\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \leq -3.1942237371779685 \cdot 10^{-60} \lor \neg \left(y \leq 3.8048841896904086 \cdot 10^{-36}\right):\\
\;\;\;\;\frac{\frac{y \cdot \cosh x}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x \cdot \frac{y}{x}}{z}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
(FPCore (x y z) :precision binary64 (if (or (<= y -3.1942237371779685e-60) (not (<= y 3.8048841896904086e-36))) (/ (/ (* y (cosh x)) z) x) (/ (* (cosh x) (/ y x)) 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 ((y <= -3.1942237371779685e-60) || !(y <= 3.8048841896904086e-36)) {
tmp = ((y * cosh(x)) / z) / x;
} else {
tmp = (cosh(x) * (y / x)) / z;
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.6 |
|---|---|
| Target | 0.4 |
| Herbie | 0.5 |
if y < -3.19422373717796848e-60 or 3.8048841896904086e-36 < y Initial program 16.8
rmApplied div-inv_binary64_1355416.9
rmApplied associate-*r/_binary64_1350116.9
Applied associate-*l/_binary64_135020.9
Simplified0.8
if -3.19422373717796848e-60 < y < 3.8048841896904086e-36Initial program 0.3
Final simplification0.5
herbie shell --seed 2020292
(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))