\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \leq -1.448772975614469 \cdot 10^{+67}:\\
\;\;\;\;\frac{\cosh x}{\frac{x}{\frac{y}{z}}}\\
\mathbf{elif}\;y \leq 2.990037073633152 \cdot 10^{-17}:\\
\;\;\;\;\frac{\frac{y \cdot \cosh x}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \cosh x}{x \cdot z}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
(FPCore (x y z)
:precision binary64
(if (<= y -1.448772975614469e+67)
(/ (cosh x) (/ x (/ y z)))
(if (<= y 2.990037073633152e-17)
(/ (/ (* y (cosh x)) x) z)
(/ (* y (cosh x)) (* 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 <= -1.448772975614469e+67) {
tmp = cosh(x) / (x / (y / z));
} else if (y <= 2.990037073633152e-17) {
tmp = ((y * cosh(x)) / x) / z;
} else {
tmp = (y * cosh(x)) / (x * z);
}
return tmp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.4 |
|---|---|
| Target | 0.5 |
| Herbie | 0.5 |
if y < -1.4487729756144689e67Initial program 29.2
rmApplied associate-*r/_binary6429.2
Applied associate-/l/_binary640.4
Simplified0.4
rmApplied associate-/l*_binary640.4
Simplified0.4
if -1.4487729756144689e67 < y < 2.9900370736331518e-17Initial program 0.6
rmApplied associate-*r/_binary640.6
if 2.9900370736331518e-17 < y Initial program 18.7
rmApplied associate-*r/_binary6418.7
Applied associate-/l/_binary640.3
Simplified0.3
Final simplification0.5
herbie shell --seed 2020219
(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))