Average Error: 30.7 → 0.0
Time: 13.2s
Precision: 64
Internal Precision: 2432
\[\frac{1 - \cos x}{\sin x}\]
\[\tan \left(\frac{x}{2}\right)\]

Error

Bits error versus x

Target

Original30.7
Target0.0
Herbie0.0
\[\tan \left(\frac{x}{2}\right)\]

Derivation

  1. Initial program 30.7

    \[\frac{1 - \cos x}{\sin x}\]
  2. Applied simplify0.0

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

Runtime

Time bar (total: 13.2s)Debug logProfile

herbie shell --seed '#(1070258749 1877548225 2229079127 1588002776 3179087814 1886870650)' +o rules:numerics
(FPCore (x)
  :name "tanhf (example 3.4)"
  :herbie-expected 2

  :herbie-target
  (tan (/ x 2))

  (/ (- 1 (cos x)) (sin x)))