Average Error: 28.0 → 2.9
Time: 12.0s
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(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|}\]
\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(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|}
double f(double x, double cos, double sin) {
        double r66982 = 2.0;
        double r66983 = x;
        double r66984 = r66982 * r66983;
        double r66985 = cos(r66984);
        double r66986 = cos;
        double r66987 = pow(r66986, r66982);
        double r66988 = sin;
        double r66989 = pow(r66988, r66982);
        double r66990 = r66983 * r66989;
        double r66991 = r66990 * r66983;
        double r66992 = r66987 * r66991;
        double r66993 = r66985 / r66992;
        return r66993;
}

double f(double x, double cos, double sin) {
        double r66994 = 2.0;
        double r66995 = x;
        double r66996 = r66994 * r66995;
        double r66997 = cos(r66996);
        double r66998 = cos;
        double r66999 = 2.0;
        double r67000 = r66994 / r66999;
        double r67001 = pow(r66998, r67000);
        double r67002 = sin;
        double r67003 = pow(r67002, r67000);
        double r67004 = r66995 * r67003;
        double r67005 = r67001 * r67004;
        double r67006 = fabs(r67005);
        double r67007 = r67006 * r67006;
        double r67008 = r66997 / r67007;
        return r67008;
}

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

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

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

    \[\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 add-sqr-sqrt21.9

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\sqrt{{cos}^{2} \cdot \left(\left(\left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot x\right)} \cdot \sqrt{{cos}^{2} \cdot \left(\left(\left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot x\right)}}}\]
  7. Simplified21.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 \sqrt{{cos}^{2} \cdot \left(\left(\left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot x\right)}}\]
  8. Simplified2.9

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

    \[\leadsto \color{blue}{\frac{\frac{\cos \left(2 \cdot x\right)}{\left|{cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right|}}{\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 add-log-exp2.7

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

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\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|}\]

Reproduce

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