\[\frac{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}{a}\]
Test:
NMSE problem 3.2.1, positive
Bits:
128 bits
Bits error versus a
Bits error versus b/2
Bits error versus c
Time: 13.6 s
Input Error: 34.4
Output Error: 5.9
Log:
Profile: 🕒
\(\begin{cases} -2 \cdot \frac{b/2}{a} & \text{when } b/2 \le -1.9477068539312885 \cdot 10^{+142} \\ \frac{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}{a} & \text{when } b/2 \le 4.025974820008425 \cdot 10^{-237} \\ \frac{1}{\frac{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}{c}} & \text{when } b/2 \le 2.2736054037680634 \cdot 10^{+124} \\ \frac{b/2 + \left(-b/2\right)}{a} - \frac{c}{\frac{b/2}{\frac{1}{2}}} & \text{otherwise} \end{cases}\)

    if b/2 < -1.9477068539312885e+142

    1. Started with
      \[\frac{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}{a}\]
      57.1
    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

    if -1.9477068539312885e+142 < b/2 < 4.025974820008425e-237

    1. Started with
      \[\frac{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}{a}\]
      9.7

    if 4.025974820008425e-237 < b/2 < 2.2736054037680634e+124

    1. Started with
      \[\frac{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}{a}\]
      37.6
    2. Using strategy rm
      37.6
    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}\]
      37.7
    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}\]
      15.9
    5. Using strategy rm
      15.9
    6. Applied clear-num to get
      \[\color{red}{\frac{\frac{a \cdot c}{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}}{a}} \leadsto \color{blue}{\frac{1}{\frac{a}{\frac{a \cdot c}{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}}}}\]
      16.2
    7. Applied simplify to get
      \[\frac{1}{\color{red}{\frac{a}{\frac{a \cdot c}{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}}}} \leadsto \frac{1}{\color{blue}{\frac{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - c \cdot a}}{c}}}\]
      7.7
    8. Applied simplify to get
      \[\frac{1}{\frac{\color{red}{\left(-b/2\right) - \sqrt{b/2 \cdot b/2 - c \cdot a}}}{c}} \leadsto \frac{1}{\frac{\color{blue}{\left(-b/2\right) - \sqrt{{b/2}^2 - a \cdot c}}}{c}}\]
      7.7

    if 2.2736054037680634e+124 < b/2

    1. Started with
      \[\frac{\left(-b/2\right) + \sqrt{{b/2}^2 - a \cdot c}}{a}\]
      60.5
    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(b/2 - \frac{1}{2} \cdot \frac{c \cdot a}{b/2}\right)}{a}\]
      40.4
    3. Taylor expanded around inf to get
      \[\frac{\left(-b/2\right) + \color{red}{\left(b/2 - \frac{1}{2} \cdot \frac{c \cdot a}{b/2}\right)}}{a} \leadsto \frac{\left(-b/2\right) + \color{blue}{\left(b/2 - \frac{1}{2} \cdot \frac{c \cdot a}{b/2}\right)}}{a}\]
      40.4
    4. Applied simplify to get
      \[\color{red}{\frac{\left(-b/2\right) + \left(b/2 - \frac{1}{2} \cdot \frac{c \cdot a}{b/2}\right)}{a}} \leadsto \color{blue}{\frac{b/2 + \left(-b/2\right)}{a} - \frac{c}{\frac{b/2}{\frac{1}{2}}}}\]
      0.1

  1. Removed slow pow expressions

Original test:


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