Average Error: 0.3 → 0.4
Time: 18.0s
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}}}{1 + \frac{{\left(\sin x\right)}^{2}}{{\left(\cos x\right)}^{2}}}\]
\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}}}{1 + \frac{{\left(\sin x\right)}^{2}}{{\left(\cos x\right)}^{2}}}
double f(double x) {
        double r21339 = 1.0;
        double r21340 = x;
        double r21341 = tan(r21340);
        double r21342 = r21341 * r21341;
        double r21343 = r21339 - r21342;
        double r21344 = r21339 + r21342;
        double r21345 = r21343 / r21344;
        return r21345;
}

double f(double x) {
        double r21346 = 1.0;
        double r21347 = x;
        double r21348 = sin(r21347);
        double r21349 = 2.0;
        double r21350 = pow(r21348, r21349);
        double r21351 = cos(r21347);
        double r21352 = pow(r21351, r21349);
        double r21353 = r21350 / r21352;
        double r21354 = r21346 - r21353;
        double r21355 = r21346 + r21353;
        double r21356 = r21354 / r21355;
        return r21356;
}

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

    \[\leadsto \color{blue}{\frac{1 - \tan x \cdot \tan x}{\tan x \cdot \tan x + 1}}\]
  3. 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}}\]
  4. Simplified0.4

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

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

Reproduce

herbie shell --seed 2019195 
(FPCore (x)
  :name "Trigonometry B"
  (/ (- 1.0 (* (tan x) (tan x))) (+ 1.0 (* (tan x) (tan x)))))