Average Error: 14.7 → 0.3
Time: 56.7s
Precision: 64
Internal Precision: 128
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\begin{array}{l} \mathbf{if}\;x \le -3007.1899192354817 \lor \neg \left(x \le 19.571058406726895\right):\\ \;\;\;\;{\left(\sqrt{(x \cdot x + -1)_*}\right)}^{-2} \cdot -2\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\left(\frac{1}{(x \cdot x + -1)_*} \cdot \frac{1}{(x \cdot x + -1)_*}\right) \cdot \frac{1}{(x \cdot x + -1)_*}} \cdot -2\\ \end{array}\]

Error

Bits error versus x

Derivation

  1. Split input into 2 regimes
  2. if x < -3007.1899192354817 or 19.571058406726895 < x

    1. Initial program 29.6

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

      \[\leadsto \frac{1}{x + 1} - \frac{1}{\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x + 1}}}\]
    4. Applied associate-/r/58.6

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

      \[\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)\]
    6. Applied associate-/r/29.6

      \[\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)\]
    7. Applied distribute-lft-out--28.4

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

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

      \[\leadsto \frac{1}{(x \cdot x + -1)_*} \cdot \color{blue}{-2}\]
    10. Using strategy rm
    11. Applied add-sqr-sqrt0.8

      \[\leadsto \frac{1}{\color{blue}{\sqrt{(x \cdot x + -1)_*} \cdot \sqrt{(x \cdot x + -1)_*}}} \cdot -2\]
    12. Applied associate-/r*0.8

      \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{(x \cdot x + -1)_*}}}{\sqrt{(x \cdot x + -1)_*}}} \cdot -2\]
    13. Using strategy rm
    14. Applied pow10.8

      \[\leadsto \frac{\frac{1}{\sqrt{(x \cdot x + -1)_*}}}{\color{blue}{{\left(\sqrt{(x \cdot x + -1)_*}\right)}^{1}}} \cdot -2\]
    15. Applied inv-pow0.8

      \[\leadsto \frac{\color{blue}{{\left(\sqrt{(x \cdot x + -1)_*}\right)}^{-1}}}{{\left(\sqrt{(x \cdot x + -1)_*}\right)}^{1}} \cdot -2\]
    16. Applied pow-div0.7

      \[\leadsto \color{blue}{{\left(\sqrt{(x \cdot x + -1)_*}\right)}^{\left(-1 - 1\right)}} \cdot -2\]
    17. Simplified0.7

      \[\leadsto {\left(\sqrt{(x \cdot x + -1)_*}\right)}^{\color{blue}{-2}} \cdot -2\]

    if -3007.1899192354817 < x < 19.571058406726895

    1. Initial program 0.0

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

      \[\leadsto \frac{1}{x + 1} - \frac{1}{\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x + 1}}}\]
    4. Applied associate-/r/0.0

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

      \[\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)\]
    6. Applied associate-/r/0.0

      \[\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)\]
    7. Applied distribute-lft-out--0.0

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

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

      \[\leadsto \frac{1}{(x \cdot x + -1)_*} \cdot \color{blue}{-2}\]
    10. Using strategy rm
    11. Applied add-cbrt-cube0.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -3007.1899192354817 \lor \neg \left(x \le 19.571058406726895\right):\\ \;\;\;\;{\left(\sqrt{(x \cdot x + -1)_*}\right)}^{-2} \cdot -2\\ \mathbf{else}:\\ \;\;\;\;\sqrt[3]{\left(\frac{1}{(x \cdot x + -1)_*} \cdot \frac{1}{(x \cdot x + -1)_*}\right) \cdot \frac{1}{(x \cdot x + -1)_*}} \cdot -2\\ \end{array}\]

Runtime

Time bar (total: 56.7s)Debug logProfile

herbie shell --seed 2018258 +o rules:numerics
(FPCore (x)
  :name "Asymptote A"
  (- (/ 1 (+ x 1)) (/ 1 (- x 1))))