Package org.apache.commons.math.util
Class ContinuedFraction
java.lang.Object
org.apache.commons.math.util.ContinuedFraction
Provides a generic means to evaluate continued fractions. Subclasses simply
provided the a and b coefficients to evaluate the continued fraction.
References:
-
Method Summary
Modifier and TypeMethodDescriptiondoubleevaluate(double x) Evaluates the continued fraction at the value x.doubleevaluate(double x, double epsilon) Evaluates the continued fraction at the value x.doubleevaluate(double x, double epsilon, int maxIterations) Evaluates the continued fraction at the value x.doubleevaluate(double x, int maxIterations) Evaluates the continued fraction at the value x.
-
Method Details
-
evaluate
Evaluates the continued fraction at the value x.- Parameters:
x- the evaluation point.- Returns:
- the value of the continued fraction evaluated at x.
- Throws:
MathException- if the algorithm fails to converge.
-
evaluate
Evaluates the continued fraction at the value x.- Parameters:
x- the evaluation point.epsilon- maximum error allowed.- Returns:
- the value of the continued fraction evaluated at x.
- Throws:
MathException- if the algorithm fails to converge.
-
evaluate
Evaluates the continued fraction at the value x.- Parameters:
x- the evaluation point.maxIterations- maximum number of convergents- Returns:
- the value of the continued fraction evaluated at x.
- Throws:
MathException- if the algorithm fails to converge.
-
evaluate
Evaluates the continued fraction at the value x.
The implementation of this method is based on equations 14-17 of:
- Eric W. Weisstein. "Continued Fraction." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/ContinuedFraction.html
- Parameters:
x- the evaluation point.epsilon- maximum error allowed.maxIterations- maximum number of convergents- Returns:
- the value of the continued fraction evaluated at x.
- Throws:
MathException- if the algorithm fails to converge.
-