Average Error: 29.6 → 0.3
Time: 19.8s
Precision: 64
\[\tan x - \tan \left(x + 1\right)\]
\[\tan x - \frac{\tan x + \tan 1}{1 - \sqrt{\tan 1} \cdot \left(\tan x \cdot \sqrt{\tan 1}\right)}\]
\tan x - \tan \left(x + 1\right)
\tan x - \frac{\tan x + \tan 1}{1 - \sqrt{\tan 1} \cdot \left(\tan x \cdot \sqrt{\tan 1}\right)}
double f(double x) {
        double r56705311 = x;
        double r56705312 = tan(r56705311);
        double r56705313 = 1.0;
        double r56705314 = r56705311 + r56705313;
        double r56705315 = tan(r56705314);
        double r56705316 = r56705312 - r56705315;
        return r56705316;
}

double f(double x) {
        double r56705317 = x;
        double r56705318 = tan(r56705317);
        double r56705319 = 1.0;
        double r56705320 = tan(r56705319);
        double r56705321 = r56705318 + r56705320;
        double r56705322 = sqrt(r56705320);
        double r56705323 = r56705318 * r56705322;
        double r56705324 = r56705322 * r56705323;
        double r56705325 = r56705319 - r56705324;
        double r56705326 = r56705321 / r56705325;
        double r56705327 = r56705318 - r56705326;
        return r56705327;
}

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(\tan x \cdot \sqrt{\tan 1}\right)}\]

Reproduce

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