Average Error: 43.8 → 42.1
Time: 1.1m
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(a \cdot -4\right) + \left(b \cdot b\right))_*\right)}^{\frac{1}{3}} \cdot \sqrt[3]{(\left(c \cdot -4\right) \cdot a + \left(b \cdot b\right))_* \cdot (\left(c \cdot -4\right) \cdot a + \left(b \cdot b\right))_*}}}\right) \cdot \left(\sqrt{\sqrt{(c \cdot \left(a \cdot -4\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 43.8

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

    \[\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.8

    \[\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.8

    \[\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.1

    \[\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.2

    \[\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}\]
  9. Using strategy rm
  10. Applied pow1/342.8

    \[\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}\]
  11. Using strategy rm
  12. Applied unpow-prod-down42.8

    \[\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}\]
  13. Simplified42.1

    \[\leadsto \frac{\frac{(\left(\sqrt{\sqrt{\color{blue}{\sqrt[3]{(\left(c \cdot -4\right) \cdot a + \left(b \cdot b\right))_* \cdot (\left(c \cdot -4\right) \cdot a + \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}\]
  14. Final simplification42.1

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

Reproduce

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