Average Error: 30.2 → 0
Time: 11.5s
Precision: 64
Internal Precision: 2368
\[\frac{1 - \cos x}{\sin x}\]
\[\tan \left(\frac{x}{2}\right)\]

Error

Bits error versus x

Target

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

Derivation

  1. Initial program 30.2

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

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

Runtime

Time bar (total: 11.5s)Debug logProfile

herbie shell --seed '#(1072840222 1305617769 1692503039 1353360431 4178980589 1488672652)' +o rules:numerics
(FPCore (x)
  :name "tanhf (example 3.4)"
  :herbie-expected 2

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

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