\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -6.88079185276629833 \cdot 10^{48} \lor \neg \left(z \le 1.98099381655969213 \cdot 10^{-38}\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{z}{\cosh x \cdot y} \cdot x}\\
\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 (((z <= -6.880791852766298e+48) || !(z <= 1.980993816559692e-38))) {
VAR = ((double) (((double) cosh(x)) * ((double) (y / ((double) (x * z))))));
} else {
VAR = ((double) (1.0 / ((double) (((double) (z / ((double) (((double) cosh(x)) * y)))) * x))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.5 |
|---|---|
| Target | 0.4 |
| Herbie | 0.5 |
if z < -6.880791852766298e+48 or 1.980993816559692e-38 < z Initial program 11.6
rmApplied *-un-lft-identity11.6
Applied times-frac11.6
Simplified11.6
Simplified0.5
if -6.880791852766298e+48 < z < 1.980993816559692e-38Initial program 0.6
rmApplied div-inv0.7
Applied associate-*r*0.7
rmApplied clear-num0.8
Simplified0.6
Final simplification0.5
herbie shell --seed 2020148
(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))