Average Error: 28.2 → 6.7
Time: 55.5s
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(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot \left(\left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right) \cdot {cos}^{\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{\cos \left(2 \cdot x\right)}{\left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot \left(\left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right) \cdot {cos}^{\left(\frac{2}{2}\right)}\right)}
double f(double x, double cos, double sin) {
        double r3076175 = 2.0;
        double r3076176 = x;
        double r3076177 = r3076175 * r3076176;
        double r3076178 = cos(r3076177);
        double r3076179 = cos;
        double r3076180 = pow(r3076179, r3076175);
        double r3076181 = sin;
        double r3076182 = pow(r3076181, r3076175);
        double r3076183 = r3076176 * r3076182;
        double r3076184 = r3076183 * r3076176;
        double r3076185 = r3076180 * r3076184;
        double r3076186 = r3076178 / r3076185;
        return r3076186;
}

double f(double x, double cos, double sin) {
        double r3076187 = 2.0;
        double r3076188 = x;
        double r3076189 = r3076187 * r3076188;
        double r3076190 = cos(r3076189);
        double r3076191 = sin;
        double r3076192 = 2.0;
        double r3076193 = r3076187 / r3076192;
        double r3076194 = pow(r3076191, r3076193);
        double r3076195 = r3076188 * r3076194;
        double r3076196 = cos;
        double r3076197 = pow(r3076196, r3076193);
        double r3076198 = r3076197 * r3076195;
        double r3076199 = r3076198 * r3076197;
        double r3076200 = r3076195 * r3076199;
        double r3076201 = r3076190 / r3076200;
        return r3076201;
}

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

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

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

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

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

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

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

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

Reproduce

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