\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \le -2.4829212502580601 \cdot 10^{-130}:\\
\;\;\;\;\frac{1}{z} \cdot \left(x \cdot y\right)\\
\mathbf{elif}\;x \cdot y \le 4.09359032056483698 \cdot 10^{-135}:\\
\;\;\;\;x \cdot \frac{y}{z}\\
\mathbf{elif}\;x \cdot y \le 1.48436680561384441 \cdot 10^{38}:\\
\;\;\;\;\frac{1}{z} \cdot \left(x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}double f(double x, double y, double z) {
double r769059 = x;
double r769060 = y;
double r769061 = r769059 * r769060;
double r769062 = z;
double r769063 = r769061 / r769062;
return r769063;
}
double f(double x, double y, double z) {
double r769064 = x;
double r769065 = y;
double r769066 = r769064 * r769065;
double r769067 = -2.48292125025806e-130;
bool r769068 = r769066 <= r769067;
double r769069 = 1.0;
double r769070 = z;
double r769071 = r769069 / r769070;
double r769072 = r769071 * r769066;
double r769073 = 4.093590320564837e-135;
bool r769074 = r769066 <= r769073;
double r769075 = r769065 / r769070;
double r769076 = r769064 * r769075;
double r769077 = 1.4843668056138444e+38;
bool r769078 = r769066 <= r769077;
double r769079 = r769070 / r769065;
double r769080 = r769064 / r769079;
double r769081 = r769078 ? r769072 : r769080;
double r769082 = r769074 ? r769076 : r769081;
double r769083 = r769068 ? r769072 : r769082;
return r769083;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.0 |
|---|---|
| Target | 6.6 |
| Herbie | 3.4 |
if (* x y) < -2.48292125025806e-130 or 4.093590320564837e-135 < (* x y) < 1.4843668056138444e+38Initial program 3.7
rmApplied associate-/l*10.2
rmApplied div-inv10.3
Applied *-un-lft-identity10.3
Applied times-frac3.9
Simplified3.8
if -2.48292125025806e-130 < (* x y) < 4.093590320564837e-135Initial program 7.5
rmApplied *-un-lft-identity7.5
Applied times-frac1.4
Simplified1.4
if 1.4843668056138444e+38 < (* x y) Initial program 9.3
rmApplied associate-/l*6.2
Final simplification3.4
herbie shell --seed 2020046 +o rules:numerics
(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))