Average Error: 18.4 → 0.0
Time: 859.0ms
Precision: binary64
\[\frac{\frac{1}{2} \cdot \left(y_i \cdot y_i + x\right)}{y_i}\]
\[\frac{1}{2} \cdot \left(\frac{x}{y_i} + y_i\right)\]
\frac{\frac{1}{2} \cdot \left(y_i \cdot y_i + x\right)}{y_i}
\frac{1}{2} \cdot \left(\frac{x}{y_i} + y_i\right)
double code(double y_i, double x) {
	return ((double) (((double) (((double) (1.0 / 2.0)) * ((double) (((double) (y_i * y_i)) + x)))) / y_i));
}
double code(double y_i, double x) {
	return ((double) (((double) (1.0 / 2.0)) * ((double) (((double) (x / y_i)) + y_i))));
}

Error

Bits error versus y_i

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 18.4

    \[\frac{\frac{1}{2} \cdot \left(y_i \cdot y_i + x\right)}{y_i}\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(\frac{x}{y_i} + y_i\right)}\]
  3. Final simplification0.0

    \[\leadsto \frac{1}{2} \cdot \left(\frac{x}{y_i} + y_i\right)\]

Reproduce

herbie shell --seed 2020152 
(FPCore (y_i x)
  :name "(/ (* (/ 1 2) (+ (* y_i y_i) x)) y_i)"
  :precision binary64
  (/ (* (/ 1.0 2.0) (+ (* y_i y_i) x)) y_i))