Average Error: 30.4 → 0.4
Time: 2.6s
Precision: binary64
\[\sqrt{{x}^{2} + {x}^{2}}\]
\[\left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \left(\sqrt[3]{\sqrt{2}} \cdot \left|x\right|\right)\]
\sqrt{{x}^{2} + {x}^{2}}
\left(\sqrt[3]{\sqrt{2}} \cdot \sqrt[3]{\sqrt{2}}\right) \cdot \left(\sqrt[3]{\sqrt{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)) (cbrt (sqrt 2.0))) (* (cbrt (sqrt 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)) * cbrt(sqrt(2.0))) * (cbrt(sqrt(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.4

    \[\sqrt{{x}^{2} + {x}^{2}}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity_binary6430.4

    \[\leadsto \sqrt{{x}^{2} + {\color{blue}{\left(1 \cdot x\right)}}^{2}}\]
  4. Applied unpow-prod-down_binary6430.4

    \[\leadsto \sqrt{{x}^{2} + \color{blue}{{1}^{2} \cdot {x}^{2}}}\]
  5. Applied distribute-rgt1-in_binary6430.4

    \[\leadsto \sqrt{\color{blue}{\left({1}^{2} + 1\right) \cdot {x}^{2}}}\]
  6. Applied sqrt-prod_binary6430.6

    \[\leadsto \color{blue}{\sqrt{{1}^{2} + 1} \cdot \sqrt{{x}^{2}}}\]
  7. Simplified30.6

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

    \[\leadsto \sqrt{2} \cdot \color{blue}{\left|x\right|}\]
  9. Using strategy rm
  10. 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|\]
  11. 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)}\]
  12. 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)}\]
  13. Final simplification0.4

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

Reproduce

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