Average Error: 28.3 → 7.0
Time: 12.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 r48094 = 2.0;
        double r48095 = x;
        double r48096 = r48094 * r48095;
        double r48097 = cos(r48096);
        double r48098 = cos;
        double r48099 = pow(r48098, r48094);
        double r48100 = sin;
        double r48101 = pow(r48100, r48094);
        double r48102 = r48095 * r48101;
        double r48103 = r48102 * r48095;
        double r48104 = r48099 * r48103;
        double r48105 = r48097 / r48104;
        return r48105;
}

double f(double x, double cos, double sin) {
        double r48106 = 2.0;
        double r48107 = x;
        double r48108 = r48106 * r48107;
        double r48109 = cos(r48108);
        double r48110 = cos;
        double r48111 = 2.0;
        double r48112 = r48106 / r48111;
        double r48113 = pow(r48110, r48112);
        double r48114 = sin;
        double r48115 = pow(r48114, r48112);
        double r48116 = r48107 * r48115;
        double r48117 = r48113 * r48116;
        double r48118 = r48113 * r48117;
        double r48119 = r48115 * r48107;
        double r48120 = r48118 * r48119;
        double r48121 = r48109 / r48120;
        return r48121;
}

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

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

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

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

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

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

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