Average Error: 33.4 → 7.1
Time: 51.0s
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 -7.8403735318794505 \cdot 10^{+87}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le -7.699840002503048 \cdot 10^{-231}:\\ \;\;\;\;\left(c \cdot \sqrt[3]{a}\right) \cdot \frac{\sqrt[3]{\frac{1}{a}}}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}\\ \mathbf{elif}\;b_2 \le 2.9111076334177086 \cdot 10^{+142}:\\ \;\;\;\;\frac{-b_2}{a} - \frac{\sqrt{b_2 \cdot b_2 - c \cdot a}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot \frac{1}{2} - 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 < -7.8403735318794505e+87

    1. Initial program 58.1

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

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

    if -7.8403735318794505e+87 < b_2 < -7.699840002503048e-231

    1. Initial program 34.3

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

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

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}}\]
    5. Using strategy rm
    6. Applied div-inv34.4

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

      \[\leadsto \color{blue}{\frac{\frac{1}{a}}{\frac{1}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}}\]
    8. Using strategy rm
    9. Applied flip--34.5

      \[\leadsto \frac{\frac{1}{a}}{\frac{1}{\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}}}}}\]
    10. Applied associate-/r/34.7

      \[\leadsto \frac{\frac{1}{a}}{\color{blue}{\frac{1}{\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}} \cdot \left(\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}}\]
    11. Applied add-cube-cbrt35.0

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{\frac{1}{a}} \cdot \sqrt[3]{\frac{1}{a}}\right) \cdot \sqrt[3]{\frac{1}{a}}}}{\frac{1}{\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}} \cdot \left(\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}\right)}\]
    12. Applied times-frac35.0

      \[\leadsto \color{blue}{\frac{\sqrt[3]{\frac{1}{a}} \cdot \sqrt[3]{\frac{1}{a}}}{\frac{1}{\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}}} \cdot \frac{\sqrt[3]{\frac{1}{a}}}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}\]
    13. Simplified15.8

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

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

      \[\leadsto \color{blue}{\left({a}^{\frac{1}{3}} \cdot c\right)} \cdot \frac{\sqrt[3]{\frac{1}{a}}}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}\]
    16. Simplified10.0

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

    if -7.699840002503048e-231 < b_2 < 2.9111076334177086e+142

    1. Initial program 9.5

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

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

    if 2.9111076334177086e+142 < b_2

    1. Initial program 56.4

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \le -7.8403735318794505 \cdot 10^{+87}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le -7.699840002503048 \cdot 10^{-231}:\\ \;\;\;\;\left(c \cdot \sqrt[3]{a}\right) \cdot \frac{\sqrt[3]{\frac{1}{a}}}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}\\ \mathbf{elif}\;b_2 \le 2.9111076334177086 \cdot 10^{+142}:\\ \;\;\;\;\frac{-b_2}{a} - \frac{\sqrt{b_2 \cdot b_2 - c \cdot a}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b_2} \cdot \frac{1}{2} - 2 \cdot \frac{b_2}{a}\\ \end{array}\]

Runtime

Time bar (total: 51.0s)Debug logProfile

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