\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1852666491.27304912 \lor \neg \left(z \le 309596806417.428772\right):\\
\;\;\;\;\frac{\cosh x \cdot y}{z \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\sqrt{\cosh x} \cdot \left(\sqrt{\cosh x} \cdot y\right)}{z}}{x}\\
\end{array}double f(double x, double y, double z) {
double r438342 = x;
double r438343 = cosh(r438342);
double r438344 = y;
double r438345 = r438344 / r438342;
double r438346 = r438343 * r438345;
double r438347 = z;
double r438348 = r438346 / r438347;
return r438348;
}
double f(double x, double y, double z) {
double r438349 = z;
double r438350 = -1852666491.273049;
bool r438351 = r438349 <= r438350;
double r438352 = 309596806417.4288;
bool r438353 = r438349 <= r438352;
double r438354 = !r438353;
bool r438355 = r438351 || r438354;
double r438356 = x;
double r438357 = cosh(r438356);
double r438358 = y;
double r438359 = r438357 * r438358;
double r438360 = r438349 * r438356;
double r438361 = r438359 / r438360;
double r438362 = sqrt(r438357);
double r438363 = r438362 * r438358;
double r438364 = r438362 * r438363;
double r438365 = r438364 / r438349;
double r438366 = r438365 / r438356;
double r438367 = r438355 ? r438361 : r438366;
return r438367;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.3 |
|---|---|
| Target | 0.4 |
| Herbie | 0.3 |
if z < -1852666491.273049 or 309596806417.4288 < z Initial program 11.5
rmApplied associate-*r/11.5
Applied associate-/l/0.3
if -1852666491.273049 < z < 309596806417.4288Initial program 0.3
rmApplied associate-*r/0.3
Applied associate-/l/19.0
rmApplied associate-/r*0.3
rmApplied add-sqr-sqrt0.3
Applied associate-*l*0.3
Final simplification0.3
herbie shell --seed 2020065 +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))