Average Error: 0.3 → 0.4
Time: 5.2s
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 r11750 = 1.0;
        double r11751 = x;
        double r11752 = tan(r11751);
        double r11753 = r11752 * r11752;
        double r11754 = r11750 - r11753;
        double r11755 = r11750 + r11753;
        double r11756 = r11754 / r11755;
        return r11756;
}

double f(double x) {
        double r11757 = 1.0;
        double r11758 = x;
        double r11759 = sin(r11758);
        double r11760 = 2.0;
        double r11761 = pow(r11759, r11760);
        double r11762 = cos(r11758);
        double r11763 = pow(r11762, r11760);
        double r11764 = r11761 / r11763;
        double r11765 = r11757 - r11764;
        double r11766 = r11764 + r11757;
        double r11767 = r11765 / r11766;
        return r11767;
}

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