Average Error: 0.2 → 0.3
Time: 15.0s
Precision: 64
\[\cos x - \sin x\]
\[\log \left(e^{\cos x - \sin x}\right)\]
\cos x - \sin x
\log \left(e^{\cos x - \sin x}\right)
double f(double x) {
        double r39706881 = x;
        double r39706882 = cos(r39706881);
        double r39706883 = sin(r39706881);
        double r39706884 = r39706882 - r39706883;
        return r39706884;
}

double f(double x) {
        double r39706885 = x;
        double r39706886 = cos(r39706885);
        double r39706887 = sin(r39706885);
        double r39706888 = r39706886 - r39706887;
        double r39706889 = exp(r39706888);
        double r39706890 = log(r39706889);
        return r39706890;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.2

    \[\cos x - \sin x\]
  2. Using strategy rm
  3. Applied add-log-exp0.3

    \[\leadsto \color{blue}{\log \left(e^{\cos x - \sin x}\right)}\]
  4. Final simplification0.3

    \[\leadsto \log \left(e^{\cos x - \sin x}\right)\]

Reproduce

herbie shell --seed 1 
(FPCore (x)
  :name "cos(x) - sin(x)"
  (- (cos x) (sin x)))