Average Error: 33.6 → 6.5
Time: 51.4s
Precision: 64
\[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b_2 \le -2.8390533194930085 \cdot 10^{+101}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le 5.591225898358983 \cdot 10^{-195}:\\ \;\;\;\;\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2} \cdot c\\ \mathbf{elif}\;b_2 \le 4.778966372232416 \cdot 10^{+96}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a}\\ \end{array}\]
\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}
\begin{array}{l}
\mathbf{if}\;b_2 \le -2.8390533194930085 \cdot 10^{+101}:\\
\;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\

\mathbf{elif}\;b_2 \le 5.591225898358983 \cdot 10^{-195}:\\
\;\;\;\;\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2} \cdot c\\

\mathbf{elif}\;b_2 \le 4.778966372232416 \cdot 10^{+96}:\\
\;\;\;\;\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}\\

\mathbf{else}:\\
\;\;\;\;-2 \cdot \frac{b_2}{a}\\

\end{array}
double f(double a, double b_2, double c) {
        double r1817977 = b_2;
        double r1817978 = -r1817977;
        double r1817979 = r1817977 * r1817977;
        double r1817980 = a;
        double r1817981 = c;
        double r1817982 = r1817980 * r1817981;
        double r1817983 = r1817979 - r1817982;
        double r1817984 = sqrt(r1817983);
        double r1817985 = r1817978 - r1817984;
        double r1817986 = r1817985 / r1817980;
        return r1817986;
}

double f(double a, double b_2, double c) {
        double r1817987 = b_2;
        double r1817988 = -2.8390533194930085e+101;
        bool r1817989 = r1817987 <= r1817988;
        double r1817990 = -0.5;
        double r1817991 = c;
        double r1817992 = r1817991 / r1817987;
        double r1817993 = r1817990 * r1817992;
        double r1817994 = 5.591225898358983e-195;
        bool r1817995 = r1817987 <= r1817994;
        double r1817996 = 1.0;
        double r1817997 = r1817987 * r1817987;
        double r1817998 = a;
        double r1817999 = r1817998 * r1817991;
        double r1818000 = r1817997 - r1817999;
        double r1818001 = sqrt(r1818000);
        double r1818002 = r1818001 - r1817987;
        double r1818003 = r1817996 / r1818002;
        double r1818004 = r1818003 * r1817991;
        double r1818005 = 4.778966372232416e+96;
        bool r1818006 = r1817987 <= r1818005;
        double r1818007 = -r1817987;
        double r1818008 = r1818007 - r1818001;
        double r1818009 = r1817998 / r1818008;
        double r1818010 = r1817996 / r1818009;
        double r1818011 = -2.0;
        double r1818012 = r1817987 / r1817998;
        double r1818013 = r1818011 * r1818012;
        double r1818014 = r1818006 ? r1818010 : r1818013;
        double r1818015 = r1817995 ? r1818004 : r1818014;
        double r1818016 = r1817989 ? r1817993 : r1818015;
        return r1818016;
}

Error

Bits error versus a

Bits error versus b_2

Bits error versus c

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 4 regimes
  2. if b_2 < -2.8390533194930085e+101

    1. Initial program 58.8

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Taylor expanded around -inf 2.4

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{c}{b_2}}\]

    if -2.8390533194930085e+101 < b_2 < 5.591225898358983e-195

    1. Initial program 30.2

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity30.2

      \[\leadsto \frac{\color{blue}{1 \cdot \left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}}{a}\]
    4. Applied associate-/l*30.3

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}}\]
    5. Using strategy rm
    6. Applied flip--30.5

      \[\leadsto \frac{1}{\frac{a}{\color{blue}{\frac{\left(-b_2\right) \cdot \left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}}}\]
    7. Applied associate-/r/30.6

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{\left(-b_2\right) \cdot \left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c}} \cdot \left(\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}}\]
    8. Applied *-un-lft-identity30.6

      \[\leadsto \frac{\color{blue}{1 \cdot 1}}{\frac{a}{\left(-b_2\right) \cdot \left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c}} \cdot \left(\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}\]
    9. Applied times-frac30.6

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b_2\right) \cdot \left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c}}} \cdot \frac{1}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}\]
    10. Simplified16.1

      \[\leadsto \color{blue}{\frac{c \cdot a}{a}} \cdot \frac{1}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}\]
    11. Simplified16.1

      \[\leadsto \frac{c \cdot a}{a} \cdot \color{blue}{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}\]
    12. Taylor expanded around 0 10.2

      \[\leadsto \color{blue}{c} \cdot \frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}\]

    if 5.591225898358983e-195 < b_2 < 4.778966372232416e+96

    1. Initial program 6.1

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity6.1

      \[\leadsto \frac{\color{blue}{1 \cdot \left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}}{a}\]
    4. Applied associate-/l*6.3

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}}\]

    if 4.778966372232416e+96 < b_2

    1. Initial program 43.5

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity43.5

      \[\leadsto \frac{\color{blue}{1 \cdot \left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}}{a}\]
    4. Applied associate-/l*43.6

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}}\]
    5. Taylor expanded around 0 4.1

      \[\leadsto \color{blue}{-2 \cdot \frac{b_2}{a}}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification6.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \le -2.8390533194930085 \cdot 10^{+101}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le 5.591225898358983 \cdot 10^{-195}:\\ \;\;\;\;\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2} \cdot c\\ \mathbf{elif}\;b_2 \le 4.778966372232416 \cdot 10^{+96}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a}\\ \end{array}\]

Reproduce

herbie shell --seed 2019104 
(FPCore (a b_2 c)
  :name "quad2m (problem 3.2.1, negative)"
  (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))