Average Error: 37.3 → 0.4
Time: 1.4m
Precision: 64
Internal Precision: 2368
\[\tan \left(x + \varepsilon\right) - \tan x\]
\[\frac{\frac{\sin \varepsilon}{\cos x \cdot \cos \varepsilon}}{1 - \tan \varepsilon \cdot \tan x} \cdot \left(\cos x + \frac{\sin x}{\frac{\cos x}{\sin x}}\right)\]

Error

Bits error versus x

Bits error versus eps

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original37.3
Target15.1
Herbie0.4
\[\frac{\sin \varepsilon}{\cos x \cdot \cos \left(x + \varepsilon\right)}\]

Derivation

  1. Initial program 37.3

    \[\tan \left(x + \varepsilon\right) - \tan x\]
  2. Using strategy rm
  3. Applied tan-sum22.1

    \[\leadsto \color{blue}{\frac{\tan x + \tan \varepsilon}{1 - \tan x \cdot \tan \varepsilon}} - \tan x\]
  4. Using strategy rm
  5. Applied add-cbrt-cube22.2

    \[\leadsto \frac{\tan x + \tan \varepsilon}{\color{blue}{\sqrt[3]{\left(\left(1 - \tan x \cdot \tan \varepsilon\right) \cdot \left(1 - \tan x \cdot \tan \varepsilon\right)\right) \cdot \left(1 - \tan x \cdot \tan \varepsilon\right)}}} - \tan x\]
  6. Applied simplify22.2

    \[\leadsto \frac{\tan x + \tan \varepsilon}{\sqrt[3]{\color{blue}{{\left(1 - \tan \varepsilon \cdot \tan x\right)}^{3}}}} - \tan x\]
  7. Using strategy rm
  8. Applied tan-quot22.3

    \[\leadsto \frac{\tan x + \tan \varepsilon}{\sqrt[3]{{\left(1 - \tan \varepsilon \cdot \tan x\right)}^{3}}} - \color{blue}{\frac{\sin x}{\cos x}}\]
  9. Applied frac-sub22.3

    \[\leadsto \color{blue}{\frac{\left(\tan x + \tan \varepsilon\right) \cdot \cos x - \sqrt[3]{{\left(1 - \tan \varepsilon \cdot \tan x\right)}^{3}} \cdot \sin x}{\sqrt[3]{{\left(1 - \tan \varepsilon \cdot \tan x\right)}^{3}} \cdot \cos x}}\]
  10. Applied simplify22.3

    \[\leadsto \frac{\color{blue}{\cos x \cdot \left(\tan \varepsilon + \tan x\right) - \left(1 - \tan \varepsilon \cdot \tan x\right) \cdot \sin x}}{\sqrt[3]{{\left(1 - \tan \varepsilon \cdot \tan x\right)}^{3}} \cdot \cos x}\]
  11. Applied simplify22.3

    \[\leadsto \frac{\cos x \cdot \left(\tan \varepsilon + \tan x\right) - \left(1 - \tan \varepsilon \cdot \tan x\right) \cdot \sin x}{\color{blue}{\cos x - \left(\tan \varepsilon \cdot \cos x\right) \cdot \tan x}}\]
  12. Taylor expanded around inf 0.4

    \[\leadsto \frac{\color{blue}{\frac{\sin \varepsilon \cdot {\left(\sin x\right)}^{2}}{\cos \varepsilon \cdot \cos x} + \frac{\sin \varepsilon \cdot \cos x}{\cos \varepsilon}}}{\cos x - \left(\tan \varepsilon \cdot \cos x\right) \cdot \tan x}\]
  13. Applied simplify0.4

    \[\leadsto \color{blue}{\frac{\frac{\sin \varepsilon}{\cos x \cdot \cos \varepsilon}}{1 - \tan \varepsilon \cdot \tan x} \cdot \left(\cos x + \frac{\sin x}{\frac{\cos x}{\sin x}}\right)}\]

Runtime

Time bar (total: 1.4m)Debug logProfile

herbie shell --seed 2018198 
(FPCore (x eps)
  :name "2tan (problem 3.3.2)"

  :herbie-target
  (/ (sin eps) (* (cos x) (cos (+ x eps))))

  (- (tan (+ x eps)) (tan x)))