Average Error: 0.3 → 0.3
Time: 40.8s
Precision: 64
\[\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}\]
\[\frac{1 - \frac{\tan x \cdot \sin x}{\cos x}}{1 + \frac{\tan x \cdot \sin x}{\cos x}}\]
\frac{1 - \tan x \cdot \tan x}{1 + \tan x \cdot \tan x}
\frac{1 - \frac{\tan x \cdot \sin x}{\cos x}}{1 + \frac{\tan x \cdot \sin x}{\cos x}}
double f(double x) {
        double r1552967 = 1.0;
        double r1552968 = x;
        double r1552969 = tan(r1552968);
        double r1552970 = r1552969 * r1552969;
        double r1552971 = r1552967 - r1552970;
        double r1552972 = r1552967 + r1552970;
        double r1552973 = r1552971 / r1552972;
        return r1552973;
}

double f(double x) {
        double r1552974 = 1.0;
        double r1552975 = x;
        double r1552976 = tan(r1552975);
        double r1552977 = sin(r1552975);
        double r1552978 = r1552976 * r1552977;
        double r1552979 = cos(r1552975);
        double r1552980 = r1552978 / r1552979;
        double r1552981 = r1552974 - r1552980;
        double r1552982 = r1552974 + r1552980;
        double r1552983 = r1552981 / r1552982;
        return r1552983;
}

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

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

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

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

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

Reproduce

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