(p)
| 882 | return f_inv |
| 883 | |
| 884 | def _quartic_invcdf_estimate(p): |
| 885 | # A handrolled piecewise approximation. There is no magic here. |
| 886 | sign, p = (1.0, p) if p <= 1/2 else (-1.0, 1.0 - p) |
| 887 | if p < 0.0106: |
| 888 | return ((2.0 * p) ** 0.3838 - 1.0) * sign |
| 889 | x = (2.0 * p) ** 0.4258865685331 - 1.0 |
| 890 | if p < 0.499: |
| 891 | x += 0.026818732 * sin(7.101753784 * p + 2.73230839482953) |
| 892 | return x * sign |
| 893 | |
| 894 | @register('quartic', 'biweight') |
| 895 | def quartic_kernel(): |