Average Error: 0.5 → 0.6
Time: 1.1s
Precision: binary64
\[\sqrt{x - 1} \cdot \sqrt{x} \]
\[x - 0.5 \]
\sqrt{x - 1} \cdot \sqrt{x}
x - 0.5
(FPCore (x) :precision binary64 (* (sqrt (- x 1.0)) (sqrt x)))
(FPCore (x) :precision binary64 (- x 0.5))
double code(double x) {
	return sqrt(x - 1.0) * sqrt(x);
}
double code(double x) {
	return x - 0.5;
}

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. Taylor expanded in x around inf 0.6

    \[\leadsto \color{blue}{x - 0.5} \]
  3. Final simplification0.6

    \[\leadsto x - 0.5 \]

Reproduce

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