Average Error: 0.5 → 0.6
Time: 2.6s
Precision: binary64
\[\sqrt{x - 1} \cdot \sqrt{x}\]
\[{\left(x - 1\right)}^{0.25} \cdot \left({\left(x - 1\right)}^{0.25} \cdot \sqrt{x}\right)\]
\sqrt{x - 1} \cdot \sqrt{x}
{\left(x - 1\right)}^{0.25} \cdot \left({\left(x - 1\right)}^{0.25} \cdot \sqrt{x}\right)
(FPCore (x) :precision binary64 (* (sqrt (- x 1.0)) (sqrt x)))
(FPCore (x)
 :precision binary64
 (* (pow (- x 1.0) 0.25) (* (pow (- x 1.0) 0.25) (sqrt x))))
double code(double x) {
	return sqrt(x - 1.0) * sqrt(x);
}
double code(double x) {
	return pow((x - 1.0), 0.25) * (pow((x - 1.0), 0.25) * sqrt(x));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.5

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

    \[\leadsto \color{blue}{\left(\sqrt{\sqrt{x - 1}} \cdot \sqrt{\sqrt{x - 1}}\right)} \cdot \sqrt{x}\]
  4. Applied associate-*l*_binary640.7

    \[\leadsto \color{blue}{\sqrt{\sqrt{x - 1}} \cdot \left(\sqrt{\sqrt{x - 1}} \cdot \sqrt{x}\right)}\]
  5. Simplified0.7

    \[\leadsto \sqrt{\sqrt{x - 1}} \cdot \color{blue}{\left(\sqrt{x} \cdot \sqrt{\sqrt{x - 1}}\right)}\]
  6. Using strategy rm
  7. Applied pow1/2_binary640.7

    \[\leadsto \sqrt{\sqrt{x - 1}} \cdot \left(\sqrt{x} \cdot \sqrt{\color{blue}{{\left(x - 1\right)}^{0.5}}}\right)\]
  8. Applied sqrt-pow1_binary640.6

    \[\leadsto \sqrt{\sqrt{x - 1}} \cdot \left(\sqrt{x} \cdot \color{blue}{{\left(x - 1\right)}^{\left(\frac{0.5}{2}\right)}}\right)\]
  9. Simplified0.6

    \[\leadsto \sqrt{\sqrt{x - 1}} \cdot \left(\sqrt{x} \cdot {\left(x - 1\right)}^{\color{blue}{0.25}}\right)\]
  10. Using strategy rm
  11. Applied pow1/2_binary640.6

    \[\leadsto \sqrt{\color{blue}{{\left(x - 1\right)}^{0.5}}} \cdot \left(\sqrt{x} \cdot {\left(x - 1\right)}^{0.25}\right)\]
  12. Applied sqrt-pow1_binary640.6

    \[\leadsto \color{blue}{{\left(x - 1\right)}^{\left(\frac{0.5}{2}\right)}} \cdot \left(\sqrt{x} \cdot {\left(x - 1\right)}^{0.25}\right)\]
  13. Simplified0.6

    \[\leadsto {\left(x - 1\right)}^{\color{blue}{0.25}} \cdot \left(\sqrt{x} \cdot {\left(x - 1\right)}^{0.25}\right)\]
  14. Final simplification0.6

    \[\leadsto {\left(x - 1\right)}^{0.25} \cdot \left({\left(x - 1\right)}^{0.25} \cdot \sqrt{x}\right)\]

Reproduce

herbie shell --seed 2020344 
(FPCore (x)
  :name "sqrt times"
  :precision binary64
  (* (sqrt (- x 1.0)) (sqrt x)))