\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;\frac{\cosh x \cdot \frac{y}{x}}{z} \le -7.1339183193240772 \cdot 10^{58} \lor \neg \left(\frac{\cosh x \cdot \frac{y}{x}}{z} \le 1.2670938134229954 \cdot 10^{-24}\right):\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\end{array}double code(double x, double y, double z) {
return ((double) (((double) (((double) cosh(x)) * ((double) (y / x)))) / z));
}
double code(double x, double y, double z) {
double VAR;
if (((((double) (((double) (((double) cosh(x)) * ((double) (y / x)))) / z)) <= -7.133918319324077e+58) || !(((double) (((double) (((double) cosh(x)) * ((double) (y / x)))) / z)) <= 1.2670938134229954e-24))) {
VAR = ((double) (((double) (((double) (((double) cosh(x)) * y)) / z)) / x));
} else {
VAR = ((double) (((double) cosh(x)) * ((double) (y / ((double) (x * z))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.4 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if (/ (* (cosh x) (/ y x)) z) < -7.1339183193240772e58 or 1.2670938134229954e-24 < (/ (* (cosh x) (/ y x)) z) Initial program 13.1
rmApplied div-inv13.2
rmApplied associate-*r/13.2
Applied associate-*l/0.5
Simplified0.4
if -7.1339183193240772e58 < (/ (* (cosh x) (/ y x)) z) < 1.2670938134229954e-24Initial program 0.2
rmApplied *-un-lft-identity0.2
Applied times-frac0.3
Simplified0.3
Simplified0.5
Final simplification0.4
herbie shell --seed 2020162
(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))