x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, y \cdot \left(z \cdot -4\right), x \cdot x\right)\\
\mathbf{if}\;z \leq -6.038238978544222 \cdot 10^{+153}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 9.433316727882347 \cdot 10^{+117}:\\
\;\;\;\;\mathsf{fma}\left(y, 4 \cdot \mathsf{fma}\left(z, -z, t\right), x \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
(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 z (* y (* z -4.0)) (* x x))))
(if (<= z -6.038238978544222e+153)
t_1
(if (<= z 9.433316727882347e+117)
(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(z, (y * (z * -4.0)), (x * x));
double tmp;
if (z <= -6.038238978544222e+153) {
tmp = t_1;
} else if (z <= 9.433316727882347e+117) {
tmp = fma(y, (4.0 * fma(z, -z, t)), (x * x));
} else {
tmp = t_1;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
| Original | 5.8 |
|---|---|
| Target | 5.8 |
| Herbie | 0.2 |
if z < -6.0382389785442217e153 or 9.43331672788234659e117 < z Initial program 50.5
Simplified50.5
Applied egg-rr50.6
Taylor expanded in t around 0 51.5
Simplified1.3
if -6.0382389785442217e153 < z < 9.43331672788234659e117Initial program 0.1
Simplified0.1
Applied egg-rr0.1
Final simplification0.2
herbie shell --seed 2022130
(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))))