Average Error: 52.2 → 0.1
Time: 17.4s
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{4 \cdot \frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{4 \cdot \frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2}
double f(double a, double b, double c) {
        double r26812 = b;
        double r26813 = -r26812;
        double r26814 = r26812 * r26812;
        double r26815 = 4.0;
        double r26816 = a;
        double r26817 = r26815 * r26816;
        double r26818 = c;
        double r26819 = r26817 * r26818;
        double r26820 = r26814 - r26819;
        double r26821 = sqrt(r26820);
        double r26822 = r26813 + r26821;
        double r26823 = 2.0;
        double r26824 = r26823 * r26816;
        double r26825 = r26822 / r26824;
        return r26825;
}

double f(double a, double b, double c) {
        double r26826 = 4.0;
        double r26827 = c;
        double r26828 = b;
        double r26829 = -r26828;
        double r26830 = r26828 * r26828;
        double r26831 = a;
        double r26832 = r26826 * r26831;
        double r26833 = r26832 * r26827;
        double r26834 = r26830 - r26833;
        double r26835 = sqrt(r26834);
        double r26836 = r26829 - r26835;
        double r26837 = r26827 / r26836;
        double r26838 = r26826 * r26837;
        double r26839 = 2.0;
        double r26840 = r26838 / r26839;
        return r26840;
}

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.2

    \[\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.2

    \[\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 times-frac0.4

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

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

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

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

    \[\leadsto \frac{1}{2} \cdot \frac{4}{\color{blue}{\frac{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}{c}}}\]
  15. Using strategy rm
  16. Applied div-inv0.3

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

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

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

Reproduce

herbie shell --seed 2019294 
(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)))