\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.259547158282228448649525588294824107293 \cdot 10^{-30}:\\
\;\;\;\;y \cdot \frac{\frac{\frac{\frac{1}{2}}{e^{x}} + e^{x} \cdot \frac{1}{2}}{z}}{x}\\
\mathbf{elif}\;z \le 1634804152264766393417728:\\
\;\;\;\;\frac{\frac{\frac{\frac{1}{2}}{e^{x}} + e^{x} \cdot \frac{1}{2}}{z} \cdot y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \cosh x}{x \cdot z}\\
\end{array}double f(double x, double y, double z) {
double r9832391 = x;
double r9832392 = cosh(r9832391);
double r9832393 = y;
double r9832394 = r9832393 / r9832391;
double r9832395 = r9832392 * r9832394;
double r9832396 = z;
double r9832397 = r9832395 / r9832396;
return r9832397;
}
double f(double x, double y, double z) {
double r9832398 = z;
double r9832399 = -1.2595471582822284e-30;
bool r9832400 = r9832398 <= r9832399;
double r9832401 = y;
double r9832402 = 0.5;
double r9832403 = x;
double r9832404 = exp(r9832403);
double r9832405 = r9832402 / r9832404;
double r9832406 = r9832404 * r9832402;
double r9832407 = r9832405 + r9832406;
double r9832408 = r9832407 / r9832398;
double r9832409 = r9832408 / r9832403;
double r9832410 = r9832401 * r9832409;
double r9832411 = 1.6348041522647664e+24;
bool r9832412 = r9832398 <= r9832411;
double r9832413 = r9832408 * r9832401;
double r9832414 = r9832413 / r9832403;
double r9832415 = cosh(r9832403);
double r9832416 = r9832401 * r9832415;
double r9832417 = r9832403 * r9832398;
double r9832418 = r9832416 / r9832417;
double r9832419 = r9832412 ? r9832414 : r9832418;
double r9832420 = r9832400 ? r9832410 : r9832419;
return r9832420;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.5 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if z < -1.2595471582822284e-30Initial program 10.6
Taylor expanded around inf 0.4
Simplified9.6
rmApplied *-un-lft-identity9.6
Applied times-frac0.5
Simplified0.5
if -1.2595471582822284e-30 < z < 1.6348041522647664e+24Initial program 0.3
Taylor expanded around inf 19.8
Simplified0.5
if 1.6348041522647664e+24 < z Initial program 12.2
rmApplied associate-*r/12.2
Applied associate-/l/0.3
Final simplification0.4
herbie shell --seed 2019171
(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))