Average Error: 28.4 → 0.5
Time: 9.2m
Precision: 64
\[1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt a \lt 94906265.62425155937671661376953125 \land 1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt b \lt 94906265.62425155937671661376953125 \land 1.053671212772350866701172186984739043147 \cdot 10^{-8} \lt c \lt 94906265.62425155937671661376953125\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \left(\left(3 \cdot a\right) \cdot c\right)}{3 \cdot a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot \left(\left(3 \cdot a\right) \cdot c\right)}{3 \cdot a}
double f(double a, double b, double c) {
        double r55165 = b;
        double r55166 = -r55165;
        double r55167 = r55165 * r55165;
        double r55168 = 3.0;
        double r55169 = a;
        double r55170 = r55168 * r55169;
        double r55171 = c;
        double r55172 = r55170 * r55171;
        double r55173 = r55167 - r55172;
        double r55174 = sqrt(r55173);
        double r55175 = r55166 + r55174;
        double r55176 = r55175 / r55170;
        return r55176;
}

double f(double a, double b, double c) {
        double r55177 = 1.0;
        double r55178 = b;
        double r55179 = -r55178;
        double r55180 = r55178 * r55178;
        double r55181 = 3.0;
        double r55182 = a;
        double r55183 = r55181 * r55182;
        double r55184 = c;
        double r55185 = r55183 * r55184;
        double r55186 = r55180 - r55185;
        double r55187 = sqrt(r55186);
        double r55188 = r55179 - r55187;
        double r55189 = r55177 / r55188;
        double r55190 = r55189 * r55185;
        double r55191 = r55190 / r55183;
        return r55191;
}

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. Initial program 28.4

    \[\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-+28.4

    \[\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. Simplified0.5

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

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

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

Reproduce

herbie shell --seed 2019323 
(FPCore (a b c)
  :name "Cubic critical, narrow range"
  :precision binary64
  :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)))