Skip to content

Commit d3d98f2

Browse files
authored
Update gausslegendre.h
1 parent 78d523c commit d3d98f2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gausslegendre.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ class LegendrePolynomial {
3636
double root = cos(M_PI * (step-0.25)/(mNumberOfIterations+0.5));
3737
Result result = calculatePolynomialValueAndDerivative(root);
3838

39-
double ratio;
39+
double newtonRaphsonRatio;
4040
do {
41-
ratio = result.value/result.derivative;
42-
root -= ratio;
41+
newtonRaphsonRatio = result.value/result.derivative;
42+
root -= newtonRaphsonRatio;
4343
result = calculatePolynomialValueAndDerivative(root);
4444
} while (fabs(ratio) > EPSILON);
4545

@@ -89,4 +89,4 @@ double gaussLegendreIntegral(double a, double b, int n, const std::function<doub
8989
return gaussLegendre * width;
9090
}
9191

92-
#endif
92+
#endif

0 commit comments

Comments
 (0)