\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -3.51381467333702519 \cdot 10^{31} \lor \neg \left(z \le 8.24592453052780382 \cdot 10^{-16}\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\cosh x \cdot \frac{1}{x \cdot \frac{z}{y}}\\
\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 <= -3.513814673337025e+31) || !(z <= 8.245924530527804e-16))) {
VAR = ((double) (((double) cosh(x)) * ((double) (y / ((double) (x * z))))));
} else {
VAR = ((double) (((double) cosh(x)) * ((double) (1.0 / ((double) (x * ((double) (z / y))))))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 8.3 |
|---|---|
| Target | 0.5 |
| Herbie | 0.4 |
if z < -3.51381467333702519e31 or 8.24592453052780382e-16 < z Initial program 12.8
rmApplied *-un-lft-identity12.8
Applied times-frac12.8
Simplified12.8
Simplified0.3
if -3.51381467333702519e31 < z < 8.24592453052780382e-16Initial program 0.5
rmApplied *-un-lft-identity0.5
Applied times-frac0.5
Simplified0.5
Simplified18.5
rmApplied clear-num18.6
rmApplied *-un-lft-identity18.6
Applied times-frac0.6
Simplified0.6
Final simplification0.4
herbie shell --seed 2020163
(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))