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




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.8 |
|---|---|
| Target | 0.5 |
| Herbie | 0.3 |
if (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < -5.557433224784573e193 or 8.756943765838428e79 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) Initial program 20.7
Applied *-un-lft-identity_binary6420.7
Applied times-frac_binary6420.6
Simplified20.6
Simplified14.4
Applied associate-/r*_binary640.3
if -5.557433224784573e193 < (/.f64 (*.f64 (cosh.f64 x) (/.f64 y x)) z) < 8.756943765838428e79Initial program 0.2
Final simplification0.3
herbie shell --seed 2021280
(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.038530535935153e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))
(/ (* (cosh x) (/ y x)) z))