Average Error: 33.4 → 10.1
Time: 46.7s
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 -7.200245550033268 \cdot 10^{-104}:\\ \;\;\;\;\frac{c}{\frac{c}{b/2} \cdot \left(\frac{1}{2} \cdot a\right) - \left(b/2 - \left(-b/2\right)\right)}\\ \mathbf{if}\;b/2 \le 3.409351165504793 \cdot 10^{+65}:\\ \;\;\;\;\frac{-b/2}{a} - \frac{\sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\\ \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 3 regimes
  2. if b/2 < -7.200245550033268e-104

    1. Initial program 51.3

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

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

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

      \[\leadsto \color{blue}{\frac{c \cdot a}{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}} \cdot \frac{1}{a}}\]
    7. Taylor expanded around -inf 21.4

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

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

    if -7.200245550033268e-104 < b/2 < 3.409351165504793e+65

    1. Initial program 12.2

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

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

    if 3.409351165504793e+65 < b/2

    1. Initial program 38.1

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

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

Runtime

Time bar (total: 46.7s)Debug logProfile

herbie shell --seed '#(1070100504 930361288 1279167582 284574201 1450237281 2578255382)' 
(FPCore (a b/2 c)
  :name "NMSE problem 3.2.1"
  (/ (- (- b/2) (sqrt (- (* b/2 b/2) (* a c)))) a))