Average Error: 0.3 → 0.4
Time: 15.9s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{1 - \frac{\log \left(e^{\sin x \cdot \tan x}\right)}{\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{\log \left(e^{\sin x \cdot \tan x}\right)}{\cos x}}{1 + \frac{\sin x \cdot \tan x}{\cos x}}
double f(double x) {
        double r737550 = 1.0;
        double r737551 = x;
        double r737552 = tan(r737551);
        double r737553 = r737552 * r737552;
        double r737554 = r737550 - r737553;
        double r737555 = r737550 + r737553;
        double r737556 = r737554 / r737555;
        return r737556;
}

double f(double x) {
        double r737557 = 1.0;
        double r737558 = x;
        double r737559 = sin(r737558);
        double r737560 = tan(r737558);
        double r737561 = r737559 * r737560;
        double r737562 = exp(r737561);
        double r737563 = log(r737562);
        double r737564 = cos(r737558);
        double r737565 = r737563 / r737564;
        double r737566 = r737557 - r737565;
        double r737567 = r737561 / r737564;
        double r737568 = r737557 + r737567;
        double r737569 = r737566 / r737568;
        return r737569;
}

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. Using strategy rm
  9. Applied add-log-exp0.4

    \[\leadsto \frac{1 - \frac{\color{blue}{\log \left(e^{\sin x \cdot \tan x}\right)}}{\cos x}}{1 + \frac{\sin x \cdot \tan x}{\cos x}}\]
  10. Final simplification0.4

    \[\leadsto \frac{1 - \frac{\log \left(e^{\sin x \cdot \tan x}\right)}{\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)))))