1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -119577009.99898484 \lor \neg \left(y \le 24790650.313024804\right):\\
\;\;\;\;\log \left(\frac{e^{1}}{1 \cdot \left(\frac{x}{{y}^{2}} - \frac{1}{y}\right) + \frac{x}{y}}\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(\frac{1}{\sqrt{1 - \left(x - y\right) \cdot \frac{1}{1 - y}}}\right) + \log \left(\frac{e^{1}}{\sqrt{1 - \left(x - y\right) \cdot \frac{1}{1 - y}}}\right)\\
\end{array}double f(double x, double y) {
double r209447 = 1.0;
double r209448 = x;
double r209449 = y;
double r209450 = r209448 - r209449;
double r209451 = r209447 - r209449;
double r209452 = r209450 / r209451;
double r209453 = r209447 - r209452;
double r209454 = log(r209453);
double r209455 = r209447 - r209454;
return r209455;
}
double f(double x, double y) {
double r209456 = y;
double r209457 = -119577009.99898484;
bool r209458 = r209456 <= r209457;
double r209459 = 24790650.313024804;
bool r209460 = r209456 <= r209459;
double r209461 = !r209460;
bool r209462 = r209458 || r209461;
double r209463 = 1.0;
double r209464 = exp(r209463);
double r209465 = x;
double r209466 = 2.0;
double r209467 = pow(r209456, r209466);
double r209468 = r209465 / r209467;
double r209469 = 1.0;
double r209470 = r209469 / r209456;
double r209471 = r209468 - r209470;
double r209472 = r209463 * r209471;
double r209473 = r209465 / r209456;
double r209474 = r209472 + r209473;
double r209475 = r209464 / r209474;
double r209476 = log(r209475);
double r209477 = r209465 - r209456;
double r209478 = r209463 - r209456;
double r209479 = r209469 / r209478;
double r209480 = r209477 * r209479;
double r209481 = r209463 - r209480;
double r209482 = sqrt(r209481);
double r209483 = r209469 / r209482;
double r209484 = log(r209483);
double r209485 = r209464 / r209482;
double r209486 = log(r209485);
double r209487 = r209484 + r209486;
double r209488 = r209462 ? r209476 : r209487;
return r209488;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.5 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -119577009.99898484 or 24790650.313024804 < y Initial program 46.9
rmApplied div-inv45.8
rmApplied add-log-exp45.8
Applied diff-log45.8
Taylor expanded around inf 0.2
Simplified0.2
if -119577009.99898484 < y < 24790650.313024804Initial program 0.1
rmApplied div-inv0.1
rmApplied add-log-exp0.1
Applied diff-log0.1
rmApplied add-sqr-sqrt0.1
Applied *-un-lft-identity0.1
Applied times-frac0.1
Applied log-prod0.1
Final simplification0.1
herbie shell --seed 2020046
(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))))))