Average Error: 0.3 → 0.4
Time: 18.7s
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 + \tan x \cdot \tan 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 + \tan x \cdot \tan x}
double f(double x) {
        double r19497 = 1.0;
        double r19498 = x;
        double r19499 = tan(r19498);
        double r19500 = r19499 * r19499;
        double r19501 = r19497 - r19500;
        double r19502 = r19497 + r19500;
        double r19503 = r19501 / r19502;
        return r19503;
}

double f(double x) {
        double r19504 = 1.0;
        double r19505 = x;
        double r19506 = sin(r19505);
        double r19507 = tan(r19505);
        double r19508 = r19506 * r19507;
        double r19509 = cos(r19505);
        double r19510 = r19508 / r19509;
        double r19511 = r19504 - r19510;
        double r19512 = r19507 * r19507;
        double r19513 = r19504 + r19512;
        double r19514 = r19511 / r19513;
        return r19514;
}

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 - \tan x \cdot \color{blue}{\frac{\sin x}{\cos x}}}{1 + \tan x \cdot \tan x}\]
  4. Applied associate-*r/0.4

    \[\leadsto \frac{1 - \color{blue}{\frac{\tan x \cdot \sin x}{\cos x}}}{1 + \tan x \cdot \tan x}\]
  5. Simplified0.4

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

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

Reproduce

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