x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\begin{array}{l}
t_0 := 1.1283791670955126 \cdot e^{z}\\
\mathbf{if}\;t_0 \leq 6.94725497403986 \cdot 10^{-310}:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{elif}\;t_0 \leq 1.1299496288236466:\\
\;\;\;\;x + \frac{y}{t_0 - x \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t_0}\\
\end{array}
(FPCore (x y z) :precision binary64 (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 1.1283791670955126 (exp z))))
(if (<= t_0 6.94725497403986e-310)
(+ x (/ -1.0 x))
(if (<= t_0 1.1299496288236466)
(+ x (/ y (- t_0 (* x y))))
(+ x (/ y t_0))))))double code(double x, double y, double z) {
return x + (y / ((1.1283791670955126 * exp(z)) - (x * y)));
}
double code(double x, double y, double z) {
double t_0 = 1.1283791670955126 * exp(z);
double tmp;
if (t_0 <= 6.94725497403986e-310) {
tmp = x + (-1.0 / x);
} else if (t_0 <= 1.1299496288236466) {
tmp = x + (y / (t_0 - (x * y)));
} else {
tmp = x + (y / t_0);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.8 |
|---|---|
| Target | 0.0 |
| Herbie | 0.1 |
if (*.f64 5081767996463981/4503599627370496 (exp.f64 z)) < 6.947254974039863e-310Initial program 8.2
Simplified0.0
Taylor expanded in y around inf 0.0
if 6.947254974039863e-310 < (*.f64 5081767996463981/4503599627370496 (exp.f64 z)) < 1.12994962882364658Initial program 0.0
if 1.12994962882364658 < (*.f64 5081767996463981/4503599627370496 (exp.f64 z)) Initial program 3.2
Taylor expanded in x around 0 0.3
Final simplification0.1
herbie shell --seed 2021215
(FPCore (x y z)
:name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(+ x (/ 1.0 (- (* (/ 1.1283791670955126 y) (exp z)) x)))
(+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))