Average Error: 0.5 → 0.5
Time: 2.8s
Precision: 64
\[\sqrt{x - 1} \cdot \sqrt{x}\]
\[\sqrt{1} \cdot \left(\sqrt{x - 1} \cdot \sqrt{x}\right)\]
\sqrt{x - 1} \cdot \sqrt{x}
\sqrt{1} \cdot \left(\sqrt{x - 1} \cdot \sqrt{x}\right)
double code(double x) {
	return (sqrt((x - 1.0)) * sqrt(x));
}
double code(double x) {
	return (sqrt(1.0) * (sqrt((x - 1.0)) * 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 *-un-lft-identity0.5

    \[\leadsto \sqrt{\color{blue}{1 \cdot \left(x - 1\right)}} \cdot \sqrt{x}\]
  4. Applied sqrt-prod0.5

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

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

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

Reproduce

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