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) cosh(x)) * ((double) (y / x)))) <= -1.9726858183719933e+160)) {
VAR = ((double) (((double) (((double) cosh(x)) * ((double) (y / z)))) / x));
} else {
double VAR_1;
if ((((double) (((double) cosh(x)) * ((double) (y / x)))) <= 6.326437943592754e+264)) {
VAR_1 = ((double) (((double) (((double) cosh(x)) * ((double) (y / x)))) / z));
} else {
VAR_1 = ((double) (1.0 / ((double) (x * ((double) (z / ((double) (((double) cosh(x)) * y))))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.4 |
|---|---|
| Target | 0.4 |
| Herbie | 0.4 |
if (* (cosh x) (/ y x)) < -1.9726858183719933e160Initial program 22.3
rmApplied div-inv22.4
rmApplied associate-*r/22.4
Applied associate-*l/1.2
Simplified1.1
if -1.9726858183719933e160 < (* (cosh x) (/ y x)) < 6.3264379435927536e264Initial program 0.3
if 6.3264379435927536e264 < (* (cosh x) (/ y x)) Initial program 44.8
rmApplied clear-num44.8
Simplified0.6
Final simplification0.4
herbie shell --seed 2020191
(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))