Average Error: 33.2 → 8.9
Time: 1.2m
Precision: 64
Internal Precision: 3200
\[\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.1933251015531554 \cdot 10^{+36}:\\ \;\;\;\;\frac{c}{\frac{b/2}{\frac{-1}{2}}}\\ \mathbf{if}\;\frac{b/2}{\frac{-1}{2}} \le -1.5752718688682571 \cdot 10^{-145}:\\ \;\;\;\;\frac{\frac{c \cdot a}{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}}{a}\\ \mathbf{if}\;\frac{b/2}{\frac{-1}{2}} \le 2.9618134763810467 \cdot 10^{+85}:\\ \;\;\;\;\left(\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}\right) \cdot \frac{1}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{2} \cdot c}{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 4 regimes
  2. if (/ b/2 -1/2) < -1.1933251015531554e+36

    1. Initial program 55.5

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

      \[\leadsto \frac{\color{blue}{\frac{-1}{2} \cdot \frac{c \cdot a}{b/2}}}{a}\]
    3. Applied simplify4.3

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

    if -1.1933251015531554e+36 < (/ b/2 -1/2) < -1.5752718688682571e-145

    1. Initial program 36.3

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

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

    if -1.5752718688682571e-145 < (/ b/2 -1/2) < 2.9618134763810467e+85

    1. Initial program 11.5

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

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

    if 2.9618134763810467e+85 < (/ b/2 -1/2)

    1. Initial program 41.7

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

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

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

Runtime

Time bar (total: 1.2m)Debug logProfile

herbie shell --seed '#(1070609872 3456127585 2380521889 2328837196 1765472538 734540918)' 
(FPCore (a b/2 c)
  :name "quad2p (problem 3.2.1, positive)"
  (/ (+ (- b/2) (sqrt (- (* b/2 b/2) (* a c)))) a))