\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -5.912986458297726092960347241480881860468 \cdot 10^{82} \lor \neg \left(z \le 10075888755760661719987257344\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(y \cdot \cosh x\right) \cdot \frac{1}{x}}{z}\\
\end{array}double f(double x, double y, double z) {
double r401110 = x;
double r401111 = cosh(r401110);
double r401112 = y;
double r401113 = r401112 / r401110;
double r401114 = r401111 * r401113;
double r401115 = z;
double r401116 = r401114 / r401115;
return r401116;
}
double f(double x, double y, double z) {
double r401117 = z;
double r401118 = -5.912986458297726e+82;
bool r401119 = r401117 <= r401118;
double r401120 = 1.0075888755760662e+28;
bool r401121 = r401117 <= r401120;
double r401122 = !r401121;
bool r401123 = r401119 || r401122;
double r401124 = x;
double r401125 = cosh(r401124);
double r401126 = y;
double r401127 = r401124 * r401117;
double r401128 = r401126 / r401127;
double r401129 = r401125 * r401128;
double r401130 = r401126 * r401125;
double r401131 = 1.0;
double r401132 = r401131 / r401124;
double r401133 = r401130 * r401132;
double r401134 = r401133 / r401117;
double r401135 = r401123 ? r401129 : r401134;
return r401135;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.8 |
|---|---|
| Target | 0.4 |
| Herbie | 0.7 |
if z < -5.912986458297726e+82 or 1.0075888755760662e+28 < z Initial program 13.3
Simplified0.3
if -5.912986458297726e+82 < z < 1.0075888755760662e+28Initial program 1.1
rmApplied div-inv1.2
Applied associate-*r*1.2
Simplified1.2
Final simplification0.7
herbie shell --seed 2019195
(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))