Average Error: 38.6 → 0.0
Time: 9.3s
Precision: 64
Internal Precision: 128
\[\left(x + 1\right) \cdot \left(x + 1\right) - 1\]
\[\begin{array}{l} \mathbf{if}\;x \le -20.173869961621886 \lor \neg \left(x \le 0.0001947752890307351\right):\\ \;\;\;\;\sqrt{\left(2 + x\right) \cdot x} \cdot \sqrt{\left(2 + x\right) \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left({x}^{3} + 8\right) \cdot x}{\left(x \cdot x - 2 \cdot x\right) + 4}\\ \end{array}\]

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 < -20.173869961621886 or 0.0001947752890307351 < x

    1. Initial program 0.1

      \[\left(x + 1\right) \cdot \left(x + 1\right) - 1\]
    2. Initial simplification0.0

      \[\leadsto \left(2 + x\right) \cdot x\]
    3. Using strategy rm
    4. Applied add-sqr-sqrt0.0

      \[\leadsto \color{blue}{\sqrt{\left(2 + x\right) \cdot x} \cdot \sqrt{\left(2 + x\right) \cdot x}}\]

    if -20.173869961621886 < x < 0.0001947752890307351

    1. Initial program 58.8

      \[\left(x + 1\right) \cdot \left(x + 1\right) - 1\]
    2. Initial simplification0.0

      \[\leadsto \left(2 + x\right) \cdot x\]
    3. Using strategy rm
    4. Applied flip3-+0.0

      \[\leadsto \color{blue}{\frac{{2}^{3} + {x}^{3}}{2 \cdot 2 + \left(x \cdot x - 2 \cdot x\right)}} \cdot x\]
    5. Applied associate-*l/0.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -20.173869961621886 \lor \neg \left(x \le 0.0001947752890307351\right):\\ \;\;\;\;\sqrt{\left(2 + x\right) \cdot x} \cdot \sqrt{\left(2 + x\right) \cdot x}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left({x}^{3} + 8\right) \cdot x}{\left(x \cdot x - 2 \cdot x\right) + 4}\\ \end{array}\]

Runtime

Time bar (total: 9.3s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes10.10.00.010.199.9%
herbie shell --seed 2018353 +o rules:numerics
(FPCore (x)
  :name "Expanding a square"
  (- (* (+ x 1) (+ x 1)) 1))