Average Error: 0.3 → 0.4
Time: 9.5s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{\frac{\left(\sqrt{1} - \tan x\right) \cdot \left(\tan x \cdot \tan x - 1\right)}{1 + \tan x \cdot \tan x}}{\tan x - \sqrt{1}}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{\frac{\left(\sqrt{1} - \tan x\right) \cdot \left(\tan x \cdot \tan x - 1\right)}{1 + \tan x \cdot \tan x}}{\tan x - \sqrt{1}}
double f(double x) {
        double r16073 = 1.0;
        double r16074 = x;
        double r16075 = tan(r16074);
        double r16076 = r16075 * r16075;
        double r16077 = r16073 - r16076;
        double r16078 = r16073 + r16076;
        double r16079 = r16077 / r16078;
        return r16079;
}

double f(double x) {
        double r16080 = 1.0;
        double r16081 = sqrt(r16080);
        double r16082 = x;
        double r16083 = tan(r16082);
        double r16084 = r16081 - r16083;
        double r16085 = r16083 * r16083;
        double r16086 = r16085 - r16080;
        double r16087 = r16084 * r16086;
        double r16088 = r16080 + r16085;
        double r16089 = r16087 / r16088;
        double r16090 = r16083 - r16081;
        double r16091 = r16089 / r16090;
        return r16091;
}

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. Simplified0.4

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

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

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

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

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

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

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

Reproduce

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