\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -12403175825184520:\\
\;\;\;\;\frac{\frac{\cosh x}{\frac{z}{y}}}{x}\\
\mathbf{elif}\;y \le 4.70989780554481168 \cdot 10^{-7}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x}{\frac{\cosh x \cdot y}{z}}}\\
\end{array}double f(double x, double y, double z) {
double r462914 = x;
double r462915 = cosh(r462914);
double r462916 = y;
double r462917 = r462916 / r462914;
double r462918 = r462915 * r462917;
double r462919 = z;
double r462920 = r462918 / r462919;
return r462920;
}
double f(double x, double y, double z) {
double r462921 = y;
double r462922 = -1.240317582518452e+16;
bool r462923 = r462921 <= r462922;
double r462924 = x;
double r462925 = cosh(r462924);
double r462926 = z;
double r462927 = r462926 / r462921;
double r462928 = r462925 / r462927;
double r462929 = r462928 / r462924;
double r462930 = 4.7098978055448117e-07;
bool r462931 = r462921 <= r462930;
double r462932 = r462925 * r462921;
double r462933 = r462932 / r462924;
double r462934 = r462933 / r462926;
double r462935 = 1.0;
double r462936 = r462932 / r462926;
double r462937 = r462924 / r462936;
double r462938 = r462935 / r462937;
double r462939 = r462931 ? r462934 : r462938;
double r462940 = r462923 ? r462929 : r462939;
return r462940;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.3 |
|---|---|
| Target | 0.5 |
| Herbie | 0.3 |
if y < -1.240317582518452e+16Initial program 22.3
rmApplied associate-*r/22.3
Applied associate-/l/0.3
rmApplied associate-/r*0.3
rmApplied associate-/l*0.4
if -1.240317582518452e+16 < y < 4.7098978055448117e-07Initial program 0.3
rmApplied associate-*r/0.3
Applied associate-/l/11.1
rmApplied associate-/r*10.3
rmApplied clear-num10.4
rmApplied associate-/r/0.7
Applied associate-/r*0.3
Simplified0.3
if 4.7098978055448117e-07 < y Initial program 20.3
rmApplied associate-*r/20.4
Applied associate-/l/0.5
rmApplied associate-/r*0.5
rmApplied clear-num0.6
Final simplification0.3
herbie shell --seed 2020064
(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))