Average Error: 28.4 → 8.3
Time: 24.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)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left(\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)}\]
\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(\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)}
double f(double x, double cos, double sin) {
        double r80853 = 2.0;
        double r80854 = x;
        double r80855 = r80853 * r80854;
        double r80856 = cos(r80855);
        double r80857 = cos;
        double r80858 = pow(r80857, r80853);
        double r80859 = sin;
        double r80860 = pow(r80859, r80853);
        double r80861 = r80854 * r80860;
        double r80862 = r80861 * r80854;
        double r80863 = r80858 * r80862;
        double r80864 = r80856 / r80863;
        return r80864;
}

double f(double x, double cos, double sin) {
        double r80865 = 2.0;
        double r80866 = x;
        double r80867 = r80865 * r80866;
        double r80868 = cos(r80867);
        double r80869 = cos;
        double r80870 = 2.0;
        double r80871 = r80865 / r80870;
        double r80872 = pow(r80869, r80871);
        double r80873 = sin;
        double r80874 = pow(r80873, r80871);
        double r80875 = r80866 * r80874;
        double r80876 = r80872 * r80875;
        double r80877 = r80876 * r80874;
        double r80878 = r80877 * r80866;
        double r80879 = r80872 * r80878;
        double r80880 = r80868 / r80879;
        return r80880;
}

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

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

    \[\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(x \cdot {sin}^{2}\right) \cdot x\right)}\]
  4. Applied associate-*l*24.1

    \[\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(x \cdot {sin}^{2}\right) \cdot x\right)\right)}}\]
  5. Using strategy rm
  6. Applied associate-*r*20.4

    \[\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)}}\]
  7. Using strategy rm
  8. Applied sqr-pow20.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 \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)}\]
  9. Applied associate-*r*13.8

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

    \[\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)}\]
  12. Final simplification8.3

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left(\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)}\]

Reproduce

herbie shell --seed 2019304 
(FPCore (x cos sin)
  :name "cos(2*x)/(cos^2(x)*sin^2(x))"
  :precision binary64
  (/ (cos (* 2 x)) (* (pow cos 2) (* (* x (pow sin 2)) x))))