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 15x 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.0 running on an Intel Core i7-14700 CPU (JAX 0.11.1, Python 3.14.7, Ubuntu 24.04.4).
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file radiax-0.1.0.tar.gz.
File metadata
- Download URL: radiax-0.1.0.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0a6ea9f495aa20b34e9908c475755d78b1f9e1ad49f9307b0289744f2939934
|
|
| MD5 |
2a78e525ff258cff2bdb593a685ea6b7
|
|
| BLAKE2b-256 |
de0188c69df509f7e5e0415b6f93ff5acf8a992dd0595ec14ca54a1d8936a567
|
File details
Details for the file radiax-0.1.0-py3-none-any.whl.
File metadata
- Download URL: radiax-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12e9974e4cd8b3bb63f110173f98ae9facf6a30e8b38f7a6110fc844d524fa3e
|
|
| MD5 |
e12de762e80c3d6a3f3251ed12a07ca5
|
|
| BLAKE2b-256 |
33413fe639192959afa32d65a65e3b11fc477e289aa5136529079cb45df28332
|