Brent cycle-finding algorithm

ID: brent-cycle-finding-algorithm

A constant-memory algorithm for detecting the eventual cycle in a sequence generated by repeated function evaluation. It holds a checkpoint fixed while a second pointer advances, doubling the checkpoint interval when exhausted; a second pass locates the start of the cycle.

New to topics? Read the docs here!