Average Error: 0.3 → 0.4
Time: 15.6s
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 r18411 = 1.0;
        double r18412 = x;
        double r18413 = tan(r18412);
        double r18414 = r18413 * r18413;
        double r18415 = r18411 - r18414;
        double r18416 = r18411 + r18414;
        double r18417 = r18415 / r18416;
        return r18417;
}

double f(double x) {
        double r18418 = 1.0;
        double r18419 = x;
        double r18420 = sin(r18419);
        double r18421 = 2.0;
        double r18422 = pow(r18420, r18421);
        double r18423 = cos(r18419);
        double r18424 = pow(r18423, r18421);
        double r18425 = r18422 / r18424;
        double r18426 = r18418 - r18425;
        double r18427 = r18425 + r18418;
        double r18428 = r18426 / r18427;
        return r18428;
}

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. 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}}\]
  3. 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 2019291 
(FPCore (x)
  :name "Trigonometry B"
  :precision binary64
  (/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))