\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -1.0432260555262782 \cdot 10^{-16}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\mathbf{elif}\;y \le 2922533292505.41:\\
\;\;\;\;\frac{\frac{y}{x} \cdot \cosh x}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\end{array}double f(double x, double y, double z) {
double r21690432 = x;
double r21690433 = cosh(r21690432);
double r21690434 = y;
double r21690435 = r21690434 / r21690432;
double r21690436 = r21690433 * r21690435;
double r21690437 = z;
double r21690438 = r21690436 / r21690437;
return r21690438;
}
double f(double x, double y, double z) {
double r21690439 = y;
double r21690440 = -1.0432260555262782e-16;
bool r21690441 = r21690439 <= r21690440;
double r21690442 = x;
double r21690443 = cosh(r21690442);
double r21690444 = r21690443 * r21690439;
double r21690445 = z;
double r21690446 = r21690444 / r21690445;
double r21690447 = r21690446 / r21690442;
double r21690448 = 2922533292505.41;
bool r21690449 = r21690439 <= r21690448;
double r21690450 = r21690439 / r21690442;
double r21690451 = r21690450 * r21690443;
double r21690452 = r21690451 / r21690445;
double r21690453 = r21690449 ? r21690452 : r21690447;
double r21690454 = r21690441 ? r21690447 : r21690453;
return r21690454;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.3 |
|---|---|
| Target | 0.5 |
| Herbie | 0.3 |
if y < -1.0432260555262782e-16 or 2922533292505.41 < y Initial program 20.1
rmApplied associate-*r/20.1
Applied associate-/l/0.3
rmApplied associate-/r*0.3
if -1.0432260555262782e-16 < y < 2922533292505.41Initial program 0.3
Final simplification0.3
herbie shell --seed 2019163 +o rules:numerics
(FPCore (x y z)
:name "Linear.Quaternion:$ctan from linear-1.19.1.3"
:herbie-target
(if (< y -4.618902267687042e-52) (* (/ (/ y z) x) (cosh x)) (if (< y 1.038530535935153e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))
(/ (* (cosh x) (/ y x)) z))