\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \le -2.4396634972759232 \cdot 10^{292}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;x \cdot y \le -3.08805406789778334 \cdot 10^{-230}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;x \cdot y \le 5.787826098283795 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{x}{z}}{\frac{1}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 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.4396634972759232e+292)) {
VAR = ((double) (x * ((double) (y / z))));
} else {
double VAR_1;
if ((((double) (x * y)) <= -3.0880540678977833e-230)) {
VAR_1 = ((double) (((double) (x * y)) / z));
} else {
double VAR_2;
if ((((double) (x * y)) <= 5.7878260982838e-310)) {
VAR_2 = ((double) (((double) (x / z)) / ((double) (1.0 / y))));
} else {
VAR_2 = ((double) (((double) (x * y)) / z));
}
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.4 |
| Herbie | 1.8 |
if (* x y) < -2.4396634972759232e+292Initial program 56.8
rmApplied *-un-lft-identity56.8
Applied times-frac0.3
Simplified0.3
if -2.4396634972759232e+292 < (* x y) < -3.0880540678977833e-230 or 5.7878260982838e-310 < (* x y) Initial program 2.3
if -3.0880540678977833e-230 < (* x y) < 5.7878260982838e-310Initial program 14.4
rmApplied associate-/l*0.2
rmApplied div-inv0.2
Applied associate-/r*0.2
Final simplification1.8
herbie shell --seed 2020147
(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))