\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -5.936045909707795 \cdot 10^{+96}:\\
\;\;\;\;\left(\left(e^{x} + \frac{1}{e^{x}}\right) \cdot y\right) \cdot \frac{\frac{1}{z}}{x + x}\\
\mathbf{elif}\;z \le 7.694949687069597 \cdot 10^{-19}:\\
\;\;\;\;\frac{\left(\frac{\frac{1}{2}}{e^{x}} + e^{x} \cdot \frac{1}{2}\right) \cdot \frac{y}{z}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(e^{x} + \frac{1}{e^{x}}\right) \cdot y}{x \cdot z} \cdot \frac{1}{2}\\
\end{array}double f(double x, double y, double z) {
double r28657119 = x;
double r28657120 = cosh(r28657119);
double r28657121 = y;
double r28657122 = r28657121 / r28657119;
double r28657123 = r28657120 * r28657122;
double r28657124 = z;
double r28657125 = r28657123 / r28657124;
return r28657125;
}
double f(double x, double y, double z) {
double r28657126 = z;
double r28657127 = -5.936045909707795e+96;
bool r28657128 = r28657126 <= r28657127;
double r28657129 = x;
double r28657130 = exp(r28657129);
double r28657131 = 1.0;
double r28657132 = r28657131 / r28657130;
double r28657133 = r28657130 + r28657132;
double r28657134 = y;
double r28657135 = r28657133 * r28657134;
double r28657136 = r28657131 / r28657126;
double r28657137 = r28657129 + r28657129;
double r28657138 = r28657136 / r28657137;
double r28657139 = r28657135 * r28657138;
double r28657140 = 7.694949687069597e-19;
bool r28657141 = r28657126 <= r28657140;
double r28657142 = 0.5;
double r28657143 = r28657142 / r28657130;
double r28657144 = r28657130 * r28657142;
double r28657145 = r28657143 + r28657144;
double r28657146 = r28657134 / r28657126;
double r28657147 = r28657145 * r28657146;
double r28657148 = r28657147 / r28657129;
double r28657149 = r28657129 * r28657126;
double r28657150 = r28657135 / r28657149;
double r28657151 = r28657150 * r28657142;
double r28657152 = r28657141 ? r28657148 : r28657151;
double r28657153 = r28657128 ? r28657139 : r28657152;
return r28657153;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.4 |
|---|---|
| Target | 0.4 |
| Herbie | 0.7 |
if z < -5.936045909707795e+96Initial program 13.7
rmApplied cosh-def13.7
Applied frac-times13.7
Applied associate-/l/0.4
rmApplied clear-num0.8
rmApplied div-inv0.8
Applied add-cube-cbrt0.8
Applied times-frac0.5
Simplified0.5
Simplified0.5
if -5.936045909707795e+96 < z < 7.694949687069597e-19Initial program 1.5
Taylor expanded around inf 15.9
Simplified1.2
if 7.694949687069597e-19 < z Initial program 10.6
rmApplied cosh-def10.6
Applied frac-times10.6
Applied associate-/l/0.3
rmApplied clear-num0.7
rmApplied times-frac10.0
Applied associate-/r*9.7
Simplified9.7
Taylor expanded around inf 0.3
Final simplification0.7
herbie shell --seed 2019164
(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))