\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;\cosh x \cdot \frac{y}{x} \le -2.12049539930230558 \cdot 10^{286} \lor \neg \left(\cosh x \cdot \frac{y}{x} \le 1.8941550272477898 \cdot 10^{193}\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x \cdot \frac{y}{x}}{z}\\
\end{array}double code(double x, double y, double z) {
return ((cosh(x) * (y / x)) / z);
}
double code(double x, double y, double z) {
double temp;
if ((((cosh(x) * (y / x)) <= -2.1204953993023056e+286) || !((cosh(x) * (y / x)) <= 1.8941550272477898e+193))) {
temp = (cosh(x) * (y / (x * z)));
} else {
temp = ((cosh(x) * (y / x)) / z);
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 8.0 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if (* (cosh x) (/ y x)) < -2.1204953993023056e+286 or 1.8941550272477898e+193 < (* (cosh x) (/ y x)) Initial program 37.3
rmApplied *-un-lft-identity37.3
Applied times-frac37.1
Simplified37.1
Simplified0.9
if -2.1204953993023056e+286 < (* (cosh x) (/ y x)) < 1.8941550272477898e+193Initial program 0.2
Final simplification0.4
herbie shell --seed 2020057 +o rules:numerics
(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))