Average Error: 0.2 → 0.0
Time: 8.8s
Precision: 64
\[\sin x \cdot \cos x\]
\[\frac{\sin \left(x + x\right)}{2}\]
\sin x \cdot \cos x
\frac{\sin \left(x + x\right)}{2}
double f(double x) {
        double r1406352 = x;
        double r1406353 = sin(r1406352);
        double r1406354 = cos(r1406352);
        double r1406355 = r1406353 * r1406354;
        return r1406355;
}

double f(double x) {
        double r1406356 = x;
        double r1406357 = r1406356 + r1406356;
        double r1406358 = sin(r1406357);
        double r1406359 = 2.0;
        double r1406360 = r1406358 / r1406359;
        return r1406360;
}

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

    \[\sin x \cdot \cos x\]
  2. Using strategy rm
  3. Applied sin-cos-mult0.0

    \[\leadsto \color{blue}{\frac{\sin \left(x - x\right) + \sin \left(x + x\right)}{2}}\]
  4. Simplified0.0

    \[\leadsto \frac{\color{blue}{\sin \left(x + x\right)}}{2}\]
  5. Final simplification0.0

    \[\leadsto \frac{\sin \left(x + x\right)}{2}\]

Reproduce

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