Average Error: 33.4 → 7.3
Time: 58.6s
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 -5.361121648143133 \cdot 10^{+118}:\\ \;\;\;\;-2 \cdot \frac{b/2}{a}\\ \mathbf{if}\;\frac{b/2}{\frac{-1}{2}} \le 1.4821026702883985 \cdot 10^{-303}:\\ \;\;\;\;\left(\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}\right) \cdot \frac{1}{a}\\ \mathbf{if}\;\frac{b/2}{\frac{-1}{2}} \le 9.520254021401762 \cdot 10^{+19}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{b/2 \cdot b/2 - c \cdot a} - b/2}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{\frac{b/2}{\frac{-1}{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 -1/2) < -5.361121648143133e+118

    1. Initial program 48.9

      \[\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}}\]

    if -5.361121648143133e+118 < (/ b/2 -1/2) < 1.4821026702883985e-303

    1. Initial program 9.1

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

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

    if 1.4821026702883985e-303 < (/ b/2 -1/2) < 9.520254021401762e+19

    1. Initial program 28.3

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

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

      \[\leadsto \frac{\frac{c \cdot a}{\color{blue}{\sqrt{b/2 \cdot b/2 - a \cdot c} - b/2}}}{a}\]
    6. Using strategy rm
    7. Applied clear-num17.8

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

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

    if 9.520254021401762e+19 < (/ b/2 -1/2)

    1. Initial program 55.6

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

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

Runtime

Time bar (total: 58.6s)Debug logProfile

herbie shell --seed '#(1070864556 424010669 783715395 1203517814 4070606583 4107618214)' 
(FPCore (a b/2 c)
  :name "NMSE problem 3.2.1"
  (/ (- (- b/2) (sqrt (- (* b/2 b/2) (* a c)))) a))