Average Error: 0.3 → 0.4
Time: 15.6s
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 r20084 = 1.0;
        double r20085 = x;
        double r20086 = tan(r20085);
        double r20087 = r20086 * r20086;
        double r20088 = r20084 - r20087;
        double r20089 = r20084 + r20087;
        double r20090 = r20088 / r20089;
        return r20090;
}

double f(double x) {
        double r20091 = 1.0;
        double r20092 = x;
        double r20093 = sin(r20092);
        double r20094 = tan(r20092);
        double r20095 = r20093 * r20094;
        double r20096 = cos(r20092);
        double r20097 = r20095 / r20096;
        double r20098 = r20091 - r20097;
        double r20099 = r20094 * r20094;
        double r20100 = r20091 + r20099;
        double r20101 = r20098 / r20100;
        return r20101;
}

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 2019209 
(FPCore (x)
  :name "Trigonometry B"
  :precision binary64
  (/ (- 1 (* (tan x) (tan x))) (+ 1 (* (tan x) (tan x)))))