Average Error: 0.3 → 0.4
Time: 23.3s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{\frac{1 - \left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right)}{\tan x \cdot \tan x + 1}}{\tan x \cdot \tan x + 1}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{\frac{1 - \left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right)}{\tan x \cdot \tan x + 1}}{\tan x \cdot \tan x + 1}
double f(double x) {
        double r461751 = 1.0;
        double r461752 = x;
        double r461753 = tan(r461752);
        double r461754 = r461753 * r461753;
        double r461755 = r461751 - r461754;
        double r461756 = r461751 + r461754;
        double r461757 = r461755 / r461756;
        return r461757;
}

double f(double x) {
        double r461758 = 1.0;
        double r461759 = x;
        double r461760 = tan(r461759);
        double r461761 = r461760 * r461760;
        double r461762 = r461761 * r461761;
        double r461763 = r461758 - r461762;
        double r461764 = r461761 + r461758;
        double r461765 = r461763 / r461764;
        double r461766 = r461765 / r461764;
        return r461766;
}

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

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

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

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

Reproduce

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