Average Error: 28.9 → 2.6
Time: 5.8s
Precision: binary64
\[\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)}\]
\[\frac{\frac{1}{\frac{\left|c \cdot \left(x \cdot s\right)\right|}{\cos \left(x \cdot 2\right)}}}{\left|c \cdot \left(x \cdot s\right)\right|}\]
\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)}
\frac{\frac{1}{\frac{\left|c \cdot \left(x \cdot s\right)\right|}{\cos \left(x \cdot 2\right)}}}{\left|c \cdot \left(x \cdot s\right)\right|}
(FPCore (x c s)
 :precision binary64
 (/ (cos (* 2.0 x)) (* (pow c 2.0) (* (* x (pow s 2.0)) x))))
(FPCore (x c s)
 :precision binary64
 (/ (/ 1.0 (/ (fabs (* c (* x s))) (cos (* x 2.0)))) (fabs (* c (* x s)))))
double code(double x, double c, double s) {
	return cos(2.0 * x) / (pow(c, 2.0) * ((x * pow(s, 2.0)) * x));
}
double code(double x, double c, double s) {
	return (1.0 / (fabs(c * (x * s)) / cos(x * 2.0))) / fabs(c * (x * s));
}

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 28.9

    \[\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)}\]
  2. Using strategy rm
  3. Applied unpow2_binary6428.9

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

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

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\sqrt{{c}^{2} \cdot \left(\left(\left(x \cdot s\right) \cdot s\right) \cdot x\right)} \cdot \sqrt{{c}^{2} \cdot \left(\left(\left(x \cdot s\right) \cdot s\right) \cdot x\right)}}}\]
  7. Simplified22.7

    \[\leadsto \frac{\cos \left(2 \cdot x\right)}{\color{blue}{\left|c \cdot \left(x \cdot s\right)\right|} \cdot \sqrt{{c}^{2} \cdot \left(\left(\left(x \cdot s\right) \cdot s\right) \cdot x\right)}}\]
  8. Simplified2.8

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

    \[\leadsto \color{blue}{\frac{\frac{\cos \left(2 \cdot x\right)}{\left|c \cdot \left(x \cdot s\right)\right|}}{\left|c \cdot \left(x \cdot s\right)\right|}}\]
  11. Simplified2.5

    \[\leadsto \frac{\color{blue}{\frac{\cos \left(x \cdot 2\right)}{\left|c \cdot \left(x \cdot s\right)\right|}}}{\left|c \cdot \left(x \cdot s\right)\right|}\]
  12. Using strategy rm
  13. Applied *-un-lft-identity_binary642.5

    \[\leadsto \frac{\frac{\color{blue}{1 \cdot \cos \left(x \cdot 2\right)}}{\left|c \cdot \left(x \cdot s\right)\right|}}{\left|c \cdot \left(x \cdot s\right)\right|}\]
  14. Applied associate-/l*_binary642.6

    \[\leadsto \frac{\color{blue}{\frac{1}{\frac{\left|c \cdot \left(x \cdot s\right)\right|}{\cos \left(x \cdot 2\right)}}}}{\left|c \cdot \left(x \cdot s\right)\right|}\]
  15. Final simplification2.6

    \[\leadsto \frac{\frac{1}{\frac{\left|c \cdot \left(x \cdot s\right)\right|}{\cos \left(x \cdot 2\right)}}}{\left|c \cdot \left(x \cdot s\right)\right|}\]

Reproduce

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