Average Error: 19.7 → 7.0
Time: 54.3s
Precision: 64
Internal Precision: 384
\[\begin{array}{l} \mathbf{if}\;b \ge 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array}\]
\[\begin{array}{l} \mathbf{if}\;b \le -2.6058915714713517 \cdot 10^{+157}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \ge 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}{a + a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{\frac{a}{b} \cdot c - b}\\ \end{array}\\ \mathbf{if}\;b \le 5.987725731185349 \cdot 10^{-281}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \ge 0:\\ \;\;\;\;\frac{\frac{4 \cdot \left(a \cdot c\right)}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array}\\ \mathbf{if}\;b \le 1.0828682995093866 \cdot 10^{+26}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \ge 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}{a + a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{\frac{a}{b} \cdot c - b}\\ \end{array}\\ \mathbf{if}\;b \ge 0:\\ \;\;\;\;\frac{\frac{c}{b}}{1} - \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt[3]{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} + \left(-b\right)} \cdot \sqrt[3]{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} + \left(-b\right)}} \cdot \frac{c + c}{\sqrt[3]{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} + \left(-b\right)}}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b

Bits error versus c

Derivation

  1. Split input into 3 regimes
  2. if b < -2.6058915714713517e+157 or 5.987725731185349e-281 < b < 1.0828682995093866e+26

    1. Initial program 22.1

      \[\begin{array}{l} \mathbf{if}\;b \ge 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array}\]
    2. Taylor expanded around -inf 7.6

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \ge 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\color{blue}{\frac{2 \cdot c}{2 \cdot \frac{c \cdot a}{b} - 2 \cdot b}}\\ \end{array}\]
    3. Applied simplify5.3

      \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;b \ge 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}{a + a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{\frac{a}{b} \cdot c - b}\\ \end{array}}\]

    if -2.6058915714713517e+157 < b < 5.987725731185349e-281

    1. Initial program 9.1

      \[\begin{array}{l} \mathbf{if}\;b \ge 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array}\]
    2. Using strategy rm
    3. Applied flip--9.1

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \ge 0:\\ \;\;\;\;\frac{\color{blue}{\frac{\left(-b\right) \cdot \left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c} \cdot \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array}\]
    4. Applied simplify9.1

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \ge 0:\\ \;\;\;\;\frac{\frac{\color{blue}{4 \cdot \left(a \cdot c\right)}}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array}\]

    if 1.0828682995093866e+26 < b

    1. Initial program 34.1

      \[\begin{array}{l} \mathbf{if}\;b \ge 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array}\]
    2. Taylor expanded around inf 10.8

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \ge 0:\\ \;\;\;\;\frac{\color{blue}{2 \cdot \frac{c \cdot a}{b} - 2 \cdot b}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array}\]
    3. Applied simplify6.4

      \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;b \ge 0:\\ \;\;\;\;\frac{\frac{c}{b}}{1} - \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c + c}{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} + \left(-b\right)}\\ \end{array}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt6.4

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \ge 0:\\ \;\;\;\;\frac{\frac{c}{b}}{1} - \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\color{blue}{\frac{c + c}{\left(\sqrt[3]{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} + \left(-b\right)} \cdot \sqrt[3]{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} + \left(-b\right)}\right) \cdot \sqrt[3]{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} + \left(-b\right)}}}\\ \end{array}\]
    6. Applied *-un-lft-identity6.4

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \ge 0:\\ \;\;\;\;\frac{\frac{c}{b}}{1} - \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1 \cdot \left(c + c\right)}{\left(\sqrt[3]{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} + \left(-b\right)} \cdot \sqrt[3]{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} + \left(-b\right)}\right) \cdot \sqrt[3]{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} + \left(-b\right)}}\\ \end{array}\]
    7. Applied times-frac6.4

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \ge 0:\\ \;\;\;\;\frac{\frac{c}{b}}{1} - \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt[3]{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} + \left(-b\right)} \cdot \sqrt[3]{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} + \left(-b\right)}} \cdot \frac{c + c}{\sqrt[3]{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} + \left(-b\right)}}\\ \end{array}\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 54.3s)Debug logProfile

herbie shell --seed '#(1064269945 2896236262 301053905 1701069080 1701464310 1614783279)' 
(FPCore (a b c)
  :name "jeff quadratic root 1"
  (if (>= b 0) (/ (- (- b) (sqrt (- (* b b) (* (* 4 a) c)))) (* 2 a)) (/ (* 2 c) (+ (- b) (sqrt (- (* b b) (* (* 4 a) c)))))))