Average Error: 27.8 → 8.7
Time: 28.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)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot \left(\left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right) \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)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot \left(\left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right) \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right)}
double f(double x, double cos, double sin) {
        double r3495263 = 2.0;
        double r3495264 = x;
        double r3495265 = r3495263 * r3495264;
        double r3495266 = cos(r3495265);
        double r3495267 = cos;
        double r3495268 = pow(r3495267, r3495263);
        double r3495269 = sin;
        double r3495270 = pow(r3495269, r3495263);
        double r3495271 = r3495264 * r3495270;
        double r3495272 = r3495271 * r3495264;
        double r3495273 = r3495268 * r3495272;
        double r3495274 = r3495266 / r3495273;
        return r3495274;
}

double f(double x, double cos, double sin) {
        double r3495275 = 2.0;
        double r3495276 = x;
        double r3495277 = r3495275 * r3495276;
        double r3495278 = cos(r3495277);
        double r3495279 = cos;
        double r3495280 = 2.0;
        double r3495281 = r3495275 / r3495280;
        double r3495282 = pow(r3495279, r3495281);
        double r3495283 = sin;
        double r3495284 = pow(r3495283, r3495281);
        double r3495285 = r3495276 * r3495284;
        double r3495286 = r3495282 * r3495285;
        double r3495287 = r3495286 * r3495284;
        double r3495288 = r3495276 * r3495287;
        double r3495289 = r3495282 * r3495288;
        double r3495290 = r3495278 / r3495289;
        return r3495290;
}

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 27.8

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

    \[\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 sqr-pow22.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(\left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot x\right)}\]
  7. Applied associate-*l*16.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(\left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot x\right)\right)}}\]
  8. Simplified19.7

    \[\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}^{2}\right)\right) \cdot x\right)}}\]
  9. Using strategy rm
  10. Applied sqr-pow19.7

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

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left(\left({cos}^{\left(\frac{2}{2}\right)} \cdot \color{blue}{\left(\left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot {sin}^{\left(\frac{2}{2}\right)}\right)}\right) \cdot x\right)}\]
  12. Using strategy rm
  13. Applied associate-*r*8.7

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left(\color{blue}{\left(\left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right) \cdot {sin}^{\left(\frac{2}{2}\right)}\right)} \cdot x\right)}\]
  14. Final simplification8.7

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

Reproduce

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