(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 -1.1783638165363816e+89)
t_1
(if (<= z 2.1474743947097236e+139)
(fma y (* -4.0 (fma 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 <= -1.1783638165363816e+89) {
tmp = t_1;
} else if (z <= 2.1474743947097236e+139) {
tmp = fma(y, (-4.0 * fma(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 <= -1.1783638165363816e+89) tmp = t_1; elseif (z <= 2.1474743947097236e+139) tmp = fma(y, Float64(-4.0 * fma(z, z, Float64(-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, -1.1783638165363816e+89], t$95$1, If[LessEqual[z, 2.1474743947097236e+139], N[(y * N[(-4.0 * N[(z * z + (-t)), $MachinePrecision]), $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.1783638165363816 \cdot 10^{+89}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2.1474743947097236 \cdot 10^{+139}:\\
\;\;\;\;\mathsf{fma}\left(y, -4 \cdot \mathsf{fma}\left(z, z, -t\right), 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.5 |
|---|---|
| Target | 5.5 |
| Herbie | 0.3 |
if z < -1.178363816536382e89 or 2.14747439470972363e139 < z Initial program 39.0
Simplified39.1
Applied egg-rr39.1
Taylor expanded in t around 0 40.4
Simplified1.7
if -1.178363816536382e89 < z < 2.14747439470972363e139Initial program 0.1
Simplified0.1
Applied egg-rr0.1
Final simplification0.3
herbie shell --seed 2022148
(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))))