Average Error: 27.8 → 2.6
Time: 27.7s
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(x \cdot 2\right)}{\left(x \cdot {cos}^{\left(\frac{2}{2}\right)}\right) \cdot {sin}^{\left(\frac{2}{2}\right)}} \cdot \frac{1}{\left(x \cdot {cos}^{\left(\frac{2}{2}\right)}\right) \cdot {sin}^{\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(x \cdot 2\right)}{\left(x \cdot {cos}^{\left(\frac{2}{2}\right)}\right) \cdot {sin}^{\left(\frac{2}{2}\right)}} \cdot \frac{1}{\left(x \cdot {cos}^{\left(\frac{2}{2}\right)}\right) \cdot {sin}^{\left(\frac{2}{2}\right)}}
double f(double x, double cos, double sin) {
        double r2700695 = 2.0;
        double r2700696 = x;
        double r2700697 = r2700695 * r2700696;
        double r2700698 = cos(r2700697);
        double r2700699 = cos;
        double r2700700 = pow(r2700699, r2700695);
        double r2700701 = sin;
        double r2700702 = pow(r2700701, r2700695);
        double r2700703 = r2700696 * r2700702;
        double r2700704 = r2700703 * r2700696;
        double r2700705 = r2700700 * r2700704;
        double r2700706 = r2700698 / r2700705;
        return r2700706;
}

double f(double x, double cos, double sin) {
        double r2700707 = x;
        double r2700708 = 2.0;
        double r2700709 = r2700707 * r2700708;
        double r2700710 = cos(r2700709);
        double r2700711 = cos;
        double r2700712 = 2.0;
        double r2700713 = r2700708 / r2700712;
        double r2700714 = pow(r2700711, r2700713);
        double r2700715 = r2700707 * r2700714;
        double r2700716 = sin;
        double r2700717 = pow(r2700716, r2700713);
        double r2700718 = r2700715 * r2700717;
        double r2700719 = r2700710 / r2700718;
        double r2700720 = 1.0;
        double r2700721 = r2700720 / r2700718;
        double r2700722 = r2700719 * r2700721;
        return r2700722;
}

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. Simplified6.5

    \[\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)}}\]
  9. Using strategy rm
  10. Applied associate-/r*6.2

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

    \[\leadsto \frac{\frac{\cos \left(2 \cdot x\right)}{{\color{blue}{\left(1 \cdot cos\right)}}^{\left(\frac{2}{2}\right)}}}{\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)}\]
  13. Applied unpow-prod-down6.2

    \[\leadsto \frac{\frac{\cos \left(2 \cdot x\right)}{\color{blue}{{1}^{\left(\frac{2}{2}\right)} \cdot {cos}^{\left(\frac{2}{2}\right)}}}}{\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)}\]
  14. Applied *-un-lft-identity6.2

    \[\leadsto \frac{\frac{\color{blue}{1 \cdot \cos \left(2 \cdot x\right)}}{{1}^{\left(\frac{2}{2}\right)} \cdot {cos}^{\left(\frac{2}{2}\right)}}}{\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)}\]
  15. Applied times-frac6.2

    \[\leadsto \frac{\color{blue}{\frac{1}{{1}^{\left(\frac{2}{2}\right)}} \cdot \frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)}}}}{\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)}\]
  16. Applied times-frac2.7

    \[\leadsto \color{blue}{\frac{\frac{1}{{1}^{\left(\frac{2}{2}\right)}}}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)} \cdot \frac{\frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)}}}{x \cdot {sin}^{\left(\frac{2}{2}\right)}}}\]
  17. Simplified4.7

    \[\leadsto \color{blue}{\frac{1}{{sin}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {cos}^{\left(\frac{2}{2}\right)}\right)}} \cdot \frac{\frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)}}}{x \cdot {sin}^{\left(\frac{2}{2}\right)}}\]
  18. Simplified2.6

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

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

Reproduce

herbie shell --seed 2019172 +o rules:numerics
(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))))