\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \le -1.20767702168173617 \cdot 10^{-132} \lor \neg \left(x \cdot y \le 0.0 \lor \neg \left(x \cdot y \le 1.4448027941880176 \cdot 10^{194}\right)\right):\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}double f(double x, double y, double z) {
double r627809 = x;
double r627810 = y;
double r627811 = r627809 * r627810;
double r627812 = z;
double r627813 = r627811 / r627812;
return r627813;
}
double f(double x, double y, double z) {
double r627814 = x;
double r627815 = y;
double r627816 = r627814 * r627815;
double r627817 = -1.2076770216817362e-132;
bool r627818 = r627816 <= r627817;
double r627819 = 0.0;
bool r627820 = r627816 <= r627819;
double r627821 = 1.4448027941880176e+194;
bool r627822 = r627816 <= r627821;
double r627823 = !r627822;
bool r627824 = r627820 || r627823;
double r627825 = !r627824;
bool r627826 = r627818 || r627825;
double r627827 = z;
double r627828 = r627816 / r627827;
double r627829 = r627827 / r627815;
double r627830 = r627814 / r627829;
double r627831 = r627826 ? r627828 : r627830;
return r627831;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.3 |
|---|---|
| Target | 6.2 |
| Herbie | 2.2 |
if (* x y) < -1.2076770216817362e-132 or 0.0 < (* x y) < 1.4448027941880176e+194Initial program 2.8
if -1.2076770216817362e-132 < (* x y) < 0.0 or 1.4448027941880176e+194 < (* x y) Initial program 13.7
rmApplied associate-/l*1.0
Final simplification2.2
herbie shell --seed 2020024
(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))