Average Error: 33.6 → 6.6
Time: 1.6m
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 -1.2686397944521473 \cdot 10^{+154}:\\ \;\;\;\;\frac{c}{\left(a \cdot \frac{1}{2}\right) \cdot \frac{c}{b_2} - \left(b_2 + b_2\right)}\\ \mathbf{if}\;b_2 \le 3.0773188623209565 \cdot 10^{-241}:\\ \;\;\;\;\frac{c}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}\\ \mathbf{if}\;b_2 \le 4.091699826456527 \cdot 10^{+100}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - c \cdot 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 < -1.2686397944521473e+154

    1. Initial program 62.9

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

      \[\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 simplify38.4

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

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

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{1 \cdot \left(\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2\right)}}}{a}\]
    8. Applied times-frac38.3

      \[\leadsto \frac{\color{blue}{\frac{c}{1} \cdot \frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{a}\]
    9. Applied associate-/l*38.3

      \[\leadsto \color{blue}{\frac{\frac{c}{1}}{\frac{a}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}}\]
    10. Applied simplify38.3

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

      \[\leadsto \frac{\frac{c}{1}}{\color{blue}{\left(\frac{1}{2} \cdot \frac{c \cdot a}{b_2} - b_2\right)} - b_2}\]
    12. Applied simplify1.4

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

    if -1.2686397944521473e+154 < b_2 < 3.0773188623209565e-241

    1. Initial program 32.9

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

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

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{a}\]
    6. Using strategy rm
    7. Applied *-un-lft-identity15.9

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{1 \cdot \left(\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2\right)}}}{a}\]
    8. Applied times-frac15.4

      \[\leadsto \frac{\color{blue}{\frac{c}{1} \cdot \frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}{a}\]
    9. Applied associate-/l*11.2

      \[\leadsto \color{blue}{\frac{\frac{c}{1}}{\frac{a}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}}\]
    10. Applied simplify8.5

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

    if 3.0773188623209565e-241 < b_2 < 4.091699826456527e+100

    1. Initial program 8.1

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

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

    if 4.091699826456527e+100 < b_2

    1. Initial program 45.6

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

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

    \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;b_2 \le -1.2686397944521473 \cdot 10^{+154}:\\ \;\;\;\;\frac{c}{\left(a \cdot \frac{1}{2}\right) \cdot \frac{c}{b_2} - \left(b_2 + b_2\right)}\\ \mathbf{if}\;b_2 \le 3.0773188623209565 \cdot 10^{-241}:\\ \;\;\;\;\frac{c}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}\\ \mathbf{if}\;b_2 \le 4.091699826456527 \cdot 10^{+100}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - c \cdot a}}}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a}\\ \end{array}}\]

Runtime

Time bar (total: 1.6m)Debug logProfile

herbie shell --seed '#(1072840222 1305617769 1692503039 1353360431 4178980589 1488672652)' +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))