\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;\frac{\cosh x \cdot \frac{y}{x}}{z} \le -3.0964517336393437 \cdot 10^{307} \lor \neg \left(\frac{\cosh x \cdot \frac{y}{x}}{z} \le 222166518906540650000\right):\\
\;\;\;\;\frac{\cosh x \cdot \frac{y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x \cdot \frac{y}{x}}{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)) <= -3.0964517336393437e+307) || !(((double) (((double) (((double) cosh(x)) * ((double) (y / x)))) / z)) <= 2.2216651890654065e+20))) {
VAR = ((double) (((double) (((double) cosh(x)) * ((double) (y / z)))) / x));
} else {
VAR = ((double) (((double) (((double) cosh(x)) * ((double) (y / x)))) / z));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.9 |
|---|---|
| Target | 0.4 |
| Herbie | 0.3 |
if (/ (* (cosh x) (/ y x)) z) < -3.0964517336393437e307 or 222166518906540650000 < (/ (* (cosh x) (/ y x)) z) Initial program 23.4
Simplified9.4
rmApplied *-un-lft-identity9.4
Applied times-frac0.4
Applied associate-*r*0.4
Simplified0.4
rmApplied associate-*l/0.4
if -3.0964517336393437e307 < (/ (* (cosh x) (/ y x)) z) < 222166518906540650000Initial program 0.2
Final simplification0.3
herbie shell --seed 2020184
(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))