\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.4024571977887486 \cdot 10^{+230}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;x \cdot y \leq -5.9589954090699305 \cdot 10^{-145} \lor \neg \left(x \cdot y \leq -0\right) \land x \cdot y \leq 1.7296203136662388 \cdot 10^{+181}:\\
\;\;\;\;\left(x \cdot y\right) \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{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)) <= -2.4024571977887486e+230)) {
VAR = ((double) (y * (x / z)));
} else {
double VAR_1;
if (((((double) (x * y)) <= -5.9589954090699305e-145) || (!(((double) (x * y)) <= -0.0) && (((double) (x * y)) <= 1.7296203136662388e+181)))) {
VAR_1 = ((double) (((double) (x * y)) * (1.0 / z)));
} else {
VAR_1 = ((double) (x * (y / z)));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.3 |
|---|---|
| Target | 6.2 |
| Herbie | 0.6 |
if (* x y) < -2.40245719778874865e230Initial program 33.3
rmApplied add-cube-cbrt33.8
Applied times-frac1.4
Taylor expanded around 0 33.3
Simplified0.6
if -2.40245719778874865e230 < (* x y) < -5.9589954090699305e-145 or -0.0 < (* x y) < 1.72962031366623875e181Initial program 0.4
rmApplied div-inv0.5
if -5.9589954090699305e-145 < (* x y) < -0.0 or 1.72962031366623875e181 < (* x y) Initial program 14.2
Simplified1.0
Final simplification0.6
herbie shell --seed 2020199
(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))