Average Error: 15.3 → 0.2
Time: 12.3s
Precision: 64
Internal Precision: 1344
\[\cos x - 1\]
\[0 - \sin x \cdot \tan \left(\frac{x}{2}\right)\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.3

    \[\cos x - 1\]
  2. Using strategy rm
  3. Applied flip--15.6

    \[\leadsto \color{blue}{\frac{\cos x \cdot \cos x - 1 \cdot 1}{\cos x + 1}}\]
  4. Applied simplify0.6

    \[\leadsto \frac{\color{blue}{-\sin x \cdot \sin x}}{\cos x + 1}\]
  5. Using strategy rm
  6. Applied neg-sub00.6

    \[\leadsto \frac{\color{blue}{0 - \sin x \cdot \sin x}}{\cos x + 1}\]
  7. Applied div-sub0.6

    \[\leadsto \color{blue}{\frac{0}{\cos x + 1} - \frac{\sin x \cdot \sin x}{\cos x + 1}}\]
  8. Applied simplify0.6

    \[\leadsto \color{blue}{0} - \frac{\sin x \cdot \sin x}{\cos x + 1}\]
  9. Applied simplify0.2

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

Runtime

Time bar (total: 12.3s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)' 
(FPCore (x)
  :name "cos(x) - 1"
  (- (cos x) 1))