Average Error: 33.1 → 10.1
Time: 36.4s
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 -7.959033818726528 \cdot 10^{+153}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a}\\ \mathbf{elif}\;b_2 \le 3.4392852604978317 \cdot 10^{-74}:\\ \;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - c \cdot a} + \left(-b_2\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{-2 \cdot \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 3 regimes
  2. if b_2 < -7.959033818726528e+153

    1. Initial program 60.9

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

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

    if -7.959033818726528e+153 < b_2 < 3.4392852604978317e-74

    1. Initial program 12.4

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

    if 3.4392852604978317e-74 < b_2

    1. Initial program 51.9

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b_2 \le -7.959033818726528 \cdot 10^{+153}:\\ \;\;\;\;-2 \cdot \frac{b_2}{a}\\ \mathbf{elif}\;b_2 \le 3.4392852604978317 \cdot 10^{-74}:\\ \;\;\;\;\frac{\sqrt{b_2 \cdot b_2 - c \cdot a} + \left(-b_2\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{-2 \cdot \frac{b_2}{c}}\\ \end{array}\]

Runtime

Time bar (total: 36.4s)Debug logProfile

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