\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -5093130071052390400 \lor \neg \left(z \le 7.93928067237076916 \cdot 10^{-20}\right):\\
\;\;\;\;\frac{\cosh x \cdot y}{z \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{x}}{z}\\
\end{array}double f(double x, double y, double z) {
double r613474 = x;
double r613475 = cosh(r613474);
double r613476 = y;
double r613477 = r613476 / r613474;
double r613478 = r613475 * r613477;
double r613479 = z;
double r613480 = r613478 / r613479;
return r613480;
}
double f(double x, double y, double z) {
double r613481 = z;
double r613482 = -5.09313007105239e+18;
bool r613483 = r613481 <= r613482;
double r613484 = 7.939280672370769e-20;
bool r613485 = r613481 <= r613484;
double r613486 = !r613485;
bool r613487 = r613483 || r613486;
double r613488 = x;
double r613489 = cosh(r613488);
double r613490 = y;
double r613491 = r613489 * r613490;
double r613492 = r613481 * r613488;
double r613493 = r613491 / r613492;
double r613494 = r613491 / r613488;
double r613495 = r613494 / r613481;
double r613496 = r613487 ? r613493 : r613495;
return r613496;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.7 |
|---|---|
| Target | 0.5 |
| Herbie | 0.4 |
if z < -5.09313007105239e+18 or 7.939280672370769e-20 < z Initial program 11.7
rmApplied associate-*r/11.8
Applied associate-/l/0.3
if -5.09313007105239e+18 < z < 7.939280672370769e-20Initial program 0.5
rmApplied associate-*r/0.5
Applied associate-/l/19.4
rmApplied associate-/r*0.3
rmApplied clear-num0.5
rmApplied associate-/r/0.5
Applied associate-/r*0.6
Simplified0.5
Final simplification0.4
herbie shell --seed 2020089
(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))