Average Error: 33.5 → 9.4
Time: 41.6s
Precision: 64
Internal Precision: 3200
\[\frac{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b/2 \le -7.0592428915980205 \cdot 10^{+47}:\\ \;\;\;\;\frac{1}{\frac{a \cdot \frac{1}{2}}{b/2} - \frac{b/2 + b/2}{c}}\\ \mathbf{if}\;b/2 \le -1.7843931071382662 \cdot 10^{-121}:\\ \;\;\;\;\frac{\frac{c \cdot a}{\sqrt{b/2 \cdot b/2 - a \cdot c} - b/2}}{a}\\ \mathbf{if}\;b/2 \le -1.170375490341468 \cdot 10^{-133}:\\ \;\;\;\;\frac{c}{(e^{\log_* (1 + \left(\frac{1}{2} \cdot a\right) \cdot \frac{c}{b/2})} - 1)^* - \left(b/2 + b/2\right)}\\ \mathbf{if}\;b/2 \le 5.969067876857501 \cdot 10^{+104}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{2}}{\frac{b/2}{c}} - b/2 \cdot \frac{2}{a}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b/2

Bits error versus c

Derivation

  1. Split input into 5 regimes
  2. if b/2 < -7.0592428915980205e+47

    1. Initial program 56.2

      \[\frac{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied flip--56.2

      \[\leadsto \frac{\color{blue}{\frac{\left(-b/2\right) \cdot \left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c} \cdot \sqrt{b/2 \cdot b/2 - a \cdot c}}{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}}}{a}\]
    4. Applied simplify29.0

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}}{a}\]
    5. Applied simplify29.0

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{\sqrt{b/2 \cdot b/2 - a \cdot c} - b/2}}}{a}\]
    6. Taylor expanded around -inf 15.5

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{\left(\frac{1}{2} \cdot \frac{c \cdot a}{b/2} - b/2\right)} - b/2}}{a}\]
    7. Applied simplify3.6

      \[\leadsto \color{blue}{\frac{c}{\left(\frac{1}{2} \cdot a\right) \cdot \frac{c}{b/2} - \left(b/2 + b/2\right)}}\]
    8. Using strategy rm
    9. Applied clear-num4.3

      \[\leadsto \color{blue}{\frac{1}{\frac{\left(\frac{1}{2} \cdot a\right) \cdot \frac{c}{b/2} - \left(b/2 + b/2\right)}{c}}}\]
    10. Applied simplify4.3

      \[\leadsto \frac{1}{\color{blue}{\frac{a \cdot \frac{1}{2}}{b/2} - \frac{b/2 + b/2}{c}}}\]

    if -7.0592428915980205e+47 < b/2 < -1.7843931071382662e-121

    1. Initial program 37.5

      \[\frac{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied flip--37.6

      \[\leadsto \frac{\color{blue}{\frac{\left(-b/2\right) \cdot \left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c} \cdot \sqrt{b/2 \cdot b/2 - a \cdot c}}{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}}}{a}\]
    4. Applied simplify15.2

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}}{a}\]
    5. Applied simplify15.2

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{\sqrt{b/2 \cdot b/2 - a \cdot c} - b/2}}}{a}\]

    if -1.7843931071382662e-121 < b/2 < -1.170375490341468e-133

    1. Initial program 28.5

      \[\frac{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied flip--28.6

      \[\leadsto \frac{\color{blue}{\frac{\left(-b/2\right) \cdot \left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c} \cdot \sqrt{b/2 \cdot b/2 - a \cdot c}}{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}}}{a}\]
    4. Applied simplify21.0

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}}{a}\]
    5. Applied simplify21.0

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{\sqrt{b/2 \cdot b/2 - a \cdot c} - b/2}}}{a}\]
    6. Taylor expanded around -inf 52.6

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{\left(\frac{1}{2} \cdot \frac{c \cdot a}{b/2} - b/2\right)} - b/2}}{a}\]
    7. Applied simplify41.5

      \[\leadsto \color{blue}{\frac{c}{\left(\frac{1}{2} \cdot a\right) \cdot \frac{c}{b/2} - \left(b/2 + b/2\right)}}\]
    8. Using strategy rm
    9. Applied expm1-log1p-u41.5

      \[\leadsto \frac{c}{\color{blue}{(e^{\log_* (1 + \left(\frac{1}{2} \cdot a\right) \cdot \frac{c}{b/2})} - 1)^*} - \left(b/2 + b/2\right)}\]

    if -1.170375490341468e-133 < b/2 < 5.969067876857501e+104

    1. Initial program 12.1

      \[\frac{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied clear-num12.3

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}}}\]

    if 5.969067876857501e+104 < b/2

    1. Initial program 46.2

      \[\frac{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]
    2. Taylor expanded around inf 9.4

      \[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot \frac{c \cdot a}{b/2} - 2 \cdot b/2}}{a}\]
    3. Applied simplify3.5

      \[\leadsto \color{blue}{\frac{\frac{1}{2}}{\frac{b/2}{c}} - b/2 \cdot \frac{2}{a}}\]
  3. Recombined 5 regimes into one program.

Runtime

Time bar (total: 41.6s)Debug logProfile

herbie shell --seed '#(1064173506 2580572819 2847706409 4129882574 1125180799 1845288547)' +o rules:numerics
(FPCore (a b/2 c)
  :name "quad2m (problem 3.2.1, negative)"
  (/ (- (- b/2) (sqrt (- (* b/2 b/2) (* a c)))) a))