(FPCore (x y z) :precision binary64 (/ (* x (+ y z)) z))
(FPCore (x y z)
:precision binary64
(let* ((t_0 (fma x (/ y z) x)))
(if (<= z -2.7e-139)
t_0
(if (<= z 4.1e-72) (pow (cbrt (+ x (/ (* x y) z))) 3.0) t_0))))double code(double x, double y, double z) {
return (x * (y + z)) / z;
}
double code(double x, double y, double z) {
double t_0 = fma(x, (y / z), x);
double tmp;
if (z <= -2.7e-139) {
tmp = t_0;
} else if (z <= 4.1e-72) {
tmp = pow(cbrt((x + ((x * y) / z))), 3.0);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y, z) return Float64(Float64(x * Float64(y + z)) / z) end
function code(x, y, z) t_0 = fma(x, Float64(y / z), x) tmp = 0.0 if (z <= -2.7e-139) tmp = t_0; elseif (z <= 4.1e-72) tmp = cbrt(Float64(x + Float64(Float64(x * y) / z))) ^ 3.0; else tmp = t_0; end return tmp end
code[x_, y_, z_] := N[(N[(x * N[(y + z), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
code[x_, y_, z_] := Block[{t$95$0 = N[(x * N[(y / z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -2.7e-139], t$95$0, If[LessEqual[z, 4.1e-72], N[Power[N[Power[N[(x + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision], t$95$0]]]
\frac{x \cdot \left(y + z\right)}{z}
\begin{array}{l}
t_0 := \mathsf{fma}\left(x, \frac{y}{z}, x\right)\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{-139}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{-72}:\\
\;\;\;\;{\left(\sqrt[3]{x + \frac{x \cdot y}{z}}\right)}^{3}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 12.2 |
|---|---|
| Target | 3.3 |
| Herbie | 2.3 |
if z < -2.6999999999999998e-139 or 4.10000000000000003e-72 < z Initial program 13.1
Simplified0.9
if -2.6999999999999998e-139 < z < 4.10000000000000003e-72Initial program 9.4
Simplified11.4
Applied egg-rr12.4
Taylor expanded in y around 0 6.5
Final simplification2.3
herbie shell --seed 2022162
(FPCore (x y z)
:name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(/ x (/ z (+ y z)))
(/ (* x (+ y z)) z))