Average Error: 0.3 → 0.4
Time: 5.3s
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 r13595 = 1.0;
        double r13596 = x;
        double r13597 = tan(r13596);
        double r13598 = r13597 * r13597;
        double r13599 = r13595 - r13598;
        double r13600 = r13595 + r13598;
        double r13601 = r13599 / r13600;
        return r13601;
}

double f(double x) {
        double r13602 = 1.0;
        double r13603 = x;
        double r13604 = sin(r13603);
        double r13605 = 2.0;
        double r13606 = pow(r13604, r13605);
        double r13607 = cos(r13603);
        double r13608 = pow(r13607, r13605);
        double r13609 = r13606 / r13608;
        double r13610 = r13602 - r13609;
        double r13611 = r13609 + r13602;
        double r13612 = r13610 / r13611;
        return r13612;
}

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