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




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.5 |
|---|---|
| Target | 0.4 |
| Herbie | 0.5 |
if y < -1.2032535890096534e-34 or 3.7328819373299038e-31 < y Initial program 18.0
rmApplied associate-*r/_binary6418.0
Applied associate-/l/_binary640.5
Simplified0.5
if -1.2032535890096534e-34 < y < 3.7328819373299038e-31Initial program 0.3
rmApplied associate-/l*_binary640.6
Final simplification0.5
herbie shell --seed 2020260
(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))