\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;\frac{y}{x} \cdot \cosh x \le -5.426249605328372 \cdot 10^{+191}:\\
\;\;\;\;\frac{\frac{\left(e^{-x} + e^{x}\right) \cdot y}{z}}{x \cdot 2}\\
\mathbf{elif}\;\frac{y}{x} \cdot \cosh x \le 4.221442743175407 \cdot 10^{+198}:\\
\;\;\;\;\left(\frac{y}{x} \cdot \cosh x\right) \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{z}}{x \cdot 2} \cdot \left(\left(e^{-x} + e^{x}\right) \cdot y\right)\\
\end{array}double f(double x, double y, double z) {
double r22936325 = x;
double r22936326 = cosh(r22936325);
double r22936327 = y;
double r22936328 = r22936327 / r22936325;
double r22936329 = r22936326 * r22936328;
double r22936330 = z;
double r22936331 = r22936329 / r22936330;
return r22936331;
}
double f(double x, double y, double z) {
double r22936332 = y;
double r22936333 = x;
double r22936334 = r22936332 / r22936333;
double r22936335 = cosh(r22936333);
double r22936336 = r22936334 * r22936335;
double r22936337 = -5.426249605328372e+191;
bool r22936338 = r22936336 <= r22936337;
double r22936339 = -r22936333;
double r22936340 = exp(r22936339);
double r22936341 = exp(r22936333);
double r22936342 = r22936340 + r22936341;
double r22936343 = r22936342 * r22936332;
double r22936344 = z;
double r22936345 = r22936343 / r22936344;
double r22936346 = 2.0;
double r22936347 = r22936333 * r22936346;
double r22936348 = r22936345 / r22936347;
double r22936349 = 4.221442743175407e+198;
bool r22936350 = r22936336 <= r22936349;
double r22936351 = 1.0;
double r22936352 = r22936351 / r22936344;
double r22936353 = r22936336 * r22936352;
double r22936354 = r22936352 / r22936347;
double r22936355 = r22936354 * r22936343;
double r22936356 = r22936350 ? r22936353 : r22936355;
double r22936357 = r22936338 ? r22936348 : r22936356;
return r22936357;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.4 |
|---|---|
| Target | 0.4 |
| Herbie | 0.6 |
if (* (cosh x) (/ y x)) < -5.426249605328372e+191Initial program 25.7
rmApplied cosh-def25.7
Applied frac-times25.7
Applied associate-/l/1.0
rmApplied div-inv1.1
rmApplied associate-/r*1.0
rmApplied associate-*r/1.2
Simplified1.1
if -5.426249605328372e+191 < (* (cosh x) (/ y x)) < 4.221442743175407e+198Initial program 0.2
rmApplied div-inv0.4
if 4.221442743175407e+198 < (* (cosh x) (/ y x)) Initial program 27.7
rmApplied cosh-def27.7
Applied frac-times27.7
Applied associate-/l/0.7
rmApplied div-inv1.1
rmApplied associate-/r*1.1
Final simplification0.6
herbie shell --seed 2019164 +o rules:numerics
(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))