Chaos without rounding error
A chaotic map doubles every rounding error at each step, so after about fifty steps a floating-point orbit has no correct digit left and nothing warns you. Here an orbit is the true one, exactly or inside an interval, periodic points are algebraic numbers, and the parameters at which cycles are born or double are proven.
What is here
A first program
import { logistic, lyapunov, bifurcationPoint, itinerary } from "@ratmath/chaos";
const f = logistic(4); // x → 4x(1 − x)
f.orbit("1/3", 3); // 1/3, 8/9, 32/81, 6272/6561: the true orbit
f.compare("1/10", 80).parted; // 52: the step where doubles have no digit right
f.periodicPoints(2).map((p) => p.text); // ["(5 − √5)/8", "(5 + √5)/8"]
lyapunov(f, "1/10", { steps: 300 }).value; // an interval, along the true orbit
bifurcationPoint(logistic(), { parameter: "r", period: 2, near: [3.44, 0.44] }).parameter; // 1 + √6, proven
itinerary(f, "1/10", 12); // "LLRLRRRLLRLR"
Three kinds of answer
Exact. The orbit of a rational point under a polynomial map is a list of rationals, and it is the true orbit. A periodic point of a polynomial map is a root of , an algebraic number, kept with its minimal polynomial.
Certified. An interval with rational ends, proven to contain the true value: a long orbit (exact rationals grow too fast to keep), a multiplier, a Lyapunov exponent along a true orbit, the parameter of a bifurcation. Ask for more digits and the interval narrows.
Estimated. A bifurcation diagram is a picture made from finitely many floating-point iterates, and its result says kind: "estimated". So does anything stated about a limit that was only observed, such as the ratios that approach Feigenbaum's constant.
Numbers in
Starting points and parameters are exact: a whole number, a fraction "1/3" or a decimal string "3.2", which means 16/5. A JavaScript number that is not whole is refused, because 0.1 is not one tenth and the point of the library is that the orbit you get is the orbit of the number you typed.
Fractals, automata and honest pixels
The same three kinds of answer carry over to pictures. An iterated function system with rational maps has exact stages and a dimension that is exact or certified; the chaos game that draws it is an estimate and says so. Whether a fraction lies in a Cantor set is decided exactly. L-systems count their symbols by matrix powers and draw at multiples of 30° in exact coordinates, and cellular automata are exact by nature. In a Mandelbrot or Julia picture or a picture of Newton basins, every pixel is proved outside, proved inside, or left undecided.
The plane and flows
In two dimensions and for differential equations the exact answers mostly run out, and proof takes over. Periodic points of the Hénon map are each proven to exist, alone in a small box, with a list that is proven complete; where a coordinate can be eliminated they are algebraic numbers again. The cat map and the horseshoe are exact throughout. A flow is solved inside boxes that are proven to hold the true solution, which is enough to prove that a periodic orbit of the Lorenz system exists, with its period and multipliers, and to find and classify every equilibrium in a region and the parameters where they change. The numbers under these proofs are doubles rounded outward, so they are fast; the statements are still theorems.
Pictures of all of this are in @ratmath/graphics. The RatMath Shelf page lists what exists across all the libraries.
@ratmath/chaos and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.