Average Error: 33.5 → 9.2
Time: 45.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 -4.129928245747817 \cdot 10^{+48}:\\ \;\;\;\;\frac{c}{b/2} \cdot \frac{-1}{2}\\ \mathbf{if}\;b/2 \le -1.7843931071382662 \cdot 10^{-121}:\\ \;\;\;\;\frac{\frac{c \cdot a}{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}}{a}\\ \mathbf{if}\;b/2 \le -1.1763897615806097 \cdot 10^{-133}:\\ \;\;\;\;\frac{c}{b/2} \cdot \frac{-1}{2}\\ \mathbf{if}\;b/2 \le 1.9051599359776491 \cdot 10^{+105}:\\ \;\;\;\;\frac{1}{\frac{a}{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{b/2}{a}\\ \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 < -4.129928245747817e+48 or -1.7843931071382662e-121 < b/2 < -1.1763897615806097e-133

    1. Initial program 55.4

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

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

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

    if -4.129928245747817e+48 < b/2 < -1.7843931071382662e-121

    1. Initial program 37.7

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

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

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

    if -1.1763897615806097e-133 < b/2 < 1.9051599359776491e+105

    1. Initial program 12.1

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

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

    if 1.9051599359776491e+105 < b/2

    1. Initial program 46.4

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

      \[\leadsto \color{blue}{-2 \cdot \frac{b/2}{a}}\]
  3. Recombined 4 regimes into one program.

Runtime

Time bar (total: 45.3s)Debug logProfile

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