Average Error: 0.3 → 0.3
Time: 19.4s
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 r20437 = 1.0;
        double r20438 = x;
        double r20439 = tan(r20438);
        double r20440 = r20439 * r20439;
        double r20441 = r20437 - r20440;
        double r20442 = r20437 + r20440;
        double r20443 = r20441 / r20442;
        return r20443;
}

double f(double x) {
        double r20444 = 1.0;
        double r20445 = x;
        double r20446 = sin(r20445);
        double r20447 = tan(r20445);
        double r20448 = r20446 * r20447;
        double r20449 = cos(r20445);
        double r20450 = r20448 / r20449;
        double r20451 = r20444 - r20450;
        double r20452 = r20444 + r20450;
        double r20453 = r20451 / r20452;
        return r20453;
}

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. Using strategy rm
  7. Applied tan-quot0.4

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

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

    \[\leadsto \frac{1 - \frac{\sin x \cdot \tan x}{\cos x}}{1 + \frac{\color{blue}{\sin x \cdot \tan x}}{\cos x}}\]
  10. 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 2019326 +o rules:numerics
(FPCore (x)
  :name "Trigonometry B"
  :precision binary64
  (/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))