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

Error

Bits error versus x

Try it out

  1. Inputs

  2. Original Output:

    Herbie Output:

Target

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

Derivation

  1. Initial program 30.1

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

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

Runtime

Time bar (total: 16.7s)Debug logProfile

herbie shell --seed '#(1072361757 3390613284 2339397988 1175251238 145061547 3101881848)' 
(FPCore (x)
  :name "tanhf (example 3.4)"
  :herbie-expected 2

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

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