1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1 - y} \le 0.9993340856260311:\\
\;\;\;\;1 - \log \left(1 - \left(\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}\right) \cdot \frac{\sqrt[3]{x - y}}{1 - y}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(1 \cdot \left(\frac{x}{{y}^{2}} - \frac{1}{y}\right) + \frac{x}{y}\right)\\
\end{array}double f(double x, double y) {
double r451197 = 1.0;
double r451198 = x;
double r451199 = y;
double r451200 = r451198 - r451199;
double r451201 = r451197 - r451199;
double r451202 = r451200 / r451201;
double r451203 = r451197 - r451202;
double r451204 = log(r451203);
double r451205 = r451197 - r451204;
return r451205;
}
double f(double x, double y) {
double r451206 = x;
double r451207 = y;
double r451208 = r451206 - r451207;
double r451209 = 1.0;
double r451210 = r451209 - r451207;
double r451211 = r451208 / r451210;
double r451212 = 0.9993340856260311;
bool r451213 = r451211 <= r451212;
double r451214 = cbrt(r451208);
double r451215 = r451214 * r451214;
double r451216 = r451214 / r451210;
double r451217 = r451215 * r451216;
double r451218 = r451209 - r451217;
double r451219 = log(r451218);
double r451220 = r451209 - r451219;
double r451221 = 2.0;
double r451222 = pow(r451207, r451221);
double r451223 = r451206 / r451222;
double r451224 = 1.0;
double r451225 = r451224 / r451207;
double r451226 = r451223 - r451225;
double r451227 = r451209 * r451226;
double r451228 = r451206 / r451207;
double r451229 = r451227 + r451228;
double r451230 = log(r451229);
double r451231 = r451209 - r451230;
double r451232 = r451213 ? r451220 : r451231;
return r451232;
}




Bits error versus x




Bits error versus y
Results
| Original | 18.0 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if (/ (- x y) (- 1.0 y)) < 0.9993340856260311Initial program 0.0
rmApplied *-un-lft-identity0.0
Applied add-cube-cbrt0.1
Applied times-frac0.1
Simplified0.1
if 0.9993340856260311 < (/ (- x y) (- 1.0 y)) Initial program 61.9
Taylor expanded around inf 0.4
Simplified0.4
Final simplification0.2
herbie shell --seed 2020021
(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))))))