1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;1 - \frac{x - y}{1 - y} \le 2.61378141 \cdot 10^{-10}:\\
\;\;\;\;1 - \log \left(\mathsf{fma}\left(1, \frac{x}{{y}^{2}} - \frac{1}{y}, \frac{x}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 - \left(\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}\right) \cdot \frac{\sqrt[3]{x - y}}{1 - y}\right)\\
\end{array}double f(double x, double y) {
double r383529 = 1.0;
double r383530 = x;
double r383531 = y;
double r383532 = r383530 - r383531;
double r383533 = r383529 - r383531;
double r383534 = r383532 / r383533;
double r383535 = r383529 - r383534;
double r383536 = log(r383535);
double r383537 = r383529 - r383536;
return r383537;
}
double f(double x, double y) {
double r383538 = 1.0;
double r383539 = x;
double r383540 = y;
double r383541 = r383539 - r383540;
double r383542 = r383538 - r383540;
double r383543 = r383541 / r383542;
double r383544 = r383538 - r383543;
double r383545 = 2.6137814135296367e-10;
bool r383546 = r383544 <= r383545;
double r383547 = 2.0;
double r383548 = pow(r383540, r383547);
double r383549 = r383539 / r383548;
double r383550 = 1.0;
double r383551 = r383550 / r383540;
double r383552 = r383549 - r383551;
double r383553 = r383539 / r383540;
double r383554 = fma(r383538, r383552, r383553);
double r383555 = log(r383554);
double r383556 = r383538 - r383555;
double r383557 = cbrt(r383541);
double r383558 = r383557 * r383557;
double r383559 = r383557 / r383542;
double r383560 = r383558 * r383559;
double r383561 = r383538 - r383560;
double r383562 = log(r383561);
double r383563 = r383538 - r383562;
double r383564 = r383546 ? r383556 : r383563;
return r383564;
}




Bits error versus x




Bits error versus y
| Original | 18.3 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if (- 1.0 (/ (- x y) (- 1.0 y))) < 2.6137814135296367e-10Initial program 63.4
Taylor expanded around inf 0.1
Simplified0.1
if 2.6137814135296367e-10 < (- 1.0 (/ (- x y) (- 1.0 y))) Initial program 0.2
rmApplied *-un-lft-identity0.2
Applied add-cube-cbrt0.2
Applied times-frac0.3
Simplified0.3
Final simplification0.2
herbie shell --seed 2020035 +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))))))