Average Error: 44.1 → 0.4
Time: 8.2s
Precision: 64
\[1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt a \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt b \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt c \lt 9007199254740992\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{\left({b}^{2} - {b}^{2}\right) + \left(3 \cdot a\right) \cdot c}{\left(3 \cdot a\right) \cdot \left(-b\right) + \left(3 \cdot a\right) \cdot \left(-\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\left({b}^{2} - {b}^{2}\right) + \left(3 \cdot a\right) \cdot c}{\left(3 \cdot a\right) \cdot \left(-b\right) + \left(3 \cdot a\right) \cdot \left(-\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}
double f(double a, double b, double c) {
        double r122282 = b;
        double r122283 = -r122282;
        double r122284 = r122282 * r122282;
        double r122285 = 3.0;
        double r122286 = a;
        double r122287 = r122285 * r122286;
        double r122288 = c;
        double r122289 = r122287 * r122288;
        double r122290 = r122284 - r122289;
        double r122291 = sqrt(r122290);
        double r122292 = r122283 + r122291;
        double r122293 = r122292 / r122287;
        return r122293;
}

double f(double a, double b, double c) {
        double r122294 = b;
        double r122295 = 2.0;
        double r122296 = pow(r122294, r122295);
        double r122297 = r122296 - r122296;
        double r122298 = 3.0;
        double r122299 = a;
        double r122300 = r122298 * r122299;
        double r122301 = c;
        double r122302 = r122300 * r122301;
        double r122303 = r122297 + r122302;
        double r122304 = -r122294;
        double r122305 = r122300 * r122304;
        double r122306 = r122294 * r122294;
        double r122307 = r122306 - r122302;
        double r122308 = sqrt(r122307);
        double r122309 = -r122308;
        double r122310 = r122300 * r122309;
        double r122311 = r122305 + r122310;
        double r122312 = r122303 / r122311;
        return r122312;
}

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 44.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-+44.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. Simplified0.5

    \[\leadsto \frac{\frac{\color{blue}{\left({b}^{2} - {b}^{2}\right) + 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 div-inv0.6

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

    \[\leadsto \color{blue}{\frac{\left({b}^{2} - {b}^{2}\right) + 3 \cdot \left(a \cdot c\right)}{\frac{3 \cdot a}{\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}}\]
  8. Simplified0.5

    \[\leadsto \frac{\left({b}^{2} - {b}^{2}\right) + 3 \cdot \left(a \cdot c\right)}{\color{blue}{\left(3 \cdot a\right) \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}\]
  9. Using strategy rm
  10. Applied associate-*r*0.4

    \[\leadsto \frac{\left({b}^{2} - {b}^{2}\right) + \color{blue}{\left(3 \cdot a\right) \cdot c}}{\left(3 \cdot a\right) \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}\]
  11. Using strategy rm
  12. Applied sub-neg0.4

    \[\leadsto \frac{\left({b}^{2} - {b}^{2}\right) + \left(3 \cdot a\right) \cdot c}{\left(3 \cdot a\right) \cdot \color{blue}{\left(\left(-b\right) + \left(-\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)\right)}}\]
  13. Applied distribute-lft-in0.4

    \[\leadsto \frac{\left({b}^{2} - {b}^{2}\right) + \left(3 \cdot a\right) \cdot c}{\color{blue}{\left(3 \cdot a\right) \cdot \left(-b\right) + \left(3 \cdot a\right) \cdot \left(-\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}\]
  14. Final simplification0.4

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

Reproduce

herbie shell --seed 2019322 
(FPCore (a b c)
  :name "Cubic critical, medium range"
  :precision binary64
  :pre (and (< 1.11022e-16 a 9.0072e15) (< 1.11022e-16 b 9.0072e15) (< 1.11022e-16 c 9.0072e15))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))