Average Error: 31.3 → 31.3
Time: 2.4s
Precision: binary64
Cost: 6848
\[\frac{1 - \cos x}{x \cdot x}\]
\[\frac{1 - \cos x}{x \cdot x}\]
\frac{1 - \cos x}{x \cdot x}
\frac{1 - \cos x}{x \cdot x}
(FPCore (x) :precision binary64 (/ (- 1.0 (cos x)) (* x x)))
(FPCore (x) :precision binary64 (/ (- 1.0 (cos x)) (* x x)))
double code(double x) {
	return (1.0 - cos(x)) / (x * x);
}
double code(double x) {
	return (1.0 - cos(x)) / (x * x);
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 31.3

    \[\frac{1 - \cos x}{x \cdot x}\]

Reproduce

herbie shell --seed 2021044 
(FPCore (x)
  :name "cos2 (problem 3.4.1)"
  :precision binary64
  (/ (- 1.0 (cos x)) (* x x)))