Average Error: 0.3 → 0.4
Time: 32.4s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{1 - \tan x \cdot \tan x}{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)\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{1 - \tan x \cdot \tan x}{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)
double f(double x) {
        double r400002 = 1.0;
        double r400003 = x;
        double r400004 = tan(r400003);
        double r400005 = r400004 * r400004;
        double r400006 = r400002 - r400005;
        double r400007 = r400002 + r400005;
        double r400008 = r400006 / r400007;
        return r400008;
}

double f(double x) {
        double r400009 = 1.0;
        double r400010 = x;
        double r400011 = tan(r400010);
        double r400012 = r400011 * r400011;
        double r400013 = r400009 - r400012;
        double r400014 = r400012 * r400012;
        double r400015 = r400009 - r400014;
        double r400016 = r400013 / r400015;
        double r400017 = r400016 * r400013;
        return r400017;
}

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

    \[\leadsto \color{blue}{\frac{1 - \tan x \cdot \tan x}{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)\]
  6. Final simplification0.4

    \[\leadsto \frac{1 - \tan x \cdot \tan x}{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)\]

Reproduce

herbie shell --seed 2019143 +o rules:numerics
(FPCore (x)
  :name "Trigonometry B"
  (/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))