x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\begin{array}{l}
\mathbf{if}\;z \cdot z \leq 3.956437111800793 \cdot 10^{+303}:\\
\;\;\;\;x \cdot x + \left(y \cdot 4\right) \cdot \left(t - z \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x + \left(y \cdot \left(4 \cdot \left(z + \sqrt{t}\right)\right)\right) \cdot \left(\sqrt{t} - z\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) 3.956437111800793e+303) (+ (* x x) (* (* y 4.0) (- t (* z z)))) (+ (* x x) (* (* y (* 4.0 (+ z (sqrt t)))) (- (sqrt t) z)))))
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 tmp;
if ((((double) (z * z)) <= 3.956437111800793e+303)) {
tmp = ((double) (((double) (x * x)) + ((double) (((double) (y * 4.0)) * ((double) (t - ((double) (z * z))))))));
} else {
tmp = ((double) (((double) (x * x)) + ((double) (((double) (y * ((double) (4.0 * ((double) (z + ((double) sqrt(t)))))))) * ((double) (((double) sqrt(t)) - z))))));
}
return tmp;
}




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) < 3.95643711180079285e303Initial program Error: 0.1 bits
if 3.95643711180079285e303 < (* z z) Initial program Error: 62.2 bits
rmApplied add-sqr-sqrtError: 63.1 bits
Applied difference-of-squaresError: 63.1 bits
Applied associate-*r*Error: 32.8 bits
SimplifiedError: 32.8 bits
Final simplificationError: 3.2 bits
herbie shell --seed 2020204
(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))))