Average Error: 33.3 → 6.7
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 -4.08238009793696 \cdot 10^{+80}:\\ \;\;\;\;\frac{c}{\frac{b/2}{\frac{-1}{2}}}\\ \mathbf{if}\;b/2 \le -5.586135086711939 \cdot 10^{-287}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{b/2 \cdot b/2 - c \cdot a} + \left(-b/2\right)}{c}}\\ \mathbf{if}\;b/2 \le 2.766211155591128 \cdot 10^{+18}:\\ \;\;\;\;\left(\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - a \cdot c}\right) \cdot \frac{1}{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 < -4.08238009793696e+80

    1. Initial program 57.8

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

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

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

    if -4.08238009793696e+80 < b/2 < -5.586135086711939e-287

    1. Initial program 31.4

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

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

      \[\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 clear-num15.7

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

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

    if -5.586135086711939e-287 < b/2 < 2.766211155591128e+18

    1. Initial program 9.4

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

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

    if 2.766211155591128e+18 < b/2

    1. Initial program 32.9

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

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

Runtime

Time bar (total: 52.9s)Debug logProfile

herbie shell --seed '#(1070355188 2193211668 3977393919 3454156579 3755371326 1656365382)' 
(FPCore (a b/2 c)
  :name "NMSE problem 3.2.1"
  (/ (- (- b/2) (sqrt (- (* b/2 b/2) (* a c)))) a))