Average Error: 59.6 → 0.3
Time: 13.4s
Precision: 64
$\sqrt{x + 1} - \sqrt{x - 1}$
$\frac{1 + 1}{\sqrt{x + 1} + \sqrt{x - 1}}$
\sqrt{x + 1} - \sqrt{x - 1}
\frac{1 + 1}{\sqrt{x + 1} + \sqrt{x - 1}}
double f(double x) {
double r2087755 = x;
double r2087756 = 1.0;
double r2087757 = r2087755 + r2087756;
double r2087758 = sqrt(r2087757);
double r2087759 = r2087755 - r2087756;
double r2087760 = sqrt(r2087759);
double r2087761 = r2087758 - r2087760;
return r2087761;
}


double f(double x) {
double r2087762 = 1.0;
double r2087763 = r2087762 + r2087762;
double r2087764 = x;
double r2087765 = r2087764 + r2087762;
double r2087766 = sqrt(r2087765);
double r2087767 = r2087764 - r2087762;
double r2087768 = sqrt(r2087767);
double r2087769 = r2087766 + r2087768;
double r2087770 = r2087763 / r2087769;
return r2087770;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 59.6

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

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

$\leadsto \frac{\color{blue}{1 + \left(0 + 1\right)}}{\sqrt{x + 1} + \sqrt{x - 1}}$
5. Final simplification0.3

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

# Reproduce

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