Generalized Continued Fraction Evaluator
Enter the a and b sequences to numerically evaluate the generalized continued fraction b0 + a1/(b1 + a2/(b2 + …)) with backward recurrence. See each level's partial approximation and its convergence in a table and graph.
Input
Numerically evaluate the generalized continued fraction b0 + a1/(b1 + a2/(b2 + a3/(b3 + …))) from the sequences you enter. Separate each term with a line break or comma.
Examples (tap to fill in)
Each term can be a formula (variable n is the term index: b uses n=0,1,2…, a uses n=1,2,3…). Operators: + - * / ^ (power) / functions: sin cos tan exp log ln log10 sqrt abs pow(a,b) and more / constants: pi (π), e. Evaluation runs up to where a has one fewer term than b.
Result
Continued fraction value
1.6181818182
Evaluated levels (depth)
9 levels
Term count (a / b)
9 / 10
a terms / b terms
Final convergence gap
0.000535
Absolute difference of the last two levels
Partial approximations at each level (convergence)
| Level (depth) | b | a | Partial approximation | Change from previous level |
|---|---|---|---|---|
| 0 | 1 | — | 1 | — |
| 1 | 1 | 1 | 2 | 1 |
| 2 | 1 | 1 | 1.5 | 0.5 |
| 3 | 1 | 1 | 1.6666666667 | 0.16666667 |
| 4 | 1 | 1 | 1.6 | 0.06666667 |
| 5 | 1 | 1 | 1.625 | 0.025 |
| 6 | 1 | 1 | 1.6153846154 | 0.00961538 |
| 7 | 1 | 1 | 1.619047619 | 0.003663 |
| 8 | 1 | 1 | 1.6176470588 | 0.00140056 |
| 9 | 1 | 1 | 1.6181818182 | 0.00053476 |
How it works
- Numerically evaluates the generalized continued fraction b0 + a1/(b1 + a2/(b2 + a3/…)) from the sequences you provide. Enter the b sequence (b0, b1, b2, …) and the a sequence (a1, a2, a3, …), separating terms with line breaks or commas.
- The calculation uses backward recurrence, dividing back from the innermost term outward. Evaluation runs up to where a has one fewer term than b, and the table lists the partial approximation at each level (depth).
- The change at each level (absolute difference from the previous level) shows how many levels it takes for the value to stabilize, i.e. the speed of convergence. The graph plots the partial approximations approaching the final value as a line.
- Each term can also be a formula. The term index is referenced by the variable n, with b using n=0,1,2,… and a using n=1,2,3,…. For example, you can write n^2 for a and 2*n for b.
- The presets let you instantly watch the golden ratio φ, √2, and pi π converge as continued fractions. Adding more terms improves the approximation accuracy.
- Supported functions include sin, cos, tan, exp, log, ln, log10, sqrt, abs, pow(a,b), and the constants pi (π) and e. If a division becomes zero mid-calculation, the value is undefined, so review the coefficients in that case.
Related calculators
Function Graph Plotter f(x)
NumericalType an expression such as sin(x) or x^2-2 and instantly plot its graph over a chosen x range. Maximum, minimum, zeros, and sample point values are shown alongside.
Open calculator →Graph Two Functions f(x) and g(x)
NumericalPlot two expressions f(x) and g(x) on the same axes in distinct colors, and automatically find their max, min, and intersection points.
Open calculator →Data Point f(x) Graph Plotter
NumericalJust paste your (x, y) data points to instantly draw a line-and-point chart. See the point count plus the minimum, maximum, and average of y at the same time.
Open calculator →Plot Data Points f(x), g(x)
NumericalPaste two sets of (x, y) data points and get f(x) and g(x) drawn as color-coded overlaid line graphs, with each series' point count and min/max.
Open calculator →