1.0 - \log \left(1.0 - \frac{x - y}{1.0 - y}\right)\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1.0 - y} \le 0.9998974867815034:\\
\;\;\;\;1.0 - \log \left(1.0 - \frac{\frac{x - y}{\sqrt[3]{1.0 - y} \cdot \sqrt[3]{1.0 - y}}}{\sqrt[3]{1.0 - y}}\right)\\
\mathbf{else}:\\
\;\;\;\;1.0 - \log \left(\left(\frac{x}{y} \cdot \frac{1.0}{y} + \frac{x}{y}\right) - \frac{1.0}{y}\right)\\
\end{array}double f(double x, double y) {
double r20830754 = 1.0;
double r20830755 = x;
double r20830756 = y;
double r20830757 = r20830755 - r20830756;
double r20830758 = r20830754 - r20830756;
double r20830759 = r20830757 / r20830758;
double r20830760 = r20830754 - r20830759;
double r20830761 = log(r20830760);
double r20830762 = r20830754 - r20830761;
return r20830762;
}
double f(double x, double y) {
double r20830763 = x;
double r20830764 = y;
double r20830765 = r20830763 - r20830764;
double r20830766 = 1.0;
double r20830767 = r20830766 - r20830764;
double r20830768 = r20830765 / r20830767;
double r20830769 = 0.9998974867815034;
bool r20830770 = r20830768 <= r20830769;
double r20830771 = cbrt(r20830767);
double r20830772 = r20830771 * r20830771;
double r20830773 = r20830765 / r20830772;
double r20830774 = r20830773 / r20830771;
double r20830775 = r20830766 - r20830774;
double r20830776 = log(r20830775);
double r20830777 = r20830766 - r20830776;
double r20830778 = r20830763 / r20830764;
double r20830779 = r20830766 / r20830764;
double r20830780 = r20830778 * r20830779;
double r20830781 = r20830780 + r20830778;
double r20830782 = r20830781 - r20830779;
double r20830783 = log(r20830782);
double r20830784 = r20830766 - r20830783;
double r20830785 = r20830770 ? r20830777 : r20830784;
return r20830785;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.2 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if (/ (- x y) (- 1.0 y)) < 0.9998974867815034Initial program 0.1
rmApplied add-cube-cbrt0.1
Applied associate-/r*0.1
if 0.9998974867815034 < (/ (- x y) (- 1.0 y)) Initial program 60.0
Taylor expanded around inf 0.4
Simplified0.4
Final simplification0.2
herbie shell --seed 2019165
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, B"
:herbie-target
(if (< y -81284752.61947241) (- 1.0 (log (- (/ x (* y y)) (- (/ 1.0 y) (/ x y))))) (if (< y 3.0094271212461764e+25) (log (/ (exp 1.0) (- 1.0 (/ (- x y) (- 1.0 y))))) (- 1.0 (log (- (/ x (* y y)) (- (/ 1.0 y) (/ x y)))))))
(- 1.0 (log (- 1.0 (/ (- x y) (- 1.0 y))))))