Average Error: 4.4 → 4.4
Time: 1.1s
Precision: binary64
\[\frac{\left(x \cdot x\right) \cdot \left(3 - 2 \cdot x\right)}{y} - \frac{0.5}{y}\]
\[\frac{\left(x \cdot x\right) \cdot \left(3 - 2 \cdot x\right)}{y} - \frac{0.5}{y}\]
\frac{\left(x \cdot x\right) \cdot \left(3 - 2 \cdot x\right)}{y} - \frac{0.5}{y}
\frac{\left(x \cdot x\right) \cdot \left(3 - 2 \cdot x\right)}{y} - \frac{0.5}{y}
double code(double x, double y) {
	return ((double) (((double) (((double) (((double) (x * x)) * ((double) (3.0 - ((double) (2.0 * x)))))) / y)) - ((double) (0.5 / y))));
}
double code(double x, double y) {
	return ((double) (((double) (((double) (((double) (x * x)) * ((double) (3.0 - ((double) (2.0 * x)))))) / y)) - ((double) (0.5 / y))));
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 4.4

    \[\frac{\left(x \cdot x\right) \cdot \left(3 - 2 \cdot x\right)}{y} - \frac{0.5}{y}\]
  2. Final simplification4.4

    \[\leadsto \frac{\left(x \cdot x\right) \cdot \left(3 - 2 \cdot x\right)}{y} - \frac{0.5}{y}\]

Reproduce

herbie shell --seed 2020153 
(FPCore (x y)
  :name "(- (/ (* (* x x) (- 3.0 (* 2.0 x))) y) (/ 0.5 y))"
  :precision binary64
  (- (/ (* (* x x) (- 3.0 (* 2.0 x))) y) (/ 0.5 y)))