1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1 - y} \le 0.0893607720034448744:\\
\;\;\;\;1 - \log \left(1 - \frac{1}{\sqrt[3]{1 - y} \cdot \sqrt[3]{1 - y}} \cdot \frac{x - y}{\sqrt[3]{1 - y}}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\left(\frac{x}{y} + 1 \cdot \frac{x}{{y}^{2}}\right) - 1 \cdot \frac{1}{y}\right)\\
\end{array}double f(double x, double y) {
double r510003 = 1.0;
double r510004 = x;
double r510005 = y;
double r510006 = r510004 - r510005;
double r510007 = r510003 - r510005;
double r510008 = r510006 / r510007;
double r510009 = r510003 - r510008;
double r510010 = log(r510009);
double r510011 = r510003 - r510010;
return r510011;
}
double f(double x, double y) {
double r510012 = x;
double r510013 = y;
double r510014 = r510012 - r510013;
double r510015 = 1.0;
double r510016 = r510015 - r510013;
double r510017 = r510014 / r510016;
double r510018 = 0.08936077200344487;
bool r510019 = r510017 <= r510018;
double r510020 = 1.0;
double r510021 = cbrt(r510016);
double r510022 = r510021 * r510021;
double r510023 = r510020 / r510022;
double r510024 = r510014 / r510021;
double r510025 = r510023 * r510024;
double r510026 = r510015 - r510025;
double r510027 = log(r510026);
double r510028 = r510015 - r510027;
double r510029 = r510012 / r510013;
double r510030 = 2.0;
double r510031 = pow(r510013, r510030);
double r510032 = r510012 / r510031;
double r510033 = r510015 * r510032;
double r510034 = r510029 + r510033;
double r510035 = r510020 / r510013;
double r510036 = r510015 * r510035;
double r510037 = r510034 - r510036;
double r510038 = log(r510037);
double r510039 = r510015 - r510038;
double r510040 = r510019 ? r510028 : r510039;
return r510040;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.5 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if (/ (- x y) (- 1.0 y)) < 0.08936077200344487Initial program 0.0
rmApplied add-cube-cbrt0.0
Applied *-un-lft-identity0.0
Applied times-frac0.0
if 0.08936077200344487 < (/ (- x y) (- 1.0 y)) Initial program 61.2
rmApplied flip3--61.2
Simplified61.2
Taylor expanded around inf 0.8
Final simplification0.2
herbie shell --seed 2020089
(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))))))