Average Error: 15.1 → 0.4
Time: 4.2s
Precision: binary64
\[\frac{1}{x + 1} - \frac{1}{x - 1} \]
\[\frac{1}{x \cdot x - 1} \cdot -2 \]
\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{1}{x \cdot x - 1} \cdot -2
(FPCore (x) :precision binary64 (- (/ 1.0 (+ x 1.0)) (/ 1.0 (- x 1.0))))
(FPCore (x) :precision binary64 (* (/ 1.0 (- (* x x) 1.0)) -2.0))
double code(double x) {
	return (1.0 / (x + 1.0)) - (1.0 / (x - 1.0));
}
double code(double x) {
	return (1.0 / ((x * x) - 1.0)) * -2.0;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.1

    \[\frac{1}{x + 1} - \frac{1}{x - 1} \]
  2. Applied flip--_binary6429.7

    \[\leadsto \frac{1}{x + 1} - \frac{1}{\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x + 1}}} \]
  3. Applied associate-/r/_binary6429.7

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

    \[\leadsto \frac{1}{\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x - 1}}} - \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(x + 1\right) \]
  5. Applied associate-/r/_binary6415.1

    \[\leadsto \color{blue}{\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(x - 1\right)} - \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(x + 1\right) \]
  6. Applied distribute-lft-out--_binary6414.5

    \[\leadsto \color{blue}{\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\left(x - 1\right) - \left(x + 1\right)\right)} \]
  7. Applied *-un-lft-identity_binary6414.5

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\left(x - 1\right) - \color{blue}{1 \cdot \left(x + 1\right)}\right) \]
  8. Applied *-un-lft-identity_binary6414.5

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\color{blue}{1 \cdot \left(x - 1\right)} - 1 \cdot \left(x + 1\right)\right) \]
  9. Applied distribute-lft-out--_binary6414.5

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

    \[\leadsto \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(1 \cdot \color{blue}{-2}\right) \]
  11. Final simplification0.4

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

Reproduce

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