Average Error: 31.2 → 0.4
Time: 34.0s
Precision: 64
Internal Precision: 128
\[\frac{1 - \cos x}{x \cdot x}\]
\[\frac{\tan \left(\frac{x}{2}\right)}{\frac{x}{\frac{\sin 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.2

    \[\frac{1 - \cos x}{x \cdot x}\]
  2. Using strategy rm
  3. Applied flip--31.4

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{\sin x \cdot \sin x}{x \cdot x}}{1 + \cos x}}\]
  8. Taylor expanded around -inf 15.5

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

    \[\leadsto \color{blue}{\frac{\tan \left(\frac{x}{2}\right)}{\frac{x \cdot x}{\sin x}}}\]
  10. Using strategy rm
  11. Applied associate-/l*0.4

    \[\leadsto \frac{\tan \left(\frac{x}{2}\right)}{\color{blue}{\frac{x}{\frac{\sin x}{x}}}}\]
  12. Final simplification0.4

    \[\leadsto \frac{\tan \left(\frac{x}{2}\right)}{\frac{x}{\frac{\sin x}{x}}}\]

Runtime

Time bar (total: 34.0s)Debug logProfile

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