Average Error: 28.0 → 2.8
Time: 54.5s
Precision: binary64
Cost: 1344
\[\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)}\]
\[\frac{\cos \left(x \cdot 2\right)}{\sqrt{\left|s \cdot \left(x \cdot c\right)\right|}} \cdot {\left(\left|s \cdot \left(x \cdot c\right)\right|\right)}^{-1.5}\]
\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)}
\frac{\cos \left(x \cdot 2\right)}{\sqrt{\left|s \cdot \left(x \cdot c\right)\right|}} \cdot {\left(\left|s \cdot \left(x \cdot c\right)\right|\right)}^{-1.5}
(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
 (*
  (/ (cos (* x 2.0)) (sqrt (fabs (* s (* x c)))))
  (pow (fabs (* s (* x c))) -1.5)))
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 (cos(x * 2.0) / sqrt(fabs(s * (x * c)))) * pow(fabs(s * (x * c)), -1.5);
}

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
Alternative 1
Accuracy2.8
Cost1472
\[\frac{\cos \left(x \cdot 2\right)}{\sqrt{\left|s \cdot \left(x \cdot c\right)\right|}} \cdot \frac{1}{{\left(\left|s \cdot \left(x \cdot c\right)\right|\right)}^{1.5}}\]

Derivation

  1. Initial program 28.0

    \[\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 add-sqr-sqrt_binary64_44128.0

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

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{\cos \left(x \cdot 2\right)}{\left|s \cdot \left(c \cdot x\right)\right|}}}{\left|s \cdot \left(c \cdot x\right)\right|}\]
  9. Using strategy rm
  10. Applied add-sqr-sqrt_binary64_4412.8

    \[\leadsto \frac{\frac{\cos \left(x \cdot 2\right)}{\left|s \cdot \left(c \cdot x\right)\right|}}{\color{blue}{\sqrt{\left|s \cdot \left(c \cdot x\right)\right|} \cdot \sqrt{\left|s \cdot \left(c \cdot x\right)\right|}}}\]
  11. Applied div-inv_binary64_4162.8

    \[\leadsto \frac{\color{blue}{\cos \left(x \cdot 2\right) \cdot \frac{1}{\left|s \cdot \left(c \cdot x\right)\right|}}}{\sqrt{\left|s \cdot \left(c \cdot x\right)\right|} \cdot \sqrt{\left|s \cdot \left(c \cdot x\right)\right|}}\]
  12. Applied times-frac_binary64_4252.8

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

    \[\leadsto \frac{\cos \left(x \cdot 2\right)}{\sqrt{\left|s \cdot \left(c \cdot x\right)\right|}} \cdot \color{blue}{\frac{1}{{\left(\left|s \cdot \left(c \cdot x\right)\right|\right)}^{1.5}}}\]
  14. Using strategy rm
  15. Applied pow-flip_binary64_4932.8

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

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

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

Reproduce

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