\frac{1 - \cos x}{x \cdot x}\frac{\sin x \cdot \frac{\tan \left(\frac{x}{2}\right)}{x}}{x}(FPCore (x) :precision binary64 (/ (- 1.0 (cos x)) (* x x)))
(FPCore (x) :precision binary64 (/ (* (sin x) (/ (tan (/ x 2.0)) x)) x))
double code(double x) {
return (1.0 - cos(x)) / (x * x);
}
double code(double x) {
return (sin(x) * (tan(x / 2.0) / x)) / x;
}











Bits error versus x
Results
| Alternative 1 | |
|---|---|
| Error | 0.4 |
| Cost | 13376 |
| Alternative 2 | |
|---|---|
| Error | 0.1 |
| Cost | 13376 |
| Alternative 3 | |
|---|---|
| Error | 0.2 |
| Cost | 13505 |
| Alternative 4 | |
|---|---|
| Error | 0.4 |
| Cost | 7810 |
| Alternative 5 | |
|---|---|
| Error | 0.4 |
| Cost | 7490 |
| Alternative 6 | |
|---|---|
| Error | 0.6 |
| Cost | 7176 |
| Alternative 7 | |
|---|---|
| Error | 15.6 |
| Cost | 706 |
| Alternative 8 | |
|---|---|
| Error | 31.0 |
| Cost | 64 |

Initial program 31.5
rmApplied flip--_binary64_5331.6
Simplified16.1
rmApplied *-un-lft-identity_binary64_7816.1
Applied times-frac_binary64_8416.1
Applied associate-/l*_binary64_2316.3
Simplified0.4
rmApplied *-un-lft-identity_binary64_780.4
Applied *-un-lft-identity_binary64_780.4
Applied times-frac_binary64_840.4
Applied *-un-lft-identity_binary64_780.4
Applied times-frac_binary64_840.4
Applied associate-/r*_binary64_220.4
Simplified0.4
rmApplied associate-/r/_binary64_240.4
Applied associate-/r*_binary64_220.1
Simplified0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2021014
(FPCore (x)
:name "cos2 (problem 3.4.1)"
:precision binary64
(/ (- 1.0 (cos x)) (* x x)))