(FPCore (x y z) :precision binary64 (+ x (/ y (- (* 1.1283791670955126 (exp z)) (* x y)))))
(FPCore (x y z) :precision binary64 (if (<= (exp z) 6.79382622630013e-310) (+ x (/ -1.0 x)) (+ x (/ y (fma 1.1283791670955126 (exp z) (- (* x y)))))))
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 tmp;
if (exp(z) <= 6.79382622630013e-310) {
tmp = x + (-1.0 / x);
} else {
tmp = x + (y / fma(1.1283791670955126, exp(z), -(x * y)));
}
return tmp;
}
function code(x, y, z) return Float64(x + Float64(y / Float64(Float64(1.1283791670955126 * exp(z)) - Float64(x * y)))) end
function code(x, y, z) tmp = 0.0 if (exp(z) <= 6.79382622630013e-310) tmp = Float64(x + Float64(-1.0 / x)); else tmp = Float64(x + Float64(y / fma(1.1283791670955126, exp(z), Float64(-Float64(x * y))))); end return tmp end
code[x_, y_, z_] := N[(x + N[(y / N[(N[(1.1283791670955126 * N[Exp[z], $MachinePrecision]), $MachinePrecision] - N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_] := If[LessEqual[N[Exp[z], $MachinePrecision], 6.79382622630013e-310], N[(x + N[(-1.0 / x), $MachinePrecision]), $MachinePrecision], N[(x + N[(y / N[(1.1283791670955126 * N[Exp[z], $MachinePrecision] + (-N[(x * y), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
x + \frac{y}{1.1283791670955126 \cdot e^{z} - x \cdot y}
\begin{array}{l}
\mathbf{if}\;e^{z} \leq 6.79382622630013 \cdot 10^{-310}:\\
\;\;\;\;x + \frac{-1}{x}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{\mathsf{fma}\left(1.1283791670955126, e^{z}, -x \cdot y\right)}\\
\end{array}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 3.1 |
|---|---|
| Target | 0.0 |
| Herbie | 1.1 |
if (exp.f64 z) < 6.793826226300134e-310Initial program 8.0
Simplified8.0
Taylor expanded in y around inf 0.0
if 6.793826226300134e-310 < (exp.f64 z) Initial program 1.5
Simplified1.5
Final simplification1.1
herbie shell --seed 2022152
(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)))))