Average Error: 0.3 → 0.4
Time: 16.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}}}{\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 r20054 = 1.0;
        double r20055 = x;
        double r20056 = tan(r20055);
        double r20057 = r20056 * r20056;
        double r20058 = r20054 - r20057;
        double r20059 = r20054 + r20057;
        double r20060 = r20058 / r20059;
        return r20060;
}

double f(double x) {
        double r20061 = 1.0;
        double r20062 = x;
        double r20063 = sin(r20062);
        double r20064 = 2.0;
        double r20065 = pow(r20063, r20064);
        double r20066 = cos(r20062);
        double r20067 = pow(r20066, r20064);
        double r20068 = r20065 / r20067;
        double r20069 = r20061 - r20068;
        double r20070 = r20068 + r20061;
        double r20071 = r20069 / r20070;
        return r20071;
}

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