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 r63449 = 2.0;
        double r63450 = x;
        double r63451 = r63449 * r63450;
        double r63452 = cos(r63451);
        double r63453 = cos;
        double r63454 = pow(r63453, r63449);
        double r63455 = sin;
        double r63456 = pow(r63455, r63449);
        double r63457 = r63450 * r63456;
        double r63458 = r63457 * r63450;
        double r63459 = r63454 * r63458;
        double r63460 = r63452 / r63459;
        return r63460;
}

double f(double x, double cos, double sin) {
        double r63461 = 2.0;
        double r63462 = x;
        double r63463 = r63461 * r63462;
        double r63464 = cos(r63463);
        double r63465 = cos;
        double r63466 = 2.0;
        double r63467 = r63461 / r63466;
        double r63468 = pow(r63465, r63467);
        double r63469 = sin;
        double r63470 = pow(r63469, r63467);
        double r63471 = r63462 * r63470;
        double r63472 = r63468 * r63471;
        double r63473 = r63468 * r63472;
        double r63474 = r63470 * r63462;
        double r63475 = r63473 * r63474;
        double r63476 = r63464 / r63475;
        return r63476;
}

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 +o rules:numerics
(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))))