Average Error: 28.0 → 6.1
Time: 30.1s
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(\left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot \left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right)\right) \cdot {cos}^{\left(\frac{2}{2}\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(\left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot \left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right)\right) \cdot {cos}^{\left(\frac{2}{2}\right)}}
double f(double x, double cos, double sin) {
        double r3103968 = 2.0;
        double r3103969 = x;
        double r3103970 = r3103968 * r3103969;
        double r3103971 = cos(r3103970);
        double r3103972 = cos;
        double r3103973 = pow(r3103972, r3103968);
        double r3103974 = sin;
        double r3103975 = pow(r3103974, r3103968);
        double r3103976 = r3103969 * r3103975;
        double r3103977 = r3103976 * r3103969;
        double r3103978 = r3103973 * r3103977;
        double r3103979 = r3103971 / r3103978;
        return r3103979;
}

double f(double x, double cos, double sin) {
        double r3103980 = 2.0;
        double r3103981 = x;
        double r3103982 = r3103980 * r3103981;
        double r3103983 = cos(r3103982);
        double r3103984 = sin;
        double r3103985 = 2.0;
        double r3103986 = r3103980 / r3103985;
        double r3103987 = pow(r3103984, r3103986);
        double r3103988 = r3103981 * r3103987;
        double r3103989 = cos;
        double r3103990 = pow(r3103989, r3103986);
        double r3103991 = r3103990 * r3103988;
        double r3103992 = r3103988 * r3103991;
        double r3103993 = r3103992 * r3103990;
        double r3103994 = r3103983 / r3103993;
        return r3103994;
}

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)}{\color{blue}{\left({cos}^{\left(\frac{2}{2}\right)} \cdot {cos}^{\left(\frac{2}{2}\right)}\right)} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}\]
  4. Applied associate-*l*23.7

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)\right)}}\]
  5. Using strategy rm
  6. Applied sqr-pow23.7

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left({cos}^{\left(\frac{2}{2}\right)} \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)\right)}\]
  7. Applied associate-*r*16.4

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left({cos}^{\left(\frac{2}{2}\right)} \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)\right)}\]
  8. Using strategy rm
  9. Applied associate-*l*13.4

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

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left({cos}^{\left(\frac{2}{2}\right)} \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)\right)}\]
  11. Using strategy rm
  12. Applied associate-*r*6.1

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

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

Reproduce

herbie shell --seed 2019179 
(FPCore (x cos sin)
  :name "cos(2*x)/(cos^2(x)*sin^2(x))"
  (/ (cos (* 2.0 x)) (* (pow cos 2.0) (* (* x (pow sin 2.0)) x))))