Average Error: 0.3 → 0.4
Time: 6.6s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{\frac{\sqrt{1} - \tan x}{\frac{1 + \tan x \cdot \tan x}{1 - \tan x \cdot \tan x}}}{\sqrt{1} - \tan x}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{\frac{\sqrt{1} - \tan x}{\frac{1 + \tan x \cdot \tan x}{1 - \tan x \cdot \tan x}}}{\sqrt{1} - \tan x}
double f(double x) {
        double r18722 = 1.0;
        double r18723 = x;
        double r18724 = tan(r18723);
        double r18725 = r18724 * r18724;
        double r18726 = r18722 - r18725;
        double r18727 = r18722 + r18725;
        double r18728 = r18726 / r18727;
        return r18728;
}

double f(double x) {
        double r18729 = 1.0;
        double r18730 = sqrt(r18729);
        double r18731 = x;
        double r18732 = tan(r18731);
        double r18733 = r18730 - r18732;
        double r18734 = r18732 * r18732;
        double r18735 = r18729 + r18734;
        double r18736 = r18729 - r18734;
        double r18737 = r18735 / r18736;
        double r18738 = r18733 / r18737;
        double r18739 = r18738 / r18733;
        return r18739;
}

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 div-inv0.4

    \[\leadsto \color{blue}{\left(1 - \tan x \cdot \tan x\right) \cdot \frac{1}{1 + \tan x \cdot \tan x}}\]
  4. Using strategy rm
  5. Applied add-sqr-sqrt0.4

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

    \[\leadsto \color{blue}{\left(\left(\sqrt{1} + \tan x\right) \cdot \left(\sqrt{1} - \tan x\right)\right)} \cdot \frac{1}{1 + \tan x \cdot \tan x}\]
  7. Applied associate-*l*0.4

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

    \[\leadsto \left(\sqrt{1} + \tan x\right) \cdot \color{blue}{\frac{\sqrt{1} - \tan x}{1 + \tan x \cdot \tan x}}\]
  9. Using strategy rm
  10. 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}\]
  11. Applied associate-*l/0.4

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

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

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

Reproduce

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