Average Error: 0.3 → 0.4
Time: 5.5s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\left(1 - \tan x \cdot \tan x\right) \cdot \frac{1}{1 + \tan x \cdot \tan x}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\left(1 - \tan x \cdot \tan x\right) \cdot \frac{1}{1 + \tan x \cdot \tan x}
double f(double x) {
        double r12020 = 1.0;
        double r12021 = x;
        double r12022 = tan(r12021);
        double r12023 = r12022 * r12022;
        double r12024 = r12020 - r12023;
        double r12025 = r12020 + r12023;
        double r12026 = r12024 / r12025;
        return r12026;
}

double f(double x) {
        double r12027 = 1.0;
        double r12028 = x;
        double r12029 = tan(r12028);
        double r12030 = r12029 * r12029;
        double r12031 = r12027 - r12030;
        double r12032 = 1.0;
        double r12033 = r12027 + r12030;
        double r12034 = r12032 / r12033;
        double r12035 = r12031 * r12034;
        return r12035;
}

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 add-cbrt-cube0.5

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

    \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\left(1 - \tan x \cdot \tan x\right) \cdot \left(1 - \tan x \cdot \tan x\right)\right) \cdot \left(1 - \tan x \cdot \tan x\right)}}}{\sqrt[3]{\left(\left(1 + \tan x \cdot \tan x\right) \cdot \left(1 + \tan x \cdot \tan x\right)\right) \cdot \left(1 + \tan x \cdot \tan x\right)}}\]
  5. Applied cbrt-undiv0.5

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

    \[\leadsto \sqrt[3]{\color{blue}{{\left(\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\right)}^{3}}}\]
  7. Using strategy rm
  8. Applied div-inv0.5

    \[\leadsto \sqrt[3]{{\color{blue}{\left(\left(1 - \tan x \cdot \tan x\right) \cdot \frac{1}{1 + \tan x \cdot \tan x}\right)}}^{3}}\]
  9. Applied unpow-prod-down0.5

    \[\leadsto \sqrt[3]{\color{blue}{{\left(1 - \tan x \cdot \tan x\right)}^{3} \cdot {\left(\frac{1}{1 + \tan x \cdot \tan x}\right)}^{3}}}\]
  10. Applied cbrt-prod0.6

    \[\leadsto \color{blue}{\sqrt[3]{{\left(1 - \tan x \cdot \tan x\right)}^{3}} \cdot \sqrt[3]{{\left(\frac{1}{1 + \tan x \cdot \tan x}\right)}^{3}}}\]
  11. Simplified0.5

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

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

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

Reproduce

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