Average Error: 38.8 → 0.0
Time: 10.5s
Precision: 64
\[\left(x + 1\right) \cdot \left(x + 1\right) - 1\]
\[\left(4 - x \cdot x\right) \cdot \frac{x}{2 - x}\]
\left(x + 1\right) \cdot \left(x + 1\right) - 1
\left(4 - x \cdot x\right) \cdot \frac{x}{2 - x}
double f(double x) {
        double r660483 = x;
        double r660484 = 1.0;
        double r660485 = r660483 + r660484;
        double r660486 = r660485 * r660485;
        double r660487 = r660486 - r660484;
        return r660487;
}

double f(double x) {
        double r660488 = 4.0;
        double r660489 = x;
        double r660490 = r660489 * r660489;
        double r660491 = r660488 - r660490;
        double r660492 = 2.0;
        double r660493 = r660492 - r660489;
        double r660494 = r660489 / r660493;
        double r660495 = r660491 * r660494;
        return r660495;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 38.8

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

    \[\leadsto \color{blue}{\left(2 + x\right) \cdot x}\]
  3. Using strategy rm
  4. Applied flip-+0.0

    \[\leadsto \color{blue}{\frac{2 \cdot 2 - x \cdot x}{2 - x}} \cdot x\]
  5. Applied associate-*l/6.6

    \[\leadsto \color{blue}{\frac{\left(2 \cdot 2 - x \cdot x\right) \cdot x}{2 - x}}\]
  6. Simplified6.6

    \[\leadsto \frac{\color{blue}{\left(4 - x \cdot x\right) \cdot x}}{2 - x}\]
  7. Using strategy rm
  8. Applied *-un-lft-identity6.6

    \[\leadsto \frac{\left(4 - x \cdot x\right) \cdot x}{2 - \color{blue}{1 \cdot x}}\]
  9. Applied *-un-lft-identity6.6

    \[\leadsto \frac{\left(4 - x \cdot x\right) \cdot x}{\color{blue}{1 \cdot 2} - 1 \cdot x}\]
  10. Applied distribute-lft-out--6.6

    \[\leadsto \frac{\left(4 - x \cdot x\right) \cdot x}{\color{blue}{1 \cdot \left(2 - x\right)}}\]
  11. Applied times-frac0.0

    \[\leadsto \color{blue}{\frac{4 - x \cdot x}{1} \cdot \frac{x}{2 - x}}\]
  12. Simplified0.0

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

    \[\leadsto \left(4 - x \cdot x\right) \cdot \frac{x}{2 - x}\]

Reproduce

herbie shell --seed 2019135 
(FPCore (x)
  :name "Expanding a square"
  (- (* (+ x 1) (+ x 1)) 1))