Average Error: 30.8 → 0.2
Time: 16.8s
Precision: 64
$\frac{\sqrt{x + 0.0001} - \sqrt{x}}{0.0001}$
$\frac{1}{\sqrt{x + 0.0001} + \sqrt{x}}$
\frac{\sqrt{x + 0.0001} - \sqrt{x}}{0.0001}
\frac{1}{\sqrt{x + 0.0001} + \sqrt{x}}
double f(double x) {
double r6013318 = x;
double r6013319 = 0.0001;
double r6013320 = r6013318 + r6013319;
double r6013321 = sqrt(r6013320);
double r6013322 = sqrt(r6013318);
double r6013323 = r6013321 - r6013322;
double r6013324 = r6013323 / r6013319;
return r6013324;
}


double f(double x) {
double r6013325 = 1.0;
double r6013326 = x;
double r6013327 = 0.0001;
double r6013328 = r6013326 + r6013327;
double r6013329 = sqrt(r6013328);
double r6013330 = sqrt(r6013326);
double r6013331 = r6013329 + r6013330;
double r6013332 = r6013325 / r6013331;
return r6013332;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 30.8

$\frac{\sqrt{x + 0.0001} - \sqrt{x}}{0.0001}$
2. Using strategy rm
3. Applied flip--30.8

$\leadsto \frac{\color{blue}{\frac{\sqrt{x + 0.0001} \cdot \sqrt{x + 0.0001} - \sqrt{x} \cdot \sqrt{x}}{\sqrt{x + 0.0001} + \sqrt{x}}}}{0.0001}$
4. Simplified0.2

$\leadsto \frac{\frac{\color{blue}{0.0001 + 0}}{\sqrt{x + 0.0001} + \sqrt{x}}}{0.0001}$
5. Using strategy rm
6. Applied *-un-lft-identity0.2

$\leadsto \frac{\color{blue}{1 \cdot \frac{0.0001 + 0}{\sqrt{x + 0.0001} + \sqrt{x}}}}{0.0001}$
7. Applied associate-/l*0.2

$\leadsto \color{blue}{\frac{1}{\frac{0.0001}{\frac{0.0001 + 0}{\sqrt{x + 0.0001} + \sqrt{x}}}}}$
8. Simplified0.2

$\leadsto \frac{1}{\color{blue}{\sqrt{x} + \sqrt{0.0001 + x}}}$
9. Final simplification0.2

$\leadsto \frac{1}{\sqrt{x + 0.0001} + \sqrt{x}}$

# Reproduce

herbie shell --seed 1
(FPCore (x)
:name "(sqrt(x+0.0001)-sqrt(x))/0.0001"
(/ (- (sqrt (+ x 0.0001)) (sqrt x)) 0.0001))