Average Error: 30.7 → 0.3
Time: 32.8s
Precision: 64
Internal Precision: 128
\[\frac{1 - \cos x}{x \cdot x}\]
\[\frac{\frac{\sin x}{x} \cdot \frac{\sin x}{x}}{\cos x + 1}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 30.7

    \[\frac{1 - \cos x}{x \cdot x}\]
  2. Initial simplification30.7

    \[\leadsto \frac{1 - \cos x}{x \cdot x}\]
  3. Using strategy rm
  4. Applied flip--30.9

    \[\leadsto \frac{\color{blue}{\frac{1 \cdot 1 - \cos x \cdot \cos x}{1 + \cos x}}}{x \cdot x}\]
  5. Applied associate-/l/30.9

    \[\leadsto \color{blue}{\frac{1 \cdot 1 - \cos x \cdot \cos x}{\left(x \cdot x\right) \cdot \left(1 + \cos x\right)}}\]
  6. Simplified15.7

    \[\leadsto \frac{\color{blue}{\sin x \cdot \sin x}}{\left(x \cdot x\right) \cdot \left(1 + \cos x\right)}\]
  7. Using strategy rm
  8. Applied associate-/r*15.7

    \[\leadsto \color{blue}{\frac{\frac{\sin x \cdot \sin x}{x \cdot x}}{1 + \cos x}}\]
  9. Using strategy rm
  10. Applied times-frac0.3

    \[\leadsto \frac{\color{blue}{\frac{\sin x}{x} \cdot \frac{\sin x}{x}}}{1 + \cos x}\]
  11. Final simplification0.3

    \[\leadsto \frac{\frac{\sin x}{x} \cdot \frac{\sin x}{x}}{\cos x + 1}\]

Runtime

Time bar (total: 32.8s)Debug logProfile

herbie shell --seed 2018296 +o rules:numerics
(FPCore (x)
  :name "cos2 (problem 3.4.1)"
  (/ (- 1 (cos x)) (* x x)))