1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -80228020.28782515227794647216796875 \lor \neg \left(y \le 42220580.41032813489437103271484375\right):\\
\;\;\;\;1 - \log \left(\frac{x}{y} + \left(\frac{x}{y} \cdot \frac{1}{y} - \frac{1}{y}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 - \frac{\frac{x - y}{\sqrt[3]{1 - y} \cdot \sqrt[3]{1 - y}}}{\sqrt[3]{1 - y}}\right)\\
\end{array}double f(double x, double y) {
double r299185 = 1.0;
double r299186 = x;
double r299187 = y;
double r299188 = r299186 - r299187;
double r299189 = r299185 - r299187;
double r299190 = r299188 / r299189;
double r299191 = r299185 - r299190;
double r299192 = log(r299191);
double r299193 = r299185 - r299192;
return r299193;
}
double f(double x, double y) {
double r299194 = y;
double r299195 = -80228020.28782515;
bool r299196 = r299194 <= r299195;
double r299197 = 42220580.410328135;
bool r299198 = r299194 <= r299197;
double r299199 = !r299198;
bool r299200 = r299196 || r299199;
double r299201 = 1.0;
double r299202 = x;
double r299203 = r299202 / r299194;
double r299204 = r299201 / r299194;
double r299205 = r299203 * r299204;
double r299206 = r299205 - r299204;
double r299207 = r299203 + r299206;
double r299208 = log(r299207);
double r299209 = r299201 - r299208;
double r299210 = r299202 - r299194;
double r299211 = r299201 - r299194;
double r299212 = cbrt(r299211);
double r299213 = r299212 * r299212;
double r299214 = r299210 / r299213;
double r299215 = r299214 / r299212;
double r299216 = r299201 - r299215;
double r299217 = log(r299216);
double r299218 = r299201 - r299217;
double r299219 = r299200 ? r299209 : r299218;
return r299219;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -80228020.28782515 or 42220580.410328135 < y Initial program 46.4
Taylor expanded around inf 0.1
Simplified0.1
if -80228020.28782515 < y < 42220580.410328135Initial program 0.1
rmApplied add-cube-cbrt0.1
Applied associate-/r*0.1
Final simplification0.1
herbie shell --seed 2019196
(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))))))