Average Error: 30.2 → 0.3
Time: 2.2m
Precision: 64
Internal Precision: 128
\[\frac{1 - \cos x}{x \cdot x}\]
\[\frac{\sin x}{x} \cdot \frac{\frac{\sin x}{x}}{1 + \cos x}\]

Error

Bits error versus x

Derivation

  1. Initial program 30.2

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

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

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

    \[\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 *-un-lft-identity15.0

    \[\leadsto \frac{\sin x \cdot \sin x}{\left(x \cdot \color{blue}{\left(1 \cdot x\right)}\right) \cdot \left(1 + \cos x\right)}\]
  8. Applied *-un-lft-identity15.0

    \[\leadsto \frac{\sin x \cdot \sin x}{\left(\color{blue}{\left(1 \cdot x\right)} \cdot \left(1 \cdot x\right)\right) \cdot \left(1 + \cos x\right)}\]
  9. Applied swap-sqr15.0

    \[\leadsto \frac{\sin x \cdot \sin x}{\color{blue}{\left(\left(1 \cdot 1\right) \cdot \left(x \cdot x\right)\right)} \cdot \left(1 + \cos x\right)}\]
  10. Applied associate-*l*15.0

    \[\leadsto \frac{\sin x \cdot \sin x}{\color{blue}{\left(1 \cdot 1\right) \cdot \left(\left(x \cdot x\right) \cdot \left(1 + \cos x\right)\right)}}\]
  11. Applied *-un-lft-identity15.0

    \[\leadsto \frac{\color{blue}{1 \cdot \left(\sin x \cdot \sin x\right)}}{\left(1 \cdot 1\right) \cdot \left(\left(x \cdot x\right) \cdot \left(1 + \cos x\right)\right)}\]
  12. Applied times-frac15.0

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

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

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

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

Reproduce

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