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











Bits error versus x
Results
| Alternative 1 | |
|---|---|
| Error | 0.3 |
| Cost | 13697 |
| Alternative 2 | |
|---|---|
| Error | 0.3 |
| Cost | 7618 |
| Alternative 3 | |
|---|---|
| Error | 0.3 |
| Cost | 7176 |
| Alternative 4 | |
|---|---|
| Error | 0.6 |
| Cost | 7176 |
| Alternative 5 | |
|---|---|
| Error | 15.6 |
| Cost | 1090 |
| Alternative 6 | |
|---|---|
| Error | 15.5 |
| Cost | 706 |
| Alternative 7 | |
|---|---|
| Error | 41.0 |
| Cost | 706 |
| Alternative 8 | |
|---|---|
| Error | 56.7 |
| Cost | 64 |

Initial program 31.3
rmApplied flip--_binary64_5331.4
Simplified15.9
rmApplied associate-/r*_binary64_2215.2
Simplified0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2021044
(FPCore (x)
:name "cos2 (problem 3.4.1)"
:precision binary64
(/ (- 1.0 (cos x)) (* x x)))