pisgah
Class Solve
java.lang.Object
|
+--pisgah.Solve
- public class Solve
- extends java.lang.Object
Solve - solve cdf(x)=y within the given range
Output
Zeroin returns an estimate for the root with accuracy
4*EPSILON*abs(x) + tol
Algorithm
G.Forsythe, M.Malcolm, C.Moler, Computer methods for mathematical
computations. M., Mir, 1980, p.180 of the Russian edition
The function makes use of the bissection procedure combined with
the linear or quadric inverse interpolation.
At every step program operates on three abscissae - a, b, and c.
b - the last and the best approximation to the root
a - the last but one approximation
c - the last but one or even earlier approximation than a that
1) |f(b)| <= |f(c)|
2) f(b) and f(c) have opposite signs, i.e. b and c confine
the root
At every step Zeroin selects one of the two new approximations, the
former being obtained by the bissection procedure and the latter
resulting in the interpolation (if a,b, and c are all different
the quadric interpolation is utilized, otherwise the linear one).
If the latter (i.e. obtained by the interpolation) point is
reasonable (i.e. lies within the current interval [b,c] not being
too close to the boundaries) it is accepted. The bissection result
is used in the other case. Therefore, the range of uncertainty is
ensured to be reduced at least by the factor 1.6
|
Constructor Summary |
Solve()
|
|
Method Summary |
static double |
zeroin(double ax,
double bx,
CalculatorInfo ci,
double y,
double tol)
Find a zero in the specified interval |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Solve
public Solve()
zeroin
public static double zeroin(double ax,
double bx,
CalculatorInfo ci,
double y,
double tol)
throws ZeroBracketingException
- Find a zero in the specified interval
ZeroBracketingException