\frac{r \cdot \sin b}{\cos \left(a + b\right)}\frac{r \cdot \sin b}{\cos a \cdot \cos b - \sin b \cdot \sin a}(FPCore (r a b) :precision binary64 (/ (* r (sin b)) (cos (+ a b))))
(FPCore (r a b) :precision binary64 (/ (* r (sin b)) (- (* (cos a) (cos b)) (* (sin b) (sin a)))))
double code(double r, double a, double b) {
return (r * sin(b)) / cos(a + b);
}
double code(double r, double a, double b) {
return (r * sin(b)) / ((cos(a) * cos(b)) - (sin(b) * sin(a)));
}






Bits error versus r






Bits error versus a






Bits error versus b
Results
| Alternative 1 | |
|---|---|
| Accuracy | 0.5 |
| Cost | 1216 |
| Alternative 2 | |
|---|---|
| Accuracy | 32.6 |
| Cost | 1344 |
| Alternative 3 | |
|---|---|
| Accuracy | 32.7 |
| Cost | 1344 |
Initial program 15.5
rmApplied cos-sum_binary64_5530.3
rmApplied *-commutative_binary64_3500.3
Final simplification0.3
herbie shell --seed 2020322
(FPCore (r a b)
:name "rsin A"
:precision binary64
(/ (* r (sin b)) (cos (+ a b))))