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

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 30.5

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

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

    \[\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(\sqrt[3]{\sqrt{2}}\right)}^{2} \cdot \left|x\right|\right)}\]
  13. Final simplification0.4

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

Reproduce

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