Average Error: 33.6 → 9.6
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{\frac{1}{2}}{b/2} \le -1.2277015075077565 \cdot 10^{-52}:\\ \;\;\;\;\frac{\frac{c \cdot a}{\sqrt{b/2 \cdot b/2 - a \cdot c} - b/2}}{a}\\ \mathbf{if}\;\frac{\frac{1}{2}}{b/2} \le -2.502342506907938 \cdot 10^{-295}:\\ \;\;\;\;\frac{c}{\frac{b/2}{\frac{-1}{2}}}\\ \mathbf{if}\;\frac{\frac{1}{2}}{b/2} \le 6.884449900100117 \cdot 10^{-154}:\\ \;\;\;\;-2 \cdot \frac{b/2}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}{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 (/ 1/2 b/2) < -1.2277015075077565e-52

    1. Initial program 28.6

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

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

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

    if -1.2277015075077565e-52 < (/ 1/2 b/2) < -2.502342506907938e-295

    1. Initial program 56.8

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

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

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

    if -2.502342506907938e-295 < (/ 1/2 b/2) < 6.884449900100117e-154

    1. Initial program 60.7

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

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

    if 6.884449900100117e-154 < (/ 1/2 b/2)

    1. Initial program 9.5

      \[\frac{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]
  3. Recombined 4 regimes into one program.

Runtime

Time bar (total: 1.3m)Debug logProfile

herbie shell --seed '#(1070609872 3456127585 2380521889 2328837196 1765472538 734540918)' 
(FPCore (a b/2 c)
  :name "NMSE problem 3.2.1"
  (/ (- (- b/2) (sqrt (- (* b/2 b/2) (* a c)))) a))