jeff quadratic root 1

Percentage Accurate: 72.4% → 90.6%
Time: 18.9s
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.4% 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.6% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}\\

\mathbf{elif}\;b \leq 1.1 \cdot 10^{+91}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{\left(-b\right) - t_0}{a \cdot 2}\\

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


\end{array}\\

\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 44.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. Simplified44.1%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around -inf 99.7%

      \[\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) + -1 \cdot b}{c}}\\ \end{array} \]
    5. Taylor expanded in b around inf 99.7%

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    9. Taylor expanded in b around 0 100.0%

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

    if -5.00000000000000024e148 < b < 1.1e91

    1. Initial program 89.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. Add Preprocessing

    if 1.1e91 < b

    1. Initial program 49.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. Simplified49.1%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around -inf 49.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)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(-b\right) + -1 \cdot b}{c}}\\ \end{array} \]
    5. Taylor expanded in b around inf 91.6%

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    8. Simplified91.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    9. Taylor expanded in b around 0 99.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    10. Step-by-step derivation
      1. +-commutative99.3%

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{c}{b} - \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification93.5%

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

Alternative 2: 90.3% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}\\

\mathbf{elif}\;b \leq 1.4 \cdot 10^{+91}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{\left(-b\right) - t_0}{a \cdot 2}\\

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


\end{array}\\

\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


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

    1. Initial program 53.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. Simplified53.2%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around -inf 99.7%

      \[\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) + -1 \cdot b}{c}}\\ \end{array} \]
    5. Taylor expanded in b around inf 99.7%

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    9. Taylor expanded in b around 0 100.0%

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

    if -1.8000000000000001e102 < b < 1.3999999999999999e91

    1. Initial program 88.7%

      \[\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. Simplified88.6%

      \[\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. Add Preprocessing

    if 1.3999999999999999e91 < b

    1. Initial program 49.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. Simplified49.1%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around -inf 49.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)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(-b\right) + -1 \cdot b}{c}}\\ \end{array} \]
    5. Taylor expanded in b around inf 91.6%

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    8. Simplified91.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    9. Taylor expanded in b around 0 99.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    10. Step-by-step derivation
      1. +-commutative99.3%

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{c}{b} - \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification93.5%

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

Alternative 3: 85.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := \left(-b\right) - b\\
t_1 := \frac{-c}{b}\\
\mathbf{if}\;b \leq -8.5 \cdot 10^{+105}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{c}{b}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}\\

\mathbf{elif}\;b \leq 1.35 \cdot 10^{-292}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{t_0}{a \cdot 2}\\

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


\end{array}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{t_0}{c}}\\


\end{array}\\

\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -8.49999999999999986e105

    1. Initial program 53.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. Simplified53.2%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around -inf 99.7%

      \[\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) + -1 \cdot b}{c}}\\ \end{array} \]
    5. Taylor expanded in b around inf 99.7%

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    9. Taylor expanded in b around 0 100.0%

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

    if -8.49999999999999986e105 < b < 1.35e-292

    1. Initial program 87.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. Simplified87.2%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around inf 87.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \color{blue}{b}}{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} \]

    if 1.35e-292 < b < 3.9e-55

    1. Initial program 84.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. Simplified84.6%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around -inf 84.6%

      \[\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) + -1 \cdot b}{c}}\\ \end{array} \]
    5. Taylor expanded in b around 0 79.2%

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

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

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

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

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

    if 3.9e-55 < b

    1. Initial program 65.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. Simplified65.3%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around -inf 65.3%

      \[\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) + -1 \cdot b}{c}}\\ \end{array} \]
    5. Taylor expanded in b around inf 87.3%

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    8. Simplified87.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    9. Taylor expanded in b around 0 92.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    10. Step-by-step derivation
      1. +-commutative92.4%

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{c}{b} - \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification90.8%

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

Alternative 4: 80.0% accurate, 1.0× speedup?

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

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

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


\end{array}\\

\mathbf{elif}\;b \leq 1.35 \cdot 10^{-292}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{b}{a}, \frac{c}{b}\right)\\

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


\end{array}\\

\mathbf{elif}\;b \leq 1.7 \cdot 10^{-54}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{\left(-b\right) - t_0}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{t_1}{c}}\\


\end{array}\\

\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -2.99999999999999989e-56

    1. Initial program 69.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. Simplified69.3%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around inf 69.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \color{blue}{b}}{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} \]
    5. Taylor expanded in b around -inf 85.6%

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

    if -2.99999999999999989e-56 < b < 1.35e-292

    1. Initial program 85.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. Simplified85.1%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around inf 85.1%

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{b}{a}, \frac{c}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(-b\right) + \sqrt{c \cdot \left(a \cdot -4\right)}}{c}}\\ \end{array} \]
    10. Step-by-step derivation
      1. add-cbrt-cube58.9%

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{b}{a}, \frac{c}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(-b\right) + {\left({\left(c \cdot \left(a \cdot -4\right)\right)}^{1.5}\right)}^{0.3333333333333333}}{c}}\\ \end{array} \]
    11. Applied egg-rr55.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{b}{a}, \frac{c}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(-b\right) + {\left({\left(c \cdot \left(a \cdot -4\right)\right)}^{1.5}\right)}^{0.3333333333333333}}{c}}\\ \end{array} \]
    12. Step-by-step derivation
      1. frac-2neg55.6%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{b}{a}, \frac{c}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{-\left(\left(-b\right) + {\left({\left(c \cdot \left(a \cdot -4\right)\right)}^{1.5}\right)}^{0.3333333333333333}\right)} \cdot \left(-c\right)\\ \end{array} \]
    13. Applied egg-rr74.5%

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

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

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

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

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

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

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

    if 1.35e-292 < b < 1.69999999999999994e-54

    1. Initial program 84.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. Simplified84.6%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around -inf 84.6%

      \[\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) + -1 \cdot b}{c}}\\ \end{array} \]
    5. Taylor expanded in b around 0 79.2%

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

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

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

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

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

    if 1.69999999999999994e-54 < b

    1. Initial program 65.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. Simplified65.3%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around -inf 65.3%

      \[\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) + -1 \cdot b}{c}}\\ \end{array} \]
    5. Taylor expanded in b around inf 87.3%

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    8. Simplified87.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    9. Taylor expanded in b around 0 92.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    10. Step-by-step derivation
      1. +-commutative92.4%

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{c}{b} - \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification85.5%

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

Alternative 5: 79.6% accurate, 1.0× speedup?

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

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

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


\end{array}\\

\mathbf{elif}\;b \leq 1.35 \cdot 10^{-292}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{b}{a}, \frac{c}{b}\right)\\

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


\end{array}\\

\mathbf{elif}\;b \leq 1.7 \cdot 10^{-59}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{t_0}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{t_1}{c}}\\


\end{array}\\

\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -9.5000000000000005e-57

    1. Initial program 69.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. Simplified69.3%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around inf 69.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \color{blue}{b}}{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} \]
    5. Taylor expanded in b around -inf 85.6%

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

    if -9.5000000000000005e-57 < b < 1.35e-292

    1. Initial program 85.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. Simplified85.1%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around inf 85.1%

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{b}{a}, \frac{c}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(-b\right) + \sqrt{c \cdot \left(a \cdot -4\right)}}{c}}\\ \end{array} \]
    10. Step-by-step derivation
      1. add-cbrt-cube58.9%

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{b}{a}, \frac{c}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(-b\right) + {\left({\left(c \cdot \left(a \cdot -4\right)\right)}^{1.5}\right)}^{0.3333333333333333}}{c}}\\ \end{array} \]
    11. Applied egg-rr55.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{b}{a}, \frac{c}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(-b\right) + {\left({\left(c \cdot \left(a \cdot -4\right)\right)}^{1.5}\right)}^{0.3333333333333333}}{c}}\\ \end{array} \]
    12. Step-by-step derivation
      1. frac-2neg55.6%

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{b}{a}, \frac{c}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{-\frac{\left(-b\right) + {\left({\left(c \cdot \left(a \cdot -4\right)\right)}^{1.5}\right)}^{0.3333333333333333}}{c}}\\ \end{array} \]
      2. metadata-eval55.6%

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{b}{a}, \frac{c}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{-\frac{\left(-b\right) + {\left({\left(c \cdot \left(a \cdot -4\right)\right)}^{1.5}\right)}^{0.3333333333333333}}{c}}\\ \end{array} \]
      3. div-inv55.6%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{b}{a}, \frac{c}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{1}{-\frac{\left(-b\right) + {\left(c \cdot \left(a \cdot -4\right)\right)}^{\left(1.5 \cdot 0.3333333333333333\right)}}{c}}\\ \end{array} \]
      5. metadata-eval74.5%

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

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

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

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

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

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

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

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

    if 1.35e-292 < b < 1.70000000000000009e-59

    1. Initial program 84.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. Simplified84.6%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around -inf 84.6%

      \[\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) + -1 \cdot b}{c}}\\ \end{array} \]
    5. Taylor expanded in b around 0 79.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.70000000000000009e-59 < b

    1. Initial program 65.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. Simplified65.3%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around -inf 65.3%

      \[\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) + -1 \cdot b}{c}}\\ \end{array} \]
    5. Taylor expanded in b around inf 87.3%

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    8. Simplified87.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    9. Taylor expanded in b around 0 92.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    10. Step-by-step derivation
      1. +-commutative92.4%

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{c}{b} - \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification85.3%

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

Alternative 6: 79.5% accurate, 1.0× speedup?

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

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

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


\end{array}\\

\mathbf{elif}\;b \leq 1.35 \cdot 10^{-292}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{b}{a}, \frac{c}{b}\right)\\

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


\end{array}\\

\mathbf{elif}\;b \leq 7 \cdot 10^{-56}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{t_0}{a \cdot 2}\\

\mathbf{else}:\\
\;\;\;\;\frac{2}{\frac{t_1}{c}}\\


\end{array}\\

\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -5.50000000000000011e-57

    1. Initial program 69.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. Simplified69.3%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around inf 69.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{\left(-b\right) - \color{blue}{b}}{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} \]
    5. Taylor expanded in b around -inf 85.6%

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

    if -5.50000000000000011e-57 < b < 1.35e-292

    1. Initial program 85.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. Simplified85.1%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around inf 85.1%

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{b}{a}, \frac{c}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(-b\right) + \sqrt{c \cdot \left(a \cdot -4\right)}}{c}}\\ \end{array} \]
    10. Step-by-step derivation
      1. add-cbrt-cube58.9%

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{b}{a}, \frac{c}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(-b\right) + {\left({\left(c \cdot \left(a \cdot -4\right)\right)}^{1.5}\right)}^{0.3333333333333333}}{c}}\\ \end{array} \]
    11. Applied egg-rr55.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{b}{a}, \frac{c}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(-b\right) + {\left({\left(c \cdot \left(a \cdot -4\right)\right)}^{1.5}\right)}^{0.3333333333333333}}{c}}\\ \end{array} \]
    12. Step-by-step derivation
      1. frac-2neg55.6%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\mathsf{fma}\left(-1, \frac{b}{a}, \frac{c}{b}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{-\left(\left(-b\right) + {\left({\left(c \cdot \left(a \cdot -4\right)\right)}^{1.5}\right)}^{0.3333333333333333}\right)} \cdot \left(-c\right)\\ \end{array} \]
    13. Applied egg-rr74.5%

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

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

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

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

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

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

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

    if 1.35e-292 < b < 6.9999999999999996e-56

    1. Initial program 84.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. Simplified84.6%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around -inf 84.6%

      \[\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) + -1 \cdot b}{c}}\\ \end{array} \]
    5. Taylor expanded in b around 0 79.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.9999999999999996e-56 < b

    1. Initial program 65.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. Simplified65.3%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around -inf 65.3%

      \[\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) + -1 \cdot b}{c}}\\ \end{array} \]
    5. Taylor expanded in b around inf 87.3%

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    8. Simplified87.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    9. Taylor expanded in b around 0 92.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    10. Step-by-step derivation
      1. +-commutative92.4%

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{c}{b} - \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification85.3%

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

Alternative 7: 73.9% accurate, 1.0× speedup?

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

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

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


\end{array}\\

\mathbf{elif}\;b \geq 0:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

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


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

    1. Initial program 75.7%

      \[\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. Simplified75.6%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around -inf 70.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)}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{2}{\frac{\left(-b\right) + -1 \cdot b}{c}}\\ \end{array} \]
    5. Taylor expanded in b around 0 69.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.2e-54 < b

    1. Initial program 65.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. Simplified65.3%

      \[\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. Add Preprocessing
    4. Taylor expanded in b around -inf 65.3%

      \[\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) + -1 \cdot b}{c}}\\ \end{array} \]
    5. Taylor expanded in b around inf 87.3%

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    8. Simplified87.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    9. Taylor expanded in b around 0 92.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-1 \cdot \frac{b}{a} + \frac{c}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
    10. Step-by-step derivation
      1. +-commutative92.4%

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{\frac{c}{b} - \frac{b}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification76.8%

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

Alternative 8: 68.4% accurate, 13.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Initial program 72.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. Simplified72.1%

    \[\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. Add Preprocessing
  4. Taylor expanded in b around -inf 68.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) + -1 \cdot b}{c}}\\ \end{array} \]
  5. Taylor expanded in b around inf 68.0%

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
  8. Simplified68.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
  9. Taylor expanded in b around 0 70.0%

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

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

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

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

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

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

Alternative 9: 36.3% accurate, 19.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{c}{b}\\

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


\end{array}
\end{array}
Derivation
  1. Initial program 72.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. Simplified72.1%

    \[\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. Add Preprocessing
  4. Taylor expanded in b around -inf 68.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) + -1 \cdot b}{c}}\\ \end{array} \]
  5. Taylor expanded in b around inf 68.0%

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
  8. Simplified68.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot b + 2 \cdot \frac{a \cdot c}{b}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]
  9. Taylor expanded in b around 0 37.9%

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

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

Reproduce

?
herbie shell --seed 2024010 
(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)))))))