\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \leq -160614062.07336497 \lor \neg \left(z \leq 2.1824738903714276 \cdot 10^{+66}\right):\\
\;\;\;\;\left(\cosh x \cdot y\right) \cdot \frac{1}{z \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x}{x} \cdot \frac{y}{z}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
(FPCore (x y z) :precision binary64 (if (or (<= z -160614062.07336497) (not (<= z 2.1824738903714276e+66))) (* (* (cosh x) y) (/ 1.0 (* z x))) (* (/ (cosh x) x) (/ y z))))
double code(double x, double y, double z) {
return (cosh(x) * (y / x)) / z;
}
double code(double x, double y, double z) {
double tmp;
if ((z <= -160614062.07336497) || !(z <= 2.1824738903714276e+66)) {
tmp = (cosh(x) * y) * (1.0 / (z * x));
} else {
tmp = (cosh(x) / x) * (y / z);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.7 |
|---|---|
| Target | 0.4 |
| Herbie | 0.5 |
if z < -160614062.07336497 or 2.18247389037142757e66 < z Initial program 12.6
rmApplied associate-*r/_binary6412.6
Applied associate-/l/_binary640.3
Simplified0.3
rmApplied div-inv_binary640.4
if -160614062.07336497 < z < 2.18247389037142757e66Initial program 1.0
rmApplied associate-*r/_binary641.0
Applied associate-/l/_binary6415.9
Simplified15.9
rmApplied times-frac_binary640.7
Final simplification0.5
herbie shell --seed 2020224
(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))