1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1 - y} \le 0.999825418925996412:\\
\;\;\;\;1 - \log \left(1 - \frac{1}{\sqrt[3]{1 - y} \cdot \sqrt[3]{1 - y}} \cdot \frac{x - y}{\sqrt[3]{1 - y}}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\left(1 \cdot \frac{x}{{y}^{2}} + \frac{x}{y}\right) - \frac{1}{y}\right)\\
\end{array}double f(double x, double y) {
double r357294 = 1.0;
double r357295 = x;
double r357296 = y;
double r357297 = r357295 - r357296;
double r357298 = r357294 - r357296;
double r357299 = r357297 / r357298;
double r357300 = r357294 - r357299;
double r357301 = log(r357300);
double r357302 = r357294 - r357301;
return r357302;
}
double f(double x, double y) {
double r357303 = x;
double r357304 = y;
double r357305 = r357303 - r357304;
double r357306 = 1.0;
double r357307 = r357306 - r357304;
double r357308 = r357305 / r357307;
double r357309 = 0.9998254189259964;
bool r357310 = r357308 <= r357309;
double r357311 = 1.0;
double r357312 = cbrt(r357307);
double r357313 = r357312 * r357312;
double r357314 = r357311 / r357313;
double r357315 = r357305 / r357312;
double r357316 = r357314 * r357315;
double r357317 = r357306 - r357316;
double r357318 = log(r357317);
double r357319 = r357306 - r357318;
double r357320 = 2.0;
double r357321 = pow(r357304, r357320);
double r357322 = r357303 / r357321;
double r357323 = r357306 * r357322;
double r357324 = r357303 / r357304;
double r357325 = r357323 + r357324;
double r357326 = r357306 / r357304;
double r357327 = r357325 - r357326;
double r357328 = log(r357327);
double r357329 = r357306 - r357328;
double r357330 = r357310 ? r357319 : r357329;
return r357330;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if (/ (- x y) (- 1.0 y)) < 0.9998254189259964Initial program 0.0
rmApplied add-cube-cbrt0.1
Applied *-un-lft-identity0.1
Applied times-frac0.1
if 0.9998254189259964 < (/ (- x y) (- 1.0 y)) Initial program 61.9
rmApplied add-cube-cbrt56.8
Applied *-un-lft-identity56.8
Applied times-frac56.7
Taylor expanded around inf 0.5
Simplified0.5
Final simplification0.2
herbie shell --seed 2020081
(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))))))