Improve explanatory comments.

This commit is contained in:
Jürg Lehni 2011-06-06 11:44:15 +01:00
parent 046f9cef6e
commit d5e7ca9f5e

View file

@ -83,6 +83,8 @@ var Numerical = new function() {
for (var i = 0; i < n; i++) {
var fx = f(x),
dx = fx / df(x);
// See if we can trust the Newton-Raphson result. If not we use
// bisection to find another candiate for Newton's method.
if (Math.abs(dx) < tol)
return x;
// Generate a candidate for Newton's method.