\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -1.127846607674739281554471432647215989737 \cdot 10^{141}:\\
\;\;\;\;\frac{\frac{\frac{1}{2}}{x}}{\frac{z}{y \cdot \left(e^{-x} + e^{x}\right)}}\\
\mathbf{elif}\;y \le 26250898118978766400982614016:\\
\;\;\;\;\frac{\frac{\left(\frac{1}{2} \cdot \left(e^{-x} + e^{x}\right)\right) \cdot y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{2} \cdot \frac{x \cdot y}{z} + \frac{y}{x \cdot z}\\
\end{array}double f(double x, double y, double z) {
double r360924 = x;
double r360925 = cosh(r360924);
double r360926 = y;
double r360927 = r360926 / r360924;
double r360928 = r360925 * r360927;
double r360929 = z;
double r360930 = r360928 / r360929;
return r360930;
}
double f(double x, double y, double z) {
double r360931 = y;
double r360932 = -1.1278466076747393e+141;
bool r360933 = r360931 <= r360932;
double r360934 = 0.5;
double r360935 = x;
double r360936 = r360934 / r360935;
double r360937 = z;
double r360938 = -r360935;
double r360939 = exp(r360938);
double r360940 = exp(r360935);
double r360941 = r360939 + r360940;
double r360942 = r360931 * r360941;
double r360943 = r360937 / r360942;
double r360944 = r360936 / r360943;
double r360945 = 2.6250898118978766e+28;
bool r360946 = r360931 <= r360945;
double r360947 = r360934 * r360941;
double r360948 = r360947 * r360931;
double r360949 = r360948 / r360935;
double r360950 = r360949 / r360937;
double r360951 = r360935 * r360931;
double r360952 = r360951 / r360937;
double r360953 = r360934 * r360952;
double r360954 = r360935 * r360937;
double r360955 = r360931 / r360954;
double r360956 = r360953 + r360955;
double r360957 = r360946 ? r360950 : r360956;
double r360958 = r360933 ? r360944 : r360957;
return r360958;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.8 |
|---|---|
| Target | 0.5 |
| Herbie | 1.4 |
if y < -1.1278466076747393e+141Initial program 36.1
Taylor expanded around inf 36.1
Simplified36.1
rmApplied div-inv36.2
Applied times-frac36.2
Applied associate-/l*0.5
Simplified0.5
if -1.1278466076747393e+141 < y < 2.6250898118978766e+28Initial program 1.5
Taylor expanded around inf 1.5
Simplified1.5
rmApplied *-un-lft-identity1.5
Applied associate-/r/1.6
Applied times-frac9.3
Simplified9.3
rmApplied associate-*r/1.6
Simplified1.5
if 2.6250898118978766e+28 < y Initial program 25.0
Taylor expanded around inf 25.0
Simplified25.0
Taylor expanded around 0 1.3
Final simplification1.4
herbie shell --seed 2019305
(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.03853053593515302e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))
(/ (* (cosh x) (/ y x)) z))