\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2.882304771437299 \cdot 10^{+93}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;x \cdot y \leq -7.344780174854295 \cdot 10^{-186}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;x \cdot y \leq 1.3111738487107896 \cdot 10^{-283}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\mathbf{elif}\;x \cdot y \leq 3.652997212110425 \cdot 10^{+139}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* x y) z))
(FPCore (x y z)
:precision binary64
(if (<= (* x y) -2.882304771437299e+93)
(* y (/ x z))
(if (<= (* x y) -7.344780174854295e-186)
(/ (* x y) z)
(if (<= (* x y) 1.3111738487107896e-283)
(/ y (/ z x))
(if (<= (* x y) 3.652997212110425e+139) (/ (* x y) z) (/ x (/ z y)))))))double code(double x, double y, double z) {
return (x * y) / z;
}
double code(double x, double y, double z) {
double tmp;
if ((x * y) <= -2.882304771437299e+93) {
tmp = y * (x / z);
} else if ((x * y) <= -7.344780174854295e-186) {
tmp = (x * y) / z;
} else if ((x * y) <= 1.3111738487107896e-283) {
tmp = y / (z / x);
} else if ((x * y) <= 3.652997212110425e+139) {
tmp = (x * y) / z;
} else {
tmp = x / (z / y);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.2 |
|---|---|
| Target | 6.3 |
| Herbie | 1.1 |
if (*.f64 x y) < -2.8823047714372988e93Initial program 12.4
rmApplied add-cube-cbrt_binary64_1784513.3
Applied associate-/r*_binary64_1775413.3
Simplified5.9
rmApplied *-un-lft-identity_binary64_178105.9
Applied times-frac_binary64_178165.1
Simplified5.1
Simplified4.1
if -2.8823047714372988e93 < (*.f64 x y) < -7.3447801748542952e-186 or 1.31117384871078956e-283 < (*.f64 x y) < 3.6529972121104252e139Initial program 0.2
if -7.3447801748542952e-186 < (*.f64 x y) < 1.31117384871078956e-283Initial program 12.0
rmApplied add-cube-cbrt_binary64_1784512.3
Applied associate-/r*_binary64_1775412.3
Simplified3.4
rmApplied associate-/l*_binary64_177551.3
Simplified0.7
if 3.6529972121104252e139 < (*.f64 x y) Initial program 18.5
rmApplied associate-/l*_binary64_177552.6
Final simplification1.1
herbie shell --seed 2021093
(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))