MCPcopy Index your code
hub / github.com/python/cpython / f_inv

Function f_inv

Lib/statistics.py:876–881  ·  view source on GitHub ↗

Return x such that f(x) ≈ y within the specified tolerance.

(y)

Source from the content-addressed store, hash-verified

874
875def _newton_raphson(f_inv_estimate, f, f_prime, tolerance=1e-12):
876 def f_inv(y):
877 "Return x such that f(x) ≈ y within the specified tolerance."
878 x = f_inv_estimate(y)
879 while abs(diff := f(x) - y) > tolerance:
880 x -= diff / f_prime(x)
881 return x
882 return f_inv
883
884def _quartic_invcdf_estimate(p):

Callers

nothing calls this directly

Calls 2

absFunction · 0.85
fFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…