\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.3223259751325834 \cdot 10^{+220}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;x \cdot y \leq -5.368407950621961 \cdot 10^{-169}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;x \cdot y \leq 5.4838713756939765 \cdot 10^{-233} \lor \neg \left(x \cdot y \leq 1.413306160411407 \cdot 10^{+170}\right):\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\
\end{array}double code(double x, double y, double z) {
return (((double) (x * y)) / z);
}
double code(double x, double y, double z) {
double VAR;
if ((((double) (x * y)) <= -1.3223259751325834e+220)) {
VAR = ((double) (y * (x / z)));
} else {
double VAR_1;
if ((((double) (x * y)) <= -5.368407950621961e-169)) {
VAR_1 = (((double) (x * y)) / z);
} else {
double VAR_2;
if (((((double) (x * y)) <= 5.4838713756939765e-233) || !(((double) (x * y)) <= 1.413306160411407e+170))) {
VAR_2 = ((double) (x * (y / z)));
} else {
VAR_2 = ((double) (((double) (x * y)) * (1.0 / 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.4 |
|---|---|
| Target | 6.0 |
| Herbie | 0.5 |
if (* x y) < -1.32232597513258336e220Initial program 31.4
Simplified0.8
rmApplied add-cube-cbrt1.9
Applied associate-*l*1.9
Simplified1.5
Taylor expanded around 0 31.4
Simplified0.8
if -1.32232597513258336e220 < (* x y) < -5.368407950621961e-169Initial program 0.2
if -5.368407950621961e-169 < (* x y) < 5.4838713756939765e-233 or 1.413306160411407e170 < (* x y) Initial program 13.1
Simplified0.8
if 5.4838713756939765e-233 < (* x y) < 1.413306160411407e170Initial program 0.2
Simplified9.3
rmApplied div-inv9.4
Applied associate-*r*0.3
Final simplification0.5
herbie shell --seed 2020196
(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))