\[\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a}\]
Test:
NMSE problem 3.2.1, negative
Bits:
128 bits
Bits error versus a
Bits error versus b/2
Bits error versus c
Time: 13.0 s
Input Error: 40.5
Output Error: 6.7
Log:
Profile: 🕒
\(\begin{cases} \frac{c}{\left(a \cdot \frac{1}{2}\right) \cdot \frac{c}{b/2} - \left(b/2 - \left(-b/2\right)\right)} & \text{when } b/2 \le -2.874810909131491 \cdot 10^{-160} \\ \frac{1}{\frac{a}{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}} & \text{when } b/2 \le 8.164018341878614 \cdot 10^{+86} \\ -2 \cdot \frac{b/2}{a} & \text{otherwise} \end{cases}\)

    if b/2 < -2.874810909131491e-160

    1. Started with
      \[\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a}\]
      59.2
    2. Using strategy rm
      59.2
    3. Applied flip-- to get
      \[\frac{\color{red}{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}}{a} \leadsto \frac{\color{blue}{\frac{{\left(-b/2\right)}^2 - {\left(\sqrt{{b/2}^2 - a \cdot c}\right)}^2}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}}}{a}\]
      59.2
    4. Applied simplify to get
      \[\frac{\frac{\color{red}{{\left(-b/2\right)}^2 - {\left(\sqrt{{b/2}^2 - a \cdot c}\right)}^2}}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}}{a} \leadsto \frac{\frac{\color{blue}{a \cdot c}}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}}{a}\]
      39.8
    5. Applied taylor to get
      \[\frac{\frac{a \cdot c}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}}{a} \leadsto \frac{\frac{a \cdot c}{\left(-b/2\right) + \left(\frac{1}{2} \cdot \frac{c \cdot a}{b/2} - b/2\right)}}{a}\]
      17.6
    6. Taylor expanded around -inf to get
      \[\frac{\frac{a \cdot c}{\left(-b/2\right) + \color{red}{\left(\frac{1}{2} \cdot \frac{c \cdot a}{b/2} - b/2\right)}}}{a} \leadsto \frac{\frac{a \cdot c}{\left(-b/2\right) + \color{blue}{\left(\frac{1}{2} \cdot \frac{c \cdot a}{b/2} - b/2\right)}}}{a}\]
      17.6
    7. Applied simplify to get
      \[\color{red}{\frac{\frac{a \cdot c}{\left(-b/2\right) + \left(\frac{1}{2} \cdot \frac{c \cdot a}{b/2} - b/2\right)}}{a}} \leadsto \color{blue}{\frac{c}{\left(a \cdot \frac{1}{2}\right) \cdot \frac{c}{b/2} - \left(b/2 - \left(-b/2\right)\right)}}\]
      5.7

    if -2.874810909131491e-160 < b/2 < 8.164018341878614e+86

    1. Started with
      \[\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a}\]
      11.3
    2. Using strategy rm
      11.3
    3. Applied clear-num to get
      \[\color{red}{\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a}} \leadsto \color{blue}{\frac{1}{\frac{a}{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}}}\]
      11.4

    if 8.164018341878614e+86 < b/2

    1. Started with
      \[\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a}\]
      44.6
    2. Applied taylor to get
      \[\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a} \leadsto -2 \cdot \frac{b/2}{a}\]
      0
    3. Taylor expanded around inf to get
      \[\color{red}{-2 \cdot \frac{b/2}{a}} \leadsto \color{blue}{-2 \cdot \frac{b/2}{a}}\]
      0

  1. Removed slow pow expressions

Original test:


(lambda ((a default) (b/2 default) (c default))
  #:name "NMSE problem 3.2.1, negative"
  (/ (- (- b/2) (sqrt (- (sqr b/2) (* a c)))) a))