double code(double x, double y, double z) {
return ((double) (((double) (x * ((double) (((double) sin(y)) / y)))) / z));
}
double code(double x, double y, double z) {
double VAR;
if ((x <= -8.52145976776694e+86)) {
VAR = ((double) (((double) (x / ((double) (y / ((double) sin(y)))))) / z));
} else {
double VAR_1;
if ((x <= 1.5499491361677228e+86)) {
VAR_1 = ((double) (((double) (((double) sin(y)) / y)) * ((double) (x / z))));
} else {
VAR_1 = ((double) (((double) (((double) (x * ((double) sin(y)))) / y)) / z));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 2.7 |
|---|---|
| Target | 0.3 |
| Herbie | 0.5 |
if x < -8.52145976776693961e86Initial program 0.2
rmApplied clear-num0.2
rmApplied un-div-inv0.2
if -8.52145976776693961e86 < x < 1.54994913616772279e86Initial program 3.7
rmApplied clear-num3.8
rmApplied un-div-inv3.7
Taylor expanded around inf 11.8
Simplified0.6
if 1.54994913616772279e86 < x Initial program 0.2
rmApplied associate-*r/0.2
Final simplification0.5
herbie shell --seed 2020190
(FPCore (x y z)
:name "Linear.Quaternion:$ctanh from linear-1.19.1.3"
:precision binary64
:herbie-target
(if (< z -4.2173720203427147e-29) (/ (* x (/ 1.0 (/ y (sin y)))) z) (if (< z 4.446702369113811e+64) (/ x (* z (/ y (sin y)))) (/ (* x (/ 1.0 (/ y (sin y)))) z)))
(/ (* x (/ (sin y) y)) z))