\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.93577210121831744 \cdot 10^{80} \lor \neg \left(z \le 2.60686388496247717 \cdot 10^{-42}\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cosh x}{\frac{z}{y} \cdot x}\\
\end{array}double f(double x, double y, double z) {
double r456215 = x;
double r456216 = cosh(r456215);
double r456217 = y;
double r456218 = r456217 / r456215;
double r456219 = r456216 * r456218;
double r456220 = z;
double r456221 = r456219 / r456220;
return r456221;
}
double f(double x, double y, double z) {
double r456222 = z;
double r456223 = -1.9357721012183174e+80;
bool r456224 = r456222 <= r456223;
double r456225 = 2.6068638849624772e-42;
bool r456226 = r456222 <= r456225;
double r456227 = !r456226;
bool r456228 = r456224 || r456227;
double r456229 = x;
double r456230 = cosh(r456229);
double r456231 = y;
double r456232 = r456229 * r456222;
double r456233 = r456231 / r456232;
double r456234 = r456230 * r456233;
double r456235 = r456222 / r456231;
double r456236 = r456235 * r456229;
double r456237 = r456230 / r456236;
double r456238 = r456228 ? r456234 : r456237;
return r456238;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.7 |
|---|---|
| Target | 0.4 |
| Herbie | 0.7 |
if z < -1.9357721012183174e+80 or 2.6068638849624772e-42 < z Initial program 12.0
rmApplied associate-/l*12.4
Simplified11.3
rmApplied div-inv11.3
Simplified0.4
if -1.9357721012183174e+80 < z < 2.6068638849624772e-42Initial program 1.3
rmApplied associate-/l*1.4
Simplified1.2
Final simplification0.7
herbie shell --seed 2020047 +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))