Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Lib/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,9 +870,12 @@ def f_inv(y):
return f_inv

def _quartic_invcdf_estimate(p):
# A handrolled piecewise approximation. There is no magic here.
sign, p = (1.0, p) if p <= 1/2 else (-1.0, 1.0 - p)
if p < 0.0106:
return ((2.0 * p) ** 0.3838 - 1.0) * sign
x = (2.0 * p) ** 0.4258865685331 - 1.0
if p >= 0.004 < 0.499:
if p < 0.499:
x += 0.026818732 * sin(7.101753784 * p + 2.73230839482953)
return x * sign

Expand Down
Loading