\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \le -5.2328744243323012 \cdot 10^{278}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;x \cdot y \le -1.5805766248223962 \cdot 10^{-144}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;x \cdot y \le 5.43472 \cdot 10^{-323}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{elif}\;x \cdot y \le 3.6477517440137462 \cdot 10^{127}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\end{array}double code(double x, double y, double z) {
return ((x * y) / z);
}
double code(double x, double y, double z) {
double VAR;
if (((x * y) <= -5.232874424332301e+278)) {
VAR = (x * (y / z));
} else {
double VAR_1;
if (((x * y) <= -1.5805766248223962e-144)) {
VAR_1 = ((x * y) / z);
} else {
double VAR_2;
if (((x * y) <= 5.4347221042537e-323)) {
VAR_2 = (x / (z / y));
} else {
double VAR_3;
if (((x * y) <= 3.647751744013746e+127)) {
VAR_3 = ((x * y) / z);
} else {
VAR_3 = (x * (y / z));
}
VAR_2 = VAR_3;
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.0 |
|---|---|
| Target | 6.1 |
| Herbie | 0.8 |
if (* x y) < -5.232874424332301e+278 or 3.647751744013746e+127 < (* x y) Initial program 22.0
rmApplied *-un-lft-identity22.0
Applied times-frac2.9
Simplified2.9
if -5.232874424332301e+278 < (* x y) < -1.5805766248223962e-144 or 5.4347221042537e-323 < (* x y) < 3.647751744013746e+127Initial program 0.3
if -1.5805766248223962e-144 < (* x y) < 5.4347221042537e-323Initial program 11.1
rmApplied associate-/l*1.0
Final simplification0.8
herbie shell --seed 2020100
(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))