Average Error: 5.4 → 5.4
Time: 1.3s
Precision: binary64
\[r \cdot x - r \cdot {x}^{2}\]
\[r \cdot \left(x - {x}^{2}\right)\]
r \cdot x - r \cdot {x}^{2}
r \cdot \left(x - {x}^{2}\right)
double code(double r, double x) {
	return ((double) (((double) (r * x)) - ((double) (r * ((double) pow(x, 2.0))))));
}
double code(double r, double x) {
	return ((double) (r * ((double) (x - ((double) pow(x, 2.0))))));
}

Error

Bits error versus r

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 5.4

    \[r \cdot x - r \cdot {x}^{2}\]
  2. Simplified5.4

    \[\leadsto \color{blue}{r \cdot \left(x - {x}^{2}\right)}\]
  3. Final simplification5.4

    \[\leadsto r \cdot \left(x - {x}^{2}\right)\]

Reproduce

herbie shell --seed 2020152 
(FPCore (r x)
  :name "(- (* r x) (* r (pow x 2)))"
  :precision binary64
  (- (* r x) (* r (pow x 2.0))))