Average Error: 33.0 → 8.7
Time: 1.4m
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.004969258463693 \cdot 10^{+111}:\\ \;\;\;\;\frac{\frac{1}{2} \cdot c}{b_2} - \left(\frac{b_2}{a} + \frac{b_2}{a}\right)\\ \mathbf{if}\;b_2 \le 2.0545829980519752 \cdot 10^{-104}:\\ \;\;\;\;\frac{1}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}\\ \mathbf{if}\;b_2 \le 2.5859354153784275 \cdot 10^{+19}:\\ \;\;\;\;\frac{1}{\left(\sqrt{b_2 \cdot b_2 - a \cdot c} + b_2\right) \cdot \frac{a}{a \cdot \left(-c\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{\left(b_2 + b_2\right) - \frac{\frac{1}{2} \cdot a}{\frac{b_2}{c}}}\\ \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.004969258463693e+111

    1. Initial program 46.6

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

      \[\leadsto \frac{\left(-b_2\right) + \color{blue}{\left(\frac{1}{2} \cdot \frac{c \cdot a}{b_2} - b_2\right)}}{a}\]
    3. Applied simplify3.1

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

    if -1.004969258463693e+111 < b_2 < 2.0545829980519752e-104

    1. Initial program 11.6

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied clear-num11.7

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

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

    if 2.0545829980519752e-104 < b_2 < 2.5859354153784275e+19

    1. Initial program 37.8

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied clear-num37.8

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}}}\]
    4. Applied simplify37.8

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}\]
    5. Using strategy rm
    6. Applied flip--37.9

      \[\leadsto \frac{1}{\frac{a}{\color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c} - b_2 \cdot b_2}{\sqrt{b_2 \cdot b_2 - a \cdot c} + b_2}}}}\]
    7. Applied associate-/r/38.0

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c} - b_2 \cdot b_2} \cdot \left(\sqrt{b_2 \cdot b_2 - a \cdot c} + b_2\right)}}\]
    8. Applied simplify15.2

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

    if 2.5859354153784275e+19 < b_2

    1. Initial program 55.4

      \[\frac{\left(-b_2\right) + \sqrt{b_2 \cdot b_2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied clear-num55.4

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

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}}\]
    5. Using strategy rm
    6. Applied flip--55.4

      \[\leadsto \frac{1}{\frac{a}{\color{blue}{\frac{\sqrt{b_2 \cdot b_2 - a \cdot c} \cdot \sqrt{b_2 \cdot b_2 - a \cdot c} - b_2 \cdot b_2}{\sqrt{b_2 \cdot b_2 - a \cdot c} + b_2}}}}\]
    7. Applied associate-/r/55.4

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

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

      \[\leadsto \frac{1}{\frac{a}{c \cdot \left(-a\right)} \cdot \left(\color{blue}{\left(b_2 - \frac{1}{2} \cdot \frac{c \cdot a}{b_2}\right)} + b_2\right)}\]
    10. Applied simplify5.1

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

    \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;b_2 \le -1.004969258463693 \cdot 10^{+111}:\\ \;\;\;\;\frac{\frac{1}{2} \cdot c}{b_2} - \left(\frac{b_2}{a} + \frac{b_2}{a}\right)\\ \mathbf{if}\;b_2 \le 2.0545829980519752 \cdot 10^{-104}:\\ \;\;\;\;\frac{1}{\frac{a}{\sqrt{b_2 \cdot b_2 - a \cdot c} - b_2}}\\ \mathbf{if}\;b_2 \le 2.5859354153784275 \cdot 10^{+19}:\\ \;\;\;\;\frac{1}{\left(\sqrt{b_2 \cdot b_2 - a \cdot c} + b_2\right) \cdot \frac{a}{a \cdot \left(-c\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{\left(b_2 + b_2\right) - \frac{\frac{1}{2} \cdot a}{\frac{b_2}{c}}}\\ \end{array}}\]

Runtime

Time bar (total: 1.4m)Debug logProfile

herbie shell --seed 2018166 
(FPCore (a b_2 c)
  :name "quad2p (problem 3.2.1, positive)"
  (/ (+ (- b_2) (sqrt (- (* b_2 b_2) (* a c)))) a))