Average Error: 28.7 → 2.6
Time: 11.3s
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 r36773 = 2.0;
        double r36774 = x;
        double r36775 = r36773 * r36774;
        double r36776 = cos(r36775);
        double r36777 = cos;
        double r36778 = pow(r36777, r36773);
        double r36779 = sin;
        double r36780 = pow(r36779, r36773);
        double r36781 = r36774 * r36780;
        double r36782 = r36781 * r36774;
        double r36783 = r36778 * r36782;
        double r36784 = r36776 / r36783;
        return r36784;
}

double f(double x, double cos, double sin) {
        double r36785 = 2.0;
        double r36786 = x;
        double r36787 = r36785 * r36786;
        double r36788 = cos(r36787);
        double r36789 = cos;
        double r36790 = 2.0;
        double r36791 = r36785 / r36790;
        double r36792 = pow(r36789, r36791);
        double r36793 = sin;
        double r36794 = pow(r36793, r36791);
        double r36795 = r36786 * r36794;
        double r36796 = r36792 * r36795;
        double r36797 = r36788 / r36796;
        double r36798 = r36797 / r36796;
        return r36798;
}

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

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

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

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

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

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

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

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

    \[\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 2020045 
(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))))