Average Error: 0.3 → 0.4
Time: 16.6s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{1}{\frac{\tan x \cdot \tan x + 1}{1 - \tan x \cdot \tan x}}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{1}{\frac{\tan x \cdot \tan x + 1}{1 - \tan x \cdot \tan x}}
double f(double x) {
        double r299991 = 1.0;
        double r299992 = x;
        double r299993 = tan(r299992);
        double r299994 = r299993 * r299993;
        double r299995 = r299991 - r299994;
        double r299996 = r299991 + r299994;
        double r299997 = r299995 / r299996;
        return r299997;
}

double f(double x) {
        double r299998 = 1.0;
        double r299999 = x;
        double r300000 = tan(r299999);
        double r300001 = r300000 * r300000;
        double r300002 = r300001 + r299998;
        double r300003 = r299998 - r300001;
        double r300004 = r300002 / r300003;
        double r300005 = r299998 / r300004;
        return r300005;
}

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 clear-num0.4

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

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

Reproduce

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