Average Error: 28.5 → 2.6
Time: 11.4s
Precision: binary64
\[\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)}\]
\[\frac{\frac{\cos \left(2 \cdot x\right)}{\left|s \cdot \left(x \cdot c\right)\right|}}{\left|s \cdot \left(x \cdot c\right)\right|}\]
\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)}
\frac{\frac{\cos \left(2 \cdot x\right)}{\left|s \cdot \left(x \cdot c\right)\right|}}{\left|s \cdot \left(x \cdot c\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
 (/ (/ (cos (* 2.0 x)) (fabs (* s (* x c)))) (fabs (* s (* x c)))))
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(2.0 * x) / fabs(s * (x * c))) / fabs(s * (x * c));
}

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

    \[\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.5

    \[\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.5

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

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

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

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

Reproduce

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