\[\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: 21.5 s
Input Error: 16.0
Output Error: 2.7
Log:
Profile: 🕒
\(\begin{cases} \frac{b + \left(-\left(\frac{c \cdot 2}{\frac{b}{a}} - b\right)\right)}{a \cdot \left(-2\right)} & \text{when } b \le -1.3462214f+10 \\ \frac{\left(-\sqrt{{b}^2 - a \cdot \left(4 \cdot c\right)}\right) + b}{-2 \cdot a} & \text{when } b \le -1.4384158f-33 \\ \frac{c}{2} \cdot \frac{4}{\left(-b\right) - \sqrt{{b}^2 - \left(c \cdot a\right) \cdot 4}} & \text{when } b \le 1.6720318f+16 \\ \frac{c}{b} \cdot \frac{-2}{2} & \text{otherwise} \end{cases}\)

    if b < -1.3462214f+10

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

    8. Applied final simplification

    if -1.3462214f+10 < b < -1.4384158f-33

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

    if -1.4384158f-33 < b < 1.6720318f+16

    1. Started with
      \[\frac{\left(-b\right) + \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\]
      13.9
    2. Using strategy rm
      13.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}\]
      15.3
    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}\]
      6.5
    5. Using strategy rm
      6.5
    6. Applied *-un-lft-identity to get
      \[\frac{\frac{c \cdot \left(4 \cdot a\right)}{\color{red}{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}}{2 \cdot a} \leadsto \frac{\frac{c \cdot \left(4 \cdot a\right)}{\color{blue}{1 \cdot \left(\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}\right)}}}{2 \cdot a}\]
      6.5
    7. Applied times-frac to get
      \[\frac{\color{red}{\frac{c \cdot \left(4 \cdot a\right)}{1 \cdot \left(\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}\right)}}}{2 \cdot a} \leadsto \frac{\color{blue}{\frac{c}{1} \cdot \frac{4 \cdot a}{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}}{2 \cdot a}\]
      4.0
    8. Applied times-frac to get
      \[\color{red}{\frac{\frac{c}{1} \cdot \frac{4 \cdot a}{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}{2 \cdot a}} \leadsto \color{blue}{\frac{\frac{c}{1}}{2} \cdot \frac{\frac{4 \cdot a}{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}{a}}\]
      4.0
    9. Applied simplify to get
      \[\color{red}{\frac{\frac{c}{1}}{2}} \cdot \frac{\frac{4 \cdot a}{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}{a} \leadsto \color{blue}{\frac{c}{2}} \cdot \frac{\frac{4 \cdot a}{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}{a}\]
      4.0
    10. Applied simplify to get
      \[\frac{c}{2} \cdot \color{red}{\frac{\frac{4 \cdot a}{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}{a}} \leadsto \frac{c}{2} \cdot \color{blue}{\frac{4}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot c\right) \cdot a}}}\]
      4.0
    11. Applied simplify to get
      \[\frac{c}{2} \cdot \frac{4}{\color{red}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot c\right) \cdot a}}} \leadsto \frac{c}{2} \cdot \frac{4}{\color{blue}{\left(-b\right) - \sqrt{{b}^2 - \left(c \cdot a\right) \cdot 4}}}\]
      3.9

    if 1.6720318f+16 < b

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