Average Error: 0.3 → 0.5
Time: 4.7s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{1 - \tan x \cdot \tan x}{\log \left(e^{\sqrt{1} - \tan x}\right)} \cdot \frac{\sqrt{1} - \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}{\log \left(e^{\sqrt{1} - \tan x}\right)} \cdot \frac{\sqrt{1} - \tan x}{1 + \tan x \cdot \tan x}
double f(double x) {
        double r10269 = 1.0;
        double r10270 = x;
        double r10271 = tan(r10270);
        double r10272 = r10271 * r10271;
        double r10273 = r10269 - r10272;
        double r10274 = r10269 + r10272;
        double r10275 = r10273 / r10274;
        return r10275;
}

double f(double x) {
        double r10276 = 1.0;
        double r10277 = x;
        double r10278 = tan(r10277);
        double r10279 = r10278 * r10278;
        double r10280 = r10276 - r10279;
        double r10281 = sqrt(r10276);
        double r10282 = r10281 - r10278;
        double r10283 = exp(r10282);
        double r10284 = log(r10283);
        double r10285 = r10280 / r10284;
        double r10286 = r10276 + r10279;
        double r10287 = r10282 / r10286;
        double r10288 = r10285 * r10287;
        return r10288;
}

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

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

    \[\leadsto \frac{\color{blue}{1 - \tan x \cdot \tan x}}{\sqrt{1} - \tan x} \cdot \frac{\sqrt{1} - \tan x}{1 + \tan x \cdot \tan x}\]
  11. Using strategy rm
  12. Applied add-log-exp0.5

    \[\leadsto \frac{1 - \tan x \cdot \tan x}{\sqrt{1} - \color{blue}{\log \left(e^{\tan x}\right)}} \cdot \frac{\sqrt{1} - \tan x}{1 + \tan x \cdot \tan x}\]
  13. Applied add-log-exp0.5

    \[\leadsto \frac{1 - \tan x \cdot \tan x}{\color{blue}{\log \left(e^{\sqrt{1}}\right)} - \log \left(e^{\tan x}\right)} \cdot \frac{\sqrt{1} - \tan x}{1 + \tan x \cdot \tan x}\]
  14. Applied diff-log0.5

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

    \[\leadsto \frac{1 - \tan x \cdot \tan x}{\log \color{blue}{\left(e^{\sqrt{1} - \tan x}\right)}} \cdot \frac{\sqrt{1} - \tan x}{1 + \tan x \cdot \tan x}\]
  16. Final simplification0.5

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

Reproduce

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