Average Error: 0.3 → 0.4
Time: 10.2s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{1 - \frac{{\left(\sin x\right)}^{2}}{{\left(\cos x\right)}^{2}}}{\frac{{\left(\sin x\right)}^{2}}{{\left(\cos x\right)}^{2}} + 1}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{1 - \frac{{\left(\sin x\right)}^{2}}{{\left(\cos x\right)}^{2}}}{\frac{{\left(\sin x\right)}^{2}}{{\left(\cos x\right)}^{2}} + 1}
double f(double x) {
        double r14484 = 1.0;
        double r14485 = x;
        double r14486 = tan(r14485);
        double r14487 = r14486 * r14486;
        double r14488 = r14484 - r14487;
        double r14489 = r14484 + r14487;
        double r14490 = r14488 / r14489;
        return r14490;
}

double f(double x) {
        double r14491 = 1.0;
        double r14492 = x;
        double r14493 = sin(r14492);
        double r14494 = 2.0;
        double r14495 = pow(r14493, r14494);
        double r14496 = cos(r14492);
        double r14497 = pow(r14496, r14494);
        double r14498 = r14495 / r14497;
        double r14499 = r14491 - r14498;
        double r14500 = r14498 + r14491;
        double r14501 = r14499 / r14500;
        return r14501;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.3

    \[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
  2. Using strategy rm
  3. Applied tan-quot0.4

    \[\leadsto \frac{1 - \tan x \cdot \color{blue}{\frac{\sin x}{\cos x}}}{1 + \tan x \cdot \tan x}\]
  4. Applied associate-*r/0.4

    \[\leadsto \frac{1 - \color{blue}{\frac{\tan x \cdot \sin x}{\cos x}}}{1 + \tan x \cdot \tan x}\]
  5. Using strategy rm
  6. Applied associate-/l*0.4

    \[\leadsto \frac{1 - \color{blue}{\frac{\tan x}{\frac{\cos x}{\sin x}}}}{1 + \tan x \cdot \tan x}\]
  7. Taylor expanded around inf 0.4

    \[\leadsto \color{blue}{\frac{1 - \frac{{\left(\sin x\right)}^{2}}{{\left(\cos x\right)}^{2}}}{\frac{{\left(\sin x\right)}^{2}}{{\left(\cos x\right)}^{2}} + 1}}\]
  8. Final simplification0.4

    \[\leadsto \frac{1 - \frac{{\left(\sin x\right)}^{2}}{{\left(\cos x\right)}^{2}}}{\frac{{\left(\sin x\right)}^{2}}{{\left(\cos x\right)}^{2}} + 1}\]

Reproduce

herbie shell --seed 2020043 +o rules:numerics
(FPCore (x)
  :name "Trigonometry B"
  :precision binary64
  (/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))