Average Error: 28.5 → 0.5
Time: 8.9s
Precision: 64
\[1.05367121277235087 \cdot 10^{-8} \lt a \lt 94906265.6242515594 \land 1.05367121277235087 \cdot 10^{-8} \lt b \lt 94906265.6242515594 \land 1.05367121277235087 \cdot 10^{-8} \lt c \lt 94906265.6242515594\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\frac{\frac{\left(4 \cdot a\right) \cdot c}{2}}{\left(-b\right) - \sqrt{\sqrt[3]{\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right) \cdot \left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right) \cdot \left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}}}}{a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{\frac{\frac{\left(4 \cdot a\right) \cdot c}{2}}{\left(-b\right) - \sqrt{\sqrt[3]{\left(\left(b \cdot b - \left(4 \cdot a\right) \cdot c\right) \cdot \left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)\right) \cdot \left(b \cdot b - \left(4 \cdot a\right) \cdot c\right)}}}}{a}
double f(double a, double b, double c) {
        double r38715 = b;
        double r38716 = -r38715;
        double r38717 = r38715 * r38715;
        double r38718 = 4.0;
        double r38719 = a;
        double r38720 = r38718 * r38719;
        double r38721 = c;
        double r38722 = r38720 * r38721;
        double r38723 = r38717 - r38722;
        double r38724 = sqrt(r38723);
        double r38725 = r38716 + r38724;
        double r38726 = 2.0;
        double r38727 = r38726 * r38719;
        double r38728 = r38725 / r38727;
        return r38728;
}

double f(double a, double b, double c) {
        double r38729 = 4.0;
        double r38730 = a;
        double r38731 = r38729 * r38730;
        double r38732 = c;
        double r38733 = r38731 * r38732;
        double r38734 = 2.0;
        double r38735 = r38733 / r38734;
        double r38736 = b;
        double r38737 = -r38736;
        double r38738 = r38736 * r38736;
        double r38739 = r38738 - r38733;
        double r38740 = r38739 * r38739;
        double r38741 = r38740 * r38739;
        double r38742 = cbrt(r38741);
        double r38743 = sqrt(r38742);
        double r38744 = r38737 - r38743;
        double r38745 = r38735 / r38744;
        double r38746 = r38745 / r38730;
        return r38746;
}

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

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

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

    \[\leadsto \frac{\frac{\color{blue}{4 \cdot \left(a \cdot c\right) + b \cdot \left(b - b\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(4 \cdot \left(a \cdot c\right) + b \cdot \left(b - b\right)\right) \cdot \frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
  7. Applied times-frac0.5

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

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

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

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

    \[\leadsto \color{blue}{\left(\frac{1}{1} \cdot \frac{0 + 4 \cdot \left(a \cdot c\right)}{2}\right)} \cdot \frac{\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{a}\]
  13. Applied associate-*l*0.5

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

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

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

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

Reproduce

herbie shell --seed 2020047 
(FPCore (a b c)
  :name "Quadratic roots, narrow range"
  :precision binary64
  :pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))