Average Error: 28.3 → 2.7
Time: 10.7s
Precision: 64
\[\frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}\]
\[\frac{\frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)}}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)}\]
\frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}
\frac{\frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)}}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)}
double f(double x, double cos, double sin) {
        double r59608 = 2.0;
        double r59609 = x;
        double r59610 = r59608 * r59609;
        double r59611 = cos(r59610);
        double r59612 = cos;
        double r59613 = pow(r59612, r59608);
        double r59614 = sin;
        double r59615 = pow(r59614, r59608);
        double r59616 = r59609 * r59615;
        double r59617 = r59616 * r59609;
        double r59618 = r59613 * r59617;
        double r59619 = r59611 / r59618;
        return r59619;
}

double f(double x, double cos, double sin) {
        double r59620 = 2.0;
        double r59621 = x;
        double r59622 = r59620 * r59621;
        double r59623 = cos(r59622);
        double r59624 = cos;
        double r59625 = 2.0;
        double r59626 = r59620 / r59625;
        double r59627 = pow(r59624, r59626);
        double r59628 = sin;
        double r59629 = pow(r59628, r59626);
        double r59630 = r59621 * r59629;
        double r59631 = r59627 * r59630;
        double r59632 = r59623 / r59631;
        double r59633 = r59632 / r59631;
        return r59633;
}

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.3

    \[\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.3

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

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

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \color{blue}{\left(\left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot \left({sin}^{\left(\frac{2}{2}\right)} \cdot x\right)\right)}}\]
  7. Simplified20.2

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

    \[\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}^{\left(\frac{2}{2}\right)}\right) \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right)}\]
  10. Applied unswap-sqr2.9

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

    \[\leadsto \color{blue}{\frac{\frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)}}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)}}\]
  13. Final simplification2.7

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

Reproduce

herbie shell --seed 2020046 
(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))))