Average Error: 33.4 → 6.5
Time: 20.8s
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 -6.447353158240281 \cdot 10^{+75}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le 4.615068992038193 \cdot 10^{-289}:\\ \;\;\;\;\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2} \cdot c\\ \mathbf{elif}\;b_2 \le 3.613539017061943 \cdot 10^{+138}:\\ \;\;\;\;\left(-\frac{b_2}{a}\right) - \frac{\sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2 \cdot -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 -6.447353158240281 \cdot 10^{+75}:\\
\;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\

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

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

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

\end{array}
double f(double a, double b_2, double c) {
        double r3727698 = b_2;
        double r3727699 = -r3727698;
        double r3727700 = r3727698 * r3727698;
        double r3727701 = a;
        double r3727702 = c;
        double r3727703 = r3727701 * r3727702;
        double r3727704 = r3727700 - r3727703;
        double r3727705 = sqrt(r3727704);
        double r3727706 = r3727699 - r3727705;
        double r3727707 = r3727706 / r3727701;
        return r3727707;
}

double f(double a, double b_2, double c) {
        double r3727708 = b_2;
        double r3727709 = -6.447353158240281e+75;
        bool r3727710 = r3727708 <= r3727709;
        double r3727711 = -0.5;
        double r3727712 = c;
        double r3727713 = r3727712 / r3727708;
        double r3727714 = r3727711 * r3727713;
        double r3727715 = 4.615068992038193e-289;
        bool r3727716 = r3727708 <= r3727715;
        double r3727717 = 1.0;
        double r3727718 = r3727708 * r3727708;
        double r3727719 = a;
        double r3727720 = r3727719 * r3727712;
        double r3727721 = r3727718 - r3727720;
        double r3727722 = sqrt(r3727721);
        double r3727723 = r3727722 - r3727708;
        double r3727724 = r3727717 / r3727723;
        double r3727725 = r3727724 * r3727712;
        double r3727726 = 3.613539017061943e+138;
        bool r3727727 = r3727708 <= r3727726;
        double r3727728 = r3727708 / r3727719;
        double r3727729 = -r3727728;
        double r3727730 = r3727722 / r3727719;
        double r3727731 = r3727729 - r3727730;
        double r3727732 = -2.0;
        double r3727733 = r3727708 * r3727732;
        double r3727734 = r3727733 / r3727719;
        double r3727735 = r3727727 ? r3727731 : r3727734;
        double r3727736 = r3727716 ? r3727725 : r3727735;
        double r3727737 = r3727710 ? r3727714 : r3727736;
        return r3727737;
}

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 < -6.447353158240281e+75

    1. Initial program 57.9

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

      \[\leadsto \frac{\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}}}}{a}\]
    4. Simplified30.7

      \[\leadsto \frac{\frac{\color{blue}{0 + a \cdot c}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}\]
    5. Simplified30.7

      \[\leadsto \frac{\frac{0 + a \cdot c}{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{a}\]
    6. Using strategy rm
    7. Applied clear-num31.0

      \[\leadsto \frac{\color{blue}{\frac{1}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{0 + a \cdot c}}}}{a}\]
    8. Simplified31.0

      \[\leadsto \frac{\frac{1}{\color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a \cdot c}}}}{a}\]
    9. Using strategy rm
    10. Applied *-un-lft-identity31.0

      \[\leadsto \frac{\frac{1}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a \cdot c}}}{\color{blue}{1 \cdot a}}\]
    11. Applied div-inv31.0

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

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

      \[\leadsto \frac{\color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2} \cdot \frac{\sqrt[3]{1}}{\frac{1}{a \cdot c}}}}{1 \cdot a}\]
    14. Applied times-frac29.1

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

      \[\leadsto \color{blue}{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}} \cdot \frac{\frac{\sqrt[3]{1}}{\frac{1}{a \cdot c}}}{a}\]
    16. Simplified28.0

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

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

    if -6.447353158240281e+75 < b_2 < 4.615068992038193e-289

    1. Initial program 29.4

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

      \[\leadsto \frac{\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}}}}{a}\]
    4. Simplified15.7

      \[\leadsto \frac{\frac{\color{blue}{0 + a \cdot c}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}\]
    5. Simplified15.7

      \[\leadsto \frac{\frac{0 + a \cdot c}{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{a}\]
    6. Using strategy rm
    7. Applied clear-num16.0

      \[\leadsto \frac{\color{blue}{\frac{1}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{0 + a \cdot c}}}}{a}\]
    8. Simplified16.0

      \[\leadsto \frac{\frac{1}{\color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a \cdot c}}}}{a}\]
    9. Using strategy rm
    10. Applied *-un-lft-identity16.0

      \[\leadsto \frac{\frac{1}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{a \cdot c}}}{\color{blue}{1 \cdot a}}\]
    11. Applied div-inv16.5

      \[\leadsto \frac{\frac{1}{\color{blue}{\left(\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2\right) \cdot \frac{1}{a \cdot c}}}}{1 \cdot a}\]
    12. Applied add-cube-cbrt16.5

      \[\leadsto \frac{\frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{\left(\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2\right) \cdot \frac{1}{a \cdot c}}}{1 \cdot a}\]
    13. Applied times-frac16.3

      \[\leadsto \frac{\color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2} \cdot \frac{\sqrt[3]{1}}{\frac{1}{a \cdot c}}}}{1 \cdot a}\]
    14. Applied times-frac15.8

      \[\leadsto \color{blue}{\frac{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{1} \cdot \frac{\frac{\sqrt[3]{1}}{\frac{1}{a \cdot c}}}{a}}\]
    15. Simplified15.8

      \[\leadsto \color{blue}{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}} \cdot \frac{\frac{\sqrt[3]{1}}{\frac{1}{a \cdot c}}}{a}\]
    16. Simplified8.9

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

    if 4.615068992038193e-289 < b_2 < 3.613539017061943e+138

    1. Initial program 8.6

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

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

    if 3.613539017061943e+138 < b_2

    1. Initial program 53.7

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

      \[\leadsto \frac{\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}}}}{a}\]
    4. Simplified62.4

      \[\leadsto \frac{\frac{\color{blue}{0 + a \cdot c}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}\]
    5. Simplified62.4

      \[\leadsto \frac{\frac{0 + a \cdot c}{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{a}\]
    6. Taylor expanded around 0 2.7

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \le -6.447353158240281 \cdot 10^{+75}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le 4.615068992038193 \cdot 10^{-289}:\\ \;\;\;\;\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2} \cdot c\\ \mathbf{elif}\;b_2 \le 3.613539017061943 \cdot 10^{+138}:\\ \;\;\;\;\left(-\frac{b_2}{a}\right) - \frac{\sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b_2 \cdot -2}{a}\\ \end{array}\]

Reproduce

herbie shell --seed 2019143 
(FPCore (a b_2 c)
  :name "NMSE problem 3.2.1"
  (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))