Average Error: 29.6 → 0.3
Time: 21.7s
Precision: 64
\[\tan x - \tan \left(x + 1\right)\]
\[\tan x - \frac{\tan x + \tan 1}{1 - \sqrt{\tan 1} \cdot \left(\sqrt{\tan 1} \cdot \tan x\right)}\]
\tan x - \tan \left(x + 1\right)
\tan x - \frac{\tan x + \tan 1}{1 - \sqrt{\tan 1} \cdot \left(\sqrt{\tan 1} \cdot \tan x\right)}
double f(double x) {
        double r463777 = x;
        double r463778 = tan(r463777);
        double r463779 = 1.0;
        double r463780 = r463777 + r463779;
        double r463781 = tan(r463780);
        double r463782 = r463778 - r463781;
        return r463782;
}

double f(double x) {
        double r463783 = x;
        double r463784 = tan(r463783);
        double r463785 = 1.0;
        double r463786 = tan(r463785);
        double r463787 = r463784 + r463786;
        double r463788 = 1.0;
        double r463789 = sqrt(r463786);
        double r463790 = r463789 * r463784;
        double r463791 = r463789 * r463790;
        double r463792 = r463788 - r463791;
        double r463793 = r463787 / r463792;
        double r463794 = r463784 - r463793;
        return r463794;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 29.6

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

    \[\leadsto \tan x - \color{blue}{\frac{\tan x + \tan 1}{1 - \tan x \cdot \tan 1}}\]
  4. Using strategy rm
  5. Applied add-sqr-sqrt0.3

    \[\leadsto \tan x - \frac{\tan x + \tan 1}{1 - \tan x \cdot \color{blue}{\left(\sqrt{\tan 1} \cdot \sqrt{\tan 1}\right)}}\]
  6. Applied associate-*r*0.3

    \[\leadsto \tan x - \frac{\tan x + \tan 1}{1 - \color{blue}{\left(\tan x \cdot \sqrt{\tan 1}\right) \cdot \sqrt{\tan 1}}}\]
  7. Final simplification0.3

    \[\leadsto \tan x - \frac{\tan x + \tan 1}{1 - \sqrt{\tan 1} \cdot \left(\sqrt{\tan 1} \cdot \tan x\right)}\]

Reproduce

herbie shell --seed 1 
(FPCore (x)
  :name "tan(x)-tan(x+1)"
  (- (tan x) (tan (+ x 1.0))))