Average Error: 32.7 → 8.8
Time: 1.3m
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}\;\frac{b_2}{\frac{-1}{2}} \le -1.5102327952834505 \cdot 10^{+120}:\\ \;\;\;\;\frac{c}{\frac{b_2}{\frac{-1}{2}}}\\ \mathbf{if}\;\frac{b_2}{\frac{-1}{2}} \le -1.1596077636613173 \cdot 10^{-262}:\\ \;\;\;\;\frac{\frac{a \cdot c}{\left(-b_2\right) - \sqrt{b_2 \cdot b_2 - a \cdot c}}}{a}\\ \mathbf{if}\;\frac{b_2}{\frac{-1}{2}} \le 6.185182159427462 \cdot 10^{+103}:\\ \;\;\;\;\frac{1}{\frac{a}{\sqrt{b_2 \cdot b_2 - c \cdot a} - b_2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{2} \cdot c}{b_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 -1/2) < -1.5102327952834505e+120

    1. Initial program 60.0

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

      \[\leadsto \frac{\color{blue}{\frac{-1}{2} \cdot \frac{a \cdot c}{b_2}}}{a}\]
    3. Applied simplify2.0

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

    if -1.5102327952834505e+120 < (/ b_2 -1/2) < -1.1596077636613173e-262

    1. Initial program 34.2

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

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

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

    if -1.1596077636613173e-262 < (/ b_2 -1/2) < 6.185182159427462e+103

    1. Initial program 8.9

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

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

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

    if 6.185182159427462e+103 < (/ b_2 -1/2)

    1. Initial program 44.5

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

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

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

Runtime

Time bar (total: 1.3m)Debug logProfile

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