Average Error: 0.3 → 0.4
Time: 15.7s
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 r20562 = 1.0;
        double r20563 = x;
        double r20564 = tan(r20563);
        double r20565 = r20564 * r20564;
        double r20566 = r20562 - r20565;
        double r20567 = r20562 + r20565;
        double r20568 = r20566 / r20567;
        return r20568;
}

double f(double x) {
        double r20569 = 1.0;
        double r20570 = x;
        double r20571 = sin(r20570);
        double r20572 = 2.0;
        double r20573 = pow(r20571, r20572);
        double r20574 = cos(r20570);
        double r20575 = pow(r20574, r20572);
        double r20576 = r20573 / r20575;
        double r20577 = r20569 - r20576;
        double r20578 = r20576 + r20569;
        double r20579 = r20577 / r20578;
        return r20579;
}

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