Average Error: 0.2 → 0.1
Time: 1.3s
Precision: binary64
\[\left(\left(\left(1 + 0.278393 \cdot x\right) + 0.23038900000000001 \cdot \left(x \cdot x\right)\right) + 9.7199999999999999 \cdot 10^{-4} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right) + 0.0781079999999999969 \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)\]
\[\left({x}^{3} \cdot \left(x \cdot 0.0781079999999999969 + 9.7199999999999999 \cdot 10^{-4}\right) + 1\right) + x \cdot \left(0.278393 + 0.23038900000000001 \cdot x\right)\]
\left(\left(\left(1 + 0.278393 \cdot x\right) + 0.23038900000000001 \cdot \left(x \cdot x\right)\right) + 9.7199999999999999 \cdot 10^{-4} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right) + 0.0781079999999999969 \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)
\left({x}^{3} \cdot \left(x \cdot 0.0781079999999999969 + 9.7199999999999999 \cdot 10^{-4}\right) + 1\right) + x \cdot \left(0.278393 + 0.23038900000000001 \cdot x\right)
double code(double x) {
	return ((double) (((double) (((double) (((double) (1.0 + ((double) (0.278393 * x)))) + ((double) (0.230389 * ((double) (x * x)))))) + ((double) (0.000972 * ((double) (((double) (x * x)) * x)))))) + ((double) (0.078108 * ((double) (((double) (x * x)) * ((double) (x * x))))))));
}
double code(double x) {
	return ((double) (((double) (((double) (((double) pow(x, 3.0)) * ((double) (((double) (x * 0.078108)) + 0.000972)))) + 1.0)) + ((double) (x * ((double) (0.278393 + ((double) (0.230389 * x))))))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.2

    \[\left(\left(\left(1 + 0.278393 \cdot x\right) + 0.23038900000000001 \cdot \left(x \cdot x\right)\right) + 9.7199999999999999 \cdot 10^{-4} \cdot \left(\left(x \cdot x\right) \cdot x\right)\right) + 0.0781079999999999969 \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right)\]
  2. Simplified0.1

    \[\leadsto \color{blue}{\left({x}^{3} \cdot \left(x \cdot 0.0781079999999999969 + 9.7199999999999999 \cdot 10^{-4}\right) + 1\right) + x \cdot \left(0.278393 + 0.23038900000000001 \cdot x\right)}\]
  3. Final simplification0.1

    \[\leadsto \left({x}^{3} \cdot \left(x \cdot 0.0781079999999999969 + 9.7199999999999999 \cdot 10^{-4}\right) + 1\right) + x \cdot \left(0.278393 + 0.23038900000000001 \cdot x\right)\]

Reproduce

herbie shell --seed 2020153 
(FPCore (x)
  :name "(+ (+ (+ (+ 1.0 (* 0.278393 x)) (* 0.230389 (* x x))) (* 0.000972 (* (* x x) x))) (* 0.078108 (* (* x x) (* x x))))"
  :precision binary64
  (+ (+ (+ (+ 1.0 (* 0.278393 x)) (* 0.230389 (* x x))) (* 0.000972 (* (* x x) x))) (* 0.078108 (* (* x x) (* x x)))))