Average Error: 0.3 → 0.4
Time: 19.7s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{\left(1 - \sqrt{\frac{\sin x \cdot \tan x}{\cos x}}\right) \cdot \left(1 + \sqrt{\frac{\sin x \cdot \tan x}{\cos x}}\right)}{1 + \tan x \cdot \tan x}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{\left(1 - \sqrt{\frac{\sin x \cdot \tan x}{\cos x}}\right) \cdot \left(1 + \sqrt{\frac{\sin x \cdot \tan x}{\cos x}}\right)}{1 + \tan x \cdot \tan x}
double f(double x) {
        double r704848 = 1.0;
        double r704849 = x;
        double r704850 = tan(r704849);
        double r704851 = r704850 * r704850;
        double r704852 = r704848 - r704851;
        double r704853 = r704848 + r704851;
        double r704854 = r704852 / r704853;
        return r704854;
}

double f(double x) {
        double r704855 = 1.0;
        double r704856 = x;
        double r704857 = sin(r704856);
        double r704858 = tan(r704856);
        double r704859 = r704857 * r704858;
        double r704860 = cos(r704856);
        double r704861 = r704859 / r704860;
        double r704862 = sqrt(r704861);
        double r704863 = r704855 - r704862;
        double r704864 = r704855 + r704862;
        double r704865 = r704863 * r704864;
        double r704866 = r704858 * r704858;
        double r704867 = r704855 + r704866;
        double r704868 = r704865 / r704867;
        return r704868;
}

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. Using strategy rm
  3. Applied tan-quot0.4

    \[\leadsto \frac{1 - \color{blue}{\frac{\sin x}{\cos x}} \cdot \tan x}{1 + \tan x \cdot \tan x}\]
  4. Applied associate-*l/0.4

    \[\leadsto \frac{1 - \color{blue}{\frac{\sin x \cdot \tan x}{\cos x}}}{1 + \tan x \cdot \tan x}\]
  5. Using strategy rm
  6. Applied add-sqr-sqrt0.4

    \[\leadsto \frac{1 - \color{blue}{\sqrt{\frac{\sin x \cdot \tan x}{\cos x}} \cdot \sqrt{\frac{\sin x \cdot \tan x}{\cos x}}}}{1 + \tan x \cdot \tan x}\]
  7. Applied *-un-lft-identity0.4

    \[\leadsto \frac{\color{blue}{1 \cdot 1} - \sqrt{\frac{\sin x \cdot \tan x}{\cos x}} \cdot \sqrt{\frac{\sin x \cdot \tan x}{\cos x}}}{1 + \tan x \cdot \tan x}\]
  8. Applied difference-of-squares0.4

    \[\leadsto \frac{\color{blue}{\left(1 + \sqrt{\frac{\sin x \cdot \tan x}{\cos x}}\right) \cdot \left(1 - \sqrt{\frac{\sin x \cdot \tan x}{\cos x}}\right)}}{1 + \tan x \cdot \tan x}\]
  9. Final simplification0.4

    \[\leadsto \frac{\left(1 - \sqrt{\frac{\sin x \cdot \tan x}{\cos x}}\right) \cdot \left(1 + \sqrt{\frac{\sin x \cdot \tan x}{\cos x}}\right)}{1 + \tan x \cdot \tan x}\]

Reproduce

herbie shell --seed 2019168 
(FPCore (x)
  :name "Trigonometry B"
  (/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))