Average Error: 0.3 → 0.4
Time: 16.9s
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 r21690 = 1.0;
        double r21691 = x;
        double r21692 = tan(r21691);
        double r21693 = r21692 * r21692;
        double r21694 = r21690 - r21693;
        double r21695 = r21690 + r21693;
        double r21696 = r21694 / r21695;
        return r21696;
}

double f(double x) {
        double r21697 = 1.0;
        double r21698 = x;
        double r21699 = sin(r21698);
        double r21700 = 2.0;
        double r21701 = pow(r21699, r21700);
        double r21702 = cos(r21698);
        double r21703 = pow(r21702, r21700);
        double r21704 = r21701 / r21703;
        double r21705 = r21697 - r21704;
        double r21706 = r21704 + r21697;
        double r21707 = r21705 / r21706;
        return r21707;
}

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