Average Error: 27.6 → 2.9
Time: 7.3s
Precision: binary64
\[\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)}\]
\[\frac{1}{\frac{{\left(\left|\left(s \cdot c\right) \cdot x\right|\right)}^{2}}{\cos \left(x \cdot 2\right)}}\]
\frac{\cos \left(2 \cdot x\right)}{{c}^{2} \cdot \left(\left(x \cdot {s}^{2}\right) \cdot x\right)}
\frac{1}{\frac{{\left(\left|\left(s \cdot c\right) \cdot x\right|\right)}^{2}}{\cos \left(x \cdot 2\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 (/ (pow (fabs (* (* s c) x)) 2.0) (cos (* x 2.0)))))
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 / (pow(fabs((s * c) * x), 2.0) / cos(x * 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.6

    \[\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_44127.6

    \[\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. Simplified27.6

    \[\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. Simplified2.9

    \[\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 clear-num_binary64_4182.9

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

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

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

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

Reproduce

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