Average Error: 33.6 → 6.5
Time: 51.5s
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 r6386304 = b_2;
        double r6386305 = -r6386304;
        double r6386306 = r6386304 * r6386304;
        double r6386307 = a;
        double r6386308 = c;
        double r6386309 = r6386307 * r6386308;
        double r6386310 = r6386306 - r6386309;
        double r6386311 = sqrt(r6386310);
        double r6386312 = r6386305 - r6386311;
        double r6386313 = r6386312 / r6386307;
        return r6386313;
}

double f(double a, double b_2, double c) {
        double r6386314 = b_2;
        double r6386315 = -2.8390533194930085e+101;
        bool r6386316 = r6386314 <= r6386315;
        double r6386317 = -0.5;
        double r6386318 = c;
        double r6386319 = r6386318 / r6386314;
        double r6386320 = r6386317 * r6386319;
        double r6386321 = 5.591225898358983e-195;
        bool r6386322 = r6386314 <= r6386321;
        double r6386323 = 1.0;
        double r6386324 = r6386314 * r6386314;
        double r6386325 = a;
        double r6386326 = r6386325 * r6386318;
        double r6386327 = r6386324 - r6386326;
        double r6386328 = sqrt(r6386327);
        double r6386329 = r6386328 - r6386314;
        double r6386330 = r6386323 / r6386329;
        double r6386331 = r6386330 * r6386318;
        double r6386332 = 4.778966372232416e+96;
        bool r6386333 = r6386314 <= r6386332;
        double r6386334 = -r6386314;
        double r6386335 = r6386334 - r6386328;
        double r6386336 = r6386325 / r6386335;
        double r6386337 = r6386323 / r6386336;
        double r6386338 = -2.0;
        double r6386339 = r6386314 / r6386325;
        double r6386340 = r6386338 * r6386339;
        double r6386341 = r6386333 ? r6386337 : r6386340;
        double r6386342 = r6386322 ? r6386331 : r6386341;
        double r6386343 = r6386316 ? r6386320 : r6386342;
        return r6386343;
}

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{\left(-b_2\right) - \color{blue}{1 \cdot \sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}\]
    4. Applied *-un-lft-identity30.2

      \[\leadsto \frac{\color{blue}{1 \cdot \left(-b_2\right)} - 1 \cdot \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    5. Applied distribute-lft-out--30.2

      \[\leadsto \frac{\color{blue}{1 \cdot \left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}}{a}\]
    6. 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}}}}\]
    7. Using strategy rm
    8. 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}}}}}\]
    9. 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)}}\]
    10. Applied add-cube-cbrt30.6

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{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)}\]
    11. Applied times-frac30.6

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

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

      \[\leadsto \frac{c \cdot a}{a} \cdot \color{blue}{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}\]
    14. Taylor expanded around inf 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{\left(-b_2\right) - \color{blue}{1 \cdot \sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}\]
    4. Applied *-un-lft-identity6.1

      \[\leadsto \frac{\color{blue}{1 \cdot \left(-b_2\right)} - 1 \cdot \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    5. Applied distribute-lft-out--6.1

      \[\leadsto \frac{\color{blue}{1 \cdot \left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}}{a}\]
    6. 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{\left(-b_2\right) - \color{blue}{1 \cdot \sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}\]
    4. Applied *-un-lft-identity43.5

      \[\leadsto \frac{\color{blue}{1 \cdot \left(-b_2\right)} - 1 \cdot \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    5. Applied distribute-lft-out--43.5

      \[\leadsto \frac{\color{blue}{1 \cdot \left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}}{a}\]
    6. 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}}}}\]
    7. 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 "NMSE problem 3.2.1"
  (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))