\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \le -4.18445552914575991 \cdot 10^{-5} \lor \neg \left(y \le 1360485835946968480000\right):\\
\;\;\;\;\frac{y \cdot \left(\frac{1}{2} \cdot \left(e^{x} + e^{-x}\right)\right)}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{y \cdot \left(\frac{1}{2} \cdot \left(e^{x} + e^{-x}\right)\right)}{x}}{z}\\
\end{array}double f(double x, double y, double z) {
double r632505 = x;
double r632506 = cosh(r632505);
double r632507 = y;
double r632508 = r632507 / r632505;
double r632509 = r632506 * r632508;
double r632510 = z;
double r632511 = r632509 / r632510;
return r632511;
}
double f(double x, double y, double z) {
double r632512 = y;
double r632513 = -4.18445552914576e-05;
bool r632514 = r632512 <= r632513;
double r632515 = 1.3604858359469685e+21;
bool r632516 = r632512 <= r632515;
double r632517 = !r632516;
bool r632518 = r632514 || r632517;
double r632519 = 0.5;
double r632520 = x;
double r632521 = exp(r632520);
double r632522 = -r632520;
double r632523 = exp(r632522);
double r632524 = r632521 + r632523;
double r632525 = r632519 * r632524;
double r632526 = r632512 * r632525;
double r632527 = z;
double r632528 = r632520 * r632527;
double r632529 = r632526 / r632528;
double r632530 = r632526 / r632520;
double r632531 = r632530 / r632527;
double r632532 = r632518 ? r632529 : r632531;
return r632532;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.7 |
|---|---|
| Target | 0.4 |
| Herbie | 0.3 |
if y < -4.18445552914576e-05 or 1.3604858359469685e+21 < y Initial program 22.0
rmApplied div-inv22.1
rmApplied cosh-def22.1
Applied frac-times22.1
Applied associate-*l/0.4
Simplified0.3
rmApplied clear-num0.4
rmApplied *-un-lft-identity0.4
Applied add-cube-cbrt0.4
Applied times-frac0.4
Simplified0.4
Simplified0.3
if -4.18445552914576e-05 < y < 1.3604858359469685e+21Initial program 0.3
rmApplied div-inv0.4
rmApplied cosh-def0.4
Applied frac-times0.4
Applied associate-*l/10.0
Simplified9.9
rmApplied clear-num10.0
rmApplied associate-/r/0.7
Applied associate-/r*0.4
Simplified0.3
Final simplification0.3
herbie shell --seed 2020047
(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))