Average Error: 27.6 → 2.6
Time: 7.7s
Precision: 64
\[\frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}\]
\[\frac{\frac{\cos \left(2 \cdot x\right)}{\left|{\left({cos}^{1} \cdot {sin}^{1}\right)}^{1} \cdot x\right|}}{\left|{\left({cos}^{1} \cdot {sin}^{1}\right)}^{1} \cdot x\right|}\]
\frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}
\frac{\frac{\cos \left(2 \cdot x\right)}{\left|{\left({cos}^{1} \cdot {sin}^{1}\right)}^{1} \cdot x\right|}}{\left|{\left({cos}^{1} \cdot {sin}^{1}\right)}^{1} \cdot x\right|}
double f(double x, double cos, double sin) {
        double r53655 = 2.0;
        double r53656 = x;
        double r53657 = r53655 * r53656;
        double r53658 = cos(r53657);
        double r53659 = cos;
        double r53660 = pow(r53659, r53655);
        double r53661 = sin;
        double r53662 = pow(r53661, r53655);
        double r53663 = r53656 * r53662;
        double r53664 = r53663 * r53656;
        double r53665 = r53660 * r53664;
        double r53666 = r53658 / r53665;
        return r53666;
}

double f(double x, double cos, double sin) {
        double r53667 = 2.0;
        double r53668 = x;
        double r53669 = r53667 * r53668;
        double r53670 = cos(r53669);
        double r53671 = cos;
        double r53672 = 1.0;
        double r53673 = pow(r53671, r53672);
        double r53674 = sin;
        double r53675 = pow(r53674, r53672);
        double r53676 = r53673 * r53675;
        double r53677 = pow(r53676, r53672);
        double r53678 = r53677 * r53668;
        double r53679 = fabs(r53678);
        double r53680 = r53670 / r53679;
        double r53681 = r53680 / r53679;
        return r53681;
}

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

    \[\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 add-sqr-sqrt21.8

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\sqrt{{cos}^{2} \cdot \left(\left(\left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot x\right)} \cdot \sqrt{{cos}^{2} \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. Simplified21.8

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\left|{cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right|} \cdot \sqrt{{cos}^{2} \cdot \left(\left(\left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot {sin}^{\left(\frac{2}{2}\right)}\right) \cdot x\right)}}\]
  8. Simplified3.1

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\left|{cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right| \cdot \color{blue}{\left|{cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right|}}\]
  9. Taylor expanded around inf 2.9

    \[\leadsto \color{blue}{\frac{\cos \left(2 \cdot x\right)}{{\left(\left|{\left({cos}^{1} \cdot {sin}^{1}\right)}^{1} \cdot x\right|\right)}^{2}}}\]
  10. Using strategy rm
  11. Applied unpow22.9

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

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

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

Reproduce

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