\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -5.3649263236055999 \cdot 10^{-48} \lor \neg \left(z \le 3.8333035288502299 \cdot 10^{56}\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x \cdot y}{z} \cdot \frac{1}{x}\\
\end{array}double code(double x, double y, double z) {
return ((cosh(x) * (y / x)) / z);
}
double code(double x, double y, double z) {
double VAR;
if (((z <= -5.3649263236056e-48) || !(z <= 3.83330352885023e+56))) {
VAR = (cosh(x) * (y / (x * z)));
} else {
VAR = (((cosh(x) * y) / z) * (1.0 / x));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.7 |
|---|---|
| Target | 0.5 |
| Herbie | 0.5 |
if z < -5.3649263236056e-48 or 3.83330352885023e+56 < z Initial program 11.7
rmApplied *-un-lft-identity11.7
Applied times-frac11.7
Simplified11.7
Simplified0.4
if -5.3649263236056e-48 < z < 3.83330352885023e+56Initial program 0.6
rmApplied associate-*r/0.6
Applied associate-/l/18.7
rmApplied associate-/r*0.6
rmApplied div-inv0.7
Final simplification0.5
herbie shell --seed 2020100 +o rules:numerics
(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))