\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 r697106 = x;
double r697107 = y;
double r697108 = r697106 * r697107;
double r697109 = z;
double r697110 = r697108 / r697109;
return r697110;
}
double f(double x, double y, double z) {
double r697111 = x;
double r697112 = y;
double r697113 = r697111 * r697112;
double r697114 = -2.48292125025806e-130;
bool r697115 = r697113 <= r697114;
double r697116 = 1.0;
double r697117 = z;
double r697118 = r697116 / r697117;
double r697119 = r697118 * r697113;
double r697120 = 4.093590320564837e-135;
bool r697121 = r697113 <= r697120;
double r697122 = r697112 / r697117;
double r697123 = r697111 * r697122;
double r697124 = 1.4843668056138444e+38;
bool r697125 = r697113 <= r697124;
double r697126 = r697117 / r697112;
double r697127 = r697111 / r697126;
double r697128 = r697125 ? r697119 : r697127;
double r697129 = r697121 ? r697123 : r697128;
double r697130 = r697115 ? r697119 : r697129;
return r697130;
}




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 clear-num10.5
rmApplied *-un-lft-identity10.5
Applied div-inv10.5
Applied times-frac3.8
Applied add-cube-cbrt3.8
Applied times-frac4.0
Simplified4.0
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
(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))