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).
Metadata
Release files for radiax 0.1.1
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.1.tar.gz | 3.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| radiax-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.3 kB
Release files / radiax-0.1.1.tar.gz
| Download URL | radiax-0.1.1.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aaf9b68ab176985da7f7d86b77afdd008f6bd40ac49a074505b2007f0729bc31
|
|
BLAKE2b-256 checksum How to use checksums |
e836560d62595f5d5bc6aa9f3a92ce06ace354ac368b99ae02493486ec49883d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","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.1-py3-none-any.whl
| Download URL | radiax-0.1.1-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eae62a02a78f8b308593b6dc31d613030e7f587e860ce6318f9be4e207483ee0
|
|
BLAKE2b-256 checksum How to use checksums |
c41a79659da3a0da1d454175d670270579a61a40b740945580fc8334d71f2eaa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","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}
|