Average Error: 29.3 → 0.1
Time: 13.8min
Precision: binary64
\[\frac{x}{x + 1} - \frac{x + 1}{x - 1}\]
\[1 \cdot \frac{\frac{-2 \cdot x}{x + 1} - 1}{x - 1}\]
\frac{x}{x + 1} - \frac{x + 1}{x - 1}
1 \cdot \frac{\frac{-2 \cdot x}{x + 1} - 1}{x - 1}
double code(double x) {
	return ((double) ((x / ((double) (x + 1.0))) - (((double) (x + 1.0)) / ((double) (x - 1.0)))));
}
double code(double x) {
	return ((double) (1.0 * (((double) ((((double) (-2.0 * x)) / ((double) (x + 1.0))) - 1.0)) / ((double) (x - 1.0)))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 29.3

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

    \[\leadsto \color{blue}{\frac{x \cdot \left(x - 1\right) - \left(x + 1\right) \cdot \left(x + 1\right)}{\left(x + 1\right) \cdot \left(x - 1\right)}}\]
  4. Simplified15.1

    \[\leadsto \frac{\color{blue}{1 \cdot \left(\left(-x\right) - \left(x + \left(x + 1\right)\right)\right)}}{\left(x + 1\right) \cdot \left(x - 1\right)}\]
  5. Simplified15.1

    \[\leadsto \frac{1 \cdot \left(\left(-x\right) - \left(x + \left(x + 1\right)\right)\right)}{\color{blue}{x \cdot x - 1 \cdot 1}}\]
  6. Using strategy rm
  7. Applied *-un-lft-identity15.1

    \[\leadsto \frac{1 \cdot \left(\left(-x\right) - \left(x + \left(x + 1\right)\right)\right)}{\color{blue}{1 \cdot \left(x \cdot x - 1 \cdot 1\right)}}\]
  8. Applied times-frac15.1

    \[\leadsto \color{blue}{\frac{1}{1} \cdot \frac{\left(-x\right) - \left(x + \left(x + 1\right)\right)}{x \cdot x - 1 \cdot 1}}\]
  9. Simplified15.1

    \[\leadsto \color{blue}{1} \cdot \frac{\left(-x\right) - \left(x + \left(x + 1\right)\right)}{x \cdot x - 1 \cdot 1}\]
  10. Simplified0.1

    \[\leadsto 1 \cdot \color{blue}{\frac{\frac{-2 \cdot x}{x + 1} - 1}{x - 1}}\]
  11. Final simplification0.1

    \[\leadsto 1 \cdot \frac{\frac{-2 \cdot x}{x + 1} - 1}{x - 1}\]

Reproduce

herbie shell --seed 2020181 
(FPCore (x)
  :name "Asymptote C"
  :precision binary64
  (- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))))