\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \le -2.2129676655986834 \cdot 10^{108}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{elif}\;x \cdot y \le -9.1676459104440448 \cdot 10^{-181}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;x \cdot y \le 7.03767637656364 \cdot 10^{-242}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{elif}\;x \cdot y \le 1.60210316985900323 \cdot 10^{190}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\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) (x * y)) <= -2.2129676655986834e+108)) {
VAR = ((double) (y / ((double) (z / x))));
} else {
double VAR_1;
if ((((double) (x * y)) <= -9.167645910444045e-181)) {
VAR_1 = ((double) (((double) (x * y)) / z));
} else {
double VAR_2;
if ((((double) (x * y)) <= 7.037676376563638e-242)) {
VAR_2 = ((double) (y / ((double) (z / x))));
} else {
double VAR_3;
if ((((double) (x * y)) <= 1.6021031698590032e+190)) {
VAR_3 = ((double) (((double) (x * y)) / z));
} else {
VAR_3 = ((double) (x * ((double) (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.5 |
|---|---|
| Target | 6.3 |
| Herbie | 0.8 |
if (* x y) < -2.2129676655986834e+108 or -9.167645910444045e-181 < (* x y) < 7.037676376563638e-242Initial program 12.4
rmApplied clear-num12.6
rmApplied associate-/r*2.0
Taylor expanded around 0 12.4
Simplified1.5
if -2.2129676655986834e+108 < (* x y) < -9.167645910444045e-181 or 7.037676376563638e-242 < (* x y) < 1.6021031698590032e+190Initial program 0.2
if 1.6021031698590032e+190 < (* x y) Initial program 25.5
rmApplied *-un-lft-identity25.5
Applied times-frac1.7
Simplified1.7
Final simplification0.8
herbie shell --seed 2020126
(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))