v0.4.0
Fourth release. Headline feature: the new curve_fit tool, plus complex and vector numeric modes and a large batch of new functions.
New tool
curve_fit— fit a library of 12 curve forms to paired(x, y)data and rank the best three by residual error: linear, quadratic, cubic, power, exponential, logarithmic, square-root, reciprocal, sinusoidal, gaussian, saturation (Michaelis-Menten), and hyperbolic. Closed-form least-squares wherever possible (normal equations, log/reciprocal linearisations, Caruana's method); the sinusoid uses an iterative frequency search. The whole fit runs in the chosen numeric type, so parameters and error carry the usual exact/inexact verdict.
New numeric modes
- Complex mode over two fixed-point parts.
- Vector type with
[a, b, …]literals, and functions that reduce over a vector:min/max, the descriptive stats,covariance/correlation,gcd/lcm,percentile/quantile, andfactor(prime factorisation).
Solver
- Bisection and Ridders' root finders (sign-change bracketers).
- Auto-detect the single unknown when
variableis omitted;min_fixed_point_precisiondefaults to 9 so the bare fixed-point solve just works.
New functions
hypot,comb/perm,clamp,lerp,sign, two-arg range foldssum(i, lo, hi, expr)/product(i, lo, hi, expr), and the financial helperspct/pct_change/bps/compoundandpmt/fv/pv.
Fixes & ergonomics
- "Did you mean…" suggestions on an unknown function/mode/algorithm.
- Lifted CPython's 4300-digit int↔str cap so large exact results (big factorials, exact rational fits) render instead of crashing.