Average Error: 0.3 → 0.3
Time: 4.6s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
double f(double x) {
        double r10409 = 1.0;
        double r10410 = x;
        double r10411 = tan(r10410);
        double r10412 = r10411 * r10411;
        double r10413 = r10409 - r10412;
        double r10414 = r10409 + r10412;
        double r10415 = r10413 / r10414;
        return r10415;
}

double f(double x) {
        double r10416 = 1.0;
        double r10417 = x;
        double r10418 = tan(r10417);
        double r10419 = r10418 * r10418;
        double r10420 = r10416 - r10419;
        double r10421 = r10416 + r10419;
        double r10422 = r10420 / r10421;
        return r10422;
}

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. Using strategy rm
  5. Applied *-un-lft-identity0.4

    \[\leadsto \frac{1}{\frac{1 + \tan x \cdot \tan x}{\color{blue}{1 \cdot \left(1 - \tan x \cdot \tan x\right)}}}\]
  6. Applied *-un-lft-identity0.4

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

    \[\leadsto \frac{1}{\color{blue}{\frac{1}{1} \cdot \frac{1 + \tan x \cdot \tan x}{1 - \tan x \cdot \tan x}}}\]
  8. Applied add-cube-cbrt0.4

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

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

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

    \[\leadsto 1 \cdot \color{blue}{\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}}\]
  12. Final simplification0.3

    \[\leadsto \frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]

Reproduce

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