Skip to content

v0.4.0

Choose a tag to compare

@laszlopere laszlopere released this 29 Jun 21:18
· 30 commits to master since this release

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, and factor (prime factorisation).

Solver

  • Bisection and Ridders' root finders (sign-change bracketers).
  • Auto-detect the single unknown when variable is omitted; min_fixed_point_precision defaults to 9 so the bare fixed-point solve just works.

New functions

  • hypot, comb/perm, clamp, lerp, sign, two-arg range folds sum(i, lo, hi, expr) / product(i, lo, hi, expr), and the financial helpers pct/pct_change/bps/compound and pmt/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.