\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -6.394362921332223351644270586304115137557 \cdot 10^{-33}:\\
\;\;\;\;\frac{\cosh x \cdot y}{x \cdot z}\\
\mathbf{elif}\;z \le 2.035540255879025646360089979447494101805 \cdot 10^{-6}:\\
\;\;\;\;\frac{y}{\frac{x}{\cosh x}} \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x \cdot y}{x \cdot z}\\
\end{array}double f(double x, double y, double z) {
double r24839921 = x;
double r24839922 = cosh(r24839921);
double r24839923 = y;
double r24839924 = r24839923 / r24839921;
double r24839925 = r24839922 * r24839924;
double r24839926 = z;
double r24839927 = r24839925 / r24839926;
return r24839927;
}
double f(double x, double y, double z) {
double r24839928 = z;
double r24839929 = -6.394362921332223e-33;
bool r24839930 = r24839928 <= r24839929;
double r24839931 = x;
double r24839932 = cosh(r24839931);
double r24839933 = y;
double r24839934 = r24839932 * r24839933;
double r24839935 = r24839931 * r24839928;
double r24839936 = r24839934 / r24839935;
double r24839937 = 2.0355402558790256e-06;
bool r24839938 = r24839928 <= r24839937;
double r24839939 = r24839931 / r24839932;
double r24839940 = r24839933 / r24839939;
double r24839941 = 1.0;
double r24839942 = r24839941 / r24839928;
double r24839943 = r24839940 * r24839942;
double r24839944 = r24839938 ? r24839943 : r24839936;
double r24839945 = r24839930 ? r24839936 : r24839944;
return r24839945;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.9 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if z < -6.394362921332223e-33 or 2.0355402558790256e-06 < z Initial program 11.5
rmApplied associate-*r/11.5
Applied associate-/l/0.4
if -6.394362921332223e-33 < z < 2.0355402558790256e-06Initial program 0.3
rmApplied *-un-lft-identity0.3
Applied associate-/r*0.3
Simplified0.3
rmApplied div-inv0.4
Final simplification0.4
herbie shell --seed 2019172
(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))