Average Error: 28.2 → 0.4
Time: 17.1s
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{1}{\frac{\sqrt{b \cdot b - \left(c \cdot a\right) \cdot 3} + b}{c} \cdot \frac{3 \cdot a}{\left(-3\right) \cdot a}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{1}{\frac{\sqrt{b \cdot b - \left(c \cdot a\right) \cdot 3} + b}{c} \cdot \frac{3 \cdot a}{\left(-3\right) \cdot a}}
double f(double a, double b, double c) {
        double r94623 = b;
        double r94624 = -r94623;
        double r94625 = r94623 * r94623;
        double r94626 = 3.0;
        double r94627 = a;
        double r94628 = r94626 * r94627;
        double r94629 = c;
        double r94630 = r94628 * r94629;
        double r94631 = r94625 - r94630;
        double r94632 = sqrt(r94631);
        double r94633 = r94624 + r94632;
        double r94634 = r94633 / r94628;
        return r94634;
}

double f(double a, double b, double c) {
        double r94635 = 1.0;
        double r94636 = b;
        double r94637 = r94636 * r94636;
        double r94638 = c;
        double r94639 = a;
        double r94640 = r94638 * r94639;
        double r94641 = 3.0;
        double r94642 = r94640 * r94641;
        double r94643 = r94637 - r94642;
        double r94644 = sqrt(r94643);
        double r94645 = r94644 + r94636;
        double r94646 = r94645 / r94638;
        double r94647 = r94641 * r94639;
        double r94648 = -r94641;
        double r94649 = r94648 * r94639;
        double r94650 = r94647 / r94649;
        double r94651 = r94646 * r94650;
        double r94652 = r94635 / r94651;
        return r94652;
}

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.2

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

    \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(3 \cdot a, -c, b \cdot b\right)} - b}{3 \cdot a}}\]
  3. Using strategy rm
  4. Applied flip--28.2

    \[\leadsto \frac{\color{blue}{\frac{\sqrt{\mathsf{fma}\left(3 \cdot a, -c, b \cdot b\right)} \cdot \sqrt{\mathsf{fma}\left(3 \cdot a, -c, b \cdot b\right)} - b \cdot b}{\sqrt{\mathsf{fma}\left(3 \cdot a, -c, b \cdot b\right)} + b}}}{3 \cdot a}\]
  5. Simplified0.6

    \[\leadsto \frac{\frac{\color{blue}{\mathsf{fma}\left(-c \cdot a, 3, 0\right)}}{\sqrt{\mathsf{fma}\left(3 \cdot a, -c, b \cdot b\right)} + b}}{3 \cdot a}\]
  6. Simplified0.6

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

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

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

    \[\leadsto \frac{\mathsf{fma}\left(-c \cdot a, 3, 0\right)}{\color{blue}{\left(\left(b + \sqrt{\mathsf{fma}\left(-a \cdot c, 3, b \cdot b\right)}\right) \cdot a\right) \cdot 3}}\]
  11. Using strategy rm
  12. Applied pow10.6

    \[\leadsto \frac{\mathsf{fma}\left(-c \cdot a, 3, 0\right)}{\left(\left(b + \sqrt{\mathsf{fma}\left(-a \cdot c, 3, b \cdot b\right)}\right) \cdot a\right) \cdot \color{blue}{{3}^{1}}}\]
  13. Applied pow10.6

    \[\leadsto \frac{\mathsf{fma}\left(-c \cdot a, 3, 0\right)}{\left(\left(b + \sqrt{\mathsf{fma}\left(-a \cdot c, 3, b \cdot b\right)}\right) \cdot \color{blue}{{a}^{1}}\right) \cdot {3}^{1}}\]
  14. Applied pow10.6

    \[\leadsto \frac{\mathsf{fma}\left(-c \cdot a, 3, 0\right)}{\left(\color{blue}{{\left(b + \sqrt{\mathsf{fma}\left(-a \cdot c, 3, b \cdot b\right)}\right)}^{1}} \cdot {a}^{1}\right) \cdot {3}^{1}}\]
  15. Applied pow-prod-down0.6

    \[\leadsto \frac{\mathsf{fma}\left(-c \cdot a, 3, 0\right)}{\color{blue}{{\left(\left(b + \sqrt{\mathsf{fma}\left(-a \cdot c, 3, b \cdot b\right)}\right) \cdot a\right)}^{1}} \cdot {3}^{1}}\]
  16. Applied pow-prod-down0.6

    \[\leadsto \frac{\mathsf{fma}\left(-c \cdot a, 3, 0\right)}{\color{blue}{{\left(\left(\left(b + \sqrt{\mathsf{fma}\left(-a \cdot c, 3, b \cdot b\right)}\right) \cdot a\right) \cdot 3\right)}^{1}}}\]
  17. Simplified0.6

    \[\leadsto \frac{\mathsf{fma}\left(-c \cdot a, 3, 0\right)}{{\color{blue}{\left(\left(\sqrt{\mathsf{fma}\left(c \cdot a, -3, b \cdot b\right)} + b\right) \cdot \left(a \cdot 3\right)\right)}}^{1}}\]
  18. Using strategy rm
  19. Applied clear-num0.6

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

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

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

Reproduce

herbie shell --seed 2019179 +o rules:numerics
(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.0 a) c)))) (* 3.0 a)))