\frac{x + y \cdot \left(z - x\right)}{z}\begin{array}{l}
\mathbf{if}\;z \le -27923.65336547152 \lor \neg \left(z \le 1.1134406296109404 \cdot 10^{42}\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 <= -27923.653365471517) || !(z <= 1.1134406296109404e+42))) {
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.0 |
|---|---|
| Target | 0.0 |
| Herbie | 0.1 |
if z < -27923.65336547152 or 1.1134406296109404e42 < z Initial program 17.6
Taylor expanded around 0 6.3
rmApplied *-un-lft-identity6.3
Applied times-frac0.0
Simplified0.0
if -27923.65336547152 < z < 1.1134406296109404e42Initial program 0.3
Taylor expanded around 0 0.2
Final simplification0.1
herbie shell --seed 2020152
(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))