1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1 - y} \le 0.99999975065411717:\\
\;\;\;\;1 - \log \left(1 - \left(\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}\right) \cdot \frac{\sqrt[3]{x - y}}{1 - y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 \cdot \left(\frac{x}{{y}^{2}} - \frac{1}{y}\right) + \frac{x}{y}\right)\\
\end{array}double f(double x, double y) {
double r398646 = 1.0;
double r398647 = x;
double r398648 = y;
double r398649 = r398647 - r398648;
double r398650 = r398646 - r398648;
double r398651 = r398649 / r398650;
double r398652 = r398646 - r398651;
double r398653 = log(r398652);
double r398654 = r398646 - r398653;
return r398654;
}
double f(double x, double y) {
double r398655 = x;
double r398656 = y;
double r398657 = r398655 - r398656;
double r398658 = 1.0;
double r398659 = r398658 - r398656;
double r398660 = r398657 / r398659;
double r398661 = 0.9999997506541172;
bool r398662 = r398660 <= r398661;
double r398663 = cbrt(r398657);
double r398664 = r398663 * r398663;
double r398665 = r398663 / r398659;
double r398666 = r398664 * r398665;
double r398667 = r398658 - r398666;
double r398668 = log(r398667);
double r398669 = r398658 - r398668;
double r398670 = 2.0;
double r398671 = pow(r398656, r398670);
double r398672 = r398655 / r398671;
double r398673 = 1.0;
double r398674 = r398673 / r398656;
double r398675 = r398672 - r398674;
double r398676 = r398658 * r398675;
double r398677 = r398655 / r398656;
double r398678 = r398676 + r398677;
double r398679 = log(r398678);
double r398680 = r398658 - r398679;
double r398681 = r398662 ? r398669 : r398680;
return r398681;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.0 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if (/ (- x y) (- 1.0 y)) < 0.9999997506541172Initial program 0.1
rmApplied *-un-lft-identity0.1
Applied add-cube-cbrt0.1
Applied times-frac0.1
Simplified0.1
if 0.9999997506541172 < (/ (- x y) (- 1.0 y)) Initial program 62.3
Taylor expanded around inf 0.3
Simplified0.3
Final simplification0.2
herbie shell --seed 2020064
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, B"
:precision binary64
:herbie-target
(if (< y -81284752.61947241) (- 1 (log (- (/ x (* y y)) (- (/ 1 y) (/ x y))))) (if (< y 3.0094271212461764e+25) (log (/ (exp 1) (- 1 (/ (- x y) (- 1 y))))) (- 1 (log (- (/ x (* y y)) (- (/ 1 y) (/ x y)))))))
(- 1 (log (- 1 (/ (- x y) (- 1 y))))))