Average Error: 30.2 → 1.6
Time: 26.5s
Precision: 64
Internal precision: 2432
\[\frac{1 - \cos x}{\sin x}\]
\[{\left(\sqrt[3]{\frac{\sin x}{\cos x + 1}}\right)}^3\]

Error

Bits error versus x

Target

Original30.2
Comparison0
Herbie1.6
\[ \tan \left(\frac{x}{2}\right) \]

Derivation

  1. Initial program 30.2

    \[\frac{1 - \cos x}{\sin x}\]
  2. Using strategy rm
  3. Applied flip-- 30.5

    \[\leadsto \frac{\color{blue}{\frac{{1}^2 - {\left(\cos x\right)}^2}{1 + \cos x}}}{\sin x}\]
  4. Applied simplify 15.0

    \[\leadsto \frac{\frac{\color{blue}{{\left(\sin x\right)}^2}}{1 + \cos x}}{\sin x}\]
  5. Using strategy rm
  6. Applied add-cube-cbrt 15.7

    \[\leadsto \color{blue}{{\left(\sqrt[3]{\frac{\frac{{\left(\sin x\right)}^2}{1 + \cos x}}{\sin x}}\right)}^3}\]
  7. Applied simplify 1.6

    \[\leadsto {\color{blue}{\left(\sqrt[3]{\frac{\sin x}{\cos x + 1}}\right)}}^3\]
  8. Removed slow pow expressions

Runtime

Time bar (total: 26.5s) Debug log

Please include this information when filing a bug report:

herbie shell --seed '#(3283856077 3183919125 3399458751 396155847 3688194147 1862413033)'
(FPCore (x)
  :name "tanhf (example 3.4)"
  :herbie-expected 1

  :target
  (tan (/ x 2))

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