\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -3.53901489297813153 \cdot 10^{-105} \lor \neg \left(z \le 12.1189184964724621\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x \cdot \frac{y}{x}}{z}\\
\end{array}double code(double x, double y, double z) {
return ((cosh(x) * (y / x)) / z);
}
double code(double x, double y, double z) {
double VAR;
if (((z <= -3.5390148929781315e-105) || !(z <= 12.118918496472462))) {
VAR = (cosh(x) * (y / (x * z)));
} else {
VAR = ((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.8 |
if z < -3.5390148929781315e-105 or 12.118918496472462 < z Initial program 10.5
rmApplied *-un-lft-identity10.5
Applied times-frac10.5
Simplified10.5
Simplified1.0
if -3.5390148929781315e-105 < z < 12.118918496472462Initial program 0.3
Final simplification0.8
herbie shell --seed 2020102 +o rules:numerics
(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))