Average Error: 28.2 → 5.6
Time: 14.1s
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({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)}\]
\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({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)}
double f(double x, double cos, double sin) {
        double r70688 = 2.0;
        double r70689 = x;
        double r70690 = r70688 * r70689;
        double r70691 = cos(r70690);
        double r70692 = cos;
        double r70693 = pow(r70692, r70688);
        double r70694 = sin;
        double r70695 = pow(r70694, r70688);
        double r70696 = r70689 * r70695;
        double r70697 = r70696 * r70689;
        double r70698 = r70693 * r70697;
        double r70699 = r70691 / r70698;
        return r70699;
}

double f(double x, double cos, double sin) {
        double r70700 = 2.0;
        double r70701 = x;
        double r70702 = r70700 * r70701;
        double r70703 = cos(r70702);
        double r70704 = cos;
        double r70705 = 2.0;
        double r70706 = r70700 / r70705;
        double r70707 = pow(r70704, r70706);
        double r70708 = sin;
        double r70709 = pow(r70708, r70706);
        double r70710 = r70701 * r70709;
        double r70711 = r70707 * r70710;
        double r70712 = r70711 * r70710;
        double r70713 = r70707 * r70712;
        double r70714 = r70703 / r70713;
        return r70714;
}

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

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

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

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

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

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left({cos}^{\left(\frac{2}{2}\right)} \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)\right)}\]
  8. Using strategy rm
  9. Applied associate-*l*13.3

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{{cos}^{\left(\frac{2}{2}\right)} \cdot \left({cos}^{\left(\frac{2}{2}\right)} \cdot \color{blue}{\left(\left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot \left({sin}^{\left(\frac{2}{2}\right)} \cdot x\right)\right)}\right)}\]
  10. Simplified13.3

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

    \[\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)}}\]
  13. Final simplification5.6

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

Reproduce

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