quadm (p42, negative)

Percentage Accurate: 52.5% → 87.2%
Time: 14.7s
Alternatives: 11
Speedup: 19.1×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))
double code(double a, double b, double c) {
	return (-b - sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a);
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (-b - sqrt(((b * b) - (4.0d0 * (a * c))))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
	return (-b - Math.sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a);
}
def code(a, b, c):
	return (-b - math.sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a)
function code(a, b, c)
	return Float64(Float64(Float64(-b) - sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(a * c))))) / Float64(2.0 * a))
end
function tmp = code(a, b, c)
	tmp = (-b - sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a);
end
code[a_, b_, c_] := N[(N[((-b) - N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}
\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 11 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: 52.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))
double code(double a, double b, double c) {
	return (-b - sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a);
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = (-b - sqrt(((b * b) - (4.0d0 * (a * c))))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
	return (-b - Math.sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a);
}
def code(a, b, c):
	return (-b - math.sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a)
function code(a, b, c)
	return Float64(Float64(Float64(-b) - sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(a * c))))) / Float64(2.0 * a))
end
function tmp = code(a, b, c)
	tmp = (-b - sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a);
end
code[a_, b_, c_] := N[(N[((-b) - N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a}
\end{array}

Alternative 1: 87.2% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;b \leq -3.9 \cdot 10^{-147}:\\
\;\;\;\;-0.5 \cdot \frac{\frac{c \cdot \left(a \cdot 4\right)}{b - t_0}}{a}\\

\mathbf{elif}\;b \leq 2.1 \cdot 10^{+25}:\\
\;\;\;\;-0.5 \cdot \frac{b + t_0}{a}\\

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


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

    1. Initial program 3.8%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around -inf 100.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/100.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-1100.0%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    4. Simplified100.0%

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

    if -4.1999999999999997e104 < b < -3.8999999999999998e-147

    1. Initial program 42.6%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Simplified42.6%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}} \]
    3. Step-by-step derivation
      1. fma-udef42.6%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{a \cdot \left(c \cdot -4\right) + b \cdot b}}}{a} \]
      2. associate-*r*42.6%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4} + b \cdot b}}{a} \]
      3. metadata-eval42.6%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(a \cdot c\right) \cdot \color{blue}{\left(-4\right)} + b \cdot b}}{a} \]
      4. distribute-rgt-neg-in42.6%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(-\left(a \cdot c\right) \cdot 4\right)} + b \cdot b}}{a} \]
      5. *-commutative42.6%

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}}{a} \]
      7. sub-neg42.6%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}{a} \]
      8. *-commutative42.6%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{b \cdot b - \color{blue}{\left(a \cdot c\right) \cdot 4}}}{a} \]
      9. associate-*l*42.6%

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

      \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b - a \cdot \left(c \cdot 4\right)}}}{a} \]
    5. Step-by-step derivation
      1. flip-+42.2%

        \[\leadsto -0.5 \cdot \frac{\color{blue}{\frac{b \cdot b - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)} \cdot \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}{b - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}}}{a} \]
      2. add-sqr-sqrt42.1%

        \[\leadsto -0.5 \cdot \frac{\frac{b \cdot b - \color{blue}{\left(b \cdot b - a \cdot \left(c \cdot 4\right)\right)}}{b - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}}{a} \]
    6. Applied egg-rr42.1%

      \[\leadsto -0.5 \cdot \frac{\color{blue}{\frac{b \cdot b - \left(b \cdot b - a \cdot \left(c \cdot 4\right)\right)}{b - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}}}{a} \]
    7. Taylor expanded in b around 0 72.6%

      \[\leadsto -0.5 \cdot \frac{\frac{\color{blue}{4 \cdot \left(c \cdot a\right)}}{b - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}}{a} \]
    8. Step-by-step derivation
      1. *-commutative72.6%

        \[\leadsto -0.5 \cdot \frac{\frac{\color{blue}{\left(c \cdot a\right) \cdot 4}}{b - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}}{a} \]
      2. associate-*l*72.7%

        \[\leadsto -0.5 \cdot \frac{\frac{\color{blue}{c \cdot \left(a \cdot 4\right)}}{b - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}}{a} \]
    9. Simplified72.7%

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

    if -3.8999999999999998e-147 < b < 2.0999999999999999e25

    1. Initial program 87.8%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Simplified87.8%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}} \]
    3. Step-by-step derivation
      1. fma-udef87.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{a \cdot \left(c \cdot -4\right) + b \cdot b}}}{a} \]
      2. associate-*r*87.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4} + b \cdot b}}{a} \]
      3. metadata-eval87.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(a \cdot c\right) \cdot \color{blue}{\left(-4\right)} + b \cdot b}}{a} \]
      4. distribute-rgt-neg-in87.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(-\left(a \cdot c\right) \cdot 4\right)} + b \cdot b}}{a} \]
      5. *-commutative87.8%

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}}{a} \]
      7. sub-neg87.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}{a} \]
      8. *-commutative87.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{b \cdot b - \color{blue}{\left(a \cdot c\right) \cdot 4}}}{a} \]
      9. associate-*l*87.8%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{b \cdot b - \color{blue}{a \cdot \left(c \cdot 4\right)}}}{a} \]
    4. Applied egg-rr87.8%

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

    if 2.0999999999999999e25 < b

    1. Initial program 58.2%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around inf 97.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    3. Step-by-step derivation
      1. associate-*r/97.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot b}{a}} \]
      2. mul-1-neg97.1%

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    4. Simplified97.1%

      \[\leadsto \color{blue}{\frac{-b}{a}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification89.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.2 \cdot 10^{+104}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq -3.9 \cdot 10^{-147}:\\ \;\;\;\;-0.5 \cdot \frac{\frac{c \cdot \left(a \cdot 4\right)}{b - \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}}{a}\\ \mathbf{elif}\;b \leq 2.1 \cdot 10^{+25}:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]

Alternative 2: 84.9% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-c}{b}\\ t_1 := -0.5 \cdot \frac{b + \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}{a}\\ \mathbf{if}\;b \leq -3 \cdot 10^{-45}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -6.2 \cdot 10^{-106}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -1.32 \cdot 10^{-129}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 2.1 \cdot 10^{+25}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (/ (- c) b))
        (t_1 (* -0.5 (/ (+ b (sqrt (- (* b b) (* a (* c 4.0))))) a))))
   (if (<= b -3e-45)
     t_0
     (if (<= b -6.2e-106)
       t_1
       (if (<= b -1.32e-129) t_0 (if (<= b 2.1e+25) t_1 (/ (- b) a)))))))
double code(double a, double b, double c) {
	double t_0 = -c / b;
	double t_1 = -0.5 * ((b + sqrt(((b * b) - (a * (c * 4.0))))) / a);
	double tmp;
	if (b <= -3e-45) {
		tmp = t_0;
	} else if (b <= -6.2e-106) {
		tmp = t_1;
	} else if (b <= -1.32e-129) {
		tmp = t_0;
	} else if (b <= 2.1e+25) {
		tmp = t_1;
	} else {
		tmp = -b / a;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = -c / b
    t_1 = (-0.5d0) * ((b + sqrt(((b * b) - (a * (c * 4.0d0))))) / a)
    if (b <= (-3d-45)) then
        tmp = t_0
    else if (b <= (-6.2d-106)) then
        tmp = t_1
    else if (b <= (-1.32d-129)) then
        tmp = t_0
    else if (b <= 2.1d+25) then
        tmp = t_1
    else
        tmp = -b / a
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = -c / b;
	double t_1 = -0.5 * ((b + Math.sqrt(((b * b) - (a * (c * 4.0))))) / a);
	double tmp;
	if (b <= -3e-45) {
		tmp = t_0;
	} else if (b <= -6.2e-106) {
		tmp = t_1;
	} else if (b <= -1.32e-129) {
		tmp = t_0;
	} else if (b <= 2.1e+25) {
		tmp = t_1;
	} else {
		tmp = -b / a;
	}
	return tmp;
}
def code(a, b, c):
	t_0 = -c / b
	t_1 = -0.5 * ((b + math.sqrt(((b * b) - (a * (c * 4.0))))) / a)
	tmp = 0
	if b <= -3e-45:
		tmp = t_0
	elif b <= -6.2e-106:
		tmp = t_1
	elif b <= -1.32e-129:
		tmp = t_0
	elif b <= 2.1e+25:
		tmp = t_1
	else:
		tmp = -b / a
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(-c) / b)
	t_1 = Float64(-0.5 * Float64(Float64(b + sqrt(Float64(Float64(b * b) - Float64(a * Float64(c * 4.0))))) / a))
	tmp = 0.0
	if (b <= -3e-45)
		tmp = t_0;
	elseif (b <= -6.2e-106)
		tmp = t_1;
	elseif (b <= -1.32e-129)
		tmp = t_0;
	elseif (b <= 2.1e+25)
		tmp = t_1;
	else
		tmp = Float64(Float64(-b) / a);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = -c / b;
	t_1 = -0.5 * ((b + sqrt(((b * b) - (a * (c * 4.0))))) / a);
	tmp = 0.0;
	if (b <= -3e-45)
		tmp = t_0;
	elseif (b <= -6.2e-106)
		tmp = t_1;
	elseif (b <= -1.32e-129)
		tmp = t_0;
	elseif (b <= 2.1e+25)
		tmp = t_1;
	else
		tmp = -b / a;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[((-c) / b), $MachinePrecision]}, Block[{t$95$1 = N[(-0.5 * N[(N[(b + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(a * N[(c * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3e-45], t$95$0, If[LessEqual[b, -6.2e-106], t$95$1, If[LessEqual[b, -1.32e-129], t$95$0, If[LessEqual[b, 2.1e+25], t$95$1, N[((-b) / a), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq -6.2 \cdot 10^{-106}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq -1.32 \cdot 10^{-129}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;b \leq 2.1 \cdot 10^{+25}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -3.00000000000000011e-45 or -6.19999999999999971e-106 < b < -1.31999999999999992e-129

    1. Initial program 17.2%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around -inf 86.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/86.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-186.3%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    4. Simplified86.3%

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

    if -3.00000000000000011e-45 < b < -6.19999999999999971e-106 or -1.31999999999999992e-129 < b < 2.0999999999999999e25

    1. Initial program 84.4%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Simplified84.4%

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{a \cdot \left(c \cdot -4\right) + b \cdot b}}}{a} \]
      2. associate-*r*84.4%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4} + b \cdot b}}{a} \]
      3. metadata-eval84.4%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(a \cdot c\right) \cdot \color{blue}{\left(-4\right)} + b \cdot b}}{a} \]
      4. distribute-rgt-neg-in84.4%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(-\left(a \cdot c\right) \cdot 4\right)} + b \cdot b}}{a} \]
      5. *-commutative84.4%

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}}{a} \]
      7. sub-neg84.4%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}{a} \]
      8. *-commutative84.4%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{b \cdot b - \color{blue}{\left(a \cdot c\right) \cdot 4}}}{a} \]
      9. associate-*l*84.4%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{b \cdot b - \color{blue}{a \cdot \left(c \cdot 4\right)}}}{a} \]
    4. Applied egg-rr84.4%

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

    if 2.0999999999999999e25 < b

    1. Initial program 58.2%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around inf 97.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    3. Step-by-step derivation
      1. associate-*r/97.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot b}{a}} \]
      2. mul-1-neg97.1%

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    4. Simplified97.1%

      \[\leadsto \color{blue}{\frac{-b}{a}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification88.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3 \cdot 10^{-45}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq -6.2 \cdot 10^{-106}:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}{a}\\ \mathbf{elif}\;b \leq -1.32 \cdot 10^{-129}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 2.1 \cdot 10^{+25}:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{b \cdot b - a \cdot \left(c \cdot 4\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]

Alternative 3: 80.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-c}{b}\\ t_1 := -0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{c \cdot \left(a \cdot -4\right)}}{a}\right)\\ \mathbf{if}\;b \leq -2.6 \cdot 10^{-45}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -6.2 \cdot 10^{-106}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -1.32 \cdot 10^{-129}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 9.5 \cdot 10^{-53}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (/ (- c) b))
        (t_1 (* -0.5 (+ (/ b a) (/ (sqrt (* c (* a -4.0))) a)))))
   (if (<= b -2.6e-45)
     t_0
     (if (<= b -6.2e-106)
       t_1
       (if (<= b -1.32e-129)
         t_0
         (if (<= b 9.5e-53) t_1 (- (/ c b) (/ b a))))))))
double code(double a, double b, double c) {
	double t_0 = -c / b;
	double t_1 = -0.5 * ((b / a) + (sqrt((c * (a * -4.0))) / a));
	double tmp;
	if (b <= -2.6e-45) {
		tmp = t_0;
	} else if (b <= -6.2e-106) {
		tmp = t_1;
	} else if (b <= -1.32e-129) {
		tmp = t_0;
	} else if (b <= 9.5e-53) {
		tmp = t_1;
	} else {
		tmp = (c / b) - (b / a);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = -c / b
    t_1 = (-0.5d0) * ((b / a) + (sqrt((c * (a * (-4.0d0)))) / a))
    if (b <= (-2.6d-45)) then
        tmp = t_0
    else if (b <= (-6.2d-106)) then
        tmp = t_1
    else if (b <= (-1.32d-129)) then
        tmp = t_0
    else if (b <= 9.5d-53) then
        tmp = t_1
    else
        tmp = (c / b) - (b / a)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = -c / b;
	double t_1 = -0.5 * ((b / a) + (Math.sqrt((c * (a * -4.0))) / a));
	double tmp;
	if (b <= -2.6e-45) {
		tmp = t_0;
	} else if (b <= -6.2e-106) {
		tmp = t_1;
	} else if (b <= -1.32e-129) {
		tmp = t_0;
	} else if (b <= 9.5e-53) {
		tmp = t_1;
	} else {
		tmp = (c / b) - (b / a);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = -c / b
	t_1 = -0.5 * ((b / a) + (math.sqrt((c * (a * -4.0))) / a))
	tmp = 0
	if b <= -2.6e-45:
		tmp = t_0
	elif b <= -6.2e-106:
		tmp = t_1
	elif b <= -1.32e-129:
		tmp = t_0
	elif b <= 9.5e-53:
		tmp = t_1
	else:
		tmp = (c / b) - (b / a)
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(-c) / b)
	t_1 = Float64(-0.5 * Float64(Float64(b / a) + Float64(sqrt(Float64(c * Float64(a * -4.0))) / a)))
	tmp = 0.0
	if (b <= -2.6e-45)
		tmp = t_0;
	elseif (b <= -6.2e-106)
		tmp = t_1;
	elseif (b <= -1.32e-129)
		tmp = t_0;
	elseif (b <= 9.5e-53)
		tmp = t_1;
	else
		tmp = Float64(Float64(c / b) - Float64(b / a));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = -c / b;
	t_1 = -0.5 * ((b / a) + (sqrt((c * (a * -4.0))) / a));
	tmp = 0.0;
	if (b <= -2.6e-45)
		tmp = t_0;
	elseif (b <= -6.2e-106)
		tmp = t_1;
	elseif (b <= -1.32e-129)
		tmp = t_0;
	elseif (b <= 9.5e-53)
		tmp = t_1;
	else
		tmp = (c / b) - (b / a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[((-c) / b), $MachinePrecision]}, Block[{t$95$1 = N[(-0.5 * N[(N[(b / a), $MachinePrecision] + N[(N[Sqrt[N[(c * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.6e-45], t$95$0, If[LessEqual[b, -6.2e-106], t$95$1, If[LessEqual[b, -1.32e-129], t$95$0, If[LessEqual[b, 9.5e-53], t$95$1, N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq -6.2 \cdot 10^{-106}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq -1.32 \cdot 10^{-129}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;b \leq 9.5 \cdot 10^{-53}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -2.59999999999999987e-45 or -6.19999999999999971e-106 < b < -1.31999999999999992e-129

    1. Initial program 17.2%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around -inf 86.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/86.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-186.3%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    4. Simplified86.3%

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

    if -2.59999999999999987e-45 < b < -6.19999999999999971e-106 or -1.31999999999999992e-129 < b < 9.5000000000000008e-53

    1. Initial program 81.5%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Simplified81.5%

      \[\leadsto \color{blue}{-0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}{a}} \]
    3. Step-by-step derivation
      1. fma-udef81.5%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{a \cdot \left(c \cdot -4\right) + b \cdot b}}}{a} \]
      2. associate-*r*81.5%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4} + b \cdot b}}{a} \]
      3. metadata-eval81.5%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(a \cdot c\right) \cdot \color{blue}{\left(-4\right)} + b \cdot b}}{a} \]
      4. distribute-rgt-neg-in81.5%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(-\left(a \cdot c\right) \cdot 4\right)} + b \cdot b}}{a} \]
      5. *-commutative81.5%

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}}{a} \]
      7. sub-neg81.5%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}{a} \]
      8. prod-diff81.3%

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

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

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

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

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

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

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

      \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right) + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}}{a} \]
    5. Step-by-step derivation
      1. fma-udef81.3%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + b \cdot b\right)} + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}{a} \]
      2. *-commutative81.3%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(a \cdot \color{blue}{\left(-4 \cdot c\right)} + b \cdot b\right) + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}{a} \]
      3. associate-*l*81.3%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(\color{blue}{\left(a \cdot -4\right) \cdot c} + b \cdot b\right) + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}{a} \]
      4. +-commutative81.3%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(b \cdot b + \left(a \cdot -4\right) \cdot c\right)} + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}{a} \]
      5. fma-def81.3%

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

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

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right) + 2 \cdot \color{blue}{\mathsf{fma}\left(a \cdot -4, c, a \cdot \left(c \cdot 4\right)\right)}}}{a} \]
      9. associate-*r*81.3%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right) + 2 \cdot \mathsf{fma}\left(a \cdot -4, c, \color{blue}{\left(a \cdot c\right) \cdot 4}\right)}}{a} \]
      10. *-commutative81.3%

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

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

      \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{b}{a} + \sqrt{2 \cdot \left(-4 \cdot \left(c \cdot a\right) + 4 \cdot \left(c \cdot a\right)\right) + -4 \cdot \left(c \cdot a\right)} \cdot \frac{1}{a}\right)} \]
    8. Step-by-step derivation
      1. *-un-lft-identity77.2%

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

        \[\leadsto -0.5 \cdot \left(1 \cdot \color{blue}{\left(\sqrt{2 \cdot \left(-4 \cdot \left(c \cdot a\right) + 4 \cdot \left(c \cdot a\right)\right) + -4 \cdot \left(c \cdot a\right)} \cdot \frac{1}{a} + \frac{b}{a}\right)}\right) \]
      3. un-div-inv77.2%

        \[\leadsto -0.5 \cdot \left(1 \cdot \left(\color{blue}{\frac{\sqrt{2 \cdot \left(-4 \cdot \left(c \cdot a\right) + 4 \cdot \left(c \cdot a\right)\right) + -4 \cdot \left(c \cdot a\right)}}{a}} + \frac{b}{a}\right)\right) \]
      4. fma-def77.2%

        \[\leadsto -0.5 \cdot \left(1 \cdot \left(\frac{\sqrt{\color{blue}{\mathsf{fma}\left(2, -4 \cdot \left(c \cdot a\right) + 4 \cdot \left(c \cdot a\right), -4 \cdot \left(c \cdot a\right)\right)}}}{a} + \frac{b}{a}\right)\right) \]
      5. distribute-rgt-out77.2%

        \[\leadsto -0.5 \cdot \left(1 \cdot \left(\frac{\sqrt{\mathsf{fma}\left(2, \color{blue}{\left(c \cdot a\right) \cdot \left(-4 + 4\right)}, -4 \cdot \left(c \cdot a\right)\right)}}{a} + \frac{b}{a}\right)\right) \]
      6. *-commutative77.2%

        \[\leadsto -0.5 \cdot \left(1 \cdot \left(\frac{\sqrt{\mathsf{fma}\left(2, \color{blue}{\left(a \cdot c\right)} \cdot \left(-4 + 4\right), -4 \cdot \left(c \cdot a\right)\right)}}{a} + \frac{b}{a}\right)\right) \]
      7. metadata-eval77.2%

        \[\leadsto -0.5 \cdot \left(1 \cdot \left(\frac{\sqrt{\mathsf{fma}\left(2, \left(a \cdot c\right) \cdot \color{blue}{0}, -4 \cdot \left(c \cdot a\right)\right)}}{a} + \frac{b}{a}\right)\right) \]
      8. *-commutative77.2%

        \[\leadsto -0.5 \cdot \left(1 \cdot \left(\frac{\sqrt{\mathsf{fma}\left(2, \left(a \cdot c\right) \cdot 0, -4 \cdot \color{blue}{\left(a \cdot c\right)}\right)}}{a} + \frac{b}{a}\right)\right) \]
    9. Applied egg-rr77.2%

      \[\leadsto -0.5 \cdot \color{blue}{\left(1 \cdot \left(\frac{\sqrt{\mathsf{fma}\left(2, \left(a \cdot c\right) \cdot 0, -4 \cdot \left(a \cdot c\right)\right)}}{a} + \frac{b}{a}\right)\right)} \]
    10. Step-by-step derivation
      1. *-lft-identity77.2%

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

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

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{\color{blue}{2 \cdot \left(\left(a \cdot c\right) \cdot 0\right) + -4 \cdot \left(a \cdot c\right)}}}{a}\right) \]
      4. mul0-rgt77.4%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{2 \cdot \color{blue}{0} + -4 \cdot \left(a \cdot c\right)}}{a}\right) \]
      5. metadata-eval77.4%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{\color{blue}{0} + -4 \cdot \left(a \cdot c\right)}}{a}\right) \]
      6. +-lft-identity77.4%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{\color{blue}{-4 \cdot \left(a \cdot c\right)}}}{a}\right) \]
      7. associate-*r*77.4%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{\color{blue}{\left(-4 \cdot a\right) \cdot c}}}{a}\right) \]
      8. *-commutative77.4%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{\color{blue}{c \cdot \left(-4 \cdot a\right)}}}{a}\right) \]
      9. *-commutative77.4%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{c \cdot \color{blue}{\left(a \cdot -4\right)}}}{a}\right) \]
    11. Simplified77.4%

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

    if 9.5000000000000008e-53 < b

    1. Initial program 66.1%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around inf 93.4%

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

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      2. unsub-neg93.4%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    4. Simplified93.4%

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification85.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.6 \cdot 10^{-45}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq -6.2 \cdot 10^{-106}:\\ \;\;\;\;-0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{c \cdot \left(a \cdot -4\right)}}{a}\right)\\ \mathbf{elif}\;b \leq -1.32 \cdot 10^{-129}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 9.5 \cdot 10^{-53}:\\ \;\;\;\;-0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{c \cdot \left(a \cdot -4\right)}}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]

Alternative 4: 80.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;b \leq -6.5 \cdot 10^{-106}:\\
\;\;\;\;-0.5 \cdot \left(\frac{b}{a} + t_0 \cdot \frac{1}{a}\right)\\

\mathbf{elif}\;b \leq -1.16 \cdot 10^{-129}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 4.4 \cdot 10^{-51}:\\
\;\;\;\;-0.5 \cdot \left(\frac{b}{a} + \frac{t_0}{a}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -2.2999999999999999e-43 or -6.4999999999999997e-106 < b < -1.16e-129

    1. Initial program 17.2%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around -inf 86.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/86.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-186.3%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    4. Simplified86.3%

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

    if -2.2999999999999999e-43 < b < -6.4999999999999997e-106

    1. Initial program 62.7%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Simplified62.7%

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{a \cdot \left(c \cdot -4\right) + b \cdot b}}}{a} \]
      2. associate-*r*62.7%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4} + b \cdot b}}{a} \]
      3. metadata-eval62.7%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(a \cdot c\right) \cdot \color{blue}{\left(-4\right)} + b \cdot b}}{a} \]
      4. distribute-rgt-neg-in62.7%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(-\left(a \cdot c\right) \cdot 4\right)} + b \cdot b}}{a} \]
      5. *-commutative62.7%

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}}{a} \]
      7. sub-neg62.7%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}{a} \]
      8. prod-diff62.3%

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

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

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

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

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

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

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

      \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right) + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}}{a} \]
    5. Step-by-step derivation
      1. fma-udef62.3%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + b \cdot b\right)} + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}{a} \]
      2. *-commutative62.3%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(a \cdot \color{blue}{\left(-4 \cdot c\right)} + b \cdot b\right) + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}{a} \]
      3. associate-*l*62.3%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(\color{blue}{\left(a \cdot -4\right) \cdot c} + b \cdot b\right) + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}{a} \]
      4. +-commutative62.3%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(b \cdot b + \left(a \cdot -4\right) \cdot c\right)} + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}{a} \]
      5. fma-def62.3%

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

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

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right) + 2 \cdot \color{blue}{\mathsf{fma}\left(a \cdot -4, c, a \cdot \left(c \cdot 4\right)\right)}}}{a} \]
      9. associate-*r*62.5%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right) + 2 \cdot \mathsf{fma}\left(a \cdot -4, c, \color{blue}{\left(a \cdot c\right) \cdot 4}\right)}}{a} \]
      10. *-commutative62.5%

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

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

      \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{b}{a} + \sqrt{2 \cdot \left(-4 \cdot \left(c \cdot a\right) + 4 \cdot \left(c \cdot a\right)\right) + -4 \cdot \left(c \cdot a\right)} \cdot \frac{1}{a}\right)} \]
    8. Step-by-step derivation
      1. *-un-lft-identity60.5%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \color{blue}{\left(1 \cdot \sqrt{2 \cdot \left(-4 \cdot \left(c \cdot a\right) + 4 \cdot \left(c \cdot a\right)\right) + -4 \cdot \left(c \cdot a\right)}\right)} \cdot \frac{1}{a}\right) \]
      2. fma-def60.5%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \left(1 \cdot \sqrt{\color{blue}{\mathsf{fma}\left(2, -4 \cdot \left(c \cdot a\right) + 4 \cdot \left(c \cdot a\right), -4 \cdot \left(c \cdot a\right)\right)}}\right) \cdot \frac{1}{a}\right) \]
      3. distribute-rgt-out60.5%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \left(1 \cdot \sqrt{\mathsf{fma}\left(2, \color{blue}{\left(c \cdot a\right) \cdot \left(-4 + 4\right)}, -4 \cdot \left(c \cdot a\right)\right)}\right) \cdot \frac{1}{a}\right) \]
      4. *-commutative60.5%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \left(1 \cdot \sqrt{\mathsf{fma}\left(2, \color{blue}{\left(a \cdot c\right)} \cdot \left(-4 + 4\right), -4 \cdot \left(c \cdot a\right)\right)}\right) \cdot \frac{1}{a}\right) \]
      5. metadata-eval60.5%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \left(1 \cdot \sqrt{\mathsf{fma}\left(2, \left(a \cdot c\right) \cdot \color{blue}{0}, -4 \cdot \left(c \cdot a\right)\right)}\right) \cdot \frac{1}{a}\right) \]
      6. *-commutative60.5%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \left(1 \cdot \sqrt{\mathsf{fma}\left(2, \left(a \cdot c\right) \cdot 0, -4 \cdot \color{blue}{\left(a \cdot c\right)}\right)}\right) \cdot \frac{1}{a}\right) \]
    9. Applied egg-rr60.5%

      \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \color{blue}{\left(1 \cdot \sqrt{\mathsf{fma}\left(2, \left(a \cdot c\right) \cdot 0, -4 \cdot \left(a \cdot c\right)\right)}\right)} \cdot \frac{1}{a}\right) \]
    10. Step-by-step derivation
      1. *-lft-identity60.5%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \color{blue}{\sqrt{\mathsf{fma}\left(2, \left(a \cdot c\right) \cdot 0, -4 \cdot \left(a \cdot c\right)\right)}} \cdot \frac{1}{a}\right) \]
      2. fma-udef60.5%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \sqrt{\color{blue}{2 \cdot \left(\left(a \cdot c\right) \cdot 0\right) + -4 \cdot \left(a \cdot c\right)}} \cdot \frac{1}{a}\right) \]
      3. mul0-rgt60.9%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \sqrt{2 \cdot \color{blue}{0} + -4 \cdot \left(a \cdot c\right)} \cdot \frac{1}{a}\right) \]
      4. metadata-eval60.9%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \sqrt{\color{blue}{0} + -4 \cdot \left(a \cdot c\right)} \cdot \frac{1}{a}\right) \]
      5. +-lft-identity60.9%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \sqrt{\color{blue}{-4 \cdot \left(a \cdot c\right)}} \cdot \frac{1}{a}\right) \]
      6. associate-*r*60.9%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \sqrt{\color{blue}{\left(-4 \cdot a\right) \cdot c}} \cdot \frac{1}{a}\right) \]
      7. *-commutative60.9%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \sqrt{\color{blue}{c \cdot \left(-4 \cdot a\right)}} \cdot \frac{1}{a}\right) \]
      8. *-commutative60.9%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \sqrt{c \cdot \color{blue}{\left(a \cdot -4\right)}} \cdot \frac{1}{a}\right) \]
    11. Simplified60.9%

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

    if -1.16e-129 < b < 4.4e-51

    1. Initial program 85.1%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Simplified85.1%

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{a \cdot \left(c \cdot -4\right) + b \cdot b}}}{a} \]
      2. associate-*r*85.1%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4} + b \cdot b}}{a} \]
      3. metadata-eval85.1%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(a \cdot c\right) \cdot \color{blue}{\left(-4\right)} + b \cdot b}}{a} \]
      4. distribute-rgt-neg-in85.1%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(-\left(a \cdot c\right) \cdot 4\right)} + b \cdot b}}{a} \]
      5. *-commutative85.1%

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}}{a} \]
      7. sub-neg85.1%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}{a} \]
      8. prod-diff84.9%

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

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

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

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

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

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

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

      \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right) + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}}{a} \]
    5. Step-by-step derivation
      1. fma-udef84.9%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + b \cdot b\right)} + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}{a} \]
      2. *-commutative84.9%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(a \cdot \color{blue}{\left(-4 \cdot c\right)} + b \cdot b\right) + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}{a} \]
      3. associate-*l*84.9%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(\color{blue}{\left(a \cdot -4\right) \cdot c} + b \cdot b\right) + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}{a} \]
      4. +-commutative84.9%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(b \cdot b + \left(a \cdot -4\right) \cdot c\right)} + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}{a} \]
      5. fma-def84.9%

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

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

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right) + 2 \cdot \color{blue}{\mathsf{fma}\left(a \cdot -4, c, a \cdot \left(c \cdot 4\right)\right)}}}{a} \]
      9. associate-*r*84.9%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right) + 2 \cdot \mathsf{fma}\left(a \cdot -4, c, \color{blue}{\left(a \cdot c\right) \cdot 4}\right)}}{a} \]
      10. *-commutative84.9%

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

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

      \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{b}{a} + \sqrt{2 \cdot \left(-4 \cdot \left(c \cdot a\right) + 4 \cdot \left(c \cdot a\right)\right) + -4 \cdot \left(c \cdot a\right)} \cdot \frac{1}{a}\right)} \]
    8. Step-by-step derivation
      1. *-un-lft-identity80.4%

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

        \[\leadsto -0.5 \cdot \left(1 \cdot \color{blue}{\left(\sqrt{2 \cdot \left(-4 \cdot \left(c \cdot a\right) + 4 \cdot \left(c \cdot a\right)\right) + -4 \cdot \left(c \cdot a\right)} \cdot \frac{1}{a} + \frac{b}{a}\right)}\right) \]
      3. un-div-inv80.4%

        \[\leadsto -0.5 \cdot \left(1 \cdot \left(\color{blue}{\frac{\sqrt{2 \cdot \left(-4 \cdot \left(c \cdot a\right) + 4 \cdot \left(c \cdot a\right)\right) + -4 \cdot \left(c \cdot a\right)}}{a}} + \frac{b}{a}\right)\right) \]
      4. fma-def80.4%

        \[\leadsto -0.5 \cdot \left(1 \cdot \left(\frac{\sqrt{\color{blue}{\mathsf{fma}\left(2, -4 \cdot \left(c \cdot a\right) + 4 \cdot \left(c \cdot a\right), -4 \cdot \left(c \cdot a\right)\right)}}}{a} + \frac{b}{a}\right)\right) \]
      5. distribute-rgt-out80.4%

        \[\leadsto -0.5 \cdot \left(1 \cdot \left(\frac{\sqrt{\mathsf{fma}\left(2, \color{blue}{\left(c \cdot a\right) \cdot \left(-4 + 4\right)}, -4 \cdot \left(c \cdot a\right)\right)}}{a} + \frac{b}{a}\right)\right) \]
      6. *-commutative80.4%

        \[\leadsto -0.5 \cdot \left(1 \cdot \left(\frac{\sqrt{\mathsf{fma}\left(2, \color{blue}{\left(a \cdot c\right)} \cdot \left(-4 + 4\right), -4 \cdot \left(c \cdot a\right)\right)}}{a} + \frac{b}{a}\right)\right) \]
      7. metadata-eval80.4%

        \[\leadsto -0.5 \cdot \left(1 \cdot \left(\frac{\sqrt{\mathsf{fma}\left(2, \left(a \cdot c\right) \cdot \color{blue}{0}, -4 \cdot \left(c \cdot a\right)\right)}}{a} + \frac{b}{a}\right)\right) \]
      8. *-commutative80.4%

        \[\leadsto -0.5 \cdot \left(1 \cdot \left(\frac{\sqrt{\mathsf{fma}\left(2, \left(a \cdot c\right) \cdot 0, -4 \cdot \color{blue}{\left(a \cdot c\right)}\right)}}{a} + \frac{b}{a}\right)\right) \]
    9. Applied egg-rr80.4%

      \[\leadsto -0.5 \cdot \color{blue}{\left(1 \cdot \left(\frac{\sqrt{\mathsf{fma}\left(2, \left(a \cdot c\right) \cdot 0, -4 \cdot \left(a \cdot c\right)\right)}}{a} + \frac{b}{a}\right)\right)} \]
    10. Step-by-step derivation
      1. *-lft-identity80.4%

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

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

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{\color{blue}{2 \cdot \left(\left(a \cdot c\right) \cdot 0\right) + -4 \cdot \left(a \cdot c\right)}}}{a}\right) \]
      4. mul0-rgt80.5%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{2 \cdot \color{blue}{0} + -4 \cdot \left(a \cdot c\right)}}{a}\right) \]
      5. metadata-eval80.5%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{\color{blue}{0} + -4 \cdot \left(a \cdot c\right)}}{a}\right) \]
      6. +-lft-identity80.5%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{\color{blue}{-4 \cdot \left(a \cdot c\right)}}}{a}\right) \]
      7. associate-*r*80.5%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{\color{blue}{\left(-4 \cdot a\right) \cdot c}}}{a}\right) \]
      8. *-commutative80.5%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{\color{blue}{c \cdot \left(-4 \cdot a\right)}}}{a}\right) \]
      9. *-commutative80.5%

        \[\leadsto -0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{c \cdot \color{blue}{\left(a \cdot -4\right)}}}{a}\right) \]
    11. Simplified80.5%

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

    if 4.4e-51 < b

    1. Initial program 66.1%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around inf 93.4%

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

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      2. unsub-neg93.4%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    4. Simplified93.4%

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification85.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.3 \cdot 10^{-43}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq -6.5 \cdot 10^{-106}:\\ \;\;\;\;-0.5 \cdot \left(\frac{b}{a} + \sqrt{c \cdot \left(a \cdot -4\right)} \cdot \frac{1}{a}\right)\\ \mathbf{elif}\;b \leq -1.16 \cdot 10^{-129}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 4.4 \cdot 10^{-51}:\\ \;\;\;\;-0.5 \cdot \left(\frac{b}{a} + \frac{\sqrt{c \cdot \left(a \cdot -4\right)}}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]

Alternative 5: 80.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-c}{b}\\ t_1 := -0.5 \cdot \frac{b + \sqrt{-4 \cdot \left(c \cdot a\right)}}{a}\\ \mathbf{if}\;b \leq -3.5 \cdot 10^{-45}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq -6.2 \cdot 10^{-106}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq -1.08 \cdot 10^{-131}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;b \leq 2.1 \cdot 10^{-53}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (/ (- c) b)) (t_1 (* -0.5 (/ (+ b (sqrt (* -4.0 (* c a)))) a))))
   (if (<= b -3.5e-45)
     t_0
     (if (<= b -6.2e-106)
       t_1
       (if (<= b -1.08e-131)
         t_0
         (if (<= b 2.1e-53) t_1 (- (/ c b) (/ b a))))))))
double code(double a, double b, double c) {
	double t_0 = -c / b;
	double t_1 = -0.5 * ((b + sqrt((-4.0 * (c * a)))) / a);
	double tmp;
	if (b <= -3.5e-45) {
		tmp = t_0;
	} else if (b <= -6.2e-106) {
		tmp = t_1;
	} else if (b <= -1.08e-131) {
		tmp = t_0;
	} else if (b <= 2.1e-53) {
		tmp = t_1;
	} else {
		tmp = (c / b) - (b / a);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = -c / b
    t_1 = (-0.5d0) * ((b + sqrt(((-4.0d0) * (c * a)))) / a)
    if (b <= (-3.5d-45)) then
        tmp = t_0
    else if (b <= (-6.2d-106)) then
        tmp = t_1
    else if (b <= (-1.08d-131)) then
        tmp = t_0
    else if (b <= 2.1d-53) then
        tmp = t_1
    else
        tmp = (c / b) - (b / a)
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double t_0 = -c / b;
	double t_1 = -0.5 * ((b + Math.sqrt((-4.0 * (c * a)))) / a);
	double tmp;
	if (b <= -3.5e-45) {
		tmp = t_0;
	} else if (b <= -6.2e-106) {
		tmp = t_1;
	} else if (b <= -1.08e-131) {
		tmp = t_0;
	} else if (b <= 2.1e-53) {
		tmp = t_1;
	} else {
		tmp = (c / b) - (b / a);
	}
	return tmp;
}
def code(a, b, c):
	t_0 = -c / b
	t_1 = -0.5 * ((b + math.sqrt((-4.0 * (c * a)))) / a)
	tmp = 0
	if b <= -3.5e-45:
		tmp = t_0
	elif b <= -6.2e-106:
		tmp = t_1
	elif b <= -1.08e-131:
		tmp = t_0
	elif b <= 2.1e-53:
		tmp = t_1
	else:
		tmp = (c / b) - (b / a)
	return tmp
function code(a, b, c)
	t_0 = Float64(Float64(-c) / b)
	t_1 = Float64(-0.5 * Float64(Float64(b + sqrt(Float64(-4.0 * Float64(c * a)))) / a))
	tmp = 0.0
	if (b <= -3.5e-45)
		tmp = t_0;
	elseif (b <= -6.2e-106)
		tmp = t_1;
	elseif (b <= -1.08e-131)
		tmp = t_0;
	elseif (b <= 2.1e-53)
		tmp = t_1;
	else
		tmp = Float64(Float64(c / b) - Float64(b / a));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	t_0 = -c / b;
	t_1 = -0.5 * ((b + sqrt((-4.0 * (c * a)))) / a);
	tmp = 0.0;
	if (b <= -3.5e-45)
		tmp = t_0;
	elseif (b <= -6.2e-106)
		tmp = t_1;
	elseif (b <= -1.08e-131)
		tmp = t_0;
	elseif (b <= 2.1e-53)
		tmp = t_1;
	else
		tmp = (c / b) - (b / a);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := Block[{t$95$0 = N[((-c) / b), $MachinePrecision]}, Block[{t$95$1 = N[(-0.5 * N[(N[(b + N[Sqrt[N[(-4.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.5e-45], t$95$0, If[LessEqual[b, -6.2e-106], t$95$1, If[LessEqual[b, -1.08e-131], t$95$0, If[LessEqual[b, 2.1e-53], t$95$1, N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;b \leq -6.2 \cdot 10^{-106}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq -1.08 \cdot 10^{-131}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;b \leq 2.1 \cdot 10^{-53}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -3.5e-45 or -6.19999999999999971e-106 < b < -1.07999999999999996e-131

    1. Initial program 17.2%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around -inf 86.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/86.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-186.3%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    4. Simplified86.3%

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

    if -3.5e-45 < b < -6.19999999999999971e-106 or -1.07999999999999996e-131 < b < 2.09999999999999977e-53

    1. Initial program 81.5%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Simplified81.5%

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

      \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{-4 \cdot \left(c \cdot a\right)}}}{a} \]
    4. Step-by-step derivation
      1. *-commutative77.4%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(c \cdot a\right) \cdot -4}}}{a} \]
    5. Simplified77.4%

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

    if 2.09999999999999977e-53 < b

    1. Initial program 66.1%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around inf 93.4%

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

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      2. unsub-neg93.4%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    4. Simplified93.4%

      \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification85.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.5 \cdot 10^{-45}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq -6.2 \cdot 10^{-106}:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{-4 \cdot \left(c \cdot a\right)}}{a}\\ \mathbf{elif}\;b \leq -1.08 \cdot 10^{-131}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 2.1 \cdot 10^{-53}:\\ \;\;\;\;-0.5 \cdot \frac{b + \sqrt{-4 \cdot \left(c \cdot a\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]

Alternative 6: 79.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.32 \cdot 10^{-129}:\\
\;\;\;\;\frac{-c}{b}\\

\mathbf{elif}\;b \leq 1.65 \cdot 10^{-54}:\\
\;\;\;\;-0.5 \cdot \frac{\sqrt{c \cdot \left(a \cdot -4\right)}}{a}\\

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


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

    1. Initial program 22.7%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around -inf 79.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/79.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-179.3%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    4. Simplified79.3%

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

    if -1.31999999999999992e-129 < b < 1.64999999999999996e-54

    1. Initial program 85.1%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Simplified85.1%

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{a \cdot \left(c \cdot -4\right) + b \cdot b}}}{a} \]
      2. associate-*r*85.1%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(a \cdot c\right) \cdot -4} + b \cdot b}}{a} \]
      3. metadata-eval85.1%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(a \cdot c\right) \cdot \color{blue}{\left(-4\right)} + b \cdot b}}{a} \]
      4. distribute-rgt-neg-in85.1%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(-\left(a \cdot c\right) \cdot 4\right)} + b \cdot b}}{a} \]
      5. *-commutative85.1%

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)}}}{a} \]
      7. sub-neg85.1%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}{a} \]
      8. prod-diff84.9%

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

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

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

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

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

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

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

      \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right) + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}}{a} \]
    5. Step-by-step derivation
      1. fma-udef84.9%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(a \cdot \left(c \cdot -4\right) + b \cdot b\right)} + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}{a} \]
      2. *-commutative84.9%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(a \cdot \color{blue}{\left(-4 \cdot c\right)} + b \cdot b\right) + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}{a} \]
      3. associate-*l*84.9%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\left(\color{blue}{\left(a \cdot -4\right) \cdot c} + b \cdot b\right) + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}{a} \]
      4. +-commutative84.9%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(b \cdot b + \left(a \cdot -4\right) \cdot c\right)} + \left(\left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right) + \left(\left(a \cdot -4\right) \cdot c + a \cdot \left(c \cdot 4\right)\right)\right)}}{a} \]
      5. fma-def84.9%

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

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

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

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right) + 2 \cdot \color{blue}{\mathsf{fma}\left(a \cdot -4, c, a \cdot \left(c \cdot 4\right)\right)}}}{a} \]
      9. associate-*r*84.9%

        \[\leadsto -0.5 \cdot \frac{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right) + 2 \cdot \mathsf{fma}\left(a \cdot -4, c, \color{blue}{\left(a \cdot c\right) \cdot 4}\right)}}{a} \]
      10. *-commutative84.9%

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

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

      \[\leadsto -0.5 \cdot \color{blue}{\left(\frac{b}{a} + \sqrt{2 \cdot \left(-4 \cdot \left(c \cdot a\right) + 4 \cdot \left(c \cdot a\right)\right) + -4 \cdot \left(c \cdot a\right)} \cdot \frac{1}{a}\right)} \]
    8. Taylor expanded in b around 0 78.6%

      \[\leadsto -0.5 \cdot \color{blue}{\left(\sqrt{2 \cdot \left(-4 \cdot \left(c \cdot a\right) + 4 \cdot \left(c \cdot a\right)\right) + -4 \cdot \left(c \cdot a\right)} \cdot \frac{1}{a}\right)} \]
    9. Step-by-step derivation
      1. associate-*r/78.6%

        \[\leadsto -0.5 \cdot \color{blue}{\frac{\sqrt{2 \cdot \left(-4 \cdot \left(c \cdot a\right) + 4 \cdot \left(c \cdot a\right)\right) + -4 \cdot \left(c \cdot a\right)} \cdot 1}{a}} \]
      2. fma-def78.6%

        \[\leadsto -0.5 \cdot \frac{\sqrt{\color{blue}{\mathsf{fma}\left(2, -4 \cdot \left(c \cdot a\right) + 4 \cdot \left(c \cdot a\right), -4 \cdot \left(c \cdot a\right)\right)}} \cdot 1}{a} \]
      3. distribute-rgt-out78.6%

        \[\leadsto -0.5 \cdot \frac{\sqrt{\mathsf{fma}\left(2, \color{blue}{\left(c \cdot a\right) \cdot \left(-4 + 4\right)}, -4 \cdot \left(c \cdot a\right)\right)} \cdot 1}{a} \]
      4. *-commutative78.6%

        \[\leadsto -0.5 \cdot \frac{\sqrt{\mathsf{fma}\left(2, \color{blue}{\left(a \cdot c\right)} \cdot \left(-4 + 4\right), -4 \cdot \left(c \cdot a\right)\right)} \cdot 1}{a} \]
      5. metadata-eval78.6%

        \[\leadsto -0.5 \cdot \frac{\sqrt{\mathsf{fma}\left(2, \left(a \cdot c\right) \cdot \color{blue}{0}, -4 \cdot \left(c \cdot a\right)\right)} \cdot 1}{a} \]
      6. *-commutative78.6%

        \[\leadsto -0.5 \cdot \frac{\sqrt{\mathsf{fma}\left(2, \left(a \cdot c\right) \cdot 0, -4 \cdot \color{blue}{\left(a \cdot c\right)}\right)} \cdot 1}{a} \]
      7. *-rgt-identity78.6%

        \[\leadsto -0.5 \cdot \frac{\color{blue}{\sqrt{\mathsf{fma}\left(2, \left(a \cdot c\right) \cdot 0, -4 \cdot \left(a \cdot c\right)\right)}}}{a} \]
      8. fma-udef78.6%

        \[\leadsto -0.5 \cdot \frac{\sqrt{\color{blue}{2 \cdot \left(\left(a \cdot c\right) \cdot 0\right) + -4 \cdot \left(a \cdot c\right)}}}{a} \]
      9. mul0-rgt78.8%

        \[\leadsto -0.5 \cdot \frac{\sqrt{2 \cdot \color{blue}{0} + -4 \cdot \left(a \cdot c\right)}}{a} \]
      10. metadata-eval78.8%

        \[\leadsto -0.5 \cdot \frac{\sqrt{\color{blue}{0} + -4 \cdot \left(a \cdot c\right)}}{a} \]
      11. +-lft-identity78.8%

        \[\leadsto -0.5 \cdot \frac{\sqrt{\color{blue}{-4 \cdot \left(a \cdot c\right)}}}{a} \]
      12. associate-*r*78.8%

        \[\leadsto -0.5 \cdot \frac{\sqrt{\color{blue}{\left(-4 \cdot a\right) \cdot c}}}{a} \]
      13. *-commutative78.8%

        \[\leadsto -0.5 \cdot \frac{\sqrt{\color{blue}{c \cdot \left(-4 \cdot a\right)}}}{a} \]
      14. *-commutative78.8%

        \[\leadsto -0.5 \cdot \frac{\sqrt{c \cdot \color{blue}{\left(a \cdot -4\right)}}}{a} \]
    10. Simplified78.8%

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

    if 1.64999999999999996e-54 < b

    1. Initial program 66.1%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around inf 93.4%

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

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      2. unsub-neg93.4%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    4. Simplified93.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.32 \cdot 10^{-129}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{elif}\;b \leq 1.65 \cdot 10^{-54}:\\ \;\;\;\;-0.5 \cdot \frac{\sqrt{c \cdot \left(a \cdot -4\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]

Alternative 7: 67.7% accurate, 12.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{-c}{b}\\

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


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

    1. Initial program 34.4%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around -inf 65.9%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/65.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-165.9%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    4. Simplified65.9%

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

    if -1.999999999999994e-310 < b

    1. Initial program 72.4%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around inf 67.2%

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

        \[\leadsto \frac{c}{b} + \color{blue}{\left(-\frac{b}{a}\right)} \]
      2. unsub-neg67.2%

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    4. Simplified67.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \end{array} \]

Alternative 8: 43.5% accurate, 19.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.8 \cdot 10^{+51}:\\
\;\;\;\;\frac{c}{b}\\

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


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

    1. Initial program 14.0%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around inf 2.3%

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

        \[\leadsto \frac{\color{blue}{-2 \cdot b + 2 \cdot \frac{c \cdot a}{b}}}{2 \cdot a} \]
      2. *-commutative2.3%

        \[\leadsto \frac{\color{blue}{b \cdot -2} + 2 \cdot \frac{c \cdot a}{b}}{2 \cdot a} \]
      3. fma-def2.3%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(b, -2, 2 \cdot \frac{c \cdot a}{b}\right)}}{2 \cdot a} \]
      4. *-commutative2.3%

        \[\leadsto \frac{\mathsf{fma}\left(b, -2, \color{blue}{\frac{c \cdot a}{b} \cdot 2}\right)}{2 \cdot a} \]
      5. associate-/l*2.3%

        \[\leadsto \frac{\mathsf{fma}\left(b, -2, \color{blue}{\frac{c}{\frac{b}{a}}} \cdot 2\right)}{2 \cdot a} \]
    4. Simplified2.3%

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

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

    if -9.79999999999999967e51 < b

    1. Initial program 66.9%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around inf 45.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    3. Step-by-step derivation
      1. associate-*r/45.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot b}{a}} \]
      2. mul-1-neg45.1%

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    4. Simplified45.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -9.8 \cdot 10^{+51}:\\ \;\;\;\;\frac{c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]

Alternative 9: 67.6% accurate, 19.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.5 \cdot 10^{-261}:\\
\;\;\;\;\frac{-c}{b}\\

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


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

    1. Initial program 30.7%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around -inf 69.3%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/69.3%

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-169.3%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    4. Simplified69.3%

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

    if -5.50000000000000042e-261 < b

    1. Initial program 73.9%

      \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
    2. Taylor expanded in b around inf 63.6%

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    3. Step-by-step derivation
      1. associate-*r/63.6%

        \[\leadsto \color{blue}{\frac{-1 \cdot b}{a}} \]
      2. mul-1-neg63.6%

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    4. Simplified63.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.5 \cdot 10^{-261}:\\ \;\;\;\;\frac{-c}{b}\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]

Alternative 10: 2.5% accurate, 38.7× speedup?

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

\\
\frac{b}{a}
\end{array}
Derivation
  1. Initial program 52.7%

    \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
  2. Step-by-step derivation
    1. clear-num52.5%

      \[\leadsto \color{blue}{\frac{1}{\frac{2 \cdot a}{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}}} \]
    2. inv-pow52.5%

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

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

      \[\leadsto \color{blue}{\frac{1}{\frac{a \cdot 2}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}}}} \]
    2. fma-udef34.0%

      \[\leadsto \frac{1}{\frac{a \cdot 2}{b - \sqrt{\color{blue}{a \cdot \left(c \cdot -4\right) + b \cdot b}}}} \]
    3. *-commutative34.0%

      \[\leadsto \frac{1}{\frac{a \cdot 2}{b - \sqrt{a \cdot \color{blue}{\left(-4 \cdot c\right)} + b \cdot b}}} \]
    4. associate-*l*34.4%

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

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

      \[\leadsto \frac{1}{\frac{a \cdot 2}{b - \sqrt{\color{blue}{\mathsf{fma}\left(c, a \cdot -4, b \cdot b\right)}}}} \]
  5. Simplified34.4%

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

    \[\leadsto \color{blue}{\frac{b}{a}} \]
  7. Final simplification2.6%

    \[\leadsto \frac{b}{a} \]

Alternative 11: 10.8% accurate, 38.7× speedup?

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

\\
\frac{c}{b}
\end{array}
Derivation
  1. Initial program 52.7%

    \[\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \]
  2. Taylor expanded in b around inf 31.4%

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

      \[\leadsto \frac{\color{blue}{-2 \cdot b + 2 \cdot \frac{c \cdot a}{b}}}{2 \cdot a} \]
    2. *-commutative31.4%

      \[\leadsto \frac{\color{blue}{b \cdot -2} + 2 \cdot \frac{c \cdot a}{b}}{2 \cdot a} \]
    3. fma-def31.4%

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(b, -2, 2 \cdot \frac{c \cdot a}{b}\right)}}{2 \cdot a} \]
    4. *-commutative31.4%

      \[\leadsto \frac{\mathsf{fma}\left(b, -2, \color{blue}{\frac{c \cdot a}{b} \cdot 2}\right)}{2 \cdot a} \]
    5. associate-/l*33.3%

      \[\leadsto \frac{\mathsf{fma}\left(b, -2, \color{blue}{\frac{c}{\frac{b}{a}}} \cdot 2\right)}{2 \cdot a} \]
  4. Simplified33.3%

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

    \[\leadsto \color{blue}{\frac{c}{b}} \]
  6. Final simplification11.5%

    \[\leadsto \frac{c}{b} \]

Developer target: 70.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}\\ \mathbf{if}\;b < 0:\\ \;\;\;\;\frac{c}{a \cdot \frac{\left(-b\right) + t_0}{2 \cdot a}}\\ \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)
     (/ c (* a (/ (+ (- b) t_0) (* 2.0 a))))
     (/ (- (- 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 = c / (a * ((-b + t_0) / (2.0 * a)));
	} else {
		tmp = (-b - t_0) / (2.0 * a);
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt(((b * b) - (4.0d0 * (a * c))))
    if (b < 0.0d0) then
        tmp = c / (a * ((-b + t_0) / (2.0d0 * a)))
    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 = c / (a * ((-b + t_0) / (2.0 * a)));
	} 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 = c / (a * ((-b + t_0) / (2.0 * a)))
	else:
		tmp = (-b - t_0) / (2.0 * a)
	return tmp
function code(a, b, c)
	t_0 = sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(a * c))))
	tmp = 0.0
	if (b < 0.0)
		tmp = Float64(c / Float64(a * Float64(Float64(Float64(-b) + t_0) / Float64(2.0 * a))));
	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 = c / (a * ((-b + t_0) / (2.0 * a)));
	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[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Less[b, 0.0], N[(c / N[(a * N[(N[((-b) + t$95$0), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]), $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 - 4 \cdot \left(a \cdot c\right)}\\
\mathbf{if}\;b < 0:\\
\;\;\;\;\frac{c}{a \cdot \frac{\left(-b\right) + t_0}{2 \cdot a}}\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023230 
(FPCore (a b c)
  :name "quadm (p42, negative)"
  :precision binary64

  :herbie-target
  (if (< b 0.0) (/ c (* a (/ (+ (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))) (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))

  (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))