Average Error: 27.9 → 3.4
Time: 8.1s
Precision: binary64
\[\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)}\]
\[\left(\sqrt[3]{\frac{\cos \left(x \cdot 2\right)}{x}} \cdot \frac{\sqrt[3]{\frac{\cos \left(x \cdot 2\right)}{x}}}{x \cdot {\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}}\right) \cdot \frac{\sqrt[3]{\frac{\cos \left(x \cdot 2\right)}{x}}}{{\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}}\]
\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)}
\left(\sqrt[3]{\frac{\cos \left(x \cdot 2\right)}{x}} \cdot \frac{\sqrt[3]{\frac{\cos \left(x \cdot 2\right)}{x}}}{x \cdot {\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}}\right) \cdot \frac{\sqrt[3]{\frac{\cos \left(x \cdot 2\right)}{x}}}{{\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}}
double code(double x, double c, double s) {
	return ((double) (((double) cos(((double) (2.0 * x)))) / ((double) (((double) pow(c, 2.0)) * ((double) (((double) (x * ((double) pow(s, 2.0)))) * x))))));
}
double code(double x, double c, double s) {
	return ((double) (((double) (((double) cbrt(((double) (((double) cos(((double) (x * 2.0)))) / x)))) * ((double) (((double) cbrt(((double) (((double) cos(((double) (x * 2.0)))) / x)))) / ((double) (x * ((double) pow(((double) (c * s)), ((double) (2.0 / 2.0)))))))))) * ((double) (((double) cbrt(((double) (((double) cos(((double) (x * 2.0)))) / x)))) / ((double) pow(((double) (c * s)), ((double) (2.0 / 2.0))))))));
}

Error

Bits error versus x

Bits error versus c

Bits error versus s

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)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)}\]
  2. Simplified27.6

    \[\leadsto \color{blue}{\frac{\cos \left(2 \cdot x\right)}{x \cdot \left(x \cdot \left({c}^{2} \cdot {s}^{2}\right)\right)}}\]
  3. Using strategy rm
  4. Applied pow-prod-down13.2

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{x \cdot \left(x \cdot \color{blue}{{\left(c \cdot s\right)}^{2}}\right)}\]
  5. Using strategy rm
  6. Applied sqr-pow13.2

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{x \cdot \left(x \cdot \color{blue}{\left({\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}\right)}\right)}\]
  7. Applied associate-*r*6.2

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{x \cdot \color{blue}{\left(\left(x \cdot {\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}\right) \cdot {\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}\right)}}\]
  8. Using strategy rm
  9. Applied associate-/r*6.0

    \[\leadsto \color{blue}{\frac{\frac{\cos \left(2 \cdot x\right)}{x}}{\left(x \cdot {\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}\right) \cdot {\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}}}\]
  10. Simplified6.0

    \[\leadsto \frac{\color{blue}{\frac{\cos \left(x \cdot 2\right)}{x}}}{\left(x \cdot {\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}\right) \cdot {\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}}\]
  11. Using strategy rm
  12. Applied add-cube-cbrt6.3

    \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{\frac{\cos \left(x \cdot 2\right)}{x}} \cdot \sqrt[3]{\frac{\cos \left(x \cdot 2\right)}{x}}\right) \cdot \sqrt[3]{\frac{\cos \left(x \cdot 2\right)}{x}}}}{\left(x \cdot {\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}\right) \cdot {\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}}\]
  13. Applied times-frac3.4

    \[\leadsto \color{blue}{\frac{\sqrt[3]{\frac{\cos \left(x \cdot 2\right)}{x}} \cdot \sqrt[3]{\frac{\cos \left(x \cdot 2\right)}{x}}}{x \cdot {\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}} \cdot \frac{\sqrt[3]{\frac{\cos \left(x \cdot 2\right)}{x}}}{{\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}}}\]
  14. Simplified3.4

    \[\leadsto \color{blue}{\left(\sqrt[3]{\frac{\cos \left(x \cdot 2\right)}{x}} \cdot \frac{\sqrt[3]{\frac{\cos \left(x \cdot 2\right)}{x}}}{x \cdot {\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}}\right)} \cdot \frac{\sqrt[3]{\frac{\cos \left(x \cdot 2\right)}{x}}}{{\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}}\]
  15. Final simplification3.4

    \[\leadsto \left(\sqrt[3]{\frac{\cos \left(x \cdot 2\right)}{x}} \cdot \frac{\sqrt[3]{\frac{\cos \left(x \cdot 2\right)}{x}}}{x \cdot {\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}}\right) \cdot \frac{\sqrt[3]{\frac{\cos \left(x \cdot 2\right)}{x}}}{{\left(c \cdot s\right)}^{\left(\frac{2}{2}\right)}}\]

Reproduce

herbie shell --seed 2020179 
(FPCore (x c s)
  :name "mixedcos"
  :precision binary64
  (/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))