Average Error: 27.6 → 8.4
Time: 28.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(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 r3020857 = 2.0;
        double r3020858 = x;
        double r3020859 = r3020857 * r3020858;
        double r3020860 = cos(r3020859);
        double r3020861 = cos;
        double r3020862 = pow(r3020861, r3020857);
        double r3020863 = sin;
        double r3020864 = pow(r3020863, r3020857);
        double r3020865 = r3020858 * r3020864;
        double r3020866 = r3020865 * r3020858;
        double r3020867 = r3020862 * r3020866;
        double r3020868 = r3020860 / r3020867;
        return r3020868;
}

double f(double x, double cos, double sin) {
        double r3020869 = 2.0;
        double r3020870 = x;
        double r3020871 = r3020869 * r3020870;
        double r3020872 = cos(r3020871);
        double r3020873 = cos;
        double r3020874 = 2.0;
        double r3020875 = r3020869 / r3020874;
        double r3020876 = pow(r3020873, r3020875);
        double r3020877 = sin;
        double r3020878 = pow(r3020877, r3020875);
        double r3020879 = r3020870 * r3020878;
        double r3020880 = r3020876 * r3020879;
        double r3020881 = r3020880 * r3020878;
        double r3020882 = r3020870 * r3020881;
        double r3020883 = r3020876 * r3020882;
        double r3020884 = r3020872 / r3020883;
        return r3020884;
}

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 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}\]
  2. Using strategy rm
  3. Applied sqr-pow27.6

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

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

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

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

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

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

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

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

    \[\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 2019169 
(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))))