Average Error: 39.1 → 11.5
Time: 37.1s
Precision: 64
$\sin x \gt 0.0$
$\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 r92017 = x;
double r92018 = 1.0;
double r92019 = r92017 - r92018;
double r92020 = sqrt(r92019);
double r92021 = r92017 + r92018;
double r92022 = r92020 / r92021;
double r92023 = sqrt(r92021);
double r92024 = r92023 / r92019;
double r92025 = r92022 - r92024;
return r92025;
}


double f(double x) {
double r92026 = 14.0;
double r92027 = x;
double r92028 = 4.0;
double r92029 = pow(r92027, r92028);
double r92030 = r92026 / r92029;
double r92031 = 22.0;
double r92032 = 6.0;
double r92033 = pow(r92027, r92032);
double r92034 = r92031 / r92033;
double r92035 = r92030 + r92034;
double r92036 = 6.0;
double r92037 = r92027 * r92027;
double r92038 = r92036 / r92037;
double r92039 = r92035 + r92038;
double r92040 = -r92039;
double r92041 = 1.0;
double r92042 = r92027 - r92041;
double r92043 = sqrt(r92042);
double r92044 = r92027 + r92041;
double r92045 = r92043 / r92044;
double r92046 = sqrt(r92044);
double r92047 = r92046 / r92042;
double r92048 = r92045 + r92047;
double r92049 = r92040 / r92048;
return r92049;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 39.1

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

$\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.1

$\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.6

$\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
:pre (> (sin x) 0.0)
(- (/ (sqrt (- x 1)) (+ x 1)) (/ (sqrt (+ x 1)) (- x 1))))