Average Error: 0.1 → 0
Time: 9.0s
Precision: 64
\[\cos x + \frac{\sin x}{\tan x}\]
\[\cos x + \cos x\]
\cos x + \frac{\sin x}{\tan x}
\cos x + \cos x
double f(double x) {
        double r3088199 = x;
        double r3088200 = cos(r3088199);
        double r3088201 = sin(r3088199);
        double r3088202 = tan(r3088199);
        double r3088203 = r3088201 / r3088202;
        double r3088204 = r3088200 + r3088203;
        return r3088204;
}

double f(double x) {
        double r3088205 = x;
        double r3088206 = cos(r3088205);
        double r3088207 = r3088206 + r3088206;
        return r3088207;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\cos x + \frac{\sin x}{\tan x}\]
  2. Taylor expanded around inf 0

    \[\leadsto \cos x + \color{blue}{\cos x}\]
  3. Final simplification0

    \[\leadsto \cos x + \cos x\]

Reproduce

herbie shell --seed 1 
(FPCore (x)
  :name "cos(x) + sin(x)/tan(x)"
  :precision binary64
  (+ (cos x) (/ (sin x) (tan x))))