Average Error: 0.3 → 0.4
Time: 10.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 r11515 = 1.0;
        double r11516 = x;
        double r11517 = tan(r11516);
        double r11518 = r11517 * r11517;
        double r11519 = r11515 - r11518;
        double r11520 = r11515 + r11518;
        double r11521 = r11519 / r11520;
        return r11521;
}

double f(double x) {
        double r11522 = 1.0;
        double r11523 = x;
        double r11524 = sin(r11523);
        double r11525 = 2.0;
        double r11526 = pow(r11524, r11525);
        double r11527 = cos(r11523);
        double r11528 = pow(r11527, r11525);
        double r11529 = r11526 / r11528;
        double r11530 = r11522 - r11529;
        double r11531 = r11529 + r11522;
        double r11532 = r11530 / r11531;
        return r11532;
}

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