Average Error: 0.3 → 0.4
Time: 22.5s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{1 + \tan x}{\frac{1 + \tan x \cdot \tan x}{1 - \tan x}}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{1 + \tan x}{\frac{1 + \tan x \cdot \tan x}{1 - \tan x}}
double f(double x) {
        double r697141 = 1.0;
        double r697142 = x;
        double r697143 = tan(r697142);
        double r697144 = r697143 * r697143;
        double r697145 = r697141 - r697144;
        double r697146 = r697141 + r697144;
        double r697147 = r697145 / r697146;
        return r697147;
}

double f(double x) {
        double r697148 = 1.0;
        double r697149 = x;
        double r697150 = tan(r697149);
        double r697151 = r697148 + r697150;
        double r697152 = r697150 * r697150;
        double r697153 = r697148 + r697152;
        double r697154 = r697148 - r697150;
        double r697155 = r697153 / r697154;
        double r697156 = r697151 / r697155;
        return r697156;
}

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{\color{blue}{1 \cdot 1} - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
  4. Applied difference-of-squares0.3

    \[\leadsto \frac{\color{blue}{\left(1 + \tan x\right) \cdot \left(1 - \tan x\right)}}{1 + \tan x \cdot \tan x}\]
  5. Using strategy rm
  6. Applied associate-/l*0.4

    \[\leadsto \color{blue}{\frac{1 + \tan x}{\frac{1 + \tan x \cdot \tan x}{1 - \tan x}}}\]
  7. Final simplification0.4

    \[\leadsto \frac{1 + \tan x}{\frac{1 + \tan x \cdot \tan x}{1 - \tan x}}\]

Reproduce

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