1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;x \leq -6.305417564235616 \cdot 10^{-122} \lor \neg \left(x \leq 0.006781316404929303\right):\\
\;\;\;\;1 - \log \left(\left(1 + \frac{y}{1 - y}\right) - \frac{x}{1 - y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 - \frac{\frac{x - y}{\sqrt[3]{\sqrt{1 - y}}}}{\sqrt[3]{1 - y} \cdot \sqrt[3]{1 - y \cdot y}} \cdot \frac{\sqrt[3]{1 + y}}{\sqrt[3]{\sqrt{1 - y}}}\right)\\
\end{array}(FPCore (x y) :precision binary64 (- 1.0 (log (- 1.0 (/ (- x y) (- 1.0 y))))))
(FPCore (x y)
:precision binary64
(if (or (<= x -6.305417564235616e-122) (not (<= x 0.006781316404929303)))
(- 1.0 (log (- (+ 1.0 (/ y (- 1.0 y))) (/ x (- 1.0 y)))))
(-
1.0
(log
(-
1.0
(*
(/
(/ (- x y) (cbrt (sqrt (- 1.0 y))))
(* (cbrt (- 1.0 y)) (cbrt (- 1.0 (* y y)))))
(/ (cbrt (+ 1.0 y)) (cbrt (sqrt (- 1.0 y))))))))))double code(double x, double y) {
return 1.0 - log(1.0 - ((x - y) / (1.0 - y)));
}
double code(double x, double y) {
double tmp;
if ((x <= -6.305417564235616e-122) || !(x <= 0.006781316404929303)) {
tmp = 1.0 - log((1.0 + (y / (1.0 - y))) - (x / (1.0 - y)));
} else {
tmp = 1.0 - log(1.0 - ((((x - y) / cbrt(sqrt(1.0 - y))) / (cbrt(1.0 - y) * cbrt(1.0 - (y * y)))) * (cbrt(1.0 + y) / cbrt(sqrt(1.0 - y)))));
}
return tmp;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.2 |
|---|---|
| Target | 0.1 |
| Herbie | 11.1 |
if x < -6.3054175642356161e-122 or 0.0067813164049293027 < x Initial program 15.9
rmApplied add-cube-cbrt_binary64_829714.7
Applied associate-/r*_binary64_820614.7
rmApplied add-cube-cbrt_binary64_829714.7
Applied cbrt-prod_binary64_829314.6
Applied add-cube-cbrt_binary64_829714.8
Applied times-frac_binary64_826814.8
Applied times-frac_binary64_826814.8
Applied cancel-sign-sub-inv_binary64_822814.8
Simplified14.8
Taylor expanded around 0 4.4
Simplified4.4
if -6.3054175642356161e-122 < x < 0.0067813164049293027Initial program 20.8
rmApplied add-cube-cbrt_binary64_829719.0
Applied associate-/r*_binary64_820619.0
rmApplied add-sqr-sqrt_binary64_828419.1
Applied cbrt-prod_binary64_829318.9
Applied flip--_binary64_823718.4
Applied cbrt-div_binary64_829418.4
Applied associate-*l/_binary64_820518.4
Applied associate-/r/_binary64_820818.5
Applied times-frac_binary64_826818.4
Applied cancel-sign-sub-inv_binary64_822818.4
Simplified18.3
Final simplification11.1
herbie shell --seed 2020344
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, B"
:precision binary64
: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))))))