Average Error: 30.1 → 0.6
Time: 15.9s
Precision: 64
\[\cos \left(x + 1\right) - \cos x\]
\[\sqrt[3]{\left(\left(\cos 1 \cdot \cos x - \left(\sin x \cdot \sin 1 + \cos x\right)\right) \cdot \left(\cos 1 \cdot \cos x - \left(\sin x \cdot \sin 1 + \cos x\right)\right)\right) \cdot \left(\cos 1 \cdot \cos x - \left(\sin x \cdot \sin 1 + \cos x\right)\right)}\]
\cos \left(x + 1\right) - \cos x
\sqrt[3]{\left(\left(\cos 1 \cdot \cos x - \left(\sin x \cdot \sin 1 + \cos x\right)\right) \cdot \left(\cos 1 \cdot \cos x - \left(\sin x \cdot \sin 1 + \cos x\right)\right)\right) \cdot \left(\cos 1 \cdot \cos x - \left(\sin x \cdot \sin 1 + \cos x\right)\right)}
double f(double x) {
        double r42294828 = x;
        double r42294829 = 1.0;
        double r42294830 = r42294828 + r42294829;
        double r42294831 = cos(r42294830);
        double r42294832 = cos(r42294828);
        double r42294833 = r42294831 - r42294832;
        return r42294833;
}

double f(double x) {
        double r42294834 = 1.0;
        double r42294835 = cos(r42294834);
        double r42294836 = x;
        double r42294837 = cos(r42294836);
        double r42294838 = r42294835 * r42294837;
        double r42294839 = sin(r42294836);
        double r42294840 = sin(r42294834);
        double r42294841 = r42294839 * r42294840;
        double r42294842 = r42294841 + r42294837;
        double r42294843 = r42294838 - r42294842;
        double r42294844 = r42294843 * r42294843;
        double r42294845 = r42294844 * r42294843;
        double r42294846 = cbrt(r42294845);
        return r42294846;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 30.1

    \[\cos \left(x + 1\right) - \cos x\]
  2. Using strategy rm
  3. Applied cos-sum0.9

    \[\leadsto \color{blue}{\left(\cos x \cdot \cos 1 - \sin x \cdot \sin 1\right)} - \cos x\]
  4. Applied associate--l-0.9

    \[\leadsto \color{blue}{\cos x \cdot \cos 1 - \left(\sin x \cdot \sin 1 + \cos x\right)}\]
  5. Using strategy rm
  6. Applied add-cbrt-cube0.6

    \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\cos x \cdot \cos 1 - \left(\sin x \cdot \sin 1 + \cos x\right)\right) \cdot \left(\cos x \cdot \cos 1 - \left(\sin x \cdot \sin 1 + \cos x\right)\right)\right) \cdot \left(\cos x \cdot \cos 1 - \left(\sin x \cdot \sin 1 + \cos x\right)\right)}}\]
  7. Final simplification0.6

    \[\leadsto \sqrt[3]{\left(\left(\cos 1 \cdot \cos x - \left(\sin x \cdot \sin 1 + \cos x\right)\right) \cdot \left(\cos 1 \cdot \cos x - \left(\sin x \cdot \sin 1 + \cos x\right)\right)\right) \cdot \left(\cos 1 \cdot \cos x - \left(\sin x \cdot \sin 1 + \cos x\right)\right)}\]

Reproduce

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