jeff quadratic root 1

Percentage Accurate: 72.2% → 90.9%
Time: 17.7s
Alternatives: 9
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{\left(-b\right) - t_0}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + t_0}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (sqrt (- (* b b) (* (* 4.0 a) c)))))
   (if (>= b 0.0) (/ (- (- b) t_0) (* 2.0 a)) (/ (* 2.0 c) (+ (- b) t_0)))))
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 = (-b - t_0) / (2.0 * a);
	} else {
		tmp = (2.0 * c) / (-b + t_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
    t_0 = sqrt(((b * b) - ((4.0d0 * a) * c)))
    if (b >= 0.0d0) then
        tmp = (-b - t_0) / (2.0d0 * a)
    else
        tmp = (2.0d0 * c) / (-b + t_0)
    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 = (-b - t_0) / (2.0 * a);
	} else {
		tmp = (2.0 * c) / (-b + t_0);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = math.sqrt(((b * b) - ((4.0 * a) * c)))
	tmp = 0
	if b >= 0.0:
		tmp = (-b - t_0) / (2.0 * a)
	else:
		tmp = (2.0 * c) / (-b + t_0)
	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(Float64(-b) - t_0) / Float64(2.0 * a));
	else
		tmp = Float64(Float64(2.0 * c) / Float64(Float64(-b) + t_0));
	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 = (-b - t_0) / (2.0 * a);
	else
		tmp = (2.0 * c) / (-b + t_0);
	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[((-b) - t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) + t$95$0), $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{\left(-b\right) - t_0}{2 \cdot a}\\

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


\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 9 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{\left(-b\right) - t_0}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + t_0}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (sqrt (- (* b b) (* (* 4.0 a) c)))))
   (if (>= b 0.0) (/ (- (- b) t_0) (* 2.0 a)) (/ (* 2.0 c) (+ (- b) t_0)))))
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 = (-b - t_0) / (2.0 * a);
	} else {
		tmp = (2.0 * c) / (-b + t_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
    t_0 = sqrt(((b * b) - ((4.0d0 * a) * c)))
    if (b >= 0.0d0) then
        tmp = (-b - t_0) / (2.0d0 * a)
    else
        tmp = (2.0d0 * c) / (-b + t_0)
    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 = (-b - t_0) / (2.0 * a);
	} else {
		tmp = (2.0 * c) / (-b + t_0);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = math.sqrt(((b * b) - ((4.0 * a) * c)))
	tmp = 0
	if b >= 0.0:
		tmp = (-b - t_0) / (2.0 * a)
	else:
		tmp = (2.0 * c) / (-b + t_0)
	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(Float64(-b) - t_0) / Float64(2.0 * a));
	else
		tmp = Float64(Float64(2.0 * c) / Float64(Float64(-b) + t_0));
	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 = (-b - t_0) / (2.0 * a);
	else
		tmp = (2.0 * c) / (-b + t_0);
	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[((-b) - t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) + t$95$0), $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{\left(-b\right) - t_0}{2 \cdot a}\\

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


\end{array}
\end{array}

Alternative 1: 90.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array}\\ \mathbf{if}\;b \leq -1.25 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -4.2 \cdot 10^{-306}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(\frac{c}{b} - \frac{b}{a}\right) + a \cdot \frac{c}{\frac{{b}^{3}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}\\ \end{array}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{+108}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{b \cdot -2}{c}}\\ \end{array}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (if (>= b 0.0) (/ (- b) a) (- (/ c b)))))
   (if (<= b -1.25e+154)
     t_0
     (if (<= b -4.2e-306)
       (if (>= b 0.0)
         (+ (- (/ c b) (/ b a)) (* a (/ c (/ (pow b 3.0) c))))
         (/ (* c 2.0) (- (sqrt (- (* b b) (* c (* a 4.0)))) b)))
       (if (<= b 5e+108)
         (if (>= b 0.0)
           (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* a 2.0))
           (/ 2.0 (/ (* b -2.0) c)))
         t_0)))))
double code(double a, double b, double c) {
	double tmp;
	if (b >= 0.0) {
		tmp = -b / a;
	} else {
		tmp = -(c / b);
	}
	double t_0 = tmp;
	double tmp_1;
	if (b <= -1.25e+154) {
		tmp_1 = t_0;
	} else if (b <= -4.2e-306) {
		double tmp_2;
		if (b >= 0.0) {
			tmp_2 = ((c / b) - (b / a)) + (a * (c / (pow(b, 3.0) / c)));
		} else {
			tmp_2 = (c * 2.0) / (sqrt(((b * b) - (c * (a * 4.0)))) - b);
		}
		tmp_1 = tmp_2;
	} else if (b <= 5e+108) {
		double tmp_3;
		if (b >= 0.0) {
			tmp_3 = (-b - sqrt(((b * b) - (4.0 * (a * c))))) / (a * 2.0);
		} else {
			tmp_3 = 2.0 / ((b * -2.0) / c);
		}
		tmp_1 = tmp_3;
	} 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
    real(8) :: tmp_3
    if (b >= 0.0d0) then
        tmp = -b / a
    else
        tmp = -(c / b)
    end if
    t_0 = tmp
    if (b <= (-1.25d+154)) then
        tmp_1 = t_0
    else if (b <= (-4.2d-306)) then
        if (b >= 0.0d0) then
            tmp_2 = ((c / b) - (b / a)) + (a * (c / ((b ** 3.0d0) / c)))
        else
            tmp_2 = (c * 2.0d0) / (sqrt(((b * b) - (c * (a * 4.0d0)))) - b)
        end if
        tmp_1 = tmp_2
    else if (b <= 5d+108) then
        if (b >= 0.0d0) then
            tmp_3 = (-b - sqrt(((b * b) - (4.0d0 * (a * c))))) / (a * 2.0d0)
        else
            tmp_3 = 2.0d0 / ((b * (-2.0d0)) / c)
        end if
        tmp_1 = tmp_3
    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 = -b / a;
	} else {
		tmp = -(c / b);
	}
	double t_0 = tmp;
	double tmp_1;
	if (b <= -1.25e+154) {
		tmp_1 = t_0;
	} else if (b <= -4.2e-306) {
		double tmp_2;
		if (b >= 0.0) {
			tmp_2 = ((c / b) - (b / a)) + (a * (c / (Math.pow(b, 3.0) / c)));
		} else {
			tmp_2 = (c * 2.0) / (Math.sqrt(((b * b) - (c * (a * 4.0)))) - b);
		}
		tmp_1 = tmp_2;
	} else if (b <= 5e+108) {
		double tmp_3;
		if (b >= 0.0) {
			tmp_3 = (-b - Math.sqrt(((b * b) - (4.0 * (a * c))))) / (a * 2.0);
		} else {
			tmp_3 = 2.0 / ((b * -2.0) / c);
		}
		tmp_1 = tmp_3;
	} else {
		tmp_1 = t_0;
	}
	return tmp_1;
}
def code(a, b, c):
	tmp = 0
	if b >= 0.0:
		tmp = -b / a
	else:
		tmp = -(c / b)
	t_0 = tmp
	tmp_1 = 0
	if b <= -1.25e+154:
		tmp_1 = t_0
	elif b <= -4.2e-306:
		tmp_2 = 0
		if b >= 0.0:
			tmp_2 = ((c / b) - (b / a)) + (a * (c / (math.pow(b, 3.0) / c)))
		else:
			tmp_2 = (c * 2.0) / (math.sqrt(((b * b) - (c * (a * 4.0)))) - b)
		tmp_1 = tmp_2
	elif b <= 5e+108:
		tmp_3 = 0
		if b >= 0.0:
			tmp_3 = (-b - math.sqrt(((b * b) - (4.0 * (a * c))))) / (a * 2.0)
		else:
			tmp_3 = 2.0 / ((b * -2.0) / c)
		tmp_1 = tmp_3
	else:
		tmp_1 = t_0
	return tmp_1
function code(a, b, c)
	tmp = 0.0
	if (b >= 0.0)
		tmp = Float64(Float64(-b) / a);
	else
		tmp = Float64(-Float64(c / b));
	end
	t_0 = tmp
	tmp_1 = 0.0
	if (b <= -1.25e+154)
		tmp_1 = t_0;
	elseif (b <= -4.2e-306)
		tmp_2 = 0.0
		if (b >= 0.0)
			tmp_2 = Float64(Float64(Float64(c / b) - Float64(b / a)) + Float64(a * Float64(c / Float64((b ^ 3.0) / c))));
		else
			tmp_2 = Float64(Float64(c * 2.0) / Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) - b));
		end
		tmp_1 = tmp_2;
	elseif (b <= 5e+108)
		tmp_3 = 0.0
		if (b >= 0.0)
			tmp_3 = Float64(Float64(Float64(-b) - sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(a * c))))) / Float64(a * 2.0));
		else
			tmp_3 = Float64(2.0 / Float64(Float64(b * -2.0) / c));
		end
		tmp_1 = tmp_3;
	else
		tmp_1 = t_0;
	end
	return tmp_1
end
function tmp_5 = code(a, b, c)
	tmp = 0.0;
	if (b >= 0.0)
		tmp = -b / a;
	else
		tmp = -(c / b);
	end
	t_0 = tmp;
	tmp_2 = 0.0;
	if (b <= -1.25e+154)
		tmp_2 = t_0;
	elseif (b <= -4.2e-306)
		tmp_3 = 0.0;
		if (b >= 0.0)
			tmp_3 = ((c / b) - (b / a)) + (a * (c / ((b ^ 3.0) / c)));
		else
			tmp_3 = (c * 2.0) / (sqrt(((b * b) - (c * (a * 4.0)))) - b);
		end
		tmp_2 = tmp_3;
	elseif (b <= 5e+108)
		tmp_4 = 0.0;
		if (b >= 0.0)
			tmp_4 = (-b - sqrt(((b * b) - (4.0 * (a * c))))) / (a * 2.0);
		else
			tmp_4 = 2.0 / ((b * -2.0) / c);
		end
		tmp_2 = tmp_4;
	else
		tmp_2 = t_0;
	end
	tmp_5 = tmp_2;
end
code[a_, b_, c_] := Block[{t$95$0 = If[GreaterEqual[b, 0.0], N[((-b) / a), $MachinePrecision], (-N[(c / b), $MachinePrecision])]}, If[LessEqual[b, -1.25e+154], t$95$0, If[LessEqual[b, -4.2e-306], If[GreaterEqual[b, 0.0], N[(N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(a * N[(c / N[(N[Power[b, 3.0], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * 2.0), $MachinePrecision] / N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], If[LessEqual[b, 5e+108], If[GreaterEqual[b, 0.0], N[(N[((-b) - N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(b * -2.0), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]], t$95$0]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{-b}{a}\\

\mathbf{else}:\\
\;\;\;\;-\frac{c}{b}\\


\end{array}\\
\mathbf{if}\;b \leq -1.25 \cdot 10^{+154}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;b \leq -4.2 \cdot 10^{-306}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\left(\frac{c}{b} - \frac{b}{a}\right) + a \cdot \frac{c}{\frac{{b}^{3}}{c}}\\

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


\end{array}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{b \cdot -2}{c}}\\


\end{array}\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.25000000000000001e154 or 4.99999999999999991e108 < b

    1. Initial program 49.6%

      \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
    2. Step-by-step derivation
      1. Simplified49.6%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \]
      3. Step-by-step derivation
        1. associate-*r/71.7%

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-1 \cdot \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
      7. Step-by-step derivation
        1. associate-*r/96.3%

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{-1 \cdot b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
        2. neg-mul-196.3%

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\color{blue}{-b}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
      8. Simplified96.3%

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{-b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

      if -1.25000000000000001e154 < b < -4.2000000000000002e-306

      1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -4.2000000000000002e-306 < b < 4.99999999999999991e108

      1. Initial program 83.4%

        \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
      2. Step-by-step derivation
        1. associate-*l*83.4%

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

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.25 \cdot 10^{+154}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array}\\ \mathbf{elif}\;b \leq -4.2 \cdot 10^{-306}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(\frac{c}{b} - \frac{b}{a}\right) + a \cdot \frac{c}{\frac{{b}^{3}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}\\ \end{array}\\ \mathbf{elif}\;b \leq 5 \cdot 10^{+108}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{b \cdot -2}{c}}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array} \]

    Alternative 2: 91.0% accurate, 1.0× 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.25 \cdot 10^{+154} \lor \neg \left(b \leq 2 \cdot 10^{+106}\right):\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - t_0}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{t_0 - b}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (let* ((t_0 (sqrt (- (* b b) (* c (* a 4.0))))))
       (if (or (<= b -1.25e+154) (not (<= b 2e+106)))
         (if (>= b 0.0) (/ (- b) a) (- (/ c b)))
         (if (>= b 0.0) (/ (- (- b) t_0) (* a 2.0)) (/ (* c 2.0) (- t_0 b))))))
    double code(double a, double b, double c) {
    	double t_0 = sqrt(((b * b) - (c * (a * 4.0))));
    	double tmp_1;
    	if ((b <= -1.25e+154) || !(b <= 2e+106)) {
    		double tmp_2;
    		if (b >= 0.0) {
    			tmp_2 = -b / a;
    		} else {
    			tmp_2 = -(c / b);
    		}
    		tmp_1 = tmp_2;
    	} else if (b >= 0.0) {
    		tmp_1 = (-b - t_0) / (a * 2.0);
    	} else {
    		tmp_1 = (c * 2.0) / (t_0 - b);
    	}
    	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 = sqrt(((b * b) - (c * (a * 4.0d0))))
        if ((b <= (-1.25d+154)) .or. (.not. (b <= 2d+106))) then
            if (b >= 0.0d0) then
                tmp_2 = -b / a
            else
                tmp_2 = -(c / b)
            end if
            tmp_1 = tmp_2
        else if (b >= 0.0d0) then
            tmp_1 = (-b - t_0) / (a * 2.0d0)
        else
            tmp_1 = (c * 2.0d0) / (t_0 - b)
        end if
        code = tmp_1
    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_1;
    	if ((b <= -1.25e+154) || !(b <= 2e+106)) {
    		double tmp_2;
    		if (b >= 0.0) {
    			tmp_2 = -b / a;
    		} else {
    			tmp_2 = -(c / b);
    		}
    		tmp_1 = tmp_2;
    	} else if (b >= 0.0) {
    		tmp_1 = (-b - t_0) / (a * 2.0);
    	} else {
    		tmp_1 = (c * 2.0) / (t_0 - b);
    	}
    	return tmp_1;
    }
    
    def code(a, b, c):
    	t_0 = math.sqrt(((b * b) - (c * (a * 4.0))))
    	tmp_1 = 0
    	if (b <= -1.25e+154) or not (b <= 2e+106):
    		tmp_2 = 0
    		if b >= 0.0:
    			tmp_2 = -b / a
    		else:
    			tmp_2 = -(c / b)
    		tmp_1 = tmp_2
    	elif b >= 0.0:
    		tmp_1 = (-b - t_0) / (a * 2.0)
    	else:
    		tmp_1 = (c * 2.0) / (t_0 - b)
    	return tmp_1
    
    function code(a, b, c)
    	t_0 = sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0))))
    	tmp_1 = 0.0
    	if ((b <= -1.25e+154) || !(b <= 2e+106))
    		tmp_2 = 0.0
    		if (b >= 0.0)
    			tmp_2 = Float64(Float64(-b) / a);
    		else
    			tmp_2 = Float64(-Float64(c / b));
    		end
    		tmp_1 = tmp_2;
    	elseif (b >= 0.0)
    		tmp_1 = Float64(Float64(Float64(-b) - t_0) / Float64(a * 2.0));
    	else
    		tmp_1 = Float64(Float64(c * 2.0) / Float64(t_0 - b));
    	end
    	return tmp_1
    end
    
    function tmp_4 = code(a, b, c)
    	t_0 = sqrt(((b * b) - (c * (a * 4.0))));
    	tmp_2 = 0.0;
    	if ((b <= -1.25e+154) || ~((b <= 2e+106)))
    		tmp_3 = 0.0;
    		if (b >= 0.0)
    			tmp_3 = -b / a;
    		else
    			tmp_3 = -(c / b);
    		end
    		tmp_2 = tmp_3;
    	elseif (b >= 0.0)
    		tmp_2 = (-b - t_0) / (a * 2.0);
    	else
    		tmp_2 = (c * 2.0) / (t_0 - b);
    	end
    	tmp_4 = tmp_2;
    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[Or[LessEqual[b, -1.25e+154], N[Not[LessEqual[b, 2e+106]], $MachinePrecision]], If[GreaterEqual[b, 0.0], N[((-b) / a), $MachinePrecision], (-N[(c / b), $MachinePrecision])], If[GreaterEqual[b, 0.0], N[(N[((-b) - t$95$0), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * 2.0), $MachinePrecision] / N[(t$95$0 - b), $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.25 \cdot 10^{+154} \lor \neg \left(b \leq 2 \cdot 10^{+106}\right):\\
    \;\;\;\;\begin{array}{l}
    \mathbf{if}\;b \geq 0:\\
    \;\;\;\;\frac{-b}{a}\\
    
    \mathbf{else}:\\
    \;\;\;\;-\frac{c}{b}\\
    
    
    \end{array}\\
    
    \mathbf{elif}\;b \geq 0:\\
    \;\;\;\;\frac{\left(-b\right) - t_0}{a \cdot 2}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{c \cdot 2}{t_0 - b}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b < -1.25000000000000001e154 or 2.00000000000000018e106 < b

      1. Initial program 49.6%

        \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
      2. Step-by-step derivation
        1. Simplified49.6%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \]
        3. Step-by-step derivation
          1. associate-*r/71.7%

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

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-1 \cdot \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
        7. Step-by-step derivation
          1. associate-*r/96.3%

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{-1 \cdot b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
          2. neg-mul-196.3%

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\color{blue}{-b}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
        8. Simplified96.3%

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{-b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

        if -1.25000000000000001e154 < b < 2.00000000000000018e106

        1. Initial program 86.9%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.25 \cdot 10^{+154} \lor \neg \left(b \leq 2 \cdot 10^{+106}\right):\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}\\ \end{array} \]

      Alternative 3: 90.8% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\\ \mathbf{if}\;b \leq -3.6 \cdot 10^{+109} \lor \neg \left(b \leq 8 \cdot 10^{+108}\right):\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - t_0}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{t_0 - b}{c}}\\ \end{array} \end{array} \]
      (FPCore (a b c)
       :precision binary64
       (let* ((t_0 (sqrt (- (* b b) (* 4.0 (* a c))))))
         (if (or (<= b -3.6e+109) (not (<= b 8e+108)))
           (if (>= b 0.0) (/ (- b) a) (- (/ c b)))
           (if (>= b 0.0) (/ (- (- b) t_0) (* a 2.0)) (/ 2.0 (/ (- t_0 b) c))))))
      double code(double a, double b, double c) {
      	double t_0 = sqrt(((b * b) - (4.0 * (a * c))));
      	double tmp_1;
      	if ((b <= -3.6e+109) || !(b <= 8e+108)) {
      		double tmp_2;
      		if (b >= 0.0) {
      			tmp_2 = -b / a;
      		} else {
      			tmp_2 = -(c / b);
      		}
      		tmp_1 = tmp_2;
      	} else if (b >= 0.0) {
      		tmp_1 = (-b - t_0) / (a * 2.0);
      	} else {
      		tmp_1 = 2.0 / ((t_0 - b) / c);
      	}
      	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 = sqrt(((b * b) - (4.0d0 * (a * c))))
          if ((b <= (-3.6d+109)) .or. (.not. (b <= 8d+108))) then
              if (b >= 0.0d0) then
                  tmp_2 = -b / a
              else
                  tmp_2 = -(c / b)
              end if
              tmp_1 = tmp_2
          else if (b >= 0.0d0) then
              tmp_1 = (-b - t_0) / (a * 2.0d0)
          else
              tmp_1 = 2.0d0 / ((t_0 - b) / c)
          end if
          code = tmp_1
      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_1;
      	if ((b <= -3.6e+109) || !(b <= 8e+108)) {
      		double tmp_2;
      		if (b >= 0.0) {
      			tmp_2 = -b / a;
      		} else {
      			tmp_2 = -(c / b);
      		}
      		tmp_1 = tmp_2;
      	} else if (b >= 0.0) {
      		tmp_1 = (-b - t_0) / (a * 2.0);
      	} else {
      		tmp_1 = 2.0 / ((t_0 - b) / c);
      	}
      	return tmp_1;
      }
      
      def code(a, b, c):
      	t_0 = math.sqrt(((b * b) - (4.0 * (a * c))))
      	tmp_1 = 0
      	if (b <= -3.6e+109) or not (b <= 8e+108):
      		tmp_2 = 0
      		if b >= 0.0:
      			tmp_2 = -b / a
      		else:
      			tmp_2 = -(c / b)
      		tmp_1 = tmp_2
      	elif b >= 0.0:
      		tmp_1 = (-b - t_0) / (a * 2.0)
      	else:
      		tmp_1 = 2.0 / ((t_0 - b) / c)
      	return tmp_1
      
      function code(a, b, c)
      	t_0 = sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(a * c))))
      	tmp_1 = 0.0
      	if ((b <= -3.6e+109) || !(b <= 8e+108))
      		tmp_2 = 0.0
      		if (b >= 0.0)
      			tmp_2 = Float64(Float64(-b) / a);
      		else
      			tmp_2 = Float64(-Float64(c / b));
      		end
      		tmp_1 = tmp_2;
      	elseif (b >= 0.0)
      		tmp_1 = Float64(Float64(Float64(-b) - t_0) / Float64(a * 2.0));
      	else
      		tmp_1 = Float64(2.0 / Float64(Float64(t_0 - b) / c));
      	end
      	return tmp_1
      end
      
      function tmp_4 = code(a, b, c)
      	t_0 = sqrt(((b * b) - (4.0 * (a * c))));
      	tmp_2 = 0.0;
      	if ((b <= -3.6e+109) || ~((b <= 8e+108)))
      		tmp_3 = 0.0;
      		if (b >= 0.0)
      			tmp_3 = -b / a;
      		else
      			tmp_3 = -(c / b);
      		end
      		tmp_2 = tmp_3;
      	elseif (b >= 0.0)
      		tmp_2 = (-b - t_0) / (a * 2.0);
      	else
      		tmp_2 = 2.0 / ((t_0 - b) / c);
      	end
      	tmp_4 = tmp_2;
      end
      
      code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[b, -3.6e+109], N[Not[LessEqual[b, 8e+108]], $MachinePrecision]], If[GreaterEqual[b, 0.0], N[((-b) / a), $MachinePrecision], (-N[(c / b), $MachinePrecision])], If[GreaterEqual[b, 0.0], N[(N[((-b) - t$95$0), $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision], N[(2.0 / N[(N[(t$95$0 - b), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\\
      \mathbf{if}\;b \leq -3.6 \cdot 10^{+109} \lor \neg \left(b \leq 8 \cdot 10^{+108}\right):\\
      \;\;\;\;\begin{array}{l}
      \mathbf{if}\;b \geq 0:\\
      \;\;\;\;\frac{-b}{a}\\
      
      \mathbf{else}:\\
      \;\;\;\;-\frac{c}{b}\\
      
      
      \end{array}\\
      
      \mathbf{elif}\;b \geq 0:\\
      \;\;\;\;\frac{\left(-b\right) - t_0}{a \cdot 2}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{2}{\frac{t_0 - b}{c}}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if b < -3.6e109 or 8.0000000000000003e108 < b

        1. Initial program 53.8%

          \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
        2. Step-by-step derivation
          1. Simplified53.7%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \]
          3. Step-by-step derivation
            1. associate-*r/74.0%

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

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

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

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-1 \cdot \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
          7. Step-by-step derivation
            1. associate-*r/96.6%

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{-1 \cdot b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
            2. neg-mul-196.6%

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\color{blue}{-b}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
          8. Simplified96.6%

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{-b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

          if -3.6e109 < b < 8.0000000000000003e108

          1. Initial program 86.1%

            \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
          2. Step-by-step derivation
            1. associate-*l*86.1%

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

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

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.6 \cdot 10^{+109} \lor \neg \left(b \leq 8 \cdot 10^{+108}\right):\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - b}{c}}\\ \end{array} \]

        Alternative 4: 86.0% accurate, 1.0× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := -\frac{c}{b}\\ \mathbf{if}\;b \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array}\\ \mathbf{elif}\;b \leq -4.2 \cdot 10^{-306}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(\frac{c}{b} - \frac{b}{a}\right) + a \cdot \frac{c}{\frac{{b}^{3}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}\\ \end{array}\\ \mathbf{elif}\;b \leq 1.62 \cdot 10^{-114}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{a \cdot \frac{c}{-0.25}}}{a}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-0.5 \cdot \left(b + \mathsf{fma}\left(-2, a \cdot \frac{c}{b}, b\right)\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{-2}{\mathsf{fma}\left(b, 2, \frac{\left(a \cdot c\right) \cdot -2}{b}\right)}\\ \end{array} \end{array} \]
        (FPCore (a b c)
         :precision binary64
         (let* ((t_0 (- (/ c b))))
           (if (<= b -1.32e+154)
             (if (>= b 0.0) (/ (- b) a) t_0)
             (if (<= b -4.2e-306)
               (if (>= b 0.0)
                 (+ (- (/ c b) (/ b a)) (* a (/ c (/ (pow b 3.0) c))))
                 (/ (* c 2.0) (- (sqrt (- (* b b) (* c (* a 4.0)))) b)))
               (if (<= b 1.62e-114)
                 (if (>= b 0.0) (* -0.5 (/ (+ b (sqrt (* a (/ c -0.25)))) a)) t_0)
                 (if (>= b 0.0)
                   (/ (* -0.5 (+ b (fma -2.0 (* a (/ c b)) b))) a)
                   (* c (/ -2.0 (fma b 2.0 (/ (* (* a c) -2.0) b))))))))))
        double code(double a, double b, double c) {
        	double t_0 = -(c / b);
        	double tmp_1;
        	if (b <= -1.32e+154) {
        		double tmp_2;
        		if (b >= 0.0) {
        			tmp_2 = -b / a;
        		} else {
        			tmp_2 = t_0;
        		}
        		tmp_1 = tmp_2;
        	} else if (b <= -4.2e-306) {
        		double tmp_3;
        		if (b >= 0.0) {
        			tmp_3 = ((c / b) - (b / a)) + (a * (c / (pow(b, 3.0) / c)));
        		} else {
        			tmp_3 = (c * 2.0) / (sqrt(((b * b) - (c * (a * 4.0)))) - b);
        		}
        		tmp_1 = tmp_3;
        	} else if (b <= 1.62e-114) {
        		double tmp_4;
        		if (b >= 0.0) {
        			tmp_4 = -0.5 * ((b + sqrt((a * (c / -0.25)))) / a);
        		} else {
        			tmp_4 = t_0;
        		}
        		tmp_1 = tmp_4;
        	} else if (b >= 0.0) {
        		tmp_1 = (-0.5 * (b + fma(-2.0, (a * (c / b)), b))) / a;
        	} else {
        		tmp_1 = c * (-2.0 / fma(b, 2.0, (((a * c) * -2.0) / b)));
        	}
        	return tmp_1;
        }
        
        function code(a, b, c)
        	t_0 = Float64(-Float64(c / b))
        	tmp_1 = 0.0
        	if (b <= -1.32e+154)
        		tmp_2 = 0.0
        		if (b >= 0.0)
        			tmp_2 = Float64(Float64(-b) / a);
        		else
        			tmp_2 = t_0;
        		end
        		tmp_1 = tmp_2;
        	elseif (b <= -4.2e-306)
        		tmp_3 = 0.0
        		if (b >= 0.0)
        			tmp_3 = Float64(Float64(Float64(c / b) - Float64(b / a)) + Float64(a * Float64(c / Float64((b ^ 3.0) / c))));
        		else
        			tmp_3 = Float64(Float64(c * 2.0) / Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) - b));
        		end
        		tmp_1 = tmp_3;
        	elseif (b <= 1.62e-114)
        		tmp_4 = 0.0
        		if (b >= 0.0)
        			tmp_4 = Float64(-0.5 * Float64(Float64(b + sqrt(Float64(a * Float64(c / -0.25)))) / a));
        		else
        			tmp_4 = t_0;
        		end
        		tmp_1 = tmp_4;
        	elseif (b >= 0.0)
        		tmp_1 = Float64(Float64(-0.5 * Float64(b + fma(-2.0, Float64(a * Float64(c / b)), b))) / a);
        	else
        		tmp_1 = Float64(c * Float64(-2.0 / fma(b, 2.0, Float64(Float64(Float64(a * c) * -2.0) / b))));
        	end
        	return tmp_1
        end
        
        code[a_, b_, c_] := Block[{t$95$0 = (-N[(c / b), $MachinePrecision])}, If[LessEqual[b, -1.32e+154], If[GreaterEqual[b, 0.0], N[((-b) / a), $MachinePrecision], t$95$0], If[LessEqual[b, -4.2e-306], If[GreaterEqual[b, 0.0], N[(N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(a * N[(c / N[(N[Power[b, 3.0], $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * 2.0), $MachinePrecision] / N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], If[LessEqual[b, 1.62e-114], If[GreaterEqual[b, 0.0], N[(-0.5 * N[(N[(b + N[Sqrt[N[(a * N[(c / -0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$0], If[GreaterEqual[b, 0.0], N[(N[(-0.5 * N[(b + N[(-2.0 * N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(c * N[(-2.0 / N[(b * 2.0 + N[(N[(N[(a * c), $MachinePrecision] * -2.0), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := -\frac{c}{b}\\
        \mathbf{if}\;b \leq -1.32 \cdot 10^{+154}:\\
        \;\;\;\;\begin{array}{l}
        \mathbf{if}\;b \geq 0:\\
        \;\;\;\;\frac{-b}{a}\\
        
        \mathbf{else}:\\
        \;\;\;\;t_0\\
        
        
        \end{array}\\
        
        \mathbf{elif}\;b \leq -4.2 \cdot 10^{-306}:\\
        \;\;\;\;\begin{array}{l}
        \mathbf{if}\;b \geq 0:\\
        \;\;\;\;\left(\frac{c}{b} - \frac{b}{a}\right) + a \cdot \frac{c}{\frac{{b}^{3}}{c}}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{c \cdot 2}{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}\\
        
        
        \end{array}\\
        
        \mathbf{elif}\;b \leq 1.62 \cdot 10^{-114}:\\
        \;\;\;\;\begin{array}{l}
        \mathbf{if}\;b \geq 0:\\
        \;\;\;\;-0.5 \cdot \frac{b + \sqrt{a \cdot \frac{c}{-0.25}}}{a}\\
        
        \mathbf{else}:\\
        \;\;\;\;t_0\\
        
        
        \end{array}\\
        
        \mathbf{elif}\;b \geq 0:\\
        \;\;\;\;\frac{-0.5 \cdot \left(b + \mathsf{fma}\left(-2, a \cdot \frac{c}{b}, b\right)\right)}{a}\\
        
        \mathbf{else}:\\
        \;\;\;\;c \cdot \frac{-2}{\mathsf{fma}\left(b, 2, \frac{\left(a \cdot c\right) \cdot -2}{b}\right)}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if b < -1.31999999999999998e154

          1. Initial program 40.5%

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \]
            3. Step-by-step derivation
              1. associate-*r/97.6%

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

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

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-1 \cdot \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
            7. Step-by-step derivation
              1. associate-*r/97.6%

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{-1 \cdot b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
              2. neg-mul-197.6%

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\color{blue}{-b}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
            8. Simplified97.6%

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{-b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

            if -1.31999999999999998e154 < b < -4.2000000000000002e-306

            1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            if -4.2000000000000002e-306 < b < 1.62e-114

            1. Initial program 67.2%

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \]
              3. Step-by-step derivation
                1. associate-*r/67.1%

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
              5. Step-by-step derivation
                1. pow1/267.1%

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \color{blue}{e^{\log \left(\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)\right) \cdot 0.5}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
              6. Applied egg-rr62.7%

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \color{blue}{e^{\log \left(\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)\right) \cdot 0.5}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
              7. Taylor expanded in a around -inf 31.7%

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\color{blue}{\left(\log \left(4 \cdot c\right) + -1 \cdot \log \left(\frac{-1}{a}\right)\right)} \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
              8. Step-by-step derivation
                1. mul-1-neg31.7%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\left(\log \left(4 \cdot c\right) + \color{blue}{\left(-\log \left(\frac{-1}{a}\right)\right)}\right) \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                2. unsub-neg31.7%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\color{blue}{\left(\log \left(4 \cdot c\right) - \log \left(\frac{-1}{a}\right)\right)} \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                3. *-commutative31.7%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\left(\log \color{blue}{\left(c \cdot 4\right)} - \log \left(\frac{-1}{a}\right)\right) \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
              9. Simplified31.7%

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\color{blue}{\left(\log \left(c \cdot 4\right) - \log \left(\frac{-1}{a}\right)\right)} \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
              10. Taylor expanded in a around 0 0.2%

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-0.5 \cdot \frac{b + \sqrt{a \cdot \frac{c}{-0.25}}}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

              if 1.62e-114 < b

              1. Initial program 71.1%

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5 \cdot \left(b + \mathsf{fma}\left(-2, \frac{c}{b} \cdot a, b\right)\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \color{blue}{\frac{-2}{-2 \cdot \frac{c \cdot a}{b} + 2 \cdot b}}\\ \end{array} \]
                8. Step-by-step derivation
                  1. +-commutative85.9%

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

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array}\\ \mathbf{elif}\;b \leq -4.2 \cdot 10^{-306}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\left(\frac{c}{b} - \frac{b}{a}\right) + a \cdot \frac{c}{\frac{{b}^{3}}{c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot 2}{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}\\ \end{array}\\ \mathbf{elif}\;b \leq 1.62 \cdot 10^{-114}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{a \cdot \frac{c}{-0.25}}}{a}\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-0.5 \cdot \left(b + \mathsf{fma}\left(-2, a \cdot \frac{c}{b}, b\right)\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{-2}{\mathsf{fma}\left(b, 2, \frac{\left(a \cdot c\right) \cdot -2}{b}\right)}\\ \end{array} \]

              Alternative 5: 74.6% accurate, 1.0× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.62 \cdot 10^{-114}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{a \cdot \frac{c}{-0.25}}}{a}\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-0.5 \cdot \left(b + \mathsf{fma}\left(-2, a \cdot \frac{c}{b}, b\right)\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{-2}{\mathsf{fma}\left(b, 2, \frac{\left(a \cdot c\right) \cdot -2}{b}\right)}\\ \end{array} \end{array} \]
              (FPCore (a b c)
               :precision binary64
               (if (<= b 1.62e-114)
                 (if (>= b 0.0) (* -0.5 (/ (+ b (sqrt (* a (/ c -0.25)))) a)) (- (/ c b)))
                 (if (>= b 0.0)
                   (/ (* -0.5 (+ b (fma -2.0 (* a (/ c b)) b))) a)
                   (* c (/ -2.0 (fma b 2.0 (/ (* (* a c) -2.0) b)))))))
              double code(double a, double b, double c) {
              	double tmp_1;
              	if (b <= 1.62e-114) {
              		double tmp_2;
              		if (b >= 0.0) {
              			tmp_2 = -0.5 * ((b + sqrt((a * (c / -0.25)))) / a);
              		} else {
              			tmp_2 = -(c / b);
              		}
              		tmp_1 = tmp_2;
              	} else if (b >= 0.0) {
              		tmp_1 = (-0.5 * (b + fma(-2.0, (a * (c / b)), b))) / a;
              	} else {
              		tmp_1 = c * (-2.0 / fma(b, 2.0, (((a * c) * -2.0) / b)));
              	}
              	return tmp_1;
              }
              
              function code(a, b, c)
              	tmp_1 = 0.0
              	if (b <= 1.62e-114)
              		tmp_2 = 0.0
              		if (b >= 0.0)
              			tmp_2 = Float64(-0.5 * Float64(Float64(b + sqrt(Float64(a * Float64(c / -0.25)))) / a));
              		else
              			tmp_2 = Float64(-Float64(c / b));
              		end
              		tmp_1 = tmp_2;
              	elseif (b >= 0.0)
              		tmp_1 = Float64(Float64(-0.5 * Float64(b + fma(-2.0, Float64(a * Float64(c / b)), b))) / a);
              	else
              		tmp_1 = Float64(c * Float64(-2.0 / fma(b, 2.0, Float64(Float64(Float64(a * c) * -2.0) / b))));
              	end
              	return tmp_1
              end
              
              code[a_, b_, c_] := If[LessEqual[b, 1.62e-114], If[GreaterEqual[b, 0.0], N[(-0.5 * N[(N[(b + N[Sqrt[N[(a * N[(c / -0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], (-N[(c / b), $MachinePrecision])], If[GreaterEqual[b, 0.0], N[(N[(-0.5 * N[(b + N[(-2.0 * N[(a * N[(c / b), $MachinePrecision]), $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(c * N[(-2.0 / N[(b * 2.0 + N[(N[(N[(a * c), $MachinePrecision] * -2.0), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;b \leq 1.62 \cdot 10^{-114}:\\
              \;\;\;\;\begin{array}{l}
              \mathbf{if}\;b \geq 0:\\
              \;\;\;\;-0.5 \cdot \frac{b + \sqrt{a \cdot \frac{c}{-0.25}}}{a}\\
              
              \mathbf{else}:\\
              \;\;\;\;-\frac{c}{b}\\
              
              
              \end{array}\\
              
              \mathbf{elif}\;b \geq 0:\\
              \;\;\;\;\frac{-0.5 \cdot \left(b + \mathsf{fma}\left(-2, a \cdot \frac{c}{b}, b\right)\right)}{a}\\
              
              \mathbf{else}:\\
              \;\;\;\;c \cdot \frac{-2}{\mathsf{fma}\left(b, 2, \frac{\left(a \cdot c\right) \cdot -2}{b}\right)}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if b < 1.62e-114

                1. Initial program 73.0%

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

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \]
                  3. Step-by-step derivation
                    1. associate-*r/65.1%

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

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                  5. Step-by-step derivation
                    1. pow1/265.1%

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \color{blue}{e^{\log \left(\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)\right) \cdot 0.5}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                  6. Applied egg-rr64.3%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \color{blue}{e^{\log \left(\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)\right) \cdot 0.5}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                  7. Taylor expanded in a around -inf 58.7%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\color{blue}{\left(\log \left(4 \cdot c\right) + -1 \cdot \log \left(\frac{-1}{a}\right)\right)} \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                  8. Step-by-step derivation
                    1. mul-1-neg58.7%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\left(\log \left(4 \cdot c\right) + \color{blue}{\left(-\log \left(\frac{-1}{a}\right)\right)}\right) \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                    2. unsub-neg58.7%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\color{blue}{\left(\log \left(4 \cdot c\right) - \log \left(\frac{-1}{a}\right)\right)} \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                    3. *-commutative58.7%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\left(\log \color{blue}{\left(c \cdot 4\right)} - \log \left(\frac{-1}{a}\right)\right) \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                  9. Simplified58.7%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\color{blue}{\left(\log \left(c \cdot 4\right) - \log \left(\frac{-1}{a}\right)\right)} \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                  10. Taylor expanded in a around 0 53.0%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-0.5 \cdot \frac{b + e^{0.5 \cdot \left(\log \left(4 \cdot c\right) - \left(-1 \cdot \log a + \log -1\right)\right)}}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                  11. Simplified64.0%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-0.5 \cdot \frac{b + \sqrt{a \cdot \frac{c}{-0.25}}}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

                  if 1.62e-114 < b

                  1. Initial program 71.1%

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5 \cdot \left(b + \mathsf{fma}\left(-2, \frac{c}{b} \cdot a, b\right)\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \color{blue}{\frac{-2}{-2 \cdot \frac{c \cdot a}{b} + 2 \cdot b}}\\ \end{array} \]
                    8. Step-by-step derivation
                      1. +-commutative85.9%

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

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

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

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

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

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

                  Alternative 6: 74.5% accurate, 1.0× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := -\frac{c}{b}\\ \mathbf{if}\;b \leq 1.62 \cdot 10^{-114}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{a \cdot \frac{c}{-0.25}}}{a}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \left(b + -2 \cdot \frac{c}{\frac{b}{a}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
                  (FPCore (a b c)
                   :precision binary64
                   (let* ((t_0 (- (/ c b))))
                     (if (<= b 1.62e-114)
                       (if (>= b 0.0) (* -0.5 (/ (+ b (sqrt (* a (/ c -0.25)))) a)) t_0)
                       (if (>= b 0.0) (* (/ -0.5 a) (+ b (+ b (* -2.0 (/ c (/ b a)))))) t_0))))
                  double code(double a, double b, double c) {
                  	double t_0 = -(c / b);
                  	double tmp_1;
                  	if (b <= 1.62e-114) {
                  		double tmp_2;
                  		if (b >= 0.0) {
                  			tmp_2 = -0.5 * ((b + sqrt((a * (c / -0.25)))) / a);
                  		} else {
                  			tmp_2 = t_0;
                  		}
                  		tmp_1 = tmp_2;
                  	} else if (b >= 0.0) {
                  		tmp_1 = (-0.5 / a) * (b + (b + (-2.0 * (c / (b / a)))));
                  	} 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 = -(c / b)
                      if (b <= 1.62d-114) then
                          if (b >= 0.0d0) then
                              tmp_2 = (-0.5d0) * ((b + sqrt((a * (c / (-0.25d0))))) / a)
                          else
                              tmp_2 = t_0
                          end if
                          tmp_1 = tmp_2
                      else if (b >= 0.0d0) then
                          tmp_1 = ((-0.5d0) / a) * (b + (b + ((-2.0d0) * (c / (b / a)))))
                      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 = -(c / b);
                  	double tmp_1;
                  	if (b <= 1.62e-114) {
                  		double tmp_2;
                  		if (b >= 0.0) {
                  			tmp_2 = -0.5 * ((b + Math.sqrt((a * (c / -0.25)))) / a);
                  		} else {
                  			tmp_2 = t_0;
                  		}
                  		tmp_1 = tmp_2;
                  	} else if (b >= 0.0) {
                  		tmp_1 = (-0.5 / a) * (b + (b + (-2.0 * (c / (b / a)))));
                  	} else {
                  		tmp_1 = t_0;
                  	}
                  	return tmp_1;
                  }
                  
                  def code(a, b, c):
                  	t_0 = -(c / b)
                  	tmp_1 = 0
                  	if b <= 1.62e-114:
                  		tmp_2 = 0
                  		if b >= 0.0:
                  			tmp_2 = -0.5 * ((b + math.sqrt((a * (c / -0.25)))) / a)
                  		else:
                  			tmp_2 = t_0
                  		tmp_1 = tmp_2
                  	elif b >= 0.0:
                  		tmp_1 = (-0.5 / a) * (b + (b + (-2.0 * (c / (b / a)))))
                  	else:
                  		tmp_1 = t_0
                  	return tmp_1
                  
                  function code(a, b, c)
                  	t_0 = Float64(-Float64(c / b))
                  	tmp_1 = 0.0
                  	if (b <= 1.62e-114)
                  		tmp_2 = 0.0
                  		if (b >= 0.0)
                  			tmp_2 = Float64(-0.5 * Float64(Float64(b + sqrt(Float64(a * Float64(c / -0.25)))) / a));
                  		else
                  			tmp_2 = t_0;
                  		end
                  		tmp_1 = tmp_2;
                  	elseif (b >= 0.0)
                  		tmp_1 = Float64(Float64(-0.5 / a) * Float64(b + Float64(b + Float64(-2.0 * Float64(c / Float64(b / a))))));
                  	else
                  		tmp_1 = t_0;
                  	end
                  	return tmp_1
                  end
                  
                  function tmp_4 = code(a, b, c)
                  	t_0 = -(c / b);
                  	tmp_2 = 0.0;
                  	if (b <= 1.62e-114)
                  		tmp_3 = 0.0;
                  		if (b >= 0.0)
                  			tmp_3 = -0.5 * ((b + sqrt((a * (c / -0.25)))) / a);
                  		else
                  			tmp_3 = t_0;
                  		end
                  		tmp_2 = tmp_3;
                  	elseif (b >= 0.0)
                  		tmp_2 = (-0.5 / a) * (b + (b + (-2.0 * (c / (b / a)))));
                  	else
                  		tmp_2 = t_0;
                  	end
                  	tmp_4 = tmp_2;
                  end
                  
                  code[a_, b_, c_] := Block[{t$95$0 = (-N[(c / b), $MachinePrecision])}, If[LessEqual[b, 1.62e-114], If[GreaterEqual[b, 0.0], N[(-0.5 * N[(N[(b + N[Sqrt[N[(a * N[(c / -0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$0], If[GreaterEqual[b, 0.0], N[(N[(-0.5 / a), $MachinePrecision] * N[(b + N[(b + N[(-2.0 * N[(c / N[(b / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := -\frac{c}{b}\\
                  \mathbf{if}\;b \leq 1.62 \cdot 10^{-114}:\\
                  \;\;\;\;\begin{array}{l}
                  \mathbf{if}\;b \geq 0:\\
                  \;\;\;\;-0.5 \cdot \frac{b + \sqrt{a \cdot \frac{c}{-0.25}}}{a}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t_0\\
                  
                  
                  \end{array}\\
                  
                  \mathbf{elif}\;b \geq 0:\\
                  \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \left(b + -2 \cdot \frac{c}{\frac{b}{a}}\right)\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t_0\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if b < 1.62e-114

                    1. Initial program 73.0%

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

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \]
                      3. Step-by-step derivation
                        1. associate-*r/65.1%

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

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                      5. Step-by-step derivation
                        1. pow1/265.1%

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \color{blue}{e^{\log \left(\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)\right) \cdot 0.5}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                      6. Applied egg-rr64.3%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \color{blue}{e^{\log \left(\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)\right) \cdot 0.5}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                      7. Taylor expanded in a around -inf 58.7%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\color{blue}{\left(\log \left(4 \cdot c\right) + -1 \cdot \log \left(\frac{-1}{a}\right)\right)} \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                      8. Step-by-step derivation
                        1. mul-1-neg58.7%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\left(\log \left(4 \cdot c\right) + \color{blue}{\left(-\log \left(\frac{-1}{a}\right)\right)}\right) \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                        2. unsub-neg58.7%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\color{blue}{\left(\log \left(4 \cdot c\right) - \log \left(\frac{-1}{a}\right)\right)} \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                        3. *-commutative58.7%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\left(\log \color{blue}{\left(c \cdot 4\right)} - \log \left(\frac{-1}{a}\right)\right) \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                      9. Simplified58.7%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\color{blue}{\left(\log \left(c \cdot 4\right) - \log \left(\frac{-1}{a}\right)\right)} \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                      10. Taylor expanded in a around 0 53.0%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-0.5 \cdot \frac{b + e^{0.5 \cdot \left(\log \left(4 \cdot c\right) - \left(-1 \cdot \log a + \log -1\right)\right)}}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                      11. Simplified64.0%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-0.5 \cdot \frac{b + \sqrt{a \cdot \frac{c}{-0.25}}}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

                      if 1.62e-114 < b

                      1. Initial program 71.1%

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

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \]
                        3. Step-by-step derivation
                          1. associate-*r/71.0%

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

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

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

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

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

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.62 \cdot 10^{-114}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{a \cdot \frac{c}{-0.25}}}{a}\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \left(b + -2 \cdot \frac{c}{\frac{b}{a}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array} \]

                      Alternative 7: 74.1% accurate, 1.0× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := -\frac{c}{b}\\ \mathbf{if}\;b \leq 2.25 \cdot 10^{-130}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-0.5 \cdot \frac{\sqrt{a \cdot \frac{c}{-0.25}}}{a}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \left(b + -2 \cdot \frac{c}{\frac{b}{a}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
                      (FPCore (a b c)
                       :precision binary64
                       (let* ((t_0 (- (/ c b))))
                         (if (<= b 2.25e-130)
                           (if (>= b 0.0) (* -0.5 (/ (sqrt (* a (/ c -0.25))) a)) t_0)
                           (if (>= b 0.0) (* (/ -0.5 a) (+ b (+ b (* -2.0 (/ c (/ b a)))))) t_0))))
                      double code(double a, double b, double c) {
                      	double t_0 = -(c / b);
                      	double tmp_1;
                      	if (b <= 2.25e-130) {
                      		double tmp_2;
                      		if (b >= 0.0) {
                      			tmp_2 = -0.5 * (sqrt((a * (c / -0.25))) / a);
                      		} else {
                      			tmp_2 = t_0;
                      		}
                      		tmp_1 = tmp_2;
                      	} else if (b >= 0.0) {
                      		tmp_1 = (-0.5 / a) * (b + (b + (-2.0 * (c / (b / a)))));
                      	} 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 = -(c / b)
                          if (b <= 2.25d-130) then
                              if (b >= 0.0d0) then
                                  tmp_2 = (-0.5d0) * (sqrt((a * (c / (-0.25d0)))) / a)
                              else
                                  tmp_2 = t_0
                              end if
                              tmp_1 = tmp_2
                          else if (b >= 0.0d0) then
                              tmp_1 = ((-0.5d0) / a) * (b + (b + ((-2.0d0) * (c / (b / a)))))
                          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 = -(c / b);
                      	double tmp_1;
                      	if (b <= 2.25e-130) {
                      		double tmp_2;
                      		if (b >= 0.0) {
                      			tmp_2 = -0.5 * (Math.sqrt((a * (c / -0.25))) / a);
                      		} else {
                      			tmp_2 = t_0;
                      		}
                      		tmp_1 = tmp_2;
                      	} else if (b >= 0.0) {
                      		tmp_1 = (-0.5 / a) * (b + (b + (-2.0 * (c / (b / a)))));
                      	} else {
                      		tmp_1 = t_0;
                      	}
                      	return tmp_1;
                      }
                      
                      def code(a, b, c):
                      	t_0 = -(c / b)
                      	tmp_1 = 0
                      	if b <= 2.25e-130:
                      		tmp_2 = 0
                      		if b >= 0.0:
                      			tmp_2 = -0.5 * (math.sqrt((a * (c / -0.25))) / a)
                      		else:
                      			tmp_2 = t_0
                      		tmp_1 = tmp_2
                      	elif b >= 0.0:
                      		tmp_1 = (-0.5 / a) * (b + (b + (-2.0 * (c / (b / a)))))
                      	else:
                      		tmp_1 = t_0
                      	return tmp_1
                      
                      function code(a, b, c)
                      	t_0 = Float64(-Float64(c / b))
                      	tmp_1 = 0.0
                      	if (b <= 2.25e-130)
                      		tmp_2 = 0.0
                      		if (b >= 0.0)
                      			tmp_2 = Float64(-0.5 * Float64(sqrt(Float64(a * Float64(c / -0.25))) / a));
                      		else
                      			tmp_2 = t_0;
                      		end
                      		tmp_1 = tmp_2;
                      	elseif (b >= 0.0)
                      		tmp_1 = Float64(Float64(-0.5 / a) * Float64(b + Float64(b + Float64(-2.0 * Float64(c / Float64(b / a))))));
                      	else
                      		tmp_1 = t_0;
                      	end
                      	return tmp_1
                      end
                      
                      function tmp_4 = code(a, b, c)
                      	t_0 = -(c / b);
                      	tmp_2 = 0.0;
                      	if (b <= 2.25e-130)
                      		tmp_3 = 0.0;
                      		if (b >= 0.0)
                      			tmp_3 = -0.5 * (sqrt((a * (c / -0.25))) / a);
                      		else
                      			tmp_3 = t_0;
                      		end
                      		tmp_2 = tmp_3;
                      	elseif (b >= 0.0)
                      		tmp_2 = (-0.5 / a) * (b + (b + (-2.0 * (c / (b / a)))));
                      	else
                      		tmp_2 = t_0;
                      	end
                      	tmp_4 = tmp_2;
                      end
                      
                      code[a_, b_, c_] := Block[{t$95$0 = (-N[(c / b), $MachinePrecision])}, If[LessEqual[b, 2.25e-130], If[GreaterEqual[b, 0.0], N[(-0.5 * N[(N[Sqrt[N[(a * N[(c / -0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$0], If[GreaterEqual[b, 0.0], N[(N[(-0.5 / a), $MachinePrecision] * N[(b + N[(b + N[(-2.0 * N[(c / N[(b / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_0 := -\frac{c}{b}\\
                      \mathbf{if}\;b \leq 2.25 \cdot 10^{-130}:\\
                      \;\;\;\;\begin{array}{l}
                      \mathbf{if}\;b \geq 0:\\
                      \;\;\;\;-0.5 \cdot \frac{\sqrt{a \cdot \frac{c}{-0.25}}}{a}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t_0\\
                      
                      
                      \end{array}\\
                      
                      \mathbf{elif}\;b \geq 0:\\
                      \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \left(b + -2 \cdot \frac{c}{\frac{b}{a}}\right)\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t_0\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if b < 2.25e-130

                        1. Initial program 72.3%

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

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \]
                          3. Step-by-step derivation
                            1. associate-*r/64.1%

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

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                          5. Step-by-step derivation
                            1. pow1/264.1%

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

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \color{blue}{e^{\log \left(\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)\right) \cdot 0.5}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                          7. Taylor expanded in a around -inf 59.5%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\color{blue}{\left(\log \left(4 \cdot c\right) + -1 \cdot \log \left(\frac{-1}{a}\right)\right)} \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                          8. Step-by-step derivation
                            1. mul-1-neg59.5%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\left(\log \left(4 \cdot c\right) + \color{blue}{\left(-\log \left(\frac{-1}{a}\right)\right)}\right) \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                            2. unsub-neg59.5%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\color{blue}{\left(\log \left(4 \cdot c\right) - \log \left(\frac{-1}{a}\right)\right)} \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                            3. *-commutative59.5%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\left(\log \color{blue}{\left(c \cdot 4\right)} - \log \left(\frac{-1}{a}\right)\right) \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                          9. Simplified59.5%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + e^{\color{blue}{\left(\log \left(c \cdot 4\right) - \log \left(\frac{-1}{a}\right)\right)} \cdot 0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                          10. Taylor expanded in b around 0 59.4%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-0.5 \cdot \frac{e^{0.5 \cdot \left(\log \left(4 \cdot c\right) - \log \left(\frac{-1}{a}\right)\right)}}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                          11. Step-by-step derivation
                            1. log-prod59.4%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-0.5 \cdot \frac{e^{0.5 \cdot \left(\color{blue}{\left(\log 4 + \log c\right)} - \log \left(\frac{-1}{a}\right)\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                            2. +-commutative59.4%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-0.5 \cdot \frac{e^{0.5 \cdot \left(\color{blue}{\left(\log c + \log 4\right)} - \log \left(\frac{-1}{a}\right)\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                            3. log-prod59.4%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-0.5 \cdot \frac{e^{0.5 \cdot \left(\color{blue}{\log \left(c \cdot 4\right)} - \log \left(\frac{-1}{a}\right)\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                            4. log-div63.1%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-0.5 \cdot \frac{e^{0.5 \cdot \color{blue}{\log \left(\frac{c \cdot 4}{\frac{-1}{a}}\right)}}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                            5. *-commutative63.1%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-0.5 \cdot \frac{e^{\color{blue}{\log \left(\frac{c \cdot 4}{\frac{-1}{a}}\right) \cdot 0.5}}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                            6. exp-to-pow63.7%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-0.5 \cdot \frac{\color{blue}{{\left(\frac{c \cdot 4}{\frac{-1}{a}}\right)}^{0.5}}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                            7. unpow1/263.7%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-0.5 \cdot \frac{\color{blue}{\sqrt{\frac{c \cdot 4}{\frac{-1}{a}}}}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                            8. associate-/r/63.7%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-0.5 \cdot \frac{\sqrt{\color{blue}{\frac{c \cdot 4}{-1} \cdot a}}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                            9. *-commutative63.7%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-0.5 \cdot \frac{\sqrt{\color{blue}{a \cdot \frac{c \cdot 4}{-1}}}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                            10. associate-/l*63.7%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-0.5 \cdot \frac{\sqrt{a \cdot \color{blue}{\frac{c}{\frac{-1}{4}}}}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                            11. metadata-eval63.7%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-0.5 \cdot \frac{\sqrt{a \cdot \frac{c}{\color{blue}{-0.25}}}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                          12. Simplified63.7%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-0.5 \cdot \frac{\sqrt{a \cdot \frac{c}{-0.25}}}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

                          if 2.25e-130 < b

                          1. Initial program 72.2%

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

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

                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \]
                            3. Step-by-step derivation
                              1. associate-*r/72.0%

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

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

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

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

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

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2.25 \cdot 10^{-130}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;-0.5 \cdot \frac{\sqrt{a \cdot \frac{c}{-0.25}}}{a}\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \left(b + -2 \cdot \frac{c}{\frac{b}{a}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array} \]

                          Alternative 8: 68.2% accurate, 6.9× speedup?

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

                            \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
                          2. Step-by-step derivation
                            1. Simplified71.7%

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

                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \]
                            3. Step-by-step derivation
                              1. associate-*r/67.5%

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

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

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

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

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

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

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

                            Alternative 9: 68.3% accurate, 19.5× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array} \end{array} \]
                            (FPCore (a b c) :precision binary64 (if (>= b 0.0) (/ (- b) a) (- (/ c b))))
                            double code(double a, double b, double c) {
                            	double tmp;
                            	if (b >= 0.0) {
                            		tmp = -b / a;
                            	} else {
                            		tmp = -(c / b);
                            	}
                            	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 = -b / a
                                else
                                    tmp = -(c / b)
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double a, double b, double c) {
                            	double tmp;
                            	if (b >= 0.0) {
                            		tmp = -b / a;
                            	} else {
                            		tmp = -(c / b);
                            	}
                            	return tmp;
                            }
                            
                            def code(a, b, c):
                            	tmp = 0
                            	if b >= 0.0:
                            		tmp = -b / a
                            	else:
                            		tmp = -(c / b)
                            	return tmp
                            
                            function code(a, b, c)
                            	tmp = 0.0
                            	if (b >= 0.0)
                            		tmp = Float64(Float64(-b) / a);
                            	else
                            		tmp = Float64(-Float64(c / b));
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(a, b, c)
                            	tmp = 0.0;
                            	if (b >= 0.0)
                            		tmp = -b / a;
                            	else
                            		tmp = -(c / b);
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[a_, b_, c_] := If[GreaterEqual[b, 0.0], N[((-b) / a), $MachinePrecision], (-N[(c / b), $MachinePrecision])]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;b \geq 0:\\
                            \;\;\;\;\frac{-b}{a}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;-\frac{c}{b}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Initial program 72.2%

                              \[\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{2 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
                            2. Step-by-step derivation
                              1. Simplified71.7%

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

                                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-0.5}{a} \cdot \left(b + \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -4\right)\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-1 \cdot \frac{c}{b}\\ \end{array} \]
                              3. Step-by-step derivation
                                1. associate-*r/67.5%

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

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

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

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

                                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-1 \cdot \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                              7. Step-by-step derivation
                                1. associate-*r/68.6%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{-1 \cdot b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                                2. neg-mul-168.6%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\color{blue}{-b}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                              8. Simplified68.6%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{-b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
                              9. Final simplification68.6%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;-\frac{c}{b}\\ \end{array} \]

                              Reproduce

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