jeff quadratic root 1

Percentage Accurate: 71.7% → 89.5%
Time: 10.6s
Alternatives: 9
Speedup: 0.9×

Specification

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

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

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


\end{array}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 alternatives:

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

Initial Program: 71.7% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}

Alternative 1: 89.5% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)}\\
t_1 := \frac{c}{-b}\\
\mathbf{if}\;b \leq -1.22 \cdot 10^{+156}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;b \leq -1.2 \cdot 10^{-281}:\\
\;\;\;\;\frac{c + c}{t\_0 - b}\\

\mathbf{elif}\;b \leq 5 \cdot 10^{+121}:\\
\;\;\;\;\frac{t\_0 + b}{a} \cdot -0.5\\

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

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


\end{array}\\

\mathbf{elif}\;b \leq 1.45 \cdot 10^{+300}:\\
\;\;\;\;c \cdot \frac{-b}{c \cdot a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -1.21999999999999991e156 or 1.44999999999999993e300 < b

    1. Initial program 40.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
      5. associate-*r/N/A

        \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
      6. fp-cancel-sign-sub-invN/A

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

        \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
      8. *-lft-identityN/A

        \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
    6. Applied rewrites38.5%

      \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
    7. Taylor expanded in a around -inf

      \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
    8. Step-by-step derivation
      1. Applied rewrites0.0%

        \[\leadsto \left(-\sqrt{-1}\right) \cdot \color{blue}{\sqrt{\frac{c}{a}}} \]
      2. Taylor expanded in b around -inf

        \[\leadsto -1 \cdot \color{blue}{\frac{c}{b}} \]
      3. Step-by-step derivation
        1. Applied rewrites91.2%

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

        if -1.21999999999999991e156 < b < -1.2e-281

        1. Initial program 89.8%

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

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

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

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

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

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

            \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
          5. associate-*r/N/A

            \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
          6. fp-cancel-sign-sub-invN/A

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

            \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
          8. *-lft-identityN/A

            \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
        6. Applied rewrites89.8%

          \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
        7. Step-by-step derivation
          1. Applied rewrites89.8%

            \[\leadsto \frac{c + c}{\color{blue}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)}} - b} \]

          if -1.2e-281 < b < 5.00000000000000007e121

          1. Initial program 80.4%

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

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

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{b + \sqrt{{b}^{2} - 4 \cdot \left(a \cdot c\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{b + \sqrt{{b}^{2} + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot c\right)}}{a}\\ \end{array} \]
            3. fp-cancel-sub-sign-invN/A

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

              \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{b + \sqrt{{b}^{2} - 4 \cdot \left(a \cdot c\right)}}{a}} \]
            5. *-commutativeN/A

              \[\leadsto \color{blue}{\frac{b + \sqrt{{b}^{2} - 4 \cdot \left(a \cdot c\right)}}{a} \cdot \frac{-1}{2}} \]
          6. Applied rewrites80.4%

            \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} + b}{a} \cdot -0.5} \]

          if 5.00000000000000007e121 < b < 3.09999999999999984e279

          1. Initial program 44.5%

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

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

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

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

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

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

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

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

                  if 3.09999999999999984e279 < b < 1.44999999999999993e300

                  1. Initial program 44.2%

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

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

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

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

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

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

                      \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                    5. associate-*r/N/A

                      \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                    6. fp-cancel-sign-sub-invN/A

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

                      \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                    8. *-lft-identityN/A

                      \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                  6. Applied rewrites1.9%

                    \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                  7. Step-by-step derivation
                    1. Applied rewrites1.9%

                      \[\leadsto c \cdot \color{blue}{\frac{2}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}} \]
                    2. Taylor expanded in a around 0

                      \[\leadsto c \cdot \left(-1 \cdot \color{blue}{\frac{b}{a \cdot c}}\right) \]
                    3. Step-by-step derivation
                      1. Applied rewrites100.0%

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

                    Alternative 2: 80.3% accurate, 0.7× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c}{-b}\\ t_1 := c \cdot \frac{\mathsf{fma}\left(\frac{b}{a}, -1, \frac{c}{b}\right)}{c}\\ \mathbf{if}\;b \leq -1.22 \cdot 10^{+156}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 3.6 \cdot 10^{-235}:\\ \;\;\;\;\frac{c + c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}\\ \mathbf{elif}\;b \leq 7 \cdot 10^{-159}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{+148}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b + \sqrt{b \cdot b}}{2 \cdot \left(-a\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \left(-b\right)}\\ \end{array}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{+308}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                    (FPCore (a b c)
                     :precision binary64
                     (let* ((t_0 (/ c (- b))) (t_1 (* c (/ (fma (/ b a) -1.0 (/ c b)) c))))
                       (if (<= b -1.22e+156)
                         t_0
                         (if (<= b 3.6e-235)
                           (/ (+ c c) (- (sqrt (fma -4.0 (* c a) (* b b))) b))
                           (if (<= b 7e-159)
                             t_1
                             (if (<= b 1.8e+148)
                               (if (>= b 0.0)
                                 (/ (+ b (sqrt (* b b))) (* 2.0 (- a)))
                                 (/ (* 2.0 c) (+ (- b) (- b))))
                               (if (<= b 1.25e+308) t_1 t_0)))))))
                    double code(double a, double b, double c) {
                    	double t_0 = c / -b;
                    	double t_1 = c * (fma((b / a), -1.0, (c / b)) / c);
                    	double tmp;
                    	if (b <= -1.22e+156) {
                    		tmp = t_0;
                    	} else if (b <= 3.6e-235) {
                    		tmp = (c + c) / (sqrt(fma(-4.0, (c * a), (b * b))) - b);
                    	} else if (b <= 7e-159) {
                    		tmp = t_1;
                    	} else if (b <= 1.8e+148) {
                    		double tmp_1;
                    		if (b >= 0.0) {
                    			tmp_1 = (b + sqrt((b * b))) / (2.0 * -a);
                    		} else {
                    			tmp_1 = (2.0 * c) / (-b + -b);
                    		}
                    		tmp = tmp_1;
                    	} else if (b <= 1.25e+308) {
                    		tmp = t_1;
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    function code(a, b, c)
                    	t_0 = Float64(c / Float64(-b))
                    	t_1 = Float64(c * Float64(fma(Float64(b / a), -1.0, Float64(c / b)) / c))
                    	tmp = 0.0
                    	if (b <= -1.22e+156)
                    		tmp = t_0;
                    	elseif (b <= 3.6e-235)
                    		tmp = Float64(Float64(c + c) / Float64(sqrt(fma(-4.0, Float64(c * a), Float64(b * b))) - b));
                    	elseif (b <= 7e-159)
                    		tmp = t_1;
                    	elseif (b <= 1.8e+148)
                    		tmp_1 = 0.0
                    		if (b >= 0.0)
                    			tmp_1 = Float64(Float64(b + sqrt(Float64(b * b))) / Float64(2.0 * Float64(-a)));
                    		else
                    			tmp_1 = Float64(Float64(2.0 * c) / Float64(Float64(-b) + Float64(-b)));
                    		end
                    		tmp = tmp_1;
                    	elseif (b <= 1.25e+308)
                    		tmp = t_1;
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    code[a_, b_, c_] := Block[{t$95$0 = N[(c / (-b)), $MachinePrecision]}, Block[{t$95$1 = N[(c * N[(N[(N[(b / a), $MachinePrecision] * -1.0 + N[(c / b), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.22e+156], t$95$0, If[LessEqual[b, 3.6e-235], N[(N[(c + c), $MachinePrecision] / N[(N[Sqrt[N[(-4.0 * N[(c * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7e-159], t$95$1, If[LessEqual[b, 1.8e+148], If[GreaterEqual[b, 0.0], N[(N[(b + N[Sqrt[N[(b * b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * (-a)), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) + (-b)), $MachinePrecision]), $MachinePrecision]], If[LessEqual[b, 1.25e+308], t$95$1, t$95$0]]]]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := \frac{c}{-b}\\
                    t_1 := c \cdot \frac{\mathsf{fma}\left(\frac{b}{a}, -1, \frac{c}{b}\right)}{c}\\
                    \mathbf{if}\;b \leq -1.22 \cdot 10^{+156}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;b \leq 3.6 \cdot 10^{-235}:\\
                    \;\;\;\;\frac{c + c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}\\
                    
                    \mathbf{elif}\;b \leq 7 \cdot 10^{-159}:\\
                    \;\;\;\;t\_1\\
                    
                    \mathbf{elif}\;b \leq 1.8 \cdot 10^{+148}:\\
                    \;\;\;\;\begin{array}{l}
                    \mathbf{if}\;b \geq 0:\\
                    \;\;\;\;\frac{b + \sqrt{b \cdot b}}{2 \cdot \left(-a\right)}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \left(-b\right)}\\
                    
                    
                    \end{array}\\
                    
                    \mathbf{elif}\;b \leq 1.25 \cdot 10^{+308}:\\
                    \;\;\;\;t\_1\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 4 regimes
                    2. if b < -1.21999999999999991e156 or 1.25e308 < b

                      1. Initial program 41.7%

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

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

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

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

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

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

                          \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                        5. associate-*r/N/A

                          \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                        6. fp-cancel-sign-sub-invN/A

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

                          \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                        8. *-lft-identityN/A

                          \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                      6. Applied rewrites39.3%

                        \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                      7. Taylor expanded in a around -inf

                        \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
                      8. Step-by-step derivation
                        1. Applied rewrites0.0%

                          \[\leadsto \left(-\sqrt{-1}\right) \cdot \color{blue}{\sqrt{\frac{c}{a}}} \]
                        2. Taylor expanded in b around -inf

                          \[\leadsto -1 \cdot \color{blue}{\frac{c}{b}} \]
                        3. Step-by-step derivation
                          1. Applied rewrites93.4%

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

                          if -1.21999999999999991e156 < b < 3.59999999999999999e-235

                          1. Initial program 88.6%

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

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

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

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

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

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

                              \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                            5. associate-*r/N/A

                              \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                            6. fp-cancel-sign-sub-invN/A

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

                              \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                            8. *-lft-identityN/A

                              \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                          6. Applied rewrites88.7%

                            \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                          7. Step-by-step derivation
                            1. Applied rewrites88.7%

                              \[\leadsto \frac{c + c}{\color{blue}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)}} - b} \]

                            if 3.59999999999999999e-235 < b < 7.00000000000000005e-159 or 1.80000000000000003e148 < b < 1.25e308

                            1. Initial program 36.4%

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

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

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

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

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

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

                                \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                              5. associate-*r/N/A

                                \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                              6. fp-cancel-sign-sub-invN/A

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

                                \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                              8. *-lft-identityN/A

                                \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                            6. Applied rewrites13.2%

                              \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                            7. Step-by-step derivation
                              1. Applied rewrites13.2%

                                \[\leadsto c \cdot \color{blue}{\frac{2}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}} \]
                              2. Taylor expanded in c around 0

                                \[\leadsto c \cdot \frac{-1 \cdot \frac{b}{a} + \frac{c}{b}}{\color{blue}{c}} \]
                              3. Step-by-step derivation
                                1. Applied rewrites76.3%

                                  \[\leadsto c \cdot \frac{\mathsf{fma}\left(\frac{b}{a}, -1, \frac{c}{b}\right)}{\color{blue}{c}} \]

                                if 7.00000000000000005e-159 < b < 1.80000000000000003e148

                                1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

                                \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.22 \cdot 10^{+156}:\\ \;\;\;\;\frac{c}{-b}\\ \mathbf{elif}\;b \leq 3.6 \cdot 10^{-235}:\\ \;\;\;\;\frac{c + c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}\\ \mathbf{elif}\;b \leq 7 \cdot 10^{-159}:\\ \;\;\;\;c \cdot \frac{\mathsf{fma}\left(\frac{b}{a}, -1, \frac{c}{b}\right)}{c}\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{+148}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b + \sqrt{b \cdot b}}{2 \cdot \left(-a\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \left(-b\right)}\\ \end{array}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{+308}:\\ \;\;\;\;c \cdot \frac{\mathsf{fma}\left(\frac{b}{a}, -1, \frac{c}{b}\right)}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \]
                              6. Add Preprocessing

                              Alternative 3: 86.4% accurate, 0.8× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)}\\ \mathbf{if}\;b \leq -1.22 \cdot 10^{+156}:\\ \;\;\;\;\frac{c}{-b}\\ \mathbf{elif}\;b \leq 3.6 \cdot 10^{-235}:\\ \;\;\;\;\frac{c + c}{t\_0 - b}\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{-167} \lor \neg \left(b \leq 8.5 \cdot 10^{+149}\right):\\ \;\;\;\;c \cdot \frac{\mathsf{fma}\left(\frac{b}{a}, -1, \frac{c}{b}\right)}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_0 + b}{a} \cdot -0.5\\ \end{array} \end{array} \]
                              (FPCore (a b c)
                               :precision binary64
                               (let* ((t_0 (sqrt (fma -4.0 (* c a) (* b b)))))
                                 (if (<= b -1.22e+156)
                                   (/ c (- b))
                                   (if (<= b 3.6e-235)
                                     (/ (+ c c) (- t_0 b))
                                     (if (or (<= b 1.8e-167) (not (<= b 8.5e+149)))
                                       (* c (/ (fma (/ b a) -1.0 (/ c b)) c))
                                       (* (/ (+ t_0 b) a) -0.5))))))
                              double code(double a, double b, double c) {
                              	double t_0 = sqrt(fma(-4.0, (c * a), (b * b)));
                              	double tmp;
                              	if (b <= -1.22e+156) {
                              		tmp = c / -b;
                              	} else if (b <= 3.6e-235) {
                              		tmp = (c + c) / (t_0 - b);
                              	} else if ((b <= 1.8e-167) || !(b <= 8.5e+149)) {
                              		tmp = c * (fma((b / a), -1.0, (c / b)) / c);
                              	} else {
                              		tmp = ((t_0 + b) / a) * -0.5;
                              	}
                              	return tmp;
                              }
                              
                              function code(a, b, c)
                              	t_0 = sqrt(fma(-4.0, Float64(c * a), Float64(b * b)))
                              	tmp = 0.0
                              	if (b <= -1.22e+156)
                              		tmp = Float64(c / Float64(-b));
                              	elseif (b <= 3.6e-235)
                              		tmp = Float64(Float64(c + c) / Float64(t_0 - b));
                              	elseif ((b <= 1.8e-167) || !(b <= 8.5e+149))
                              		tmp = Float64(c * Float64(fma(Float64(b / a), -1.0, Float64(c / b)) / c));
                              	else
                              		tmp = Float64(Float64(Float64(t_0 + b) / a) * -0.5);
                              	end
                              	return tmp
                              end
                              
                              code[a_, b_, c_] := Block[{t$95$0 = N[Sqrt[N[(-4.0 * N[(c * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, -1.22e+156], N[(c / (-b)), $MachinePrecision], If[LessEqual[b, 3.6e-235], N[(N[(c + c), $MachinePrecision] / N[(t$95$0 - b), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[b, 1.8e-167], N[Not[LessEqual[b, 8.5e+149]], $MachinePrecision]], N[(c * N[(N[(N[(b / a), $MachinePrecision] * -1.0 + N[(c / b), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$0 + b), $MachinePrecision] / a), $MachinePrecision] * -0.5), $MachinePrecision]]]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              t_0 := \sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)}\\
                              \mathbf{if}\;b \leq -1.22 \cdot 10^{+156}:\\
                              \;\;\;\;\frac{c}{-b}\\
                              
                              \mathbf{elif}\;b \leq 3.6 \cdot 10^{-235}:\\
                              \;\;\;\;\frac{c + c}{t\_0 - b}\\
                              
                              \mathbf{elif}\;b \leq 1.8 \cdot 10^{-167} \lor \neg \left(b \leq 8.5 \cdot 10^{+149}\right):\\
                              \;\;\;\;c \cdot \frac{\mathsf{fma}\left(\frac{b}{a}, -1, \frac{c}{b}\right)}{c}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\frac{t\_0 + b}{a} \cdot -0.5\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 4 regimes
                              2. if b < -1.21999999999999991e156

                                1. Initial program 40.2%

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                  5. associate-*r/N/A

                                    \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                  6. fp-cancel-sign-sub-invN/A

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

                                    \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                                  8. *-lft-identityN/A

                                    \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                                6. Applied rewrites40.2%

                                  \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                                7. Taylor expanded in a around -inf

                                  \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
                                8. Step-by-step derivation
                                  1. Applied rewrites0.0%

                                    \[\leadsto \left(-\sqrt{-1}\right) \cdot \color{blue}{\sqrt{\frac{c}{a}}} \]
                                  2. Taylor expanded in b around -inf

                                    \[\leadsto -1 \cdot \color{blue}{\frac{c}{b}} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites95.6%

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

                                    if -1.21999999999999991e156 < b < 3.59999999999999999e-235

                                    1. Initial program 88.6%

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

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

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

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

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

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

                                        \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                      5. associate-*r/N/A

                                        \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                      6. fp-cancel-sign-sub-invN/A

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

                                        \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                                      8. *-lft-identityN/A

                                        \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                                    6. Applied rewrites88.7%

                                      \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites88.7%

                                        \[\leadsto \frac{c + c}{\color{blue}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)}} - b} \]

                                      if 3.59999999999999999e-235 < b < 1.8e-167 or 8.49999999999999956e149 < b

                                      1. Initial program 36.4%

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

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

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

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

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

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

                                          \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                        5. associate-*r/N/A

                                          \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                        6. fp-cancel-sign-sub-invN/A

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

                                          \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                                        8. *-lft-identityN/A

                                          \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                                      6. Applied rewrites13.2%

                                        \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites13.3%

                                          \[\leadsto c \cdot \color{blue}{\frac{2}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}} \]
                                        2. Taylor expanded in c around 0

                                          \[\leadsto c \cdot \frac{-1 \cdot \frac{b}{a} + \frac{c}{b}}{\color{blue}{c}} \]
                                        3. Step-by-step derivation
                                          1. Applied rewrites76.3%

                                            \[\leadsto c \cdot \frac{\mathsf{fma}\left(\frac{b}{a}, -1, \frac{c}{b}\right)}{\color{blue}{c}} \]

                                          if 1.8e-167 < b < 8.49999999999999956e149

                                          1. Initial program 86.9%

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

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

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

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

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{b + \sqrt{{b}^{2} - 4 \cdot \left(a \cdot c\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{2} \cdot \frac{b + \sqrt{{b}^{2} + \left(\mathsf{neg}\left(4\right)\right) \cdot \left(a \cdot c\right)}}{a}\\ \end{array} \]
                                            3. fp-cancel-sub-sign-invN/A

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

                                              \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{b + \sqrt{{b}^{2} - 4 \cdot \left(a \cdot c\right)}}{a}} \]
                                            5. *-commutativeN/A

                                              \[\leadsto \color{blue}{\frac{b + \sqrt{{b}^{2} - 4 \cdot \left(a \cdot c\right)}}{a} \cdot \frac{-1}{2}} \]
                                          6. Applied rewrites86.9%

                                            \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} + b}{a} \cdot -0.5} \]
                                        4. Recombined 4 regimes into one program.
                                        5. Final simplification87.2%

                                          \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.22 \cdot 10^{+156}:\\ \;\;\;\;\frac{c}{-b}\\ \mathbf{elif}\;b \leq 3.6 \cdot 10^{-235}:\\ \;\;\;\;\frac{c + c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{-167} \lor \neg \left(b \leq 8.5 \cdot 10^{+149}\right):\\ \;\;\;\;c \cdot \frac{\mathsf{fma}\left(\frac{b}{a}, -1, \frac{c}{b}\right)}{c}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} + b}{a} \cdot -0.5\\ \end{array} \]
                                        6. Add Preprocessing

                                        Alternative 4: 81.3% accurate, 0.9× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c}{-b}\\ \mathbf{if}\;b \leq -1.22 \cdot 10^{+156}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 3.8 \cdot 10^{-147}:\\ \;\;\;\;\frac{c + c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{+148}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b + \sqrt{b \cdot b}}{2 \cdot \left(-a\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \left(-b\right)}\\ \end{array}\\ \mathbf{elif}\;b \leq 1.45 \cdot 10^{+300}:\\ \;\;\;\;c \cdot \frac{-b}{c \cdot a}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                        (FPCore (a b c)
                                         :precision binary64
                                         (let* ((t_0 (/ c (- b))))
                                           (if (<= b -1.22e+156)
                                             t_0
                                             (if (<= b 3.8e-147)
                                               (/ (+ c c) (- (sqrt (fma -4.0 (* c a) (* b b))) b))
                                               (if (<= b 1.8e+148)
                                                 (if (>= b 0.0)
                                                   (/ (+ b (sqrt (* b b))) (* 2.0 (- a)))
                                                   (/ (* 2.0 c) (+ (- b) (- b))))
                                                 (if (<= b 1.45e+300) (* c (/ (- b) (* c a))) t_0))))))
                                        double code(double a, double b, double c) {
                                        	double t_0 = c / -b;
                                        	double tmp;
                                        	if (b <= -1.22e+156) {
                                        		tmp = t_0;
                                        	} else if (b <= 3.8e-147) {
                                        		tmp = (c + c) / (sqrt(fma(-4.0, (c * a), (b * b))) - b);
                                        	} else if (b <= 1.8e+148) {
                                        		double tmp_1;
                                        		if (b >= 0.0) {
                                        			tmp_1 = (b + sqrt((b * b))) / (2.0 * -a);
                                        		} else {
                                        			tmp_1 = (2.0 * c) / (-b + -b);
                                        		}
                                        		tmp = tmp_1;
                                        	} else if (b <= 1.45e+300) {
                                        		tmp = c * (-b / (c * a));
                                        	} else {
                                        		tmp = t_0;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        function code(a, b, c)
                                        	t_0 = Float64(c / Float64(-b))
                                        	tmp = 0.0
                                        	if (b <= -1.22e+156)
                                        		tmp = t_0;
                                        	elseif (b <= 3.8e-147)
                                        		tmp = Float64(Float64(c + c) / Float64(sqrt(fma(-4.0, Float64(c * a), Float64(b * b))) - b));
                                        	elseif (b <= 1.8e+148)
                                        		tmp_1 = 0.0
                                        		if (b >= 0.0)
                                        			tmp_1 = Float64(Float64(b + sqrt(Float64(b * b))) / Float64(2.0 * Float64(-a)));
                                        		else
                                        			tmp_1 = Float64(Float64(2.0 * c) / Float64(Float64(-b) + Float64(-b)));
                                        		end
                                        		tmp = tmp_1;
                                        	elseif (b <= 1.45e+300)
                                        		tmp = Float64(c * Float64(Float64(-b) / Float64(c * a)));
                                        	else
                                        		tmp = t_0;
                                        	end
                                        	return tmp
                                        end
                                        
                                        code[a_, b_, c_] := Block[{t$95$0 = N[(c / (-b)), $MachinePrecision]}, If[LessEqual[b, -1.22e+156], t$95$0, If[LessEqual[b, 3.8e-147], N[(N[(c + c), $MachinePrecision] / N[(N[Sqrt[N[(-4.0 * N[(c * a), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.8e+148], If[GreaterEqual[b, 0.0], N[(N[(b + N[Sqrt[N[(b * b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * (-a)), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * c), $MachinePrecision] / N[((-b) + (-b)), $MachinePrecision]), $MachinePrecision]], If[LessEqual[b, 1.45e+300], N[(c * N[((-b) / N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        t_0 := \frac{c}{-b}\\
                                        \mathbf{if}\;b \leq -1.22 \cdot 10^{+156}:\\
                                        \;\;\;\;t\_0\\
                                        
                                        \mathbf{elif}\;b \leq 3.8 \cdot 10^{-147}:\\
                                        \;\;\;\;\frac{c + c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}\\
                                        
                                        \mathbf{elif}\;b \leq 1.8 \cdot 10^{+148}:\\
                                        \;\;\;\;\begin{array}{l}
                                        \mathbf{if}\;b \geq 0:\\
                                        \;\;\;\;\frac{b + \sqrt{b \cdot b}}{2 \cdot \left(-a\right)}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \left(-b\right)}\\
                                        
                                        
                                        \end{array}\\
                                        
                                        \mathbf{elif}\;b \leq 1.45 \cdot 10^{+300}:\\
                                        \;\;\;\;c \cdot \frac{-b}{c \cdot a}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;t\_0\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 4 regimes
                                        2. if b < -1.21999999999999991e156 or 1.44999999999999993e300 < b

                                          1. Initial program 40.8%

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

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

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

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

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

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

                                              \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                            5. associate-*r/N/A

                                              \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                            6. fp-cancel-sign-sub-invN/A

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

                                              \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                                            8. *-lft-identityN/A

                                              \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                                          6. Applied rewrites38.5%

                                            \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                                          7. Taylor expanded in a around -inf

                                            \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
                                          8. Step-by-step derivation
                                            1. Applied rewrites0.0%

                                              \[\leadsto \left(-\sqrt{-1}\right) \cdot \color{blue}{\sqrt{\frac{c}{a}}} \]
                                            2. Taylor expanded in b around -inf

                                              \[\leadsto -1 \cdot \color{blue}{\frac{c}{b}} \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites91.2%

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

                                              if -1.21999999999999991e156 < b < 3.80000000000000028e-147

                                              1. Initial program 85.3%

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

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

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

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

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

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

                                                  \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                5. associate-*r/N/A

                                                  \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                6. fp-cancel-sign-sub-invN/A

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

                                                  \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                                                8. *-lft-identityN/A

                                                  \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                                              6. Applied rewrites84.8%

                                                \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites84.8%

                                                  \[\leadsto \frac{c + c}{\color{blue}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)}} - b} \]

                                                if 3.80000000000000028e-147 < b < 1.80000000000000003e148

                                                1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

                                                if 1.80000000000000003e148 < b < 1.44999999999999993e300

                                                1. Initial program 35.9%

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

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

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

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

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

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

                                                    \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                  5. associate-*r/N/A

                                                    \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                  6. fp-cancel-sign-sub-invN/A

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

                                                    \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                                                  8. *-lft-identityN/A

                                                    \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                                                6. Applied rewrites7.6%

                                                  \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                                                7. Step-by-step derivation
                                                  1. Applied rewrites7.7%

                                                    \[\leadsto c \cdot \color{blue}{\frac{2}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}} \]
                                                  2. Taylor expanded in a around 0

                                                    \[\leadsto c \cdot \left(-1 \cdot \color{blue}{\frac{b}{a \cdot c}}\right) \]
                                                  3. Step-by-step derivation
                                                    1. Applied rewrites71.9%

                                                      \[\leadsto c \cdot \frac{-b}{\color{blue}{c \cdot a}} \]
                                                  4. Recombined 4 regimes into one program.
                                                  5. Final simplification79.5%

                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.22 \cdot 10^{+156}:\\ \;\;\;\;\frac{c}{-b}\\ \mathbf{elif}\;b \leq 3.8 \cdot 10^{-147}:\\ \;\;\;\;\frac{c + c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{+148}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b + \sqrt{b \cdot b}}{2 \cdot \left(-a\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \left(-b\right)}\\ \end{array}\\ \mathbf{elif}\;b \leq 1.45 \cdot 10^{+300}:\\ \;\;\;\;c \cdot \frac{-b}{c \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \]
                                                  6. Add Preprocessing

                                                  Alternative 5: 68.6% accurate, 0.9× speedup?

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

                                                    1. Initial program 73.6%

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

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

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

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

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

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

                                                        \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                      5. associate-*r/N/A

                                                        \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                      6. fp-cancel-sign-sub-invN/A

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

                                                        \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                                                      8. *-lft-identityN/A

                                                        \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                                                    6. Applied rewrites72.7%

                                                      \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                                                    7. Taylor expanded in a around -inf

                                                      \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
                                                    8. Step-by-step derivation
                                                      1. Applied rewrites0.0%

                                                        \[\leadsto \left(-\sqrt{-1}\right) \cdot \color{blue}{\sqrt{\frac{c}{a}}} \]
                                                      2. Taylor expanded in b around -inf

                                                        \[\leadsto -1 \cdot \color{blue}{\frac{c}{b}} \]
                                                      3. Step-by-step derivation
                                                        1. Applied rewrites79.1%

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

                                                        if -4.0000000000000002e-135 < b < 7.39999999999999968e-181

                                                        1. Initial program 76.6%

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

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

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

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

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

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

                                                            \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                          5. associate-*r/N/A

                                                            \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                          6. fp-cancel-sign-sub-invN/A

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

                                                            \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                                                          8. *-lft-identityN/A

                                                            \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                                                        6. Applied rewrites75.9%

                                                          \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                                                        7. Taylor expanded in a around -inf

                                                          \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
                                                        8. Step-by-step derivation
                                                          1. Applied rewrites0.0%

                                                            \[\leadsto \left(-\sqrt{-1}\right) \cdot \color{blue}{\sqrt{\frac{c}{a}}} \]
                                                          2. Step-by-step derivation
                                                            1. Applied rewrites46.9%

                                                              \[\leadsto \color{blue}{-\sqrt{\frac{c}{a} \cdot -1}} \]

                                                            if 7.39999999999999968e-181 < b < 1.80000000000000003e148

                                                            1. Initial program 83.4%

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

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

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

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

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

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

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

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

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

                                                            if 1.80000000000000003e148 < b < 1.44999999999999993e300

                                                            1. Initial program 35.9%

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

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

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

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

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

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

                                                                \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                              5. associate-*r/N/A

                                                                \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                              6. fp-cancel-sign-sub-invN/A

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

                                                                \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                                                              8. *-lft-identityN/A

                                                                \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                                                            6. Applied rewrites7.6%

                                                              \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                                                            7. Step-by-step derivation
                                                              1. Applied rewrites7.7%

                                                                \[\leadsto c \cdot \color{blue}{\frac{2}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}} \]
                                                              2. Taylor expanded in a around 0

                                                                \[\leadsto c \cdot \left(-1 \cdot \color{blue}{\frac{b}{a \cdot c}}\right) \]
                                                              3. Step-by-step derivation
                                                                1. Applied rewrites71.9%

                                                                  \[\leadsto c \cdot \frac{-b}{\color{blue}{c \cdot a}} \]
                                                              4. Recombined 4 regimes into one program.
                                                              5. Final simplification67.9%

                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{-135}:\\ \;\;\;\;\frac{c}{-b}\\ \mathbf{elif}\;b \leq 7.4 \cdot 10^{-181}:\\ \;\;\;\;-\sqrt{\frac{c}{a} \cdot -1}\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{+148}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{b + \sqrt{b \cdot b}}{2 \cdot \left(-a\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) + \left(-b\right)}\\ \end{array}\\ \mathbf{elif}\;b \leq 1.45 \cdot 10^{+300}:\\ \;\;\;\;c \cdot \frac{-b}{c \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \]
                                                              6. Add Preprocessing

                                                              Alternative 6: 64.1% accurate, 1.3× speedup?

                                                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{c}{-b}\\ \mathbf{if}\;b \leq -4 \cdot 10^{-135}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;b \leq 7.4 \cdot 10^{-181}:\\ \;\;\;\;-\sqrt{\frac{c}{a} \cdot -1}\\ \mathbf{elif}\;b \leq 2.1 \cdot 10^{+292}:\\ \;\;\;\;c \cdot \frac{-b}{c \cdot a}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                                              (FPCore (a b c)
                                                               :precision binary64
                                                               (let* ((t_0 (/ c (- b))))
                                                                 (if (<= b -4e-135)
                                                                   t_0
                                                                   (if (<= b 7.4e-181)
                                                                     (- (sqrt (* (/ c a) -1.0)))
                                                                     (if (<= b 2.1e+292) (* c (/ (- b) (* c a))) t_0)))))
                                                              double code(double a, double b, double c) {
                                                              	double t_0 = c / -b;
                                                              	double tmp;
                                                              	if (b <= -4e-135) {
                                                              		tmp = t_0;
                                                              	} else if (b <= 7.4e-181) {
                                                              		tmp = -sqrt(((c / a) * -1.0));
                                                              	} else if (b <= 2.1e+292) {
                                                              		tmp = c * (-b / (c * a));
                                                              	} else {
                                                              		tmp = t_0;
                                                              	}
                                                              	return tmp;
                                                              }
                                                              
                                                              real(8) function code(a, b, c)
                                                                  real(8), intent (in) :: a
                                                                  real(8), intent (in) :: b
                                                                  real(8), intent (in) :: c
                                                                  real(8) :: t_0
                                                                  real(8) :: tmp
                                                                  t_0 = c / -b
                                                                  if (b <= (-4d-135)) then
                                                                      tmp = t_0
                                                                  else if (b <= 7.4d-181) then
                                                                      tmp = -sqrt(((c / a) * (-1.0d0)))
                                                                  else if (b <= 2.1d+292) then
                                                                      tmp = c * (-b / (c * a))
                                                                  else
                                                                      tmp = t_0
                                                                  end if
                                                                  code = tmp
                                                              end function
                                                              
                                                              public static double code(double a, double b, double c) {
                                                              	double t_0 = c / -b;
                                                              	double tmp;
                                                              	if (b <= -4e-135) {
                                                              		tmp = t_0;
                                                              	} else if (b <= 7.4e-181) {
                                                              		tmp = -Math.sqrt(((c / a) * -1.0));
                                                              	} else if (b <= 2.1e+292) {
                                                              		tmp = c * (-b / (c * a));
                                                              	} else {
                                                              		tmp = t_0;
                                                              	}
                                                              	return tmp;
                                                              }
                                                              
                                                              def code(a, b, c):
                                                              	t_0 = c / -b
                                                              	tmp = 0
                                                              	if b <= -4e-135:
                                                              		tmp = t_0
                                                              	elif b <= 7.4e-181:
                                                              		tmp = -math.sqrt(((c / a) * -1.0))
                                                              	elif b <= 2.1e+292:
                                                              		tmp = c * (-b / (c * a))
                                                              	else:
                                                              		tmp = t_0
                                                              	return tmp
                                                              
                                                              function code(a, b, c)
                                                              	t_0 = Float64(c / Float64(-b))
                                                              	tmp = 0.0
                                                              	if (b <= -4e-135)
                                                              		tmp = t_0;
                                                              	elseif (b <= 7.4e-181)
                                                              		tmp = Float64(-sqrt(Float64(Float64(c / a) * -1.0)));
                                                              	elseif (b <= 2.1e+292)
                                                              		tmp = Float64(c * Float64(Float64(-b) / Float64(c * a)));
                                                              	else
                                                              		tmp = t_0;
                                                              	end
                                                              	return tmp
                                                              end
                                                              
                                                              function tmp_2 = code(a, b, c)
                                                              	t_0 = c / -b;
                                                              	tmp = 0.0;
                                                              	if (b <= -4e-135)
                                                              		tmp = t_0;
                                                              	elseif (b <= 7.4e-181)
                                                              		tmp = -sqrt(((c / a) * -1.0));
                                                              	elseif (b <= 2.1e+292)
                                                              		tmp = c * (-b / (c * a));
                                                              	else
                                                              		tmp = t_0;
                                                              	end
                                                              	tmp_2 = tmp;
                                                              end
                                                              
                                                              code[a_, b_, c_] := Block[{t$95$0 = N[(c / (-b)), $MachinePrecision]}, If[LessEqual[b, -4e-135], t$95$0, If[LessEqual[b, 7.4e-181], (-N[Sqrt[N[(N[(c / a), $MachinePrecision] * -1.0), $MachinePrecision]], $MachinePrecision]), If[LessEqual[b, 2.1e+292], N[(c * N[((-b) / N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
                                                              
                                                              \begin{array}{l}
                                                              
                                                              \\
                                                              \begin{array}{l}
                                                              t_0 := \frac{c}{-b}\\
                                                              \mathbf{if}\;b \leq -4 \cdot 10^{-135}:\\
                                                              \;\;\;\;t\_0\\
                                                              
                                                              \mathbf{elif}\;b \leq 7.4 \cdot 10^{-181}:\\
                                                              \;\;\;\;-\sqrt{\frac{c}{a} \cdot -1}\\
                                                              
                                                              \mathbf{elif}\;b \leq 2.1 \cdot 10^{+292}:\\
                                                              \;\;\;\;c \cdot \frac{-b}{c \cdot a}\\
                                                              
                                                              \mathbf{else}:\\
                                                              \;\;\;\;t\_0\\
                                                              
                                                              
                                                              \end{array}
                                                              \end{array}
                                                              
                                                              Derivation
                                                              1. Split input into 3 regimes
                                                              2. if b < -4.0000000000000002e-135 or 2.1000000000000002e292 < b

                                                                1. Initial program 73.3%

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

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

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

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

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

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

                                                                    \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                                  5. associate-*r/N/A

                                                                    \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                                  6. fp-cancel-sign-sub-invN/A

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

                                                                    \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                                                                  8. *-lft-identityN/A

                                                                    \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                                                                6. Applied rewrites71.5%

                                                                  \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                                                                7. Taylor expanded in a around -inf

                                                                  \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
                                                                8. Step-by-step derivation
                                                                  1. Applied rewrites0.0%

                                                                    \[\leadsto \left(-\sqrt{-1}\right) \cdot \color{blue}{\sqrt{\frac{c}{a}}} \]
                                                                  2. Taylor expanded in b around -inf

                                                                    \[\leadsto -1 \cdot \color{blue}{\frac{c}{b}} \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites77.8%

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

                                                                    if -4.0000000000000002e-135 < b < 7.39999999999999968e-181

                                                                    1. Initial program 76.6%

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

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

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

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

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

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

                                                                        \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                                      5. associate-*r/N/A

                                                                        \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                                      6. fp-cancel-sign-sub-invN/A

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

                                                                        \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                                                                      8. *-lft-identityN/A

                                                                        \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                                                                    6. Applied rewrites75.9%

                                                                      \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                                                                    7. Taylor expanded in a around -inf

                                                                      \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
                                                                    8. Step-by-step derivation
                                                                      1. Applied rewrites0.0%

                                                                        \[\leadsto \left(-\sqrt{-1}\right) \cdot \color{blue}{\sqrt{\frac{c}{a}}} \]
                                                                      2. Step-by-step derivation
                                                                        1. Applied rewrites46.9%

                                                                          \[\leadsto \color{blue}{-\sqrt{\frac{c}{a} \cdot -1}} \]

                                                                        if 7.39999999999999968e-181 < b < 2.1000000000000002e292

                                                                        1. Initial program 67.0%

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

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

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

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

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

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

                                                                            \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                                          5. associate-*r/N/A

                                                                            \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                                          6. fp-cancel-sign-sub-invN/A

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

                                                                            \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                                                                          8. *-lft-identityN/A

                                                                            \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                                                                        6. Applied rewrites22.1%

                                                                          \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                                                                        7. Step-by-step derivation
                                                                          1. Applied rewrites22.1%

                                                                            \[\leadsto c \cdot \color{blue}{\frac{2}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}} \]
                                                                          2. Taylor expanded in a around 0

                                                                            \[\leadsto c \cdot \left(-1 \cdot \color{blue}{\frac{b}{a \cdot c}}\right) \]
                                                                          3. Step-by-step derivation
                                                                            1. Applied rewrites51.3%

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

                                                                          Alternative 7: 59.8% accurate, 1.6× speedup?

                                                                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.1 \cdot 10^{-308} \lor \neg \left(b \leq 2.1 \cdot 10^{+292}\right):\\ \;\;\;\;\frac{c}{-b}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{-b}{c \cdot a}\\ \end{array} \end{array} \]
                                                                          (FPCore (a b c)
                                                                           :precision binary64
                                                                           (if (or (<= b -1.1e-308) (not (<= b 2.1e+292)))
                                                                             (/ c (- b))
                                                                             (* c (/ (- b) (* c a)))))
                                                                          double code(double a, double b, double c) {
                                                                          	double tmp;
                                                                          	if ((b <= -1.1e-308) || !(b <= 2.1e+292)) {
                                                                          		tmp = c / -b;
                                                                          	} else {
                                                                          		tmp = c * (-b / (c * 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 <= (-1.1d-308)) .or. (.not. (b <= 2.1d+292))) then
                                                                                  tmp = c / -b
                                                                              else
                                                                                  tmp = c * (-b / (c * a))
                                                                              end if
                                                                              code = tmp
                                                                          end function
                                                                          
                                                                          public static double code(double a, double b, double c) {
                                                                          	double tmp;
                                                                          	if ((b <= -1.1e-308) || !(b <= 2.1e+292)) {
                                                                          		tmp = c / -b;
                                                                          	} else {
                                                                          		tmp = c * (-b / (c * a));
                                                                          	}
                                                                          	return tmp;
                                                                          }
                                                                          
                                                                          def code(a, b, c):
                                                                          	tmp = 0
                                                                          	if (b <= -1.1e-308) or not (b <= 2.1e+292):
                                                                          		tmp = c / -b
                                                                          	else:
                                                                          		tmp = c * (-b / (c * a))
                                                                          	return tmp
                                                                          
                                                                          function code(a, b, c)
                                                                          	tmp = 0.0
                                                                          	if ((b <= -1.1e-308) || !(b <= 2.1e+292))
                                                                          		tmp = Float64(c / Float64(-b));
                                                                          	else
                                                                          		tmp = Float64(c * Float64(Float64(-b) / Float64(c * a)));
                                                                          	end
                                                                          	return tmp
                                                                          end
                                                                          
                                                                          function tmp_2 = code(a, b, c)
                                                                          	tmp = 0.0;
                                                                          	if ((b <= -1.1e-308) || ~((b <= 2.1e+292)))
                                                                          		tmp = c / -b;
                                                                          	else
                                                                          		tmp = c * (-b / (c * a));
                                                                          	end
                                                                          	tmp_2 = tmp;
                                                                          end
                                                                          
                                                                          code[a_, b_, c_] := If[Or[LessEqual[b, -1.1e-308], N[Not[LessEqual[b, 2.1e+292]], $MachinePrecision]], N[(c / (-b)), $MachinePrecision], N[(c * N[((-b) / N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                                                          
                                                                          \begin{array}{l}
                                                                          
                                                                          \\
                                                                          \begin{array}{l}
                                                                          \mathbf{if}\;b \leq -1.1 \cdot 10^{-308} \lor \neg \left(b \leq 2.1 \cdot 10^{+292}\right):\\
                                                                          \;\;\;\;\frac{c}{-b}\\
                                                                          
                                                                          \mathbf{else}:\\
                                                                          \;\;\;\;c \cdot \frac{-b}{c \cdot a}\\
                                                                          
                                                                          
                                                                          \end{array}
                                                                          \end{array}
                                                                          
                                                                          Derivation
                                                                          1. Split input into 2 regimes
                                                                          2. if b < -1.1000000000000001e-308 or 2.1000000000000002e292 < b

                                                                            1. Initial program 74.1%

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

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

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

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

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

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

                                                                                \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                                              5. associate-*r/N/A

                                                                                \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                                              6. fp-cancel-sign-sub-invN/A

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

                                                                                \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                                                                              8. *-lft-identityN/A

                                                                                \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                                                                            6. Applied rewrites72.7%

                                                                              \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                                                                            7. Taylor expanded in a around -inf

                                                                              \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
                                                                            8. Step-by-step derivation
                                                                              1. Applied rewrites0.0%

                                                                                \[\leadsto \left(-\sqrt{-1}\right) \cdot \color{blue}{\sqrt{\frac{c}{a}}} \]
                                                                              2. Taylor expanded in b around -inf

                                                                                \[\leadsto -1 \cdot \color{blue}{\frac{c}{b}} \]
                                                                              3. Step-by-step derivation
                                                                                1. Applied rewrites65.1%

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

                                                                                if -1.1000000000000001e-308 < b < 2.1000000000000002e292

                                                                                1. Initial program 68.2%

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

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

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

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

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

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

                                                                                    \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                                                  5. associate-*r/N/A

                                                                                    \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                                                  6. fp-cancel-sign-sub-invN/A

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

                                                                                    \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                                                                                  8. *-lft-identityN/A

                                                                                    \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                                                                                6. Applied rewrites30.1%

                                                                                  \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                                                                                7. Step-by-step derivation
                                                                                  1. Applied rewrites30.1%

                                                                                    \[\leadsto c \cdot \color{blue}{\frac{2}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} - b}} \]
                                                                                  2. Taylor expanded in a around 0

                                                                                    \[\leadsto c \cdot \left(-1 \cdot \color{blue}{\frac{b}{a \cdot c}}\right) \]
                                                                                  3. Step-by-step derivation
                                                                                    1. Applied rewrites43.7%

                                                                                      \[\leadsto c \cdot \frac{-b}{\color{blue}{c \cdot a}} \]
                                                                                  4. Recombined 2 regimes into one program.
                                                                                  5. Final simplification55.7%

                                                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.1 \cdot 10^{-308} \lor \neg \left(b \leq 2.1 \cdot 10^{+292}\right):\\ \;\;\;\;\frac{c}{-b}\\ \mathbf{else}:\\ \;\;\;\;c \cdot \frac{-b}{c \cdot a}\\ \end{array} \]
                                                                                  6. Add Preprocessing

                                                                                  Alternative 8: 37.4% accurate, 1.6× speedup?

                                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -3 \cdot 10^{-264} \lor \neg \left(b \leq 7.6 \cdot 10^{+212}\right):\\ \;\;\;\;\frac{c}{-b}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot b}{0} \cdot 4\\ \end{array} \end{array} \]
                                                                                  (FPCore (a b c)
                                                                                   :precision binary64
                                                                                   (if (or (<= b -3e-264) (not (<= b 7.6e+212)))
                                                                                     (/ c (- b))
                                                                                     (* (/ (* c b) 0.0) 4.0)))
                                                                                  double code(double a, double b, double c) {
                                                                                  	double tmp;
                                                                                  	if ((b <= -3e-264) || !(b <= 7.6e+212)) {
                                                                                  		tmp = c / -b;
                                                                                  	} else {
                                                                                  		tmp = ((c * b) / 0.0) * 4.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 <= (-3d-264)) .or. (.not. (b <= 7.6d+212))) then
                                                                                          tmp = c / -b
                                                                                      else
                                                                                          tmp = ((c * b) / 0.0d0) * 4.0d0
                                                                                      end if
                                                                                      code = tmp
                                                                                  end function
                                                                                  
                                                                                  public static double code(double a, double b, double c) {
                                                                                  	double tmp;
                                                                                  	if ((b <= -3e-264) || !(b <= 7.6e+212)) {
                                                                                  		tmp = c / -b;
                                                                                  	} else {
                                                                                  		tmp = ((c * b) / 0.0) * 4.0;
                                                                                  	}
                                                                                  	return tmp;
                                                                                  }
                                                                                  
                                                                                  def code(a, b, c):
                                                                                  	tmp = 0
                                                                                  	if (b <= -3e-264) or not (b <= 7.6e+212):
                                                                                  		tmp = c / -b
                                                                                  	else:
                                                                                  		tmp = ((c * b) / 0.0) * 4.0
                                                                                  	return tmp
                                                                                  
                                                                                  function code(a, b, c)
                                                                                  	tmp = 0.0
                                                                                  	if ((b <= -3e-264) || !(b <= 7.6e+212))
                                                                                  		tmp = Float64(c / Float64(-b));
                                                                                  	else
                                                                                  		tmp = Float64(Float64(Float64(c * b) / 0.0) * 4.0);
                                                                                  	end
                                                                                  	return tmp
                                                                                  end
                                                                                  
                                                                                  function tmp_2 = code(a, b, c)
                                                                                  	tmp = 0.0;
                                                                                  	if ((b <= -3e-264) || ~((b <= 7.6e+212)))
                                                                                  		tmp = c / -b;
                                                                                  	else
                                                                                  		tmp = ((c * b) / 0.0) * 4.0;
                                                                                  	end
                                                                                  	tmp_2 = tmp;
                                                                                  end
                                                                                  
                                                                                  code[a_, b_, c_] := If[Or[LessEqual[b, -3e-264], N[Not[LessEqual[b, 7.6e+212]], $MachinePrecision]], N[(c / (-b)), $MachinePrecision], N[(N[(N[(c * b), $MachinePrecision] / 0.0), $MachinePrecision] * 4.0), $MachinePrecision]]
                                                                                  
                                                                                  \begin{array}{l}
                                                                                  
                                                                                  \\
                                                                                  \begin{array}{l}
                                                                                  \mathbf{if}\;b \leq -3 \cdot 10^{-264} \lor \neg \left(b \leq 7.6 \cdot 10^{+212}\right):\\
                                                                                  \;\;\;\;\frac{c}{-b}\\
                                                                                  
                                                                                  \mathbf{else}:\\
                                                                                  \;\;\;\;\frac{c \cdot b}{0} \cdot 4\\
                                                                                  
                                                                                  
                                                                                  \end{array}
                                                                                  \end{array}
                                                                                  
                                                                                  Derivation
                                                                                  1. Split input into 2 regimes
                                                                                  2. if b < -3e-264 or 7.59999999999999976e212 < b

                                                                                    1. Initial program 68.6%

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

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

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

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

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

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

                                                                                        \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                                                      5. associate-*r/N/A

                                                                                        \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                                                      6. fp-cancel-sign-sub-invN/A

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

                                                                                        \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                                                                                      8. *-lft-identityN/A

                                                                                        \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                                                                                    6. Applied rewrites63.9%

                                                                                      \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                                                                                    7. Taylor expanded in a around -inf

                                                                                      \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
                                                                                    8. Step-by-step derivation
                                                                                      1. Applied rewrites0.0%

                                                                                        \[\leadsto \left(-\sqrt{-1}\right) \cdot \color{blue}{\sqrt{\frac{c}{a}}} \]
                                                                                      2. Taylor expanded in b around -inf

                                                                                        \[\leadsto -1 \cdot \color{blue}{\frac{c}{b}} \]
                                                                                      3. Step-by-step derivation
                                                                                        1. Applied rewrites59.5%

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

                                                                                        if -3e-264 < b < 7.59999999999999976e212

                                                                                        1. Initial program 76.2%

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

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

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

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

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

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

                                                                                            \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                                                          5. associate-*r/N/A

                                                                                            \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                                                          6. fp-cancel-sign-sub-invN/A

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

                                                                                            \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                                                                                          8. *-lft-identityN/A

                                                                                            \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                                                                                        6. Applied rewrites38.1%

                                                                                          \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                                                                                        7. Step-by-step derivation
                                                                                          1. Applied rewrites34.8%

                                                                                            \[\leadsto \frac{2 \cdot c}{\frac{\mathsf{fma}\left(-b, b, \mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)\right)}{\color{blue}{\sqrt{\mathsf{fma}\left(-4 \cdot c, a, b \cdot b\right)} + b}}} \]
                                                                                          2. Taylor expanded in a around 0

                                                                                            \[\leadsto 4 \cdot \color{blue}{\frac{b \cdot c}{-1 \cdot {b}^{2} + {b}^{2}}} \]
                                                                                          3. Step-by-step derivation
                                                                                            1. Applied rewrites6.2%

                                                                                              \[\leadsto \frac{c \cdot b}{0} \cdot \color{blue}{4} \]
                                                                                          4. Recombined 2 regimes into one program.
                                                                                          5. Final simplification38.9%

                                                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3 \cdot 10^{-264} \lor \neg \left(b \leq 7.6 \cdot 10^{+212}\right):\\ \;\;\;\;\frac{c}{-b}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot b}{0} \cdot 4\\ \end{array} \]
                                                                                          6. Add Preprocessing

                                                                                          Alternative 9: 35.4% accurate, 4.0× speedup?

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

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

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

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

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

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

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

                                                                                              \[\leadsto \color{blue}{2 \cdot \frac{c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                                                            5. associate-*r/N/A

                                                                                              \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} + -1 \cdot b}} \]
                                                                                            6. fp-cancel-sign-sub-invN/A

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

                                                                                              \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{1} \cdot b} \]
                                                                                            8. *-lft-identityN/A

                                                                                              \[\leadsto \frac{2 \cdot c}{\sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}} - \color{blue}{b}} \]
                                                                                          6. Applied rewrites53.9%

                                                                                            \[\leadsto \color{blue}{\frac{2 \cdot c}{\sqrt{\mathsf{fma}\left(-4, c \cdot a, b \cdot b\right)} - b}} \]
                                                                                          7. Taylor expanded in a around -inf

                                                                                            \[\leadsto -1 \cdot \color{blue}{\left(\sqrt{\frac{c}{a}} \cdot \sqrt{-1}\right)} \]
                                                                                          8. Step-by-step derivation
                                                                                            1. Applied rewrites0.0%

                                                                                              \[\leadsto \left(-\sqrt{-1}\right) \cdot \color{blue}{\sqrt{\frac{c}{a}}} \]
                                                                                            2. Taylor expanded in b around -inf

                                                                                              \[\leadsto -1 \cdot \color{blue}{\frac{c}{b}} \]
                                                                                            3. Step-by-step derivation
                                                                                              1. Applied rewrites37.3%

                                                                                                \[\leadsto \frac{c}{\color{blue}{-b}} \]
                                                                                              2. Add Preprocessing

                                                                                              Reproduce

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