\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -7.86664282492854740730204323783673108712 \cdot 10^{65}:\\
\;\;\;\;\frac{\frac{e^{x} \cdot y + \frac{y}{e^{x}}}{2}}{x \cdot z}\\
\mathbf{elif}\;z \le 7.966049154723343466287174107454135040236 \cdot 10^{-53}:\\
\;\;\;\;\frac{\frac{\frac{e^{x} \cdot y + \frac{y}{e^{x}}}{z}}{2}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{e^{x} \cdot y + \frac{y}{e^{x}}}{2}}{x \cdot z}\\
\end{array}double f(double x, double y, double z) {
double r22985901 = x;
double r22985902 = cosh(r22985901);
double r22985903 = y;
double r22985904 = r22985903 / r22985901;
double r22985905 = r22985902 * r22985904;
double r22985906 = z;
double r22985907 = r22985905 / r22985906;
return r22985907;
}
double f(double x, double y, double z) {
double r22985908 = z;
double r22985909 = -7.866642824928547e+65;
bool r22985910 = r22985908 <= r22985909;
double r22985911 = x;
double r22985912 = exp(r22985911);
double r22985913 = y;
double r22985914 = r22985912 * r22985913;
double r22985915 = r22985913 / r22985912;
double r22985916 = r22985914 + r22985915;
double r22985917 = 2.0;
double r22985918 = r22985916 / r22985917;
double r22985919 = r22985911 * r22985908;
double r22985920 = r22985918 / r22985919;
double r22985921 = 7.9660491547233435e-53;
bool r22985922 = r22985908 <= r22985921;
double r22985923 = r22985916 / r22985908;
double r22985924 = r22985923 / r22985917;
double r22985925 = r22985924 / r22985911;
double r22985926 = r22985922 ? r22985925 : r22985920;
double r22985927 = r22985910 ? r22985920 : r22985926;
return r22985927;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 8.0 |
|---|---|
| Target | 0.5 |
| Herbie | 0.6 |
if z < -7.866642824928547e+65 or 7.9660491547233435e-53 < z Initial program 11.8
rmApplied associate-*r/11.8
Applied associate-/l/0.6
rmApplied cosh-def0.6
Applied associate-*l/0.6
Simplified0.6
if -7.866642824928547e+65 < z < 7.9660491547233435e-53Initial program 1.0
rmApplied associate-*r/1.0
Applied associate-/l/17.5
rmApplied cosh-def17.5
Applied associate-*l/17.5
Simplified17.5
rmApplied associate-/r*0.8
Simplified0.8
Final simplification0.6
herbie shell --seed 2019174
(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))