Average Error: 43.7 → 0.5
Time: 22.5s
Precision: 64
\[1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt a \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt b \lt 9007199254740992 \land 1.1102230246251565404236316680908203125 \cdot 10^{-16} \lt c \lt 9007199254740992\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{3}{\frac{\left(3 \cdot a\right) \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}{a \cdot c}}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{3}{\frac{\left(3 \cdot a\right) \cdot \left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}{a \cdot c}}
double f(double a, double b, double c) {
        double r89722 = b;
        double r89723 = -r89722;
        double r89724 = r89722 * r89722;
        double r89725 = 3.0;
        double r89726 = a;
        double r89727 = r89725 * r89726;
        double r89728 = c;
        double r89729 = r89727 * r89728;
        double r89730 = r89724 - r89729;
        double r89731 = sqrt(r89730);
        double r89732 = r89723 + r89731;
        double r89733 = r89732 / r89727;
        return r89733;
}

double f(double a, double b, double c) {
        double r89734 = 3.0;
        double r89735 = a;
        double r89736 = r89734 * r89735;
        double r89737 = b;
        double r89738 = -r89737;
        double r89739 = r89737 * r89737;
        double r89740 = c;
        double r89741 = r89736 * r89740;
        double r89742 = r89739 - r89741;
        double r89743 = sqrt(r89742);
        double r89744 = r89738 - r89743;
        double r89745 = r89736 * r89744;
        double r89746 = r89735 * r89740;
        double r89747 = r89745 / r89746;
        double r89748 = r89734 / r89747;
        return r89748;
}

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 43.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-+43.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.5

    \[\leadsto \frac{\frac{\color{blue}{\left({b}^{2} - {b}^{2}\right) + 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 associate-*r*0.4

    \[\leadsto \frac{\frac{\left({b}^{2} - {b}^{2}\right) + \color{blue}{\left(3 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\]
  7. Using strategy rm
  8. Applied flip-+0.4

    \[\leadsto \frac{\frac{\color{blue}{\frac{\left({b}^{2} - {b}^{2}\right) \cdot \left({b}^{2} - {b}^{2}\right) - \left(\left(3 \cdot a\right) \cdot c\right) \cdot \left(\left(3 \cdot a\right) \cdot c\right)}{\left({b}^{2} - {b}^{2}\right) - \left(3 \cdot a\right) \cdot c}}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\]
  9. Applied associate-/l/0.5

    \[\leadsto \frac{\color{blue}{\frac{\left({b}^{2} - {b}^{2}\right) \cdot \left({b}^{2} - {b}^{2}\right) - \left(\left(3 \cdot a\right) \cdot c\right) \cdot \left(\left(3 \cdot a\right) \cdot c\right)}{\left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) \cdot \left(\left({b}^{2} - {b}^{2}\right) - \left(3 \cdot a\right) \cdot c\right)}}}{3 \cdot a}\]
  10. Simplified0.5

    \[\leadsto \frac{\frac{\left({b}^{2} - {b}^{2}\right) \cdot \left({b}^{2} - {b}^{2}\right) - \left(\left(3 \cdot a\right) \cdot c\right) \cdot \left(\left(3 \cdot a\right) \cdot c\right)}{\color{blue}{\left(\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) \cdot \left(-\left(3 \cdot a\right) \cdot c\right)}}}{3 \cdot a}\]
  11. Using strategy rm
  12. Applied difference-of-squares0.5

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

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

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

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

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

Reproduce

herbie shell --seed 2019297 
(FPCore (a b c)
  :name "Cubic critical, medium range"
  :precision binary64
  :pre (and (< 1.11022e-16 a 9.0072e15) (< 1.11022e-16 b 9.0072e15) (< 1.11022e-16 c 9.0072e15))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3 a) c)))) (* 3 a)))