Average Error: 21.6 → 20.3
Time: 29.2s
Precision: 64
Internal Precision: 128
\[\frac{1 - \cos x}{x \cdot x}\]
\[\frac{\sin x \cdot \sin \left(x \cdot \frac{1}{2}\right)}{\cos \left(x \cdot \frac{1}{2}\right) \cdot {x}^{2}}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 21.6

    \[\frac{1 - \cos x}{x \cdot x}\]
  2. Initial simplification21.6

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

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

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

    \[\leadsto \frac{\color{blue}{\sin x \cdot \sin x}}{\left(x \cdot x\right) \cdot \left(1 + \cos x\right)}\]
  7. Taylor expanded around inf 20.5

    \[\leadsto \color{blue}{\frac{{\left(\sin x\right)}^{2}}{{x}^{2} \cdot \left(\cos x + 1\right)}}\]
  8. Simplified20.3

    \[\leadsto \color{blue}{\frac{\tan \left(\frac{x}{2}\right)}{\frac{x \cdot x}{\sin x}}}\]
  9. Taylor expanded around -inf 20.3

    \[\leadsto \color{blue}{\frac{\sin x \cdot \sin \left(\frac{1}{2} \cdot x\right)}{\cos \left(\frac{1}{2} \cdot x\right) \cdot {x}^{2}}}\]
  10. Final simplification20.3

    \[\leadsto \frac{\sin x \cdot \sin \left(x \cdot \frac{1}{2}\right)}{\cos \left(x \cdot \frac{1}{2}\right) \cdot {x}^{2}}\]

Runtime

Time bar (total: 29.2s)Debug logProfile

herbie shell --seed 2018277 
(FPCore (x)
  :name "cos2 (problem 3.4.1)"
  (/ (- 1 (cos x)) (* x x)))