Average Error: 43.9 → 42.2
Time: 33.2s
Precision: 64
Internal Precision: 128
\[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
\[\frac{\frac{(\left(\sqrt{\sqrt{(c \cdot \left(a \cdot -4\right) + \left(b \cdot b\right))_*}}\right) \cdot \left(\sqrt{\sqrt{\sqrt[3]{(\left(c \cdot a\right) \cdot -4 + \left(b \cdot b\right))_* \cdot (\left(c \cdot a\right) \cdot -4 + \left(b \cdot b\right))_*} \cdot {\left((c \cdot \left(a \cdot -4\right) + \left(b \cdot b\right))_*\right)}^{\frac{1}{3}}}}\right) + \left(-b\right))_*}{2}}{a}\]

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(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
  2. Simplified43.9

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

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

    \[\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-neg43.3

    \[\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-cbrt-cube43.3

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

    \[\leadsto \frac{\frac{(\left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) \cdot \left(\sqrt{\sqrt{\color{blue}{{\left(\left((c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_* \cdot (c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*\right) \cdot (c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*\right)}^{\frac{1}{3}}}}}\right) + \left(-b\right))_*}{2}}{a}\]
  11. Using strategy rm
  12. Applied unpow-prod-down43.0

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

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

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

Reproduce

herbie shell --seed 2019050 +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)))