Average Error: 28.2 → 16.3
Time: 34.4s
Precision: 64
\[1.0536712127723509 \cdot 10^{-08} \lt a \lt 94906265.62425156 \land 1.0536712127723509 \cdot 10^{-08} \lt b \lt 94906265.62425156 \land 1.0536712127723509 \cdot 10^{-08} \lt c \lt 94906265.62425156\]
\[\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 1549.9005570311153:\\ \;\;\;\;\frac{\frac{\left(b \cdot b + -3 \cdot \left(a \cdot c\right)\right) \cdot \sqrt{b \cdot b + -3 \cdot \left(a \cdot c\right)} - \left(b \cdot b\right) \cdot b}{\left(b \cdot b + -3 \cdot \left(a \cdot c\right)\right) + \left(b \cdot \sqrt{b \cdot b + -3 \cdot \left(a \cdot c\right)} + b \cdot b\right)}}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b}\\ \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 1549.9005570311153:\\
\;\;\;\;\frac{\frac{\left(b \cdot b + -3 \cdot \left(a \cdot c\right)\right) \cdot \sqrt{b \cdot b + -3 \cdot \left(a \cdot c\right)} - \left(b \cdot b\right) \cdot b}{\left(b \cdot b + -3 \cdot \left(a \cdot c\right)\right) + \left(b \cdot \sqrt{b \cdot b + -3 \cdot \left(a \cdot c\right)} + b \cdot b\right)}}{a \cdot 3}\\

\mathbf{else}:\\
\;\;\;\;\frac{-1}{2} \cdot \frac{c}{b}\\

\end{array}
double f(double a, double b, double c) {
        double r3651832 = b;
        double r3651833 = -r3651832;
        double r3651834 = r3651832 * r3651832;
        double r3651835 = 3.0;
        double r3651836 = a;
        double r3651837 = r3651835 * r3651836;
        double r3651838 = c;
        double r3651839 = r3651837 * r3651838;
        double r3651840 = r3651834 - r3651839;
        double r3651841 = sqrt(r3651840);
        double r3651842 = r3651833 + r3651841;
        double r3651843 = r3651842 / r3651837;
        return r3651843;
}

double f(double a, double b, double c) {
        double r3651844 = b;
        double r3651845 = 1549.9005570311153;
        bool r3651846 = r3651844 <= r3651845;
        double r3651847 = r3651844 * r3651844;
        double r3651848 = -3.0;
        double r3651849 = a;
        double r3651850 = c;
        double r3651851 = r3651849 * r3651850;
        double r3651852 = r3651848 * r3651851;
        double r3651853 = r3651847 + r3651852;
        double r3651854 = sqrt(r3651853);
        double r3651855 = r3651853 * r3651854;
        double r3651856 = r3651847 * r3651844;
        double r3651857 = r3651855 - r3651856;
        double r3651858 = r3651844 * r3651854;
        double r3651859 = r3651858 + r3651847;
        double r3651860 = r3651853 + r3651859;
        double r3651861 = r3651857 / r3651860;
        double r3651862 = 3.0;
        double r3651863 = r3651849 * r3651862;
        double r3651864 = r3651861 / r3651863;
        double r3651865 = -0.5;
        double r3651866 = r3651850 / r3651844;
        double r3651867 = r3651865 * r3651866;
        double r3651868 = r3651846 ? r3651864 : r3651867;
        return r3651868;
}

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 2 regimes
  2. if b < 1549.9005570311153

    1. Initial program 17.1

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Simplified17.1

      \[\leadsto \color{blue}{\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a}}\]
    3. Using strategy rm
    4. Applied flip3--17.2

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

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

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

    if 1549.9005570311153 < b

    1. Initial program 36.5

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
    2. Simplified36.5

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

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{c}{b}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification16.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le 1549.9005570311153:\\ \;\;\;\;\frac{\frac{\left(b \cdot b + -3 \cdot \left(a \cdot c\right)\right) \cdot \sqrt{b \cdot b + -3 \cdot \left(a \cdot c\right)} - \left(b \cdot b\right) \cdot b}{\left(b \cdot b + -3 \cdot \left(a \cdot c\right)\right) + \left(b \cdot \sqrt{b \cdot b + -3 \cdot \left(a \cdot c\right)} + b \cdot b\right)}}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b}\\ \end{array}\]

Reproduce

herbie shell --seed 2019144 
(FPCore (a b c)
  :name "Cubic critical, narrow range"
  :pre (and (< 1.0536712127723509e-08 a 94906265.62425156) (< 1.0536712127723509e-08 b 94906265.62425156) (< 1.0536712127723509e-08 c 94906265.62425156))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))