\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -0.00141642850598626738 \lor \neg \left(z \le 0.0946531258338925569\right):\\
\;\;\;\;\frac{\cosh x \cdot y}{z \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{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 <= -0.0014164285059862674) || !(z <= 0.09465312583389256))) {
VAR = ((double) (((double) (((double) cosh(x)) * y)) / ((double) (z * x))));
} else {
VAR = ((double) (((double) (((double) (((double) cosh(x)) * y)) / z)) / x));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.4 |
|---|---|
| Target | 0.4 |
| Herbie | 0.3 |
if z < -0.00141642850598626738 or 0.0946531258338925569 < z Initial program 11.2
rmApplied associate-*r/11.2
Applied associate-/l/0.3
if -0.00141642850598626738 < z < 0.0946531258338925569Initial program 0.3
rmApplied div-inv0.4
rmApplied associate-*r/0.4
Applied associate-*l/0.4
Simplified0.3
Final simplification0.3
herbie shell --seed 2020155
(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))