Average Error: 27.6 → 2.6
Time: 58.3s
Precision: 64
\[\frac{\cos \left(2.0 \cdot x\right)}{{cos}^{2.0} \cdot \left(\left(x \cdot {sin}^{2.0}\right) \cdot x\right)}\]
\[\frac{\frac{\cos \left(2.0 \cdot x\right)}{{cos}^{\left(\frac{2.0}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2.0}{2}\right)}\right)}}{{cos}^{\left(\frac{2.0}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2.0}{2}\right)}\right)}\]
\frac{\cos \left(2.0 \cdot x\right)}{{cos}^{2.0} \cdot \left(\left(x \cdot {sin}^{2.0}\right) \cdot x\right)}
\frac{\frac{\cos \left(2.0 \cdot x\right)}{{cos}^{\left(\frac{2.0}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2.0}{2}\right)}\right)}}{{cos}^{\left(\frac{2.0}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2.0}{2}\right)}\right)}
double f(double x, double cos, double sin) {
        double r2698363 = 2.0;
        double r2698364 = x;
        double r2698365 = r2698363 * r2698364;
        double r2698366 = cos(r2698365);
        double r2698367 = cos;
        double r2698368 = pow(r2698367, r2698363);
        double r2698369 = sin;
        double r2698370 = pow(r2698369, r2698363);
        double r2698371 = r2698364 * r2698370;
        double r2698372 = r2698371 * r2698364;
        double r2698373 = r2698368 * r2698372;
        double r2698374 = r2698366 / r2698373;
        return r2698374;
}

double f(double x, double cos, double sin) {
        double r2698375 = 2.0;
        double r2698376 = x;
        double r2698377 = r2698375 * r2698376;
        double r2698378 = cos(r2698377);
        double r2698379 = cos;
        double r2698380 = 2.0;
        double r2698381 = r2698375 / r2698380;
        double r2698382 = pow(r2698379, r2698381);
        double r2698383 = sin;
        double r2698384 = pow(r2698383, r2698381);
        double r2698385 = r2698376 * r2698384;
        double r2698386 = r2698382 * r2698385;
        double r2698387 = r2698378 / r2698386;
        double r2698388 = r2698387 / r2698386;
        return r2698388;
}

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

    \[\frac{\cos \left(2.0 \cdot x\right)}{{cos}^{2.0} \cdot \left(\left(x \cdot {sin}^{2.0}\right) \cdot x\right)}\]
  2. Using strategy rm
  3. Applied sqr-pow27.6

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

    \[\leadsto \frac{\cos \left(2.0 \cdot x\right)}{{cos}^{2.0} \cdot \left(\color{blue}{\left(\left(x \cdot {sin}^{\left(\frac{2.0}{2}\right)}\right) \cdot {sin}^{\left(\frac{2.0}{2}\right)}\right)} \cdot x\right)}\]
  5. Using strategy rm
  6. Applied associate-*l*19.6

    \[\leadsto \frac{\cos \left(2.0 \cdot x\right)}{{cos}^{2.0} \cdot \color{blue}{\left(\left(x \cdot {sin}^{\left(\frac{2.0}{2}\right)}\right) \cdot \left({sin}^{\left(\frac{2.0}{2}\right)} \cdot x\right)\right)}}\]
  7. Simplified19.6

    \[\leadsto \frac{\cos \left(2.0 \cdot x\right)}{{cos}^{2.0} \cdot \left(\left(x \cdot {sin}^{\left(\frac{2.0}{2}\right)}\right) \cdot \color{blue}{\left(x \cdot {sin}^{\left(\frac{2.0}{2}\right)}\right)}\right)}\]
  8. Using strategy rm
  9. Applied sqr-pow19.6

    \[\leadsto \frac{\cos \left(2.0 \cdot x\right)}{\color{blue}{\left({cos}^{\left(\frac{2.0}{2}\right)} \cdot {cos}^{\left(\frac{2.0}{2}\right)}\right)} \cdot \left(\left(x \cdot {sin}^{\left(\frac{2.0}{2}\right)}\right) \cdot \left(x \cdot {sin}^{\left(\frac{2.0}{2}\right)}\right)\right)}\]
  10. Applied unswap-sqr2.9

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

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

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

Reproduce

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