\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -1.335660724529533 \cdot 10^{-48} \lor \neg \left(z \le 6.2733557363758206 \cdot 10^{41}\right):\\
\;\;\;\;\frac{\cosh x \cdot y}{z \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\cosh x \cdot y}{z}}{x}\\
\end{array}double code(double x, double y, double z) {
return ((cosh(x) * (y / x)) / z);
}
double code(double x, double y, double z) {
double temp;
if (((z <= -1.335660724529533e-48) || !(z <= 6.2733557363758206e+41))) {
temp = ((cosh(x) * y) / (z * x));
} else {
temp = (((cosh(x) * y) / z) / x);
}
return temp;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.5 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if z < -1.335660724529533e-48 or 6.2733557363758206e+41 < z Initial program 11.2
rmApplied associate-*r/11.2
Applied associate-/l/0.4
if -1.335660724529533e-48 < z < 6.2733557363758206e+41Initial program 0.6
rmApplied associate-*r/0.6
Applied associate-/l/19.8
rmApplied associate-/r*0.4
Final simplification0.4
herbie shell --seed 2020058
(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))