Average Error: 14.5 → 0.0
Time: 3.2s
Precision: 64
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\begin{array}{l} \mathbf{if}\;x \le -207.49900421996719 \lor \neg \left(x \le 190.79256050286557\right):\\ \;\;\;\;-\left(2 \cdot \frac{1}{{x}^{6}} + \left(2 \cdot {x}^{\left(-2\right)} + 2 \cdot \frac{1}{{x}^{4}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{{x}^{3} + {1}^{3}} \cdot \left(x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)\right) - \frac{1}{x - 1}\\ \end{array}\]
\frac{1}{x + 1} - \frac{1}{x - 1}
\begin{array}{l}
\mathbf{if}\;x \le -207.49900421996719 \lor \neg \left(x \le 190.79256050286557\right):\\
\;\;\;\;-\left(2 \cdot \frac{1}{{x}^{6}} + \left(2 \cdot {x}^{\left(-2\right)} + 2 \cdot \frac{1}{{x}^{4}}\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{1}{{x}^{3} + {1}^{3}} \cdot \left(x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)\right) - \frac{1}{x - 1}\\

\end{array}
double code(double x) {
	return ((1.0 / (x + 1.0)) - (1.0 / (x - 1.0)));
}
double code(double x) {
	double VAR;
	if (((x <= -207.4990042199672) || !(x <= 190.79256050286557))) {
		VAR = -((2.0 * (1.0 / pow(x, 6.0))) + ((2.0 * pow(x, -2.0)) + (2.0 * (1.0 / pow(x, 4.0)))));
	} else {
		VAR = (((1.0 / (pow(x, 3.0) + pow(1.0, 3.0))) * ((x * x) + ((1.0 * 1.0) - (x * 1.0)))) - (1.0 / (x - 1.0)));
	}
	return VAR;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if x < -207.4990042199672 or 190.79256050286557 < x

    1. Initial program 28.9

      \[\frac{1}{x + 1} - \frac{1}{x - 1}\]
    2. Using strategy rm
    3. Applied flip3-+60.8

      \[\leadsto \frac{1}{\color{blue}{\frac{{x}^{3} + {1}^{3}}{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)}}} - \frac{1}{x - 1}\]
    4. Applied associate-/r/60.8

      \[\leadsto \color{blue}{\frac{1}{{x}^{3} + {1}^{3}} \cdot \left(x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)\right)} - \frac{1}{x - 1}\]
    5. Taylor expanded around inf 0.9

      \[\leadsto \color{blue}{-\left(2 \cdot \frac{1}{{x}^{6}} + \left(2 \cdot \frac{1}{{x}^{2}} + 2 \cdot \frac{1}{{x}^{4}}\right)\right)}\]
    6. Using strategy rm
    7. Applied pow-flip0.0

      \[\leadsto -\left(2 \cdot \frac{1}{{x}^{6}} + \left(2 \cdot \color{blue}{{x}^{\left(-2\right)}} + 2 \cdot \frac{1}{{x}^{4}}\right)\right)\]

    if -207.4990042199672 < x < 190.79256050286557

    1. Initial program 0.0

      \[\frac{1}{x + 1} - \frac{1}{x - 1}\]
    2. Using strategy rm
    3. Applied flip3-+0.0

      \[\leadsto \frac{1}{\color{blue}{\frac{{x}^{3} + {1}^{3}}{x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)}}} - \frac{1}{x - 1}\]
    4. Applied associate-/r/0.0

      \[\leadsto \color{blue}{\frac{1}{{x}^{3} + {1}^{3}} \cdot \left(x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)\right)} - \frac{1}{x - 1}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -207.49900421996719 \lor \neg \left(x \le 190.79256050286557\right):\\ \;\;\;\;-\left(2 \cdot \frac{1}{{x}^{6}} + \left(2 \cdot {x}^{\left(-2\right)} + 2 \cdot \frac{1}{{x}^{4}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{{x}^{3} + {1}^{3}} \cdot \left(x \cdot x + \left(1 \cdot 1 - x \cdot 1\right)\right) - \frac{1}{x - 1}\\ \end{array}\]

Reproduce

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