x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)
\begin{array}{l}
\mathbf{if}\;z \leq -1.6331768204397996 \cdot 10^{+153}:\\
\;\;\;\;x \cdot x - \frac{4 \cdot \left(z + \sqrt{t}\right)}{\frac{\frac{1}{z - \sqrt{t}}}{y}}\\
\mathbf{elif}\;z \leq 2.5730812676030823 \cdot 10^{+126}:\\
\;\;\;\;x \cdot x - \left(4 \cdot y\right) \cdot \left(z \cdot z - t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot x - \left(z - \sqrt{t}\right) \cdot \left(\left(z + \sqrt{t}\right) \cdot \left(4 \cdot y\right)\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 -1.6331768204397996e+153)
(- (* x x) (/ (* 4.0 (+ z (sqrt t))) (/ (/ 1.0 (- z (sqrt t))) y)))
(if (<= z 2.5730812676030823e+126)
(- (* x x) (* (* 4.0 y) (- (* z z) t)))
(- (* x x) (* (- z (sqrt t)) (* (+ z (sqrt t)) (* 4.0 y)))))))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 tmp;
if (z <= -1.6331768204397996e+153) {
tmp = (x * x) - ((4.0 * (z + sqrt(t))) / ((1.0 / (z - sqrt(t))) / y));
} else if (z <= 2.5730812676030823e+126) {
tmp = (x * x) - ((4.0 * y) * ((z * z) - t));
} else {
tmp = (x * x) - ((z - sqrt(t)) * ((z + sqrt(t)) * (4.0 * y)));
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 5.8 |
|---|---|
| Target | 5.8 |
| Herbie | 3.5 |
if z < -1.6331768204397996e153Initial program 62.3
rmApplied flip--_binary64_1744464.0
Applied associate-*r/_binary64_1741164.0
Simplified64.0
rmApplied clear-num_binary64_1746864.0
Simplified62.3
rmApplied add-sqr-sqrt_binary64_1749163.2
Applied difference-of-squares_binary64_1743863.2
Applied add-sqr-sqrt_binary64_1749163.2
Applied times-frac_binary64_1747561.4
Applied times-frac_binary64_1747529.6
Applied associate-/r*_binary64_1741329.5
Simplified29.4
if -1.6331768204397996e153 < z < 2.5730812676030823e126Initial program 0.1
if 2.5730812676030823e126 < z Initial program 44.3
rmApplied add-sqr-sqrt_binary64_1749154.3
Applied difference-of-squares_binary64_1743854.3
Applied associate-*r*_binary64_1740931.9
Final simplification3.5
herbie shell --seed 2021043
(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))))