Average Error: 33.8 → 6.9
Time: 1.2m
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.8765836124523342 \cdot 10^{+87}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le -2.1184861593584847 \cdot 10^{-212}:\\ \;\;\;\;\left(\sqrt[3]{\frac{c}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}} \cdot \sqrt[3]{\frac{c}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}\right) \cdot \sqrt[3]{\frac{c}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}\\ \mathbf{elif}\;b_2 \le 3.3298964342253374 \cdot 10^{+118}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{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

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.8765836124523342e+87

    1. Initial program 58.2

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

      \[\leadsto \frac{\color{blue}{\frac{-1}{2} \cdot \frac{c \cdot a}{b_2}}}{a}\]
    3. Applied simplify2.8

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

    if -1.8765836124523342e+87 < b_2 < -2.1184861593584847e-212

    1. Initial program 36.1

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

      \[\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 simplify16.7

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

      \[\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 add-cube-cbrt17.4

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

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

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

    if -2.1184861593584847e-212 < b_2 < 3.3298964342253374e+118

    1. Initial program 10.2

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

    if 3.3298964342253374e+118 < 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.1

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

Runtime

Time bar (total: 1.2m)Debug logProfile

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