\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \le -2.4829212502580601 \cdot 10^{-130} \lor \neg \left(x \cdot y \le 3.353944357483643 \cdot 10^{-120}\right) \land x \cdot y \le 1.48436680561384441 \cdot 10^{38}:\\
\;\;\;\;\frac{1}{z \cdot \frac{\frac{1}{x}}{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}double f(double x, double y, double z) {
double r829558 = x;
double r829559 = y;
double r829560 = r829558 * r829559;
double r829561 = z;
double r829562 = r829560 / r829561;
return r829562;
}
double f(double x, double y, double z) {
double r829563 = x;
double r829564 = y;
double r829565 = r829563 * r829564;
double r829566 = -2.48292125025806e-130;
bool r829567 = r829565 <= r829566;
double r829568 = 3.353944357483643e-120;
bool r829569 = r829565 <= r829568;
double r829570 = !r829569;
double r829571 = 1.4843668056138444e+38;
bool r829572 = r829565 <= r829571;
bool r829573 = r829570 && r829572;
bool r829574 = r829567 || r829573;
double r829575 = 1.0;
double r829576 = z;
double r829577 = r829575 / r829563;
double r829578 = r829577 / r829564;
double r829579 = r829576 * r829578;
double r829580 = r829575 / r829579;
double r829581 = r829576 / r829564;
double r829582 = r829563 / r829581;
double r829583 = r829574 ? r829580 : r829582;
return r829583;
}




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 3.353944357483643e-120 < (* x y) < 1.4843668056138444e+38Initial program 3.8
rmApplied associate-/l*10.3
rmApplied clear-num10.5
rmApplied *-un-lft-identity10.5
Applied div-inv10.6
Applied times-frac3.9
Simplified3.9
Simplified3.9
if -2.48292125025806e-130 < (* x y) < 3.353944357483643e-120 or 1.4843668056138444e+38 < (* x y) Initial program 7.9
rmApplied associate-/l*3.0
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))