WOLFRAM

Copy to clipboard.
FixedPoint[f,expr]

starts with expr, then applies f repeatedly until the result no longer changes.

Copy to clipboard.
FixedPoint[f,expr,n]

stops after at most n steps.

Details and Options

  • 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.

Examples

open allclose all

Basic Examples  (3)Summary of the most common use cases

Find a value such that :

Out[1]=1
Out[2]=2

Fixed point of an integer-valued function:

Out[1]=1
Out[2]=2

Repeated application of a rule until the result no longer changes:

Out[1]=1
Out[2]=2

Scope  (2)Survey of the scope of standard use cases

Numerical fixed point of a function:

Out[1]=1

Fixed point of a repeated transformation:

Out[1]=1

Generalizations & Extensions  (1)Generalized and extended use cases

Stop after at most 10 steps:

Out[1]=1
Out[2]=2

Options  (2)Common values & functionality for each option

SameTest  (2)

Stop as soon as successive iterations differ by less than :

Out[1]=1
Out[2]=2

Perform exact arithmetic, but use a numerical comparison function:

Out[1]=1

Applications  (8)Sample problems that can be solved with this function

Find using Newton's method:

Out[1]=1

Fixed point of a complex iteration:

Out[1]=1

Matrix-multiplication convergence:

Root of the current directory tree (the result will depend on computer system):

Out[1]=1

Repeated differentiation:

Out[1]=1

Find the minimum of with the steepest-descent method (vector notation):

Out[1]=1

Component notation:

Out[2]=2

Evaluate combinators [more info]:

Out[1]=1

Connected components in a graph:

Out[2]=2

Properties & Relations  (3)Properties of the function, and connections to other functions

FixedPoint gives the last element of FixedPointList:

Out[1]=1
Out[2]=2

Apply rules repeatedly until the result no longer changes using ReplaceRepeated (//.):

Out[1]=1
Out[2]=2
Out[3]=3

FixedPoint is equivalent to a particular choice of arguments of NestWhile:

Out[1]=1

Possible Issues  (2)Common pitfalls and unexpected behavior

Calculations may not converge in a finite number of steps:

Out[1]=1

Providing a maximum number of iterations will guarantee termination:

Out[2]=2

Using a numerical test for convergence works in this case as well:

Out[3]=3

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:

Out[1]=1
Wolfram Research (1988), FixedPoint, Wolfram Language function, https://reference.wolfram.com/language/ref/FixedPoint.html (updated 1996).
Copy to clipboard.
Wolfram Research (1988), FixedPoint, Wolfram Language function, https://reference.wolfram.com/language/ref/FixedPoint.html (updated 1996).

Text

Wolfram Research (1988), FixedPoint, Wolfram Language function, https://reference.wolfram.com/language/ref/FixedPoint.html (updated 1996).

Copy to clipboard.
Wolfram Research (1988), FixedPoint, Wolfram Language function, https://reference.wolfram.com/language/ref/FixedPoint.html (updated 1996).

CMS

Wolfram Language. 1988. "FixedPoint." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996. https://reference.wolfram.com/language/ref/FixedPoint.html.

Copy to clipboard.
Wolfram Language. 1988. "FixedPoint." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996. https://reference.wolfram.com/language/ref/FixedPoint.html.

APA

Wolfram Language. (1988). FixedPoint. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FixedPoint.html

Copy to clipboard.
Wolfram Language. (1988). FixedPoint. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FixedPoint.html

BibTeX

@misc{reference.wolfram_2024_fixedpoint, author="Wolfram Research", title="{FixedPoint}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/FixedPoint.html}", note=[Accessed: 07-January-2025 ]}

Copy to clipboard.
@misc{reference.wolfram_2024_fixedpoint, author="Wolfram Research", title="{FixedPoint}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/FixedPoint.html}", note=[Accessed: 07-January-2025 ]}

BibLaTeX

@online{reference.wolfram_2024_fixedpoint, organization={Wolfram Research}, title={FixedPoint}, year={1996}, url={https://reference.wolfram.com/language/ref/FixedPoint.html}, note=[Accessed: 07-January-2025 ]}

Copy to clipboard.
@online{reference.wolfram_2024_fixedpoint, organization={Wolfram Research}, title={FixedPoint}, year={1996}, url={https://reference.wolfram.com/language/ref/FixedPoint.html}, note=[Accessed: 07-January-2025 ]}