\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -8.986365873619643 \cdot 10^{-102}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\mathbf{elif}\;y \le 1.0982237141506651 \cdot 10^{-11}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{x}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x \cdot y}{x \cdot z}\\
\end{array}double f(double x, double y, double z) {
double r22184247 = x;
double r22184248 = cosh(r22184247);
double r22184249 = y;
double r22184250 = r22184249 / r22184247;
double r22184251 = r22184248 * r22184250;
double r22184252 = z;
double r22184253 = r22184251 / r22184252;
return r22184253;
}
double f(double x, double y, double z) {
double r22184254 = y;
double r22184255 = -8.986365873619643e-102;
bool r22184256 = r22184254 <= r22184255;
double r22184257 = x;
double r22184258 = cosh(r22184257);
double r22184259 = r22184258 * r22184254;
double r22184260 = z;
double r22184261 = r22184259 / r22184260;
double r22184262 = r22184261 / r22184257;
double r22184263 = 1.0982237141506651e-11;
bool r22184264 = r22184254 <= r22184263;
double r22184265 = r22184259 / r22184257;
double r22184266 = r22184265 / r22184260;
double r22184267 = r22184257 * r22184260;
double r22184268 = r22184259 / r22184267;
double r22184269 = r22184264 ? r22184266 : r22184268;
double r22184270 = r22184256 ? r22184262 : r22184269;
return r22184270;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 8.1 |
|---|---|
| Target | 0.4 |
| Herbie | 0.7 |
if y < -8.986365873619643e-102Initial program 14.6
rmApplied associate-*r/14.7
Applied associate-/l/1.4
rmApplied associate-/r*1.6
if -8.986365873619643e-102 < y < 1.0982237141506651e-11Initial program 0.3
rmApplied associate-*r/0.3
Applied associate-/l/12.2
rmApplied associate-/r*11.2
rmApplied div-inv11.3
rmApplied associate-*l/0.4
Simplified0.3
if 1.0982237141506651e-11 < y Initial program 19.9
rmApplied associate-*r/19.9
Applied associate-/l/0.4
Final simplification0.7
herbie shell --seed 2019165 +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))