1.0 - \log \left(1.0 - \frac{x - y}{1.0 - y}\right)\begin{array}{l}
\mathbf{if}\;\frac{x - y}{1.0 - y} \le 0.8581617207853955:\\
\;\;\;\;1.0 - \left(\log \left(\sqrt{1.0 - \frac{x - y}{1.0 - y}}\right) + \log \left(\sqrt{1.0 - \frac{x - y}{1.0 - y}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1.0 - \log \left(\mathsf{fma}\left(\frac{1.0}{y}, \frac{x}{y}, \frac{x}{y}\right) - \frac{1.0}{y}\right)\\
\end{array}double f(double x, double y) {
double r15232132 = 1.0;
double r15232133 = x;
double r15232134 = y;
double r15232135 = r15232133 - r15232134;
double r15232136 = r15232132 - r15232134;
double r15232137 = r15232135 / r15232136;
double r15232138 = r15232132 - r15232137;
double r15232139 = log(r15232138);
double r15232140 = r15232132 - r15232139;
return r15232140;
}
double f(double x, double y) {
double r15232141 = x;
double r15232142 = y;
double r15232143 = r15232141 - r15232142;
double r15232144 = 1.0;
double r15232145 = r15232144 - r15232142;
double r15232146 = r15232143 / r15232145;
double r15232147 = 0.8581617207853955;
bool r15232148 = r15232146 <= r15232147;
double r15232149 = r15232144 - r15232146;
double r15232150 = sqrt(r15232149);
double r15232151 = log(r15232150);
double r15232152 = r15232151 + r15232151;
double r15232153 = r15232144 - r15232152;
double r15232154 = r15232144 / r15232142;
double r15232155 = r15232141 / r15232142;
double r15232156 = fma(r15232154, r15232155, r15232155);
double r15232157 = r15232156 - r15232154;
double r15232158 = log(r15232157);
double r15232159 = r15232144 - r15232158;
double r15232160 = r15232148 ? r15232153 : r15232159;
return r15232160;
}




Bits error versus x




Bits error versus y
| Original | 18.2 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if (/ (- x y) (- 1.0 y)) < 0.8581617207853955Initial program 0.0
rmApplied add-sqr-sqrt0.0
Applied log-prod0.0
if 0.8581617207853955 < (/ (- x y) (- 1.0 y)) Initial program 59.3
Taylor expanded around inf 0.7
Simplified0.7
Final simplification0.2
herbie shell --seed 2019163 +o rules:numerics
(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))))))