Average Error: 26.7 → 26.7
Time: 1.4s
Precision: binary64
\[\frac{2}{x + \sqrt{\left(x \cdot x\right) \cdot \left(1 - y\right) + y}}\]
\[\frac{2}{x + \sqrt{\left(x \cdot x\right) \cdot \left(1 - y\right) + y}}\]
\frac{2}{x + \sqrt{\left(x \cdot x\right) \cdot \left(1 - y\right) + y}}
\frac{2}{x + \sqrt{\left(x \cdot x\right) \cdot \left(1 - y\right) + y}}
double code(double x, double y) {
	return ((double) (2.0 / ((double) (x + ((double) sqrt(((double) (((double) (((double) (x * x)) * ((double) (1.0 - y)))) + y))))))));
}
double code(double x, double y) {
	return ((double) (2.0 / ((double) (x + ((double) sqrt(((double) (((double) (((double) (x * x)) * ((double) (1.0 - y)))) + 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 26.7

    \[\frac{2}{x + \sqrt{\left(x \cdot x\right) \cdot \left(1 - y\right) + y}}\]
  2. Final simplification26.7

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

Reproduce

herbie shell --seed 2020152 
(FPCore (x y)
  :name "(/ 2.0 (+ x (sqrt (+ (* (* x x) (- 1.0 y)) y))))"
  :precision binary64
  (/ 2.0 (+ x (sqrt (+ (* (* x x) (- 1.0 y)) y)))))