Average Error: 0.3 → 0.3
Time: 20.9s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{1 - \frac{\sin x \cdot \tan x}{\cos x}}{1 + \frac{\sin x \cdot \tan x}{\cos x}}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{1 - \frac{\sin x \cdot \tan x}{\cos x}}{1 + \frac{\sin x \cdot \tan x}{\cos x}}
double f(double x) {
        double r805262 = 1.0;
        double r805263 = x;
        double r805264 = tan(r805263);
        double r805265 = r805264 * r805264;
        double r805266 = r805262 - r805265;
        double r805267 = r805262 + r805265;
        double r805268 = r805266 / r805267;
        return r805268;
}

double f(double x) {
        double r805269 = 1.0;
        double r805270 = x;
        double r805271 = sin(r805270);
        double r805272 = tan(r805270);
        double r805273 = r805271 * r805272;
        double r805274 = cos(r805270);
        double r805275 = r805273 / r805274;
        double r805276 = r805269 - r805275;
        double r805277 = r805269 + r805275;
        double r805278 = r805276 / r805277;
        return r805278;
}

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 tan-quot0.4

    \[\leadsto \frac{1 - \color{blue}{\frac{\sin x}{\cos x}} \cdot \tan x}{1 + \tan x \cdot \tan x}\]
  4. Applied associate-*l/0.4

    \[\leadsto \frac{1 - \color{blue}{\frac{\sin x \cdot \tan x}{\cos x}}}{1 + \tan x \cdot \tan x}\]
  5. Using strategy rm
  6. Applied tan-quot0.4

    \[\leadsto \frac{1 - \frac{\sin x \cdot \tan x}{\cos x}}{1 + \color{blue}{\frac{\sin x}{\cos x}} \cdot \tan x}\]
  7. Applied associate-*l/0.3

    \[\leadsto \frac{1 - \frac{\sin x \cdot \tan x}{\cos x}}{1 + \color{blue}{\frac{\sin x \cdot \tan x}{\cos x}}}\]
  8. Final simplification0.3

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

Reproduce

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