Average Error: 0.3 → 0.4
Time: 16.4s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{1 - \tan x \cdot \tan x}{1 + \frac{{\left(\sin x\right)}^{2}}{{\left(\cos x\right)}^{2}}}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{1 - \tan x \cdot \tan x}{1 + \frac{{\left(\sin x\right)}^{2}}{{\left(\cos x\right)}^{2}}}
double f(double x) {
        double r19111 = 1.0;
        double r19112 = x;
        double r19113 = tan(r19112);
        double r19114 = r19113 * r19113;
        double r19115 = r19111 - r19114;
        double r19116 = r19111 + r19114;
        double r19117 = r19115 / r19116;
        return r19117;
}

double f(double x) {
        double r19118 = 1.0;
        double r19119 = x;
        double r19120 = tan(r19119);
        double r19121 = r19120 * r19120;
        double r19122 = r19118 - r19121;
        double r19123 = sin(r19119);
        double r19124 = 2.0;
        double r19125 = pow(r19123, r19124);
        double r19126 = cos(r19119);
        double r19127 = pow(r19126, r19124);
        double r19128 = r19125 / r19127;
        double r19129 = r19118 + r19128;
        double r19130 = r19122 / r19129;
        return r19130;
}

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 - \tan x \cdot \tan x}{1 + \tan x \cdot \color{blue}{\frac{\sin x}{\cos x}}}\]
  4. Applied tan-quot0.4

    \[\leadsto \frac{1 - \tan x \cdot \tan x}{1 + \color{blue}{\frac{\sin x}{\cos x}} \cdot \frac{\sin x}{\cos x}}\]
  5. Applied frac-times0.4

    \[\leadsto \frac{1 - \tan x \cdot \tan x}{1 + \color{blue}{\frac{\sin x \cdot \sin x}{\cos x \cdot \cos x}}}\]
  6. Simplified0.4

    \[\leadsto \frac{1 - \tan x \cdot \tan x}{1 + \frac{\color{blue}{{\left(\sin x\right)}^{2}}}{\cos x \cdot \cos x}}\]
  7. Simplified0.4

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

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

Reproduce

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