Average Error: 43.9 → 0.4
Time: 19.7s
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{\frac{3 \cdot a}{\frac{b + \sqrt{\mathsf{fma}\left(3, \left(-c\right) \cdot a, b \cdot b\right)}}{-c}}}{3 \cdot a}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a}
\frac{\frac{3 \cdot a}{\frac{b + \sqrt{\mathsf{fma}\left(3, \left(-c\right) \cdot a, b \cdot b\right)}}{-c}}}{3 \cdot a}
double f(double a, double b, double c) {
        double r112565 = b;
        double r112566 = -r112565;
        double r112567 = r112565 * r112565;
        double r112568 = 3.0;
        double r112569 = a;
        double r112570 = r112568 * r112569;
        double r112571 = c;
        double r112572 = r112570 * r112571;
        double r112573 = r112567 - r112572;
        double r112574 = sqrt(r112573);
        double r112575 = r112566 + r112574;
        double r112576 = r112575 / r112570;
        return r112576;
}

double f(double a, double b, double c) {
        double r112577 = 3.0;
        double r112578 = a;
        double r112579 = r112577 * r112578;
        double r112580 = b;
        double r112581 = c;
        double r112582 = -r112581;
        double r112583 = r112582 * r112578;
        double r112584 = r112580 * r112580;
        double r112585 = fma(r112577, r112583, r112584);
        double r112586 = sqrt(r112585);
        double r112587 = r112580 + r112586;
        double r112588 = r112587 / r112582;
        double r112589 = r112579 / r112588;
        double r112590 = r112589 / r112579;
        return r112590;
}

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 43.9

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

    \[\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 \cdot b - b \cdot b\right) + \left(3 \cdot c\right) \cdot a}}{\left(-b\right) - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}}{3 \cdot a}\]
  5. Simplified0.5

    \[\leadsto \frac{\frac{\left(b \cdot b - b \cdot b\right) + \left(3 \cdot c\right) \cdot a}{\color{blue}{\left(-b\right) - \sqrt{\mathsf{fma}\left(3, a \cdot \left(-c\right), b \cdot b\right)}}}}{3 \cdot a}\]
  6. Using strategy rm
  7. Applied frac-2neg0.5

    \[\leadsto \frac{\color{blue}{\frac{-\left(\left(b \cdot b - b \cdot b\right) + \left(3 \cdot c\right) \cdot a\right)}{-\left(\left(-b\right) - \sqrt{\mathsf{fma}\left(3, a \cdot \left(-c\right), b \cdot b\right)}\right)}}}{3 \cdot a}\]
  8. Simplified0.4

    \[\leadsto \frac{\frac{\color{blue}{\left(3 \cdot a\right) \cdot \left(-c\right)}}{-\left(\left(-b\right) - \sqrt{\mathsf{fma}\left(3, a \cdot \left(-c\right), b \cdot b\right)}\right)}}{3 \cdot a}\]
  9. Simplified0.4

    \[\leadsto \frac{\frac{\left(3 \cdot a\right) \cdot \left(-c\right)}{\color{blue}{-\left(-\left(b + \sqrt{\mathsf{fma}\left(3, \left(-a\right) \cdot c, b \cdot b\right)}\right)\right)}}}{3 \cdot a}\]
  10. Using strategy rm
  11. Applied associate-/l*0.4

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

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

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

Reproduce

herbie shell --seed 2019179 +o rules:numerics
(FPCore (a b c)
  :name "Cubic critical, medium range"
  :pre (and (< 1.1102230246251565e-16 a 9007199254740992.0) (< 1.1102230246251565e-16 b 9007199254740992.0) (< 1.1102230246251565e-16 c 9007199254740992.0))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))