Average Error: 6.6 → 6.6
Time: 8.5s
Precision: 64
$\frac{\left(-b\right) + \sqrt{{b}^{2} - 4 \cdot ac}}{2 \cdot a}$
$\frac{\sqrt{{b}^{2} - 4 \cdot ac} - b}{2 \cdot a}$
\frac{\left(-b\right) + \sqrt{{b}^{2} - 4 \cdot ac}}{2 \cdot a}
\frac{\sqrt{{b}^{2} - 4 \cdot ac} - b}{2 \cdot a}
double f(double b, double ac, double a) {
double r3519279 = b;
double r3519280 = -r3519279;
double r3519281 = 2.0;
double r3519282 = pow(r3519279, r3519281);
double r3519283 = 4.0;
double r3519284 = ac;
double r3519285 = r3519283 * r3519284;
double r3519286 = r3519282 - r3519285;
double r3519287 = sqrt(r3519286);
double r3519288 = r3519280 + r3519287;
double r3519289 = a;
double r3519290 = r3519281 * r3519289;
double r3519291 = r3519288 / r3519290;
return r3519291;
}


double f(double b, double ac, double a) {
double r3519292 = b;
double r3519293 = 2.0;
double r3519294 = pow(r3519292, r3519293);
double r3519295 = 4.0;
double r3519296 = ac;
double r3519297 = r3519295 * r3519296;
double r3519298 = r3519294 - r3519297;
double r3519299 = sqrt(r3519298);
double r3519300 = r3519299 - r3519292;
double r3519301 = a;
double r3519302 = r3519293 * r3519301;
double r3519303 = r3519300 / r3519302;
return r3519303;
}



# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Initial program 6.6

$\frac{\left(-b\right) + \sqrt{{b}^{2} - 4 \cdot ac}}{2 \cdot a}$
2. Simplified6.6

$\leadsto \color{blue}{\frac{\sqrt{{b}^{2} - 4 \cdot ac} - b}{2 \cdot a}}$
3. Final simplification6.6

$\leadsto \frac{\sqrt{{b}^{2} - 4 \cdot ac} - b}{2 \cdot a}$

# Reproduce

herbie shell --seed 1
(FPCore (b ac a)
:name "(-b+sqrt(b^2-4ac))/(2a)"
:precision binary32
(/ (+ (- b) (sqrt (- (pow b 2) (* 4 ac)))) (* 2 a)))