\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;\frac{\cosh x \cdot \frac{y}{x}}{z} \le -2132121890186478992287162732707315712:\\
\;\;\;\;\frac{1}{\frac{2 \cdot x}{\frac{\left(e^{x} + e^{-x}\right) \cdot y}{z}}}\\
\mathbf{elif}\;\frac{\cosh x \cdot \frac{y}{x}}{z} \le 2.012757038928455801214359719345400453991 \cdot 10^{-70}:\\
\;\;\;\;\frac{\left(e^{x} + e^{-x}\right) \cdot y}{z \cdot \left(2 \cdot x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(e^{x} + e^{-x}\right) \cdot y}{z}}{2 \cdot x}\\
\end{array}double f(double x, double y, double z) {
double r397821 = x;
double r397822 = cosh(r397821);
double r397823 = y;
double r397824 = r397823 / r397821;
double r397825 = r397822 * r397824;
double r397826 = z;
double r397827 = r397825 / r397826;
return r397827;
}
double f(double x, double y, double z) {
double r397828 = x;
double r397829 = cosh(r397828);
double r397830 = y;
double r397831 = r397830 / r397828;
double r397832 = r397829 * r397831;
double r397833 = z;
double r397834 = r397832 / r397833;
double r397835 = -2.132121890186479e+36;
bool r397836 = r397834 <= r397835;
double r397837 = 1.0;
double r397838 = 2.0;
double r397839 = r397838 * r397828;
double r397840 = exp(r397828);
double r397841 = -r397828;
double r397842 = exp(r397841);
double r397843 = r397840 + r397842;
double r397844 = r397843 * r397830;
double r397845 = r397844 / r397833;
double r397846 = r397839 / r397845;
double r397847 = r397837 / r397846;
double r397848 = 2.0127570389284558e-70;
bool r397849 = r397834 <= r397848;
double r397850 = r397833 * r397839;
double r397851 = r397844 / r397850;
double r397852 = r397845 / r397839;
double r397853 = r397849 ? r397851 : r397852;
double r397854 = r397836 ? r397847 : r397853;
return r397854;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.7 |
|---|---|
| Target | 0.4 |
| Herbie | 0.5 |
if (/ (* (cosh x) (/ y x)) z) < -2.132121890186479e+36Initial program 14.0
rmApplied cosh-def14.0
Applied frac-times14.0
Applied associate-/l/12.5
rmApplied associate-/r*0.3
rmApplied clear-num0.4
if -2.132121890186479e+36 < (/ (* (cosh x) (/ y x)) z) < 2.0127570389284558e-70Initial program 0.2
rmApplied cosh-def0.2
Applied frac-times0.2
Applied associate-/l/0.4
if 2.0127570389284558e-70 < (/ (* (cosh x) (/ y x)) z) Initial program 11.0
rmApplied cosh-def11.0
Applied frac-times11.1
Applied associate-/l/10.7
rmApplied associate-/r*0.8
Final simplification0.5
herbie shell --seed 2019212
(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))