starts with expr, then applies f repeatedly until the result no longer changes.
Details and Options
- FixedPoint[f,expr,n] stops after at most n steps.
- FixedPoint always returns the last result it gets.
- You can use Throw to exit from FixedPoint before it is finished.
- FixedPoint[f,expr] applies SameQ to successive pairs of results to determine whether a fixed point has been reached.
- FixedPoint[f,expr,…,SameTest->s] applies s to successive pairs of results.
Examplesopen allclose all
Basic Examples (3)
Find a value such that :
Fixed point of an integer-valued function:
Repeated application of a rule until the result no longer changes:
Numerical fixed point of a function:
Fixed point of a repeated transformation:
Generalizations & Extensions (1)
Stop after at most 10 steps:
Stop as soon as successive iterations differ by less than :
Perform exact arithmetic, but use a numerical comparison function:
Find using Newton's method:
Fixed point of a complex iteration:
Root of the current directory tree (the result will depend on computer system):
Find the minimum of with the steepest-descent method (vector notation):
Evaluate combinators [more info]:
Connected components in a graph:
Properties & Relations (3)
Possible Issues (2)
Calculations may not converge in a finite number of steps:
Providing a maximum number of iterations will guarantee termination:
Using a numerical test for convergence works in this case as well:
Convergence may fail in machine-precision computations due to oscillations in the final digits. Use a test function with a larger tolerance than SameQ to resolve this:
Introduced in 1988
Updated in 1996