Analytic polynomial roots within JAX
JIT-compatible fully analytic variant of jax.numpy.roots for small-degree polynomials
Overview
radiax.roots is a drop-in replacement for jax.numpy.roots for polynomials of up to the third degree1. It is fully analytic, with support for complex roots and coefficients. It is JIT-compatible2 and has been benchmarked to be around 20x faster than jax.numpy.roots for cubic polynomials3.
Installation
pip install radiax
Usage
import jax.numpy as jnp
from radiax import roots
# Coefficients of the polynomial: x**3 - 6*x**2 + 11*x - 6
coeffs = jnp.array([1, -6, 11, -6])
# Find the roots of the polynomial
r = roots(coeffs)
print(r)
Footnotes
1 Support for degree 4 (quartic) polynomials has not been implemented yet.
2 Just like with jax.numpy.roots, the optional keyword argument strip_zeros must be set to False for JIT-compatibility.
3 radiax 0.1.3 running on an Intel Core i7-14700 CPU (JAX 0.11.1, Python 3.14.7, Ubuntu 24.04.5).
Metadata
Release files for radiax 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| radiax-0.1.3.tar.gz | 3.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| radiax-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.3 kB
Release files / radiax-0.1.3.tar.gz
| Download URL | radiax-0.1.3.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e2be884b780a71d53632f6e686534731e6d638e629623bebb4e4cc6a7c0cf427
|
|
BLAKE2b-256 checksum How to use checksums |
41be9dd1cbbf8cf838f8fd25b009dd2051de81a8b89a1b1ebf38bbc917bbb195
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.12 {"installer":{"name":"uv","version":"0.12.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / radiax-0.1.3-py3-none-any.whl
| Download URL | radiax-0.1.3-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3bf0534a0588037bbb1dd6578f3564f6c03e8c6cc5209f7086554af759072ef2
|
|
BLAKE2b-256 checksum How to use checksums |
536300efc6b7b3c270b70ad72fe9be180c7be79bfda8fb5d46c1d229397bfb5c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.12 {"installer":{"name":"uv","version":"0.12.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|