Average Error: 28.1 → 6.6
Time: 21.2s
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)}{\left({cos}^{\left(\frac{2}{2}\right)} \cdot \left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right)\right) \cdot \left({sin}^{\left(\frac{2}{2}\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)}{\left({cos}^{\left(\frac{2}{2}\right)} \cdot \left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right)\right) \cdot \left({sin}^{\left(\frac{2}{2}\right)} \cdot x\right)}
double f(double x, double cos, double sin) {
        double r63918 = 2.0;
        double r63919 = x;
        double r63920 = r63918 * r63919;
        double r63921 = cos(r63920);
        double r63922 = cos;
        double r63923 = pow(r63922, r63918);
        double r63924 = sin;
        double r63925 = pow(r63924, r63918);
        double r63926 = r63919 * r63925;
        double r63927 = r63926 * r63919;
        double r63928 = r63923 * r63927;
        double r63929 = r63921 / r63928;
        return r63929;
}

double f(double x, double cos, double sin) {
        double r63930 = 2.0;
        double r63931 = x;
        double r63932 = r63930 * r63931;
        double r63933 = cos(r63932);
        double r63934 = cos;
        double r63935 = 2.0;
        double r63936 = r63930 / r63935;
        double r63937 = pow(r63934, r63936);
        double r63938 = sin;
        double r63939 = pow(r63938, r63936);
        double r63940 = r63931 * r63939;
        double r63941 = r63937 * r63940;
        double r63942 = r63937 * r63941;
        double r63943 = r63939 * r63931;
        double r63944 = r63942 * r63943;
        double r63945 = r63933 / r63944;
        return r63945;
}

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

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

    \[\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*21.9

    \[\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*19.9

    \[\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. Using strategy rm
  8. Applied associate-*r*15.9

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

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

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

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

Reproduce

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