Average Error: 0.3 → 0.4
Time: 17.0s
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}}}{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 - \frac{{\left(\sin x\right)}^{2}}{{\left(\cos x\right)}^{2}}}{1 + \frac{{\left(\sin x\right)}^{2}}{{\left(\cos x\right)}^{2}}}
double f(double x) {
        double r20571 = 1.0;
        double r20572 = x;
        double r20573 = tan(r20572);
        double r20574 = r20573 * r20573;
        double r20575 = r20571 - r20574;
        double r20576 = r20571 + r20574;
        double r20577 = r20575 / r20576;
        return r20577;
}

double f(double x) {
        double r20578 = 1.0;
        double r20579 = x;
        double r20580 = sin(r20579);
        double r20581 = 2.0;
        double r20582 = pow(r20580, r20581);
        double r20583 = cos(r20579);
        double r20584 = pow(r20583, r20581);
        double r20585 = r20582 / r20584;
        double r20586 = r20578 - r20585;
        double r20587 = r20578 + r20585;
        double r20588 = r20586 / r20587;
        return r20588;
}

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 clear-num0.4

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

    \[\leadsto \frac{1}{\color{blue}{\frac{\tan x \cdot \tan x + 1}{1 - \tan x \cdot \tan x}}}\]
  5. Using strategy rm
  6. Applied div-inv0.4

    \[\leadsto \frac{1}{\color{blue}{\left(\tan x \cdot \tan x + 1\right) \cdot \frac{1}{1 - \tan x \cdot \tan x}}}\]
  7. Applied associate-/r*0.4

    \[\leadsto \color{blue}{\frac{\frac{1}{\tan x \cdot \tan x + 1}}{\frac{1}{1 - \tan x \cdot \tan x}}}\]
  8. 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}}\]
  9. Final simplification0.4

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

Reproduce

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