Average Error: 34.2 → 7.1
Time: 18.2s
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 r79559 = b_2;
        double r79560 = -r79559;
        double r79561 = r79559 * r79559;
        double r79562 = a;
        double r79563 = c;
        double r79564 = r79562 * r79563;
        double r79565 = r79561 - r79564;
        double r79566 = sqrt(r79565);
        double r79567 = r79560 - r79566;
        double r79568 = r79567 / r79562;
        return r79568;
}

double f(double a, double b_2, double c) {
        double r79569 = b_2;
        double r79570 = -2.0612055510809406e+75;
        bool r79571 = r79569 <= r79570;
        double r79572 = -0.5;
        double r79573 = c;
        double r79574 = r79573 / r79569;
        double r79575 = r79572 * r79574;
        double r79576 = -1.3591367057663401e-248;
        bool r79577 = r79569 <= r79576;
        double r79578 = 1.0;
        double r79579 = r79569 * r79569;
        double r79580 = a;
        double r79581 = r79580 * r79573;
        double r79582 = r79579 - r79581;
        double r79583 = sqrt(r79582);
        double r79584 = r79583 - r79569;
        double r79585 = r79578 / r79584;
        double r79586 = cbrt(r79585);
        double r79587 = r79586 * r79586;
        double r79588 = r79578 / r79573;
        double r79589 = cbrt(r79588);
        double r79590 = r79589 * r79589;
        double r79591 = r79587 / r79590;
        double r79592 = r79586 / r79589;
        double r79593 = r79591 * r79592;
        double r79594 = 5.5575580047450245e+97;
        bool r79595 = r79569 <= r79594;
        double r79596 = -r79569;
        double r79597 = r79596 - r79583;
        double r79598 = r79580 / r79597;
        double r79599 = r79578 / r79598;
        double r79600 = -2.0;
        double r79601 = r79600 * r79569;
        double r79602 = r79601 / r79580;
        double r79603 = r79595 ? r79599 : r79602;
        double r79604 = r79577 ? r79593 : r79603;
        double r79605 = r79571 ? r79575 : r79604;
        return r79605;
}

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. 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 "NMSE problem 3.2.1"
  :precision binary64
  (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))