\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 r571584 = x;
double r571585 = cosh(r571584);
double r571586 = y;
double r571587 = r571586 / r571584;
double r571588 = r571585 * r571587;
double r571589 = z;
double r571590 = r571588 / r571589;
return r571590;
}
double f(double x, double y, double z) {
double r571591 = y;
double r571592 = -4.18445552914576e-05;
bool r571593 = r571591 <= r571592;
double r571594 = 1.3604858359469685e+21;
bool r571595 = r571591 <= r571594;
double r571596 = !r571595;
bool r571597 = r571593 || r571596;
double r571598 = 0.5;
double r571599 = x;
double r571600 = exp(r571599);
double r571601 = -r571599;
double r571602 = exp(r571601);
double r571603 = r571600 + r571602;
double r571604 = r571598 * r571603;
double r571605 = r571591 * r571604;
double r571606 = z;
double r571607 = r571599 * r571606;
double r571608 = r571605 / r571607;
double r571609 = r571605 / r571599;
double r571610 = r571609 / r571606;
double r571611 = r571597 ? r571608 : r571610;
return r571611;
}




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))