Average Error: 30.4 → 0.3
Time: 11.4s
Precision: 64
$\sqrt{x + 1} - \sqrt{x}$
$\frac{1}{\sqrt{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}} \cdot \sqrt{\sqrt[3]{1 + x}} + \sqrt{x}}$
\sqrt{x + 1} - \sqrt{x}
\frac{1}{\sqrt{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}} \cdot \sqrt{\sqrt[3]{1 + x}} + \sqrt{x}}
double f(double x) {
double r168186 = x;
double r168187 = 1.0;
double r168188 = r168186 + r168187;
double r168189 = sqrt(r168188);
double r168190 = sqrt(r168186);
double r168191 = r168189 - r168190;
return r168191;
}


double f(double x) {
double r168192 = 1.0;
double r168193 = x;
double r168194 = r168192 + r168193;
double r168195 = cbrt(r168194);
double r168196 = r168195 * r168195;
double r168197 = sqrt(r168196);
double r168198 = sqrt(r168195);
double r168199 = r168197 * r168198;
double r168200 = sqrt(r168193);
double r168201 = r168199 + r168200;
double r168202 = r168192 / r168201;
return r168202;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 30.4

$\sqrt{x + 1} - \sqrt{x}$
2. Using strategy rm
3. Applied flip--30.2

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

$\leadsto \frac{\color{blue}{1}}{\sqrt{x + 1} + \sqrt{x}}$
5. Using strategy rm

$\leadsto \frac{1}{\sqrt{\color{blue}{\left(\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}\right) \cdot \sqrt[3]{x + 1}}} + \sqrt{x}}$
7. Applied sqrt-prod0.3

$\leadsto \frac{1}{\color{blue}{\sqrt{\sqrt[3]{x + 1} \cdot \sqrt[3]{x + 1}} \cdot \sqrt{\sqrt[3]{x + 1}}} + \sqrt{x}}$
8. Final simplification0.3

$\leadsto \frac{1}{\sqrt{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}} \cdot \sqrt{\sqrt[3]{1 + x}} + \sqrt{x}}$

# Reproduce

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