\[\frac{\left(-b\right) + \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\]
Test:
NMSE p42, positive
Bits:
128 bits
Bits error versus a
Bits error versus b
Bits error versus c
Time: 25.3 s
Input Error: 33.7
Output Error: 5.6
Log:
Profile: 🕒
\(\begin{cases} \frac{-b}{a} & \text{when } b \le -1.6281272861378632 \cdot 10^{+148} \\ \frac{\left(-\sqrt{{b}^2 - a \cdot \left(4 \cdot c\right)}\right) + b}{-2 \cdot a} & \text{when } b \le 7.593764942414574 \cdot 10^{-295} \\ \frac{1}{2} \cdot \frac{4 \cdot c}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}} & \text{when } b \le 2.993431952201985 \cdot 10^{+83} \\ \frac{c}{b} \cdot \frac{-2}{2} & \text{otherwise} \end{cases}\)

    if b < -1.6281272861378632e+148

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

    if -1.6281272861378632e+148 < b < 7.593764942414574e-295

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

    if 7.593764942414574e-295 < b < 2.993431952201985e+83

    1. Started with
      \[\frac{\left(-b\right) + \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\]
      31.9
    2. Using strategy rm
      31.9
    3. Applied flip-+ to get
      \[\frac{\color{red}{\left(-b\right) + \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}{2 \cdot a} \leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^2 - {\left(\sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}\right)}^2}{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}}{2 \cdot a}\]
      32.0
    4. Applied simplify to get
      \[\frac{\frac{\color{red}{{\left(-b\right)}^2 - {\left(\sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}\right)}^2}}{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}{2 \cdot a} \leadsto \frac{\frac{\color{blue}{c \cdot \left(4 \cdot a\right)}}{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}{2 \cdot a}\]
      16.2
    5. Using strategy rm
      16.2
    6. Applied *-un-lft-identity to get
      \[\frac{\color{red}{\frac{c \cdot \left(4 \cdot a\right)}{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}}{2 \cdot a} \leadsto \frac{\color{blue}{1 \cdot \frac{c \cdot \left(4 \cdot a\right)}{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}}{2 \cdot a}\]
      16.2
    7. Applied times-frac to get
      \[\color{red}{\frac{1 \cdot \frac{c \cdot \left(4 \cdot a\right)}{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}{2 \cdot a}} \leadsto \color{blue}{\frac{1}{2} \cdot \frac{\frac{c \cdot \left(4 \cdot a\right)}{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}{a}}\]
      16.2
    8. Applied simplify to get
      \[\frac{1}{2} \cdot \color{red}{\frac{\frac{c \cdot \left(4 \cdot a\right)}{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}{a}} \leadsto \frac{1}{2} \cdot \color{blue}{\frac{4 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - a \cdot \left(4 \cdot c\right)}}}\]
      9.2
    9. Applied simplify to get
      \[\frac{1}{2} \cdot \frac{4 \cdot c}{\color{red}{\left(-b\right) - \sqrt{b \cdot b - a \cdot \left(4 \cdot c\right)}}} \leadsto \frac{1}{2} \cdot \frac{4 \cdot c}{\color{blue}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}}\]
      9.2

    if 2.993431952201985e+83 < b

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

  1. Removed slow pow expressions

Original test:


(lambda ((a default) (b default) (c default))
  #:name "NMSE p42, positive"
  (/ (+ (- b) (sqrt (- (sqr b) (* 4 (* a c))))) (* 2 a))
  #:target
  (if (< b 0) (/ (+ (- b) (sqrt (- (sqr b) (* 4 (* a c))))) (* 2 a)) (/ c (* a (/ (- (- b) (sqrt (- (sqr b) (* 4 (* a c))))) (* 2 a))))))