Average Error: 43.7 → 0.4
Time: 6.8s
Precision: 64
\[1.11022 \cdot 10^{-16} \lt a \lt 9.0072 \cdot 10^{15} \land 1.11022 \cdot 10^{-16} \lt b \lt 9.0072 \cdot 10^{15} \land 1.11022 \cdot 10^{-16} \lt c \lt 9.0072 \cdot 10^{15}\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\frac{{b}^{2} + 4 \cdot \left(a \cdot c\right)}{\sqrt{b \cdot b + \left(4 \cdot a\right) \cdot c}} \cdot \frac{{b}^{2} - 4 \cdot \left(a \cdot c\right)}{\sqrt{b \cdot b + \left(4 \cdot a\right) \cdot c}}}}}{2 \cdot a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\frac{{b}^{2} + 4 \cdot \left(a \cdot c\right)}{\sqrt{b \cdot b + \left(4 \cdot a\right) \cdot c}} \cdot \frac{{b}^{2} - 4 \cdot \left(a \cdot c\right)}{\sqrt{b \cdot b + \left(4 \cdot a\right) \cdot c}}}}}{2 \cdot a}
double f(double a, double b, double c) {
        double r38363 = b;
        double r38364 = -r38363;
        double r38365 = r38363 * r38363;
        double r38366 = 4.0;
        double r38367 = a;
        double r38368 = r38366 * r38367;
        double r38369 = c;
        double r38370 = r38368 * r38369;
        double r38371 = r38365 - r38370;
        double r38372 = sqrt(r38371);
        double r38373 = r38364 + r38372;
        double r38374 = 2.0;
        double r38375 = r38374 * r38367;
        double r38376 = r38373 / r38375;
        return r38376;
}

double f(double a, double b, double c) {
        double r38377 = 0.0;
        double r38378 = 4.0;
        double r38379 = a;
        double r38380 = c;
        double r38381 = r38379 * r38380;
        double r38382 = r38378 * r38381;
        double r38383 = r38377 + r38382;
        double r38384 = b;
        double r38385 = -r38384;
        double r38386 = 2.0;
        double r38387 = pow(r38384, r38386);
        double r38388 = r38387 + r38382;
        double r38389 = r38384 * r38384;
        double r38390 = r38378 * r38379;
        double r38391 = r38390 * r38380;
        double r38392 = r38389 + r38391;
        double r38393 = sqrt(r38392);
        double r38394 = r38388 / r38393;
        double r38395 = r38387 - r38382;
        double r38396 = r38395 / r38393;
        double r38397 = r38394 * r38396;
        double r38398 = sqrt(r38397);
        double r38399 = r38385 - r38398;
        double r38400 = r38383 / r38399;
        double r38401 = 2.0;
        double r38402 = r38401 * r38379;
        double r38403 = r38400 / r38402;
        return r38403;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 43.7

    \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
  2. Using strategy rm
  3. Applied flip-+43.7

    \[\leadsto \frac{\color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
  4. Simplified0.4

    \[\leadsto \frac{\frac{\color{blue}{0 + 4 \cdot \left(a \cdot c\right)}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\]
  5. Using strategy rm
  6. Applied flip--0.4

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\color{blue}{\frac{\left(b \cdot b\right) \cdot \left(b \cdot b\right) - \left(\left(4 \cdot a\right) \cdot c\right) \cdot \left(\left(4 \cdot a\right) \cdot c\right)}{b \cdot b + \left(4 \cdot a\right) \cdot c}}}}}{2 \cdot a}\]
  7. Simplified0.4

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\frac{\color{blue}{{b}^{4} - \left(4 \cdot \left(a \cdot c\right)\right) \cdot \left(4 \cdot \left(a \cdot c\right)\right)}}{b \cdot b + \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
  8. Using strategy rm
  9. Applied add-sqr-sqrt0.4

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\frac{{b}^{4} - \left(4 \cdot \left(a \cdot c\right)\right) \cdot \left(4 \cdot \left(a \cdot c\right)\right)}{\color{blue}{\sqrt{b \cdot b + \left(4 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b + \left(4 \cdot a\right) \cdot c}}}}}}{2 \cdot a}\]
  10. Applied sqr-pow0.4

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\frac{\color{blue}{{b}^{\left(\frac{4}{2}\right)} \cdot {b}^{\left(\frac{4}{2}\right)}} - \left(4 \cdot \left(a \cdot c\right)\right) \cdot \left(4 \cdot \left(a \cdot c\right)\right)}{\sqrt{b \cdot b + \left(4 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b + \left(4 \cdot a\right) \cdot c}}}}}{2 \cdot a}\]
  11. Applied difference-of-squares0.4

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\frac{\color{blue}{\left({b}^{\left(\frac{4}{2}\right)} + 4 \cdot \left(a \cdot c\right)\right) \cdot \left({b}^{\left(\frac{4}{2}\right)} - 4 \cdot \left(a \cdot c\right)\right)}}{\sqrt{b \cdot b + \left(4 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b + \left(4 \cdot a\right) \cdot c}}}}}{2 \cdot a}\]
  12. Applied times-frac0.4

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\color{blue}{\frac{{b}^{\left(\frac{4}{2}\right)} + 4 \cdot \left(a \cdot c\right)}{\sqrt{b \cdot b + \left(4 \cdot a\right) \cdot c}} \cdot \frac{{b}^{\left(\frac{4}{2}\right)} - 4 \cdot \left(a \cdot c\right)}{\sqrt{b \cdot b + \left(4 \cdot a\right) \cdot c}}}}}}{2 \cdot a}\]
  13. Simplified0.4

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\color{blue}{\frac{{b}^{2} + 4 \cdot \left(a \cdot c\right)}{\sqrt{b \cdot b + \left(4 \cdot a\right) \cdot c}}} \cdot \frac{{b}^{\left(\frac{4}{2}\right)} - 4 \cdot \left(a \cdot c\right)}{\sqrt{b \cdot b + \left(4 \cdot a\right) \cdot c}}}}}{2 \cdot a}\]
  14. Simplified0.4

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{\frac{{b}^{2} + 4 \cdot \left(a \cdot c\right)}{\sqrt{b \cdot b + \left(4 \cdot a\right) \cdot c}} \cdot \color{blue}{\frac{{b}^{2} - 4 \cdot \left(a \cdot c\right)}{\sqrt{b \cdot b + \left(4 \cdot a\right) \cdot c}}}}}}{2 \cdot a}\]
  15. Final simplification0.4

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

Reproduce

herbie shell --seed 2020062 
(FPCore (a b c)
  :name "Quadratic roots, medium range"
  :precision binary64
  :pre (and (< 1.11022e-16 a 9.0072e+15) (< 1.11022e-16 b 9.0072e+15) (< 1.11022e-16 c 9.0072e+15))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))