1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -34474611802046.8828125 \lor \neg \left(y \le 43744445.7007110416889190673828125\right):\\
\;\;\;\;1 - \log \left(\mathsf{fma}\left(\frac{1}{y}, \frac{x}{y}, \frac{x}{y} - \frac{1}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \left(\log \left(\sqrt{\left(\left(-\frac{\mathsf{fma}\left(y, 1 + y, 1 \cdot 1\right)}{\frac{{1}^{3} - {y}^{3}}{x - y}}\right) + {\left(\sqrt[3]{1}\right)}^{3}\right) + \frac{x - y}{{1}^{3} - {y}^{3}} \cdot \left(\left(-\mathsf{fma}\left(y, 1 + y, 1 \cdot 1\right)\right) + \mathsf{fma}\left(y, 1 + y, 1 \cdot 1\right)\right)}\right) + \log \left(\sqrt{1 - \frac{x - y}{1 - y}}\right)\right)\\
\end{array}double f(double x, double y) {
double r277291 = 1.0;
double r277292 = x;
double r277293 = y;
double r277294 = r277292 - r277293;
double r277295 = r277291 - r277293;
double r277296 = r277294 / r277295;
double r277297 = r277291 - r277296;
double r277298 = log(r277297);
double r277299 = r277291 - r277298;
return r277299;
}
double f(double x, double y) {
double r277300 = y;
double r277301 = -34474611802046.883;
bool r277302 = r277300 <= r277301;
double r277303 = 43744445.70071104;
bool r277304 = r277300 <= r277303;
double r277305 = !r277304;
bool r277306 = r277302 || r277305;
double r277307 = 1.0;
double r277308 = r277307 / r277300;
double r277309 = x;
double r277310 = r277309 / r277300;
double r277311 = r277310 - r277308;
double r277312 = fma(r277308, r277310, r277311);
double r277313 = log(r277312);
double r277314 = r277307 - r277313;
double r277315 = r277307 + r277300;
double r277316 = r277307 * r277307;
double r277317 = fma(r277300, r277315, r277316);
double r277318 = 3.0;
double r277319 = pow(r277307, r277318);
double r277320 = pow(r277300, r277318);
double r277321 = r277319 - r277320;
double r277322 = r277309 - r277300;
double r277323 = r277321 / r277322;
double r277324 = r277317 / r277323;
double r277325 = -r277324;
double r277326 = cbrt(r277307);
double r277327 = pow(r277326, r277318);
double r277328 = r277325 + r277327;
double r277329 = r277322 / r277321;
double r277330 = -r277317;
double r277331 = r277330 + r277317;
double r277332 = r277329 * r277331;
double r277333 = r277328 + r277332;
double r277334 = sqrt(r277333);
double r277335 = log(r277334);
double r277336 = r277307 - r277300;
double r277337 = r277322 / r277336;
double r277338 = r277307 - r277337;
double r277339 = sqrt(r277338);
double r277340 = log(r277339);
double r277341 = r277335 + r277340;
double r277342 = r277307 - r277341;
double r277343 = r277306 ? r277314 : r277342;
return r277343;
}




Bits error versus x




Bits error versus y
| Original | 18.5 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -34474611802046.883 or 43744445.70071104 < y Initial program 47.4
Taylor expanded around inf 0.0
Simplified0.0
if -34474611802046.883 < y < 43744445.70071104Initial program 0.2
rmApplied add-sqr-sqrt0.2
Applied log-prod0.2
rmApplied flip3--0.2
Applied associate-/r/0.2
Applied add-cube-cbrt0.2
Applied prod-diff0.2
Simplified0.2
Simplified0.2
rmApplied fma-udef0.2
Simplified0.2
Final simplification0.1
herbie shell --seed 2019174 +o rules:numerics
(FPCore (x y)
:name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, B"
: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))))))