\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -4.41253613397111438599433893468190853575 \cdot 10^{77} \lor \neg \left(z \le 1175910331545633266413439287296\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y}{z} \cdot \cosh x}{x}\\
\end{array}double f(double x, double y, double z) {
double r716914 = x;
double r716915 = cosh(r716914);
double r716916 = y;
double r716917 = r716916 / r716914;
double r716918 = r716915 * r716917;
double r716919 = z;
double r716920 = r716918 / r716919;
return r716920;
}
double f(double x, double y, double z) {
double r716921 = z;
double r716922 = -4.4125361339711144e+77;
bool r716923 = r716921 <= r716922;
double r716924 = 1.1759103315456333e+30;
bool r716925 = r716921 <= r716924;
double r716926 = !r716925;
bool r716927 = r716923 || r716926;
double r716928 = x;
double r716929 = cosh(r716928);
double r716930 = y;
double r716931 = r716928 * r716921;
double r716932 = r716930 / r716931;
double r716933 = r716929 * r716932;
double r716934 = r716930 / r716921;
double r716935 = r716934 * r716929;
double r716936 = r716935 / r716928;
double r716937 = r716927 ? r716933 : r716936;
return r716937;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.7 |
|---|---|
| Target | 0.4 |
| Herbie | 0.5 |
if z < -4.4125361339711144e+77 or 1.1759103315456333e+30 < z Initial program 13.1
rmApplied *-un-lft-identity13.1
Applied times-frac13.1
Simplified13.1
Simplified0.3
if -4.4125361339711144e+77 < z < 1.1759103315456333e+30Initial program 1.1
rmApplied *-un-lft-identity1.1
Applied times-frac1.1
Simplified1.1
Simplified14.8
rmApplied *-un-lft-identity14.8
Applied times-frac0.8
rmApplied associate-*l/0.7
Applied associate-*r/0.7
Simplified0.7
Final simplification0.5
herbie shell --seed 2019362
(FPCore (x y z)
:name "Linear.Quaternion:$ctan from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< y -4.618902267687042e-52) (* (/ (/ y z) x) (cosh x)) (if (< y 1.0385305359351529e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))
(/ (* (cosh x) (/ y x)) z))