Average Error: 40.2 → 40.2
Time: 2.2s
Precision: binary64
\[\frac{\sqrt{x + h} - \sqrt{x}}{h}\]
\[\frac{\sqrt{x + h} - \sqrt{x}}{h}\]
\frac{\sqrt{x + h} - \sqrt{x}}{h}
\frac{\sqrt{x + h} - \sqrt{x}}{h}
double code(double x, double h) {
	return ((double) (((double) (((double) sqrt(((double) (x + h)))) - ((double) sqrt(x)))) / h));
}
double code(double x, double h) {
	return ((double) (((double) (((double) sqrt(((double) (x + h)))) - ((double) sqrt(x)))) / h));
}

Error

Bits error versus x

Bits error versus h

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 40.2

    \[\frac{\sqrt{x + h} - \sqrt{x}}{h}\]
  2. Final simplification40.2

    \[\leadsto \frac{\sqrt{x + h} - \sqrt{x}}{h}\]

Reproduce

herbie shell --seed 2020152 
(FPCore (x h)
  :name "(/ (- (sqrt (+ x h)) (sqrt x)) h)"
  :precision binary64
  (/ (- (sqrt (+ x h)) (sqrt x)) h))