\frac{x + y \cdot \left(z - x\right)}{z}\begin{array}{l}
\mathbf{if}\;x \le -86.3371335760888456 \lor \neg \left(x \le 7.7200267136732314 \cdot 10^{-131}\right):\\
\;\;\;\;\left(\frac{x}{z} + y\right) - \frac{x}{\frac{z}{y}}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{x}{z} + y\right) - \frac{x \cdot y}{z}\\
\end{array}double code(double x, double y, double z) {
return ((x + (y * (z - x))) / z);
}
double code(double x, double y, double z) {
double VAR;
if (((x <= -86.33713357608885) || !(x <= 7.720026713673231e-131))) {
VAR = (((x / z) + y) - (x / (z / y)));
} else {
VAR = (((x / z) + y) - ((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.3 |
if x < -86.33713357608885 or 7.720026713673231e-131 < x Initial program 12.2
Taylor expanded around 0 6.6
rmApplied associate-/l*0.6
if -86.33713357608885 < x < 7.720026713673231e-131Initial program 8.4
Taylor expanded around 0 0.0
Final simplification0.3
herbie shell --seed 2020103
(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))