(FPCore (x y z t) :precision binary64 (- (* x x) (* (* y 4.0) (- (* z z) t))))
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma x x (* z (* z (* y -4.0))))))
(if (<= z -1e+125)
t_1
(if (<= z 9.8e+89) (fma (* y -4.0) (- (* z z) t) (* x x)) t_1))))double code(double x, double y, double z, double t) {
return (x * x) - ((y * 4.0) * ((z * z) - t));
}
double code(double x, double y, double z, double t) {
double t_1 = fma(x, x, (z * (z * (y * -4.0))));
double tmp;
if (z <= -1e+125) {
tmp = t_1;
} else if (z <= 9.8e+89) {
tmp = fma((y * -4.0), ((z * z) - t), (x * x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) return Float64(Float64(x * x) - Float64(Float64(y * 4.0) * Float64(Float64(z * z) - t))) end
function code(x, y, z, t) t_1 = fma(x, x, Float64(z * Float64(z * Float64(y * -4.0)))) tmp = 0.0 if (z <= -1e+125) tmp = t_1; elseif (z <= 9.8e+89) tmp = fma(Float64(y * -4.0), Float64(Float64(z * z) - t), Float64(x * x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] - N[(N[(y * 4.0), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * x + N[(z * N[(z * N[(y * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e+125], t$95$1, If[LessEqual[z, 9.8e+89], N[(N[(y * -4.0), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, x, z \cdot \left(z \cdot \left(y \cdot -4\right)\right)\right)\\
\mathbf{if}\;z \leq -1 \cdot 10^{+125}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{+89}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot -4, z \cdot z - t, x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 5.8 |
|---|---|
| Target | 5.8 |
| Herbie | 0.4 |
if z < -9.9999999999999992e124 or 9.79999999999999992e89 < z Initial program 37.0
Applied egg-rr37.0
Taylor expanded in t around 0 39.1
Simplified2.3
if -9.9999999999999992e124 < z < 9.79999999999999992e89Initial program 0.1
Applied egg-rr0.1
Final simplification0.4
herbie shell --seed 2022166
(FPCore (x y z t)
:name "Graphics.Rasterific.Shading:$sradialGradientWithFocusShader from Rasterific-0.6.1, B"
:precision binary64
:herbie-target
(- (* x x) (* 4.0 (* y (- (* z z) t))))
(- (* x x) (* (* y 4.0) (- (* z z) t))))