Average Error: 28.6 → 0.6
Time: 17.7s
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}{3 \cdot a}}{\frac{\frac{1}{3 \cdot a}}{\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{c}{3 \cdot a}}{\frac{\frac{1}{3 \cdot a}}{\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}}
double f(double a, double b, double c) {
        double r93046 = b;
        double r93047 = -r93046;
        double r93048 = r93046 * r93046;
        double r93049 = 3.0;
        double r93050 = a;
        double r93051 = r93049 * r93050;
        double r93052 = c;
        double r93053 = r93051 * r93052;
        double r93054 = r93048 - r93053;
        double r93055 = sqrt(r93054);
        double r93056 = r93047 + r93055;
        double r93057 = r93056 / r93051;
        return r93057;
}

double f(double a, double b, double c) {
        double r93058 = c;
        double r93059 = 3.0;
        double r93060 = a;
        double r93061 = r93059 * r93060;
        double r93062 = r93058 / r93061;
        double r93063 = 1.0;
        double r93064 = r93063 / r93061;
        double r93065 = b;
        double r93066 = -r93065;
        double r93067 = r93065 * r93065;
        double r93068 = r93061 * r93058;
        double r93069 = r93067 - r93068;
        double r93070 = sqrt(r93069);
        double r93071 = r93066 - r93070;
        double r93072 = r93063 / r93071;
        double r93073 = r93064 / r93072;
        double r93074 = r93062 / r93073;
        return r93074;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2019326 
(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)))