\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;\frac{x \cdot y}{z} \le -3.95253 \cdot 10^{-323}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;\frac{x \cdot y}{z} \le 1.25608554375454006 \cdot 10^{-255}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\mathbf{elif}\;\frac{x \cdot y}{z} \le 9.4322673509474408 \cdot 10^{246}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}double code(double x, double y, double z) {
return ((double) (((double) (x * y)) / z));
}
double code(double x, double y, double z) {
double VAR;
if ((((double) (((double) (x * y)) / z)) <= -3.95252516673e-323)) {
VAR = ((double) (((double) (x * y)) / z));
} else {
double VAR_1;
if ((((double) (((double) (x * y)) / z)) <= 1.25608554375454e-255)) {
VAR_1 = ((double) (((double) (x / z)) * y));
} else {
double VAR_2;
if ((((double) (((double) (x * y)) / z)) <= 9.43226735094744e+246)) {
VAR_2 = ((double) (((double) (x * y)) / z));
} else {
VAR_2 = ((double) (x / ((double) (z / y))));
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.1 |
|---|---|
| Target | 6.3 |
| Herbie | 2.7 |
if (/ (* x y) z) < -3.95252516673e-323 or 1.25608554375454e-255 < (/ (* x y) z) < 9.43226735094744e+246Initial program 2.6
if -3.95252516673e-323 < (/ (* x y) z) < 1.25608554375454e-255Initial program 10.3
rmApplied associate-/l*1.6
rmApplied associate-/r/1.8
if 9.43226735094744e+246 < (/ (* x y) z) Initial program 33.8
rmApplied associate-/l*8.5
Final simplification2.7
herbie shell --seed 2020121
(FPCore (x y z)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< z -4.262230790519429e-138) (/ (* x y) z) (if (< z 1.7042130660650472e-164) (/ x (/ z y)) (* (/ x z) y)))
(/ (* x y) z))