\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1948241059787096980000 \lor \neg \left(z \le 7.2256649558957228 \cdot 10^{-45}\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x \cdot \frac{y}{z}}{x}\\
\end{array}double f(double x, double y, double z) {
double r524800 = x;
double r524801 = cosh(r524800);
double r524802 = y;
double r524803 = r524802 / r524800;
double r524804 = r524801 * r524803;
double r524805 = z;
double r524806 = r524804 / r524805;
return r524806;
}
double f(double x, double y, double z) {
double r524807 = z;
double r524808 = -1.948241059787097e+21;
bool r524809 = r524807 <= r524808;
double r524810 = 7.225664955895723e-45;
bool r524811 = r524807 <= r524810;
double r524812 = !r524811;
bool r524813 = r524809 || r524812;
double r524814 = x;
double r524815 = cosh(r524814);
double r524816 = y;
double r524817 = r524814 * r524807;
double r524818 = r524816 / r524817;
double r524819 = r524815 * r524818;
double r524820 = r524816 / r524807;
double r524821 = r524815 * r524820;
double r524822 = r524821 / r524814;
double r524823 = r524813 ? r524819 : r524822;
return r524823;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.9 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if z < -1.948241059787097e+21 or 7.225664955895723e-45 < z Initial program 11.8
rmApplied div-inv11.9
rmApplied associate-*r/11.9
Applied associate-*l/10.1
Simplified10.0
rmApplied *-un-lft-identity10.0
Applied *-un-lft-identity10.0
Applied times-frac10.0
Applied times-frac10.0
Simplified10.0
Simplified0.4
if -1.948241059787097e+21 < z < 7.225664955895723e-45Initial program 0.4
rmApplied div-inv0.5
rmApplied associate-*r/0.5
Applied associate-*l/0.4
Simplified0.3
rmApplied *-un-lft-identity0.3
Applied times-frac0.3
Simplified0.3
Final simplification0.4
herbie shell --seed 2020039
(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))