← All packages

Numerics & statistics

star-interp 0.1.0

Lagrange interpolation through tabulated points

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

Apache-2.0 Released & Verified single file

Summary

Value and first derivative of the interpolating polynomial through 2 to 20 tabulated points, in barycentric form; within 7e-15 of exact rational arithmetic on 600 tables, closer to the exact value than SciPy (1.2e-14) and NumPy (7e-11) on the same tables; extrapolation refused.

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 10 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_interp-0.1.0-py3-none-any.whl

In Python: import star_interp

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_interp_0_1_0,
  author  = {Cavazzini, Andrea},
  title   = {{star-interp}: Lagrange interpolation through tabulated points},
  version = {0.1.0},
  year    = {2026},
  url     = {https://andrea07072000.github.io/S.T.A.R.-/software/star_interp/},
  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-interp @ git+https://github.com/Andrea07072000/S.T.A.R.-.git@dc09f61dcee098d518f070d6a23a8815defc1109#subdirectory=packages/star_interp"

README · tests · evidence (GitHub)

Technical sheet

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

Requirements

  • R1 lagrange(xs, ys, x): the polynomial of degree len(xs) − 1 through the points, in barycentric form; nodes in any order and any spacing; at a node the tabulated value is returned exactly. Reproduces Meeus Example 3.a.
  • R2 lagrange_derivative(xs, ys, x): its first derivative, also at the nodes; lagrange_weights(xs): the weights.
  • R3 Measured on 600 tables of 2 to 11 jittered, unsorted nodes against EXACT rational arithmetic (SymPy): value within 7e-15 of the exact polynomial, relative to the largest tabulated value; derivative within 1e-13 (scaled). On the same tables SciPy's barycentric interpolator is within 1.2e-14 of the exact value and a NumPy polynomial fit within 7e-11.
  • R4 Every function returns a finite float or raises ValueError: fewer than 2 or more than 20 points, lengths that differ, equal nodes, any non-finite or non-numeric element (booleans included), an x outside the range of the nodes (extrapolation is refused), nodes whose weights overflow.

Limits (what is not claimed)

The accuracy stated is that of evaluating the polynomial, NOT of the interpolation: how well a polynomial through n points represents an orbit depends on the spacing, the degree and where in the table x falls (the central interval is the reliable one), and is the caller's to assess. No extrapolation, no Hermite interpolation (positions with velocities), no splines, scalars only (interpolate each coordinate separately). With many points far from equally spaced the polynomial itself oscillates; that is a property of the method, not checked here.

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_interp.py 0.944 (2026-10-06)
Independent implementations written by others (needs 2)
numpy.polynomial.Polynomial.fit, scipy.interpolate.BarycentricInterpolator, SymPy exact rational interpolation
Also compared with, not counted
published values: Meeus, Astronomical Algorithms, Example 3.a
Result
Released & Verified

Evidence in the registry

CheckStatusRecordedWhat was observed
Unit testsVERIFIED2026-10-0610 passed in 0.32s
ReviewVERIFIED2026-10-06Requirements, interface, units, data provenance, dependency surface and failure behaviour reviewed
ReviewVERIFIED2026-10-06Re-running the cross-check gives a byte-identical evidence file
Reference valueVERIFIED2026-10-060.8761253: within 3e-7 of the printed value (printed to 1e-6) (suite: 10 passed in 0.32s)
Cross-check with independent librariesVERIFIED2026-10-06star_interp evaluates the interpolating polynomial and its derivative to the accuracy double precision allows, as measured against exact arithmetic
BenchmarkVERIFIED2026-10-06error against exact arithmetic: star_interp 6.6e-15, SciPy 1.1e-14, NumPy 6.6e-11
Clean install from the release tagVERIFIED2026-10-06pytest outside the tree: 10 passed in 0.09s

Fingerprints (SHA-256)

star_interp-0.1.0-py3-none-any.whld22a442ef7847297ec6fec1ee55462e9bb5cb72de73dcbab7a2fc68a08142e51
star_interp.py11c6ad197ef4621720a7ce1ed8c0464b407f6b9fedcdae92ec7c361063a96e7c
star_interp-0.1.0-source.zip6b4beef182e8b83cc46b154fcfbf6ab431c4457f569715e2f1ec99610c319258

results