Average Error: 0.5 → 0.5
Time: 1.3s
Precision: binary64
\[\sqrt{x - 1} \cdot \sqrt{x}\]
\[\sqrt{x - 1} \cdot \sqrt{x}\]
\sqrt{x - 1} \cdot \sqrt{x}
\sqrt{x - 1} \cdot \sqrt{x}
(FPCore (x) :precision binary64 (* (sqrt (- x 1.0)) (sqrt x)))
(FPCore (x) :precision binary64 (* (sqrt (- x 1.0)) (sqrt x)))
double code(double x) {
	return sqrt(x - 1.0) * sqrt(x);
}
double code(double x) {
	return 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. Final simplification0.5

    \[\leadsto \sqrt{x - 1} \cdot \sqrt{x}\]

Reproduce

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