Average Error: 52.4 → 0.4
Time: 6.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{0 + 4 \cdot \left(a \cdot c\right)}{\left(2 \cdot a\right) \cdot \left(\left(-b\right) - \sqrt{\frac{{b}^{4} - \left(4 \cdot \left(a \cdot c\right)\right) \cdot \left(4 \cdot \left(a \cdot c\right)\right)}{b \cdot b + \left(4 \cdot a\right) \cdot c}}\right)}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{0 + 4 \cdot \left(a \cdot c\right)}{\left(2 \cdot a\right) \cdot \left(\left(-b\right) - \sqrt{\frac{{b}^{4} - \left(4 \cdot \left(a \cdot c\right)\right) \cdot \left(4 \cdot \left(a \cdot c\right)\right)}{b \cdot b + \left(4 \cdot a\right) \cdot c}}\right)}
double f(double a, double b, double c) {
        double r33648 = b;
        double r33649 = -r33648;
        double r33650 = r33648 * r33648;
        double r33651 = 4.0;
        double r33652 = a;
        double r33653 = r33651 * r33652;
        double r33654 = c;
        double r33655 = r33653 * r33654;
        double r33656 = r33650 - r33655;
        double r33657 = sqrt(r33656);
        double r33658 = r33649 + r33657;
        double r33659 = 2.0;
        double r33660 = r33659 * r33652;
        double r33661 = r33658 / r33660;
        return r33661;
}

double f(double a, double b, double c) {
        double r33662 = 0.0;
        double r33663 = 4.0;
        double r33664 = a;
        double r33665 = c;
        double r33666 = r33664 * r33665;
        double r33667 = r33663 * r33666;
        double r33668 = r33662 + r33667;
        double r33669 = 2.0;
        double r33670 = r33669 * r33664;
        double r33671 = b;
        double r33672 = -r33671;
        double r33673 = 4.0;
        double r33674 = pow(r33671, r33673);
        double r33675 = r33667 * r33667;
        double r33676 = r33674 - r33675;
        double r33677 = r33671 * r33671;
        double r33678 = r33663 * r33664;
        double r33679 = r33678 * r33665;
        double r33680 = r33677 + r33679;
        double r33681 = r33676 / r33680;
        double r33682 = sqrt(r33681);
        double r33683 = r33672 - r33682;
        double r33684 = r33670 * r33683;
        double r33685 = r33668 / r33684;
        return r33685;
}

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 \frac{\color{blue}{\left(0 + 4 \cdot \left(a \cdot c\right)\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 + 4 \cdot \left(a \cdot c\right)}{\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 + 4 \cdot \left(a \cdot c\right)}{\color{blue}{\left(2 \cdot a\right) \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}\]
  9. Using strategy rm
  10. Applied flip--0.4

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

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

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

Reproduce

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