Average Error: 33.1 → 6.2
Time: 1.5m
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 -6.828935803399742 \cdot 10^{+153}:\\ \;\;\;\;\frac{\frac{1}{2} \cdot c}{b_2} - \left(\frac{b_2}{a} + \frac{b_2}{a}\right)\\ \mathbf{if}\;b_2 \le -2.692624266094629 \cdot 10^{-274}:\\ \;\;\;\;\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \mathbf{if}\;b_2 \le 1.7223601702853666 \cdot 10^{+122}:\\ \;\;\;\;\frac{c}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{\left(b_2 + b_2\right) - \frac{\frac{1}{2} \cdot a}{\frac{b_2}{c}}}\\ \end{array}\]

Error

Bits error versus a

Bits error versus b_2

Bits error versus c

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 4 regimes
  2. if b_2 < -6.828935803399742e+153

    1. Initial program 60.7

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

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

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

    if -6.828935803399742e+153 < b_2 < -2.692624266094629e-274

    1. Initial program 7.7

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]

    if -2.692624266094629e-274 < b_2 < 1.7223601702853666e+122

    1. Initial program 31.6

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}\]
    5. Using strategy rm
    6. Applied flip--31.7

      \[\leadsto \frac{1}{\frac{a}{\color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c} - b_2 \cdot b_2}{\sqrt{b_2 \cdot b_2 - a \cdot c} + b_2}}}}\]
    7. Applied associate-/r/31.8

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

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{c \cdot \left(-a\right)}} \cdot \left(\sqrt{b_2 \cdot b_2 - a \cdot c} + b_2\right)}\]
    9. Taylor expanded around 0 9.1

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

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

    if 1.7223601702853666e+122 < b_2

    1. Initial program 59.8

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}\]
    5. Using strategy rm
    6. Applied flip--59.9

      \[\leadsto \frac{1}{\frac{a}{\color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c} - b_2 \cdot b_2}{\sqrt{b_2 \cdot b_2 - a \cdot c} + b_2}}}}\]
    7. Applied associate-/r/59.9

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

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{c \cdot \left(-a\right)}} \cdot \left(\sqrt{b_2 \cdot b_2 - a \cdot c} + b_2\right)}\]
    9. Taylor expanded around inf 7.6

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

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

    \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;b_2 \le -6.828935803399742 \cdot 10^{+153}:\\ \;\;\;\;\frac{\frac{1}{2} \cdot c}{b_2} - \left(\frac{b_2}{a} + \frac{b_2}{a}\right)\\ \mathbf{if}\;b_2 \le -2.692624266094629 \cdot 10^{-274}:\\ \;\;\;\;\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\\ \mathbf{if}\;b_2 \le 1.7223601702853666 \cdot 10^{+122}:\\ \;\;\;\;\frac{c}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{\left(b_2 + b_2\right) - \frac{\frac{1}{2} \cdot a}{\frac{b_2}{c}}}\\ \end{array}}\]

Runtime

Time bar (total: 1.5m)Debug logProfile

herbie shell --seed 2018178 
(FPCore (a b_2 c)
  :name "quad2p (problem 3.2.1, positive)"
  (/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))