1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -954400778077.866821 \lor \neg \left(y \le 0.99315470732115574\right):\\
\;\;\;\;1 - \log \left(\mathsf{fma}\left(1, \frac{x}{{y}^{2}} - \frac{1}{y}, \frac{x}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\mathsf{fma}\left(1, 1, -\frac{\sqrt[3]{1 + y}}{\sqrt{\sqrt[3]{1 - y}}} \cdot \frac{\frac{x - y}{\sqrt[3]{1 \cdot 1 - y \cdot y} \cdot \sqrt[3]{1 - y}}}{\sqrt{\sqrt[3]{1 - y}}}\right) + \mathsf{fma}\left(-\frac{\sqrt[3]{1 + y}}{\sqrt{\sqrt[3]{1 - y}}}, \frac{\frac{x - y}{\sqrt[3]{1 \cdot 1 - y \cdot y} \cdot \sqrt[3]{1 - y}}}{\sqrt{\sqrt[3]{1 - y}}}, \frac{\sqrt[3]{1 + y}}{\sqrt{\sqrt[3]{1 - y}}} \cdot \frac{\frac{x - y}{\sqrt[3]{1 \cdot 1 - y \cdot y} \cdot \sqrt[3]{1 - y}}}{\sqrt{\sqrt[3]{1 - y}}}\right)\right)\\
\end{array}double code(double x, double y) {
return (1.0 - log((1.0 - ((x - y) / (1.0 - y)))));
}
double code(double x, double y) {
double VAR;
if (((y <= -954400778077.8668) || !(y <= 0.9931547073211557))) {
VAR = (1.0 - log(fma(1.0, ((x / pow(y, 2.0)) - (1.0 / y)), (x / y))));
} else {
VAR = (1.0 - log((fma(1.0, 1.0, -((cbrt((1.0 + y)) / sqrt(cbrt((1.0 - y)))) * (((x - y) / (cbrt(((1.0 * 1.0) - (y * y))) * cbrt((1.0 - y)))) / sqrt(cbrt((1.0 - y)))))) + fma(-(cbrt((1.0 + y)) / sqrt(cbrt((1.0 - y)))), (((x - y) / (cbrt(((1.0 * 1.0) - (y * y))) * cbrt((1.0 - y)))) / sqrt(cbrt((1.0 - y)))), ((cbrt((1.0 + y)) / sqrt(cbrt((1.0 - y)))) * (((x - y) / (cbrt(((1.0 * 1.0) - (y * y))) * cbrt((1.0 - y)))) / sqrt(cbrt((1.0 - y)))))))));
}
return VAR;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.0 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if y < -954400778077.8668 or 0.9931547073211557 < y Initial program 47.0
Taylor expanded around inf 0.1
Simplified0.1
if -954400778077.8668 < y < 0.9931547073211557Initial program 0.2
rmApplied add-cube-cbrt0.3
Applied associate-/r*0.3
rmApplied add-sqr-sqrt0.3
Applied flip--0.3
Applied cbrt-div0.2
Applied associate-*r/0.2
Applied associate-/r/0.2
Applied times-frac0.2
Applied add-sqr-sqrt0.2
Applied prod-diff0.2
Simplified0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020079 +o rules:numerics
(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))))))