1 - \log \left(1 - \frac{x - y}{1 - y}\right)\begin{array}{l}
\mathbf{if}\;y \le -224500362.7019620835781097412109375:\\
\;\;\;\;1 - \log \left(\mathsf{fma}\left(\frac{x}{y}, \frac{1}{y}, \frac{x}{y} - \frac{1}{y}\right)\right)\\
\mathbf{elif}\;y \le 51921085.7710403501987457275390625:\\
\;\;\;\;\log \left(\frac{1}{\sqrt{1 - \frac{x - y}{1 - y}}} \cdot \frac{e^{1}}{\sqrt{\mathsf{fma}\left(1, 1, \frac{x - y}{1 \cdot 1 - y \cdot y} \cdot \left(-\left(1 + y\right)\right)\right) + \mathsf{fma}\left(-\left(1 + y\right), \frac{x - y}{1 \cdot 1 - y \cdot y}, \frac{x - y}{1 \cdot 1 - y \cdot y} \cdot \left(1 + y\right)\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;1 - \log \left(\mathsf{fma}\left(\frac{x}{y}, \frac{1}{y}, \frac{x}{y} - \frac{1}{y}\right)\right)\\
\end{array}double f(double x, double y) {
double r14570006 = 1.0;
double r14570007 = x;
double r14570008 = y;
double r14570009 = r14570007 - r14570008;
double r14570010 = r14570006 - r14570008;
double r14570011 = r14570009 / r14570010;
double r14570012 = r14570006 - r14570011;
double r14570013 = log(r14570012);
double r14570014 = r14570006 - r14570013;
return r14570014;
}
double f(double x, double y) {
double r14570015 = y;
double r14570016 = -224500362.70196208;
bool r14570017 = r14570015 <= r14570016;
double r14570018 = 1.0;
double r14570019 = x;
double r14570020 = r14570019 / r14570015;
double r14570021 = r14570018 / r14570015;
double r14570022 = r14570020 - r14570021;
double r14570023 = fma(r14570020, r14570021, r14570022);
double r14570024 = log(r14570023);
double r14570025 = r14570018 - r14570024;
double r14570026 = 51921085.77104035;
bool r14570027 = r14570015 <= r14570026;
double r14570028 = 1.0;
double r14570029 = r14570019 - r14570015;
double r14570030 = r14570018 - r14570015;
double r14570031 = r14570029 / r14570030;
double r14570032 = r14570018 - r14570031;
double r14570033 = sqrt(r14570032);
double r14570034 = r14570028 / r14570033;
double r14570035 = exp(r14570018);
double r14570036 = r14570018 * r14570018;
double r14570037 = r14570015 * r14570015;
double r14570038 = r14570036 - r14570037;
double r14570039 = r14570029 / r14570038;
double r14570040 = r14570018 + r14570015;
double r14570041 = -r14570040;
double r14570042 = r14570039 * r14570041;
double r14570043 = fma(r14570028, r14570018, r14570042);
double r14570044 = r14570039 * r14570040;
double r14570045 = fma(r14570041, r14570039, r14570044);
double r14570046 = r14570043 + r14570045;
double r14570047 = sqrt(r14570046);
double r14570048 = r14570035 / r14570047;
double r14570049 = r14570034 * r14570048;
double r14570050 = log(r14570049);
double r14570051 = r14570027 ? r14570050 : r14570025;
double r14570052 = r14570017 ? r14570025 : r14570051;
return r14570052;
}




Bits error versus x




Bits error versus y
| Original | 18.9 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
if y < -224500362.70196208 or 51921085.77104035 < y Initial program 47.4
Taylor expanded around inf 0.1
Simplified0.1
if -224500362.70196208 < y < 51921085.77104035Initial program 0.1
rmApplied add-log-exp0.1
Applied diff-log0.1
rmApplied add-sqr-sqrt0.1
Applied *-un-lft-identity0.1
Applied times-frac0.1
rmApplied flip--0.1
Applied associate-/r/0.1
Applied *-un-lft-identity0.1
Applied prod-diff0.1
Final simplification0.1
herbie shell --seed 2019168 +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))))))