\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \le -1.39299103375843131 \cdot 10^{-89}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;x \cdot y \le 0.0:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;x \cdot y \le 3.9220340091600002 \cdot 10^{156}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot 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) (x * y)) <= -1.3929910337584313e-89)) {
VAR = ((double) (((double) (x * y)) / z));
} else {
double VAR_1;
if ((((double) (x * y)) <= 0.0)) {
VAR_1 = ((double) (x * ((double) (y / z))));
} else {
double VAR_2;
if ((((double) (x * y)) <= 3.92203400916e+156)) {
VAR_2 = ((double) (((double) (x * y)) / z));
} else {
VAR_2 = ((double) (((double) (x / 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.2 |
|---|---|
| Target | 6.5 |
| Herbie | 2.7 |
if (* x y) < -1.39299103375843131e-89 or 0.0 < (* x y) < 3.9220340091600002e156Initial program 3.0
if -1.39299103375843131e-89 < (* x y) < 0.0Initial program 9.8
rmApplied *-un-lft-identity9.8
Applied times-frac1.9
Simplified1.9
if 3.9220340091600002e156 < (* x y) Initial program 18.5
rmApplied associate-/l*1.9
rmApplied associate-/r/3.7
Final simplification2.7
herbie shell --seed 2020155
(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))