Average Error: 33.8 → 12.4
Time: 25.1s
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.860057971799534 \cdot 10^{+130}:\\ \;\;\;\;\frac{\frac{-1}{2} \cdot \frac{a \cdot c}{b_2}}{a}\\ \mathbf{elif}\;b_2 \le -1.5826573427766718 \cdot 10^{-98}:\\ \;\;\;\;\frac{a \cdot c}{\left(\sqrt{b_2 \cdot b_2 - a \cdot c} + \left(-b_2\right)\right) \cdot a}\\ \mathbf{elif}\;b_2 \le 1.7614678069962397 \cdot 10^{+81}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a}\\ \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 < -1.860057971799534e+130

    1. Initial program 60.2

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Initial simplification60.2

      \[\leadsto \frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    3. Taylor expanded around 0 60.2

      \[\leadsto \frac{\left(-b_2\right) - \sqrt{\color{blue}{{b_2}^{2} - a \cdot c}}}{a}\]
    4. Taylor expanded around -inf 13.9

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

    if -1.860057971799534e+130 < b_2 < -1.5826573427766718e-98

    1. Initial program 43.6

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Initial simplification43.6

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

      \[\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}\]
    5. Applied associate-/l/45.8

      \[\leadsto \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}}{a \cdot \left(\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}}\]
    6. Simplified16.9

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

    if -1.5826573427766718e-98 < b_2 < 1.7614678069962397e+81

    1. Initial program 12.4

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Initial simplification12.4

      \[\leadsto \frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    3. Using strategy rm
    4. Applied *-un-lft-identity12.4

      \[\leadsto \frac{\color{blue}{1 \cdot \left(\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}}{a}\]
    5. Applied associate-/l*12.6

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

    if 1.7614678069962397e+81 < b_2

    1. Initial program 41.4

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Initial simplification41.4

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \le -1.860057971799534 \cdot 10^{+130}:\\ \;\;\;\;\frac{\frac{-1}{2} \cdot \frac{a \cdot c}{b_2}}{a}\\ \mathbf{elif}\;b_2 \le -1.5826573427766718 \cdot 10^{-98}:\\ \;\;\;\;\frac{a \cdot c}{\left(\sqrt{b_2 \cdot b_2 - a \cdot c} + \left(-b_2\right)\right) \cdot a}\\ \mathbf{elif}\;b_2 \le 1.7614678069962397 \cdot 10^{+81}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a}\\ \end{array}\]

Runtime

Time bar (total: 25.1s)Debug logProfile

herbie shell --seed 2018249 
(FPCore (a b_2 c)
  :name "quad2m (problem 3.2.1, negative)"
  (/ (- (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))