x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\begin{array}{l}
\mathbf{if}\;z \cdot z \le 6.24661204370148753 \cdot 10^{297}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right) + \left(y \cdot 4\right) \cdot \mathsf{fma}\left(-z, z, z \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(\left(y \cdot 4\right) \cdot \left(\sqrt{t} + z\right)\right) \cdot \left(\sqrt{t} - z\right)\right)\\
\end{array}double code(double x, double y, double z, double t) {
return ((double) (((double) (x * x)) - ((double) (((double) (y * 4.0)) * ((double) (((double) (z * z)) - t))))));
}
double code(double x, double y, double z, double t) {
double VAR;
if ((((double) (z * z)) <= 6.246612043701488e+297)) {
VAR = ((double) fma(x, x, ((double) (((double) (((double) (y * 4.0)) * ((double) (t - ((double) (z * z)))))) + ((double) (((double) (y * 4.0)) * ((double) fma(((double) -(z)), z, ((double) (z * z))))))))));
} else {
VAR = ((double) fma(x, x, ((double) (((double) (((double) (y * 4.0)) * ((double) (((double) sqrt(t)) + z)))) * ((double) (((double) sqrt(t)) - z))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.0 |
|---|---|
| Target | 6.0 |
| Herbie | 3.2 |
if (* z z) < 6.246612043701488e+297Initial program 0.1
Simplified0.1
rmApplied add-sqr-sqrt31.9
Applied prod-diff31.9
Applied distribute-lft-in31.9
Simplified0.1
if 6.246612043701488e+297 < (* z z) Initial program 59.9
Simplified59.9
rmApplied add-sqr-sqrt61.8
Applied difference-of-squares61.8
Applied associate-*r*31.8
Final simplification3.2
herbie shell --seed 2020120 +o rules:numerics
(FPCore (x y z t)
:name "Graphics.Rasterific.Shading:$sradialGradientWithFocusShader from Rasterific-0.6.1, B"
:precision binary64
:herbie-target
(- (* x x) (* 4 (* y (- (* z z) t))))
(- (* x x) (* (* y 4) (- (* z z) t))))