\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.72160496452561263986704681669141916127 \cdot 10^{202} \lor \neg \left(z \le 1.342227135368572564573491428767395770614 \cdot 10^{-58}\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{z \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\cosh x \cdot \frac{\frac{y}{z}}{x}\\
\end{array}double f(double x, double y, double z) {
double r456370 = x;
double r456371 = cosh(r456370);
double r456372 = y;
double r456373 = r456372 / r456370;
double r456374 = r456371 * r456373;
double r456375 = z;
double r456376 = r456374 / r456375;
return r456376;
}
double f(double x, double y, double z) {
double r456377 = z;
double r456378 = -1.7216049645256126e+202;
bool r456379 = r456377 <= r456378;
double r456380 = 1.3422271353685726e-58;
bool r456381 = r456377 <= r456380;
double r456382 = !r456381;
bool r456383 = r456379 || r456382;
double r456384 = x;
double r456385 = cosh(r456384);
double r456386 = y;
double r456387 = r456377 * r456384;
double r456388 = r456386 / r456387;
double r456389 = r456385 * r456388;
double r456390 = r456386 / r456377;
double r456391 = r456390 / r456384;
double r456392 = r456385 * r456391;
double r456393 = r456383 ? r456389 : r456392;
return r456393;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.6 |
|---|---|
| Target | 0.4 |
| Herbie | 2.1 |
if z < -1.7216049645256126e+202 or 1.3422271353685726e-58 < z Initial program 11.7
rmApplied associate-/l*12.2
Simplified10.8
rmApplied div-inv10.8
Simplified10.7
rmApplied div-inv10.8
Applied associate-/l*0.6
Simplified0.5
if -1.7216049645256126e+202 < z < 1.3422271353685726e-58Initial program 3.8
rmApplied associate-/l*3.9
Simplified3.6
rmApplied div-inv3.6
Simplified3.5
Final simplification2.1
herbie shell --seed 2019326 +o rules:numerics
(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.038530535935153e-39) (/ (/ (* (cosh x) y) x) z) (* (/ (/ y z) x) (cosh x))))
(/ (* (cosh x) (/ y x)) z))