Average Error: 33.2 → 9.3
Time: 53.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 -6178373148497.949:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le -1.4795847427363915 \cdot 10^{-113}:\\ \;\;\;\;\left(\sqrt[3]{\frac{1}{a}} \cdot \left(\left(c \cdot a\right) \cdot \sqrt[3]{\frac{1}{a}}\right)\right) \cdot \frac{\sqrt[3]{\frac{1}{a}}}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}\\ \mathbf{elif}\;b_2 \le -8.195693387748483 \cdot 10^{-118}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le 1.2345555440908271 \cdot 10^{+84}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{{b_2}^{2} - c \cdot a}}{a}\\ \mathbf{else}:\\ \;\;\;\;(-2 \cdot \left(\frac{b_2}{a}\right) + \left(\frac{c}{\frac{b_2}{\frac{1}{2}}}\right))_*\\ \end{array}\]

Error

Bits error versus a

Bits error versus b_2

Bits error versus c

Derivation

  1. Split input into 4 regimes
  2. if b_2 < -6178373148497.949 or -1.4795847427363915e-113 < b_2 < -8.195693387748483e-118

    1. Initial program 54.6

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

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

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

    if -6178373148497.949 < b_2 < -1.4795847427363915e-113

    1. Initial program 37.1

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

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

      \[\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*37.2

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

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

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

      \[\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}}}}}\]
    11. Applied associate-/r/37.3

      \[\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)}}\]
    12. Applied add-cube-cbrt37.6

      \[\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)}\]
    13. Applied times-frac37.6

      \[\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}}}\]
    14. Simplified18.0

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

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

    if -8.195693387748483e-118 < b_2 < 1.2345555440908271e+84

    1. Initial program 11.8

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

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

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

    if 1.2345555440908271e+84 < b_2

    1. Initial program 43.5

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \le -6178373148497.949:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le -1.4795847427363915 \cdot 10^{-113}:\\ \;\;\;\;\left(\sqrt[3]{\frac{1}{a}} \cdot \left(\left(c \cdot a\right) \cdot \sqrt[3]{\frac{1}{a}}\right)\right) \cdot \frac{\sqrt[3]{\frac{1}{a}}}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}\\ \mathbf{elif}\;b_2 \le -8.195693387748483 \cdot 10^{-118}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{c}{b_2}\\ \mathbf{elif}\;b_2 \le 1.2345555440908271 \cdot 10^{+84}:\\ \;\;\;\;\frac{\left(-b_2\right) - \sqrt{{b_2}^{2} - c \cdot a}}{a}\\ \mathbf{else}:\\ \;\;\;\;(-2 \cdot \left(\frac{b_2}{a}\right) + \left(\frac{c}{\frac{b_2}{\frac{1}{2}}}\right))_*\\ \end{array}\]

Runtime

Time bar (total: 53.2s)Debug logProfile

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