Average Error: 44.1 → 43.1
Time: 27.6s
Precision: 64
Internal Precision: 128
\[\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 183215478.5480535:\\ \;\;\;\;\frac{\frac{\frac{{\left(\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}\right)}^{3} - {b}^{3}}{\left(\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*} \cdot b + b \cdot b\right) + \sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*} \cdot \sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}}{2}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{\frac{(\left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) \cdot \left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}{2}} \cdot \sqrt[3]{\frac{(\left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) \cdot \left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}{2}}}{\frac{a}{\sqrt[3]{\frac{-2 \cdot e^{\log c + \log a}}{b}} \cdot \sqrt[3]{\frac{1}{2}}}}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Split input into 2 regimes
  2. if b < 183215478.5480535

    1. Initial program 35.6

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

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*} - b}{2}}{a}}\]
    3. Using strategy rm
    4. Applied flip3--35.7

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

    if 183215478.5480535 < b

    1. Initial program 53.6

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

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

      \[\leadsto \frac{\frac{\sqrt{\color{blue}{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*} \cdot \sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}} - b}{2}}{a}\]
    5. Applied sqrt-prod53.3

      \[\leadsto \frac{\frac{\color{blue}{\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}} \cdot \sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}} - b}{2}}{a}\]
    6. Applied fma-neg52.6

      \[\leadsto \frac{\frac{\color{blue}{(\left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) \cdot \left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}}{2}}{a}\]
    7. Using strategy rm
    8. Applied add-cube-cbrt52.6

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

      \[\leadsto \color{blue}{\frac{\sqrt[3]{\frac{(\left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) \cdot \left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}{2}} \cdot \sqrt[3]{\frac{(\left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) \cdot \left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}{2}}}{\frac{a}{\sqrt[3]{\frac{(\left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) \cdot \left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}{2}}}}}\]
    10. Taylor expanded around 0 63.6

      \[\leadsto \frac{\sqrt[3]{\frac{(\left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) \cdot \left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}{2}} \cdot \sqrt[3]{\frac{(\left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) \cdot \left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}{2}}}{\frac{a}{\color{blue}{\sqrt[3]{\frac{1}{2}} \cdot e^{\frac{1}{3} \cdot \left(\left(\log -2 + \left(\log a + \log c\right)\right) - \log b\right)}}}}\]
    11. Simplified51.5

      \[\leadsto \frac{\sqrt[3]{\frac{(\left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) \cdot \left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}{2}} \cdot \sqrt[3]{\frac{(\left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) \cdot \left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}{2}}}{\frac{a}{\color{blue}{\sqrt[3]{\frac{-2 \cdot e^{\log c + \log a}}{b}} \cdot \sqrt[3]{\frac{1}{2}}}}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification43.1

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \le 183215478.5480535:\\ \;\;\;\;\frac{\frac{\frac{{\left(\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}\right)}^{3} - {b}^{3}}{\left(\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*} \cdot b + b \cdot b\right) + \sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*} \cdot \sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}}{2}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt[3]{\frac{(\left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) \cdot \left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}{2}} \cdot \sqrt[3]{\frac{(\left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) \cdot \left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}{2}}}{\frac{a}{\sqrt[3]{\frac{-2 \cdot e^{\log c + \log a}}{b}} \cdot \sqrt[3]{\frac{1}{2}}}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019053 +o rules:numerics
(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 a) c)))) (* 2 a)))