\[\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: 1.4 m
Input Error: 37.2
Output Error: 6.8
Log:
Profile: 🕒
\(\begin{cases} \frac{c}{b} - \frac{b}{a} & \text{when } b \le -2.2913476789857995 \cdot 10^{+35} \\ \frac{\left(-\sqrt{{b}^2 - a \cdot \left(4 \cdot c\right)}\right) + b}{-2 \cdot a} & \text{when } b \le 2.890760014197913 \cdot 10^{-73} \\ \frac{c}{2} \cdot \frac{\frac{4}{2}}{c \cdot \frac{a}{b} - b} & \text{otherwise} \end{cases}\)

    if b < -2.2913476789857995e+35

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

    if -2.2913476789857995e+35 < b < 2.890760014197913e-73

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

    if 2.890760014197913e-73 < b

    1. Started with
      \[\frac{\left(-b\right) + \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\]
      58.4
    2. Using strategy rm
      58.4
    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}\]
      58.4
    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}\]
      34.7
    5. Using strategy rm
      34.7
    6. Applied div-inv 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}{\left(c \cdot \left(4 \cdot a\right)\right) \cdot \frac{1}{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}}{2 \cdot a}\]
      34.8
    7. Applied associate-/l* to get
      \[\color{red}{\frac{\left(c \cdot \left(4 \cdot a\right)\right) \cdot \frac{1}{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}{2 \cdot a}} \leadsto \color{blue}{\frac{c \cdot \left(4 \cdot a\right)}{\frac{2 \cdot a}{\frac{1}{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}}}\]
      33.9
    8. Applied taylor to get
      \[\frac{c \cdot \left(4 \cdot a\right)}{\frac{2 \cdot a}{\frac{1}{\left(-b\right) - \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}}} \leadsto \frac{c \cdot \left(4 \cdot a\right)}{\frac{2 \cdot a}{\frac{1}{2 \cdot \frac{c \cdot a}{b} - 2 \cdot b}}}\]
      18.3
    9. Taylor expanded around inf to get
      \[\frac{c \cdot \left(4 \cdot a\right)}{\frac{2 \cdot a}{\frac{1}{\color{red}{2 \cdot \frac{c \cdot a}{b} - 2 \cdot b}}}} \leadsto \frac{c \cdot \left(4 \cdot a\right)}{\frac{2 \cdot a}{\frac{1}{\color{blue}{2 \cdot \frac{c \cdot a}{b} - 2 \cdot b}}}}\]
      18.3
    10. Applied simplify to get
      \[\color{red}{\frac{c \cdot \left(4 \cdot a\right)}{\frac{2 \cdot a}{\frac{1}{2 \cdot \frac{c \cdot a}{b} - 2 \cdot b}}}} \leadsto \color{blue}{\frac{c}{\frac{2}{1}} \cdot \frac{\frac{4}{2}}{c \cdot \frac{a}{b} - b}}\]
      4.0
    11. Applied simplify to get
      \[\color{red}{\frac{c}{\frac{2}{1}}} \cdot \frac{\frac{4}{2}}{c \cdot \frac{a}{b} - b} \leadsto \color{blue}{\frac{c}{2}} \cdot \frac{\frac{4}{2}}{c \cdot \frac{a}{b} - b}\]
      4.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))))))