Average Error: 43.9 → 11.4
Time: 17.8s
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(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\begin{array}{l} \mathbf{if}\;b \le 6.961131476357276728544534868600712762543 \cdot 10^{-8}:\\ \;\;\;\;\frac{\frac{\sqrt[3]{\sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)} - b} \cdot \sqrt[3]{\sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)} - b}}{\sqrt{a}} \cdot \frac{\sqrt[3]{\sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)} - b}}{\sqrt{a}}}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2 \cdot \frac{c}{b}}{2}\\ \end{array}\]
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}
\begin{array}{l}
\mathbf{if}\;b \le 6.961131476357276728544534868600712762543 \cdot 10^{-8}:\\
\;\;\;\;\frac{\frac{\sqrt[3]{\sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)} - b} \cdot \sqrt[3]{\sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)} - b}}{\sqrt{a}} \cdot \frac{\sqrt[3]{\sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)} - b}}{\sqrt{a}}}{2}\\

\mathbf{else}:\\
\;\;\;\;\frac{-2 \cdot \frac{c}{b}}{2}\\

\end{array}
double f(double a, double b, double c) {
        double r1934485 = b;
        double r1934486 = -r1934485;
        double r1934487 = r1934485 * r1934485;
        double r1934488 = 4.0;
        double r1934489 = a;
        double r1934490 = r1934488 * r1934489;
        double r1934491 = c;
        double r1934492 = r1934490 * r1934491;
        double r1934493 = r1934487 - r1934492;
        double r1934494 = sqrt(r1934493);
        double r1934495 = r1934486 + r1934494;
        double r1934496 = 2.0;
        double r1934497 = r1934496 * r1934489;
        double r1934498 = r1934495 / r1934497;
        return r1934498;
}

double f(double a, double b, double c) {
        double r1934499 = b;
        double r1934500 = 6.961131476357277e-08;
        bool r1934501 = r1934499 <= r1934500;
        double r1934502 = r1934499 * r1934499;
        double r1934503 = 4.0;
        double r1934504 = c;
        double r1934505 = a;
        double r1934506 = r1934504 * r1934505;
        double r1934507 = r1934503 * r1934506;
        double r1934508 = r1934502 - r1934507;
        double r1934509 = sqrt(r1934508);
        double r1934510 = r1934509 - r1934499;
        double r1934511 = cbrt(r1934510);
        double r1934512 = r1934511 * r1934511;
        double r1934513 = sqrt(r1934505);
        double r1934514 = r1934512 / r1934513;
        double r1934515 = r1934511 / r1934513;
        double r1934516 = r1934514 * r1934515;
        double r1934517 = 2.0;
        double r1934518 = r1934516 / r1934517;
        double r1934519 = -2.0;
        double r1934520 = r1934504 / r1934499;
        double r1934521 = r1934519 * r1934520;
        double r1934522 = r1934521 / r1934517;
        double r1934523 = r1934501 ? r1934518 : r1934522;
        return r1934523;
}

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. Split input into 2 regimes
  2. if b < 6.961131476357277e-08

    1. Initial program 12.8

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
    2. Simplified12.8

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{b \cdot b - \left(c \cdot a\right) \cdot 4} - b}{a}}{2}}\]
    3. Using strategy rm
    4. Applied add-sqr-sqrt12.8

      \[\leadsto \frac{\frac{\sqrt{b \cdot b - \left(c \cdot a\right) \cdot 4} - b}{\color{blue}{\sqrt{a} \cdot \sqrt{a}}}}{2}\]
    5. Applied add-cube-cbrt12.9

      \[\leadsto \frac{\frac{\color{blue}{\left(\sqrt[3]{\sqrt{b \cdot b - \left(c \cdot a\right) \cdot 4} - b} \cdot \sqrt[3]{\sqrt{b \cdot b - \left(c \cdot a\right) \cdot 4} - b}\right) \cdot \sqrt[3]{\sqrt{b \cdot b - \left(c \cdot a\right) \cdot 4} - b}}}{\sqrt{a} \cdot \sqrt{a}}}{2}\]
    6. Applied times-frac12.9

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

    if 6.961131476357277e-08 < b

    1. Initial program 44.7

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
    2. Simplified44.7

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{b \cdot b - \left(c \cdot a\right) \cdot 4} - b}{a}}{2}}\]
    3. Taylor expanded around inf 11.4

      \[\leadsto \frac{\color{blue}{-2 \cdot \frac{c}{b}}}{2}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification11.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le 6.961131476357276728544534868600712762543 \cdot 10^{-8}:\\ \;\;\;\;\frac{\frac{\sqrt[3]{\sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)} - b} \cdot \sqrt[3]{\sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)} - b}}{\sqrt{a}} \cdot \frac{\sqrt[3]{\sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)} - b}}{\sqrt{a}}}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2 \cdot \frac{c}{b}}{2}\\ \end{array}\]

Reproduce

herbie shell --seed 2019172 
(FPCore (a b c)
  :name "Quadratic roots, 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) (* (* 4.0 a) c)))) (* 2.0 a)))