\frac{x + y \cdot \left(z - x\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -3.65301397789678598 \cdot 10^{-37} \lor \neg \left(z \le 2.20000429689763433 \cdot 10^{-45}\right):\\
\;\;\;\;\left(\frac{x}{z} + y\right) - x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \left(z - x\right)}{z}\\
\end{array}double code(double x, double y, double z) {
return ((double) (((double) (x + ((double) (y * ((double) (z - x)))))) / z));
}
double code(double x, double y, double z) {
double VAR;
if (((z <= -3.653013977896786e-37) || !(z <= 2.2000042968976343e-45))) {
VAR = ((double) (((double) (((double) (x / z)) + y)) - ((double) (x * ((double) (y / z))))));
} else {
VAR = ((double) (((double) (x + ((double) (y * ((double) (z - x)))))) / z));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 9.8 |
|---|---|
| Target | 0.0 |
| Herbie | 0.1 |
if z < -3.65301397789678598e-37 or 2.20000429689763433e-45 < z Initial program 14.6
Taylor expanded around 0 4.8
rmApplied *-un-lft-identity4.8
Applied times-frac0.2
Simplified0.2
if -3.65301397789678598e-37 < z < 2.20000429689763433e-45Initial program 0.1
Final simplification0.1
herbie shell --seed 2020161
(FPCore (x y z)
:name "Diagrams.Backend.Rasterific:rasterificRadialGradient from diagrams-rasterific-1.3.1.3"
:precision binary64
:herbie-target
(- (+ y (/ x z)) (/ y (/ z x)))
(/ (+ x (* y (- z x))) z))