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

Error

Bits error versus x

Bits error versus eps

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Initial program 36.7

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

    \[\leadsto \color{blue}{\frac{\tan x + \tan \varepsilon}{1 - \tan x \cdot \tan \varepsilon}} - \tan x\]
  4. Using strategy rm
  5. Applied div-inv21.3

    \[\leadsto \color{blue}{\left(\tan x + \tan \varepsilon\right) \cdot \frac{1}{1 - \tan x \cdot \tan \varepsilon}} - \tan x\]
  6. Using strategy rm
  7. Applied tan-quot21.4

    \[\leadsto \left(\tan x + \tan \varepsilon\right) \cdot \frac{1}{1 - \tan x \cdot \tan \varepsilon} - \color{blue}{\frac{\sin x}{\cos x}}\]
  8. Applied associate-*r/21.3

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

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

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

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

Runtime

Time bar (total: 1.4m)Debug logProfile

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

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

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