Average Error: 33.6 → 9.0
Time: 3.4m
Precision: 64
Internal Precision: 3392
\[\frac{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]
\[\begin{array}{l} \mathbf{if}\;b/2 \le -2.4917218919267 \cdot 10^{+102}:\\ \;\;\;\;\frac{\frac{-c}{b/2}}{\frac{1}{\frac{1}{2}}}\\ \mathbf{if}\;b/2 \le -9.75028372252833 \cdot 10^{-244}:\\ \;\;\;\;\frac{1}{\frac{a}{c \cdot a} \cdot \left(\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}\right)}\\ \mathbf{if}\;b/2 \le 4.453225197274891 \cdot 10^{+74}:\\ \;\;\;\;\frac{\left(-b/2\right) - \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 4 regimes
  2. if b/2 < -2.4917218919267e+102

    1. Initial program 58.9

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

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

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

    if -2.4917218919267e+102 < b/2 < -9.75028372252833e-244

    1. Initial program 34.3

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

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

      \[\leadsto \frac{1}{\frac{a}{\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}}}}}\]
    6. Applied associate-/r/34.5

      \[\leadsto \frac{1}{\color{blue}{\frac{a}{\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}} \cdot \left(\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}\right)}}\]
    7. Applied simplify15.6

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

    if -9.75028372252833e-244 < b/2 < 4.453225197274891e+74

    1. Initial program 10.4

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

    if 4.453225197274891e+74 < b/2

    1. Initial program 40.6

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

Runtime

Time bar (total: 3.4m)Debug logProfile

herbie shell --seed '#(1939690843 327321720 555351923 2438475338 4053368242 4228276045)' 
(FPCore (a b/2 c)
  :name "NMSE problem 3.2.1"
  (/ (- (- b/2) (sqrt (- (* b/2 b/2) (* a c)))) a))