\[\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: 23.8 s
Input Error: 34.1
Output Error: 7.0
Log:
Profile: 🕒
\(\begin{cases} \frac{-b}{a} & \text{when } b \le -2.668895794746948 \cdot 10^{+112} \\ \frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} & \text{when } b \le 1.4445095675228828 \cdot 10^{-303} \\ \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} & \text{when } b \le 1.3336442321324732 \cdot 10^{+29} \\ \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 < -2.668895794746948e+112

    1. Started with
      \[\frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\]
      48.9
    2. Applied taylor to get
      \[\frac{\left(-b\right) + \sqrt{{b}^2 - \left(4 \cdot a\right) \cdot c}}{2 \cdot a} \leadsto -1 \cdot \frac{b}{a}\]
      0
    3. Taylor expanded around -inf to get
      \[\color{red}{-1 \cdot \frac{b}{a}} \leadsto \color{blue}{-1 \cdot \frac{b}{a}}\]
      0
    4. Applied simplify to get
      \[\color{red}{-1 \cdot \frac{b}{a}} \leadsto \color{blue}{\frac{-b}{a}}\]
      0

    if -2.668895794746948e+112 < b < 1.4445095675228828e-303

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

    if 1.4445095675228828e-303 < b < 1.3336442321324732e+29

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

    if 1.3336442321324732e+29 < b

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

  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))))))