Average Error: 0.3 → 0.4
Time: 43.7s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\left(1 - \tan x \cdot \tan x\right) \cdot \frac{1 - \tan x \cdot \tan x}{1 - \left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right)}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\left(1 - \tan x \cdot \tan x\right) \cdot \frac{1 - \tan x \cdot \tan x}{1 - \left(\tan x \cdot \tan x\right) \cdot \left(\tan x \cdot \tan x\right)}
double f(double x) {
        double r1546334 = 1.0;
        double r1546335 = x;
        double r1546336 = tan(r1546335);
        double r1546337 = r1546336 * r1546336;
        double r1546338 = r1546334 - r1546337;
        double r1546339 = r1546334 + r1546337;
        double r1546340 = r1546338 / r1546339;
        return r1546340;
}

double f(double x) {
        double r1546341 = 1.0;
        double r1546342 = x;
        double r1546343 = tan(r1546342);
        double r1546344 = r1546343 * r1546343;
        double r1546345 = r1546341 - r1546344;
        double r1546346 = r1546344 * r1546344;
        double r1546347 = r1546341 - r1546346;
        double r1546348 = r1546345 / r1546347;
        double r1546349 = r1546345 * r1546348;
        return r1546349;
}

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{1 - \tan x \cdot \tan x}{\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}}}\]
  4. Applied associate-/r/0.4

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

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

Reproduce

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