Average Error: 30.9 → 0.4
Time: 2.3s
Precision: binary64
\[\sqrt{{x}^{2} + {x}^{2}}\]
\[\left(\sqrt[3]{\sqrt{2}} \cdot \left|x\right|\right) \cdot {\left(\sqrt{2}\right)}^{0.6666666666666666}\]
\sqrt{{x}^{2} + {x}^{2}}
\left(\sqrt[3]{\sqrt{2}} \cdot \left|x\right|\right) \cdot {\left(\sqrt{2}\right)}^{0.6666666666666666}
(FPCore (x) :precision binary64 (sqrt (+ (pow x 2.0) (pow x 2.0))))
(FPCore (x)
 :precision binary64
 (* (* (cbrt (sqrt 2.0)) (fabs x)) (pow (sqrt 2.0) 0.6666666666666666)))
double code(double x) {
	return sqrt(pow(x, 2.0) + pow(x, 2.0));
}
double code(double x) {
	return (cbrt(sqrt(2.0)) * fabs(x)) * pow(sqrt(2.0), 0.6666666666666666);
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 30.9

    \[\sqrt{{x}^{2} + {x}^{2}}\]
  2. Simplified30.9

    \[\leadsto \color{blue}{\sqrt{2 \cdot \left(x \cdot x\right)}}\]
  3. Using strategy rm
  4. Applied sqrt-prod_binary6431.0

    \[\leadsto \color{blue}{\sqrt{2} \cdot \sqrt{x \cdot x}}\]
  5. Simplified0.4

    \[\leadsto \sqrt{2} \cdot \color{blue}{\left|x\right|}\]
  6. Using strategy rm
  7. Applied add-cube-cbrt_binary640.4

    \[\leadsto \color{blue}{\left(\left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \sqrt[3]{\sqrt{2}}\right)} \cdot \left|x\right|\]
  8. Applied associate-*l*_binary640.4

    \[\leadsto \color{blue}{\left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \left(\sqrt[3]{\sqrt{2}} \cdot \left|x\right|\right)}\]
  9. Simplified0.4

    \[\leadsto \left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \color{blue}{\left(\left|x\right| \cdot \sqrt[3]{\sqrt{2}}\right)}\]
  10. Using strategy rm
  11. Applied associate-*l*_binary640.6

    \[\leadsto \color{blue}{\sqrt[3]{\sqrt{2}} \cdot \left(\sqrt[3]{\sqrt{2}} \cdot \left(\left|x\right| \cdot \sqrt[3]{\sqrt{2}}\right)\right)}\]
  12. Simplified0.4

    \[\leadsto \sqrt[3]{\sqrt{2}} \cdot \color{blue}{\left(\left|x\right| \cdot {\left(\sqrt{2}\right)}^{0.6666666666666666}\right)}\]
  13. Using strategy rm
  14. Applied associate-*r*_binary640.4

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

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

Alternatives

Reproduce

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