Average Error: 22.3 → 22.3
Time: 1.6s
Precision: binary64
\[b - \frac{\sqrt{{b}^{2} - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[b - \frac{\sqrt{{b}^{2} - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
b - \frac{\sqrt{{b}^{2} - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
b - \frac{\sqrt{{b}^{2} - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
double code(double b, double a, double c) {
	return ((double) (b - ((double) (((double) sqrt(((double) (((double) pow(b, 2.0)) - ((double) (((double) (4.0 * a)) * c)))))) / ((double) (2.0 * a))))));
}
double code(double b, double a, double c) {
	return ((double) (b - ((double) (((double) sqrt(((double) (((double) pow(b, 2.0)) - ((double) (((double) (4.0 * a)) * c)))))) / ((double) (2.0 * a))))));
}

Error

Bits error versus b

Bits error versus a

Bits error versus c

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 22.3

    \[b - \frac{\sqrt{{b}^{2} - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
  2. Final simplification22.3

    \[\leadsto b - \frac{\sqrt{{b}^{2} - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]

Reproduce

herbie shell --seed 2020153 
(FPCore (b a c)
  :name "(- b (/ (sqrt (- (pow b 2) (* (* 4 a) c))) (* 2 a)))"
  :precision binary64
  (- b (/ (sqrt (- (pow b 2.0) (* (* 4.0 a) c))) (* 2.0 a))))