Average Error: 39.8 → 39.8
Time: 2.6s
Precision: binary64
Cost: 13120
\[\cos \left(x + \varepsilon\right) - \cos x\]
\[\cos \left(x + \varepsilon\right) - \cos x\]
\cos \left(x + \varepsilon\right) - \cos x
\cos \left(x + \varepsilon\right) - \cos x
(FPCore (x eps) :precision binary64 (- (cos (+ x eps)) (cos x)))
(FPCore (x eps) :precision binary64 (- (cos (+ x eps)) (cos x)))
double code(double x, double eps) {
	return cos(x + eps) - cos(x);
}
double code(double x, double eps) {
	return cos(x + eps) - cos(x);
}

Error

Bits error versus x

Bits error versus eps

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 39.8

    \[\cos \left(x + \varepsilon\right) - \cos x\]

Reproduce

herbie shell --seed 2021042 
(FPCore (x eps)
  :name "2cos (problem 3.3.5)"
  :precision binary64
  (- (cos (+ x eps)) (cos x)))