jeff quadratic root 2

Percentage Accurate: 72.1% → 90.1%
Time: 17.7s
Alternatives: 12
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 12 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.1% 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.1% accurate, 0.8× speedup?

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

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

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

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


\end{array}\\

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

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


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

    1. Initial program 45.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. associate-*r/N/A

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

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

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(b\right)}{a}} \]
      5. neg-lowering-neg.f6498.1

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    11. Simplified98.1%

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

    if -1.8000000000000001e138 < b < 2.3e72

    1. Initial program 87.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. Step-by-step derivation
      1. neg-mul-1N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
      14. *-lowering-*.f6487.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{\mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}\right)}{2 \cdot a}\\ \end{array} \]
    4. Applied egg-rr87.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{\mathsf{fma}\left(b, -1, \sqrt{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}\right)}{2 \cdot a}\\ \end{array} \]

    if 2.3e72 < b

    1. Initial program 61.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 90.2% accurate, 0.8× speedup?

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

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

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

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


\end{array}\\

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

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


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

    1. Initial program 45.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. associate-*r/N/A

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

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

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(b\right)}{a}} \]
      5. neg-lowering-neg.f6498.1

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    11. Simplified98.1%

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

    if -1.00000000000000003e139 < b < 4.0000000000000002e76

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

    if 4.0000000000000002e76 < b

    1. Initial program 61.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 90.1% accurate, 0.9× speedup?

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

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

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

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


\end{array}\\

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

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


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

    1. Initial program 45.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. associate-*r/N/A

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

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

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(b\right)}{a}} \]
      5. neg-lowering-neg.f6498.1

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    11. Simplified98.1%

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

    if -1.00000000000000003e139 < b < 3e74

    1. Initial program 87.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. Applied egg-rr87.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3e74 < b

    1. Initial program 61.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 73.9% accurate, 1.0× speedup?

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

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

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


\end{array}\\

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

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


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

    1. Initial program 73.1%

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

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

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

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

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

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

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

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

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

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

    if 1.6e-99 < b

    1. Initial program 74.7%

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
      2. neg-lowering-neg.f6474.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{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    5. Simplified74.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{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    6. Step-by-step derivation
      1. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}\\ \end{array} \]
    7. Applied egg-rr74.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{-1}{a \cdot \left(b + b\right)}\\ \end{array} \]
    8. Taylor expanded in c around 0

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

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

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

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

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

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

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

Alternative 5: 73.9% accurate, 1.0× speedup?

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

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

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


\end{array}\\

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

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


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

    1. Initial program 73.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.6e-99 < b

    1. Initial program 74.7%

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \end{array} \]
      2. neg-lowering-neg.f6474.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{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    5. Simplified74.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{\left(-b\right) + \left(-b\right)}{2 \cdot a}\\ \end{array} \]
    6. Step-by-step derivation
      1. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}}\\ \end{array} \]
    7. Applied egg-rr74.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{-1}{a \cdot \left(b + b\right)}\\ \end{array} \]
    8. Taylor expanded in c around 0

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

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

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

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

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

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

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

Alternative 6: 67.0% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.2 \cdot 10^{-274}:\\
\;\;\;\;\frac{-b}{a}\\

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

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


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

    1. Initial program 70.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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. associate-*r/N/A

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

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    11. Simplified71.5%

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

    if -8.19999999999999975e-274 < b

    1. Initial program 76.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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{-1}{a \cdot \left(b + b\right)}\\ \end{array} \]
    8. Taylor expanded in c around 0

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

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

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

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

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

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

Alternative 7: 40.5% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 2.3 \cdot 10^{-182}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{b}{a} - \frac{b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 2.3e-182) (/ (- b) a) (- (/ b a) (/ b a))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 2.3e-182) {
		tmp = -b / a;
	} else {
		tmp = (b / a) - (b / a);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= 2.3d-182) then
        tmp = -b / a
    else
        tmp = (b / a) - (b / a)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= 2.3e-182) {
		tmp = -b / a;
	} else {
		tmp = (b / a) - (b / a);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 2.3e-182:
		tmp = -b / a
	else:
		tmp = (b / a) - (b / a)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 2.3e-182)
		tmp = Float64(Float64(-b) / a);
	else
		tmp = Float64(Float64(b / a) - Float64(b / a));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= 2.3e-182)
		tmp = -b / a;
	else
		tmp = (b / a) - (b / a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 2.3e-182], N[((-b) / a), $MachinePrecision], N[(N[(b / a), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.3 \cdot 10^{-182}:\\
\;\;\;\;\frac{-b}{a}\\

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


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

    1. Initial program 70.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. associate-*r/N/A

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

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

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

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

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

    if 2.2999999999999999e-182 < b

    1. Initial program 78.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. associate-*r/N/A

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

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    11. Simplified2.5%

      \[\leadsto \color{blue}{\frac{-b}{a}} \]
    12. Applied egg-rr19.3%

      \[\leadsto \color{blue}{\frac{b}{a} - \frac{b}{a}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 8: 67.0% accurate, 2.0× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

    Alternative 9: 38.7% accurate, 2.2× speedup?

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

      1. Initial program 69.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
        2. associate-*r/N/A

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

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

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(b\right)}{a}} \]
        5. neg-lowering-neg.f6468.4

          \[\leadsto \frac{\color{blue}{-b}}{a} \]
      11. Simplified68.4%

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

      if -5.00000000000023e-311 < b

      1. Initial program 77.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
        2. associate-*r/N/A

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

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

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

          \[\leadsto \frac{\color{blue}{-b}}{a} \]
      11. Simplified2.7%

        \[\leadsto \color{blue}{\frac{-b}{a}} \]
      12. Applied egg-rr10.0%

        \[\leadsto \color{blue}{\frac{1}{a \cdot \left(b + b\right)}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 10: 38.3% accurate, 2.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 0.7:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{a \cdot \left(b + b\right)}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= b 0.7) (/ (- b) a) (/ -1.0 (* a (+ b b)))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (b <= 0.7) {
    		tmp = -b / a;
    	} else {
    		tmp = -1.0 / (a * (b + b));
    	}
    	return tmp;
    }
    
    real(8) function code(a, b, c)
        real(8), intent (in) :: a
        real(8), intent (in) :: b
        real(8), intent (in) :: c
        real(8) :: tmp
        if (b <= 0.7d0) then
            tmp = -b / a
        else
            tmp = (-1.0d0) / (a * (b + b))
        end if
        code = tmp
    end function
    
    public static double code(double a, double b, double c) {
    	double tmp;
    	if (b <= 0.7) {
    		tmp = -b / a;
    	} else {
    		tmp = -1.0 / (a * (b + b));
    	}
    	return tmp;
    }
    
    def code(a, b, c):
    	tmp = 0
    	if b <= 0.7:
    		tmp = -b / a
    	else:
    		tmp = -1.0 / (a * (b + b))
    	return tmp
    
    function code(a, b, c)
    	tmp = 0.0
    	if (b <= 0.7)
    		tmp = Float64(Float64(-b) / a);
    	else
    		tmp = Float64(-1.0 / Float64(a * Float64(b + b)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b, c)
    	tmp = 0.0;
    	if (b <= 0.7)
    		tmp = -b / a;
    	else
    		tmp = -1.0 / (a * (b + b));
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, b_, c_] := If[LessEqual[b, 0.7], N[((-b) / a), $MachinePrecision], N[(-1.0 / N[(a * N[(b + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq 0.7:\\
    \;\;\;\;\frac{-b}{a}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{-1}{a \cdot \left(b + b\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b < 0.69999999999999996

      1. Initial program 74.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
        2. associate-*r/N/A

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

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

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

          \[\leadsto \frac{\color{blue}{-b}}{a} \]
      11. Simplified50.5%

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

      if 0.69999999999999996 < b

      1. Initial program 71.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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
        2. associate-*r/N/A

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

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

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

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

        \[\leadsto \color{blue}{\frac{-b}{a}} \]
      12. Applied egg-rr13.2%

        \[\leadsto \color{blue}{\frac{-1}{a \cdot \left(b + b\right)}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 11: 35.4% accurate, 4.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. associate-*r/N/A

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

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

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(b\right)}{a}} \]
      5. neg-lowering-neg.f6436.6

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    11. Simplified36.6%

      \[\leadsto \color{blue}{\frac{-b}{a}} \]
    12. Add Preprocessing

    Alternative 12: 2.6% accurate, 4.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
      2. associate-*r/N/A

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

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

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(b\right)}{a}} \]
      5. neg-lowering-neg.f6436.6

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    11. Simplified36.6%

      \[\leadsto \color{blue}{\frac{-b}{a}} \]
    12. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{\mathsf{neg}\left(b\right)}}} \]
      2. metadata-evalN/A

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

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

        \[\leadsto \color{blue}{1} \cdot \frac{1}{\frac{a}{\mathsf{neg}\left(b\right)}} \]
      5. metadata-evalN/A

        \[\leadsto \color{blue}{\frac{2}{2}} \cdot \frac{1}{\frac{a}{\mathsf{neg}\left(b\right)}} \]
      6. clear-numN/A

        \[\leadsto \frac{2}{2} \cdot \color{blue}{\frac{\mathsf{neg}\left(b\right)}{a}} \]
      7. times-fracN/A

        \[\leadsto \color{blue}{\frac{2 \cdot \left(\mathsf{neg}\left(b\right)\right)}{2 \cdot a}} \]
      8. count-2N/A

        \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) + \left(\mathsf{neg}\left(b\right)\right)}}{2 \cdot a} \]
      9. flip-+N/A

        \[\leadsto \frac{\color{blue}{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right)}}}{2 \cdot a} \]
      10. +-inversesN/A

        \[\leadsto \frac{\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\color{blue}{0}}}{2 \cdot a} \]
      11. metadata-evalN/A

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

        \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{0}\right)}}{2 \cdot a} \]
      13. +-inversesN/A

        \[\leadsto \frac{\mathsf{neg}\left(\frac{\left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right) \cdot \left(\mathsf{neg}\left(b\right)\right)}{\color{blue}{\left(\mathsf{neg}\left(b\right)\right) - \left(\mathsf{neg}\left(b\right)\right)}}\right)}{2 \cdot a} \]
      14. flip-+N/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(b\right)\right) + \left(\mathsf{neg}\left(b\right)\right)\right)}\right)}{2 \cdot a} \]
      15. distribute-neg-outN/A

        \[\leadsto \frac{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left(b + b\right)\right)\right)}\right)}{2 \cdot a} \]
      16. remove-double-negN/A

        \[\leadsto \frac{\color{blue}{b + b}}{2 \cdot a} \]
      17. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{b + b}{2}}{a}} \]
    13. Applied egg-rr2.5%

      \[\leadsto \color{blue}{\frac{b}{a}} \]
    14. Add Preprocessing

    Reproduce

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