Average Error: 0.3 → 0.4
Time: 10.4s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\left(\tan x + \sqrt{1}\right) \cdot \frac{\frac{1 - \tan x \cdot \tan x}{\sqrt{1} + \tan x}}{1 + \tan x \cdot \tan x}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\left(\tan x + \sqrt{1}\right) \cdot \frac{\frac{1 - \tan x \cdot \tan x}{\sqrt{1} + \tan x}}{1 + \tan x \cdot \tan x}
double f(double x) {
        double r14939 = 1.0;
        double r14940 = x;
        double r14941 = tan(r14940);
        double r14942 = r14941 * r14941;
        double r14943 = r14939 - r14942;
        double r14944 = r14939 + r14942;
        double r14945 = r14943 / r14944;
        return r14945;
}

double f(double x) {
        double r14946 = x;
        double r14947 = tan(r14946);
        double r14948 = 1.0;
        double r14949 = sqrt(r14948);
        double r14950 = r14947 + r14949;
        double r14951 = r14947 * r14947;
        double r14952 = r14948 - r14951;
        double r14953 = r14949 + r14947;
        double r14954 = r14952 / r14953;
        double r14955 = r14948 + r14951;
        double r14956 = r14954 / r14955;
        double r14957 = r14950 * r14956;
        return r14957;
}

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 flip--0.4

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

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

    \[\leadsto \left(\tan x + \sqrt{1}\right) \cdot \frac{\frac{1 - \tan x \cdot \tan x}{\sqrt{1} + \tan x}}{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)))))