1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -150492446.473063856 \lor \neg \left(y \le 533944797.16773558\right):\\
\;\;\;\;1 - \log \left(1 \cdot \left(\frac{x}{{y}^{2}} - \frac{1}{y}\right) + \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 - \left(x - y\right) \cdot \frac{1}{1 - y}\right)\\
\end{array}double f(double x, double y) {
double r378547 = 1.0;
double r378548 = x;
double r378549 = y;
double r378550 = r378548 - r378549;
double r378551 = r378547 - r378549;
double r378552 = r378550 / r378551;
double r378553 = r378547 - r378552;
double r378554 = log(r378553);
double r378555 = r378547 - r378554;
return r378555;
}
double f(double x, double y) {
double r378556 = y;
double r378557 = -150492446.47306386;
bool r378558 = r378556 <= r378557;
double r378559 = 533944797.1677356;
bool r378560 = r378556 <= r378559;
double r378561 = !r378560;
bool r378562 = r378558 || r378561;
double r378563 = 1.0;
double r378564 = x;
double r378565 = 2.0;
double r378566 = pow(r378556, r378565);
double r378567 = r378564 / r378566;
double r378568 = 1.0;
double r378569 = r378568 / r378556;
double r378570 = r378567 - r378569;
double r378571 = r378563 * r378570;
double r378572 = r378564 / r378556;
double r378573 = r378571 + r378572;
double r378574 = log(r378573);
double r378575 = r378563 - r378574;
double r378576 = r378564 - r378556;
double r378577 = r378563 - r378556;
double r378578 = r378568 / r378577;
double r378579 = r378576 * r378578;
double r378580 = r378563 - r378579;
double r378581 = log(r378580);
double r378582 = r378563 - r378581;
double r378583 = r378562 ? r378575 : r378582;
return r378583;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.3 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -150492446.47306386 or 533944797.1677356 < y Initial program 47.4
Taylor expanded around inf 0.1
Simplified0.1
if -150492446.47306386 < y < 533944797.1677356Initial program 0.1
rmApplied div-inv0.1
Final simplification0.1
herbie shell --seed 2020083
(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))))))