\[\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: 18.6 s
Input Error: 17.6
Output Error: 3.4
Log:
Profile: 🕒
\(\begin{cases} \frac{\frac{c \cdot 2}{\frac{b}{a}} + \left(\left(-b\right) - b\right)}{a \cdot 2} & \text{when } b \le -3.840384f-10 \\ \frac{c}{2} \cdot \frac{4}{\left(-b\right) - \sqrt{{b}^2 - \left(c \cdot a\right) \cdot 4}} & \text{when } b \le 1.7973414f+17 \\ \frac{c}{b} \cdot \frac{-2}{2} & \text{otherwise} \end{cases}\)

    if b < -3.840384f-10

    1. Started with
      \[\frac{\left(-b\right) + \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\]
      17.3
    2. Using strategy rm
      17.3
    3. Applied *-un-lft-identity 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}{1 \cdot \left(\left(-b\right) + \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}\right)}}{2 \cdot a}\]
      17.3
    4. Applied times-frac to get
      \[\color{red}{\frac{1 \cdot \left(\left(-b\right) + \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}\right)}{2 \cdot a}} \leadsto \color{blue}{\frac{1}{2} \cdot \frac{\left(-b\right) + \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}{a}}\]
      17.3
    5. Applied taylor to get
      \[\frac{1}{2} \cdot \frac{\left(-b\right) + \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}{a} \leadsto \frac{1}{2} \cdot \frac{\left(-b\right) + \left(2 \cdot \frac{c \cdot a}{b} - b\right)}{a}\]
      4.6
    6. Taylor expanded around -inf to get
      \[\frac{1}{2} \cdot \frac{\left(-b\right) + \color{red}{\left(2 \cdot \frac{c \cdot a}{b} - b\right)}}{a} \leadsto \frac{1}{2} \cdot \frac{\left(-b\right) + \color{blue}{\left(2 \cdot \frac{c \cdot a}{b} - b\right)}}{a}\]
      4.6
    7. Applied simplify to get
      \[\color{red}{\frac{1}{2} \cdot \frac{\left(-b\right) + \left(2 \cdot \frac{c \cdot a}{b} - b\right)}{a}} \leadsto \color{blue}{\frac{\frac{c \cdot 2}{\frac{b}{a}} + \left(\left(-b\right) - b\right)}{a \cdot 2}}\]
      2.5

    if -3.840384f-10 < b < 1.7973414f+17

    1. Started with
      \[\frac{\left(-b\right) + \sqrt{{b}^2 - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}\]
      12.4
    2. Using strategy rm
      12.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}\]
      14.6
    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}\]
      7.6
    5. Using strategy rm
      7.6
    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}\]
      7.6
    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}\]
      5.7
    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}}\]
      5.7
    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}\]
      5.7
    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}}}\]
      5.7
    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}}}\]
      5.6

    if 1.7973414f+17 < b

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