Average Error: 33.4 → 6.5
Time: 1.3m
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}\;\frac{b/2}{\frac{-1}{2}} \le -1.602744556913015 \cdot 10^{+73}:\\ \;\;\;\;\frac{c}{\frac{\frac{1}{2} \cdot a}{\frac{b/2}{c}} - 2 \cdot b/2}\\ \mathbf{if}\;\frac{b/2}{\frac{-1}{2}} \le -2.0784881752531858 \cdot 10^{-254}:\\ \;\;\;\;\frac{1}{\frac{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - c \cdot a}}{c}}\\ \mathbf{if}\;\frac{b/2}{\frac{-1}{2}} \le 3.4996271880155585 \cdot 10^{+139}:\\ \;\;\;\;\frac{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}{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.602744556913015e+73

    1. Initial program 57.5

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

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

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

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

    if -1.602744556913015e+73 < (/ b/2 -1/2) < -2.0784881752531858e-254

    1. Initial program 33.3

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

      \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}}{a}\]
    5. Using strategy rm
    6. Applied clear-num17.1

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

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

    if -2.0784881752531858e-254 < (/ b/2 -1/2) < 3.4996271880155585e+139

    1. Initial program 9.2

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

    if 3.4996271880155585e+139 < (/ b/2 -1/2)

    1. Initial program 55.1

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

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

      \[\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.3m)Debug logProfile

herbie shell --seed '#(1070991898 1055468627 4280279443 640792587 928206309 3646738750)' 
(FPCore (a b/2 c)
  :name "quad2p (problem 3.2.1, positive)"
  (/ (+ (- b/2) (sqrt (- (* b/2 b/2) (* a c)))) a))