\[\frac{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\]
Test:
NMSE p42, negative
Bits:
128 bits
Bits error versus a
Bits error versus b
Bits error versus c
Time: 15.6 s
Input Error: 17.6
Output Error: 2.8
Log:
Profile: 🕒
\(\begin{cases} \frac{c}{b} \cdot \frac{-2}{2} & \text{when } b \le -1.1439667f-08 \\ \frac{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{a \cdot 2} & \text{when } b \le 1.5139723f+14 \\ \frac{a \cdot \frac{c}{b} - b}{a} & \text{otherwise} \end{cases}\)

    if b < -1.1439667f-08

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

    if -1.1439667f-08 < b < 1.5139723f+14

    1. Started with
      \[\frac{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\]
      6.0
    2. Using strategy rm
      6.0
    3. Applied pow1 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}{{\left(\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}\right)}^{1}}}{2 \cdot a}\]
      6.0
    4. Applied taylor to get
      \[\frac{{\left(\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}\right)}^{1}}{2 \cdot a} \leadsto \frac{{\left(\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(c \cdot a\right)}\right)}^{1}}{2 \cdot a}\]
      6.0
    5. Taylor expanded around 0 to get
      \[\frac{{\left(\left(-b\right) - \sqrt{\color{red}{{b}^2 - 4 \cdot \left(c \cdot a\right)}}\right)}^{1}}{2 \cdot a} \leadsto \frac{{\left(\left(-b\right) - \sqrt{\color{blue}{{b}^2 - 4 \cdot \left(c \cdot a\right)}}\right)}^{1}}{2 \cdot a}\]
      6.0
    6. Applied simplify to get
      \[\color{red}{\frac{{\left(\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(c \cdot a\right)}\right)}^{1}}{2 \cdot a}} \leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}}\]
      6.0

    if 1.5139723f+14 < b

    1. Started with
      \[\frac{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\]
      23.2
    2. Using strategy rm
      23.2
    3. Applied pow1 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}{{\left(\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}\right)}^{1}}}{2 \cdot a}\]
      23.2
    4. Applied taylor to get
      \[\frac{{\left(\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}\right)}^{1}}{2 \cdot a} \leadsto \frac{{\left(2 \cdot \frac{c \cdot a}{b} - 2 \cdot b\right)}^{1}}{2 \cdot a}\]
      6.5
    5. Taylor expanded around inf to get
      \[\frac{{\color{red}{\left(2 \cdot \frac{c \cdot a}{b} - 2 \cdot b\right)}}^{1}}{2 \cdot a} \leadsto \frac{{\color{blue}{\left(2 \cdot \frac{c \cdot a}{b} - 2 \cdot b\right)}}^{1}}{2 \cdot a}\]
      6.5
    6. Applied simplify to get
      \[\color{red}{\frac{{\left(2 \cdot \frac{c \cdot a}{b} - 2 \cdot b\right)}^{1}}{2 \cdot a}} \leadsto \color{blue}{\frac{a \cdot \frac{c}{b} - b}{a}}\]
      0.7

  1. Removed slow pow expressions

Original test:


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