Average Error: 43.8 → 0.2
Time: 18.8s
Precision: 64
\[1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt a \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt b \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt c \lt 9007199254740992\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\frac{\left(4 \cdot a\right) \cdot c}{a \cdot 2}}{\left(-b\right) - \sqrt{{b}^{2} - 4 \cdot \left(a \cdot c\right)}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\frac{\left(4 \cdot a\right) \cdot c}{a \cdot 2}}{\left(-b\right) - \sqrt{{b}^{2} - 4 \cdot \left(a \cdot c\right)}}
double f(double a, double b, double c) {
        double r42091 = b;
        double r42092 = -r42091;
        double r42093 = r42091 * r42091;
        double r42094 = 4.0;
        double r42095 = a;
        double r42096 = r42094 * r42095;
        double r42097 = c;
        double r42098 = r42096 * r42097;
        double r42099 = r42093 - r42098;
        double r42100 = sqrt(r42099);
        double r42101 = r42092 + r42100;
        double r42102 = 2.0;
        double r42103 = r42102 * r42095;
        double r42104 = r42101 / r42103;
        return r42104;
}

double f(double a, double b, double c) {
        double r42105 = 4.0;
        double r42106 = a;
        double r42107 = r42105 * r42106;
        double r42108 = c;
        double r42109 = r42107 * r42108;
        double r42110 = 2.0;
        double r42111 = r42106 * r42110;
        double r42112 = r42109 / r42111;
        double r42113 = b;
        double r42114 = -r42113;
        double r42115 = 2.0;
        double r42116 = pow(r42113, r42115);
        double r42117 = r42106 * r42108;
        double r42118 = r42105 * r42117;
        double r42119 = r42116 - r42118;
        double r42120 = sqrt(r42119);
        double r42121 = r42114 - r42120;
        double r42122 = r42112 / r42121;
        return r42122;
}

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

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

    \[\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 + \left(4 \cdot a\right) \cdot c}}{\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 \frac{\color{blue}{\left(0 + \left(4 \cdot a\right) \cdot c\right) \cdot \frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
  7. Applied associate-/l*0.5

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

    \[\leadsto \frac{0 + \left(4 \cdot a\right) \cdot c}{\color{blue}{\left(a \cdot 2\right) \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}\]
  9. Using strategy rm
  10. Applied associate-/r*0.2

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

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

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

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

Reproduce

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