1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -391848944.810126841068267822265625 \lor \neg \left(y \le 6764068.6677209436893463134765625\right):\\
\;\;\;\;1 - \log \left(\mathsf{fma}\left(1, \frac{x}{{y}^{2}}, \frac{x}{y}\right) - \frac{1}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\mathsf{fma}\left(\frac{x - y}{{1}^{3} - {y}^{3}}, -\mathsf{fma}\left(1, 1, y \cdot \left(1 + y\right)\right), {\left(\sqrt[3]{1}\right)}^{3}\right) + \frac{x - y}{{1}^{3} - {y}^{3}} \cdot \left(\left(-\mathsf{fma}\left(1, 1, y \cdot \left(1 + y\right)\right)\right) + \mathsf{fma}\left(1, 1, y \cdot \left(1 + y\right)\right)\right)\right)\\
\end{array}double f(double x, double y) {
double r244088 = 1.0;
double r244089 = x;
double r244090 = y;
double r244091 = r244089 - r244090;
double r244092 = r244088 - r244090;
double r244093 = r244091 / r244092;
double r244094 = r244088 - r244093;
double r244095 = log(r244094);
double r244096 = r244088 - r244095;
return r244096;
}
double f(double x, double y) {
double r244097 = y;
double r244098 = -391848944.81012684;
bool r244099 = r244097 <= r244098;
double r244100 = 6764068.667720944;
bool r244101 = r244097 <= r244100;
double r244102 = !r244101;
bool r244103 = r244099 || r244102;
double r244104 = 1.0;
double r244105 = x;
double r244106 = 2.0;
double r244107 = pow(r244097, r244106);
double r244108 = r244105 / r244107;
double r244109 = r244105 / r244097;
double r244110 = fma(r244104, r244108, r244109);
double r244111 = r244104 / r244097;
double r244112 = r244110 - r244111;
double r244113 = log(r244112);
double r244114 = r244104 - r244113;
double r244115 = r244105 - r244097;
double r244116 = 3.0;
double r244117 = pow(r244104, r244116);
double r244118 = pow(r244097, r244116);
double r244119 = r244117 - r244118;
double r244120 = r244115 / r244119;
double r244121 = r244104 + r244097;
double r244122 = r244097 * r244121;
double r244123 = fma(r244104, r244104, r244122);
double r244124 = -r244123;
double r244125 = cbrt(r244104);
double r244126 = pow(r244125, r244116);
double r244127 = fma(r244120, r244124, r244126);
double r244128 = r244124 + r244123;
double r244129 = r244120 * r244128;
double r244130 = r244127 + r244129;
double r244131 = log(r244130);
double r244132 = r244104 - r244131;
double r244133 = r244103 ? r244114 : r244132;
return r244133;
}




Bits error versus x




Bits error versus y
| Original | 18.4 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -391848944.81012684 or 6764068.667720944 < y Initial program 47.1
Taylor expanded around inf 0.1
Simplified0.1
if -391848944.81012684 < y < 6764068.667720944Initial program 0.1
rmApplied flip3--0.1
Applied associate-/r/0.1
Applied add-cube-cbrt0.1
Applied prod-diff0.1
Simplified0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019304 +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.619472414) (- 1 (log (- (/ x (* y y)) (- (/ 1 y) (/ x y))))) (if (< y 3.0094271212461764e25) (log (/ (exp 1) (- 1 (/ (- x y) (- 1 y))))) (- 1 (log (- (/ x (* y y)) (- (/ 1 y) (/ x y)))))))
(- 1 (log (- 1 (/ (- x y) (- 1 y))))))