Average Error: 33.3 → 10.9
Time: 41.3s
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 -2.613229441070947 \cdot 10^{+45}:\\ \;\;\;\;\frac{\frac{b/2}{\frac{-1}{2}}}{a}\\ \mathbf{if}\;b/2 \le 1.2130749104231461 \cdot 10^{-142}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}}\\ \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 3 regimes
  2. if b/2 < -2.613229441070947e+45

    1. Initial program 36.5

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

      \[\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 simplify60.3

      \[\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 21.2

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{\frac{-1}{2} \cdot \frac{c \cdot a}{b/2}}}}{a}\]
    6. Applied simplify6.0

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

    if -2.613229441070947e+45 < b/2 < 1.2130749104231461e-142

    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 clear-num11.6

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

    if 1.2130749104231461e-142 < b/2

    1. Initial program 49.4

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

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

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

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

      \[\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 3 regimes into one program.

Runtime

Time bar (total: 41.3s)Debug logProfile

herbie shell --seed '#(1064397287 3527694221 3797617954 1138343853 2854031332 1153838279)' 
(FPCore (a b/2 c)
  :name "quad2p (problem 3.2.1, positive)"
  (/ (+ (- b/2) (sqrt (- (* b/2 b/2) (* a c)))) a))