)]}'
{
  "commit": "79a554ffcf33156b81f3098e4e67821da867e2d6",
  "tree": "8f026bfcb7487d4e13d8b09ca69b576dcedae707",
  "parents": [
    "f1113c08abec23462182a5a8235f8ab47277ec4d"
  ],
  "author": {
    "name": "Sameer Agarwal",
    "email": "sameeragarwal@google.com",
    "time": "Fri Jan 13 11:37:27 2023 -0800"
  },
  "committer": {
    "name": "Sameer Agarwal",
    "email": "sameeragarwal@google.com",
    "time": "Fri Jan 13 11:37:27 2023 -0800"
  },
  "message": "Fix a bug in QuaternionRotatePoint.\n\nIn https://ceres-solver-review.git.corp.google.com/c/ceres-solver/+/23802\n\nthe computation of the norm of a quaternion\n\nscale \u003d 1/sqrt(q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3]);\n\nwas replaced by\n\nscale \u003d 1/hypot(q[0], q[1], hypot(q[2], q[3]));\n\nwhile this appear to be a more accurate computation because of the\nuse of hypot which can handle over and underflow it introduces a\nbug for the case where q[2] \u003d q[3] \u003d 0.\n\nWhile the hypot(q[2], q[3]) \u003d\u003d 0 as scalars, if q[2] and q[3] are\njets, then the derivative will be NaN. Which means that even though\nq[0] or q[1] is non-zero and the norm of the quaternion is non-zero,\nand the resulting derivative is finite, this way of computing the\nscale will produce nans in the derivative of scale.\n\nThe following quaternion will replicate the problem described above.\n\nusing Jet \u003d ceres::Jet\u003cdouble, 4\u003e;\nstd::array\u003cJet, 4\u003e quaternion \u003d {Jet(1.0, 0), Jet(0.0, 1), Jet(0.0, 2), Jet(0.0, 3)};\n\nThis CL reverts the change to QuaternionRotatePoint and\nadds a test for it.\n\nThanks to Jonathan Taylor for reproducing this bug.\n\nChange-Id: I0fbbcc77d6945a38563d82efba4429f4b5278cd5\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "1220173dd4949d8127ae0201efa77354804239fb",
      "old_mode": 33188,
      "old_path": "include/ceres/rotation.h",
      "new_id": "ab1e69e6a04b1b88a3005bf9de76adc823f74c30",
      "new_mode": 33188,
      "new_path": "include/ceres/rotation.h"
    },
    {
      "type": "modify",
      "old_id": "b59c48737f229239f15117934645fbbe3e8d16cb",
      "old_mode": 33188,
      "old_path": "internal/ceres/rotation_test.cc",
      "new_id": "28a4271c450ae6b9fd204938ba123b3f96b0771f",
      "new_mode": 33188,
      "new_path": "internal/ceres/rotation_test.cc"
    }
  ]
}
