\frac{x + y \cdot \left(z - x\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -9.94216446941703258 \cdot 10^{122} \lor \neg \left(z \le 1.50650054871705328 \cdot 10^{-115}\right):\\
\;\;\;\;\left(\frac{x}{z} + y\right) - x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{x}{z} + y\right) - \frac{x \cdot y}{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 <= -9.942164469417033e+122) || !(z <= 1.5065005487170533e-115))) {
VAR = ((double) (((double) (((double) (x / z)) + y)) - ((double) (x * ((double) (y / z))))));
} else {
VAR = ((double) (((double) (((double) (x / z)) + y)) - ((double) (((double) (x * y)) / z))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 10.4 |
|---|---|
| Target | 0.0 |
| Herbie | 0.6 |
if z < -9.94216446941703258e122 or 1.50650054871705328e-115 < z Initial program 16.2
Taylor expanded around 0 5.0
rmApplied *-un-lft-identity5.0
Applied times-frac0.4
Simplified0.4
if -9.94216446941703258e122 < z < 1.50650054871705328e-115Initial program 2.1
Taylor expanded around 0 0.8
Final simplification0.6
herbie shell --seed 2020162
(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))