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

    if b < -2.2913476789857995e+35

    1. Started with
      \[\frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
      38.1
    2. Using strategy rm
      38.1
    3. Applied clear-num to get
      \[\color{red}{\frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}} \leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}}}\]
      38.2
    4. Applied taylor to get
      \[\frac{1}{\frac{2 \cdot a}{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}} \leadsto \frac{1}{\frac{2 \cdot a}{2 \cdot \frac{c \cdot a}{b} - 2 \cdot b}}\]
      10.6
    5. Taylor expanded around -inf to get
      \[\frac{1}{\frac{2 \cdot a}{\color{red}{2 \cdot \frac{c \cdot a}{b} - 2 \cdot b}}} \leadsto \frac{1}{\frac{2 \cdot a}{\color{blue}{2 \cdot \frac{c \cdot a}{b} - 2 \cdot b}}}\]
      10.6
    6. Applied simplify to get
      \[\frac{1}{\frac{2 \cdot a}{2 \cdot \frac{c \cdot a}{b} - 2 \cdot b}} \leadsto \frac{1}{\frac{\frac{a}{1}}{a \cdot \frac{c}{b} - b}}\]
      3.1

    7. Applied final simplification
    8. Applied simplify to get
      \[\color{red}{\frac{1}{\frac{\frac{a}{1}}{a \cdot \frac{c}{b} - b}}} \leadsto \color{blue}{\frac{\frac{c}{b}}{1} - \frac{b}{a}}\]
      0.0

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

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

    if 2.890760014197913e-73 < b

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

    11. Applied final simplification
    12. Applied simplify to get
      \[\color{red}{\frac{\frac{1}{2}}{\frac{c}{b} \cdot a - b} \cdot \left(\frac{4 \cdot c}{2} \cdot \frac{a}{a}\right)} \leadsto \color{blue}{\frac{\frac{c \cdot 4}{2 \cdot 2}}{\frac{c}{\frac{b}{a}} - b}}\]
      3.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))))))