Average Error: 0.3 → 0.4
Time: 9.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 r13029 = 1.0;
        double r13030 = x;
        double r13031 = tan(r13030);
        double r13032 = r13031 * r13031;
        double r13033 = r13029 - r13032;
        double r13034 = r13029 + r13032;
        double r13035 = r13033 / r13034;
        return r13035;
}

double f(double x) {
        double r13036 = 1.0;
        double r13037 = x;
        double r13038 = sin(r13037);
        double r13039 = tan(r13037);
        double r13040 = r13038 * r13039;
        double r13041 = cos(r13037);
        double r13042 = r13040 / r13041;
        double r13043 = r13036 - r13042;
        double r13044 = r13039 * r13039;
        double r13045 = r13036 + r13044;
        double r13046 = r13043 / r13045;
        return r13046;
}

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