avoid recomputation. f_a/g_a has already been computed and we can use it directly. Change-Id: I39b07205c7d2486e88076089fa960f116919f27f
diff --git a/include/ceres/jet.h b/include/ceres/jet.h index f6fe4ad..082bcc3 100644 --- a/include/ceres/jet.h +++ b/include/ceres/jet.h
@@ -391,7 +391,7 @@ // which holds because v*v = 0. const T g_a_inverse = T(1.0) / g.a; const T f_a_by_g_a = f.a * g_a_inverse; - return Jet<T, N>(f.a * g_a_inverse, (f.v - f_a_by_g_a * g.v) * g_a_inverse); + return Jet<T, N>(f_a_by_g_a, (f.v - f_a_by_g_a * g.v) * g_a_inverse); } // Binary / with a scalar: s / x