Average Error: 28.2 → 0.3
Time: 27.0s
Precision: 64
\[1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt a \lt 94906265.62425155937671661376953125 \land 1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt b \lt 94906265.62425155937671661376953125 \land 1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt c \lt 94906265.62425155937671661376953125\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{1}{2} \cdot \frac{4 \cdot a}{\frac{a}{\frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{1}{2} \cdot \frac{4 \cdot a}{\frac{a}{\frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}
double f(double a, double b, double c) {
        double r82056 = b;
        double r82057 = -r82056;
        double r82058 = r82056 * r82056;
        double r82059 = 4.0;
        double r82060 = a;
        double r82061 = r82059 * r82060;
        double r82062 = c;
        double r82063 = r82061 * r82062;
        double r82064 = r82058 - r82063;
        double r82065 = sqrt(r82064);
        double r82066 = r82057 + r82065;
        double r82067 = 2.0;
        double r82068 = r82067 * r82060;
        double r82069 = r82066 / r82068;
        return r82069;
}

double f(double a, double b, double c) {
        double r82070 = 1.0;
        double r82071 = 2.0;
        double r82072 = r82070 / r82071;
        double r82073 = 4.0;
        double r82074 = a;
        double r82075 = r82073 * r82074;
        double r82076 = c;
        double r82077 = b;
        double r82078 = -r82077;
        double r82079 = r82077 * r82077;
        double r82080 = r82075 * r82076;
        double r82081 = r82079 - r82080;
        double r82082 = sqrt(r82081);
        double r82083 = r82078 - r82082;
        double r82084 = r82076 / r82083;
        double r82085 = r82074 / r82084;
        double r82086 = r82075 / r82085;
        double r82087 = r82072 * r82086;
        return r82087;
}

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 28.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-+28.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 + c \cdot \left(4 \cdot a\right)}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\]
  5. Using strategy rm
  6. Applied clear-num0.5

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

    \[\leadsto \frac{1}{\color{blue}{\frac{2 \cdot a}{\frac{\left(4 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}}\]
  8. Using strategy rm
  9. Applied *-un-lft-identity0.5

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

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

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

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

    \[\leadsto \frac{\color{blue}{\frac{1}{\frac{2}{4 \cdot a}}}}{\frac{a}{\frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}\]
  14. Using strategy rm
  15. Applied *-un-lft-identity0.4

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

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

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

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

    \[\leadsto \frac{\frac{1}{\frac{2}{4 \cdot a}}}{\color{blue}{\frac{1}{\frac{1}{1}} \cdot \frac{a}{\frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}}\]
  20. Applied div-inv0.4

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019209 +o rules:numerics
(FPCore (a b c)
  :name "Quadratic roots, narrow range"
  :precision binary64
  :pre (and (< 1.05367121277235087e-8 a 94906265.6242515594) (< 1.05367121277235087e-8 b 94906265.6242515594) (< 1.05367121277235087e-8 c 94906265.6242515594))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))