Average Error: 28.4 → 0.3
Time: 5.6s
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{1}{2} \cdot \left(\frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}} \cdot 4\right)\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\frac{1}{2} \cdot \left(\frac{c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}} \cdot 4\right)
double f(double a, double b, double c) {
        double r30700 = b;
        double r30701 = -r30700;
        double r30702 = r30700 * r30700;
        double r30703 = 4.0;
        double r30704 = a;
        double r30705 = r30703 * r30704;
        double r30706 = c;
        double r30707 = r30705 * r30706;
        double r30708 = r30702 - r30707;
        double r30709 = sqrt(r30708);
        double r30710 = r30701 + r30709;
        double r30711 = 2.0;
        double r30712 = r30711 * r30704;
        double r30713 = r30710 / r30712;
        return r30713;
}

double f(double a, double b, double c) {
        double r30714 = 1.0;
        double r30715 = 2.0;
        double r30716 = r30714 / r30715;
        double r30717 = c;
        double r30718 = b;
        double r30719 = -r30718;
        double r30720 = r30718 * r30718;
        double r30721 = 4.0;
        double r30722 = a;
        double r30723 = r30721 * r30722;
        double r30724 = r30723 * r30717;
        double r30725 = r30720 - r30724;
        double r30726 = sqrt(r30725);
        double r30727 = r30719 - r30726;
        double r30728 = r30717 / r30727;
        double r30729 = r30728 * r30721;
        double r30730 = r30716 * r30729;
        return r30730;
}

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.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-+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}{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 *-un-lft-identity0.5

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

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

    \[\leadsto \frac{\color{blue}{\frac{1}{1} \cdot \frac{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}\]
  9. Applied times-frac0.5

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

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

    \[\leadsto \frac{1}{2} \cdot \color{blue}{\frac{4 \cdot \left(a \cdot c\right)}{a \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\right)}}\]
  12. Using strategy rm
  13. Applied clear-num0.5

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

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

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

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

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

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

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

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

Reproduce

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