Average Error: 34.2 → 10.2
Time: 4.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 -2.125553485370055 \cdot 10^{-113}:\\ \;\;\;\;1 \cdot \left(1 \cdot \left(\frac{-1}{2} \cdot \frac{c}{b_2}\right)\right)\\ \mathbf{elif}\;b_2 \le 6.51740022507215 \cdot 10^{112}:\\ \;\;\;\;1 \cdot \left(1 \cdot \frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(1 \cdot \left(\frac{1}{2} \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\right)\right)\\ \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.125553485370055 \cdot 10^{-113}:\\
\;\;\;\;1 \cdot \left(1 \cdot \left(\frac{-1}{2} \cdot \frac{c}{b_2}\right)\right)\\

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

\mathbf{else}:\\
\;\;\;\;1 \cdot \left(1 \cdot \left(\frac{1}{2} \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\right)\right)\\

\end{array}
double f(double a, double b_2, double c) {
        double r84007 = b_2;
        double r84008 = -r84007;
        double r84009 = r84007 * r84007;
        double r84010 = a;
        double r84011 = c;
        double r84012 = r84010 * r84011;
        double r84013 = r84009 - r84012;
        double r84014 = sqrt(r84013);
        double r84015 = r84008 - r84014;
        double r84016 = r84015 / r84010;
        return r84016;
}

double f(double a, double b_2, double c) {
        double r84017 = b_2;
        double r84018 = -2.125553485370055e-113;
        bool r84019 = r84017 <= r84018;
        double r84020 = 1.0;
        double r84021 = -0.5;
        double r84022 = c;
        double r84023 = r84022 / r84017;
        double r84024 = r84021 * r84023;
        double r84025 = r84020 * r84024;
        double r84026 = r84020 * r84025;
        double r84027 = 6.51740022507215e+112;
        bool r84028 = r84017 <= r84027;
        double r84029 = -r84017;
        double r84030 = r84017 * r84017;
        double r84031 = a;
        double r84032 = r84031 * r84022;
        double r84033 = r84030 - r84032;
        double r84034 = sqrt(r84033);
        double r84035 = r84029 - r84034;
        double r84036 = r84035 / r84031;
        double r84037 = r84020 * r84036;
        double r84038 = r84020 * r84037;
        double r84039 = 0.5;
        double r84040 = r84039 * r84023;
        double r84041 = 2.0;
        double r84042 = r84017 / r84031;
        double r84043 = r84041 * r84042;
        double r84044 = r84040 - r84043;
        double r84045 = r84020 * r84044;
        double r84046 = r84020 * r84045;
        double r84047 = r84028 ? r84038 : r84046;
        double r84048 = r84019 ? r84026 : r84047;
        return r84048;
}

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 3 regimes
  2. if b_2 < -2.125553485370055e-113

    1. Initial program 51.4

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

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

      \[\leadsto \color{blue}{1 \cdot \frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}}\]
    6. Using strategy rm
    7. Applied *-un-lft-identity51.4

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

      \[\leadsto 1 \cdot \frac{1}{\frac{\color{blue}{1 \cdot a}}{1 \cdot \left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}}\]
    9. Applied times-frac51.4

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

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

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

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

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

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

    if -2.125553485370055e-113 < b_2 < 6.51740022507215e+112

    1. Initial program 12.1

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

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

      \[\leadsto \color{blue}{1 \cdot \frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}}\]
    6. Using strategy rm
    7. Applied *-un-lft-identity12.3

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

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

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

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

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

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

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

    if 6.51740022507215e+112 < b_2

    1. Initial program 49.8

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

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

      \[\leadsto \color{blue}{1 \cdot \frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}}\]
    6. Using strategy rm
    7. Applied *-un-lft-identity49.9

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \le -2.125553485370055 \cdot 10^{-113}:\\ \;\;\;\;1 \cdot \left(1 \cdot \left(\frac{-1}{2} \cdot \frac{c}{b_2}\right)\right)\\ \mathbf{elif}\;b_2 \le 6.51740022507215 \cdot 10^{112}:\\ \;\;\;\;1 \cdot \left(1 \cdot \frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;1 \cdot \left(1 \cdot \left(\frac{1}{2} \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}\right)\right)\\ \end{array}\]

Reproduce

herbie shell --seed 2020064 +o rules:numerics
(FPCore (a b_2 c)
  :name "NMSE problem 3.2.1"
  :precision binary64
  (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))