\[\frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
Test:
The quadratic formula (r1)
Bits:
128 bits
Bits error versus a
Bits error versus b
Bits error versus c
Time: 1.1 m
Input Error: 16.0
Output Error: 2.8
Log:
Profile: 🕒
\(\begin{cases} \frac{c}{b} - \frac{b}{a} & \text{when } b \le -1.8967889f+12 \\ \frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} & \text{when } b \le -5.8884015f-31 \\ \frac{\frac{4 \cdot a}{1} \cdot \frac{c}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a} & \text{when } b \le 4.607453f+16 \\ \frac{\frac{4}{2} \cdot c}{(\left(a \cdot 2\right) * \left(\frac{c}{b}\right) + \left(-b\right))_* - b} & \text{otherwise} \end{cases}\)

    if b < -1.8967889f+12

    1. Started with
      \[\frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
      21.7
    2. Applied taylor to get
      \[\frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \leadsto \frac{2 \cdot \frac{c \cdot a}{b} - 2 \cdot b}{2 \cdot a}\]
      5.7
    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}\]
      5.7
    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 -1.8967889f+12 < b < -5.8884015f-31

    1. Started with
      \[\frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
      3.9

    if -5.8884015f-31 < b < 4.607453f+16

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

    if 4.607453f+16 < b

    1. Started with
      \[\frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
      30.0
    2. Using strategy rm
      30.0
    3. Applied flip-+ to get
      \[\frac{\color{red}{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a} \leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^2 - {\left(\sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}\right)}^2}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}}}{2 \cdot a}\]
      30.8
    4. Applied simplify to get
      \[\frac{\frac{\color{red}{{\left(-b\right)}^2 - {\left(\sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}\right)}^2}}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a} \leadsto \frac{\frac{\color{blue}{\left(4 \cdot a\right) \cdot c}}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a}\]
      18.0
    5. Applied taylor to get
      \[\frac{\frac{\left(4 \cdot a\right) \cdot c}{\left(-b\right) - \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}}{2 \cdot a} \leadsto \frac{\frac{\left(4 \cdot a\right) \cdot c}{\left(-b\right) - \left(b - 2 \cdot \frac{c \cdot a}{b}\right)}}{2 \cdot a}\]
      7.9
    6. Taylor expanded around inf to get
      \[\frac{\frac{\left(4 \cdot a\right) \cdot c}{\left(-b\right) - \color{red}{\left(b - 2 \cdot \frac{c \cdot a}{b}\right)}}}{2 \cdot a} \leadsto \frac{\frac{\left(4 \cdot a\right) \cdot c}{\left(-b\right) - \color{blue}{\left(b - 2 \cdot \frac{c \cdot a}{b}\right)}}}{2 \cdot a}\]
      7.9
    7. Applied simplify to get
      \[\color{red}{\frac{\frac{\left(4 \cdot a\right) \cdot c}{\left(-b\right) - \left(b - 2 \cdot \frac{c \cdot a}{b}\right)}}{2 \cdot a}} \leadsto \color{blue}{\frac{\frac{1}{2} \cdot \left(4 \cdot c\right)}{(\left(a \cdot 2\right) * \left(\frac{c}{b}\right) + \left(-b\right))_* - b}}\]
      0.9
    8. Applied simplify to get
      \[\frac{\color{red}{\frac{1}{2} \cdot \left(4 \cdot c\right)}}{(\left(a \cdot 2\right) * \left(\frac{c}{b}\right) + \left(-b\right))_* - b} \leadsto \frac{\color{blue}{\frac{4}{2} \cdot c}}{(\left(a \cdot 2\right) * \left(\frac{c}{b}\right) + \left(-b\right))_* - b}\]
      0.7

  1. Removed slow pow expressions

Original test:


(lambda ((a default) (b default) (c default))
  #:name "The quadratic formula (r1)"
  (/ (+ (- 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))))))