{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}{\left(a \cdot \cos \left(\left(\pi \cdot \frac{1}{\sqrt{180}}\right) \cdot \frac{angle}{\sqrt{180}}\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}(FPCore (a b angle) :precision binary64 (+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))
(FPCore (a b angle) :precision binary64 (+ (pow (* a (cos (* (* PI (/ 1.0 (sqrt 180.0))) (/ angle (sqrt 180.0))))) 2.0) (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * cos(((double) M_PI) * (angle / 180.0))), 2.0) + pow((b * sin(((double) M_PI) * (angle / 180.0))), 2.0);
}
double code(double a, double b, double angle) {
return pow((a * cos((((double) M_PI) * (1.0 / sqrt(180.0))) * (angle / sqrt(180.0)))), 2.0) + pow((b * sin(((double) M_PI) * (angle / 180.0))), 2.0);
}











Bits error versus a











Bits error versus b











Bits error versus angle
Results
| Alternative 1 | |
|---|---|
| Error | 20.3 |
| Cost | 39616 |
| Alternative 2 | |
|---|---|
| Error | 20.3 |
| Cost | 26688 |
| Alternative 3 | |
|---|---|
| Error | 20.3 |
| Cost | 26688 |
| Alternative 4 | |
|---|---|
| Error | 20.4 |
| Cost | 19904 |
| Alternative 5 | |
|---|---|
| Error | 25.1 |
| Cost | 7873 |
| Alternative 6 | |
|---|---|
| Error | 25.1 |
| Cost | 7873 |
| Alternative 7 | |
|---|---|
| Error | 52.9 |
| Cost | 64 |
| Alternative 8 | |
|---|---|
| Error | 60.7 |
| Cost | 64 |


Initial program 20.3
rmApplied add-sqr-sqrt_binary64_10020.3
Applied *-un-lft-identity_binary64_7820.3
Applied times-frac_binary64_8420.3
Applied associate-*r*_binary64_1820.3
Simplified20.3
rmApplied div-inv_binary64_7520.3
rmApplied *-un-lft-identity_binary64_7820.3
Simplified20.3
Final simplification20.3
herbie shell --seed 2021040
(FPCore (a b angle)
:name "ab-angle->ABCF C"
:precision binary64
(+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))