Average Error: 58.8 → 0.2
Time: 15.6s
Precision: 64
$\log \left(x + 1\right) - \log \left(x - 1\right)$
$\frac{0.4000000000000000222044604925031308084726}{{x}^{5}} + \left(\frac{2}{x} + \frac{0.6666666666666666296592325124947819858789}{x \cdot \left(x \cdot x\right)}\right)$
\log \left(x + 1\right) - \log \left(x - 1\right)
\frac{0.4000000000000000222044604925031308084726}{{x}^{5}} + \left(\frac{2}{x} + \frac{0.6666666666666666296592325124947819858789}{x \cdot \left(x \cdot x\right)}\right)
double f(double x) {
double r37254665 = x;
double r37254666 = 1.0;
double r37254667 = r37254665 + r37254666;
double r37254668 = log(r37254667);
double r37254669 = r37254665 - r37254666;
double r37254670 = log(r37254669);
double r37254671 = r37254668 - r37254670;
return r37254671;
}


double f(double x) {
double r37254672 = 0.4;
double r37254673 = x;
double r37254674 = 5.0;
double r37254675 = pow(r37254673, r37254674);
double r37254676 = r37254672 / r37254675;
double r37254677 = 2.0;
double r37254678 = r37254677 / r37254673;
double r37254679 = 0.6666666666666666;
double r37254680 = r37254673 * r37254673;
double r37254681 = r37254673 * r37254680;
double r37254682 = r37254679 / r37254681;
double r37254683 = r37254678 + r37254682;
double r37254684 = r37254676 + r37254683;
return r37254684;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 58.8

$\log \left(x + 1\right) - \log \left(x - 1\right)$
2. Taylor expanded around inf 0.2

$\leadsto \color{blue}{0.4000000000000000222044604925031308084726 \cdot \frac{1}{{x}^{5}} + \left(2 \cdot \frac{1}{x} + 0.6666666666666666296592325124947819858789 \cdot \frac{1}{{x}^{3}}\right)}$
3. Simplified0.2

$\leadsto \color{blue}{\left(\frac{2}{x} + \frac{0.6666666666666666296592325124947819858789}{x \cdot \left(x \cdot x\right)}\right) + \frac{0.4000000000000000222044604925031308084726}{{x}^{5}}}$
4. Final simplification0.2

$\leadsto \frac{0.4000000000000000222044604925031308084726}{{x}^{5}} + \left(\frac{2}{x} + \frac{0.6666666666666666296592325124947819858789}{x \cdot \left(x \cdot x\right)}\right)$

# Reproduce

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