\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.08311240125912723 \cdot 10^{45} \lor \neg \left(z \le 7.54555974864738856 \cdot 10^{50}\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x}{\frac{z}{\frac{y}{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 <= -1.0831124012591272e+45) || !(z <= 7.545559748647389e+50))) {
VAR = ((double) (((double) cosh(x)) * ((double) (y / ((double) (x * z))))));
} else {
VAR = ((double) (((double) cosh(x)) / ((double) (z / ((double) (y / x))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.8 |
|---|---|
| Target | 0.4 |
| Herbie | 0.7 |
if z < -1.08311240125912723e45 or 7.54555974864738856e50 < z Initial program 12.9
rmApplied *-un-lft-identity12.9
Applied times-frac12.9
Simplified12.9
Simplified0.3
if -1.08311240125912723e45 < z < 7.54555974864738856e50Initial program 1.0
rmApplied associate-/l*1.1
Final simplification0.7
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))