Average Error: 28.3 → 2.7
Time: 13.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}{\left|s \cdot \left(x \cdot c\right)\right|}}{\frac{\left|s \cdot \left(x \cdot c\right)\right|}{\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{\frac{1}{\left|s \cdot \left(x \cdot c\right)\right|}}{\frac{\left|s \cdot \left(x \cdot c\right)\right|}{\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 (fabs (* s (* x c)))) (/ (fabs (* s (* x c))) (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 / fabs(s * (x * c))) / (fabs(s * (x * c)) / 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 28.3

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

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

    \[\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. Simplified3.0

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{1}{\frac{\left|s \cdot \left(x \cdot c\right)\right|}{\cos \left(x \cdot 2\right)}}}}{\left|s \cdot \left(x \cdot c\right)\right|}\]
  11. Using strategy rm
  12. Applied div-inv_binary64_4162.7

    \[\leadsto \frac{\frac{1}{\color{blue}{\left|s \cdot \left(x \cdot c\right)\right| \cdot \frac{1}{\cos \left(x \cdot 2\right)}}}}{\left|s \cdot \left(x \cdot c\right)\right|}\]
  13. Applied *-un-lft-identity_binary64_4192.7

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

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

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

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

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

Reproduce

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