Average Error: 27.4 → 2.7
Time: 22.6s
Precision: 64
\[\frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}\]
\[\cos \left(2 \cdot x\right) \cdot {\left(\left(x \cdot sin\right) \cdot cos\right)}^{-2}\]
\frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}
\cos \left(2 \cdot x\right) \cdot {\left(\left(x \cdot sin\right) \cdot cos\right)}^{-2}
double f(double x, double cos, double sin) {
        double r2094501 = 2.0;
        double r2094502 = x;
        double r2094503 = r2094501 * r2094502;
        double r2094504 = cos(r2094503);
        double r2094505 = cos;
        double r2094506 = pow(r2094505, r2094501);
        double r2094507 = sin;
        double r2094508 = pow(r2094507, r2094501);
        double r2094509 = r2094502 * r2094508;
        double r2094510 = r2094509 * r2094502;
        double r2094511 = r2094506 * r2094510;
        double r2094512 = r2094504 / r2094511;
        return r2094512;
}

double f(double x, double cos, double sin) {
        double r2094513 = 2.0;
        double r2094514 = x;
        double r2094515 = r2094513 * r2094514;
        double r2094516 = cos(r2094515);
        double r2094517 = sin;
        double r2094518 = r2094514 * r2094517;
        double r2094519 = cos;
        double r2094520 = r2094518 * r2094519;
        double r2094521 = -2.0;
        double r2094522 = pow(r2094520, r2094521);
        double r2094523 = r2094516 * r2094522;
        return r2094523;
}

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

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

    \[\leadsto \color{blue}{\frac{\cos \left(2 \cdot x\right)}{\left(sin \cdot \left(x \cdot cos\right)\right) \cdot \left(sin \cdot \left(x \cdot cos\right)\right)}}\]
  3. Using strategy rm
  4. Applied clear-num2.7

    \[\leadsto \color{blue}{\frac{1}{\frac{\left(sin \cdot \left(x \cdot cos\right)\right) \cdot \left(sin \cdot \left(x \cdot cos\right)\right)}{\cos \left(2 \cdot x\right)}}}\]
  5. Using strategy rm
  6. Applied *-un-lft-identity2.7

    \[\leadsto \frac{1}{\frac{\left(sin \cdot \left(x \cdot cos\right)\right) \cdot \left(sin \cdot \left(x \cdot cos\right)\right)}{\color{blue}{1 \cdot \cos \left(2 \cdot x\right)}}}\]
  7. Applied times-frac2.7

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

    \[\leadsto \color{blue}{\frac{\frac{1}{\frac{sin \cdot \left(x \cdot cos\right)}{1}}}{\frac{sin \cdot \left(x \cdot cos\right)}{\cos \left(2 \cdot x\right)}}}\]
  9. Using strategy rm
  10. Applied associate-/r/2.4

    \[\leadsto \color{blue}{\frac{\frac{1}{\frac{sin \cdot \left(x \cdot cos\right)}{1}}}{sin \cdot \left(x \cdot cos\right)} \cdot \cos \left(2 \cdot x\right)}\]
  11. Simplified2.7

    \[\leadsto \color{blue}{\frac{\frac{1}{cos \cdot \left(sin \cdot x\right)}}{cos \cdot \left(sin \cdot x\right)}} \cdot \cos \left(2 \cdot x\right)\]
  12. Using strategy rm
  13. Applied pow12.7

    \[\leadsto \frac{\frac{1}{cos \cdot \left(sin \cdot x\right)}}{cos \cdot \left(sin \cdot \color{blue}{{x}^{1}}\right)} \cdot \cos \left(2 \cdot x\right)\]
  14. Applied pow12.7

    \[\leadsto \frac{\frac{1}{cos \cdot \left(sin \cdot x\right)}}{cos \cdot \left(\color{blue}{{sin}^{1}} \cdot {x}^{1}\right)} \cdot \cos \left(2 \cdot x\right)\]
  15. Applied pow-prod-down2.7

    \[\leadsto \frac{\frac{1}{cos \cdot \left(sin \cdot x\right)}}{cos \cdot \color{blue}{{\left(sin \cdot x\right)}^{1}}} \cdot \cos \left(2 \cdot x\right)\]
  16. Applied pow12.7

    \[\leadsto \frac{\frac{1}{cos \cdot \left(sin \cdot x\right)}}{\color{blue}{{cos}^{1}} \cdot {\left(sin \cdot x\right)}^{1}} \cdot \cos \left(2 \cdot x\right)\]
  17. Applied pow-prod-down2.7

    \[\leadsto \frac{\frac{1}{cos \cdot \left(sin \cdot x\right)}}{\color{blue}{{\left(cos \cdot \left(sin \cdot x\right)\right)}^{1}}} \cdot \cos \left(2 \cdot x\right)\]
  18. Applied inv-pow2.7

    \[\leadsto \frac{\color{blue}{{\left(cos \cdot \left(sin \cdot x\right)\right)}^{-1}}}{{\left(cos \cdot \left(sin \cdot x\right)\right)}^{1}} \cdot \cos \left(2 \cdot x\right)\]
  19. Applied pow-div2.7

    \[\leadsto \color{blue}{{\left(cos \cdot \left(sin \cdot x\right)\right)}^{\left(-1 - 1\right)}} \cdot \cos \left(2 \cdot x\right)\]
  20. Simplified2.7

    \[\leadsto {\left(cos \cdot \left(sin \cdot x\right)\right)}^{\color{blue}{-2}} \cdot \cos \left(2 \cdot x\right)\]
  21. Final simplification2.7

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

Reproduce

herbie shell --seed 2019162 +o rules:numerics
(FPCore (x cos sin)
  :name "cos(2*x)/(cos^2(x)*sin^2(x))"
  (/ (cos (* 2 x)) (* (pow cos 2) (* (* x (pow sin 2)) x))))