Average Error: 28.7 → 0.4
Time: 12.5s
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{a}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot c}{a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{a}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}} \cdot c}{a}
double f(double a, double b, double c) {
        double r80186 = b;
        double r80187 = -r80186;
        double r80188 = r80186 * r80186;
        double r80189 = 3.0;
        double r80190 = a;
        double r80191 = r80189 * r80190;
        double r80192 = c;
        double r80193 = r80191 * r80192;
        double r80194 = r80188 - r80193;
        double r80195 = sqrt(r80194);
        double r80196 = r80187 + r80195;
        double r80197 = r80196 / r80191;
        return r80197;
}

double f(double a, double b, double c) {
        double r80198 = a;
        double r80199 = b;
        double r80200 = -r80199;
        double r80201 = r80199 * r80199;
        double r80202 = 3.0;
        double r80203 = r80202 * r80198;
        double r80204 = c;
        double r80205 = r80203 * r80204;
        double r80206 = r80201 - r80205;
        double r80207 = sqrt(r80206);
        double r80208 = r80200 - r80207;
        double r80209 = r80198 / r80208;
        double r80210 = r80209 * r80204;
        double r80211 = r80210 / r80198;
        return r80211;
}

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

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

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

    \[\leadsto \frac{\frac{\color{blue}{0 + 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 *-un-lft-identity0.6

    \[\leadsto \frac{\frac{0 + 3 \cdot \left(a \cdot c\right)}{\color{blue}{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}}{3 \cdot a}\]
  7. Applied *-un-lft-identity0.6

    \[\leadsto \frac{\frac{\color{blue}{1 \cdot \left(0 + 3 \cdot \left(a \cdot c\right)\right)}}{1 \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}}{3 \cdot a}\]
  8. Applied times-frac0.6

    \[\leadsto \frac{\color{blue}{\frac{1}{1} \cdot \frac{0 + 3 \cdot \left(a \cdot c\right)}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}{3 \cdot a}\]
  9. Applied times-frac0.6

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

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

    \[\leadsto \frac{1}{3} \cdot \color{blue}{\frac{\frac{\left(3 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{a}}\]
  12. Using strategy rm
  13. Applied *-un-lft-identity0.6

    \[\leadsto \frac{1}{3} \cdot \frac{\frac{\left(3 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{\color{blue}{1 \cdot a}}\]
  14. Applied div-inv0.6

    \[\leadsto \frac{1}{3} \cdot \frac{\color{blue}{\left(\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}}}}{1 \cdot a}\]
  15. Applied times-frac0.6

    \[\leadsto \frac{1}{3} \cdot \color{blue}{\left(\frac{\left(3 \cdot a\right) \cdot c}{1} \cdot \frac{\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{a}\right)}\]
  16. Applied associate-*r*0.7

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

    \[\leadsto \color{blue}{\left(c \cdot \frac{a \cdot 3}{3}\right)} \cdot \frac{\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{a}\]
  18. Using strategy rm
  19. Applied associate-*r/0.6

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

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

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

Reproduce

herbie shell --seed 2019351 +o rules:numerics
(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)))