\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -9.318083108674960798059641283288945178294 \cdot 10^{-34}:\\
\;\;\;\;\frac{\cosh x \cdot y}{x \cdot z}\\
\mathbf{elif}\;z \le 2.232206736370805648104041633838868572772 \cdot 10^{46}:\\
\;\;\;\;\frac{\frac{\frac{y}{e^{x}} + y \cdot e^{x}}{x \cdot 2}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x \cdot y}{x \cdot z}\\
\end{array}double f(double x, double y, double z) {
double r21634867 = x;
double r21634868 = cosh(r21634867);
double r21634869 = y;
double r21634870 = r21634869 / r21634867;
double r21634871 = r21634868 * r21634870;
double r21634872 = z;
double r21634873 = r21634871 / r21634872;
return r21634873;
}
double f(double x, double y, double z) {
double r21634874 = z;
double r21634875 = -9.31808310867496e-34;
bool r21634876 = r21634874 <= r21634875;
double r21634877 = x;
double r21634878 = cosh(r21634877);
double r21634879 = y;
double r21634880 = r21634878 * r21634879;
double r21634881 = r21634877 * r21634874;
double r21634882 = r21634880 / r21634881;
double r21634883 = 2.2322067363708056e+46;
bool r21634884 = r21634874 <= r21634883;
double r21634885 = exp(r21634877);
double r21634886 = r21634879 / r21634885;
double r21634887 = r21634879 * r21634885;
double r21634888 = r21634886 + r21634887;
double r21634889 = 2.0;
double r21634890 = r21634877 * r21634889;
double r21634891 = r21634888 / r21634890;
double r21634892 = r21634891 / r21634874;
double r21634893 = r21634884 ? r21634892 : r21634882;
double r21634894 = r21634876 ? r21634882 : r21634893;
return r21634894;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.9 |
|---|---|
| Target | 0.4 |
| Herbie | 0.5 |
if z < -9.31808310867496e-34 or 2.2322067363708056e+46 < z Initial program 12.1
rmApplied associate-*r/12.1
Applied associate-/l/0.4
if -9.31808310867496e-34 < z < 2.2322067363708056e+46Initial program 0.7
rmApplied cosh-def0.7
Applied frac-times0.7
Simplified0.7
Final simplification0.5
herbie shell --seed 2019172 +o rules:numerics
(FPCore (x y z)
:name "Linear.Quaternion:$ctan from linear-1.19.1.3"
:herbie-target
(if (< y -4.618902267687042e-52) (* (/ (/ y z) x) (cosh x)) (if (< y 1.038530535935153e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))
(/ (* (cosh x) (/ y x)) z))