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 ((((double) (((double) (((double) cosh(x)) * ((double) (y / x)))) / z)) <= -inf.0)) {
VAR = ((double) (y * ((double) (((double) cosh(x)) / ((double) (x * z))))));
} else {
double VAR_1;
if ((((double) (((double) (((double) cosh(x)) * ((double) (y / x)))) / z)) <= 5.75167906107457e-57)) {
VAR_1 = ((double) (((double) (((double) cosh(x)) * ((double) (y / x)))) / z));
} else {
VAR_1 = ((double) (((double) cosh(x)) / ((double) (x * ((double) (z / y))))));
}
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 (/ (* (cosh x) (/ y x)) z) < -inf.0Initial program 64.0
rmApplied associate-/l*63.9
Simplified0.5
rmApplied associate-*r/0.5
Applied associate-/r/0.5
if -inf.0 < (/ (* (cosh x) (/ y x)) z) < 5.75167906107457026e-57Initial program 0.2
if 5.75167906107457026e-57 < (/ (* (cosh x) (/ y x)) z) Initial program 11.3
rmApplied associate-/l*11.4
Simplified0.8
Final simplification0.4
herbie shell --seed 2020180
(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))