\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.3159694493115124 \cdot 10^{88}:\\
\;\;\;\;\frac{\cosh x \cdot y}{z \cdot x}\\
\mathbf{elif}\;z \le 3.7180943296009127 \cdot 10^{45}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{\frac{1}{2} \cdot \left(e^{x} + e^{-x}\right)}{x}}{z}}{\frac{1}{y}}\\
\end{array}double f(double x, double y, double z) {
double r529341 = x;
double r529342 = cosh(r529341);
double r529343 = y;
double r529344 = r529343 / r529341;
double r529345 = r529342 * r529344;
double r529346 = z;
double r529347 = r529345 / r529346;
return r529347;
}
double f(double x, double y, double z) {
double r529348 = z;
double r529349 = -1.3159694493115124e+88;
bool r529350 = r529348 <= r529349;
double r529351 = x;
double r529352 = cosh(r529351);
double r529353 = y;
double r529354 = r529352 * r529353;
double r529355 = r529348 * r529351;
double r529356 = r529354 / r529355;
double r529357 = 3.7180943296009127e+45;
bool r529358 = r529348 <= r529357;
double r529359 = r529354 / r529348;
double r529360 = r529359 / r529351;
double r529361 = 0.5;
double r529362 = exp(r529351);
double r529363 = -r529351;
double r529364 = exp(r529363);
double r529365 = r529362 + r529364;
double r529366 = r529361 * r529365;
double r529367 = r529366 / r529351;
double r529368 = r529367 / r529348;
double r529369 = 1.0;
double r529370 = r529369 / r529353;
double r529371 = r529368 / r529370;
double r529372 = r529358 ? r529360 : r529371;
double r529373 = r529350 ? r529356 : r529372;
return r529373;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.6 |
|---|---|
| Target | 0.4 |
| Herbie | 0.7 |
if z < -1.3159694493115124e+88Initial program 13.4
rmApplied associate-*r/13.4
Applied associate-/l/0.4
if -1.3159694493115124e+88 < z < 3.7180943296009127e+45Initial program 1.6
rmApplied associate-*r/1.6
Applied associate-/l/14.0
rmApplied associate-/r*1.1
if 3.7180943296009127e+45 < z Initial program 12.9
rmApplied associate-*r/13.0
Applied associate-/l/0.3
rmApplied associate-/l*0.8
rmApplied div-inv0.9
Applied associate-/r*0.5
Taylor expanded around inf 0.5
Simplified0.4
Final simplification0.7
herbie shell --seed 2020025
(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))