\frac{\cosh x \cdot \frac{y}{x}}{z}\begin{array}{l}
\mathbf{if}\;z \le -8.6650042703662669 \cdot 10^{-45} \lor \neg \left(z \le 6.22728347851612269 \cdot 10^{-28}\right):\\
\;\;\;\;\cosh x \cdot \frac{y}{x \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\cosh x \cdot \frac{\frac{1}{x}}{\frac{z}{y}}\\
\end{array}double code(double x, double y, double z) {
return ((double) (((double) (((double) cosh(x)) * ((double) (y / x)))) / z));
}
double code(double x, double y, double z) {
double VAR;
if (((z <= -8.665004270366267e-45) || !(z <= 6.227283478516123e-28))) {
VAR = ((double) (((double) cosh(x)) * ((double) (y / ((double) (x * z))))));
} else {
VAR = ((double) (((double) cosh(x)) * ((double) (((double) (1.0 / x)) / ((double) (z / y))))));
}
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 z < -8.6650042703662669e-45 or 6.22728347851612269e-28 < z Initial program 11.0
rmApplied *-un-lft-identity11.0
Applied times-frac11.0
Simplified11.0
Simplified0.4
if -8.6650042703662669e-45 < z < 6.22728347851612269e-28Initial program 0.3
rmApplied *-un-lft-identity0.3
Applied times-frac0.3
Simplified0.3
Simplified23.3
rmApplied clear-num23.3
rmApplied *-un-lft-identity23.3
Applied times-frac0.4
Applied associate-/r*0.4
Simplified0.4
Final simplification0.4
herbie shell --seed 2020168
(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))