\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \le -4.4795481217015377 \cdot 10^{-218} \lor \neg \left(x \cdot y \le 1.36108928858102591 \cdot 10^{-243}\right) \land x \cdot y \le 5.58670820551259035 \cdot 10^{230}:\\
\;\;\;\;\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)) <= -4.4795481217015377e-218) || (!(((double) (x * y)) <= 1.361089288581026e-243) && (((double) (x * y)) <= 5.58670820551259e+230)))) {
VAR = ((double) (((double) (x * y)) / z));
} else {
VAR = ((double) (x * ((double) (y / z))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.2 |
|---|---|
| Target | 6.3 |
| Herbie | 1.7 |
if (* x y) < -4.4795481217015377e-218 or 1.36108928858102591e-243 < (* x y) < 5.58670820551259035e230Initial program 2.3
if -4.4795481217015377e-218 < (* x y) < 1.36108928858102591e-243 or 5.58670820551259035e230 < (* x y) Initial program 15.7
Simplified0.2
Final simplification1.7
herbie shell --seed 2020181
(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))