\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;\cosh x \cdot \frac{y}{x} \le -4.359963571427226706906654116630111705967 \cdot 10^{288} \lor \neg \left(\cosh x \cdot \frac{y}{x} \le 4.818059594116706179187911079448660909001 \cdot 10^{190}\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(e^{x} + e^{-x}\right) \cdot y}{x}}{2 \cdot z}\\
\end{array}double f(double x, double y, double z) {
double r517403 = x;
double r517404 = cosh(r517403);
double r517405 = y;
double r517406 = r517405 / r517403;
double r517407 = r517404 * r517406;
double r517408 = z;
double r517409 = r517407 / r517408;
return r517409;
}
double f(double x, double y, double z) {
double r517410 = x;
double r517411 = cosh(r517410);
double r517412 = y;
double r517413 = r517412 / r517410;
double r517414 = r517411 * r517413;
double r517415 = -4.3599635714272267e+288;
bool r517416 = r517414 <= r517415;
double r517417 = 4.818059594116706e+190;
bool r517418 = r517414 <= r517417;
double r517419 = !r517418;
bool r517420 = r517416 || r517419;
double r517421 = z;
double r517422 = r517410 * r517421;
double r517423 = r517412 / r517422;
double r517424 = r517411 * r517423;
double r517425 = exp(r517410);
double r517426 = -r517410;
double r517427 = exp(r517426);
double r517428 = r517425 + r517427;
double r517429 = r517428 * r517412;
double r517430 = r517429 / r517410;
double r517431 = 2.0;
double r517432 = r517431 * r517421;
double r517433 = r517430 / r517432;
double r517434 = r517420 ? r517424 : r517433;
return r517434;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.5 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if (* (cosh x) (/ y x)) < -4.3599635714272267e+288 or 4.818059594116706e+190 < (* (cosh x) (/ y x)) Initial program 35.5
rmApplied *-un-lft-identity35.5
Applied times-frac35.5
Simplified35.5
Simplified0.7
if -4.3599635714272267e+288 < (* (cosh x) (/ y x)) < 4.818059594116706e+190Initial program 0.3
rmApplied *-un-lft-identity0.3
Applied times-frac0.3
Simplified0.3
Simplified8.8
rmApplied add-cube-cbrt9.7
Applied times-frac2.8
Applied associate-*r*2.8
rmApplied cosh-def2.8
Applied associate-*l/2.8
Applied frac-times1.4
Simplified0.3
Final simplification0.4
herbie shell --seed 2019356
(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))