Average Error: 33.2 → 7.0
Time: 31.2s
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 -4.788193143159137 \cdot 10^{+150}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le 1.2290816625658895 \cdot 10^{-172}:\\ \;\;\;\;\frac{c}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}\\ \mathbf{elif}\;b_2 \le 2.3119933765001658 \cdot 10^{+83}:\\ \;\;\;\;\frac{\sqrt[3]{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}} \cdot \sqrt[3]{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}{\frac{a}{\sqrt[3]{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2} \cdot \frac{c}{b_2} - \frac{b_2}{a} \cdot 2\\ \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 < -4.788193143159137e+150

    1. Initial program 62.3

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

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

    if -4.788193143159137e+150 < b_2 < 1.2290816625658895e-172

    1. Initial program 30.9

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied flip--31.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 associate-/l/35.9

      \[\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)}}\]
    5. Simplified20.6

      \[\leadsto \frac{\color{blue}{a \cdot c}}{a \cdot \left(\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}\]
    6. Using strategy rm
    7. Applied times-frac9.9

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

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

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

    if 1.2290816625658895e-172 < b_2 < 2.3119933765001658e+83

    1. Initial program 6.0

      \[\frac{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt7.1

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

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

    if 2.3119933765001658e+83 < b_2

    1. Initial program 43.4

      \[\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}{\frac{1}{2} \cdot \frac{c}{b_2} - 2 \cdot \frac{b_2}{a}}\]
  3. Recombined 4 regimes into one program.
  4. Final simplification7.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \le -4.788193143159137 \cdot 10^{+150}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le 1.2290816625658895 \cdot 10^{-172}:\\ \;\;\;\;\frac{c}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}\\ \mathbf{elif}\;b_2 \le 2.3119933765001658 \cdot 10^{+83}:\\ \;\;\;\;\frac{\sqrt[3]{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}} \cdot \sqrt[3]{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}{\frac{a}{\sqrt[3]{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2} \cdot \frac{c}{b_2} - \frac{b_2}{a} \cdot 2\\ \end{array}\]

Runtime

Time bar (total: 31.2s)Debug logProfile

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