Average Error: 27.9 → 6.7
Time: 19.2s
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)}{\left({cos}^{\left(\frac{2}{2}\right)} \cdot \left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right)\right) \cdot \left({sin}^{\left(\frac{2}{2}\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)}{\left({cos}^{\left(\frac{2}{2}\right)} \cdot \left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right)\right) \cdot \left({sin}^{\left(\frac{2}{2}\right)} \cdot x\right)}
double f(double x, double cos, double sin) {
        double r61419 = 2.0;
        double r61420 = x;
        double r61421 = r61419 * r61420;
        double r61422 = cos(r61421);
        double r61423 = cos;
        double r61424 = pow(r61423, r61419);
        double r61425 = sin;
        double r61426 = pow(r61425, r61419);
        double r61427 = r61420 * r61426;
        double r61428 = r61427 * r61420;
        double r61429 = r61424 * r61428;
        double r61430 = r61422 / r61429;
        return r61430;
}

double f(double x, double cos, double sin) {
        double r61431 = 2.0;
        double r61432 = x;
        double r61433 = r61431 * r61432;
        double r61434 = cos(r61433);
        double r61435 = cos;
        double r61436 = 2.0;
        double r61437 = r61431 / r61436;
        double r61438 = pow(r61435, r61437);
        double r61439 = sin;
        double r61440 = pow(r61439, r61437);
        double r61441 = r61432 * r61440;
        double r61442 = r61438 * r61441;
        double r61443 = r61438 * r61442;
        double r61444 = r61440 * r61432;
        double r61445 = r61443 * r61444;
        double r61446 = r61434 / r61445;
        return r61446;
}

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

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

    \[\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 associate-*l*19.6

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

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\left({cos}^{2} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right) \cdot \left({sin}^{\left(\frac{2}{2}\right)} \cdot x\right)}}\]
  9. Using strategy rm
  10. Applied sqr-pow15.8

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\left(\color{blue}{\left({cos}^{\left(\frac{2}{2}\right)} \cdot {cos}^{\left(\frac{2}{2}\right)}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right) \cdot \left({sin}^{\left(\frac{2}{2}\right)} \cdot x\right)}\]
  11. Applied associate-*l*6.7

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\left({cos}^{\left(\frac{2}{2}\right)} \cdot \left({cos}^{\left(\frac{2}{2}\right)} \cdot \left(x \cdot {sin}^{\left(\frac{2}{2}\right)}\right)\right)\right)} \cdot \left({sin}^{\left(\frac{2}{2}\right)} \cdot x\right)}\]
  12. Final simplification6.7

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

Reproduce

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