\[{\left(x + 1\right)}^2 - 1\]
Test:
Expanding a square
Bits:
128 bits
Bits error versus x
Time: 2.7 s
Input Error: 39.0
Output Error: 0.0
Log:
Profile: 🕒
\({x}^2 + x \cdot 2\)
  1. Started with
    \[{\left(x + 1\right)}^2 - 1\]
    39.0
  2. Applied taylor to get
    \[{\left(x + 1\right)}^2 - 1 \leadsto {x}^2 + 2 \cdot x\]
    0.0
  3. Taylor expanded around 0 to get
    \[\color{red}{{x}^2 + 2 \cdot x} \leadsto \color{blue}{{x}^2 + 2 \cdot x}\]
    0.0
  4. Applied simplify to get
    \[\color{red}{{x}^2 + 2 \cdot x} \leadsto \color{blue}{x \cdot \left(x + 2\right)}\]
    0.0
  5. Using strategy rm
    0.0
  6. Applied distribute-lft-in to get
    \[\color{red}{x \cdot \left(x + 2\right)} \leadsto \color{blue}{x \cdot x + x \cdot 2}\]
    0.0
  7. Applied simplify to get
    \[\color{red}{x \cdot x} + x \cdot 2 \leadsto \color{blue}{{x}^2} + x \cdot 2\]
    0.0

Original test:


(lambda ((x default))
  #:name "Expanding a square"
  (- (sqr (+ x 1)) 1))