Average Error: 33.6 → 10.4
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}\;\frac{b/2}{\frac{-1}{2}} \le -1.8028950303622766 \cdot 10^{-143}:\\ \;\;\;\;\frac{c}{\left(-b/2\right) + (\left(\frac{c}{b/2}\right) \cdot \left(\frac{1}{2} \cdot a\right) + \left(-b/2\right))_*}\\ \mathbf{if}\;\frac{b/2}{\frac{-1}{2}} \le 3.385020990828352 \cdot 10^{+79}:\\ \;\;\;\;\frac{1}{\frac{a}{\sqrt{b/2 \cdot b/2 - a \cdot c} - b/2}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{\frac{1}{2}}{b/2} - \left(\frac{b/2}{a} + \frac{b/2}{a}\right)\\ \end{array}\]

Error

Bits error versus a

Bits error versus b/2

Bits error versus c

Derivation

  1. Split input into 3 regimes
  2. if (/ b/2 -1/2) < -1.8028950303622766e-143

    1. Initial program 50.6

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

      \[\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 simplify24.8

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}}{a}\]
    5. Taylor expanded around inf 23.3

      \[\leadsto \frac{\frac{c \cdot a}{\left(-b/2\right) - \color{blue}{\left(b/2 - \frac{1}{2} \cdot \frac{c \cdot a}{b/2}\right)}}}{a}\]
    6. Applied simplify12.0

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

    if -1.8028950303622766e-143 < (/ b/2 -1/2) < 3.385020990828352e+79

    1. Initial program 11.3

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

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

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{\sqrt{b/2 \cdot b/2 - a \cdot c} - b/2}}}\]

    if 3.385020990828352e+79 < (/ b/2 -1/2)

    1. Initial program 41.5

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

      \[\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 simplify4.4

      \[\leadsto \color{blue}{c \cdot \frac{\frac{1}{2}}{b/2} - \left(\frac{b/2}{a} + \frac{b/2}{a}\right)}\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 1.4m)Debug logProfile

herbie shell --seed '#(1071119240 1686926585 3481876196 78132896 2080707795 3185793749)' +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))