Average Error: 30.5 → 0.1
Time: 29.7s
Precision: 64
Internal Precision: 2368
\[\frac{1 - \cos x}{x \cdot x}\]
\[\frac{\sin x}{x} \cdot \frac{\tan \left(\frac{x}{2}\right)}{x}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 30.5

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

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

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

    \[\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.0

    \[\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-*l*15.1

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

    \[\leadsto \color{blue}{\frac{\sin x}{x} \cdot \frac{\sin x}{x \cdot \left(1 + \cos x\right)}}\]
  11. Simplified0.3

    \[\leadsto \frac{\sin x}{x} \cdot \color{blue}{\frac{\sin x}{(\left(\cos x\right) \cdot x + x)_*}}\]
  12. Using strategy rm
  13. Applied *-un-lft-identity0.3

    \[\leadsto \frac{\sin x}{x} \cdot \frac{\sin x}{\color{blue}{1 \cdot (\left(\cos x\right) \cdot x + x)_*}}\]
  14. Applied *-un-lft-identity0.3

    \[\leadsto \frac{\sin x}{x} \cdot \frac{\color{blue}{1 \cdot \sin x}}{1 \cdot (\left(\cos x\right) \cdot x + x)_*}\]
  15. Applied times-frac0.3

    \[\leadsto \frac{\sin x}{x} \cdot \color{blue}{\left(\frac{1}{1} \cdot \frac{\sin x}{(\left(\cos x\right) \cdot x + x)_*}\right)}\]
  16. Simplified0.3

    \[\leadsto \frac{\sin x}{x} \cdot \left(\color{blue}{1} \cdot \frac{\sin x}{(\left(\cos x\right) \cdot x + x)_*}\right)\]
  17. Simplified0.1

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

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

Runtime

Time bar (total: 29.7s)Debug logProfile

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