Average Error: 0.3 → 0.4
Time: 17.9s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\left(\tan x + 1\right) \cdot \frac{1 - \tan x}{\tan x \cdot \tan x + 1}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\left(\tan x + 1\right) \cdot \frac{1 - \tan x}{\tan x \cdot \tan x + 1}
double f(double x) {
        double r761460 = 1.0;
        double r761461 = x;
        double r761462 = tan(r761461);
        double r761463 = r761462 * r761462;
        double r761464 = r761460 - r761463;
        double r761465 = r761460 + r761463;
        double r761466 = r761464 / r761465;
        return r761466;
}

double f(double x) {
        double r761467 = x;
        double r761468 = tan(r761467);
        double r761469 = 1.0;
        double r761470 = r761468 + r761469;
        double r761471 = r761469 - r761468;
        double r761472 = r761468 * r761468;
        double r761473 = r761472 + r761469;
        double r761474 = r761471 / r761473;
        double r761475 = r761470 * r761474;
        return r761475;
}

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 *-un-lft-identity0.3

    \[\leadsto \frac{1 - \tan x \cdot \tan x}{\color{blue}{1 \cdot \left(1 + \tan x \cdot \tan x\right)}}\]
  4. Applied add-sqr-sqrt0.3

    \[\leadsto \frac{\color{blue}{\sqrt{1} \cdot \sqrt{1}} - \tan x \cdot \tan x}{1 \cdot \left(1 + \tan x \cdot \tan x\right)}\]
  5. Applied difference-of-squares0.4

    \[\leadsto \frac{\color{blue}{\left(\sqrt{1} + \tan x\right) \cdot \left(\sqrt{1} - \tan x\right)}}{1 \cdot \left(1 + \tan x \cdot \tan x\right)}\]
  6. Applied times-frac0.4

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

    \[\leadsto \color{blue}{\left(\tan x + 1\right)} \cdot \frac{\sqrt{1} - \tan x}{1 + \tan x \cdot \tan x}\]
  8. Simplified0.4

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

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

Reproduce

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