Average Error: 39.7 → 11.5
Time: 18.5s
Precision: 64
$\frac{\sqrt{x - 1}}{x + 1} - \frac{\sqrt{x + 1}}{x - 1}$
$\frac{-\left(\left(\frac{14}{{x}^{4}} + \frac{22}{{x}^{6}}\right) + \frac{6}{x \cdot x}\right)}{\frac{\sqrt{x - 1}}{x + 1} + \frac{\sqrt{x + 1}}{x - 1}}$
\frac{\sqrt{x - 1}}{x + 1} - \frac{\sqrt{x + 1}}{x - 1}
\frac{-\left(\left(\frac{14}{{x}^{4}} + \frac{22}{{x}^{6}}\right) + \frac{6}{x \cdot x}\right)}{\frac{\sqrt{x - 1}}{x + 1} + \frac{\sqrt{x + 1}}{x - 1}}
double f(double x) {
double r57087 = x;
double r57088 = 1.0;
double r57089 = r57087 - r57088;
double r57090 = sqrt(r57089);
double r57091 = r57087 + r57088;
double r57092 = r57090 / r57091;
double r57093 = sqrt(r57091);
double r57094 = r57093 / r57089;
double r57095 = r57092 - r57094;
return r57095;
}


double f(double x) {
double r57096 = 14.0;
double r57097 = x;
double r57098 = 4.0;
double r57099 = pow(r57097, r57098);
double r57100 = r57096 / r57099;
double r57101 = 22.0;
double r57102 = 6.0;
double r57103 = pow(r57097, r57102);
double r57104 = r57101 / r57103;
double r57105 = r57100 + r57104;
double r57106 = 6.0;
double r57107 = r57097 * r57097;
double r57108 = r57106 / r57107;
double r57109 = r57105 + r57108;
double r57110 = -r57109;
double r57111 = 1.0;
double r57112 = r57097 - r57111;
double r57113 = sqrt(r57112);
double r57114 = r57097 + r57111;
double r57115 = r57113 / r57114;
double r57116 = sqrt(r57114);
double r57117 = r57116 / r57112;
double r57118 = r57115 + r57117;
double r57119 = r57110 / r57118;
return r57119;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 39.7

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

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

$\leadsto \frac{\color{blue}{\frac{x - 1}{\left(x + 1\right) \cdot \left(x + 1\right)} - \frac{x + 1}{\left(x - 1\right) \cdot \left(x - 1\right)}}}{\frac{\sqrt{x - 1}}{x + 1} + \frac{\sqrt{x + 1}}{x - 1}}$
5. Taylor expanded around inf 11.5

$\leadsto \frac{\color{blue}{-\left(6 \cdot \frac{1}{{x}^{2}} + \left(14 \cdot \frac{1}{{x}^{4}} + 22 \cdot \frac{1}{{x}^{6}}\right)\right)}}{\frac{\sqrt{x - 1}}{x + 1} + \frac{\sqrt{x + 1}}{x - 1}}$
6. Simplified11.5

$\leadsto \frac{\color{blue}{-\left(\left(\frac{14}{{x}^{4}} + \frac{22}{{x}^{6}}\right) + \frac{6}{x \cdot x}\right)}}{\frac{\sqrt{x - 1}}{x + 1} + \frac{\sqrt{x + 1}}{x - 1}}$
7. Final simplification11.5

$\leadsto \frac{-\left(\left(\frac{14}{{x}^{4}} + \frac{22}{{x}^{6}}\right) + \frac{6}{x \cdot x}\right)}{\frac{\sqrt{x - 1}}{x + 1} + \frac{\sqrt{x + 1}}{x - 1}}$

# Reproduce

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