\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1852666491.27304912 \lor \neg \left(z \le 309596806417.428772\right):\\
\;\;\;\;\frac{\cosh x \cdot y}{z \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\sqrt{\cosh x} \cdot \left(\sqrt{\cosh x} \cdot y\right)}{z}}{x}\\
\end{array}double f(double x, double y, double z) {
double r575950 = x;
double r575951 = cosh(r575950);
double r575952 = y;
double r575953 = r575952 / r575950;
double r575954 = r575951 * r575953;
double r575955 = z;
double r575956 = r575954 / r575955;
return r575956;
}
double f(double x, double y, double z) {
double r575957 = z;
double r575958 = -1852666491.273049;
bool r575959 = r575957 <= r575958;
double r575960 = 309596806417.4288;
bool r575961 = r575957 <= r575960;
double r575962 = !r575961;
bool r575963 = r575959 || r575962;
double r575964 = x;
double r575965 = cosh(r575964);
double r575966 = y;
double r575967 = r575965 * r575966;
double r575968 = r575957 * r575964;
double r575969 = r575967 / r575968;
double r575970 = sqrt(r575965);
double r575971 = r575970 * r575966;
double r575972 = r575970 * r575971;
double r575973 = r575972 / r575957;
double r575974 = r575973 / r575964;
double r575975 = r575963 ? r575969 : r575974;
return r575975;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.3 |
|---|---|
| Target | 0.4 |
| Herbie | 0.3 |
if z < -1852666491.273049 or 309596806417.4288 < z Initial program 11.5
rmApplied associate-*r/11.5
Applied associate-/l/0.3
if -1852666491.273049 < z < 309596806417.4288Initial program 0.3
rmApplied associate-*r/0.3
Applied associate-/l/19.0
rmApplied associate-/r*0.3
rmApplied add-sqr-sqrt0.3
Applied associate-*l*0.3
Final simplification0.3
herbie shell --seed 2020065
(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))