Average Error: 15.6 → 0.5
Time: 22.0s
Precision: 64
Internal Precision: 1344
\[\frac{1 - \cos x}{1 + \sin x}\]
\[\frac{\sin x}{\sin x + 1} \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.6

    \[\frac{1 - \cos x}{1 + \sin x}\]
  2. Initial simplification15.6

    \[\leadsto \frac{1 - \cos x}{1 + \sin x}\]
  3. Using strategy rm
  4. Applied flip--15.8

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

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

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

    \[\leadsto \color{blue}{\frac{\sin x}{1 + \sin x} \cdot \frac{\sin x}{1 + \cos x}}\]
  9. Simplified0.5

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

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

Runtime

Time bar (total: 22.0s)Debug log

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