Average Error: 33.4 → 9.2
Time: 1.4m
Precision: 64
Internal Precision: 3392
\[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b_2 \le -38520853.1134147:\\ \;\;\;\;\frac{c}{\frac{\frac{1}{2} \cdot c}{\frac{b_2}{a}} - \left(b_2 + b_2\right)}\\ \mathbf{if}\;b_2 \le -1.3469772442563848 \cdot 10^{-99}:\\ \;\;\;\;\frac{\frac{c \cdot a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}{a}\\ \mathbf{if}\;b_2 \le 1.3044801101345269 \cdot 10^{+122}:\\ \;\;\;\;\left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right) \cdot \frac{1}{a}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a}\\ \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 < -38520853.1134147

    1. Initial program 55.0

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

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

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}\]
    5. Applied simplify26.1

      \[\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 16.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 simplify5.7

      \[\leadsto \color{blue}{\frac{c}{\frac{\frac{1}{2} \cdot c}{\frac{b_2}{a}} - \left(b_2 + b_2\right)}}\]

    if -38520853.1134147 < b_2 < -1.3469772442563848e-99

    1. Initial program 38.2

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

      \[\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 simplify17.9

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}\]
    5. Applied simplify17.9

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{a}\]

    if -1.3469772442563848e-99 < b_2 < 1.3044801101345269e+122

    1. Initial program 11.8

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied div-inv11.9

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

    if 1.3044801101345269e+122 < b_2

    1. Initial program 50.1

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

      \[\leadsto \color{blue}{-2 \cdot \frac{b_2}{a}}\]
  3. Recombined 4 regimes into one program.

Runtime

Time bar (total: 1.4m)Debug logProfile

herbie shell --seed '#(1071821486 549052472 3784827256 1559736200 3548510075 881134285)' 
(FPCore (a b_2 c)
  :name "quad2m (problem 3.2.1, negative)"
  (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))