Average Error: 33.5 → 9.1
Time: 48.2s
Precision: 64
Internal Precision: 3456
\[\frac{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b/2 \le -7.119919606578702 \cdot 10^{+117}:\\ \;\;\;\;\frac{\frac{c}{b/2} \cdot \left(a \cdot \frac{1}{2}\right) + \left(\left(-b/2\right) - b/2\right)}{a}\\ \mathbf{if}\;b/2 \le 2.0822643182711032 \cdot 10^{-210}:\\ \;\;\;\;\frac{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\\ \mathbf{if}\;b/2 \le 3.3791250959750616 \cdot 10^{+104}:\\ \;\;\;\;\frac{\frac{c \cdot a}{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{\left(\left(-b/2\right) - b/2\right) + \left(\frac{1}{2} \cdot c\right) \cdot \frac{a}{b/2}}\\ \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 < -7.119919606578702e+117

    1. Initial program 49.0

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

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

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

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

    if -7.119919606578702e+117 < b/2 < 2.0822643182711032e-210

    1. Initial program 10.5

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

    if 2.0822643182711032e-210 < b/2 < 3.3791250959750616e+104

    1. Initial program 36.0

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

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

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

    if 3.3791250959750616e+104 < b/2

    1. Initial program 59.4

      \[\frac{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]
    2. Using strategy rm
    3. Applied flip-+59.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 simplify32.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 14.7

      \[\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 simplify2.2

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

Runtime

Time bar (total: 48.2s)Debug logProfile

herbie shell --seed '#(1064173506 2580572819 2847706409 4129882574 1125180799 1845288547)' 
(FPCore (a b/2 c)
  :name "quad2p (problem 3.2.1, positive)"
  (/ (+ (- b/2) (sqrt (- (* b/2 b/2) (* a c)))) a))