\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \le -3.7422477441071717 \cdot 10^{287}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\mathbf{elif}\;x \cdot y \le -4.10429083584695144 \cdot 10^{-162} \lor \neg \left(x \cdot y \le 3.3281391811522597 \cdot 10^{-203}\right) \land x \cdot y \le 1.32202209694643531 \cdot 10^{136}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\end{array}double f(double x, double y, double z) {
double r520915 = x;
double r520916 = y;
double r520917 = r520915 * r520916;
double r520918 = z;
double r520919 = r520917 / r520918;
return r520919;
}
double f(double x, double y, double z) {
double r520920 = x;
double r520921 = y;
double r520922 = r520920 * r520921;
double r520923 = -3.742247744107172e+287;
bool r520924 = r520922 <= r520923;
double r520925 = z;
double r520926 = r520920 / r520925;
double r520927 = r520926 * r520921;
double r520928 = -4.1042908358469514e-162;
bool r520929 = r520922 <= r520928;
double r520930 = 3.32813918115226e-203;
bool r520931 = r520922 <= r520930;
double r520932 = !r520931;
double r520933 = 1.3220220969464353e+136;
bool r520934 = r520922 <= r520933;
bool r520935 = r520932 && r520934;
bool r520936 = r520929 || r520935;
double r520937 = r520922 / r520925;
double r520938 = r520925 / r520921;
double r520939 = r520920 / r520938;
double r520940 = r520936 ? r520937 : r520939;
double r520941 = r520924 ? r520927 : r520940;
return r520941;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.5 |
|---|---|
| Target | 6.3 |
| Herbie | 0.7 |
if (* x y) < -3.742247744107172e+287Initial program 54.3
rmApplied associate-/l*0.3
rmApplied associate-/r/0.3
if -3.742247744107172e+287 < (* x y) < -4.1042908358469514e-162 or 3.32813918115226e-203 < (* x y) < 1.3220220969464353e+136Initial program 0.2
if -4.1042908358469514e-162 < (* x y) < 3.32813918115226e-203 or 1.3220220969464353e+136 < (* x y) Initial program 12.4
rmApplied associate-/l*1.3
Final simplification0.7
herbie shell --seed 2019199
(FPCore (x y z)
:name "Diagrams.Solve.Tridiagonal:solveCyclicTriDiagonal from diagrams-solve-0.1, A"
:herbie-target
(if (< z -4.262230790519429e-138) (/ (* x y) z) (if (< z 1.7042130660650472e-164) (/ x (/ z y)) (* (/ x z) y)))
(/ (* x y) z))