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

Error

Bits error versus x

Target

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

Derivation

  1. Initial program 30.9

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

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

Runtime

Time bar (total: 13.1s)Debug logProfile

herbie shell --seed '#(1070355188 2193211668 3977393919 3454156579 3755371326 1656365382)' 
(FPCore (x)
  :name "tanhf (example 3.4)"
  :herbie-expected 2

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

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