Average Error: 43.8 → 0.5
Time: 7.5s
Precision: 64
\[1.11022 \cdot 10^{-16} \lt a \lt 9.0072 \cdot 10^{15} \land 1.11022 \cdot 10^{-16} \lt b \lt 9.0072 \cdot 10^{15} \land 1.11022 \cdot 10^{-16} \lt c \lt 9.0072 \cdot 10^{15}\]
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}\]
\[\frac{3 \cdot \left(a \cdot c\right)}{3} \cdot \frac{\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{3 \cdot \left(a \cdot c\right)}{3} \cdot \frac{\frac{1}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{a}
double f(double a, double b, double c) {
        double r142636 = b;
        double r142637 = -r142636;
        double r142638 = r142636 * r142636;
        double r142639 = 3.0;
        double r142640 = a;
        double r142641 = r142639 * r142640;
        double r142642 = c;
        double r142643 = r142641 * r142642;
        double r142644 = r142638 - r142643;
        double r142645 = sqrt(r142644);
        double r142646 = r142637 + r142645;
        double r142647 = r142646 / r142641;
        return r142647;
}

double f(double a, double b, double c) {
        double r142648 = 3.0;
        double r142649 = a;
        double r142650 = c;
        double r142651 = r142649 * r142650;
        double r142652 = r142648 * r142651;
        double r142653 = r142652 / r142648;
        double r142654 = 1.0;
        double r142655 = b;
        double r142656 = -r142655;
        double r142657 = r142655 * r142655;
        double r142658 = r142648 * r142649;
        double r142659 = r142658 * r142650;
        double r142660 = r142657 - r142659;
        double r142661 = sqrt(r142660);
        double r142662 = r142656 - r142661;
        double r142663 = r142654 / r142662;
        double r142664 = r142663 / r142649;
        double r142665 = r142653 * r142664;
        return r142665;
}

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.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-+43.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}{\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 div-inv0.6

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

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

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

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

Reproduce

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