\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;\frac{\cosh x \cdot \frac{y}{x}}{z} \leq -1.2655409549400952 \cdot 10^{+215} \lor \neg \left(\frac{\cosh x \cdot \frac{y}{x}}{z} \leq 7.79880706110208 \cdot 10^{-24}\right):\\
\;\;\;\;\cosh x \cdot \frac{\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) cosh(x)) * (y / x))) / z);
}
double code(double x, double y, double z) {
double VAR;
if ((((((double) (((double) cosh(x)) * (y / x))) / z) <= -1.2655409549400952e+215) || !((((double) (((double) cosh(x)) * (y / x))) / z) <= 7.79880706110208e-24))) {
VAR = ((double) (((double) cosh(x)) * ((y / z) / x)));
} else {
VAR = (((double) (((double) cosh(x)) * (y / x))) / z);
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.7 |
|---|---|
| Target | 0.4 |
| Herbie | 0.3 |
if (/ (* (cosh x) (/ y x)) z) < -1.2655409549400952e215 or 7.79880706110207929e-24 < (/ (* (cosh x) (/ y x)) z) Initial program Error: 17.7 bits
SimplifiedError: 11.5 bits
rmApplied add-cube-cbrtError: 12.4 bits
Applied times-fracError: 10.7 bits
SimplifiedError: 10.7 bits
rmApplied associate-*l/Error: 10.7 bits
Applied associate-*l/Error: 1.5 bits
SimplifiedError: 0.4 bits
if -1.2655409549400952e215 < (/ (* (cosh x) (/ y x)) z) < 7.79880706110207929e-24Initial program Error: 0.2 bits
Final simplificationError: 0.3 bits
herbie shell --seed 2020200
(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))