Average Error: 0.3 → 0.4
Time: 17.1s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{\frac{1 \cdot \sqrt{1} - \tan x \cdot \left(\tan x \cdot \tan x\right)}{\tan x \cdot \frac{1 - \tan x \cdot \tan x}{\sqrt{1} - \tan x} + 1} \cdot \left(\sqrt{1} + \tan x\right)}{1 + \tan x \cdot \tan x}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{\frac{1 \cdot \sqrt{1} - \tan x \cdot \left(\tan x \cdot \tan x\right)}{\tan x \cdot \frac{1 - \tan x \cdot \tan x}{\sqrt{1} - \tan x} + 1} \cdot \left(\sqrt{1} + \tan x\right)}{1 + \tan x \cdot \tan x}
double f(double x) {
        double r786091 = 1.0;
        double r786092 = x;
        double r786093 = tan(r786092);
        double r786094 = r786093 * r786093;
        double r786095 = r786091 - r786094;
        double r786096 = r786091 + r786094;
        double r786097 = r786095 / r786096;
        return r786097;
}

double f(double x) {
        double r786098 = 1.0;
        double r786099 = sqrt(r786098);
        double r786100 = r786098 * r786099;
        double r786101 = x;
        double r786102 = tan(r786101);
        double r786103 = r786102 * r786102;
        double r786104 = r786102 * r786103;
        double r786105 = r786100 - r786104;
        double r786106 = r786098 - r786103;
        double r786107 = r786099 - r786102;
        double r786108 = r786106 / r786107;
        double r786109 = r786102 * r786108;
        double r786110 = r786109 + r786098;
        double r786111 = r786105 / r786110;
        double r786112 = r786099 + r786102;
        double r786113 = r786111 * r786112;
        double r786114 = r786098 + r786103;
        double r786115 = r786113 / r786114;
        return r786115;
}

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-sqr-sqrt0.3

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

    \[\leadsto \frac{\color{blue}{\left(\sqrt{1} + \tan x\right) \cdot \left(\sqrt{1} - \tan x\right)}}{1 + \tan x \cdot \tan x}\]
  5. Using strategy rm
  6. Applied flip3--0.4

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

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

    \[\leadsto \frac{\left(\sqrt{1} + \tan x\right) \cdot \frac{1 \cdot \sqrt{1} - \left(\tan x \cdot \tan x\right) \cdot \tan x}{\color{blue}{1 + \tan x \cdot \left(\sqrt{1} + \tan x\right)}}}{1 + \tan x \cdot \tan x}\]
  9. Using strategy rm
  10. Applied flip-+0.4

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

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

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

Reproduce

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