← All packages

Numerics & statistics

star-rootfind 0.1.0

Bracketed roots to the last float

Public state: Released & Verified. The registry label is RELEASED. What the states mean →

Apache-2.0 Released & Verified single file

Summary

Root of a real function inside a bracket by bisection over the floats (no tolerance, at most 64 evaluations after the two ends, the result within one float of the change of sign) and a scan for every change of sign over equal pieces; 600 problems in six families, Kepler's equation included, agree with mpmath at 50 digits, SciPy brentq and fluids brenth within 2.1e-15 relative.

Run in your browser

Edit the code and press Run (or Ctrl+Enter). Python runs in your browser with this package's published code. The first run downloads Python once (about 12 MB).

Runs in the browser: all 47 tests pass in the browser's Python (Pyodide 314.0.7, Python 3.14.2), measured on 20 October 2026.

Use it on your computer

No account and no GitHub needed. Download, then install with one command:

python -m pip install star_rootfind-0.1.0-py3-none-any.whl

In Python: import star_rootfind

Get started →

Cite it, and its bill of materials

For a paper, a report or a supplier file: the citation in two formats, and the software bill of materials (SBOM) in the two standard formats, with the fingerprint of the wheel.

@software{cavazzini_star_rootfind_0_1_0,
  author  = {Cavazzini, Andrea},
  title   = {{star-rootfind}: Bracketed roots to the last float},
  version = {0.1.0},
  year    = {2026},
  url     = {https://andrea07072000.github.io/S.T.A.R.-/software/star_rootfind/},
  note    = {Apache-2.0. Source: https://github.com/Andrea07072000/S.T.A.R.-, commit dc09f61d}
}

For developers

Install directly from the public repository:

python -m pip install "star-rootfind @ git+https://github.com/Andrea07072000/S.T.A.R.-.git@dc09f61dcee098d518f070d6a23a8815defc1109#subdirectory=packages/star_rootfind"

README · tests · evidence (GitHub)

Technical sheet

Package
star-rootfind
Import name
star_rootfind
Version
0.1.0
Licence
Apache-2.0
Python
>=3.9
Dependencies
none (standard library only)
Capability
star.numerics.bracketed-root
Maturity
Released & Verified (RELEASED)
Published commit
dc09f61d

Requirements

  • R1 find_root(f, a, b), a < b, with f(a) and f(b) of opposite sign (or one of them zero), returns a float of [a, b] such that f changes sign between it and a neighbouring float, or f is exactly zero there.
  • R2 The interval is halved in the number of floats it contains: f is evaluated at a, at b, and then at most 64 times, whatever the width of the bracket. find_roots(f, a, b, pieces) splits [a, b] into equal pieces and returns, sorted, one root for each piece with a change of sign and every piece edge where f is zero.
  • R3 Measured on 600 bracketed problems in six families (cube root, exponential, cosine, Kepler's equation up to e = 0.95, tanh, logarithm): the result agrees with mpmath at 50 digits, SciPy brentq and fluids brenth within 2.1e-15 relative.
  • R4 Every function returns floats or raises ValueError: f not callable, limits that are not finite numbers within 1e300 or not in increasing order, no change of sign, a value of f that is not a finite real number, an invalid number of pieces. An exception raised by f itself is not caught.

Limits (what is not claimed)

A change of sign is found, not proved to be a root: for a discontinuous function the result is the jump. The result is exact for f as computed; its distance from the true root is the rounding error of f divided by its slope, which this module cannot know (x*x − 2 on [0, 2] returns the float below sqrt(2) rounded). Roots without a change of sign (double roots) are not found, and find_roots misses two roots that fall in the same piece: it is a scan, not a guarantee of completeness. Bisection uses up to 64 evaluations where Brent's method often needs ten: this is for certainty of termination and of the last digit, not for speed. One dimension only.

Release gate

Computed by the registry from the result files, with the same function that decides RELEASED.

Mutation score, latest measure of each module (needs at least 0.850)
  • star_rootfind.py 0.939 (2026-10-07)
Independent implementations written by others (needs 2)
fluids.numerics.brenth, mpmath findroot at 50 digits, scipy.optimize.brentq
Result
Released & Verified

Evidence in the registry

CheckStatusRecordedWhat was observed
Clean install from the release tagVERIFIED2026-10-07pytest outside the tree: 47 passed in 0.68s
Unit testsVERIFIED2026-10-0747 passed in 0.88s
ReviewVERIFIED2026-10-07Requirements, interface, units, data provenance, dependency surface and failure behaviour reviewed
ReviewVERIFIED2026-10-07Re-running the cross-check gives a byte-identical evidence file
Reference valueVERIFIED2026-10-07find_root(lambda x: x**3 - 2*x - 5, 2, 3) = 2.0945514815423265 (suite: 47 passed in 0.88s)
Cross-check with independent librariesVERIFIED2026-10-07star_rootfind.find_root returns the point where the computed function changes sign, to the last float, with no tolerance and at most 64 evaluations after the two ends
BenchmarkVERIFIED2026-10-07largest relative difference from mpmath at 50 digits: 1.5e-15

Fingerprints (SHA-256)

star_rootfind-0.1.0-py3-none-any.whl943984b32d2a1212bdc68875deb8ee45504c09f1cee62e0ce864b5043a75100a
star_rootfind.py14bd52ede61ac2bc042e09e05ad72f76716eb232a3f5a276958074206fca360b
star_rootfind-0.1.0-source.zipe62f4ec68626dd00598ec0ce91d54f4caccb161a9387bbc478ee1f5cd147286d

results