Average Error: 28.8 → 0.4
Time: 16.3s
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{c \cdot \left(3 \cdot a\right)}{3 \cdot a}}{\left(-b\right) - \sqrt{\frac{{b}^{6} - {\left(\left(3 \cdot a\right) \cdot c\right)}^{3}}{{b}^{4} + \left(\left(3 \cdot a\right) \cdot c\right) \cdot \left(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{\frac{c \cdot \left(3 \cdot a\right)}{3 \cdot a}}{\left(-b\right) - \sqrt{\frac{{b}^{6} - {\left(\left(3 \cdot a\right) \cdot c\right)}^{3}}{{b}^{4} + \left(\left(3 \cdot a\right) \cdot c\right) \cdot \left(b \cdot b + \left(3 \cdot a\right) \cdot c\right)}}}
double f(double a, double b, double c) {
        double r95296 = b;
        double r95297 = -r95296;
        double r95298 = r95296 * r95296;
        double r95299 = 3.0;
        double r95300 = a;
        double r95301 = r95299 * r95300;
        double r95302 = c;
        double r95303 = r95301 * r95302;
        double r95304 = r95298 - r95303;
        double r95305 = sqrt(r95304);
        double r95306 = r95297 + r95305;
        double r95307 = r95306 / r95301;
        return r95307;
}

double f(double a, double b, double c) {
        double r95308 = c;
        double r95309 = 3.0;
        double r95310 = a;
        double r95311 = r95309 * r95310;
        double r95312 = r95308 * r95311;
        double r95313 = r95312 / r95311;
        double r95314 = b;
        double r95315 = -r95314;
        double r95316 = 6.0;
        double r95317 = pow(r95314, r95316);
        double r95318 = r95311 * r95308;
        double r95319 = 3.0;
        double r95320 = pow(r95318, r95319);
        double r95321 = r95317 - r95320;
        double r95322 = 4.0;
        double r95323 = pow(r95314, r95322);
        double r95324 = r95314 * r95314;
        double r95325 = r95324 + r95318;
        double r95326 = r95318 * r95325;
        double r95327 = r95323 + r95326;
        double r95328 = r95321 / r95327;
        double r95329 = sqrt(r95328);
        double r95330 = r95315 - r95329;
        double r95331 = r95313 / r95330;
        return r95331;
}

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

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

    \[\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 + c \cdot \left(3 \cdot a\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.5

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

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

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

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

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

    \[\leadsto \frac{1}{1} \cdot \color{blue}{\frac{\frac{c \cdot \left(3 \cdot a\right)}{3 \cdot a}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}\]
  13. Using strategy rm
  14. Applied flip3--0.4

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

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

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

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

Reproduce

herbie shell --seed 2019304 
(FPCore (a b c)
  :name "Cubic critical, narrow range"
  :precision binary64
  :pre (and (< 1.05367121277235087e-8 a 94906265.6242515594) (< 1.05367121277235087e-8 b 94906265.6242515594) (< 1.05367121277235087e-8 c 94906265.6242515594))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))