Average Error: 26.9 → 2.8
Time: 39.9s
Precision: 64
\[\frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}\]
\[\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)}}\]
\frac{\cos \left(2 \cdot x\right)}{{cos}^{2} \cdot \left(\left(x \cdot {sin}^{2}\right) \cdot x\right)}
\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)}}
double f(double x, double cos, double sin) {
        double r2598210 = 2.0;
        double r2598211 = x;
        double r2598212 = r2598210 * r2598211;
        double r2598213 = cos(r2598212);
        double r2598214 = cos;
        double r2598215 = pow(r2598214, r2598210);
        double r2598216 = sin;
        double r2598217 = pow(r2598216, r2598210);
        double r2598218 = r2598211 * r2598217;
        double r2598219 = r2598218 * r2598211;
        double r2598220 = r2598215 * r2598219;
        double r2598221 = r2598213 / r2598220;
        return r2598221;
}

double f(double x, double cos, double sin) {
        double r2598222 = 1.0;
        double r2598223 = sin;
        double r2598224 = x;
        double r2598225 = cos;
        double r2598226 = r2598224 * r2598225;
        double r2598227 = r2598223 * r2598226;
        double r2598228 = r2598227 * r2598227;
        double r2598229 = 2.0;
        double r2598230 = r2598229 * r2598224;
        double r2598231 = cos(r2598230);
        double r2598232 = r2598228 / r2598231;
        double r2598233 = r2598222 / r2598232;
        return r2598233;
}

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 26.9

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

    \[\leadsto \color{blue}{\frac{\cos \left(2 \cdot x\right)}{\left(\left(sin \cdot x\right) \cdot cos\right) \cdot \left(\left(sin \cdot x\right) \cdot cos\right)}}\]
  3. Taylor expanded around -inf 30.5

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{{x}^{2} \cdot \left({cos}^{2} \cdot {sin}^{2}\right)}}\]
  4. Simplified2.9

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

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

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

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

    \[\leadsto \color{blue}{\frac{\frac{1}{\frac{\left(sin \cdot cos\right) \cdot x}{1}}}{\frac{\left(sin \cdot cos\right) \cdot x}{\cos \left(2 \cdot x\right)}}}\]
  11. Using strategy rm
  12. Applied associate-/l/2.9

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

    \[\leadsto \frac{1}{\color{blue}{\frac{\left(sin \cdot \left(x \cdot cos\right)\right) \cdot \left(sin \cdot \left(x \cdot cos\right)\right)}{\cos \left(x \cdot 2\right)}}}\]
  14. Final simplification2.8

    \[\leadsto \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)}}\]

Reproduce

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