Fix wrong number of iterations in False Position method.

This commit is contained in:
Jürg Lehni 2011-03-20 02:03:26 +00:00
parent 11e70c5069
commit a794816097

View file

@ -70,7 +70,6 @@ var Numerical = new function() {
var Ax = A * x[i];
sum += w[i++] * (f(B + Ax) + f(B - Ax));
}
return A * sum;
},
@ -95,7 +94,7 @@ var Numerical = new function() {
fb = f(b),
dx = b - a,
del, x;
for (var i = 0; i <= n; i++) {
for (var i = 0; i < n; i++) {
x = a + dx * fa / (fa - fb);
var fx = f(x);
if (fx < 0) {