1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1 - y} \le 0.99999975065411717:\\
\;\;\;\;1 - \log \left(1 - \frac{\sqrt[3]{x - y} \cdot \sqrt[3]{x - y}}{\frac{1 - y}{\sqrt[3]{x - 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 r359054 = 1.0;
double r359055 = x;
double r359056 = y;
double r359057 = r359055 - r359056;
double r359058 = r359054 - r359056;
double r359059 = r359057 / r359058;
double r359060 = r359054 - r359059;
double r359061 = log(r359060);
double r359062 = r359054 - r359061;
return r359062;
}
double f(double x, double y) {
double r359063 = x;
double r359064 = y;
double r359065 = r359063 - r359064;
double r359066 = 1.0;
double r359067 = r359066 - r359064;
double r359068 = r359065 / r359067;
double r359069 = 0.9999997506541172;
bool r359070 = r359068 <= r359069;
double r359071 = cbrt(r359065);
double r359072 = r359071 * r359071;
double r359073 = r359067 / r359071;
double r359074 = r359072 / r359073;
double r359075 = r359066 - r359074;
double r359076 = log(r359075);
double r359077 = r359066 - r359076;
double r359078 = 2.0;
double r359079 = pow(r359064, r359078);
double r359080 = r359063 / r359079;
double r359081 = 1.0;
double r359082 = r359081 / r359064;
double r359083 = r359080 - r359082;
double r359084 = r359066 * r359083;
double r359085 = r359063 / r359064;
double r359086 = r359084 + r359085;
double r359087 = log(r359086);
double r359088 = r359066 - r359087;
double r359089 = r359070 ? r359077 : r359088;
return r359089;
}




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.9999997506541172Initial program 0.1
rmApplied add-cube-cbrt0.1
Applied associate-/l*0.1
if 0.9999997506541172 < (/ (- x y) (- 1.0 y)) Initial program 62.3
rmApplied add-cube-cbrt59.3
Applied associate-/l*59.3
Taylor expanded around inf 0.3
Simplified0.3
Final simplification0.2
herbie shell --seed 2020064 +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.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))))))