\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;y \leq -0.09626506099155085 \lor \neg \left(y \leq 5.4305020927789424 \cdot 10^{-46}\right):\\
\;\;\;\;\frac{y \cdot \cosh x}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\cosh x \cdot \frac{\frac{y}{x}}{z}\\
\end{array}(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z))
(FPCore (x y z) :precision binary64 (if (or (<= y -0.09626506099155085) (not (<= y 5.4305020927789424e-46))) (/ (* y (cosh x)) (* x z)) (* (cosh x) (/ (/ y x) z))))
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 <= -0.09626506099155085) || !(y <= 5.4305020927789424e-46))) {
VAR = (((double) (y * ((double) cosh(x)))) / ((double) (x * z)));
} else {
VAR = ((double) (((double) cosh(x)) * ((y / x) / z)));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 8.1 |
|---|---|
| Target | 0.5 |
| Herbie | 0.4 |
if y < -0.096265060991550855 or 5.4305020927789424e-46 < y Initial program 19.3
Simplified0.5
rmApplied associate-*r/0.5
Simplified0.5
if -0.096265060991550855 < y < 5.4305020927789424e-46Initial program 0.3
Simplified11.6
rmApplied associate-/r*0.3
Final simplification0.4
herbie shell --seed 2020198
(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))