Average Error: 52.2 → 0.1
Time: 21.2s
Precision: 64
\[4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt a \lt 20282409603651670423947251286016 \land 4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt b \lt 20282409603651670423947251286016 \land 4.930380657631323783823303533017413935458 \cdot 10^{-32} \lt c \lt 20282409603651670423947251286016\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{1 \cdot c}{\left(-b\right) - \sqrt{{b}^{2} - 3 \cdot \left(a \cdot c\right)}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{1 \cdot c}{\left(-b\right) - \sqrt{{b}^{2} - 3 \cdot \left(a \cdot c\right)}}
double f(double a, double b, double c) {
        double r71627 = b;
        double r71628 = -r71627;
        double r71629 = r71627 * r71627;
        double r71630 = 3.0;
        double r71631 = a;
        double r71632 = r71630 * r71631;
        double r71633 = c;
        double r71634 = r71632 * r71633;
        double r71635 = r71629 - r71634;
        double r71636 = sqrt(r71635);
        double r71637 = r71628 + r71636;
        double r71638 = r71637 / r71632;
        return r71638;
}

double f(double a, double b, double c) {
        double r71639 = 1.0;
        double r71640 = c;
        double r71641 = r71639 * r71640;
        double r71642 = b;
        double r71643 = -r71642;
        double r71644 = 2.0;
        double r71645 = pow(r71642, r71644);
        double r71646 = 3.0;
        double r71647 = a;
        double r71648 = r71647 * r71640;
        double r71649 = r71646 * r71648;
        double r71650 = r71645 - r71649;
        double r71651 = sqrt(r71650);
        double r71652 = r71643 - r71651;
        double r71653 = r71641 / r71652;
        return r71653;
}

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 52.2

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

    \[\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.4

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

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

    \[\leadsto \color{blue}{\frac{0 + \left(3 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{{b}^{2} - 3 \cdot \left(a \cdot c\right)}} \cdot \frac{1}{3 \cdot a}}\]
  8. Using strategy rm
  9. Applied *-un-lft-identity0.4

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

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

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

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

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

Reproduce

herbie shell --seed 2019305 
(FPCore (a b c)
  :name "Cubic critical, wide range"
  :precision binary64
  :pre (and (< 4.93038e-32 a 2.02824e31) (< 4.93038e-32 b 2.02824e31) (< 4.93038e-32 c 2.02824e31))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))