Average Error: 0.2 → 0.2
Time: 1.2s
Precision: binary64
\[y + \left(y \cdot 0.5\right) \cdot \left(1 - \left(x \cdot y\right) \cdot y\right)\]
\[y + \left(y \cdot 0.5\right) \cdot \left(1 - \left(x \cdot y\right) \cdot y\right)\]
y + \left(y \cdot 0.5\right) \cdot \left(1 - \left(x \cdot y\right) \cdot y\right)
y + \left(y \cdot 0.5\right) \cdot \left(1 - \left(x \cdot y\right) \cdot y\right)
double code(double y, double x) {
	return ((double) (y + ((double) (((double) (y * 0.5)) * ((double) (1.0 - ((double) (((double) (x * y)) * y))))))));
}
double code(double y, double x) {
	return ((double) (y + ((double) (((double) (y * 0.5)) * ((double) (1.0 - ((double) (((double) (x * y)) * y))))))));
}

Error

Bits error versus y

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.2

    \[y + \left(y \cdot 0.5\right) \cdot \left(1 - \left(x \cdot y\right) \cdot y\right)\]
  2. Final simplification0.2

    \[\leadsto y + \left(y \cdot 0.5\right) \cdot \left(1 - \left(x \cdot y\right) \cdot y\right)\]

Reproduce

herbie shell --seed 2020152 
(FPCore (y x)
  :name "(+ y (* (* y 0.5) (- 1 (* (* x y) y))))"
  :precision binary64
  (+ y (* (* y 0.5) (- 1.0 (* (* x y) y)))))