Average Error: 30.8 → 0.4
Time: 3.0s
Precision: binary64
\[\sqrt{{x}^{2} + {x}^{2}}\]
\[\sqrt{\sqrt{2}} \cdot \left(\left|{x}^{\left(\frac{2}{2}\right)}\right| \cdot \sqrt{\sqrt{2}}\right)\]
\sqrt{{x}^{2} + {x}^{2}}
\sqrt{\sqrt{2}} \cdot \left(\left|{x}^{\left(\frac{2}{2}\right)}\right| \cdot \sqrt{\sqrt{2}}\right)
(FPCore (x) :precision binary64 (sqrt (+ (pow x 2.0) (pow x 2.0))))
(FPCore (x)
 :precision binary64
 (* (sqrt (sqrt 2.0)) (* (fabs (pow x (/ 2.0 2.0))) (sqrt (sqrt 2.0)))))
double code(double x) {
	return ((double) sqrt(((double) (((double) pow(x, 2.0)) + ((double) pow(x, 2.0))))));
}
double code(double x) {
	return ((double) (((double) sqrt(((double) sqrt(2.0)))) * ((double) (((double) fabs(((double) pow(x, (2.0 / 2.0))))) * ((double) sqrt(((double) sqrt(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{{x}^{2} + {x}^{2}}\]
  2. Simplified30.8

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

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

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

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

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

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

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

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

Reproduce

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