\[\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a}\]
Test:
NMSE problem 3.2.1
Bits:
128 bits
Bits error versus a
Bits error versus b/2
Bits error versus c
Time: 13.1 s
Input Error: 16.1
Output Error: 2.4
Log:
Profile: 🕒
\(\begin{cases} \frac{b/2 + \left(-b/2\right)}{a} - \frac{1}{2} \cdot \frac{c}{b/2} & \text{when } b/2 \le -7.0905583f+15 \\ \frac{\frac{a}{1} \cdot \frac{c}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}}{a} & \text{when } b/2 \le -2.2375216f-37 \\ \frac{{\left(\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}\right)}^{1}}{a} & \text{when } b/2 \le 4.0821213f+08 \\ \frac{\frac{1}{2}}{\frac{b/2}{c}} - \frac{b/2}{a} \cdot 2 & \text{otherwise} \end{cases}\)

    if b/2 < -7.0905583f+15

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

    if -7.0905583f+15 < b/2 < -2.2375216f-37

    1. Started with
      \[\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{a}\]
      15.3
    2. Using strategy rm
      15.3
    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}\]
      16.6
    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}\]
      6.8
    5. Using strategy rm
      6.8
    6. Applied *-un-lft-identity to get
      \[\frac{\frac{a \cdot c}{\color{red}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}}}{a} \leadsto \frac{\frac{a \cdot c}{\color{blue}{1 \cdot \left(\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}\right)}}}{a}\]
      6.8
    7. Applied times-frac to get
      \[\frac{\color{red}{\frac{a \cdot c}{1 \cdot \left(\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}\right)}}}{a} \leadsto \frac{\color{blue}{\frac{a}{1} \cdot \frac{c}{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}}}{a}\]
      3.9

    if -2.2375216f-37 < b/2 < 4.0821213f+08

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

    if 4.0821213f+08 < b/2

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

  1. Removed slow pow expressions

Original test:


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