\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)}\frac{\frac{\cos \left(2 \cdot x\right)}{c \cdot \left|x \cdot s\right|}}{c \cdot \left|x \cdot s\right|}(FPCore (x c s) :precision binary64 (/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))
(FPCore (x c s) :precision binary64 (/ (/ (cos (* 2.0 x)) (* c (fabs (* x s)))) (* c (fabs (* x s)))))
double code(double x, double c, double s) {
return cos(2.0 * x) / (pow(c, 2.0) * ((x * pow(s, 2.0)) * x));
}
double code(double x, double c, double s) {
return (cos(2.0 * x) / (c * fabs(x * s))) / (c * fabs(x * s));
}














Bits error versus x














Bits error versus c














Bits error versus s
Results
| Alternative 1 | |
|---|---|
| Error | 2.8 |
| Cost | 19968 |
| Alternative 2 | |
|---|---|
| Error | 2.8 |
| Cost | 19840 |
| Alternative 3 | |
|---|---|
| Error | 11.9 |
| Cost | 13905 |
| Alternative 4 | |
|---|---|
| Error | 17.5 |
| Cost | 7688 |
| Alternative 5 | |
|---|---|
| Error | 22.3 |
| Cost | 7688 |
| Alternative 6 | |
|---|---|
| Error | 26.8 |
| Cost | 8002 |
| Alternative 7 | |
|---|---|
| Error | 26.9 |
| Cost | 7688 |
| Alternative 8 | |
|---|---|
| Error | 29.3 |
| Cost | 3010 |
| Alternative 9 | |
|---|---|
| Error | 29.4 |
| Cost | 1474 |
| Alternative 10 | |
|---|---|
| Error | 33.4 |
| Cost | 64 |
| Alternative 11 | |
|---|---|
| Error | 61.5 |
| Cost | 64 |

Initial program 28.2
Simplified28.2
rmApplied add-sqr-sqrt_binary64_44128.3
Simplified28.3
Simplified20.1
rmApplied pow2_binary64_50020.1
Applied pow2_binary64_50020.1
Applied pow-prod-down_binary64_4902.8
rmApplied unpow2_binary64_4842.8
Applied associate-/r*_binary64_3632.5
Simplified2.5
Simplified2.5
Final simplification2.5
herbie shell --seed 2021044
(FPCore (x c s)
:name "mixedcos"
:precision binary64
(/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))