Average Error: 34.1 → 7.7
Time: 16.5s
Precision: 64
Internal precision: 2176
\[\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b/2 \le -2.87424490884018 \cdot 10^{+81}:\\ \;\;\;\;\frac{c}{b/2} \cdot \frac{-1}{2}\\ \mathbf{if}\;b/2 \le -4.834287429638526 \cdot 10^{-103}:\\ \;\;\;\;\frac{\frac{c \cdot a}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}}{a}\\ \mathbf{if}\;b/2 \le 2.3106113327966147 \cdot 10^{+121}:\\ \;\;\;\;\left(\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}\right) \cdot \frac{1}{a}\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{b/2}{a}\right) - \left(\frac{b/2}{a} - \frac{c}{\frac{b/2}{\frac{1}{2}}}\right)\\ \end{array}\]

Error

Bits error versus a

Bits error versus b/2

Bits error versus c

Derivation

  1. Split input into 4 regimes.
  2. if b/2 < -2.87424490884018e+81

    1. Initial program 58.2

      \[\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a}\]
    2. Applied taylor 15.8

      \[\leadsto \frac{\frac{-1}{2} \cdot \frac{c \cdot a}{b/2}}{a}\]
    3. Taylor expanded around -inf 15.8

      \[\leadsto \frac{\color{blue}{\frac{-1}{2} \cdot \frac{c \cdot a}{b/2}}}{a}\]
    4. Applied simplify 0.0

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

    if -2.87424490884018e+81 < b/2 < -4.834287429638526e-103

    1. Initial program 41.2

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

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

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

    if -4.834287429638526e-103 < b/2 < 2.3106113327966147e+121

    1. Initial program 11.9

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

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

    if 2.3106113327966147e+121 < b/2

    1. Initial program 52.1

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

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

      \[\leadsto \left(\left(-b/2\right) - \left(b/2 - \frac{1}{2} \cdot \frac{c \cdot a}{b/2}\right)\right) \cdot \frac{1}{a}\]
    5. Taylor expanded around inf 13.5

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

      \[\leadsto \color{blue}{\left(-\frac{b/2}{a}\right) - \left(\frac{b/2}{a} - \frac{c}{\frac{b/2}{\frac{1}{2}}}\right)}\]
  3. Recombined 4 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 16.5s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1067901057 3396600083 3715501224 3126139233 3908045574 1593683916)'
(FPCore (a b/2 c)
  :name "quad2m (problem 3.2.1, negative)"
  (/ (- (- b/2) (sqrt (- (sqr b/2) (* a c)))) a))