Average Error: 34.2 → 11.0
Time: 5.6s
Precision: 64
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\begin{array}{l} \mathbf{if}\;b \le -1.36928751418848999 \cdot 10^{59}:\\ \;\;\;\;\frac{1.5 \cdot \frac{a \cdot c}{b} - 2 \cdot b}{3 \cdot a}\\ \mathbf{elif}\;b \le 8.77192164127749907 \cdot 10^{-166}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \sqrt{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\\ \mathbf{elif}\;b \le 7.40885953468443465 \cdot 10^{146}:\\ \;\;\;\;\frac{\frac{1}{\sqrt[3]{\left(-b\right) - \sqrt{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \sqrt{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{\frac{1}{c} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0 + 3 \cdot \left(a \cdot c\right)}{1.5 \cdot \frac{a \cdot c}{b} - 2 \cdot b}}{3 \cdot a}\\ \end{array}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\begin{array}{l}
\mathbf{if}\;b \le -1.36928751418848999 \cdot 10^{59}:\\
\;\;\;\;\frac{1.5 \cdot \frac{a \cdot c}{b} - 2 \cdot b}{3 \cdot a}\\

\mathbf{elif}\;b \le 8.77192164127749907 \cdot 10^{-166}:\\
\;\;\;\;\frac{\left(-b\right) + \sqrt{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \sqrt{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\\

\mathbf{elif}\;b \le 7.40885953468443465 \cdot 10^{146}:\\
\;\;\;\;\frac{\frac{1}{\sqrt[3]{\left(-b\right) - \sqrt{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \sqrt{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{\frac{1}{c} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{0 + 3 \cdot \left(a \cdot c\right)}{1.5 \cdot \frac{a \cdot c}{b} - 2 \cdot b}}{3 \cdot a}\\

\end{array}
double f(double a, double b, double c) {
        double r134985 = b;
        double r134986 = -r134985;
        double r134987 = r134985 * r134985;
        double r134988 = 3.0;
        double r134989 = a;
        double r134990 = r134988 * r134989;
        double r134991 = c;
        double r134992 = r134990 * r134991;
        double r134993 = r134987 - r134992;
        double r134994 = sqrt(r134993);
        double r134995 = r134986 + r134994;
        double r134996 = r134995 / r134990;
        return r134996;
}

double f(double a, double b, double c) {
        double r134997 = b;
        double r134998 = -1.36928751418849e+59;
        bool r134999 = r134997 <= r134998;
        double r135000 = 1.5;
        double r135001 = a;
        double r135002 = c;
        double r135003 = r135001 * r135002;
        double r135004 = r135003 / r134997;
        double r135005 = r135000 * r135004;
        double r135006 = 2.0;
        double r135007 = r135006 * r134997;
        double r135008 = r135005 - r135007;
        double r135009 = 3.0;
        double r135010 = r135009 * r135001;
        double r135011 = r135008 / r135010;
        double r135012 = 8.771921641277499e-166;
        bool r135013 = r134997 <= r135012;
        double r135014 = -r134997;
        double r135015 = r134997 * r134997;
        double r135016 = r135010 * r135002;
        double r135017 = r135015 - r135016;
        double r135018 = sqrt(r135017);
        double r135019 = sqrt(r135018);
        double r135020 = r135019 * r135019;
        double r135021 = r135014 + r135020;
        double r135022 = r135021 / r135010;
        double r135023 = 7.408859534684435e+146;
        bool r135024 = r134997 <= r135023;
        double r135025 = 1.0;
        double r135026 = r135014 - r135020;
        double r135027 = cbrt(r135026);
        double r135028 = r135014 - r135018;
        double r135029 = cbrt(r135028);
        double r135030 = r135027 * r135029;
        double r135031 = r135025 / r135030;
        double r135032 = 1.0;
        double r135033 = r135032 / r135002;
        double r135034 = r135033 * r135029;
        double r135035 = r135031 / r135034;
        double r135036 = 0.0;
        double r135037 = r135009 * r135003;
        double r135038 = r135036 + r135037;
        double r135039 = r135038 / r135008;
        double r135040 = r135039 / r135010;
        double r135041 = r135024 ? r135035 : r135040;
        double r135042 = r135013 ? r135022 : r135041;
        double r135043 = r134999 ? r135011 : r135042;
        return r135043;
}

Error

Bits error versus a

Bits error versus b

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 < -1.36928751418849e+59

    1. Initial program 38.5

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Taylor expanded around -inf 11.1

      \[\leadsto \frac{\color{blue}{1.5 \cdot \frac{a \cdot c}{b} - 2 \cdot b}}{3 \cdot a}\]

    if -1.36928751418849e+59 < b < 8.771921641277499e-166

    1. Initial program 11.8

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Using strategy rm
    3. Applied add-sqr-sqrt11.8

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\]
    4. Applied sqrt-prod12.0

      \[\leadsto \frac{\left(-b\right) + \color{blue}{\sqrt{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \sqrt{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\]

    if 8.771921641277499e-166 < b < 7.408859534684435e+146

    1. Initial program 39.7

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

      \[\leadsto \frac{\color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\]
    4. Simplified15.3

      \[\leadsto \frac{\frac{\color{blue}{0 + 3 \cdot \left(a \cdot c\right)}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\]
    5. Using strategy rm
    6. Applied add-cube-cbrt15.9

      \[\leadsto \frac{\frac{0 + 3 \cdot \left(a \cdot c\right)}{\color{blue}{\left(\sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\right) \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}}{3 \cdot a}\]
    7. Applied *-un-lft-identity15.9

      \[\leadsto \frac{\frac{\color{blue}{1 \cdot \left(0 + 3 \cdot \left(a \cdot c\right)\right)}}{\left(\sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}\right) \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\]
    8. Applied times-frac15.9

      \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}} \cdot \frac{0 + 3 \cdot \left(a \cdot c\right)}{\sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}}{3 \cdot a}\]
    9. Applied associate-/l*14.6

      \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{\frac{3 \cdot a}{\frac{0 + 3 \cdot \left(a \cdot c\right)}{\sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}}}\]
    10. Simplified14.0

      \[\leadsto \frac{\frac{1}{\sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{\color{blue}{\frac{3 \cdot a}{3 \cdot \left(a \cdot c\right)} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}\]
    11. Taylor expanded around 0 6.9

      \[\leadsto \frac{\frac{1}{\sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{\color{blue}{\frac{1}{c}} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}\]
    12. Using strategy rm
    13. Applied add-sqr-sqrt6.9

      \[\leadsto \frac{\frac{1}{\sqrt[3]{\left(-b\right) - \sqrt{\color{blue}{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{\frac{1}{c} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}\]
    14. Applied sqrt-prod6.9

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

    if 7.408859534684435e+146 < b

    1. Initial program 63.1

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

      \[\leadsto \frac{\color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\]
    4. Simplified37.2

      \[\leadsto \frac{\frac{\color{blue}{0 + 3 \cdot \left(a \cdot c\right)}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\]
    5. Taylor expanded around inf 14.8

      \[\leadsto \frac{\frac{0 + 3 \cdot \left(a \cdot c\right)}{\color{blue}{1.5 \cdot \frac{a \cdot c}{b} - 2 \cdot b}}}{3 \cdot a}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification11.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le -1.36928751418848999 \cdot 10^{59}:\\ \;\;\;\;\frac{1.5 \cdot \frac{a \cdot c}{b} - 2 \cdot b}{3 \cdot a}\\ \mathbf{elif}\;b \le 8.77192164127749907 \cdot 10^{-166}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \sqrt{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\\ \mathbf{elif}\;b \le 7.40885953468443465 \cdot 10^{146}:\\ \;\;\;\;\frac{\frac{1}{\sqrt[3]{\left(-b\right) - \sqrt{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \sqrt{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{\frac{1}{c} \cdot \sqrt[3]{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0 + 3 \cdot \left(a \cdot c\right)}{1.5 \cdot \frac{a \cdot c}{b} - 2 \cdot b}}{3 \cdot a}\\ \end{array}\]

Reproduce

herbie shell --seed 2020025 
(FPCore (a b c)
  :name "Cubic critical"
  :precision binary64
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))