jeff quadratic root 2

Percentage Accurate: 72.2% → 90.6%
Time: 18.7s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

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


\end{array}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 72.2% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}

Alternative 1: 90.6% accurate, 0.5× speedup?

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

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

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


\end{array}\\

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

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


\end{array}\\

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

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


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

    1. Initial program 55.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.20000000000000003e80 < b < 4.0000000000000002e92

    1. Initial program 83.5%

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

    if 4.0000000000000002e92 < b

    1. Initial program 56.6%

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

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

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

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

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

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

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

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

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

Alternative 2: 90.5% accurate, 0.9× speedup?

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

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

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


\end{array}\\

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

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


\end{array}\\

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

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


\end{array}\\

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

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


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

    1. Initial program 55.2%

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot b}{a \cdot -2}\\ \end{array} \]
    8. Step-by-step derivation
      1. *-commutative89.9%

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

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

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

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

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

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

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

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

    if -2.2999999999999999e81 < b < 8.60000000000000047e-281

    1. Initial program 81.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.60000000000000047e-281 < b < 4.39999999999999984e92

    1. Initial program 85.3%

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

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

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

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

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

    if 4.39999999999999984e92 < b

    1. Initial program 56.6%

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

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

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

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

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

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

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

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

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

Alternative 3: 80.6% accurate, 0.9× speedup?

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

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

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


\end{array}\\

\mathbf{elif}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;t\_0\\

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


\end{array}\\

\mathbf{elif}\;b \leq 2.4 \cdot 10^{-41}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{-1}{\frac{b + t\_1}{c \cdot 2}}\\

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


\end{array}\\

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

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


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

    1. Initial program 69.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.05e-82 < b < -4.999999999999985e-310

    1. Initial program 72.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < b < 2.40000000000000022e-41

    1. Initial program 75.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.40000000000000022e-41 < b

    1. Initial program 70.2%

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

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

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

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

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

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

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

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

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

Alternative 4: 90.5% accurate, 0.9× speedup?

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

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

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


\end{array}\\

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

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


\end{array}\\

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

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


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

    1. Initial program 55.2%

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot b}{a \cdot -2}\\ \end{array} \]
    8. Step-by-step derivation
      1. *-commutative89.9%

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

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

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

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

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

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

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

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

    if -2.5e79 < b < 3.49999999999999986e92

    1. Initial program 83.5%

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

    if 3.49999999999999986e92 < b

    1. Initial program 56.6%

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

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

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

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

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

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

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

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

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

Alternative 5: 85.6% accurate, 0.9× speedup?

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

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

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


\end{array}\\

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

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


\end{array}\\

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

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


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

    1. Initial program 55.2%

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot b}{a \cdot -2}\\ \end{array} \]
    8. Step-by-step derivation
      1. *-commutative89.9%

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

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

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

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

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

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

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

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

    if -2.2999999999999999e81 < b < 4.20000000000000025e-41

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.20000000000000025e-41 < b

    1. Initial program 70.2%

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

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

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

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

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

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

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

Alternative 6: 85.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.3 \cdot 10^{+81}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{-c}{b}\\

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


\end{array}\\

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

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


\end{array}\\

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

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


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

    1. Initial program 55.2%

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot b}{a \cdot -2}\\ \end{array} \]
    8. Step-by-step derivation
      1. *-commutative89.9%

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

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

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

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

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

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

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

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

    if -2.2999999999999999e81 < b < 3.5e-41

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.5e-41 < b

    1. Initial program 70.2%

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

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

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

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

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

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

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

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

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

Alternative 7: 85.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.3 \cdot 10^{+81}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{-c}{b}\\

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


\end{array}\\

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

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


\end{array}\\

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

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


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

    1. Initial program 55.2%

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot b}{a \cdot -2}\\ \end{array} \]
    8. Step-by-step derivation
      1. *-commutative89.9%

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

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

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

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

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

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

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

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

    if -2.2999999999999999e81 < b < 2.4999999999999998e-41

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.4999999999999998e-41 < b

    1. Initial program 70.2%

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

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

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

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

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

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

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

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

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

Alternative 8: 85.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2 \cdot 10^{+79}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{-c}{b}\\

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


\end{array}\\

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

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


\end{array}\\

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

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


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

    1. Initial program 55.2%

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot b}{a \cdot -2}\\ \end{array} \]
    8. Step-by-step derivation
      1. *-commutative89.9%

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

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

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

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

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

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

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

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

    if -1.99999999999999993e79 < b < 3.30000000000000024e-41

    1. Initial program 79.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.30000000000000024e-41 < b

    1. Initial program 70.2%

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

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

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

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

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

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

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

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

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

Alternative 9: 73.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{-c}{b}\\
\mathbf{if}\;b \leq -4.2 \cdot 10^{-86}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;t\_0\\

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


\end{array}\\

\mathbf{elif}\;b \geq 0:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 69.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.2e-86 < b

    1. Initial program 72.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 67.2% accurate, 13.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Initial program 71.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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