jeff quadratic root 2

Percentage Accurate: 72.2% → 90.6%
Time: 17.2s
Alternatives: 11
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\\ \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + t\_0}{2 \cdot a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (sqrt (- (* b b) (* (* 4.0 a) c)))))
   (if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_0)) (/ (+ (- b) t_0) (* 2.0 a)))))
double code(double a, double b, double c) {
	double t_0 = sqrt(((b * b) - ((4.0 * a) * c)));
	double tmp;
	if (b >= 0.0) {
		tmp = (2.0 * c) / (-b - t_0);
	} else {
		tmp = (-b + t_0) / (2.0 * a);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt(((b * b) - ((4.0d0 * a) * c)))
    if (b >= 0.0d0) then
        tmp = (2.0d0 * c) / (-b - t_0)
    else
        tmp = (-b + t_0) / (2.0d0 * a)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = Math.sqrt(((b * b) - ((4.0 * a) * c)));
	double tmp;
	if (b >= 0.0) {
		tmp = (2.0 * c) / (-b - t_0);
	} else {
		tmp = (-b + t_0) / (2.0 * a);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = math.sqrt(((b * b) - ((4.0 * a) * c)))
	tmp = 0
	if b >= 0.0:
		tmp = (2.0 * c) / (-b - t_0)
	else:
		tmp = (-b + t_0) / (2.0 * a)
	return tmp
function code(a, b, c)
	t_0 = sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))
	tmp = 0.0
	if (b >= 0.0)
		tmp = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_0));
	else
		tmp = Float64(Float64(Float64(-b) + t_0) / Float64(2.0 * a));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = sqrt(((b * b) - ((4.0 * a) * c)));
	tmp = 0.0;
	if (b >= 0.0)
		tmp = (2.0 * c) / (-b - t_0);
	else
		tmp = (-b + t_0) / (2.0 * a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[((-b) + t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\\
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + t\_0}{2 \cdot a}\\


\end{array}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 72.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\\ \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + t\_0}{2 \cdot a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (sqrt (- (* b b) (* (* 4.0 a) c)))))
   (if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_0)) (/ (+ (- b) t_0) (* 2.0 a)))))
double code(double a, double b, double c) {
	double t_0 = sqrt(((b * b) - ((4.0 * a) * c)));
	double tmp;
	if (b >= 0.0) {
		tmp = (2.0 * c) / (-b - t_0);
	} else {
		tmp = (-b + t_0) / (2.0 * a);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt(((b * b) - ((4.0d0 * a) * c)))
    if (b >= 0.0d0) then
        tmp = (2.0d0 * c) / (-b - t_0)
    else
        tmp = (-b + t_0) / (2.0d0 * a)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = Math.sqrt(((b * b) - ((4.0 * a) * c)));
	double tmp;
	if (b >= 0.0) {
		tmp = (2.0 * c) / (-b - t_0);
	} else {
		tmp = (-b + t_0) / (2.0 * a);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = math.sqrt(((b * b) - ((4.0 * a) * c)))
	tmp = 0
	if b >= 0.0:
		tmp = (2.0 * c) / (-b - t_0)
	else:
		tmp = (-b + t_0) / (2.0 * a)
	return tmp
function code(a, b, c)
	t_0 = sqrt(Float64(Float64(b * b) - Float64(Float64(4.0 * a) * c)))
	tmp = 0.0
	if (b >= 0.0)
		tmp = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_0));
	else
		tmp = Float64(Float64(Float64(-b) + t_0) / Float64(2.0 * a));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = sqrt(((b * b) - ((4.0 * a) * c)));
	tmp = 0.0;
	if (b >= 0.0)
		tmp = (2.0 * c) / (-b - t_0);
	else
		tmp = (-b + t_0) / (2.0 * a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[((-b) + t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\\
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\left(-b\right) + t\_0}{2 \cdot a}\\


\end{array}
\end{array}

Alternative 1: 90.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}\\ \mathbf{if}\;b \leq -1.05 \cdot 10^{+151}:\\ \;\;\;\;-\frac{b}{a}\\ \mathbf{elif}\;b \leq 1.6 \cdot 10^{+81}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_0 - b}{a \cdot 2}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -4} - b}{a \cdot 2}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (sqrt (- (* b b) (* c (* a 4.0))))))
   (if (<= b -1.05e+151)
     (- (/ b a))
     (if (<= b 1.6e+81)
       (if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_0)) (/ (- t_0 b) (* a 2.0)))
       (if (>= b 0.0)
         (/ (* 2.0 c) (* 2.0 (- (* a (/ c b)) b)))
         (/ (- (sqrt (* (* a c) -4.0)) b) (* a 2.0)))))))
double code(double a, double b, double c) {
	double t_0 = sqrt(((b * b) - (c * (a * 4.0))));
	double tmp;
	if (b <= -1.05e+151) {
		tmp = -(b / a);
	} else if (b <= 1.6e+81) {
		double tmp_1;
		if (b >= 0.0) {
			tmp_1 = (2.0 * c) / (-b - t_0);
		} else {
			tmp_1 = (t_0 - b) / (a * 2.0);
		}
		tmp = tmp_1;
	} else if (b >= 0.0) {
		tmp = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
	} else {
		tmp = (sqrt(((a * c) * -4.0)) - b) / (a * 2.0);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    real(8) :: tmp_1
    t_0 = sqrt(((b * b) - (c * (a * 4.0d0))))
    if (b <= (-1.05d+151)) then
        tmp = -(b / a)
    else if (b <= 1.6d+81) then
        if (b >= 0.0d0) then
            tmp_1 = (2.0d0 * c) / (-b - t_0)
        else
            tmp_1 = (t_0 - b) / (a * 2.0d0)
        end if
        tmp = tmp_1
    else if (b >= 0.0d0) then
        tmp = (2.0d0 * c) / (2.0d0 * ((a * (c / b)) - b))
    else
        tmp = (sqrt(((a * c) * (-4.0d0))) - b) / (a * 2.0d0)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = Math.sqrt(((b * b) - (c * (a * 4.0))));
	double tmp;
	if (b <= -1.05e+151) {
		tmp = -(b / a);
	} else if (b <= 1.6e+81) {
		double tmp_1;
		if (b >= 0.0) {
			tmp_1 = (2.0 * c) / (-b - t_0);
		} else {
			tmp_1 = (t_0 - b) / (a * 2.0);
		}
		tmp = tmp_1;
	} else if (b >= 0.0) {
		tmp = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
	} else {
		tmp = (Math.sqrt(((a * c) * -4.0)) - b) / (a * 2.0);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = math.sqrt(((b * b) - (c * (a * 4.0))))
	tmp = 0
	if b <= -1.05e+151:
		tmp = -(b / a)
	elif b <= 1.6e+81:
		tmp_1 = 0
		if b >= 0.0:
			tmp_1 = (2.0 * c) / (-b - t_0)
		else:
			tmp_1 = (t_0 - b) / (a * 2.0)
		tmp = tmp_1
	elif b >= 0.0:
		tmp = (2.0 * c) / (2.0 * ((a * (c / b)) - b))
	else:
		tmp = (math.sqrt(((a * c) * -4.0)) - b) / (a * 2.0)
	return tmp
function code(a, b, c)
	t_0 = sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0))))
	tmp = 0.0
	if (b <= -1.05e+151)
		tmp = Float64(-Float64(b / a));
	elseif (b <= 1.6e+81)
		tmp_1 = 0.0
		if (b >= 0.0)
			tmp_1 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_0));
		else
			tmp_1 = Float64(Float64(t_0 - b) / Float64(a * 2.0));
		end
		tmp = tmp_1;
	elseif (b >= 0.0)
		tmp = Float64(Float64(2.0 * c) / Float64(2.0 * Float64(Float64(a * Float64(c / b)) - b)));
	else
		tmp = Float64(Float64(sqrt(Float64(Float64(a * c) * -4.0)) - b) / Float64(a * 2.0));
	end
	return tmp
end
function tmp_3 = code(a, b, c)
	t_0 = sqrt(((b * b) - (c * (a * 4.0))));
	tmp = 0.0;
	if (b <= -1.05e+151)
		tmp = -(b / a);
	elseif (b <= 1.6e+81)
		tmp_2 = 0.0;
		if (b >= 0.0)
			tmp_2 = (2.0 * c) / (-b - t_0);
		else
			tmp_2 = (t_0 - b) / (a * 2.0);
		end
		tmp = tmp_2;
	elseif (b >= 0.0)
		tmp = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
	else
		tmp = (sqrt(((a * c) * -4.0)) - b) / (a * 2.0);
	end
	tmp_3 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, -1.05e+151], (-N[(b / a), $MachinePrecision]), If[LessEqual[b, 1.6e+81], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[(2.0 * N[(N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(N[(a * c), $MachinePrecision] * -4.0), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}\\
\mathbf{if}\;b \leq -1.05 \cdot 10^{+151}:\\
\;\;\;\;-\frac{b}{a}\\

\mathbf{elif}\;b \leq 1.6 \cdot 10^{+81}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_0 - b}{a \cdot 2}\\


\end{array}\\

\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -4} - b}{a \cdot 2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.05e151

    1. Initial program 33.7%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing
    3. Taylor expanded in b around -inf

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
      2. neg-lowering-neg.f64100.0

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    5. Simplified100.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    6. Taylor expanded in b around -inf

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-1 \cdot \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \end{array} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\mathsf{neg}\left(\frac{b}{a}\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{neg}\left(\frac{b}{a}\right)\\ \end{array} \]
      2. distribute-neg-frac2N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{b}{\mathsf{neg}\left(a\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{\mathsf{neg}\left(a\right)}\\ \end{array} \]
      3. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{\color{blue}{-1 \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{-1 \cdot a}\\ \end{array} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{b}{-1 \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{-1 \cdot a}\\ \end{array} \]
      5. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{\color{blue}{\mathsf{neg}\left(a\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{\mathsf{neg}\left(a\right)}\\ \end{array} \]
      6. neg-lowering-neg.f64100.0

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{\color{blue}{-a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    8. Simplified100.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{b}{-a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    9. Taylor expanded in b around 0

      \[\leadsto \color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;b \geq 0:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ } \end{array}} \]
    10. Step-by-step derivation
      1. if-sameN/A

        \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{b}{a}\right)} \]
      3. distribute-neg-frac2N/A

        \[\leadsto \color{blue}{\frac{b}{\mathsf{neg}\left(a\right)}} \]
      4. mul-1-negN/A

        \[\leadsto \frac{b}{\color{blue}{-1 \cdot a}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{b}{-1 \cdot a}} \]
      6. mul-1-negN/A

        \[\leadsto \frac{b}{\color{blue}{\mathsf{neg}\left(a\right)}} \]
      7. neg-lowering-neg.f64100.0

        \[\leadsto \frac{b}{\color{blue}{-a}} \]
    11. Simplified100.0%

      \[\leadsto \color{blue}{\frac{b}{-a}} \]

    if -1.05e151 < b < 1.6e81

    1. Initial program 87.5%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing

    if 1.6e81 < b

    1. Initial program 44.8%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\left(b + -2 \cdot \frac{a \cdot c}{b}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(b + -2 \cdot \frac{a \cdot c}{b}\right)}\\ \end{array} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\left(-2 \cdot \frac{a \cdot c}{b} + b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(-2 \cdot \frac{a \cdot c}{b} + b\right)}\\ \end{array} \]
      2. associate-*r/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{-2 \cdot \left(a \cdot c\right)}{b}} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \left(a \cdot c\right)}{b} + b\right)}\\ \end{array} \]
      3. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \color{blue}{\left(c \cdot a\right)}}{b} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \left(c \cdot a\right)}{b} + b\right)}\\ \end{array} \]
      4. associate-*r*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{\color{blue}{\left(-2 \cdot c\right) \cdot a}}{b} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{\left(-2 \cdot c\right) \cdot a}{b} + b\right)}\\ \end{array} \]
      5. associate-*l/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{-2 \cdot c}{b} \cdot a} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot c}{b} \cdot a + b\right)}\\ \end{array} \]
      6. associate-*r/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\left(-2 \cdot \frac{c}{b}\right)} \cdot a + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\left(-2 \cdot \frac{c}{b}\right) \cdot a + b\right)}\\ \end{array} \]
      7. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\left(\frac{c}{b} \cdot -2\right)} \cdot a + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\left(\frac{c}{b} \cdot -2\right) \cdot a + b\right)}\\ \end{array} \]
      8. associate-*l*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{c}{b} \cdot \left(-2 \cdot a\right)} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{c}{b} \cdot \left(-2 \cdot a\right) + b\right)}\\ \end{array} \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      10. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\color{blue}{\frac{c}{b}}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      11. *-lowering-*.f6498.4

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, \color{blue}{-2 \cdot a}, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    5. Simplified98.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{\mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    6. Taylor expanded in b around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      3. *-lowering-*.f6498.4

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
    8. Simplified98.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
    9. Taylor expanded in c around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}\\ \end{array} \]
    10. Step-by-step derivation
      1. distribute-lft-out--N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}\\ \end{array} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}\\ \end{array} \]
      3. --lowering--.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \color{blue}{\left(\frac{a \cdot c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}\\ \end{array} \]
      4. associate-/l*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\color{blue}{a \cdot \frac{c}{b}} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \end{array} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\color{blue}{a \cdot \frac{c}{b}} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \end{array} \]
      6. /-lowering-/.f6498.4

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \color{blue}{\frac{c}{b}} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
    11. Simplified98.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.05 \cdot 10^{+151}:\\ \;\;\;\;-\frac{b}{a}\\ \mathbf{elif}\;b \leq 1.6 \cdot 10^{+81}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -4} - b}{a \cdot 2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 81.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\left(a \cdot c\right) \cdot -4}\\ t_1 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_0 - b}{a \cdot 2}\\ \end{array}\\ \mathbf{if}\;b \leq -5 \cdot 10^{-76}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, a \cdot -2, b\right)}\\ \mathbf{else}:\\ \;\;\;\;-\mathsf{fma}\left(b, -\frac{c}{b \cdot b}, \frac{b}{a}\right)\\ \end{array}\\ \mathbf{elif}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 9.5 \cdot 10^{-92}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{b + b}{a \cdot \left(-2\right)}\\ \end{array}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (sqrt (* (* a c) -4.0)))
        (t_1
         (if (>= b 0.0)
           (/ (* 2.0 c) (* 2.0 (- (* a (/ c b)) b)))
           (/ (- t_0 b) (* a 2.0)))))
   (if (<= b -5e-76)
     (if (>= b 0.0)
       (/ (* 2.0 c) (- (- b) (fma (/ c b) (* a -2.0) b)))
       (- (fma b (- (/ c (* b b))) (/ b a))))
     (if (<= b -5e-310)
       t_1
       (if (<= b 9.5e-92)
         (if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_0)) (/ (+ b b) (* a (- 2.0))))
         t_1)))))
double code(double a, double b, double c) {
	double t_0 = sqrt(((a * c) * -4.0));
	double tmp;
	if (b >= 0.0) {
		tmp = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
	} else {
		tmp = (t_0 - b) / (a * 2.0);
	}
	double t_1 = tmp;
	double tmp_2;
	if (b <= -5e-76) {
		double tmp_3;
		if (b >= 0.0) {
			tmp_3 = (2.0 * c) / (-b - fma((c / b), (a * -2.0), b));
		} else {
			tmp_3 = -fma(b, -(c / (b * b)), (b / a));
		}
		tmp_2 = tmp_3;
	} else if (b <= -5e-310) {
		tmp_2 = t_1;
	} else if (b <= 9.5e-92) {
		double tmp_4;
		if (b >= 0.0) {
			tmp_4 = (2.0 * c) / (-b - t_0);
		} else {
			tmp_4 = (b + b) / (a * -2.0);
		}
		tmp_2 = tmp_4;
	} else {
		tmp_2 = t_1;
	}
	return tmp_2;
}
function code(a, b, c)
	t_0 = sqrt(Float64(Float64(a * c) * -4.0))
	tmp = 0.0
	if (b >= 0.0)
		tmp = Float64(Float64(2.0 * c) / Float64(2.0 * Float64(Float64(a * Float64(c / b)) - b)));
	else
		tmp = Float64(Float64(t_0 - b) / Float64(a * 2.0));
	end
	t_1 = tmp
	tmp_2 = 0.0
	if (b <= -5e-76)
		tmp_3 = 0.0
		if (b >= 0.0)
			tmp_3 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - fma(Float64(c / b), Float64(a * -2.0), b)));
		else
			tmp_3 = Float64(-fma(b, Float64(-Float64(c / Float64(b * b))), Float64(b / a)));
		end
		tmp_2 = tmp_3;
	elseif (b <= -5e-310)
		tmp_2 = t_1;
	elseif (b <= 9.5e-92)
		tmp_4 = 0.0
		if (b >= 0.0)
			tmp_4 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_0));
		else
			tmp_4 = Float64(Float64(b + b) / Float64(a * Float64(-2.0)));
		end
		tmp_2 = tmp_4;
	else
		tmp_2 = t_1;
	end
	return tmp_2
end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(a * c), $MachinePrecision] * -4.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[(2.0 * N[(N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]}, If[LessEqual[b, -5e-76], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - N[(N[(c / b), $MachinePrecision] * N[(a * -2.0), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(b * (-N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision]) + N[(b / a), $MachinePrecision]), $MachinePrecision])], If[LessEqual[b, -5e-310], t$95$1, If[LessEqual[b, 9.5e-92], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(b + b), $MachinePrecision] / N[(a * (-2.0)), $MachinePrecision]), $MachinePrecision]], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{\left(a \cdot c\right) \cdot -4}\\
t_1 := \begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_0 - b}{a \cdot 2}\\


\end{array}\\
\mathbf{if}\;b \leq -5 \cdot 10^{-76}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, a \cdot -2, b\right)}\\

\mathbf{else}:\\
\;\;\;\;-\mathsf{fma}\left(b, -\frac{c}{b \cdot b}, \frac{b}{a}\right)\\


\end{array}\\

\mathbf{elif}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 9.5 \cdot 10^{-92}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{b + b}{a \cdot \left(-2\right)}\\


\end{array}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -4.9999999999999998e-76

    1. Initial program 62.3%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\left(b + -2 \cdot \frac{a \cdot c}{b}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(b + -2 \cdot \frac{a \cdot c}{b}\right)}\\ \end{array} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\left(-2 \cdot \frac{a \cdot c}{b} + b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(-2 \cdot \frac{a \cdot c}{b} + b\right)}\\ \end{array} \]
      2. associate-*r/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{-2 \cdot \left(a \cdot c\right)}{b}} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \left(a \cdot c\right)}{b} + b\right)}\\ \end{array} \]
      3. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \color{blue}{\left(c \cdot a\right)}}{b} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \left(c \cdot a\right)}{b} + b\right)}\\ \end{array} \]
      4. associate-*r*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{\color{blue}{\left(-2 \cdot c\right) \cdot a}}{b} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{\left(-2 \cdot c\right) \cdot a}{b} + b\right)}\\ \end{array} \]
      5. associate-*l/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{-2 \cdot c}{b} \cdot a} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot c}{b} \cdot a + b\right)}\\ \end{array} \]
      6. associate-*r/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\left(-2 \cdot \frac{c}{b}\right)} \cdot a + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\left(-2 \cdot \frac{c}{b}\right) \cdot a + b\right)}\\ \end{array} \]
      7. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\left(\frac{c}{b} \cdot -2\right)} \cdot a + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\left(\frac{c}{b} \cdot -2\right) \cdot a + b\right)}\\ \end{array} \]
      8. associate-*l*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{c}{b} \cdot \left(-2 \cdot a\right)} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{c}{b} \cdot \left(-2 \cdot a\right) + b\right)}\\ \end{array} \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      10. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\color{blue}{\frac{c}{b}}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      11. *-lowering-*.f6462.3

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, \color{blue}{-2 \cdot a}, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    5. Simplified62.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{\mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    6. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\color{blue}{\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \end{array} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\color{blue}{2 \cdot c}}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      5. +-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \end{array} \]
      6. unsub-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \end{array} \]
    7. Applied egg-rr62.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{2 \cdot a}{\sqrt{\mathsf{fma}\left(a, -4 \cdot c, b \cdot b\right)} - b}}\\ \end{array} \]
    8. Taylor expanded in b around -inf

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      3. distribute-lft-inN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      4. associate-*r/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      5. *-rgt-identityN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      7. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      8. neg-lowering-neg.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      9. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      10. unpow2N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      11. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      12. /-lowering-/.f6490.6

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;-\mathsf{fma}\left(b, -\frac{c}{b \cdot b}, \frac{b}{a}\right)\\ \end{array} \]
    10. Simplified90.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;-\mathsf{fma}\left(b, -\frac{c}{b \cdot b}, \frac{b}{a}\right)\\ \end{array} \]

    if -4.9999999999999998e-76 < b < -4.999999999999985e-310 or 9.49999999999999946e-92 < b

    1. Initial program 64.9%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\left(b + -2 \cdot \frac{a \cdot c}{b}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(b + -2 \cdot \frac{a \cdot c}{b}\right)}\\ \end{array} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\left(-2 \cdot \frac{a \cdot c}{b} + b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(-2 \cdot \frac{a \cdot c}{b} + b\right)}\\ \end{array} \]
      2. associate-*r/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{-2 \cdot \left(a \cdot c\right)}{b}} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \left(a \cdot c\right)}{b} + b\right)}\\ \end{array} \]
      3. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \color{blue}{\left(c \cdot a\right)}}{b} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \left(c \cdot a\right)}{b} + b\right)}\\ \end{array} \]
      4. associate-*r*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{\color{blue}{\left(-2 \cdot c\right) \cdot a}}{b} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{\left(-2 \cdot c\right) \cdot a}{b} + b\right)}\\ \end{array} \]
      5. associate-*l/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{-2 \cdot c}{b} \cdot a} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot c}{b} \cdot a + b\right)}\\ \end{array} \]
      6. associate-*r/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\left(-2 \cdot \frac{c}{b}\right)} \cdot a + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\left(-2 \cdot \frac{c}{b}\right) \cdot a + b\right)}\\ \end{array} \]
      7. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\left(\frac{c}{b} \cdot -2\right)} \cdot a + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\left(\frac{c}{b} \cdot -2\right) \cdot a + b\right)}\\ \end{array} \]
      8. associate-*l*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{c}{b} \cdot \left(-2 \cdot a\right)} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{c}{b} \cdot \left(-2 \cdot a\right) + b\right)}\\ \end{array} \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      10. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\color{blue}{\frac{c}{b}}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      11. *-lowering-*.f6481.5

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, \color{blue}{-2 \cdot a}, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    5. Simplified81.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{\mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    6. Taylor expanded in b around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      3. *-lowering-*.f6478.3

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
    8. Simplified78.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
    9. Taylor expanded in c around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}\\ \end{array} \]
    10. Step-by-step derivation
      1. distribute-lft-out--N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}\\ \end{array} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}\\ \end{array} \]
      3. --lowering--.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \color{blue}{\left(\frac{a \cdot c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}\\ \end{array} \]
      4. associate-/l*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\color{blue}{a \cdot \frac{c}{b}} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \end{array} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\color{blue}{a \cdot \frac{c}{b}} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \end{array} \]
      6. /-lowering-/.f6478.3

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \color{blue}{\frac{c}{b}} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
    11. Simplified78.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]

    if -4.999999999999985e-310 < b < 9.49999999999999946e-92

    1. Initial program 90.2%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing
    3. Taylor expanded in b around -inf

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
      2. neg-lowering-neg.f6490.2

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    5. Simplified90.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    6. Taylor expanded in b around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{-4 \cdot \left(a \cdot c\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{-4 \cdot \left(a \cdot c\right)}}\\ \end{array} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      3. *-lowering-*.f6485.5

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\color{blue}{\left(a \cdot c\right)} \cdot -4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    8. Simplified85.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification83.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-76}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, a \cdot -2, b\right)}\\ \mathbf{else}:\\ \;\;\;\;-\mathsf{fma}\left(b, -\frac{c}{b \cdot b}, \frac{b}{a}\right)\\ \end{array}\\ \mathbf{elif}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -4} - b}{a \cdot 2}\\ \end{array}\\ \mathbf{elif}\;b \leq 9.5 \cdot 10^{-92}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b + b}{a \cdot \left(-2\right)}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -4} - b}{a \cdot 2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 81.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\left(a \cdot c\right) \cdot -4}\\ t_1 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_0 - b}{a \cdot 2}\\ \end{array}\\ \mathbf{if}\;b \leq -4.8 \cdot 10^{-76}:\\ \;\;\;\;-\frac{b}{a}\\ \mathbf{elif}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 3.5 \cdot 10^{-79}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{b + b}{a \cdot \left(-2\right)}\\ \end{array}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (sqrt (* (* a c) -4.0)))
        (t_1
         (if (>= b 0.0)
           (/ (* 2.0 c) (* 2.0 (- (* a (/ c b)) b)))
           (/ (- t_0 b) (* a 2.0)))))
   (if (<= b -4.8e-76)
     (- (/ b a))
     (if (<= b -5e-310)
       t_1
       (if (<= b 3.5e-79)
         (if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_0)) (/ (+ b b) (* a (- 2.0))))
         t_1)))))
double code(double a, double b, double c) {
	double t_0 = sqrt(((a * c) * -4.0));
	double tmp;
	if (b >= 0.0) {
		tmp = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
	} else {
		tmp = (t_0 - b) / (a * 2.0);
	}
	double t_1 = tmp;
	double tmp_1;
	if (b <= -4.8e-76) {
		tmp_1 = -(b / a);
	} else if (b <= -5e-310) {
		tmp_1 = t_1;
	} else if (b <= 3.5e-79) {
		double tmp_2;
		if (b >= 0.0) {
			tmp_2 = (2.0 * c) / (-b - t_0);
		} else {
			tmp_2 = (b + b) / (a * -2.0);
		}
		tmp_1 = tmp_2;
	} else {
		tmp_1 = t_1;
	}
	return tmp_1;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    real(8) :: tmp_1
    real(8) :: tmp_2
    t_0 = sqrt(((a * c) * (-4.0d0)))
    if (b >= 0.0d0) then
        tmp = (2.0d0 * c) / (2.0d0 * ((a * (c / b)) - b))
    else
        tmp = (t_0 - b) / (a * 2.0d0)
    end if
    t_1 = tmp
    if (b <= (-4.8d-76)) then
        tmp_1 = -(b / a)
    else if (b <= (-5d-310)) then
        tmp_1 = t_1
    else if (b <= 3.5d-79) then
        if (b >= 0.0d0) then
            tmp_2 = (2.0d0 * c) / (-b - t_0)
        else
            tmp_2 = (b + b) / (a * -2.0d0)
        end if
        tmp_1 = tmp_2
    else
        tmp_1 = t_1
    end if
    code = tmp_1
end function
public static double code(double a, double b, double c) {
	double t_0 = Math.sqrt(((a * c) * -4.0));
	double tmp;
	if (b >= 0.0) {
		tmp = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
	} else {
		tmp = (t_0 - b) / (a * 2.0);
	}
	double t_1 = tmp;
	double tmp_1;
	if (b <= -4.8e-76) {
		tmp_1 = -(b / a);
	} else if (b <= -5e-310) {
		tmp_1 = t_1;
	} else if (b <= 3.5e-79) {
		double tmp_2;
		if (b >= 0.0) {
			tmp_2 = (2.0 * c) / (-b - t_0);
		} else {
			tmp_2 = (b + b) / (a * -2.0);
		}
		tmp_1 = tmp_2;
	} else {
		tmp_1 = t_1;
	}
	return tmp_1;
}
def code(a, b, c):
	t_0 = math.sqrt(((a * c) * -4.0))
	tmp = 0
	if b >= 0.0:
		tmp = (2.0 * c) / (2.0 * ((a * (c / b)) - b))
	else:
		tmp = (t_0 - b) / (a * 2.0)
	t_1 = tmp
	tmp_1 = 0
	if b <= -4.8e-76:
		tmp_1 = -(b / a)
	elif b <= -5e-310:
		tmp_1 = t_1
	elif b <= 3.5e-79:
		tmp_2 = 0
		if b >= 0.0:
			tmp_2 = (2.0 * c) / (-b - t_0)
		else:
			tmp_2 = (b + b) / (a * -2.0)
		tmp_1 = tmp_2
	else:
		tmp_1 = t_1
	return tmp_1
function code(a, b, c)
	t_0 = sqrt(Float64(Float64(a * c) * -4.0))
	tmp = 0.0
	if (b >= 0.0)
		tmp = Float64(Float64(2.0 * c) / Float64(2.0 * Float64(Float64(a * Float64(c / b)) - b)));
	else
		tmp = Float64(Float64(t_0 - b) / Float64(a * 2.0));
	end
	t_1 = tmp
	tmp_1 = 0.0
	if (b <= -4.8e-76)
		tmp_1 = Float64(-Float64(b / a));
	elseif (b <= -5e-310)
		tmp_1 = t_1;
	elseif (b <= 3.5e-79)
		tmp_2 = 0.0
		if (b >= 0.0)
			tmp_2 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - t_0));
		else
			tmp_2 = Float64(Float64(b + b) / Float64(a * Float64(-2.0)));
		end
		tmp_1 = tmp_2;
	else
		tmp_1 = t_1;
	end
	return tmp_1
end
function tmp_4 = code(a, b, c)
	t_0 = sqrt(((a * c) * -4.0));
	tmp = 0.0;
	if (b >= 0.0)
		tmp = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
	else
		tmp = (t_0 - b) / (a * 2.0);
	end
	t_1 = tmp;
	tmp_2 = 0.0;
	if (b <= -4.8e-76)
		tmp_2 = -(b / a);
	elseif (b <= -5e-310)
		tmp_2 = t_1;
	elseif (b <= 3.5e-79)
		tmp_3 = 0.0;
		if (b >= 0.0)
			tmp_3 = (2.0 * c) / (-b - t_0);
		else
			tmp_3 = (b + b) / (a * -2.0);
		end
		tmp_2 = tmp_3;
	else
		tmp_2 = t_1;
	end
	tmp_4 = tmp_2;
end
code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(a * c), $MachinePrecision] * -4.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[(2.0 * N[(N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]}, If[LessEqual[b, -4.8e-76], (-N[(b / a), $MachinePrecision]), If[LessEqual[b, -5e-310], t$95$1, If[LessEqual[b, 3.5e-79], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(b + b), $MachinePrecision] / N[(a * (-2.0)), $MachinePrecision]), $MachinePrecision]], t$95$1]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sqrt{\left(a \cdot c\right) \cdot -4}\\
t_1 := \begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_0 - b}{a \cdot 2}\\


\end{array}\\
\mathbf{if}\;b \leq -4.8 \cdot 10^{-76}:\\
\;\;\;\;-\frac{b}{a}\\

\mathbf{elif}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq 3.5 \cdot 10^{-79}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{b + b}{a \cdot \left(-2\right)}\\


\end{array}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -4.80000000000000026e-76

    1. Initial program 62.3%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing
    3. Taylor expanded in b around -inf

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
      2. neg-lowering-neg.f6490.3

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    5. Simplified90.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    6. Taylor expanded in b around -inf

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-1 \cdot \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \end{array} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\mathsf{neg}\left(\frac{b}{a}\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{neg}\left(\frac{b}{a}\right)\\ \end{array} \]
      2. distribute-neg-frac2N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{b}{\mathsf{neg}\left(a\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{\mathsf{neg}\left(a\right)}\\ \end{array} \]
      3. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{\color{blue}{-1 \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{-1 \cdot a}\\ \end{array} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{b}{-1 \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{-1 \cdot a}\\ \end{array} \]
      5. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{\color{blue}{\mathsf{neg}\left(a\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{\mathsf{neg}\left(a\right)}\\ \end{array} \]
      6. neg-lowering-neg.f6490.3

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{\color{blue}{-a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    8. Simplified90.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{b}{-a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    9. Taylor expanded in b around 0

      \[\leadsto \color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;b \geq 0:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ } \end{array}} \]
    10. Step-by-step derivation
      1. if-sameN/A

        \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{b}{a}\right)} \]
      3. distribute-neg-frac2N/A

        \[\leadsto \color{blue}{\frac{b}{\mathsf{neg}\left(a\right)}} \]
      4. mul-1-negN/A

        \[\leadsto \frac{b}{\color{blue}{-1 \cdot a}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{b}{-1 \cdot a}} \]
      6. mul-1-negN/A

        \[\leadsto \frac{b}{\color{blue}{\mathsf{neg}\left(a\right)}} \]
      7. neg-lowering-neg.f6490.3

        \[\leadsto \frac{b}{\color{blue}{-a}} \]
    11. Simplified90.3%

      \[\leadsto \color{blue}{\frac{b}{-a}} \]

    if -4.80000000000000026e-76 < b < -4.999999999999985e-310 or 3.5000000000000003e-79 < b

    1. Initial program 64.9%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\left(b + -2 \cdot \frac{a \cdot c}{b}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(b + -2 \cdot \frac{a \cdot c}{b}\right)}\\ \end{array} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\left(-2 \cdot \frac{a \cdot c}{b} + b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(-2 \cdot \frac{a \cdot c}{b} + b\right)}\\ \end{array} \]
      2. associate-*r/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{-2 \cdot \left(a \cdot c\right)}{b}} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \left(a \cdot c\right)}{b} + b\right)}\\ \end{array} \]
      3. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \color{blue}{\left(c \cdot a\right)}}{b} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \left(c \cdot a\right)}{b} + b\right)}\\ \end{array} \]
      4. associate-*r*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{\color{blue}{\left(-2 \cdot c\right) \cdot a}}{b} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{\left(-2 \cdot c\right) \cdot a}{b} + b\right)}\\ \end{array} \]
      5. associate-*l/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{-2 \cdot c}{b} \cdot a} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot c}{b} \cdot a + b\right)}\\ \end{array} \]
      6. associate-*r/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\left(-2 \cdot \frac{c}{b}\right)} \cdot a + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\left(-2 \cdot \frac{c}{b}\right) \cdot a + b\right)}\\ \end{array} \]
      7. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\left(\frac{c}{b} \cdot -2\right)} \cdot a + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\left(\frac{c}{b} \cdot -2\right) \cdot a + b\right)}\\ \end{array} \]
      8. associate-*l*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{c}{b} \cdot \left(-2 \cdot a\right)} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{c}{b} \cdot \left(-2 \cdot a\right) + b\right)}\\ \end{array} \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      10. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\color{blue}{\frac{c}{b}}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      11. *-lowering-*.f6481.5

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, \color{blue}{-2 \cdot a}, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    5. Simplified81.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{\mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    6. Taylor expanded in b around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      3. *-lowering-*.f6478.3

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
    8. Simplified78.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
    9. Taylor expanded in c around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}\\ \end{array} \]
    10. Step-by-step derivation
      1. distribute-lft-out--N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}\\ \end{array} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}\\ \end{array} \]
      3. --lowering--.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \color{blue}{\left(\frac{a \cdot c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}\\ \end{array} \]
      4. associate-/l*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\color{blue}{a \cdot \frac{c}{b}} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \end{array} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\color{blue}{a \cdot \frac{c}{b}} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \end{array} \]
      6. /-lowering-/.f6478.3

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \color{blue}{\frac{c}{b}} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
    11. Simplified78.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]

    if -4.999999999999985e-310 < b < 3.5000000000000003e-79

    1. Initial program 90.2%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing
    3. Taylor expanded in b around -inf

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
      2. neg-lowering-neg.f6490.2

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    5. Simplified90.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    6. Taylor expanded in b around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{-4 \cdot \left(a \cdot c\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{-4 \cdot \left(a \cdot c\right)}}\\ \end{array} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      3. *-lowering-*.f6485.5

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\color{blue}{\left(a \cdot c\right)} \cdot -4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    8. Simplified85.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification83.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.8 \cdot 10^{-76}:\\ \;\;\;\;-\frac{b}{a}\\ \mathbf{elif}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -4} - b}{a \cdot 2}\\ \end{array}\\ \mathbf{elif}\;b \leq 3.5 \cdot 10^{-79}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b + b}{a \cdot \left(-2\right)}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -4} - b}{a \cdot 2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 81.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -4} - b}{a \cdot 2}\\ \end{array}\\ \mathbf{if}\;b \leq -5 \cdot 10^{-76}:\\ \;\;\;\;-\frac{b}{a}\\ \mathbf{elif}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-77}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\left(-b\right) - \sqrt{c \cdot \left(a \cdot -4\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b + b}{a \cdot \left(-2\right)}\\ \end{array}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0
         (if (>= b 0.0)
           (/ (* 2.0 c) (* 2.0 (- (* a (/ c b)) b)))
           (/ (- (sqrt (* (* a c) -4.0)) b) (* a 2.0)))))
   (if (<= b -5e-76)
     (- (/ b a))
     (if (<= b -5e-310)
       t_0
       (if (<= b 6e-77)
         (if (>= b 0.0)
           (* c (/ 2.0 (- (- b) (sqrt (* c (* a -4.0))))))
           (/ (+ b b) (* a (- 2.0))))
         t_0)))))
double code(double a, double b, double c) {
	double tmp;
	if (b >= 0.0) {
		tmp = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
	} else {
		tmp = (sqrt(((a * c) * -4.0)) - b) / (a * 2.0);
	}
	double t_0 = tmp;
	double tmp_1;
	if (b <= -5e-76) {
		tmp_1 = -(b / a);
	} else if (b <= -5e-310) {
		tmp_1 = t_0;
	} else if (b <= 6e-77) {
		double tmp_2;
		if (b >= 0.0) {
			tmp_2 = c * (2.0 / (-b - sqrt((c * (a * -4.0)))));
		} else {
			tmp_2 = (b + b) / (a * -2.0);
		}
		tmp_1 = tmp_2;
	} else {
		tmp_1 = t_0;
	}
	return tmp_1;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    real(8) :: tmp_1
    real(8) :: tmp_2
    if (b >= 0.0d0) then
        tmp = (2.0d0 * c) / (2.0d0 * ((a * (c / b)) - b))
    else
        tmp = (sqrt(((a * c) * (-4.0d0))) - b) / (a * 2.0d0)
    end if
    t_0 = tmp
    if (b <= (-5d-76)) then
        tmp_1 = -(b / a)
    else if (b <= (-5d-310)) then
        tmp_1 = t_0
    else if (b <= 6d-77) then
        if (b >= 0.0d0) then
            tmp_2 = c * (2.0d0 / (-b - sqrt((c * (a * (-4.0d0))))))
        else
            tmp_2 = (b + b) / (a * -2.0d0)
        end if
        tmp_1 = tmp_2
    else
        tmp_1 = t_0
    end if
    code = tmp_1
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b >= 0.0) {
		tmp = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
	} else {
		tmp = (Math.sqrt(((a * c) * -4.0)) - b) / (a * 2.0);
	}
	double t_0 = tmp;
	double tmp_1;
	if (b <= -5e-76) {
		tmp_1 = -(b / a);
	} else if (b <= -5e-310) {
		tmp_1 = t_0;
	} else if (b <= 6e-77) {
		double tmp_2;
		if (b >= 0.0) {
			tmp_2 = c * (2.0 / (-b - Math.sqrt((c * (a * -4.0)))));
		} else {
			tmp_2 = (b + b) / (a * -2.0);
		}
		tmp_1 = tmp_2;
	} else {
		tmp_1 = t_0;
	}
	return tmp_1;
}
def code(a, b, c):
	tmp = 0
	if b >= 0.0:
		tmp = (2.0 * c) / (2.0 * ((a * (c / b)) - b))
	else:
		tmp = (math.sqrt(((a * c) * -4.0)) - b) / (a * 2.0)
	t_0 = tmp
	tmp_1 = 0
	if b <= -5e-76:
		tmp_1 = -(b / a)
	elif b <= -5e-310:
		tmp_1 = t_0
	elif b <= 6e-77:
		tmp_2 = 0
		if b >= 0.0:
			tmp_2 = c * (2.0 / (-b - math.sqrt((c * (a * -4.0)))))
		else:
			tmp_2 = (b + b) / (a * -2.0)
		tmp_1 = tmp_2
	else:
		tmp_1 = t_0
	return tmp_1
function code(a, b, c)
	tmp = 0.0
	if (b >= 0.0)
		tmp = Float64(Float64(2.0 * c) / Float64(2.0 * Float64(Float64(a * Float64(c / b)) - b)));
	else
		tmp = Float64(Float64(sqrt(Float64(Float64(a * c) * -4.0)) - b) / Float64(a * 2.0));
	end
	t_0 = tmp
	tmp_1 = 0.0
	if (b <= -5e-76)
		tmp_1 = Float64(-Float64(b / a));
	elseif (b <= -5e-310)
		tmp_1 = t_0;
	elseif (b <= 6e-77)
		tmp_2 = 0.0
		if (b >= 0.0)
			tmp_2 = Float64(c * Float64(2.0 / Float64(Float64(-b) - sqrt(Float64(c * Float64(a * -4.0))))));
		else
			tmp_2 = Float64(Float64(b + b) / Float64(a * Float64(-2.0)));
		end
		tmp_1 = tmp_2;
	else
		tmp_1 = t_0;
	end
	return tmp_1
end
function tmp_4 = code(a, b, c)
	tmp = 0.0;
	if (b >= 0.0)
		tmp = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
	else
		tmp = (sqrt(((a * c) * -4.0)) - b) / (a * 2.0);
	end
	t_0 = tmp;
	tmp_2 = 0.0;
	if (b <= -5e-76)
		tmp_2 = -(b / a);
	elseif (b <= -5e-310)
		tmp_2 = t_0;
	elseif (b <= 6e-77)
		tmp_3 = 0.0;
		if (b >= 0.0)
			tmp_3 = c * (2.0 / (-b - sqrt((c * (a * -4.0)))));
		else
			tmp_3 = (b + b) / (a * -2.0);
		end
		tmp_2 = tmp_3;
	else
		tmp_2 = t_0;
	end
	tmp_4 = tmp_2;
end
code[a_, b_, c_] := Block[{t$95$0 = If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[(2.0 * N[(N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(N[(a * c), $MachinePrecision] * -4.0), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]}, If[LessEqual[b, -5e-76], (-N[(b / a), $MachinePrecision]), If[LessEqual[b, -5e-310], t$95$0, If[LessEqual[b, 6e-77], If[GreaterEqual[b, 0.0], N[(c * N[(2.0 / N[((-b) - N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b + b), $MachinePrecision] / N[(a * (-2.0)), $MachinePrecision]), $MachinePrecision]], t$95$0]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -4} - b}{a \cdot 2}\\


\end{array}\\
\mathbf{if}\;b \leq -5 \cdot 10^{-76}:\\
\;\;\;\;-\frac{b}{a}\\

\mathbf{elif}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;b \leq 6 \cdot 10^{-77}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;c \cdot \frac{2}{\left(-b\right) - \sqrt{c \cdot \left(a \cdot -4\right)}}\\

\mathbf{else}:\\
\;\;\;\;\frac{b + b}{a \cdot \left(-2\right)}\\


\end{array}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -4.9999999999999998e-76

    1. Initial program 62.3%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing
    3. Taylor expanded in b around -inf

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
      2. neg-lowering-neg.f6490.3

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    5. Simplified90.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    6. Taylor expanded in b around -inf

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-1 \cdot \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \end{array} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\mathsf{neg}\left(\frac{b}{a}\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{neg}\left(\frac{b}{a}\right)\\ \end{array} \]
      2. distribute-neg-frac2N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{b}{\mathsf{neg}\left(a\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{\mathsf{neg}\left(a\right)}\\ \end{array} \]
      3. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{\color{blue}{-1 \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{-1 \cdot a}\\ \end{array} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{b}{-1 \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{-1 \cdot a}\\ \end{array} \]
      5. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{\color{blue}{\mathsf{neg}\left(a\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{\mathsf{neg}\left(a\right)}\\ \end{array} \]
      6. neg-lowering-neg.f6490.3

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{\color{blue}{-a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    8. Simplified90.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{b}{-a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    9. Taylor expanded in b around 0

      \[\leadsto \color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;b \geq 0:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ } \end{array}} \]
    10. Step-by-step derivation
      1. if-sameN/A

        \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{b}{a}\right)} \]
      3. distribute-neg-frac2N/A

        \[\leadsto \color{blue}{\frac{b}{\mathsf{neg}\left(a\right)}} \]
      4. mul-1-negN/A

        \[\leadsto \frac{b}{\color{blue}{-1 \cdot a}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{b}{-1 \cdot a}} \]
      6. mul-1-negN/A

        \[\leadsto \frac{b}{\color{blue}{\mathsf{neg}\left(a\right)}} \]
      7. neg-lowering-neg.f6490.3

        \[\leadsto \frac{b}{\color{blue}{-a}} \]
    11. Simplified90.3%

      \[\leadsto \color{blue}{\frac{b}{-a}} \]

    if -4.9999999999999998e-76 < b < -4.999999999999985e-310 or 6.00000000000000033e-77 < b

    1. Initial program 64.9%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\left(b + -2 \cdot \frac{a \cdot c}{b}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(b + -2 \cdot \frac{a \cdot c}{b}\right)}\\ \end{array} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\left(-2 \cdot \frac{a \cdot c}{b} + b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(-2 \cdot \frac{a \cdot c}{b} + b\right)}\\ \end{array} \]
      2. associate-*r/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{-2 \cdot \left(a \cdot c\right)}{b}} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \left(a \cdot c\right)}{b} + b\right)}\\ \end{array} \]
      3. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \color{blue}{\left(c \cdot a\right)}}{b} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \left(c \cdot a\right)}{b} + b\right)}\\ \end{array} \]
      4. associate-*r*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{\color{blue}{\left(-2 \cdot c\right) \cdot a}}{b} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{\left(-2 \cdot c\right) \cdot a}{b} + b\right)}\\ \end{array} \]
      5. associate-*l/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{-2 \cdot c}{b} \cdot a} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot c}{b} \cdot a + b\right)}\\ \end{array} \]
      6. associate-*r/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\left(-2 \cdot \frac{c}{b}\right)} \cdot a + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\left(-2 \cdot \frac{c}{b}\right) \cdot a + b\right)}\\ \end{array} \]
      7. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\left(\frac{c}{b} \cdot -2\right)} \cdot a + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\left(\frac{c}{b} \cdot -2\right) \cdot a + b\right)}\\ \end{array} \]
      8. associate-*l*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{c}{b} \cdot \left(-2 \cdot a\right)} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{c}{b} \cdot \left(-2 \cdot a\right) + b\right)}\\ \end{array} \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      10. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\color{blue}{\frac{c}{b}}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      11. *-lowering-*.f6481.5

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, \color{blue}{-2 \cdot a}, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    5. Simplified81.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{\mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    6. Taylor expanded in b around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      3. *-lowering-*.f6478.3

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
    8. Simplified78.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
    9. Taylor expanded in c around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}\\ \end{array} \]
    10. Step-by-step derivation
      1. distribute-lft-out--N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}\\ \end{array} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}\\ \end{array} \]
      3. --lowering--.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \color{blue}{\left(\frac{a \cdot c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}\\ \end{array} \]
      4. associate-/l*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\color{blue}{a \cdot \frac{c}{b}} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \end{array} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\color{blue}{a \cdot \frac{c}{b}} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \end{array} \]
      6. /-lowering-/.f6478.3

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \color{blue}{\frac{c}{b}} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
    11. Simplified78.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]

    if -4.999999999999985e-310 < b < 6.00000000000000033e-77

    1. Initial program 90.2%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing
    3. Taylor expanded in b around -inf

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
      2. neg-lowering-neg.f6490.2

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    5. Simplified90.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    6. Taylor expanded in b around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{-4 \cdot \left(a \cdot c\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{-4 \cdot \left(a \cdot c\right)}}\\ \end{array} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      3. *-lowering-*.f6485.5

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\color{blue}{\left(a \cdot c\right)} \cdot -4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    8. Simplified85.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\color{blue}{c \cdot 2}}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      2. associate-/l*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \color{blue}{\frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      5. --lowering--.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\color{blue}{\left(\mathsf{neg}\left(b\right)\right)} - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      7. associate-*l*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{a \cdot \left(c \cdot -4\right)}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{a \cdot \left(c \cdot -4\right)}}\\ \end{array} \]
      8. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{a \cdot \color{blue}{\left(-4 \cdot c\right)}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{a \cdot \left(-4 \cdot c\right)}}\\ \end{array} \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\sqrt{a \cdot \left(-4 \cdot c\right)}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{a \cdot \left(-4 \cdot c\right)}}\\ \end{array} \]
      10. associate-*r*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{\left(a \cdot -4\right) \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot -4\right) \cdot c}}\\ \end{array} \]
      11. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{c \cdot \left(a \cdot -4\right)}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{c \cdot \left(a \cdot -4\right)}}\\ \end{array} \]
      12. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{c \cdot \left(a \cdot -4\right)}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{c \cdot \left(a \cdot -4\right)}}\\ \end{array} \]
      13. *-lowering-*.f6485.4

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\left(-b\right) - \sqrt{c \cdot \color{blue}{\left(a \cdot -4\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    10. Applied egg-rr85.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{c \cdot \frac{2}{\left(-b\right) - \sqrt{c \cdot \left(a \cdot -4\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification83.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-76}:\\ \;\;\;\;-\frac{b}{a}\\ \mathbf{elif}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -4} - b}{a \cdot 2}\\ \end{array}\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-77}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\left(-b\right) - \sqrt{c \cdot \left(a \cdot -4\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b + b}{a \cdot \left(-2\right)}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -4} - b}{a \cdot 2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 90.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+154}:\\ \;\;\;\;-\frac{b}{a}\\ \mathbf{elif}\;b \leq 1.05 \cdot 10^{+80}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -4} - b}{a \cdot 2}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1e+154)
   (- (/ b a))
   (if (<= b 1.05e+80)
     (if (>= b 0.0)
       (* c (/ -2.0 (+ b (sqrt (fma c (* a -4.0) (* b b))))))
       (/ (- (sqrt (- (* b b) (* c (* a 4.0)))) b) (* a 2.0)))
     (if (>= b 0.0)
       (/ (* 2.0 c) (* 2.0 (- (* a (/ c b)) b)))
       (/ (- (sqrt (* (* a c) -4.0)) b) (* a 2.0))))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1e+154) {
		tmp = -(b / a);
	} else if (b <= 1.05e+80) {
		double tmp_1;
		if (b >= 0.0) {
			tmp_1 = c * (-2.0 / (b + sqrt(fma(c, (a * -4.0), (b * b)))));
		} else {
			tmp_1 = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
		}
		tmp = tmp_1;
	} else if (b >= 0.0) {
		tmp = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
	} else {
		tmp = (sqrt(((a * c) * -4.0)) - b) / (a * 2.0);
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= -1e+154)
		tmp = Float64(-Float64(b / a));
	elseif (b <= 1.05e+80)
		tmp_1 = 0.0
		if (b >= 0.0)
			tmp_1 = Float64(c * Float64(-2.0 / Float64(b + sqrt(fma(c, Float64(a * -4.0), Float64(b * b))))));
		else
			tmp_1 = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) - b) / Float64(a * 2.0));
		end
		tmp = tmp_1;
	elseif (b >= 0.0)
		tmp = Float64(Float64(2.0 * c) / Float64(2.0 * Float64(Float64(a * Float64(c / b)) - b)));
	else
		tmp = Float64(Float64(sqrt(Float64(Float64(a * c) * -4.0)) - b) / Float64(a * 2.0));
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -1e+154], (-N[(b / a), $MachinePrecision]), If[LessEqual[b, 1.05e+80], If[GreaterEqual[b, 0.0], N[(c * N[(-2.0 / N[(b + N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[(2.0 * N[(N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(N[(a * c), $MachinePrecision] * -4.0), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1 \cdot 10^{+154}:\\
\;\;\;\;-\frac{b}{a}\\

\mathbf{elif}\;b \leq 1.05 \cdot 10^{+80}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;c \cdot \frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\


\end{array}\\

\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -4} - b}{a \cdot 2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.00000000000000004e154

    1. Initial program 33.7%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing
    3. Taylor expanded in b around -inf

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
      2. neg-lowering-neg.f64100.0

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    5. Simplified100.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    6. Taylor expanded in b around -inf

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-1 \cdot \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \end{array} \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\mathsf{neg}\left(\frac{b}{a}\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{neg}\left(\frac{b}{a}\right)\\ \end{array} \]
      2. distribute-neg-frac2N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{b}{\mathsf{neg}\left(a\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{\mathsf{neg}\left(a\right)}\\ \end{array} \]
      3. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{\color{blue}{-1 \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{-1 \cdot a}\\ \end{array} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{b}{-1 \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{-1 \cdot a}\\ \end{array} \]
      5. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{\color{blue}{\mathsf{neg}\left(a\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{\mathsf{neg}\left(a\right)}\\ \end{array} \]
      6. neg-lowering-neg.f64100.0

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{\color{blue}{-a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    8. Simplified100.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{b}{-a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    9. Taylor expanded in b around 0

      \[\leadsto \color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;b \geq 0:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ } \end{array}} \]
    10. Step-by-step derivation
      1. if-sameN/A

        \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{b}{a}\right)} \]
      3. distribute-neg-frac2N/A

        \[\leadsto \color{blue}{\frac{b}{\mathsf{neg}\left(a\right)}} \]
      4. mul-1-negN/A

        \[\leadsto \frac{b}{\color{blue}{-1 \cdot a}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \color{blue}{\frac{b}{-1 \cdot a}} \]
      6. mul-1-negN/A

        \[\leadsto \frac{b}{\color{blue}{\mathsf{neg}\left(a\right)}} \]
      7. neg-lowering-neg.f64100.0

        \[\leadsto \frac{b}{\color{blue}{-a}} \]
    11. Simplified100.0%

      \[\leadsto \color{blue}{\frac{b}{-a}} \]

    if -1.00000000000000004e154 < b < 1.05000000000000001e80

    1. Initial program 87.5%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing
    3. Applied egg-rr87.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]

    if 1.05000000000000001e80 < b

    1. Initial program 44.8%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\left(b + -2 \cdot \frac{a \cdot c}{b}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(b + -2 \cdot \frac{a \cdot c}{b}\right)}\\ \end{array} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\left(-2 \cdot \frac{a \cdot c}{b} + b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(-2 \cdot \frac{a \cdot c}{b} + b\right)}\\ \end{array} \]
      2. associate-*r/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{-2 \cdot \left(a \cdot c\right)}{b}} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \left(a \cdot c\right)}{b} + b\right)}\\ \end{array} \]
      3. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \color{blue}{\left(c \cdot a\right)}}{b} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \left(c \cdot a\right)}{b} + b\right)}\\ \end{array} \]
      4. associate-*r*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{\color{blue}{\left(-2 \cdot c\right) \cdot a}}{b} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{\left(-2 \cdot c\right) \cdot a}{b} + b\right)}\\ \end{array} \]
      5. associate-*l/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{-2 \cdot c}{b} \cdot a} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot c}{b} \cdot a + b\right)}\\ \end{array} \]
      6. associate-*r/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\left(-2 \cdot \frac{c}{b}\right)} \cdot a + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\left(-2 \cdot \frac{c}{b}\right) \cdot a + b\right)}\\ \end{array} \]
      7. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\left(\frac{c}{b} \cdot -2\right)} \cdot a + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\left(\frac{c}{b} \cdot -2\right) \cdot a + b\right)}\\ \end{array} \]
      8. associate-*l*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{c}{b} \cdot \left(-2 \cdot a\right)} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{c}{b} \cdot \left(-2 \cdot a\right) + b\right)}\\ \end{array} \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      10. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\color{blue}{\frac{c}{b}}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      11. *-lowering-*.f6498.4

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, \color{blue}{-2 \cdot a}, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    5. Simplified98.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{\mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    6. Taylor expanded in b around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      3. *-lowering-*.f6498.4

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
    8. Simplified98.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
    9. Taylor expanded in c around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}\\ \end{array} \]
    10. Step-by-step derivation
      1. distribute-lft-out--N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}\\ \end{array} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}\\ \end{array} \]
      3. --lowering--.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \color{blue}{\left(\frac{a \cdot c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}\\ \end{array} \]
      4. associate-/l*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\color{blue}{a \cdot \frac{c}{b}} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \end{array} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\color{blue}{a \cdot \frac{c}{b}} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \end{array} \]
      6. /-lowering-/.f6498.4

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \color{blue}{\frac{c}{b}} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
    11. Simplified98.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+154}:\\ \;\;\;\;-\frac{b}{a}\\ \mathbf{elif}\;b \leq 1.05 \cdot 10^{+80}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -4} - b}{a \cdot 2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 90.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -4.5 \cdot 10^{+65}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, a \cdot -2, b\right)}\\ \mathbf{else}:\\ \;\;\;\;-\mathsf{fma}\left(b, -\frac{c}{b \cdot b}, \frac{b}{a}\right)\\ \end{array}\\ \mathbf{elif}\;b \leq 1.55 \cdot 10^{+81}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{a} \cdot \left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b\right)\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -4} - b}{a \cdot 2}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -4.5e+65)
   (if (>= b 0.0)
     (/ (* 2.0 c) (- (- b) (fma (/ c b) (* a -2.0) b)))
     (- (fma b (- (/ c (* b b))) (/ b a))))
   (if (<= b 1.55e+81)
     (if (>= b 0.0)
       (* c (/ -2.0 (+ b (sqrt (fma c (* a -4.0) (* b b))))))
       (* (/ 0.5 a) (- (sqrt (fma a (* c -4.0) (* b b))) b)))
     (if (>= b 0.0)
       (/ (* 2.0 c) (* 2.0 (- (* a (/ c b)) b)))
       (/ (- (sqrt (* (* a c) -4.0)) b) (* a 2.0))))))
double code(double a, double b, double c) {
	double tmp_1;
	if (b <= -4.5e+65) {
		double tmp_2;
		if (b >= 0.0) {
			tmp_2 = (2.0 * c) / (-b - fma((c / b), (a * -2.0), b));
		} else {
			tmp_2 = -fma(b, -(c / (b * b)), (b / a));
		}
		tmp_1 = tmp_2;
	} else if (b <= 1.55e+81) {
		double tmp_3;
		if (b >= 0.0) {
			tmp_3 = c * (-2.0 / (b + sqrt(fma(c, (a * -4.0), (b * b)))));
		} else {
			tmp_3 = (0.5 / a) * (sqrt(fma(a, (c * -4.0), (b * b))) - b);
		}
		tmp_1 = tmp_3;
	} else if (b >= 0.0) {
		tmp_1 = (2.0 * c) / (2.0 * ((a * (c / b)) - b));
	} else {
		tmp_1 = (sqrt(((a * c) * -4.0)) - b) / (a * 2.0);
	}
	return tmp_1;
}
function code(a, b, c)
	tmp_1 = 0.0
	if (b <= -4.5e+65)
		tmp_2 = 0.0
		if (b >= 0.0)
			tmp_2 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - fma(Float64(c / b), Float64(a * -2.0), b)));
		else
			tmp_2 = Float64(-fma(b, Float64(-Float64(c / Float64(b * b))), Float64(b / a)));
		end
		tmp_1 = tmp_2;
	elseif (b <= 1.55e+81)
		tmp_3 = 0.0
		if (b >= 0.0)
			tmp_3 = Float64(c * Float64(-2.0 / Float64(b + sqrt(fma(c, Float64(a * -4.0), Float64(b * b))))));
		else
			tmp_3 = Float64(Float64(0.5 / a) * Float64(sqrt(fma(a, Float64(c * -4.0), Float64(b * b))) - b));
		end
		tmp_1 = tmp_3;
	elseif (b >= 0.0)
		tmp_1 = Float64(Float64(2.0 * c) / Float64(2.0 * Float64(Float64(a * Float64(c / b)) - b)));
	else
		tmp_1 = Float64(Float64(sqrt(Float64(Float64(a * c) * -4.0)) - b) / Float64(a * 2.0));
	end
	return tmp_1
end
code[a_, b_, c_] := If[LessEqual[b, -4.5e+65], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - N[(N[(c / b), $MachinePrecision] * N[(a * -2.0), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(b * (-N[(c / N[(b * b), $MachinePrecision]), $MachinePrecision]) + N[(b / a), $MachinePrecision]), $MachinePrecision])], If[LessEqual[b, 1.55e+81], If[GreaterEqual[b, 0.0], N[(c * N[(-2.0 / N[(b + N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 / a), $MachinePrecision] * N[(N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[(2.0 * N[(N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(N[(a * c), $MachinePrecision] * -4.0), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.5 \cdot 10^{+65}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, a \cdot -2, b\right)}\\

\mathbf{else}:\\
\;\;\;\;-\mathsf{fma}\left(b, -\frac{c}{b \cdot b}, \frac{b}{a}\right)\\


\end{array}\\

\mathbf{elif}\;b \leq 1.55 \cdot 10^{+81}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;c \cdot \frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}}\\

\mathbf{else}:\\
\;\;\;\;\frac{0.5}{a} \cdot \left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b\right)\\


\end{array}\\

\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -4} - b}{a \cdot 2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -4.5e65

    1. Initial program 52.2%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\left(b + -2 \cdot \frac{a \cdot c}{b}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(b + -2 \cdot \frac{a \cdot c}{b}\right)}\\ \end{array} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\left(-2 \cdot \frac{a \cdot c}{b} + b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(-2 \cdot \frac{a \cdot c}{b} + b\right)}\\ \end{array} \]
      2. associate-*r/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{-2 \cdot \left(a \cdot c\right)}{b}} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \left(a \cdot c\right)}{b} + b\right)}\\ \end{array} \]
      3. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \color{blue}{\left(c \cdot a\right)}}{b} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \left(c \cdot a\right)}{b} + b\right)}\\ \end{array} \]
      4. associate-*r*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{\color{blue}{\left(-2 \cdot c\right) \cdot a}}{b} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{\left(-2 \cdot c\right) \cdot a}{b} + b\right)}\\ \end{array} \]
      5. associate-*l/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{-2 \cdot c}{b} \cdot a} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot c}{b} \cdot a + b\right)}\\ \end{array} \]
      6. associate-*r/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\left(-2 \cdot \frac{c}{b}\right)} \cdot a + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\left(-2 \cdot \frac{c}{b}\right) \cdot a + b\right)}\\ \end{array} \]
      7. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\left(\frac{c}{b} \cdot -2\right)} \cdot a + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\left(\frac{c}{b} \cdot -2\right) \cdot a + b\right)}\\ \end{array} \]
      8. associate-*l*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{c}{b} \cdot \left(-2 \cdot a\right)} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{c}{b} \cdot \left(-2 \cdot a\right) + b\right)}\\ \end{array} \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      10. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\color{blue}{\frac{c}{b}}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      11. *-lowering-*.f6452.2

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, \color{blue}{-2 \cdot a}, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    5. Simplified52.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{\mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    6. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\color{blue}{\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \end{array} \]
      4. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\color{blue}{2 \cdot c}}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      5. +-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \end{array} \]
      6. unsub-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \end{array} \]
    7. Applied egg-rr52.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{2 \cdot a}{\sqrt{\mathsf{fma}\left(a, -4 \cdot c, b \cdot b\right)} - b}}\\ \end{array} \]
    8. Taylor expanded in b around -inf

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
    9. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      3. distribute-lft-inN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      4. associate-*r/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      5. *-rgt-identityN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      7. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      8. neg-lowering-neg.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      9. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      10. unpow2N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      11. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      12. /-lowering-/.f64100.0

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;-\mathsf{fma}\left(b, -\frac{c}{b \cdot b}, \frac{b}{a}\right)\\ \end{array} \]
    10. Simplified100.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;-\mathsf{fma}\left(b, -\frac{c}{b \cdot b}, \frac{b}{a}\right)\\ \end{array} \]

    if -4.5e65 < b < 1.55e81

    1. Initial program 85.7%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing
    3. Applied egg-rr85.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \cdot c}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    4. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \cdot c\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \cdot c\\ \end{array} \]
      2. associate-/r/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \cdot c\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \cdot c\\ \end{array} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \cdot c\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \cdot c\\ \end{array} \]
      4. associate-/r*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \cdot c\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \cdot c\\ \end{array} \]
      5. metadata-evalN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \cdot c\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \cdot c\\ \end{array} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \cdot c\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \cdot c\\ \end{array} \]
      7. +-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \cdot c\\ \mathbf{else}:\\ \;\;\;\;\color{blue}{\frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \cdot c}\\ \end{array} \]
      8. unsub-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \cdot c\\ \mathbf{else}:\\ \;\;\;\;\color{blue}{\frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \cdot c}\\ \end{array} \]
    5. Applied egg-rr85.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}} \cdot c\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{a} \cdot \left(\sqrt{\mathsf{fma}\left(a, -4 \cdot c, b \cdot b\right)} - b\right)\\ \end{array} \]

    if 1.55e81 < b

    1. Initial program 44.8%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing
    3. Taylor expanded in a around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\left(b + -2 \cdot \frac{a \cdot c}{b}\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(b + -2 \cdot \frac{a \cdot c}{b}\right)}\\ \end{array} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\left(-2 \cdot \frac{a \cdot c}{b} + b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(-2 \cdot \frac{a \cdot c}{b} + b\right)}\\ \end{array} \]
      2. associate-*r/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{-2 \cdot \left(a \cdot c\right)}{b}} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \left(a \cdot c\right)}{b} + b\right)}\\ \end{array} \]
      3. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \color{blue}{\left(c \cdot a\right)}}{b} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot \left(c \cdot a\right)}{b} + b\right)}\\ \end{array} \]
      4. associate-*r*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{\color{blue}{\left(-2 \cdot c\right) \cdot a}}{b} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{\left(-2 \cdot c\right) \cdot a}{b} + b\right)}\\ \end{array} \]
      5. associate-*l/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{-2 \cdot c}{b} \cdot a} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{-2 \cdot c}{b} \cdot a + b\right)}\\ \end{array} \]
      6. associate-*r/N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\left(-2 \cdot \frac{c}{b}\right)} \cdot a + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\left(-2 \cdot \frac{c}{b}\right) \cdot a + b\right)}\\ \end{array} \]
      7. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\left(\frac{c}{b} \cdot -2\right)} \cdot a + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\left(\frac{c}{b} \cdot -2\right) \cdot a + b\right)}\\ \end{array} \]
      8. associate-*l*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\color{blue}{\frac{c}{b} \cdot \left(-2 \cdot a\right)} + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \left(\frac{c}{b} \cdot \left(-2 \cdot a\right) + b\right)}\\ \end{array} \]
      9. accelerator-lowering-fma.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      10. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\color{blue}{\frac{c}{b}}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      11. *-lowering-*.f6498.4

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, \color{blue}{-2 \cdot a}, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    5. Simplified98.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{\mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    6. Taylor expanded in b around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \end{array} \]
      3. *-lowering-*.f6498.4

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
    8. Simplified98.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, -2 \cdot a, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
    9. Taylor expanded in c around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \frac{a \cdot c}{b} - 2 \cdot b}\\ \end{array} \]
    10. Step-by-step derivation
      1. distribute-lft-out--N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}\\ \end{array} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}\\ \end{array} \]
      3. --lowering--.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \color{blue}{\left(\frac{a \cdot c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\frac{a \cdot c}{b} - b\right)}\\ \end{array} \]
      4. associate-/l*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\color{blue}{a \cdot \frac{c}{b}} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \end{array} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(\color{blue}{a \cdot \frac{c}{b}} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \end{array} \]
      6. /-lowering-/.f6498.4

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \color{blue}{\frac{c}{b}} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
    11. Simplified98.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{\left(a \cdot c\right) \cdot -4}}{2 \cdot a}\\ \end{array} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.5 \cdot 10^{+65}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \mathsf{fma}\left(\frac{c}{b}, a \cdot -2, b\right)}\\ \mathbf{else}:\\ \;\;\;\;-\mathsf{fma}\left(b, -\frac{c}{b \cdot b}, \frac{b}{a}\right)\\ \end{array}\\ \mathbf{elif}\;b \leq 1.55 \cdot 10^{+81}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{b + \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5}{a} \cdot \left(\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b\right)\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{2 \cdot \left(a \cdot \frac{c}{b} - b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -4} - b}{a \cdot 2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 74.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{b + b}{a \cdot \left(-2\right)}\\ \mathbf{if}\;b \leq 4.4 \cdot 10^{-78}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\left(-b\right) - \sqrt{c \cdot \left(a \cdot -4\right)}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (/ (+ b b) (* a (- 2.0)))))
   (if (<= b 4.4e-78)
     (if (>= b 0.0) (* c (/ 2.0 (- (- b) (sqrt (* c (* a -4.0)))))) t_0)
     (if (>= b 0.0) (/ (* 2.0 c) (- (- b) b)) t_0))))
double code(double a, double b, double c) {
	double t_0 = (b + b) / (a * -2.0);
	double tmp_1;
	if (b <= 4.4e-78) {
		double tmp_2;
		if (b >= 0.0) {
			tmp_2 = c * (2.0 / (-b - sqrt((c * (a * -4.0)))));
		} else {
			tmp_2 = t_0;
		}
		tmp_1 = tmp_2;
	} else if (b >= 0.0) {
		tmp_1 = (2.0 * c) / (-b - b);
	} else {
		tmp_1 = t_0;
	}
	return tmp_1;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    real(8) :: tmp_1
    real(8) :: tmp_2
    t_0 = (b + b) / (a * -2.0d0)
    if (b <= 4.4d-78) then
        if (b >= 0.0d0) then
            tmp_2 = c * (2.0d0 / (-b - sqrt((c * (a * (-4.0d0))))))
        else
            tmp_2 = t_0
        end if
        tmp_1 = tmp_2
    else if (b >= 0.0d0) then
        tmp_1 = (2.0d0 * c) / (-b - b)
    else
        tmp_1 = t_0
    end if
    code = tmp_1
end function
public static double code(double a, double b, double c) {
	double t_0 = (b + b) / (a * -2.0);
	double tmp_1;
	if (b <= 4.4e-78) {
		double tmp_2;
		if (b >= 0.0) {
			tmp_2 = c * (2.0 / (-b - Math.sqrt((c * (a * -4.0)))));
		} else {
			tmp_2 = t_0;
		}
		tmp_1 = tmp_2;
	} else if (b >= 0.0) {
		tmp_1 = (2.0 * c) / (-b - b);
	} else {
		tmp_1 = t_0;
	}
	return tmp_1;
}
def code(a, b, c):
	t_0 = (b + b) / (a * -2.0)
	tmp_1 = 0
	if b <= 4.4e-78:
		tmp_2 = 0
		if b >= 0.0:
			tmp_2 = c * (2.0 / (-b - math.sqrt((c * (a * -4.0)))))
		else:
			tmp_2 = t_0
		tmp_1 = tmp_2
	elif b >= 0.0:
		tmp_1 = (2.0 * c) / (-b - b)
	else:
		tmp_1 = t_0
	return tmp_1
function code(a, b, c)
	t_0 = Float64(Float64(b + b) / Float64(a * Float64(-2.0)))
	tmp_1 = 0.0
	if (b <= 4.4e-78)
		tmp_2 = 0.0
		if (b >= 0.0)
			tmp_2 = Float64(c * Float64(2.0 / Float64(Float64(-b) - sqrt(Float64(c * Float64(a * -4.0))))));
		else
			tmp_2 = t_0;
		end
		tmp_1 = tmp_2;
	elseif (b >= 0.0)
		tmp_1 = Float64(Float64(2.0 * c) / Float64(Float64(-b) - b));
	else
		tmp_1 = t_0;
	end
	return tmp_1
end
function tmp_4 = code(a, b, c)
	t_0 = (b + b) / (a * -2.0);
	tmp_2 = 0.0;
	if (b <= 4.4e-78)
		tmp_3 = 0.0;
		if (b >= 0.0)
			tmp_3 = c * (2.0 / (-b - sqrt((c * (a * -4.0)))));
		else
			tmp_3 = t_0;
		end
		tmp_2 = tmp_3;
	elseif (b >= 0.0)
		tmp_2 = (2.0 * c) / (-b - b);
	else
		tmp_2 = t_0;
	end
	tmp_4 = tmp_2;
end
code[a_, b_, c_] := Block[{t$95$0 = N[(N[(b + b), $MachinePrecision] / N[(a * (-2.0)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 4.4e-78], If[GreaterEqual[b, 0.0], N[(c * N[(2.0 / N[((-b) - N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0], If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - b), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{b + b}{a \cdot \left(-2\right)}\\
\mathbf{if}\;b \leq 4.4 \cdot 10^{-78}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;c \cdot \frac{2}{\left(-b\right) - \sqrt{c \cdot \left(a \cdot -4\right)}}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}\\

\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 4.3999999999999998e-78

    1. Initial program 70.9%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing
    3. Taylor expanded in b around -inf

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
      2. neg-lowering-neg.f6476.9

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    5. Simplified76.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    6. Taylor expanded in b around 0

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{-4 \cdot \left(a \cdot c\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{-4 \cdot \left(a \cdot c\right)}}\\ \end{array} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      3. *-lowering-*.f6475.8

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\color{blue}{\left(a \cdot c\right)} \cdot -4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    8. Simplified75.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\color{blue}{c \cdot 2}}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      2. associate-/l*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \color{blue}{\frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      5. --lowering--.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\color{blue}{\left(\mathsf{neg}\left(b\right)\right)} - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot c\right) \cdot -4}}\\ \end{array} \]
      7. associate-*l*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{a \cdot \left(c \cdot -4\right)}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{a \cdot \left(c \cdot -4\right)}}\\ \end{array} \]
      8. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{a \cdot \color{blue}{\left(-4 \cdot c\right)}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{a \cdot \left(-4 \cdot c\right)}}\\ \end{array} \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{\sqrt{a \cdot \left(-4 \cdot c\right)}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{a \cdot \left(-4 \cdot c\right)}}\\ \end{array} \]
      10. associate-*r*N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{\left(a \cdot -4\right) \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\left(a \cdot -4\right) \cdot c}}\\ \end{array} \]
      11. *-commutativeN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{c \cdot \left(a \cdot -4\right)}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{c \cdot \left(a \cdot -4\right)}}\\ \end{array} \]
      12. *-lowering-*.f64N/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{\color{blue}{c \cdot \left(a \cdot -4\right)}}}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{2}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{c \cdot \left(a \cdot -4\right)}}\\ \end{array} \]
      13. *-lowering-*.f6475.8

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\left(-b\right) - \sqrt{c \cdot \color{blue}{\left(a \cdot -4\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    10. Applied egg-rr75.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{c \cdot \frac{2}{\left(-b\right) - \sqrt{c \cdot \left(a \cdot -4\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]

    if 4.3999999999999998e-78 < b

    1. Initial program 61.8%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
    2. Add Preprocessing
    3. Taylor expanded in b around -inf

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
      2. neg-lowering-neg.f6461.8

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    5. Simplified61.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    6. Taylor expanded in b around inf

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - b}\\ \end{array} \]
    7. Step-by-step derivation
      1. Simplified84.1%

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
      2. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - b}\\ \end{array} \]
        2. --lowering--.f64N/A

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - b}\\ \end{array} \]
        3. neg-lowering-neg.f6484.1

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \end{array} \]
      3. Applied egg-rr84.1%

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \end{array} \]
    8. Recombined 2 regimes into one program.
    9. Final simplification78.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 4.4 \cdot 10^{-78}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{2}{\left(-b\right) - \sqrt{c \cdot \left(a \cdot -4\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b + b}{a \cdot \left(-2\right)}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{b + b}{a \cdot \left(-2\right)}\\ \end{array} \]
    10. Add Preprocessing

    Alternative 8: 47.9% accurate, 1.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.15 \cdot 10^{-262}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(c \cdot -2\right) \cdot \left(b + b\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{b + b}{a \cdot \left(-2\right)}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-c}{b + b}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b + b}{a}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= b 1.15e-262)
       (if (>= b 0.0) (* (* c -2.0) (+ b b)) (/ (+ b b) (* a (- 2.0))))
       (if (>= b 0.0) (/ (- c) (+ b b)) (- (/ (+ b b) a)))))
    double code(double a, double b, double c) {
    	double tmp_1;
    	if (b <= 1.15e-262) {
    		double tmp_2;
    		if (b >= 0.0) {
    			tmp_2 = (c * -2.0) * (b + b);
    		} else {
    			tmp_2 = (b + b) / (a * -2.0);
    		}
    		tmp_1 = tmp_2;
    	} else if (b >= 0.0) {
    		tmp_1 = -c / (b + b);
    	} else {
    		tmp_1 = -((b + b) / a);
    	}
    	return tmp_1;
    }
    
    real(8) function code(a, b, c)
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        real(8), intent (in) :: c
        real(8) :: tmp
        real(8) :: tmp_1
        real(8) :: tmp_2
        if (b <= 1.15d-262) then
            if (b >= 0.0d0) then
                tmp_2 = (c * (-2.0d0)) * (b + b)
            else
                tmp_2 = (b + b) / (a * -2.0d0)
            end if
            tmp_1 = tmp_2
        else if (b >= 0.0d0) then
            tmp_1 = -c / (b + b)
        else
            tmp_1 = -((b + b) / a)
        end if
        code = tmp_1
    end function
    
    public static double code(double a, double b, double c) {
    	double tmp_1;
    	if (b <= 1.15e-262) {
    		double tmp_2;
    		if (b >= 0.0) {
    			tmp_2 = (c * -2.0) * (b + b);
    		} else {
    			tmp_2 = (b + b) / (a * -2.0);
    		}
    		tmp_1 = tmp_2;
    	} else if (b >= 0.0) {
    		tmp_1 = -c / (b + b);
    	} else {
    		tmp_1 = -((b + b) / a);
    	}
    	return tmp_1;
    }
    
    def code(a, b, c):
    	tmp_1 = 0
    	if b <= 1.15e-262:
    		tmp_2 = 0
    		if b >= 0.0:
    			tmp_2 = (c * -2.0) * (b + b)
    		else:
    			tmp_2 = (b + b) / (a * -2.0)
    		tmp_1 = tmp_2
    	elif b >= 0.0:
    		tmp_1 = -c / (b + b)
    	else:
    		tmp_1 = -((b + b) / a)
    	return tmp_1
    
    function code(a, b, c)
    	tmp_1 = 0.0
    	if (b <= 1.15e-262)
    		tmp_2 = 0.0
    		if (b >= 0.0)
    			tmp_2 = Float64(Float64(c * -2.0) * Float64(b + b));
    		else
    			tmp_2 = Float64(Float64(b + b) / Float64(a * Float64(-2.0)));
    		end
    		tmp_1 = tmp_2;
    	elseif (b >= 0.0)
    		tmp_1 = Float64(Float64(-c) / Float64(b + b));
    	else
    		tmp_1 = Float64(-Float64(Float64(b + b) / a));
    	end
    	return tmp_1
    end
    
    function tmp_4 = code(a, b, c)
    	tmp_2 = 0.0;
    	if (b <= 1.15e-262)
    		tmp_3 = 0.0;
    		if (b >= 0.0)
    			tmp_3 = (c * -2.0) * (b + b);
    		else
    			tmp_3 = (b + b) / (a * -2.0);
    		end
    		tmp_2 = tmp_3;
    	elseif (b >= 0.0)
    		tmp_2 = -c / (b + b);
    	else
    		tmp_2 = -((b + b) / a);
    	end
    	tmp_4 = tmp_2;
    end
    
    code[a_, b_, c_] := If[LessEqual[b, 1.15e-262], If[GreaterEqual[b, 0.0], N[(N[(c * -2.0), $MachinePrecision] * N[(b + b), $MachinePrecision]), $MachinePrecision], N[(N[(b + b), $MachinePrecision] / N[(a * (-2.0)), $MachinePrecision]), $MachinePrecision]], If[GreaterEqual[b, 0.0], N[((-c) / N[(b + b), $MachinePrecision]), $MachinePrecision], (-N[(N[(b + b), $MachinePrecision] / a), $MachinePrecision])]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq 1.15 \cdot 10^{-262}:\\
    \;\;\;\;\begin{array}{l}
    \mathbf{if}\;b \geq 0:\\
    \;\;\;\;\left(c \cdot -2\right) \cdot \left(b + b\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{b + b}{a \cdot \left(-2\right)}\\
    
    
    \end{array}\\
    
    \mathbf{elif}\;b \geq 0:\\
    \;\;\;\;\frac{-c}{b + b}\\
    
    \mathbf{else}:\\
    \;\;\;\;-\frac{b + b}{a}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b < 1.15000000000000005e-262

      1. Initial program 66.5%

        \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
      2. Add Preprocessing
      3. Taylor expanded in b around -inf

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
      4. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
        2. neg-lowering-neg.f6473.8

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
      5. Simplified73.8%

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
      6. Taylor expanded in b around inf

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - b}\\ \end{array} \]
      7. Step-by-step derivation
        1. Simplified68.9%

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
        2. Step-by-step derivation
          1. sub-negN/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - b}\\ \end{array} \]
          2. --lowering--.f64N/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - b}\\ \end{array} \]
          3. neg-lowering-neg.f6468.9

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \end{array} \]
        3. Applied egg-rr68.9%

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \end{array} \]
        4. Step-by-step derivation
          1. frac-2negN/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{\mathsf{neg}\left(2 \cdot c\right)}{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(b\right)\right) - b\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(2 \cdot c\right)}{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(b\right)\right) - b\right)\right)}\\ \end{array} \]
          2. div-invN/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(b\right)\right) - b\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(b\right)\right) - b\right)\right)}\\ \end{array} \]
          3. sub-negN/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(b\right)\right) + \left(\mathsf{neg}\left(b\right)\right)\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \left(\mathsf{neg}\left(b\right)\right)\right)\right)}\\ \end{array} \]
          4. distribute-neg-outN/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left(b + b\right)\right)\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \frac{1}{\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(b + b\right)\right)\right)\right)}\\ \end{array} \]
          5. remove-double-negN/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \frac{1}{\color{blue}{b + b}}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \frac{1}{b + b}\\ \end{array} \]
          6. flip-+N/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \frac{1}{\color{blue}{\frac{b \cdot b - b \cdot b}{b - b}}}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \frac{1}{\frac{b \cdot b - b \cdot b}{b - b}}\\ \end{array} \]
          7. +-inversesN/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \frac{1}{\frac{\color{blue}{0}}{b - b}}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \frac{1}{\frac{0}{b - b}}\\ \end{array} \]
          8. +-inversesN/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \frac{1}{\frac{0}{\color{blue}{0}}}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \frac{1}{\frac{0}{0}}\\ \end{array} \]
          9. +-inversesN/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \frac{1}{\frac{\color{blue}{b - b}}{0}}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \frac{1}{\frac{b - b}{0}}\\ \end{array} \]
          10. +-inversesN/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \frac{1}{\frac{b - b}{\color{blue}{b \cdot b - b \cdot b}}}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \frac{1}{\frac{b - b}{b \cdot b - b \cdot b}}\\ \end{array} \]
          11. clear-numN/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \color{blue}{\frac{b \cdot b - b \cdot b}{b - b}}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \frac{b \cdot b - b \cdot b}{b - b}\\ \end{array} \]
          12. flip-+N/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \color{blue}{\left(b + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \left(b + b\right)\\ \end{array} \]
          13. *-lowering-*.f64N/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \left(b + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{neg}\left(2 \cdot c\right)\right) \cdot \left(b + b\right)\\ \end{array} \]
          14. *-commutativeN/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(\mathsf{neg}\left(\color{blue}{c \cdot 2}\right)\right) \cdot \left(b + b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{neg}\left(c \cdot 2\right)\right) \cdot \left(b + b\right)\\ \end{array} \]
          15. distribute-rgt-neg-inN/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\left(c \cdot \left(\mathsf{neg}\left(2\right)\right)\right)} \cdot \left(b + b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c \cdot \left(\mathsf{neg}\left(2\right)\right)\right) \cdot \left(b + b\right)\\ \end{array} \]
          16. metadata-evalN/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(c \cdot \color{blue}{-2}\right) \cdot \left(b + b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c \cdot -2\right) \cdot \left(b + b\right)\\ \end{array} \]
          17. *-lowering-*.f64N/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\left(c \cdot -2\right)} \cdot \left(b + b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c \cdot -2\right) \cdot \left(b + b\right)\\ \end{array} \]
          18. +-lowering-+.f6469.0

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(c \cdot -2\right) \cdot \color{blue}{\left(b + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \end{array} \]
        5. Applied egg-rr69.0%

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\left(c \cdot -2\right) \cdot \left(b + b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \end{array} \]

        if 1.15000000000000005e-262 < b

        1. Initial program 69.1%

          \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
        2. Add Preprocessing
        3. Taylor expanded in b around -inf

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
        4. Step-by-step derivation
          1. mul-1-negN/A

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
          2. neg-lowering-neg.f6469.1

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
        5. Simplified69.1%

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
        6. Taylor expanded in b around inf

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - b}\\ \end{array} \]
        7. Step-by-step derivation
          1. Simplified67.0%

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
          2. Step-by-step derivation
            1. clear-numN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{1}{\frac{\left(\mathsf{neg}\left(b\right)\right) - b}{2 \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\left(\mathsf{neg}\left(b\right)\right) - b}{2 \cdot c}}\\ \end{array} \]
            2. associate-/r*N/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\color{blue}{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) - b}{2}}{c}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) - b}{2}}{c}}\\ \end{array} \]
            3. sub-negN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\frac{\frac{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) + \left(\mathsf{neg}\left(b\right)\right)}}{2}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) + \left(\mathsf{neg}\left(b\right)\right)}{2}}{c}}\\ \end{array} \]
            4. flip-+N/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\frac{\frac{\color{blue}{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right)}}}{2}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right)}}{2}}{c}}\\ \end{array} \]
            5. +-inversesN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\frac{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\color{blue}{0}}}{2}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{0}}{2}}{c}}\\ \end{array} \]
            6. associate-/l/N/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\frac{\color{blue}{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{2 \cdot 0}}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{2 \cdot 0}}{c}}\\ \end{array} \]
            7. metadata-evalN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\color{blue}{0}}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{0}}{c}}\\ \end{array} \]
            8. +-inversesN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right)}}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right)}}{c}}\\ \end{array} \]
            9. flip-+N/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\frac{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) + \left(\mathsf{neg}\left(b\right)\right)}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\left(\mathsf{neg}\left(b\right)\right) + \left(\mathsf{neg}\left(b\right)\right)}{c}}\\ \end{array} \]
            10. sub-negN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\frac{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) - b}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\left(\mathsf{neg}\left(b\right)\right) - b}{c}}\\ \end{array} \]
            11. clear-numN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{c}{\left(\mathsf{neg}\left(b\right)\right) - b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{\left(\mathsf{neg}\left(b\right)\right) - b}\\ \end{array} \]
            12. frac-2negN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{\mathsf{neg}\left(c\right)}{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(b\right)\right) - b\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(b\right)\right) - b\right)\right)}\\ \end{array} \]
            13. sub-negN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(b\right)\right) + \left(\mathsf{neg}\left(b\right)\right)\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \left(\mathsf{neg}\left(b\right)\right)\right)\right)}\\ \end{array} \]
            14. flip-+N/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{\mathsf{neg}\left(\color{blue}{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right)}}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right)}\right)}\\ \end{array} \]
            15. +-inversesN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\color{blue}{0}}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{0}\right)}\\ \end{array} \]
            16. distribute-neg-frac2N/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{\color{blue}{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\mathsf{neg}\left(0\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\mathsf{neg}\left(0\right)}}\\ \end{array} \]
          3. Applied egg-rr23.3%

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{-c}{b + b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
          4. Step-by-step derivation
            1. sub-negN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
            2. associate-/r*N/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
            3. frac-2negN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
            4. sub-negN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
            5. flip-+N/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
            6. +-inversesN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
            7. associate-/l/N/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
            8. metadata-evalN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
            9. +-inversesN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
            10. flip-+N/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
            11. distribute-neg-outN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
            12. remove-double-negN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
            13. /-lowering-/.f64N/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
            14. +-lowering-+.f64N/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
            15. neg-lowering-neg.f6423.3

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-c}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\color{blue}{\frac{b + b}{-a}}\\ \end{array} \]
          5. Applied egg-rr23.3%

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-c}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{b + b}{-a}\\ \end{array} \]
        8. Recombined 2 regimes into one program.
        9. Final simplification47.5%

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.15 \cdot 10^{-262}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(c \cdot -2\right) \cdot \left(b + b\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{b + b}{a \cdot \left(-2\right)}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-c}{b + b}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b + b}{a}\\ \end{array} \]
        10. Add Preprocessing

        Alternative 9: 47.9% accurate, 1.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.05 \cdot 10^{-229}:\\ \;\;\;\;-\frac{b}{a}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-c}{b + b}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b + b}{a}\\ \end{array} \end{array} \]
        (FPCore (a b c)
         :precision binary64
         (if (<= b -2.05e-229)
           (- (/ b a))
           (if (>= b 0.0) (/ (- c) (+ b b)) (- (/ (+ b b) a)))))
        double code(double a, double b, double c) {
        	double tmp;
        	if (b <= -2.05e-229) {
        		tmp = -(b / a);
        	} else if (b >= 0.0) {
        		tmp = -c / (b + b);
        	} else {
        		tmp = -((b + b) / a);
        	}
        	return tmp;
        }
        
        real(8) function code(a, b, c)
            real(8), intent (in) :: a
            real(8), intent (in) :: b
            real(8), intent (in) :: c
            real(8) :: tmp
            if (b <= (-2.05d-229)) then
                tmp = -(b / a)
            else if (b >= 0.0d0) then
                tmp = -c / (b + b)
            else
                tmp = -((b + b) / a)
            end if
            code = tmp
        end function
        
        public static double code(double a, double b, double c) {
        	double tmp;
        	if (b <= -2.05e-229) {
        		tmp = -(b / a);
        	} else if (b >= 0.0) {
        		tmp = -c / (b + b);
        	} else {
        		tmp = -((b + b) / a);
        	}
        	return tmp;
        }
        
        def code(a, b, c):
        	tmp = 0
        	if b <= -2.05e-229:
        		tmp = -(b / a)
        	elif b >= 0.0:
        		tmp = -c / (b + b)
        	else:
        		tmp = -((b + b) / a)
        	return tmp
        
        function code(a, b, c)
        	tmp = 0.0
        	if (b <= -2.05e-229)
        		tmp = Float64(-Float64(b / a));
        	elseif (b >= 0.0)
        		tmp = Float64(Float64(-c) / Float64(b + b));
        	else
        		tmp = Float64(-Float64(Float64(b + b) / a));
        	end
        	return tmp
        end
        
        function tmp_2 = code(a, b, c)
        	tmp = 0.0;
        	if (b <= -2.05e-229)
        		tmp = -(b / a);
        	elseif (b >= 0.0)
        		tmp = -c / (b + b);
        	else
        		tmp = -((b + b) / a);
        	end
        	tmp_2 = tmp;
        end
        
        code[a_, b_, c_] := If[LessEqual[b, -2.05e-229], (-N[(b / a), $MachinePrecision]), If[GreaterEqual[b, 0.0], N[((-c) / N[(b + b), $MachinePrecision]), $MachinePrecision], (-N[(N[(b + b), $MachinePrecision] / a), $MachinePrecision])]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;b \leq -2.05 \cdot 10^{-229}:\\
        \;\;\;\;-\frac{b}{a}\\
        
        \mathbf{elif}\;b \geq 0:\\
        \;\;\;\;\frac{-c}{b + b}\\
        
        \mathbf{else}:\\
        \;\;\;\;-\frac{b + b}{a}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if b < -2.05e-229

          1. Initial program 64.9%

            \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
          2. Add Preprocessing
          3. Taylor expanded in b around -inf

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
          4. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
            2. neg-lowering-neg.f6478.2

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
          5. Simplified78.2%

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
          6. Taylor expanded in b around -inf

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-1 \cdot \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \end{array} \]
          7. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\mathsf{neg}\left(\frac{b}{a}\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{neg}\left(\frac{b}{a}\right)\\ \end{array} \]
            2. distribute-neg-frac2N/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{b}{\mathsf{neg}\left(a\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{\mathsf{neg}\left(a\right)}\\ \end{array} \]
            3. mul-1-negN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{\color{blue}{-1 \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{-1 \cdot a}\\ \end{array} \]
            4. /-lowering-/.f64N/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{b}{-1 \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{-1 \cdot a}\\ \end{array} \]
            5. mul-1-negN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{\color{blue}{\mathsf{neg}\left(a\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{\mathsf{neg}\left(a\right)}\\ \end{array} \]
            6. neg-lowering-neg.f6478.2

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{\color{blue}{-a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
          8. Simplified78.2%

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{b}{-a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
          9. Taylor expanded in b around 0

            \[\leadsto \color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;b \geq 0:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ } \end{array}} \]
          10. Step-by-step derivation
            1. if-sameN/A

              \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
            2. mul-1-negN/A

              \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{b}{a}\right)} \]
            3. distribute-neg-frac2N/A

              \[\leadsto \color{blue}{\frac{b}{\mathsf{neg}\left(a\right)}} \]
            4. mul-1-negN/A

              \[\leadsto \frac{b}{\color{blue}{-1 \cdot a}} \]
            5. /-lowering-/.f64N/A

              \[\leadsto \color{blue}{\frac{b}{-1 \cdot a}} \]
            6. mul-1-negN/A

              \[\leadsto \frac{b}{\color{blue}{\mathsf{neg}\left(a\right)}} \]
            7. neg-lowering-neg.f6478.2

              \[\leadsto \frac{b}{\color{blue}{-a}} \]
          11. Simplified78.2%

            \[\leadsto \color{blue}{\frac{b}{-a}} \]

          if -2.05e-229 < b

          1. Initial program 70.1%

            \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
          2. Add Preprocessing
          3. Taylor expanded in b around -inf

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
          4. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
            2. neg-lowering-neg.f6465.9

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
          5. Simplified65.9%

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
          6. Taylor expanded in b around inf

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - b}\\ \end{array} \]
          7. Step-by-step derivation
            1. Simplified59.2%

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
            2. Step-by-step derivation
              1. clear-numN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{1}{\frac{\left(\mathsf{neg}\left(b\right)\right) - b}{2 \cdot c}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\left(\mathsf{neg}\left(b\right)\right) - b}{2 \cdot c}}\\ \end{array} \]
              2. associate-/r*N/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\color{blue}{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) - b}{2}}{c}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) - b}{2}}{c}}\\ \end{array} \]
              3. sub-negN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\frac{\frac{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) + \left(\mathsf{neg}\left(b\right)\right)}}{2}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) + \left(\mathsf{neg}\left(b\right)\right)}{2}}{c}}\\ \end{array} \]
              4. flip-+N/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\frac{\frac{\color{blue}{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right)}}}{2}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right)}}{2}}{c}}\\ \end{array} \]
              5. +-inversesN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\frac{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\color{blue}{0}}}{2}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{0}}{2}}{c}}\\ \end{array} \]
              6. associate-/l/N/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\frac{\color{blue}{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{2 \cdot 0}}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{2 \cdot 0}}{c}}\\ \end{array} \]
              7. metadata-evalN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\color{blue}{0}}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{0}}{c}}\\ \end{array} \]
              8. +-inversesN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right)}}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right)}}{c}}\\ \end{array} \]
              9. flip-+N/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\frac{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) + \left(\mathsf{neg}\left(b\right)\right)}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\left(\mathsf{neg}\left(b\right)\right) + \left(\mathsf{neg}\left(b\right)\right)}{c}}\\ \end{array} \]
              10. sub-negN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{1}{\frac{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) - b}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\left(\mathsf{neg}\left(b\right)\right) - b}{c}}\\ \end{array} \]
              11. clear-numN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{c}{\left(\mathsf{neg}\left(b\right)\right) - b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{\left(\mathsf{neg}\left(b\right)\right) - b}\\ \end{array} \]
              12. frac-2negN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{\mathsf{neg}\left(c\right)}{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(b\right)\right) - b\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(b\right)\right) - b\right)\right)}\\ \end{array} \]
              13. sub-negN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(b\right)\right) + \left(\mathsf{neg}\left(b\right)\right)\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(b\right)\right) + \left(\mathsf{neg}\left(b\right)\right)\right)\right)}\\ \end{array} \]
              14. flip-+N/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{\mathsf{neg}\left(\color{blue}{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right)}}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right)}\right)}\\ \end{array} \]
              15. +-inversesN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\color{blue}{0}}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{0}\right)}\\ \end{array} \]
              16. distribute-neg-frac2N/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{\color{blue}{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\mathsf{neg}\left(0\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\mathsf{neg}\left(0\right)}}\\ \end{array} \]
            3. Applied egg-rr20.9%

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{-c}{b + b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
            4. Step-by-step derivation
              1. sub-negN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
              2. associate-/r*N/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
              3. frac-2negN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
              4. sub-negN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
              5. flip-+N/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
              6. +-inversesN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
              7. associate-/l/N/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
              8. metadata-evalN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
              9. +-inversesN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
              10. flip-+N/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
              11. distribute-neg-outN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
              12. remove-double-negN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
              13. /-lowering-/.f64N/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
              14. +-lowering-+.f64N/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{neg}\left(c\right)}{b + b}\\ \end{array} \]
              15. neg-lowering-neg.f6420.9

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-c}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\color{blue}{\frac{b + b}{-a}}\\ \end{array} \]
            5. Applied egg-rr20.9%

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-c}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{b + b}{-a}\\ \end{array} \]
          8. Recombined 2 regimes into one program.
          9. Final simplification47.5%

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.05 \cdot 10^{-229}:\\ \;\;\;\;-\frac{b}{a}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-c}{b + b}\\ \mathbf{else}:\\ \;\;\;\;-\frac{b + b}{a}\\ \end{array} \]
          10. Add Preprocessing

          Alternative 10: 67.6% accurate, 2.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{b + b}{a \cdot \left(-2\right)}\\ \end{array} \end{array} \]
          (FPCore (a b c)
           :precision binary64
           (if (>= b 0.0) (/ (* 2.0 c) (- (- b) b)) (/ (+ b b) (* a (- 2.0)))))
          double code(double a, double b, double c) {
          	double tmp;
          	if (b >= 0.0) {
          		tmp = (2.0 * c) / (-b - b);
          	} else {
          		tmp = (b + b) / (a * -2.0);
          	}
          	return tmp;
          }
          
          real(8) function code(a, b, c)
              real(8), intent (in) :: a
              real(8), intent (in) :: b
              real(8), intent (in) :: c
              real(8) :: tmp
              if (b >= 0.0d0) then
                  tmp = (2.0d0 * c) / (-b - b)
              else
                  tmp = (b + b) / (a * -2.0d0)
              end if
              code = tmp
          end function
          
          public static double code(double a, double b, double c) {
          	double tmp;
          	if (b >= 0.0) {
          		tmp = (2.0 * c) / (-b - b);
          	} else {
          		tmp = (b + b) / (a * -2.0);
          	}
          	return tmp;
          }
          
          def code(a, b, c):
          	tmp = 0
          	if b >= 0.0:
          		tmp = (2.0 * c) / (-b - b)
          	else:
          		tmp = (b + b) / (a * -2.0)
          	return tmp
          
          function code(a, b, c)
          	tmp = 0.0
          	if (b >= 0.0)
          		tmp = Float64(Float64(2.0 * c) / Float64(Float64(-b) - b));
          	else
          		tmp = Float64(Float64(b + b) / Float64(a * Float64(-2.0)));
          	end
          	return tmp
          end
          
          function tmp_2 = code(a, b, c)
          	tmp = 0.0;
          	if (b >= 0.0)
          		tmp = (2.0 * c) / (-b - b);
          	else
          		tmp = (b + b) / (a * -2.0);
          	end
          	tmp_2 = tmp;
          end
          
          code[a_, b_, c_] := If[GreaterEqual[b, 0.0], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) - b), $MachinePrecision]), $MachinePrecision], N[(N[(b + b), $MachinePrecision] / N[(a * (-2.0)), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;b \geq 0:\\
          \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{b + b}{a \cdot \left(-2\right)}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Initial program 67.7%

            \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
          2. Add Preprocessing
          3. Taylor expanded in b around -inf

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
          4. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
            2. neg-lowering-neg.f6471.6

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
          5. Simplified71.6%

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
          6. Taylor expanded in b around inf

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \color{blue}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - b}\\ \end{array} \]
          7. Step-by-step derivation
            1. Simplified68.0%

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \color{blue}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
            2. Step-by-step derivation
              1. sub-negN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - b}\\ \end{array} \]
              2. --lowering--.f64N/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - b}\\ \end{array} \]
              3. neg-lowering-neg.f6468.0

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \end{array} \]
            3. Applied egg-rr68.0%

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) - b}{2 \cdot a}\\ \end{array} \]
            4. Final simplification68.0%

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - b}\\ \mathbf{else}:\\ \;\;\;\;\frac{b + b}{a \cdot \left(-2\right)}\\ \end{array} \]
            5. Add Preprocessing

            Alternative 11: 35.9% accurate, 4.0× speedup?

            \[\begin{array}{l} \\ -\frac{b}{a} \end{array} \]
            (FPCore (a b c) :precision binary64 (- (/ b a)))
            double code(double a, double b, double c) {
            	return -(b / a);
            }
            
            real(8) function code(a, b, c)
                real(8), intent (in) :: a
                real(8), intent (in) :: b
                real(8), intent (in) :: c
                code = -(b / a)
            end function
            
            public static double code(double a, double b, double c) {
            	return -(b / a);
            }
            
            def code(a, b, c):
            	return -(b / a)
            
            function code(a, b, c)
            	return Float64(-Float64(b / a))
            end
            
            function tmp = code(a, b, c)
            	tmp = -(b / a);
            end
            
            code[a_, b_, c_] := (-N[(b / a), $MachinePrecision])
            
            \begin{array}{l}
            
            \\
            -\frac{b}{a}
            \end{array}
            
            Derivation
            1. Initial program 67.7%

              \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \end{array} \]
            2. Add Preprocessing
            3. Taylor expanded in b around -inf

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
            4. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
              2. neg-lowering-neg.f6471.6

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
            5. Simplified71.6%

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
            6. Taylor expanded in b around -inf

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-1 \cdot \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \end{array} \]
            7. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\mathsf{neg}\left(\frac{b}{a}\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{neg}\left(\frac{b}{a}\right)\\ \end{array} \]
              2. distribute-neg-frac2N/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{b}{\mathsf{neg}\left(a\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{\mathsf{neg}\left(a\right)}\\ \end{array} \]
              3. mul-1-negN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{\color{blue}{-1 \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{-1 \cdot a}\\ \end{array} \]
              4. /-lowering-/.f64N/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{b}{-1 \cdot a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{-1 \cdot a}\\ \end{array} \]
              5. mul-1-negN/A

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{\color{blue}{\mathsf{neg}\left(a\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{\mathsf{neg}\left(a\right)}\\ \end{array} \]
              6. neg-lowering-neg.f6438.0

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b}{\color{blue}{-a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
            8. Simplified38.0%

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{b}{-a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
            9. Taylor expanded in b around 0

              \[\leadsto \color{blue}{\begin{array}{l} \color{blue}{\mathbf{if}\;b \geq 0:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{b}{a}\\ } \end{array}} \]
            10. Step-by-step derivation
              1. if-sameN/A

                \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
              2. mul-1-negN/A

                \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{b}{a}\right)} \]
              3. distribute-neg-frac2N/A

                \[\leadsto \color{blue}{\frac{b}{\mathsf{neg}\left(a\right)}} \]
              4. mul-1-negN/A

                \[\leadsto \frac{b}{\color{blue}{-1 \cdot a}} \]
              5. /-lowering-/.f64N/A

                \[\leadsto \color{blue}{\frac{b}{-1 \cdot a}} \]
              6. mul-1-negN/A

                \[\leadsto \frac{b}{\color{blue}{\mathsf{neg}\left(a\right)}} \]
              7. neg-lowering-neg.f6438.0

                \[\leadsto \frac{b}{\color{blue}{-a}} \]
            11. Simplified38.0%

              \[\leadsto \color{blue}{\frac{b}{-a}} \]
            12. Final simplification38.0%

              \[\leadsto -\frac{b}{a} \]
            13. Add Preprocessing

            Reproduce

            ?
            herbie shell --seed 2024199 
            (FPCore (a b c)
              :name "jeff quadratic root 2"
              :precision binary64
              (if (>= b 0.0) (/ (* 2.0 c) (- (- b) (sqrt (- (* b b) (* (* 4.0 a) c))))) (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a))))