Average Error: 52.4 → 0.1
Time: 5.8s
Precision: 64
\[4.93038 \cdot 10^{-32} \lt a \lt 2.02824 \cdot 10^{31} \land 4.93038 \cdot 10^{-32} \lt b \lt 2.02824 \cdot 10^{31} \land 4.93038 \cdot 10^{-32} \lt c \lt 2.02824 \cdot 10^{31}\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{2 \cdot 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{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}
double f(double a, double b, double c) {
        double r33171 = b;
        double r33172 = -r33171;
        double r33173 = r33171 * r33171;
        double r33174 = 4.0;
        double r33175 = a;
        double r33176 = r33174 * r33175;
        double r33177 = c;
        double r33178 = r33176 * r33177;
        double r33179 = r33173 - r33178;
        double r33180 = sqrt(r33179);
        double r33181 = r33172 + r33180;
        double r33182 = 2.0;
        double r33183 = r33182 * r33175;
        double r33184 = r33181 / r33183;
        return r33184;
}

double f(double a, double b, double c) {
        double r33185 = 2.0;
        double r33186 = c;
        double r33187 = r33185 * r33186;
        double r33188 = b;
        double r33189 = -r33188;
        double r33190 = r33188 * r33188;
        double r33191 = 4.0;
        double r33192 = a;
        double r33193 = r33191 * r33192;
        double r33194 = r33193 * r33186;
        double r33195 = r33190 - r33194;
        double r33196 = sqrt(r33195);
        double r33197 = r33189 - r33196;
        double r33198 = r33187 / r33197;
        return r33198;
}

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 div-inv0.5

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

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

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

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

    \[\leadsto {\color{blue}{\left(\frac{\frac{4 \cdot \left(a \cdot c\right)}{2 \cdot a}}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\right)}}^{1}\]
  12. Taylor expanded around 0 0.1

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

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

Reproduce

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