jeff quadratic root 2

Percentage Accurate: 72.2% → 90.7%
Time: 9.1s
Alternatives: 7
Speedup: N/A×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\\ \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + t\_0}{2 \cdot a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (sqrt (- (* b b) (* (* 4.0 a) c)))))
   (if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_0)) (/ (+ (- b) t_0) (* 2.0 a)))))
double code(double a, double b, double c) {
	double t_0 = sqrt(((b * b) - ((4.0 * a) * c)));
	double tmp;
	if (b >= 0.0) {
		tmp = (2.0 * c) / (-b - t_0);
	} else {
		tmp = (-b + t_0) / (2.0 * a);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

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


\end{array}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 7 alternatives:

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

Initial Program: 72.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}\\ \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(-b\right) + t\_0}{2 \cdot a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (sqrt (- (* b b) (* (* 4.0 a) c)))))
   (if (>= b 0.0) (/ (* 2.0 c) (- (- b) t_0)) (/ (+ (- b) t_0) (* 2.0 a)))))
double code(double a, double b, double c) {
	double t_0 = sqrt(((b * b) - ((4.0 * a) * c)));
	double tmp;
	if (b >= 0.0) {
		tmp = (2.0 * c) / (-b - t_0);
	} else {
		tmp = (-b + t_0) / (2.0 * a);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

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

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

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


\end{array}
\end{array}

Alternative 1: 90.7% accurate, N/A× speedup?

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

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

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


\end{array}\\

\mathbf{elif}\;b \leq 2.5 \cdot 10^{+121}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{t\_0}{b + t\_1}\\

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


\end{array}\\

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

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


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

    1. Initial program 39.1%

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

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

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

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

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

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

      if -2e153 < b < 2.50000000000000004e121

      1. Initial program 84.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 2.50000000000000004e121 < b

      1. Initial program 65.2%

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

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

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

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

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

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

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

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

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

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

    Alternative 2: 90.5% accurate, N/A× speedup?

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

      1. Initial program 39.1%

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

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

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

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

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

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

        if -2e153 < b < 2.50000000000000004e121

        1. Initial program 84.3%

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

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

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

        if 2.50000000000000004e121 < b

        1. Initial program 65.2%

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

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

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

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

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

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

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

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

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

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

      Alternative 3: 90.4% accurate, N/A× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left({b}^{1}, {b}^{1}, -4 \cdot \left(a \cdot c\right)\right)\\ \mathbf{if}\;b \leq -2 \cdot 10^{+153} \lor \neg \left(b \leq 2.5 \cdot 10^{+121}\right):\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-1 \cdot \left(2 \cdot c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 \cdot b + -1 \cdot b}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot c}{\mathsf{fma}\left({t\_0}^{-0.5}, {t\_0}^{1}, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{{t\_0}^{0.5} - b}{a} \cdot 0.5\\ \end{array} \end{array} \]
      (FPCore (a b c)
       :precision binary64
       (let* ((t_0 (fma (pow b 1.0) (pow b 1.0) (* -4.0 (* a c)))))
         (if (or (<= b -2e+153) (not (<= b 2.5e+121)))
           (if (>= b 0.0)
             (/ (* -1.0 (* 2.0 c)) (+ b b))
             (/ (+ (* -1.0 b) (* -1.0 b)) (* 2.0 a)))
           (if (>= b 0.0)
             (/ (* -2.0 c) (fma (pow t_0 -0.5) (pow t_0 1.0) b))
             (* (/ (- (pow t_0 0.5) b) a) 0.5)))))
      double code(double a, double b, double c) {
      	double t_0 = fma(pow(b, 1.0), pow(b, 1.0), (-4.0 * (a * c)));
      	double tmp_1;
      	if ((b <= -2e+153) || !(b <= 2.5e+121)) {
      		double tmp_2;
      		if (b >= 0.0) {
      			tmp_2 = (-1.0 * (2.0 * c)) / (b + b);
      		} else {
      			tmp_2 = ((-1.0 * b) + (-1.0 * b)) / (2.0 * a);
      		}
      		tmp_1 = tmp_2;
      	} else if (b >= 0.0) {
      		tmp_1 = (-2.0 * c) / fma(pow(t_0, -0.5), pow(t_0, 1.0), b);
      	} else {
      		tmp_1 = ((pow(t_0, 0.5) - b) / a) * 0.5;
      	}
      	return tmp_1;
      }
      
      function code(a, b, c)
      	t_0 = fma((b ^ 1.0), (b ^ 1.0), Float64(-4.0 * Float64(a * c)))
      	tmp_1 = 0.0
      	if ((b <= -2e+153) || !(b <= 2.5e+121))
      		tmp_2 = 0.0
      		if (b >= 0.0)
      			tmp_2 = Float64(Float64(-1.0 * Float64(2.0 * c)) / Float64(b + b));
      		else
      			tmp_2 = Float64(Float64(Float64(-1.0 * b) + Float64(-1.0 * b)) / Float64(2.0 * a));
      		end
      		tmp_1 = tmp_2;
      	elseif (b >= 0.0)
      		tmp_1 = Float64(Float64(-2.0 * c) / fma((t_0 ^ -0.5), (t_0 ^ 1.0), b));
      	else
      		tmp_1 = Float64(Float64(Float64((t_0 ^ 0.5) - b) / a) * 0.5);
      	end
      	return tmp_1
      end
      
      code[a_, b_, c_] := Block[{t$95$0 = N[(N[Power[b, 1.0], $MachinePrecision] * N[Power[b, 1.0], $MachinePrecision] + N[(-4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[b, -2e+153], N[Not[LessEqual[b, 2.5e+121]], $MachinePrecision]], If[GreaterEqual[b, 0.0], N[(N[(-1.0 * N[(2.0 * c), $MachinePrecision]), $MachinePrecision] / N[(b + b), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-1.0 * b), $MachinePrecision] + N[(-1.0 * b), $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]], If[GreaterEqual[b, 0.0], N[(N[(-2.0 * c), $MachinePrecision] / N[(N[Power[t$95$0, -0.5], $MachinePrecision] * N[Power[t$95$0, 1.0], $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Power[t$95$0, 0.5], $MachinePrecision] - b), $MachinePrecision] / a), $MachinePrecision] * 0.5), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \mathsf{fma}\left({b}^{1}, {b}^{1}, -4 \cdot \left(a \cdot c\right)\right)\\
      \mathbf{if}\;b \leq -2 \cdot 10^{+153} \lor \neg \left(b \leq 2.5 \cdot 10^{+121}\right):\\
      \;\;\;\;\begin{array}{l}
      \mathbf{if}\;b \geq 0:\\
      \;\;\;\;\frac{-1 \cdot \left(2 \cdot c\right)}{b + b}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{-1 \cdot b + -1 \cdot b}{2 \cdot a}\\
      
      
      \end{array}\\
      
      \mathbf{elif}\;b \geq 0:\\
      \;\;\;\;\frac{-2 \cdot c}{\mathsf{fma}\left({t\_0}^{-0.5}, {t\_0}^{1}, b\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{{t\_0}^{0.5} - b}{a} \cdot 0.5\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if b < -2e153 or 2.50000000000000004e121 < b

        1. Initial program 54.3%

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

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

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

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

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

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

          if -2e153 < b < 2.50000000000000004e121

          1. Initial program 84.3%

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2 \cdot 10^{+153} \lor \neg \left(b \leq 2.5 \cdot 10^{+121}\right):\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-1 \cdot \left(2 \cdot c\right)}{b + b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1 \cdot b + -1 \cdot b}{2 \cdot a}\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot c}{\mathsf{fma}\left({\left(\mathsf{fma}\left({b}^{1}, {b}^{1}, -4 \cdot \left(a \cdot c\right)\right)\right)}^{-0.5}, {\left(\mathsf{fma}\left({b}^{1}, {b}^{1}, -4 \cdot \left(a \cdot c\right)\right)\right)}^{1}, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\mathsf{fma}\left({b}^{1}, {b}^{1}, -4 \cdot \left(a \cdot c\right)\right)\right)}^{0.5} - b}{a} \cdot 0.5\\ \end{array} \]
        10. Add Preprocessing

        Alternative 4: 81.3% accurate, N/A× speedup?

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

          1. Initial program 75.9%

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

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

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

          if 3.4e124 < b

          1. Initial program 63.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 5: 71.9% accurate, N/A× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(-4, a \cdot c, b \cdot b\right)\\ t_1 := -4 \cdot \left(a \cdot c\right)\\ t_2 := \mathsf{fma}\left({b}^{1}, {b}^{1}, t\_1\right)\\ \mathbf{if}\;b \leq -7.5 \cdot 10^{-294}:\\ \;\;\;\;\begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot c}{\mathsf{fma}\left({\left({\left({\left(\mathsf{fma}\left(b, b, t\_1\right)\right)}^{0.5}\right)}^{2}\right)}^{-0.5}, {t\_2}^{1}, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{{t\_2}^{0.5} - b}{a} \cdot 0.5\\ \end{array}\\ \mathbf{elif}\;b \geq 0:\\ \;\;\;\;\left(-1 \cdot 2\right) \cdot \frac{c}{b + {\left(b \cdot b - 4 \cdot \left(a \cdot c\right)\right)}^{0.5}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{{\left({t\_0}^{3}\right)}^{0.5} - \left(b \cdot b\right) \cdot b}{a \cdot \left(\mathsf{fma}\left(-4, a \cdot c, 2 \cdot \left(b \cdot b\right)\right) - -1 \cdot \left(b \cdot {t\_0}^{0.5}\right)\right)}\\ \end{array} \end{array} \]
        (FPCore (a b c)
         :precision binary64
         (let* ((t_0 (fma -4.0 (* a c) (* b b)))
                (t_1 (* -4.0 (* a c)))
                (t_2 (fma (pow b 1.0) (pow b 1.0) t_1)))
           (if (<= b -7.5e-294)
             (if (>= b 0.0)
               (/
                (* -2.0 c)
                (fma (pow (pow (pow (fma b b t_1) 0.5) 2.0) -0.5) (pow t_2 1.0) b))
               (* (/ (- (pow t_2 0.5) b) a) 0.5))
             (if (>= b 0.0)
               (* (* -1.0 2.0) (/ c (+ b (pow (- (* b b) (* 4.0 (* a c))) 0.5))))
               (*
                0.5
                (/
                 (- (pow (pow t_0 3.0) 0.5) (* (* b b) b))
                 (*
                  a
                  (-
                   (fma -4.0 (* a c) (* 2.0 (* b b)))
                   (* -1.0 (* b (pow t_0 0.5)))))))))))
        double code(double a, double b, double c) {
        	double t_0 = fma(-4.0, (a * c), (b * b));
        	double t_1 = -4.0 * (a * c);
        	double t_2 = fma(pow(b, 1.0), pow(b, 1.0), t_1);
        	double tmp_1;
        	if (b <= -7.5e-294) {
        		double tmp_2;
        		if (b >= 0.0) {
        			tmp_2 = (-2.0 * c) / fma(pow(pow(pow(fma(b, b, t_1), 0.5), 2.0), -0.5), pow(t_2, 1.0), b);
        		} else {
        			tmp_2 = ((pow(t_2, 0.5) - b) / a) * 0.5;
        		}
        		tmp_1 = tmp_2;
        	} else if (b >= 0.0) {
        		tmp_1 = (-1.0 * 2.0) * (c / (b + pow(((b * b) - (4.0 * (a * c))), 0.5)));
        	} else {
        		tmp_1 = 0.5 * ((pow(pow(t_0, 3.0), 0.5) - ((b * b) * b)) / (a * (fma(-4.0, (a * c), (2.0 * (b * b))) - (-1.0 * (b * pow(t_0, 0.5))))));
        	}
        	return tmp_1;
        }
        
        function code(a, b, c)
        	t_0 = fma(-4.0, Float64(a * c), Float64(b * b))
        	t_1 = Float64(-4.0 * Float64(a * c))
        	t_2 = fma((b ^ 1.0), (b ^ 1.0), t_1)
        	tmp_1 = 0.0
        	if (b <= -7.5e-294)
        		tmp_2 = 0.0
        		if (b >= 0.0)
        			tmp_2 = Float64(Float64(-2.0 * c) / fma((((fma(b, b, t_1) ^ 0.5) ^ 2.0) ^ -0.5), (t_2 ^ 1.0), b));
        		else
        			tmp_2 = Float64(Float64(Float64((t_2 ^ 0.5) - b) / a) * 0.5);
        		end
        		tmp_1 = tmp_2;
        	elseif (b >= 0.0)
        		tmp_1 = Float64(Float64(-1.0 * 2.0) * Float64(c / Float64(b + (Float64(Float64(b * b) - Float64(4.0 * Float64(a * c))) ^ 0.5))));
        	else
        		tmp_1 = Float64(0.5 * Float64(Float64(((t_0 ^ 3.0) ^ 0.5) - Float64(Float64(b * b) * b)) / Float64(a * Float64(fma(-4.0, Float64(a * c), Float64(2.0 * Float64(b * b))) - Float64(-1.0 * Float64(b * (t_0 ^ 0.5)))))));
        	end
        	return tmp_1
        end
        
        code[a_, b_, c_] := Block[{t$95$0 = N[(-4.0 * N[(a * c), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[b, 1.0], $MachinePrecision] * N[Power[b, 1.0], $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[b, -7.5e-294], If[GreaterEqual[b, 0.0], N[(N[(-2.0 * c), $MachinePrecision] / N[(N[Power[N[Power[N[Power[N[(b * b + t$95$1), $MachinePrecision], 0.5], $MachinePrecision], 2.0], $MachinePrecision], -0.5], $MachinePrecision] * N[Power[t$95$2, 1.0], $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Power[t$95$2, 0.5], $MachinePrecision] - b), $MachinePrecision] / a), $MachinePrecision] * 0.5), $MachinePrecision]], If[GreaterEqual[b, 0.0], N[(N[(-1.0 * 2.0), $MachinePrecision] * N[(c / N[(b + N[Power[N[(N[(b * b), $MachinePrecision] - N[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(N[Power[N[Power[t$95$0, 3.0], $MachinePrecision], 0.5], $MachinePrecision] - N[(N[(b * b), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] / N[(a * N[(N[(-4.0 * N[(a * c), $MachinePrecision] + N[(2.0 * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-1.0 * N[(b * N[Power[t$95$0, 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \mathsf{fma}\left(-4, a \cdot c, b \cdot b\right)\\
        t_1 := -4 \cdot \left(a \cdot c\right)\\
        t_2 := \mathsf{fma}\left({b}^{1}, {b}^{1}, t\_1\right)\\
        \mathbf{if}\;b \leq -7.5 \cdot 10^{-294}:\\
        \;\;\;\;\begin{array}{l}
        \mathbf{if}\;b \geq 0:\\
        \;\;\;\;\frac{-2 \cdot c}{\mathsf{fma}\left({\left({\left({\left(\mathsf{fma}\left(b, b, t\_1\right)\right)}^{0.5}\right)}^{2}\right)}^{-0.5}, {t\_2}^{1}, b\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{{t\_2}^{0.5} - b}{a} \cdot 0.5\\
        
        
        \end{array}\\
        
        \mathbf{elif}\;b \geq 0:\\
        \;\;\;\;\left(-1 \cdot 2\right) \cdot \frac{c}{b + {\left(b \cdot b - 4 \cdot \left(a \cdot c\right)\right)}^{0.5}}\\
        
        \mathbf{else}:\\
        \;\;\;\;0.5 \cdot \frac{{\left({t\_0}^{3}\right)}^{0.5} - \left(b \cdot b\right) \cdot b}{a \cdot \left(\mathsf{fma}\left(-4, a \cdot c, 2 \cdot \left(b \cdot b\right)\right) - -1 \cdot \left(b \cdot {t\_0}^{0.5}\right)\right)}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if b < -7.5000000000000004e-294

          1. Initial program 70.6%

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

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

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

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

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

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

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

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot c}{\mathsf{fma}\left({\left({\left({b}^{1} \cdot {b}^{1} + -4 \cdot \left(a \cdot c\right)\right)}^{\left(\frac{1}{2} + \frac{1}{2}\right)}\right)}^{\frac{-1}{2}}, {\left(\mathsf{fma}\left({b}^{\color{blue}{1}}, {b}^{1}, -4 \cdot \left(a \cdot c\right)\right)\right)}^{1}, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\mathsf{fma}\left({b}^{1}, {b}^{1}, -4 \cdot \left(a \cdot c\right)\right)\right)}^{\frac{1}{2}} - b}{a} \cdot \frac{1}{2}\\ \end{array} \]
            8. pow-prod-upN/A

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

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

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

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

          if -7.5000000000000004e-294 < b

          1. Initial program 75.9%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{2 \cdot c}{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(\left(b \cdot b\right) \cdot b, -1, {\left(\mathsf{fma}\left({b}^{1}, {b}^{1}, -4 \cdot \left(a \cdot c\right)\right)\right)}^{1.5}\right)}{\mathsf{fma}\left({b}^{1}, {b}^{1}, {\left(\mathsf{fma}\left({b}^{1}, {b}^{1}, -4 \cdot \left(a \cdot c\right)\right)\right)}^{0.5} \cdot {\left(\mathsf{fma}\left({b}^{1}, {b}^{1}, -4 \cdot \left(a \cdot c\right)\right)\right)}^{0.5} - \left(-1 \cdot b\right) \cdot {\left(\mathsf{fma}\left({b}^{1}, {b}^{1}, -4 \cdot \left(a \cdot c\right)\right)\right)}^{0.5}\right)}}{2 \cdot a}\\ \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}{-1 \cdot b - \sqrt{{b}^{2} - 4 \cdot \left(a \cdot c\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{2} \cdot \frac{\sqrt{{\left(-4 \cdot \left(a \cdot c\right) + {b}^{2}\right)}^{3}} + -1 \cdot {b}^{3}}{a \cdot \left(\left(-4 \cdot \left(a \cdot c\right) + 2 \cdot {b}^{2}\right) - -1 \cdot \left(b \cdot \sqrt{-4 \cdot \left(a \cdot c\right) + {b}^{2}}\right)\right)}\\ } \end{array}} \]
          5. Applied rewrites75.9%

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

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

        Alternative 6: 65.6% accurate, N/A× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left({b}^{1}, {b}^{1}, -4 \cdot \left(a \cdot c\right)\right)\\ \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot c}{\mathsf{fma}\left({t\_0}^{-0.5}, {t\_0}^{1}, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{{t\_0}^{0.5} - b}{a} \cdot 0.5\\ \end{array} \end{array} \]
        (FPCore (a b c)
         :precision binary64
         (let* ((t_0 (fma (pow b 1.0) (pow b 1.0) (* -4.0 (* a c)))))
           (if (>= b 0.0)
             (/ (* -2.0 c) (fma (pow t_0 -0.5) (pow t_0 1.0) b))
             (* (/ (- (pow t_0 0.5) b) a) 0.5))))
        double code(double a, double b, double c) {
        	double t_0 = fma(pow(b, 1.0), pow(b, 1.0), (-4.0 * (a * c)));
        	double tmp;
        	if (b >= 0.0) {
        		tmp = (-2.0 * c) / fma(pow(t_0, -0.5), pow(t_0, 1.0), b);
        	} else {
        		tmp = ((pow(t_0, 0.5) - b) / a) * 0.5;
        	}
        	return tmp;
        }
        
        function code(a, b, c)
        	t_0 = fma((b ^ 1.0), (b ^ 1.0), Float64(-4.0 * Float64(a * c)))
        	tmp = 0.0
        	if (b >= 0.0)
        		tmp = Float64(Float64(-2.0 * c) / fma((t_0 ^ -0.5), (t_0 ^ 1.0), b));
        	else
        		tmp = Float64(Float64(Float64((t_0 ^ 0.5) - b) / a) * 0.5);
        	end
        	return tmp
        end
        
        code[a_, b_, c_] := Block[{t$95$0 = N[(N[Power[b, 1.0], $MachinePrecision] * N[Power[b, 1.0], $MachinePrecision] + N[(-4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[GreaterEqual[b, 0.0], N[(N[(-2.0 * c), $MachinePrecision] / N[(N[Power[t$95$0, -0.5], $MachinePrecision] * N[Power[t$95$0, 1.0], $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Power[t$95$0, 0.5], $MachinePrecision] - b), $MachinePrecision] / a), $MachinePrecision] * 0.5), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \mathsf{fma}\left({b}^{1}, {b}^{1}, -4 \cdot \left(a \cdot c\right)\right)\\
        \mathbf{if}\;b \geq 0:\\
        \;\;\;\;\frac{-2 \cdot c}{\mathsf{fma}\left({t\_0}^{-0.5}, {t\_0}^{1}, b\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{{t\_0}^{0.5} - b}{a} \cdot 0.5\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Initial program 73.4%

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

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

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

        Alternative 7: 65.6% accurate, N/A× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := -4 \cdot \left(a \cdot c\right)\\ t_1 := \mathsf{fma}\left({b}^{1}, {b}^{1}, t\_0\right)\\ \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot c}{\mathsf{fma}\left({\left({\left({\left(\mathsf{fma}\left(b, b, t\_0\right)\right)}^{0.5}\right)}^{2}\right)}^{-0.5}, {t\_1}^{1}, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{{t\_1}^{0.5} - b}{a} \cdot 0.5\\ \end{array} \end{array} \]
        (FPCore (a b c)
         :precision binary64
         (let* ((t_0 (* -4.0 (* a c))) (t_1 (fma (pow b 1.0) (pow b 1.0) t_0)))
           (if (>= b 0.0)
             (/
              (* -2.0 c)
              (fma (pow (pow (pow (fma b b t_0) 0.5) 2.0) -0.5) (pow t_1 1.0) b))
             (* (/ (- (pow t_1 0.5) b) a) 0.5))))
        double code(double a, double b, double c) {
        	double t_0 = -4.0 * (a * c);
        	double t_1 = fma(pow(b, 1.0), pow(b, 1.0), t_0);
        	double tmp;
        	if (b >= 0.0) {
        		tmp = (-2.0 * c) / fma(pow(pow(pow(fma(b, b, t_0), 0.5), 2.0), -0.5), pow(t_1, 1.0), b);
        	} else {
        		tmp = ((pow(t_1, 0.5) - b) / a) * 0.5;
        	}
        	return tmp;
        }
        
        function code(a, b, c)
        	t_0 = Float64(-4.0 * Float64(a * c))
        	t_1 = fma((b ^ 1.0), (b ^ 1.0), t_0)
        	tmp = 0.0
        	if (b >= 0.0)
        		tmp = Float64(Float64(-2.0 * c) / fma((((fma(b, b, t_0) ^ 0.5) ^ 2.0) ^ -0.5), (t_1 ^ 1.0), b));
        	else
        		tmp = Float64(Float64(Float64((t_1 ^ 0.5) - b) / a) * 0.5);
        	end
        	return tmp
        end
        
        code[a_, b_, c_] := Block[{t$95$0 = N[(-4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[b, 1.0], $MachinePrecision] * N[Power[b, 1.0], $MachinePrecision] + t$95$0), $MachinePrecision]}, If[GreaterEqual[b, 0.0], N[(N[(-2.0 * c), $MachinePrecision] / N[(N[Power[N[Power[N[Power[N[(b * b + t$95$0), $MachinePrecision], 0.5], $MachinePrecision], 2.0], $MachinePrecision], -0.5], $MachinePrecision] * N[Power[t$95$1, 1.0], $MachinePrecision] + b), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Power[t$95$1, 0.5], $MachinePrecision] - b), $MachinePrecision] / a), $MachinePrecision] * 0.5), $MachinePrecision]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := -4 \cdot \left(a \cdot c\right)\\
        t_1 := \mathsf{fma}\left({b}^{1}, {b}^{1}, t\_0\right)\\
        \mathbf{if}\;b \geq 0:\\
        \;\;\;\;\frac{-2 \cdot c}{\mathsf{fma}\left({\left({\left({\left(\mathsf{fma}\left(b, b, t\_0\right)\right)}^{0.5}\right)}^{2}\right)}^{-0.5}, {t\_1}^{1}, b\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{{t\_1}^{0.5} - b}{a} \cdot 0.5\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Initial program 73.4%

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

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

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

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

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

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

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

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

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{-2 \cdot c}{\mathsf{fma}\left({\left({\left({b}^{1} \cdot {b}^{1} + -4 \cdot \left(a \cdot c\right)\right)}^{\left(\frac{1}{2} + \frac{1}{2}\right)}\right)}^{\frac{-1}{2}}, {\left(\mathsf{fma}\left({b}^{\color{blue}{1}}, {b}^{1}, -4 \cdot \left(a \cdot c\right)\right)\right)}^{1}, b\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{{\left(\mathsf{fma}\left({b}^{1}, {b}^{1}, -4 \cdot \left(a \cdot c\right)\right)\right)}^{\frac{1}{2}} - b}{a} \cdot \frac{1}{2}\\ \end{array} \]
          8. pow-prod-upN/A

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

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

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

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

        Reproduce

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