\frac{x \cdot y}{z}\begin{array}{l}
\mathbf{if}\;x \cdot y \le -1.394495778794157817173263708359068376665 \cdot 10^{144}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\mathbf{elif}\;x \cdot y \le -2.091115834215142392182824625708863732465 \cdot 10^{-215}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{elif}\;x \cdot y \le 1.107151871760683778945393640864932427286 \cdot 10^{-309}:\\
\;\;\;\;\frac{x}{\frac{z}{y}}\\
\mathbf{elif}\;x \cdot y \le 8.013896806549786117243748175613103383758 \cdot 10^{151}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\end{array}double f(double x, double y, double z) {
double r917881 = x;
double r917882 = y;
double r917883 = r917881 * r917882;
double r917884 = z;
double r917885 = r917883 / r917884;
return r917885;
}
double f(double x, double y, double z) {
double r917886 = x;
double r917887 = y;
double r917888 = r917886 * r917887;
double r917889 = -1.3944957787941578e+144;
bool r917890 = r917888 <= r917889;
double r917891 = z;
double r917892 = r917886 / r917891;
double r917893 = r917892 * r917887;
double r917894 = -2.0911158342151424e-215;
bool r917895 = r917888 <= r917894;
double r917896 = r917888 / r917891;
double r917897 = 1.107151871760684e-309;
bool r917898 = r917888 <= r917897;
double r917899 = r917891 / r917887;
double r917900 = r917886 / r917899;
double r917901 = 8.013896806549786e+151;
bool r917902 = r917888 <= r917901;
double r917903 = r917902 ? r917896 : r917893;
double r917904 = r917898 ? r917900 : r917903;
double r917905 = r917895 ? r917896 : r917904;
double r917906 = r917890 ? r917893 : r917905;
return r917906;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 6.4 |
|---|---|
| Target | 6.3 |
| Herbie | 0.7 |
if (* x y) < -1.3944957787941578e+144 or 8.013896806549786e+151 < (* x y) Initial program 19.0
rmApplied associate-/l*2.4
rmApplied associate-/r/3.0
if -1.3944957787941578e+144 < (* x y) < -2.0911158342151424e-215 or 1.107151871760684e-309 < (* x y) < 8.013896806549786e+151Initial program 0.2
rmApplied associate-/l*9.4
rmApplied *-un-lft-identity9.4
Applied add-cube-cbrt10.2
Applied times-frac10.2
Applied *-un-lft-identity10.2
Applied times-frac2.9
Simplified2.9
rmApplied associate-*l/2.9
Simplified2.9
Taylor expanded around 0 0.2
if -2.0911158342151424e-215 < (* x y) < 1.107151871760684e-309Initial program 14.4
rmApplied associate-/l*0.3
Final simplification0.7
herbie shell --seed 2019353
(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))