Average Error: 34.2 → 7.1
Time: 19.6s
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.061205551080940634651657060257542002276 \cdot 10^{75}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le -1.359136705766340146185049019495290138271 \cdot 10^{-248}:\\ \;\;\;\;\frac{\sqrt[3]{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}} \cdot \sqrt[3]{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{\sqrt[3]{\frac{1}{c}} \cdot \sqrt[3]{\frac{1}{c}}} \cdot \frac{\sqrt[3]{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{\sqrt[3]{\frac{1}{c}}}\\ \mathbf{elif}\;b_2 \le 5.557558004745024527115535790994790141148 \cdot 10^{97}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2 \cdot 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.061205551080940634651657060257542002276 \cdot 10^{75}:\\
\;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\

\mathbf{elif}\;b_2 \le -1.359136705766340146185049019495290138271 \cdot 10^{-248}:\\
\;\;\;\;\frac{\sqrt[3]{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}} \cdot \sqrt[3]{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{\sqrt[3]{\frac{1}{c}} \cdot \sqrt[3]{\frac{1}{c}}} \cdot \frac{\sqrt[3]{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{\sqrt[3]{\frac{1}{c}}}\\

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

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

\end{array}
double f(double a, double b_2, double c) {
        double r33372 = b_2;
        double r33373 = -r33372;
        double r33374 = r33372 * r33372;
        double r33375 = a;
        double r33376 = c;
        double r33377 = r33375 * r33376;
        double r33378 = r33374 - r33377;
        double r33379 = sqrt(r33378);
        double r33380 = r33373 - r33379;
        double r33381 = r33380 / r33375;
        return r33381;
}

double f(double a, double b_2, double c) {
        double r33382 = b_2;
        double r33383 = -2.0612055510809406e+75;
        bool r33384 = r33382 <= r33383;
        double r33385 = -0.5;
        double r33386 = c;
        double r33387 = r33386 / r33382;
        double r33388 = r33385 * r33387;
        double r33389 = -1.3591367057663401e-248;
        bool r33390 = r33382 <= r33389;
        double r33391 = 1.0;
        double r33392 = r33382 * r33382;
        double r33393 = a;
        double r33394 = r33393 * r33386;
        double r33395 = r33392 - r33394;
        double r33396 = sqrt(r33395);
        double r33397 = r33396 - r33382;
        double r33398 = r33391 / r33397;
        double r33399 = cbrt(r33398);
        double r33400 = r33399 * r33399;
        double r33401 = r33391 / r33386;
        double r33402 = cbrt(r33401);
        double r33403 = r33402 * r33402;
        double r33404 = r33400 / r33403;
        double r33405 = r33399 / r33402;
        double r33406 = r33404 * r33405;
        double r33407 = 5.5575580047450245e+97;
        bool r33408 = r33382 <= r33407;
        double r33409 = -r33382;
        double r33410 = r33409 - r33396;
        double r33411 = r33393 / r33410;
        double r33412 = r33391 / r33411;
        double r33413 = -2.0;
        double r33414 = r33413 * r33382;
        double r33415 = r33414 / r33393;
        double r33416 = r33408 ? r33412 : r33415;
        double r33417 = r33390 ? r33406 : r33416;
        double r33418 = r33384 ? r33388 : r33417;
        return r33418;
}

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.0612055510809406e+75

    1. Initial program 58.1

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

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

    if -2.0612055510809406e+75 < b_2 < -1.3591367057663401e-248

    1. Initial program 32.5

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

      \[\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. Simplified17.1

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

      \[\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 *-un-lft-identity17.1

      \[\leadsto \frac{\frac{0 + a \cdot c}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\color{blue}{1 \cdot a}}\]
    8. Applied associate-/r*17.1

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

      \[\leadsto \frac{\color{blue}{\frac{a}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}{c}}}}{a}\]
    10. Using strategy rm
    11. Applied div-inv14.2

      \[\leadsto \frac{\frac{a}{\color{blue}{\left(\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2\right) \cdot \frac{1}{c}}}}{a}\]
    12. Applied *-un-lft-identity14.2

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

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2} \cdot \frac{a}{\frac{1}{c}}}}{a}\]
    14. Applied associate-/l*16.3

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

      \[\leadsto \frac{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\color{blue}{\frac{1}{c}}}\]
    16. Using strategy rm
    17. Applied add-cube-cbrt8.9

      \[\leadsto \frac{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\color{blue}{\left(\sqrt[3]{\frac{1}{c}} \cdot \sqrt[3]{\frac{1}{c}}\right) \cdot \sqrt[3]{\frac{1}{c}}}}\]
    18. Applied add-cube-cbrt9.2

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

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

    if -1.3591367057663401e-248 < b_2 < 5.5575580047450245e+97

    1. Initial program 10.2

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

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

    if 5.5575580047450245e+97 < b_2

    1. Initial program 47.3

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied flip--63.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. Simplified62.1

      \[\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.1

      \[\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 *-un-lft-identity62.1

      \[\leadsto \frac{\frac{0 + a \cdot c}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{\color{blue}{1 \cdot a}}\]
    8. Applied associate-/r*62.1

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \le -2.061205551080940634651657060257542002276 \cdot 10^{75}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le -1.359136705766340146185049019495290138271 \cdot 10^{-248}:\\ \;\;\;\;\frac{\sqrt[3]{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}} \cdot \sqrt[3]{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{\sqrt[3]{\frac{1}{c}} \cdot \sqrt[3]{\frac{1}{c}}} \cdot \frac{\sqrt[3]{\frac{1}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{\sqrt[3]{\frac{1}{c}}}\\ \mathbf{elif}\;b_2 \le 5.557558004745024527115535790994790141148 \cdot 10^{97}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2 \cdot b_2}{a}\\ \end{array}\]

Reproduce

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