Average Error: 37.0 → 14.8
Time: 47.9s
Precision: 64
Internal Precision: 2368
\[\tan \left(x + e\right) - \tan x\]
\[\begin{array}{l} \mathbf{if}\;x \cdot {e}^{2} + \left({e}^{3} \cdot {x}^{2} + e\right) \le -6.095429746541726 \cdot 10^{-25}:\\ \;\;\;\;\frac{\frac{{\left(\tan x\right)}^{3} + {\left(\tan e\right)}^{3}}{\tan x \cdot \tan x - \tan e \cdot \left(\tan x - \tan e\right)}}{1 - \tan x \cdot \tan e} - \tan x\\ \mathbf{if}\;x \cdot {e}^{2} + \left({e}^{3} \cdot {x}^{2} + e\right) \le 3.4462337190046724 \cdot 10^{-48}:\\ \;\;\;\;x \cdot {e}^{2} + \left({e}^{3} \cdot {x}^{2} + e\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\tan x + \tan e}{\left(\sqrt[3]{1 - \tan x \cdot \tan e} \cdot \sqrt[3]{1 - \tan x \cdot \tan e}\right) \cdot \sqrt[3]{1 - \tan x \cdot \tan e}} - \tan x\\ \end{array}\]

Error

Bits error versus x

Bits error versus e

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if (+ (* x (pow e 2)) (+ (* (pow e 3) (pow x 2)) e)) < -6.095429746541726e-25

    1. Initial program 35.4

      \[\tan \left(x + e\right) - \tan x\]
    2. Using strategy rm
    3. Applied tan-sum10.7

      \[\leadsto \color{blue}{\frac{\tan x + \tan e}{1 - \tan x \cdot \tan e}} - \tan x\]
    4. Using strategy rm
    5. Applied flip3-+10.8

      \[\leadsto \frac{\color{blue}{\frac{{\left(\tan x\right)}^{3} + {\left(\tan e\right)}^{3}}{\tan x \cdot \tan x + \left(\tan e \cdot \tan e - \tan x \cdot \tan e\right)}}}{1 - \tan x \cdot \tan e} - \tan x\]
    6. Applied simplify10.8

      \[\leadsto \frac{\frac{{\left(\tan x\right)}^{3} + {\left(\tan e\right)}^{3}}{\color{blue}{\tan x \cdot \tan x - \tan e \cdot \left(\tan x - \tan e\right)}}}{1 - \tan x \cdot \tan e} - \tan x\]

    if -6.095429746541726e-25 < (+ (* x (pow e 2)) (+ (* (pow e 3) (pow x 2)) e)) < 3.4462337190046724e-48

    1. Initial program 40.1

      \[\tan \left(x + e\right) - \tan x\]
    2. Taylor expanded around 0 16.7

      \[\leadsto \color{blue}{x \cdot {e}^{2} + \left({e}^{3} \cdot {x}^{2} + e\right)}\]

    if 3.4462337190046724e-48 < (+ (* x (pow e 2)) (+ (* (pow e 3) (pow x 2)) e))

    1. Initial program 35.7

      \[\tan \left(x + e\right) - \tan x\]
    2. Using strategy rm
    3. Applied tan-sum14.9

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

      \[\leadsto \frac{\tan x + \tan e}{\color{blue}{\left(\sqrt[3]{1 - \tan x \cdot \tan e} \cdot \sqrt[3]{1 - \tan x \cdot \tan e}\right) \cdot \sqrt[3]{1 - \tan x \cdot \tan e}}} - \tan x\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 47.9s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)' 
(FPCore (x e)
  :name "tan(x+e) - tan(x)"
  (- (tan (+ x e)) (tan x)))