Average Error: 0.3 → 0.4
Time: 5.6s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{\sqrt{1} + \tan x}{\frac{1 + \tan x \cdot \tan x}{1 - \tan x \cdot \tan x} \cdot \left(\sqrt{1} + \tan x\right)}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{\sqrt{1} + \tan x}{\frac{1 + \tan x \cdot \tan x}{1 - \tan x \cdot \tan x} \cdot \left(\sqrt{1} + \tan x\right)}
double f(double x) {
        double r13236 = 1.0;
        double r13237 = x;
        double r13238 = tan(r13237);
        double r13239 = r13238 * r13238;
        double r13240 = r13236 - r13239;
        double r13241 = r13236 + r13239;
        double r13242 = r13240 / r13241;
        return r13242;
}

double f(double x) {
        double r13243 = 1.0;
        double r13244 = sqrt(r13243);
        double r13245 = x;
        double r13246 = tan(r13245);
        double r13247 = r13244 + r13246;
        double r13248 = r13246 * r13246;
        double r13249 = r13243 + r13248;
        double r13250 = r13243 - r13248;
        double r13251 = r13249 / r13250;
        double r13252 = r13251 * r13247;
        double r13253 = r13247 / r13252;
        return r13253;
}

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. Applied associate-/l*0.4

    \[\leadsto \color{blue}{\frac{\sqrt{1} + \tan x}{\frac{1 + \tan x \cdot \tan x}{\sqrt{1} - \tan x}}}\]
  6. Using strategy rm
  7. Applied flip--0.4

    \[\leadsto \frac{\sqrt{1} + \tan x}{\frac{1 + \tan x \cdot \tan x}{\color{blue}{\frac{\sqrt{1} \cdot \sqrt{1} - \tan x \cdot \tan x}{\sqrt{1} + \tan x}}}}\]
  8. Applied associate-/r/0.4

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

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

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

Reproduce

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