\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \leq -1.252876066324285 \cdot 10^{-34}:\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{elif}\;y \leq 8.583768275425656 \cdot 10^{+21}:\\
\;\;\;\;\left(\cosh x \cdot \frac{y}{x}\right) \cdot \frac{1}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot \frac{z}{y \cdot \cosh x}}\\
\end{array}double code(double x, double y, double z) {
return (((double) (((double) cosh(x)) * (y / x))) / z);
}
double code(double x, double y, double z) {
double VAR;
if ((y <= -1.252876066324285e-34)) {
VAR = ((double) (((double) cosh(x)) * (y / ((double) (x * z)))));
} else {
double VAR_1;
if ((y <= 8.583768275425656e+21)) {
VAR_1 = ((double) (((double) (((double) cosh(x)) * (y / x))) * (1.0 / z)));
} else {
VAR_1 = (1.0 / ((double) (x * (z / ((double) (y * ((double) cosh(x))))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.9 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if y < -1.25287606632428499e-34Initial program 18.4
Simplified0.5
if -1.25287606632428499e-34 < y < 8.583768275425656e21Initial program 0.3
rmApplied div-inv0.4
if 8.583768275425656e21 < y Initial program 24.2
rmApplied clear-num24.2
Simplified0.4
Final simplification0.4
herbie shell --seed 2020196
(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))