Average Error: 52.7 → 50.9
Time: 36.4s
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{{\left((c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*\right)}^{\frac{1}{3}} \cdot \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))_*}}}\right) \cdot \left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}{2}}{a}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Initial program 52.7

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

    \[\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-sqrt52.4

    \[\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}\]
  5. Applied fma-neg51.9

    \[\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}\]
  6. Using strategy rm
  7. Applied add-cbrt-cube52.0

    \[\leadsto \frac{\frac{(\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) \cdot \left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}{2}}{a}\]
  8. Using strategy rm
  9. Applied pow1/351.3

    \[\leadsto \frac{\frac{(\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) \cdot \left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}{2}}{a}\]
  10. Using strategy rm
  11. Applied unpow-prod-down51.3

    \[\leadsto \frac{\frac{(\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) \cdot \left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}{2}}{a}\]
  12. Simplified50.9

    \[\leadsto \frac{\frac{(\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) \cdot \left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}{2}}{a}\]
  13. Final simplification50.9

    \[\leadsto \frac{\frac{(\left(\sqrt{\sqrt{{\left((c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*\right)}^{\frac{1}{3}} \cdot \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))_*}}}\right) \cdot \left(\sqrt{\sqrt{(c \cdot \left(-4 \cdot a\right) + \left(b \cdot b\right))_*}}\right) + \left(-b\right))_*}{2}}{a}\]

Reproduce

herbie shell --seed 2019053 +o rules:numerics
(FPCore (a b c)
  :name "Quadratic roots, wide range"
  :pre (and (< 4.930380657631324e-32 a 2.028240960365167e+31) (< 4.930380657631324e-32 b 2.028240960365167e+31) (< 4.930380657631324e-32 c 2.028240960365167e+31))
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)))