Registry / analytics / pyroot

pyroot

JSON →
library0.3.1pypypi✓ verified 82d ago

pyroot provides advanced bracketed root-finding methods for single-variable functions. Current version 0.3.1, released under MIT license, with moderate development pace.

pip install pyroot
INSTALL
IMPORT
SIG · PYROOT
P
pyroot
analyticspythonv0.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

root_in
from pyroot import root_in
from pyroot import find_root
root_iter
from pyroot import root_iter

Demonstrates basic root-finding with default Brent method.

from pyroot import find_root f = lambda x: x**3 - x - 2 # function with root near 1.5 root = find_root(f, a=1, b=2) print(f"Root: {root}")
Debug
Known issues
gotchaFunction must bracket a root: f(a) and f(b) must have opposite signs. Otherwise ValueError is raised.
fix
Ensure f(a) * f(b) < 0 before calling find_root.
affects: all
gotchaNo method selection parameter. find_root always uses Brent's method; for other methods, instantiate them directly (e.g., BisectionMethod).
fix
Use from pyroot import BisectionMethod; method = BisectionMethod(); root = method.find_root(f, a, b)
affects: all
deprecatedThe 'root' function alias from pyroot.root is deprecated and will be removed in a future version.
fix
Use pyroot.find_root instead.
affects: >=0.3.0
Upgrade
Version history
0.3.1latest on PyPI · released Sep 10, 2024
Audit
Dependencies
numpyrequiredUsed internally for array operations
Agent activity
35 hits · last 30 days
node
34
OpenAI (training)
1
Resources
pyroot — pip install pyroot · libregistry