\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \le -1.479973884495300604070714800261381475132 \cdot 10^{167}:\\
\;\;\;\;y \cdot \frac{x}{z}\\
\mathbf{elif}\;x \cdot y \le -1.416209028111420696434446461734804676286 \cdot 10^{-165} \lor \neg \left(x \cdot y \le 6.735758574504119133242399316181506457656 \cdot 10^{-122}\right):\\
\;\;\;\;\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 r460570 = x;
double r460571 = y;
double r460572 = r460570 * r460571;
double r460573 = z;
double r460574 = r460572 / r460573;
return r460574;
}
double f(double x, double y, double z) {
double r460575 = x;
double r460576 = y;
double r460577 = r460575 * r460576;
double r460578 = -1.4799738844953006e+167;
bool r460579 = r460577 <= r460578;
double r460580 = z;
double r460581 = r460575 / r460580;
double r460582 = r460576 * r460581;
double r460583 = -1.4162090281114207e-165;
bool r460584 = r460577 <= r460583;
double r460585 = 6.735758574504119e-122;
bool r460586 = r460577 <= r460585;
double r460587 = !r460586;
bool r460588 = r460584 || r460587;
double r460589 = 1.0;
double r460590 = r460589 / r460580;
double r460591 = r460590 * r460577;
double r460592 = r460580 / r460576;
double r460593 = r460575 / r460592;
double r460594 = r460588 ? r460591 : r460593;
double r460595 = r460579 ? r460582 : r460594;
return r460595;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.3 |
|---|---|
| Target | 6.3 |
| Herbie | 2.7 |
if (* x y) < -1.4799738844953006e+167Initial program 19.6
rmApplied associate-/l*1.7
rmApplied clear-num1.7
Taylor expanded around 0 19.6
Simplified2.4
if -1.4799738844953006e+167 < (* x y) < -1.4162090281114207e-165 or 6.735758574504119e-122 < (* x y) Initial program 3.2
rmApplied associate-/l*9.9
rmApplied div-inv10.0
Applied *-un-lft-identity10.0
Applied times-frac3.4
Simplified3.3
if -1.4162090281114207e-165 < (* x y) < 6.735758574504119e-122Initial program 8.6
rmApplied associate-/l*1.6
Final simplification2.7
herbie shell --seed 2019323 +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))