x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\begin{array}{l}
\mathbf{if}\;z \cdot z \le 3.8524189806013002 \cdot 10^{304}:\\
\;\;\;\;x \cdot x - \left(z \cdot z - t\right) \cdot \left(y \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x - \left(\left(y \cdot 4\right) \cdot \left(z + \sqrt{t}\right)\right) \cdot \left(z - \sqrt{t}\right)\\
\end{array}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 temp;
if (((z * z) <= 3.8524189806013e+304)) {
temp = ((x * x) - (((z * z) - t) * (y * 4.0)));
} else {
temp = ((x * x) - (((y * 4.0) * (z + sqrt(t))) * (z - sqrt(t))));
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 5.9 |
|---|---|
| Target | 5.9 |
| Herbie | 3.2 |
if (* z z) < 3.8524189806013e+304Initial program 0.1
rmApplied *-commutative0.1
if 3.8524189806013e+304 < (* z z) Initial program 61.5
rmApplied add-sqr-sqrt62.7
Applied difference-of-squares62.7
Applied associate-*r*33.3
Final simplification3.2
herbie shell --seed 2020053
(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))))