\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \le -3.1553374956545372 \cdot 10^{-173}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;x \cdot y \le 3.30239338386023779 \cdot 10^{-200}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\mathbf{elif}\;x \cdot y \le 3.6874275339874201 \cdot 10^{173}:\\
\;\;\;\;\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)) <= -3.1553374956545372e-173)) {
VAR = ((double) (((double) (x * y)) / z));
} else {
double VAR_1;
if ((((double) (x * y)) <= 3.302393383860238e-200)) {
VAR_1 = ((double) (((double) (x / z)) * y));
} else {
double VAR_2;
if ((((double) (x * y)) <= 3.68742753398742e+173)) {
VAR_2 = ((double) (((double) (x * y)) / z));
} else {
VAR_2 = ((double) (x * ((double) (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 | 5.8 |
|---|---|
| Target | 6.3 |
| Herbie | 1.9 |
if (* x y) < -3.1553374956545372e-173 or 3.30239338386023779e-200 < (* x y) < 3.6874275339874201e173Initial program 2.4
if -3.1553374956545372e-173 < (* x y) < 3.30239338386023779e-200Initial program 9.6
rmApplied associate-/l*1.1
rmApplied associate-/r/0.7
if 3.6874275339874201e173 < (* x y) Initial program 19.3
rmApplied *-un-lft-identity19.3
Applied times-frac2.2
Simplified2.2
Final simplification1.9
herbie shell --seed 2020164
(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))