Average Error: 0.3 → 0.3
Time: 10.1s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{\left(\tan x + \sqrt{1}\right) \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{\left(\tan x + \sqrt{1}\right) \cdot \left(\sqrt{1} - \tan x\right)}{1 + \tan x \cdot \tan x}
double f(double x) {
        double r13227 = 1.0;
        double r13228 = x;
        double r13229 = tan(r13228);
        double r13230 = r13229 * r13229;
        double r13231 = r13227 - r13230;
        double r13232 = r13227 + r13230;
        double r13233 = r13231 / r13232;
        return r13233;
}

double f(double x) {
        double r13234 = x;
        double r13235 = tan(r13234);
        double r13236 = 1.0;
        double r13237 = sqrt(r13236);
        double r13238 = r13235 + r13237;
        double r13239 = r13237 - r13235;
        double r13240 = r13238 * r13239;
        double r13241 = r13235 * r13235;
        double r13242 = r13236 + r13241;
        double r13243 = r13240 / r13242;
        return r13243;
}

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

    \[\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 + \sqrt{1}\right)} \cdot \frac{\sqrt{1} - \tan x}{1 + \tan x \cdot \tan x}\]
  8. Using strategy rm
  9. Applied div-sub0.4

    \[\leadsto \left(\tan x + \sqrt{1}\right) \cdot \color{blue}{\left(\frac{\sqrt{1}}{1 + \tan x \cdot \tan x} - \frac{\tan x}{1 + \tan x \cdot \tan x}\right)}\]
  10. Using strategy rm
  11. Applied sub-div0.4

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

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

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

Reproduce

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