simplifying
diff --git a/unsupported/Eigen/src/NonLinear/lmder.h b/unsupported/Eigen/src/NonLinear/lmder.h
index f134927..1b8fd9a 100644
--- a/unsupported/Eigen/src/NonLinear/lmder.h
+++ b/unsupported/Eigen/src/NonLinear/lmder.h
@@ -260,11 +260,11 @@
}
/* L230: */
}
- temp1 = ei_enorm<Scalar>(n, &wa3[1]) / fnorm;
- temp2 = ei_sqrt(par) * pnorm / fnorm;
+ temp1 = ei_abs2(ei_enorm<Scalar>(n, &wa3[1]) / fnorm);
+ temp2 = ei_abs2( ei_sqrt(par) * pnorm / fnorm);
/* Computing 2nd power */
- prered = temp1 * temp1 + temp2 * temp2 / p5;
- dirder = -(temp1 * temp1 + temp2 * temp2);
+ prered = temp1 + temp2 / p5;
+ dirder = -(temp1 + temp2);
/* compute the ratio of the actual to the predicted */
/* reduction. */
diff --git a/unsupported/Eigen/src/NonLinear/lmdif.h b/unsupported/Eigen/src/NonLinear/lmdif.h
index 3db36fc..5f06a9b 100644
--- a/unsupported/Eigen/src/NonLinear/lmdif.h
+++ b/unsupported/Eigen/src/NonLinear/lmdif.h
@@ -262,11 +262,11 @@
}
/* L230: */
}
- temp1 = ei_enorm<Scalar>(n, &wa3[1]) / fnorm;
- temp2 = ei_sqrt(par) * pnorm / fnorm;
+ temp1 = ei_abs2(ei_enorm<Scalar>(n, &wa3[1]) / fnorm);
+ temp2 = ei_abs2( ei_sqrt(par) * pnorm / fnorm);
/* Computing 2nd power */
- prered = temp1 * temp1 + temp2 * temp2 / p5;
- dirder = -(temp1 * temp1 + temp2 * temp2);
+ prered = temp1 + temp2 / p5;
+ dirder = -(temp1 + temp2);
/* compute the ratio of the actual to the predicted */
/* reduction. */
diff --git a/unsupported/Eigen/src/NonLinear/lmstr.h b/unsupported/Eigen/src/NonLinear/lmstr.h
index e18ee4c..e2dbc87 100644
--- a/unsupported/Eigen/src/NonLinear/lmstr.h
+++ b/unsupported/Eigen/src/NonLinear/lmstr.h
@@ -284,11 +284,11 @@
}
/* L270: */
}
- temp1 = ei_enorm<Scalar>(n, &wa3[1]) / fnorm;
- temp2 = ei_sqrt(par) * pnorm / fnorm;
+ temp1 = ei_abs2(ei_enorm<Scalar>(n, &wa3[1]) / fnorm);
+ temp2 = ei_abs2( ei_sqrt(par) * pnorm / fnorm);
/* Computing 2nd power */
- prered = temp1 * temp1 + temp2 * temp2 / p5;
- dirder = -(temp1 * temp1 + temp2 * temp2);
+ prered = temp1 + temp2 / p5;
+ dirder = -(temp1 + temp2);
/* compute the ratio of the actual to the predicted */
/* reduction. */