Average Error: 15.3 → 0.6
Time: 6.7s
Precision: 64
Internal Precision: 1344
\[1 - \cos \left(\frac{x}{2}\right)\]
\[\frac{\sin \left(\frac{x}{2}\right) \cdot \sin \left(\frac{x}{2}\right)}{e^{\log \left(1 + \cos \left(\frac{x}{2}\right)\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

    \[1 - \cos \left(\frac{x}{2}\right)\]
  2. Initial simplification15.3

    \[\leadsto 1 - \cos \left(\frac{x}{2}\right)\]
  3. Using strategy rm
  4. Applied add-exp-log15.3

    \[\leadsto \color{blue}{e^{\log \left(1 - \cos \left(\frac{x}{2}\right)\right)}}\]
  5. Using strategy rm
  6. Applied flip--15.6

    \[\leadsto e^{\log \color{blue}{\left(\frac{1 \cdot 1 - \cos \left(\frac{x}{2}\right) \cdot \cos \left(\frac{x}{2}\right)}{1 + \cos \left(\frac{x}{2}\right)}\right)}}\]
  7. Applied log-div15.6

    \[\leadsto e^{\color{blue}{\log \left(1 \cdot 1 - \cos \left(\frac{x}{2}\right) \cdot \cos \left(\frac{x}{2}\right)\right) - \log \left(1 + \cos \left(\frac{x}{2}\right)\right)}}\]
  8. Applied exp-diff15.6

    \[\leadsto \color{blue}{\frac{e^{\log \left(1 \cdot 1 - \cos \left(\frac{x}{2}\right) \cdot \cos \left(\frac{x}{2}\right)\right)}}{e^{\log \left(1 + \cos \left(\frac{x}{2}\right)\right)}}}\]
  9. Simplified0.6

    \[\leadsto \frac{\color{blue}{\sin \left(\frac{x}{2}\right) \cdot \sin \left(\frac{x}{2}\right)}}{e^{\log \left(1 + \cos \left(\frac{x}{2}\right)\right)}}\]
  10. Final simplification0.6

    \[\leadsto \frac{\sin \left(\frac{x}{2}\right) \cdot \sin \left(\frac{x}{2}\right)}{e^{\log \left(1 + \cos \left(\frac{x}{2}\right)\right)}}\]

Runtime

Time bar (total: 6.7s)Debug log

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