Average Error: 28.4 → 8.3
Time: 25.3s
Precision: 64
\[\frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}\]
\[\frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left(\left(\left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right) \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot x\right)}\]
\frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}
\frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left(\left(\left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right) \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot x\right)}
double f(double x, double cos, double sin) {
        double r82560 = 2.0;
        double r82561 = x;
        double r82562 = r82560 * r82561;
        double r82563 = cos(r82562);
        double r82564 = cos;
        double r82565 = pow(r82564, r82560);
        double r82566 = sin;
        double r82567 = pow(r82566, r82560);
        double r82568 = r82561 * r82567;
        double r82569 = r82568 * r82561;
        double r82570 = r82565 * r82569;
        double r82571 = r82563 / r82570;
        return r82571;
}

double f(double x, double cos, double sin) {
        double r82572 = 2.0;
        double r82573 = x;
        double r82574 = r82572 * r82573;
        double r82575 = cos(r82574);
        double r82576 = cos;
        double r82577 = 2.0;
        double r82578 = r82572 / r82577;
        double r82579 = pow(r82576, r82578);
        double r82580 = sin;
        double r82581 = pow(r82580, r82578);
        double r82582 = r82573 * r82581;
        double r82583 = r82579 * r82582;
        double r82584 = r82583 * r82581;
        double r82585 = r82584 * r82573;
        double r82586 = r82579 * r82585;
        double r82587 = r82575 / r82586;
        return r82587;
}

Error

Bits error versus x

Bits error versus cos

Bits error versus sin

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 28.4

    \[\frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}\]
  2. Using strategy rm
  3. Applied sqr-pow28.4

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\left({cos}^{\left(\frac{2}{2}\right)} \cdot {cos}^{\left(\frac{2}{2}\right)}\right)} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}\]
  4. Applied associate-*l*24.1

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)\right)}}\]
  5. Using strategy rm
  6. Applied associate-*r*20.4

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \color{blue}{\left(\left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{2}\right)\right) \cdot x\right)}}\]
  7. Using strategy rm
  8. Applied sqr-pow20.4

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left(\left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot \color{blue}{\left({sin}^{\left(\frac{2}{2}\right)} \cdot {sin}^{\left(\frac{2}{2}\right)}\right)}\right)\right) \cdot x\right)}\]
  9. Applied associate-*r*13.8

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left(\left({cos}^{\left(\frac{2}{2}\right)} \cdot \color{blue}{\left(\left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot {sin}^{\left(\frac{2}{2}\right)}\right)}\right) \cdot x\right)}\]
  10. Using strategy rm
  11. Applied associate-*r*8.3

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left(\color{blue}{\left(\left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right) \cdot {sin}^{\left(\frac{2}{2}\right)}\right)} \cdot x\right)}\]
  12. Final simplification8.3

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left(\left(\left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right) \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot x\right)}\]

Reproduce

herbie shell --seed 2019304 +o rules:numerics
(FPCore (x cos sin)
  :name "cos(2*x)/(cos^2(x)*sin^2(x))"
  :precision binary64
  (/ (cos (* 2 x)) (* (pow cos 2) (* (* x (pow sin 2)) x))))