Average Error: 33.8 → 9.5
Time: 52.9s
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 -1.8467051498896273 \cdot 10^{+80}:\\ \;\;\;\;\frac{c}{\frac{\frac{1}{2} \cdot a}{\frac{b/2}{c}} - \left(b/2 + b/2\right)}\\ \mathbf{if}\;b/2 \le -6.8370322578253936 \cdot 10^{-105}:\\ \;\;\;\;\frac{\frac{c \cdot a}{\left(-b/2\right) + \sqrt{b/2 \cdot b/2 - a \cdot c}}}{a}\\ \mathbf{if}\;b/2 \le 2.0378291826148502 \cdot 10^{+43}:\\ \;\;\;\;\frac{(\left(\sqrt[3]{-b/2} \cdot \sqrt[3]{-b/2}\right) \cdot \left(\sqrt[3]{-b/2}\right) + \left(-\sqrt{b/2 \cdot b/2 - a \cdot c}\right))_*}{a}\\ \mathbf{else}:\\ \;\;\;\;(\left(\frac{c}{b/2}\right) \cdot \frac{1}{2} + \left(\left(-\frac{b/2}{a}\right) - \frac{b/2}{a}\right))_*\\ \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.8467051498896273e+80

    1. Initial program 57.9

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

      \[\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 simplify31.7

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

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

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

    if -1.8467051498896273e+80 < b/2 < -6.8370322578253936e-105

    1. Initial program 41.5

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

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

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

    if -6.8370322578253936e-105 < b/2 < 2.0378291826148502e+43

    1. Initial program 13.0

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

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{-b/2} \cdot \sqrt[3]{-b/2}\right) \cdot \sqrt[3]{-b/2}} - \sqrt{b/2 \cdot b/2 - a \cdot c}}{a}\]
    4. Applied fma-neg13.2

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

    if 2.0378291826148502e+43 < b/2

    1. Initial program 35.8

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

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

      \[\leadsto \color{blue}{(\left(\frac{c}{b/2}\right) \cdot \frac{1}{2} + \left(\left(-\frac{b/2}{a}\right) - \frac{b/2}{a}\right))_*}\]
  3. Recombined 4 regimes into one program.

Runtime

Time bar (total: 52.9s)Debug logProfile

herbie shell --seed '#(1064300848 3212030778 2049303162 3567222883 2277747821 1384278011)' +o rules:numerics
(FPCore (a b/2 c)
  :name "NMSE problem 3.2.1"
  (/ (- (- b/2) (sqrt (- (* b/2 b/2) (* a c)))) a))