Average Error: 43.9 → 11.4
Time: 17.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(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 r1989673 = b;
        double r1989674 = -r1989673;
        double r1989675 = r1989673 * r1989673;
        double r1989676 = 4.0;
        double r1989677 = a;
        double r1989678 = r1989676 * r1989677;
        double r1989679 = c;
        double r1989680 = r1989678 * r1989679;
        double r1989681 = r1989675 - r1989680;
        double r1989682 = sqrt(r1989681);
        double r1989683 = r1989674 + r1989682;
        double r1989684 = 2.0;
        double r1989685 = r1989684 * r1989677;
        double r1989686 = r1989683 / r1989685;
        return r1989686;
}

double f(double a, double b, double c) {
        double r1989687 = b;
        double r1989688 = 6.961131476357277e-08;
        bool r1989689 = r1989687 <= r1989688;
        double r1989690 = r1989687 * r1989687;
        double r1989691 = 4.0;
        double r1989692 = c;
        double r1989693 = a;
        double r1989694 = r1989692 * r1989693;
        double r1989695 = r1989691 * r1989694;
        double r1989696 = r1989690 - r1989695;
        double r1989697 = sqrt(r1989696);
        double r1989698 = r1989697 - r1989687;
        double r1989699 = cbrt(r1989698);
        double r1989700 = r1989699 * r1989699;
        double r1989701 = sqrt(r1989693);
        double r1989702 = r1989700 / r1989701;
        double r1989703 = r1989699 / r1989701;
        double r1989704 = r1989702 * r1989703;
        double r1989705 = 2.0;
        double r1989706 = r1989704 / r1989705;
        double r1989707 = -2.0;
        double r1989708 = r1989692 / r1989687;
        double r1989709 = r1989707 * r1989708;
        double r1989710 = r1989709 / r1989705;
        double r1989711 = r1989689 ? r1989706 : r1989710;
        return r1989711;
}

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)))