Average Error: 30.8 → 0.4
Time: 3.0s
Precision: binary64
\[\sqrt{2 \cdot {x}^{2}}\]
\[\sqrt{\sqrt{2}} \cdot \left(\sqrt{\sqrt{2}} \cdot \left|{x}^{\left(\frac{2}{2}\right)}\right|\right)\]
\sqrt{2 \cdot {x}^{2}}
\sqrt{\sqrt{2}} \cdot \left(\sqrt{\sqrt{2}} \cdot \left|{x}^{\left(\frac{2}{2}\right)}\right|\right)
(FPCore (x) :precision binary64 (sqrt (* 2.0 (pow x 2.0))))
(FPCore (x)
 :precision binary64
 (* (sqrt (sqrt 2.0)) (* (sqrt (sqrt 2.0)) (fabs (pow x (/ 2.0 2.0))))))
double code(double x) {
	return ((double) sqrt(((double) (2.0 * ((double) pow(x, 2.0))))));
}
double code(double x) {
	return ((double) (((double) sqrt(((double) sqrt(2.0)))) * ((double) (((double) sqrt(((double) sqrt(2.0)))) * ((double) fabs(((double) pow(x, (2.0 / 2.0)))))))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 30.8

    \[\sqrt{2 \cdot {x}^{2}}\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt_binary6431.1

    \[\leadsto \sqrt{\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)} \cdot {x}^{2}}\]
  4. Applied associate-*l*_binary6431.0

    \[\leadsto \sqrt{\color{blue}{\sqrt{2} \cdot \left(\sqrt{2} \cdot {x}^{2}\right)}}\]
  5. Simplified31.0

    \[\leadsto \sqrt{\sqrt{2} \cdot \color{blue}{\left({x}^{2} \cdot \sqrt{2}\right)}}\]
  6. Using strategy rm
  7. Applied sqrt-prod_binary6430.9

    \[\leadsto \color{blue}{\sqrt{\sqrt{2}} \cdot \sqrt{{x}^{2} \cdot \sqrt{2}}}\]
  8. Simplified30.9

    \[\leadsto \sqrt{\sqrt{2}} \cdot \color{blue}{\sqrt{\sqrt{2} \cdot {x}^{2}}}\]
  9. Using strategy rm
  10. Applied sqrt-prod_binary6431.0

    \[\leadsto \sqrt{\sqrt{2}} \cdot \color{blue}{\left(\sqrt{\sqrt{2}} \cdot \sqrt{{x}^{2}}\right)}\]
  11. Using strategy rm
  12. Applied sqr-pow_binary6431.0

    \[\leadsto \sqrt{\sqrt{2}} \cdot \left(\sqrt{\sqrt{2}} \cdot \sqrt{\color{blue}{{x}^{\left(\frac{2}{2}\right)} \cdot {x}^{\left(\frac{2}{2}\right)}}}\right)\]
  13. Applied rem-sqrt-square_binary640.4

    \[\leadsto \sqrt{\sqrt{2}} \cdot \left(\sqrt{\sqrt{2}} \cdot \color{blue}{\left|{x}^{\left(\frac{2}{2}\right)}\right|}\right)\]
  14. Final simplification0.4

    \[\leadsto \sqrt{\sqrt{2}} \cdot \left(\sqrt{\sqrt{2}} \cdot \left|{x}^{\left(\frac{2}{2}\right)}\right|\right)\]

Reproduce

herbie shell --seed 2020205 
(FPCore (x)
  :name "sqrt D"
  :precision binary64
  (sqrt (* 2.0 (pow x 2.0))))