Average Error: 29.6 → 0.3
Time: 18.9s
Precision: 64
\[\tan x - \tan \left(x + 1\right)\]
\[\tan x - \frac{\tan x + \tan 1}{1 - \left(\sqrt{\tan 1} \cdot \tan x\right) \cdot \sqrt{\tan 1}}\]
\tan x - \tan \left(x + 1\right)
\tan x - \frac{\tan x + \tan 1}{1 - \left(\sqrt{\tan 1} \cdot \tan x\right) \cdot \sqrt{\tan 1}}
double f(double x) {
        double r1154241 = x;
        double r1154242 = tan(r1154241);
        double r1154243 = 1.0;
        double r1154244 = r1154241 + r1154243;
        double r1154245 = tan(r1154244);
        double r1154246 = r1154242 - r1154245;
        return r1154246;
}

double f(double x) {
        double r1154247 = x;
        double r1154248 = tan(r1154247);
        double r1154249 = 1.0;
        double r1154250 = tan(r1154249);
        double r1154251 = r1154248 + r1154250;
        double r1154252 = 1.0;
        double r1154253 = sqrt(r1154250);
        double r1154254 = r1154253 * r1154248;
        double r1154255 = r1154254 * r1154253;
        double r1154256 = r1154252 - r1154255;
        double r1154257 = r1154251 / r1154256;
        double r1154258 = r1154248 - r1154257;
        return r1154258;
}

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. Simplified0.3

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

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

Reproduce

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