\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -8.710586004282429932361687759696753237551 \cdot 10^{-56} \lor \neg \left(y \le 3.814137150824676695755918942870868365663 \cdot 10^{-28}\right):\\
\;\;\;\;\frac{\cosh x \cdot y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x} \cdot \left(\cosh x \cdot y\right)}{z}\\
\end{array}double f(double x, double y, double z) {
double r397521 = x;
double r397522 = cosh(r397521);
double r397523 = y;
double r397524 = r397523 / r397521;
double r397525 = r397522 * r397524;
double r397526 = z;
double r397527 = r397525 / r397526;
return r397527;
}
double f(double x, double y, double z) {
double r397528 = y;
double r397529 = -8.71058600428243e-56;
bool r397530 = r397528 <= r397529;
double r397531 = 3.8141371508246767e-28;
bool r397532 = r397528 <= r397531;
double r397533 = !r397532;
bool r397534 = r397530 || r397533;
double r397535 = x;
double r397536 = cosh(r397535);
double r397537 = r397536 * r397528;
double r397538 = z;
double r397539 = r397535 * r397538;
double r397540 = r397537 / r397539;
double r397541 = 1.0;
double r397542 = r397541 / r397535;
double r397543 = r397542 * r397537;
double r397544 = r397543 / r397538;
double r397545 = r397534 ? r397540 : r397544;
return r397545;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 8.0 |
|---|---|
| Target | 0.4 |
| Herbie | 0.5 |
if y < -8.71058600428243e-56 or 3.8141371508246767e-28 < y Initial program 18.2
rmApplied associate-*r/18.2
Applied associate-/l/0.7
Simplified0.7
if -8.71058600428243e-56 < y < 3.8141371508246767e-28Initial program 0.3
rmApplied div-inv0.4
Applied associate-*r*0.4
Final simplification0.5
herbie shell --seed 2019179
(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))