Average Error: 52.4 → 0.1
Time: 18.2s
Precision: 64
\[4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt a \lt 20282409603651670423947251286016 \land 4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt b \lt 20282409603651670423947251286016 \land 4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt c \lt 20282409603651670423947251286016\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{\frac{2}{4}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{\frac{2}{4}}
double f(double a, double b, double c) {
        double r27089 = b;
        double r27090 = -r27089;
        double r27091 = r27089 * r27089;
        double r27092 = 4.0;
        double r27093 = a;
        double r27094 = r27092 * r27093;
        double r27095 = c;
        double r27096 = r27094 * r27095;
        double r27097 = r27091 - r27096;
        double r27098 = sqrt(r27097);
        double r27099 = r27090 + r27098;
        double r27100 = 2.0;
        double r27101 = r27100 * r27093;
        double r27102 = r27099 / r27101;
        return r27102;
}

double f(double a, double b, double c) {
        double r27103 = c;
        double r27104 = b;
        double r27105 = -r27104;
        double r27106 = r27104 * r27104;
        double r27107 = 4.0;
        double r27108 = a;
        double r27109 = r27107 * r27108;
        double r27110 = r27109 * r27103;
        double r27111 = r27106 - r27110;
        double r27112 = sqrt(r27111);
        double r27113 = r27105 - r27112;
        double r27114 = r27103 / r27113;
        double r27115 = 2.0;
        double r27116 = r27115 / r27107;
        double r27117 = r27114 / r27116;
        return r27117;
}

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 52.4

    \[\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-+52.4

    \[\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 *-un-lft-identity0.4

    \[\leadsto \frac{\frac{0 + 4 \cdot \left(a \cdot c\right)}{\color{blue}{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}}{2 \cdot a}\]
  7. Applied *-un-lft-identity0.4

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

    \[\leadsto \frac{\color{blue}{\frac{1}{1} \cdot \frac{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}\]
  9. Applied associate-/l*0.4

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

    \[\leadsto \frac{\frac{1}{1}}{\color{blue}{\frac{2 \cdot a}{4 \cdot \left(a \cdot c\right)} \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}\]
  11. Using strategy rm
  12. Applied times-frac0.5

    \[\leadsto \frac{\frac{1}{1}}{\color{blue}{\left(\frac{2}{4} \cdot \frac{a}{a \cdot c}\right)} \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}\]
  13. Applied associate-*l*0.5

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

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

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

Reproduce

herbie shell --seed 2019297 
(FPCore (a b c)
  :name "Quadratic roots, wide range"
  :precision binary64
  :pre (and (< 4.93038e-32 a 2.02824e31) (< 4.93038e-32 b 2.02824e31) (< 4.93038e-32 c 2.02824e31))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))