Average Error: 33.9 → 9.9
Time: 29.6s
Precision: 64
Internal Precision: 128
\[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b_2 \le -2.410267969009899 \cdot 10^{-98}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le 4.8539323749735836 \cdot 10^{+132}:\\ \;\;\;\;(\left(\frac{-1}{a}\right) \cdot \left(\sqrt{b_2 \cdot b_2 - c \cdot a}\right) + \left(-\frac{b_2}{a}\right))_*\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{b_2}{a}\right) - (\left(\frac{c}{b_2}\right) \cdot \frac{-1}{2} + \left(\frac{b_2}{a}\right))_*\\ \end{array}\]

Error

Bits error versus a

Bits error versus b_2

Bits error versus c

Derivation

  1. Split input into 3 regimes
  2. if b_2 < -2.410267969009899e-98

    1. Initial program 52.1

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

      \[\leadsto \color{blue}{\frac{-b_2}{a} - \frac{\sqrt{b_2 \cdot b_2 - a \cdot c}}{a}}\]
    4. Taylor expanded around -inf 10.0

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

    if -2.410267969009899e-98 < b_2 < 4.8539323749735836e+132

    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-sub11.8

      \[\leadsto \color{blue}{\frac{-b_2}{a} - \frac{\sqrt{b_2 \cdot b_2 - a \cdot c}}{a}}\]
    4. Using strategy rm
    5. Applied *-un-lft-identity11.8

      \[\leadsto \frac{-b_2}{a} - \color{blue}{1 \cdot \frac{\sqrt{b_2 \cdot b_2 - a \cdot c}}{a}}\]
    6. Applied div-inv11.9

      \[\leadsto \color{blue}{\left(-b_2\right) \cdot \frac{1}{a}} - 1 \cdot \frac{\sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    7. Applied prod-diff11.9

      \[\leadsto \color{blue}{(\left(-b_2\right) \cdot \left(\frac{1}{a}\right) + \left(-\frac{\sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \cdot 1\right))_* + (\left(-\frac{\sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\right) \cdot 1 + \left(\frac{\sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \cdot 1\right))_*}\]
    8. Simplified12.0

      \[\leadsto \color{blue}{(\left(\frac{-1}{a}\right) \cdot \left(\sqrt{b_2 \cdot b_2 - a \cdot c}\right) + \left(-\frac{b_2}{a}\right))_*} + (\left(-\frac{\sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\right) \cdot 1 + \left(\frac{\sqrt{b_2 \cdot b_2 - a \cdot c}}{a} \cdot 1\right))_*\]
    9. Simplified11.9

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

    if 4.8539323749735836e+132 < b_2

    1. Initial program 53.0

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

      \[\leadsto \color{blue}{\frac{-b_2}{a} - \frac{\sqrt{b_2 \cdot b_2 - a \cdot c}}{a}}\]
    4. Taylor expanded around inf 2.2

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

      \[\leadsto \frac{-b_2}{a} - \color{blue}{(\left(\frac{c}{b_2}\right) \cdot \frac{-1}{2} + \left(\frac{b_2}{a}\right))_*}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification9.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \le -2.410267969009899 \cdot 10^{-98}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le 4.8539323749735836 \cdot 10^{+132}:\\ \;\;\;\;(\left(\frac{-1}{a}\right) \cdot \left(\sqrt{b_2 \cdot b_2 - c \cdot a}\right) + \left(-\frac{b_2}{a}\right))_*\\ \mathbf{else}:\\ \;\;\;\;\left(-\frac{b_2}{a}\right) - (\left(\frac{c}{b_2}\right) \cdot \frac{-1}{2} + \left(\frac{b_2}{a}\right))_*\\ \end{array}\]

Runtime

Time bar (total: 29.6s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes34.09.95.628.484.9%
herbie shell --seed 2018354 +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))