x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\begin{array}{l}
\mathbf{if}\;z \cdot z \le 1.8605794011033563 \cdot 10^{298}:\\
\;\;\;\;\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)) <= 1.8605794011033563e+298)) {
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.1 |
|---|---|
| Target | 6.1 |
| Herbie | 3.5 |
if (* z z) < 1.8605794011033563e+298Initial program 0.1
Simplified0.1
rmApplied add-sqr-sqrt31.9
Applied prod-diff31.9
Applied distribute-lft-in31.9
Simplified0.1
if 1.8605794011033563e+298 < (* z z) Initial program 60.4
Simplified60.4
rmApplied add-sqr-sqrt62.1
Applied difference-of-squares62.1
Applied associate-*r*34.2
Final simplification3.5
herbie shell --seed 2020122 +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))))