Average Error: 27.9 → 27.9
Time: 2.7s
Precision: binary64
\[{\left(x + h\right)}^{3} - {x}^{3}\]
\[{\left(x + h\right)}^{3} - {x}^{3}\]
{\left(x + h\right)}^{3} - {x}^{3}
{\left(x + h\right)}^{3} - {x}^{3}
double code(double x, double h) {
	return ((double) (((double) pow(((double) (x + h)), 3.0)) - ((double) pow(x, 3.0))));
}
double code(double x, double h) {
	return ((double) (((double) pow(((double) (x + h)), 3.0)) - ((double) pow(x, 3.0))));
}

Error

Bits error versus x

Bits error versus h

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 27.9

    \[{\left(x + h\right)}^{3} - {x}^{3}\]
  2. Final simplification27.9

    \[\leadsto {\left(x + h\right)}^{3} - {x}^{3}\]

Reproduce

herbie shell --seed 2020153 
(FPCore (x h)
  :name "(- (pow (+ x h) 3) (pow x 3))"
  :precision binary64
  (- (pow (+ x h) 3.0) (pow x 3.0)))