Average Error: 33.9 → 6.4
Time: 4.9s
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 -1.590533515710923911285132150132268111726 \cdot 10^{145}:\\ \;\;\;\;{\left(\frac{-1}{2} \cdot \frac{c}{b_2}\right)}^{1}\\ \mathbf{elif}\;b_2 \le 4.96300435132134949065666295644348045876 \cdot 10^{-308}:\\ \;\;\;\;\frac{\frac{1}{a} \cdot 0 + \frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1} \cdot c}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}\\ \mathbf{elif}\;b_2 \le 3.052625918698214186101405817559582864419 \cdot 10^{94}:\\ \;\;\;\;{\left(\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\right)}^{1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2} \cdot \frac{c}{b_2} - 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 -1.590533515710923911285132150132268111726 \cdot 10^{145}:\\
\;\;\;\;{\left(\frac{-1}{2} \cdot \frac{c}{b_2}\right)}^{1}\\

\mathbf{elif}\;b_2 \le 4.96300435132134949065666295644348045876 \cdot 10^{-308}:\\
\;\;\;\;\frac{\frac{1}{a} \cdot 0 + \frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1} \cdot c}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}\\

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

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

\end{array}
double f(double a, double b_2, double c) {
        double r13820 = b_2;
        double r13821 = -r13820;
        double r13822 = r13820 * r13820;
        double r13823 = a;
        double r13824 = c;
        double r13825 = r13823 * r13824;
        double r13826 = r13822 - r13825;
        double r13827 = sqrt(r13826);
        double r13828 = r13821 - r13827;
        double r13829 = r13828 / r13823;
        return r13829;
}

double f(double a, double b_2, double c) {
        double r13830 = b_2;
        double r13831 = -1.590533515710924e+145;
        bool r13832 = r13830 <= r13831;
        double r13833 = -0.5;
        double r13834 = c;
        double r13835 = r13834 / r13830;
        double r13836 = r13833 * r13835;
        double r13837 = 1.0;
        double r13838 = pow(r13836, r13837);
        double r13839 = 4.963004351321349e-308;
        bool r13840 = r13830 <= r13839;
        double r13841 = a;
        double r13842 = r13837 / r13841;
        double r13843 = 0.0;
        double r13844 = r13842 * r13843;
        double r13845 = cbrt(r13837);
        double r13846 = r13845 * r13845;
        double r13847 = r13846 / r13837;
        double r13848 = r13847 * r13834;
        double r13849 = r13844 + r13848;
        double r13850 = -r13830;
        double r13851 = r13830 * r13830;
        double r13852 = r13841 * r13834;
        double r13853 = r13851 - r13852;
        double r13854 = sqrt(r13853);
        double r13855 = r13850 + r13854;
        double r13856 = r13849 / r13855;
        double r13857 = 3.0526259186982142e+94;
        bool r13858 = r13830 <= r13857;
        double r13859 = r13850 - r13854;
        double r13860 = r13859 / r13841;
        double r13861 = pow(r13860, r13837);
        double r13862 = 0.5;
        double r13863 = r13862 * r13835;
        double r13864 = 2.0;
        double r13865 = r13830 / r13841;
        double r13866 = r13864 * r13865;
        double r13867 = r13863 - r13866;
        double r13868 = r13858 ? r13861 : r13867;
        double r13869 = r13840 ? r13856 : r13868;
        double r13870 = r13832 ? r13838 : r13869;
        return r13870;
}

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 < -1.590533515710924e+145

    1. Initial program 63.0

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied div-inv63.0

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

      \[\leadsto \left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right) \cdot \color{blue}{{\left(\frac{1}{a}\right)}^{1}}\]
    6. Applied pow163.0

      \[\leadsto \color{blue}{{\left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}^{1}} \cdot {\left(\frac{1}{a}\right)}^{1}\]
    7. Applied pow-prod-down63.0

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

      \[\leadsto {\color{blue}{\left(\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\right)}}^{1}\]
    9. Taylor expanded around -inf 1.7

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

    if -1.590533515710924e+145 < b_2 < 4.963004351321349e-308

    1. Initial program 33.8

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied div-inv33.8

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

      \[\leadsto \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}}} \cdot \frac{1}{a}\]
    6. Applied associate-*l/33.9

      \[\leadsto \color{blue}{\frac{\left(\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}\right) \cdot \frac{1}{a}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}\]
    7. Simplified14.4

      \[\leadsto \frac{\color{blue}{\frac{1}{a} \cdot 0 + \frac{1}{a} \cdot \left(a \cdot c\right)}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}\]
    8. Using strategy rm
    9. Applied *-un-lft-identity14.4

      \[\leadsto \frac{\frac{1}{a} \cdot 0 + \frac{1}{\color{blue}{1 \cdot a}} \cdot \left(a \cdot c\right)}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}\]
    10. Applied add-cube-cbrt14.4

      \[\leadsto \frac{\frac{1}{a} \cdot 0 + \frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{1 \cdot a} \cdot \left(a \cdot c\right)}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}\]
    11. Applied times-frac14.4

      \[\leadsto \frac{\frac{1}{a} \cdot 0 + \color{blue}{\left(\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1} \cdot \frac{\sqrt[3]{1}}{a}\right)} \cdot \left(a \cdot c\right)}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}\]
    12. Applied associate-*l*14.4

      \[\leadsto \frac{\frac{1}{a} \cdot 0 + \color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1} \cdot \left(\frac{\sqrt[3]{1}}{a} \cdot \left(a \cdot c\right)\right)}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}\]
    13. Simplified7.9

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

    if 4.963004351321349e-308 < b_2 < 3.0526259186982142e+94

    1. Initial program 9.2

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied div-inv9.3

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

      \[\leadsto \left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right) \cdot \color{blue}{{\left(\frac{1}{a}\right)}^{1}}\]
    6. Applied pow19.3

      \[\leadsto \color{blue}{{\left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}^{1}} \cdot {\left(\frac{1}{a}\right)}^{1}\]
    7. Applied pow-prod-down9.3

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

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

    if 3.0526259186982142e+94 < b_2

    1. Initial program 44.8

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \le -1.590533515710923911285132150132268111726 \cdot 10^{145}:\\ \;\;\;\;{\left(\frac{-1}{2} \cdot \frac{c}{b_2}\right)}^{1}\\ \mathbf{elif}\;b_2 \le 4.96300435132134949065666295644348045876 \cdot 10^{-308}:\\ \;\;\;\;\frac{\frac{1}{a} \cdot 0 + \frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{1} \cdot c}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}\\ \mathbf{elif}\;b_2 \le 3.052625918698214186101405817559582864419 \cdot 10^{94}:\\ \;\;\;\;{\left(\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\right)}^{1}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2} \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\\ \end{array}\]

Reproduce

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