\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;\cosh x \cdot \frac{y}{x} \le -3.96646255890094319 \cdot 10^{194} \lor \neg \left(\cosh x \cdot \frac{y}{x} \le 6.6675943150014093 \cdot 10^{145}\right):\\
\;\;\;\;\frac{\cosh x \cdot y}{z \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot 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) cosh(x)) * ((double) (y / x)))) <= -3.966462558900943e+194) || !(((double) (((double) cosh(x)) * ((double) (y / x)))) <= 6.667594315001409e+145))) {
VAR = ((double) (((double) (((double) cosh(x)) * y)) / ((double) (z * x))));
} else {
VAR = ((double) (((double) (((double) (((double) cosh(x)) * y)) / x)) / z));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.8 |
|---|---|
| Target | 0.4 |
| Herbie | 0.6 |
if (* (cosh x) (/ y x)) < -3.96646255890094319e194 or 6.6675943150014093e145 < (* (cosh x) (/ y x)) Initial program 25.1
rmApplied associate-*r/25.1
Applied associate-/l/1.3
if -3.96646255890094319e194 < (* (cosh x) (/ y x)) < 6.6675943150014093e145Initial program 0.3
rmApplied associate-*r/0.3
Final simplification0.6
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))