Average Error: 0.3 → 0.4
Time: 5.4s
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 r11610 = 1.0;
        double r11611 = x;
        double r11612 = tan(r11611);
        double r11613 = r11612 * r11612;
        double r11614 = r11610 - r11613;
        double r11615 = r11610 + r11613;
        double r11616 = r11614 / r11615;
        return r11616;
}

double f(double x) {
        double r11617 = 1.0;
        double r11618 = x;
        double r11619 = sin(r11618);
        double r11620 = 2.0;
        double r11621 = pow(r11619, r11620);
        double r11622 = cos(r11618);
        double r11623 = pow(r11622, r11620);
        double r11624 = r11621 / r11623;
        double r11625 = r11617 - r11624;
        double r11626 = r11624 + r11617;
        double r11627 = r11625 / r11626;
        return r11627;
}

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 2020027 
(FPCore (x)
  :name "Trigonometry B"
  :precision binary64
  (/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))