x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 9.211511594325861 \cdot 10^{+280}:\\
\;\;\;\;x \cdot x + y \cdot \left(4 \cdot \left(t - z \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x + y \cdot \left(4 \cdot t\right)\\
\end{array}(FPCore (x y z t) :precision binary64 (- (* x x) (* (* y 4.0) (- (* z z) t))))
(FPCore (x y z t) :precision binary64 (if (<= (* z z) 9.211511594325861e+280) (+ (* x x) (* y (* 4.0 (- t (* z z))))) (+ (* x x) (* y (* 4.0 t)))))
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)) <= 9.211511594325861e+280)) {
VAR = ((double) (((double) (x * x)) + ((double) (y * ((double) (4.0 * ((double) (t - ((double) (z * z))))))))));
} else {
VAR = ((double) (((double) (x * x)) + ((double) (y * ((double) (4.0 * t))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.0 |
|---|---|
| Target | 5.9 |
| Herbie | 6.0 |
if (* z z) < 9.2115115943258612e280Initial program 0.1
Simplified0.1
if 9.2115115943258612e280 < (* z z) Initial program 53.7
Simplified54.0
Taylor expanded around 0 54.5
Simplified54.5
Final simplification6.0
herbie shell --seed 2020198
(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))))