jeff quadratic root 2

Percentage Accurate: 72.6% → 88.1%
Time: 24.4s
Alternatives: 7
Speedup: 1.0×

Specification

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

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

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


\end{array}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 7 alternatives:

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

Initial Program: 72.6% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}

Alternative 1: 88.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_0 := c \cdot \left(a \cdot -4\right)\\
\mathbf{if}\;b \leq -33500000000000:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{b}{a}, \frac{c}{b}\right)\\

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


\end{array}\\

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

\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \left(\frac{b}{a} - \frac{\mathsf{hypot}\left(b, \sqrt{t_0}\right)}{a}\right)\\


\end{array}\\

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

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


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

    1. Initial program 55.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.35e13 < b < 1.00000000000000001e55

    1. Initial program 82.3%

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

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

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

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

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

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

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

    if 1.00000000000000001e55 < b

    1. Initial program 55.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 88.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_0 := c \cdot \left(a \cdot -4\right)\\
\mathbf{if}\;b \leq -66000000:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{b}{a}, \frac{c}{b}\right)\\

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


\end{array}\\

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

\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \left(\left(b - \mathsf{hypot}\left(b, \sqrt{t_0}\right)\right) \cdot \frac{1}{a}\right)\\


\end{array}\\

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

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


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

    1. Initial program 55.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.6e7 < b < 1.00000000000000001e55

    1. Initial program 82.3%

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

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

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

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

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

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

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

    if 1.00000000000000001e55 < b

    1. Initial program 55.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 90.6% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}\\

\mathbf{elif}\;b \leq 8.8 \cdot 10^{+54}:\\
\;\;\;\;\begin{array}{l}
\mathbf{if}\;b \geq 0:\\
\;\;\;\;\frac{c \cdot 2}{\left(-b\right) - t_1}\\

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


\end{array}\\

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

\mathbf{else}:\\
\;\;\;\;t_0\\


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

    1. Initial program 39.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999984e134 < b < 8.7999999999999996e54

    1. Initial program 82.7%

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

    if 8.7999999999999996e54 < b

    1. Initial program 55.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 67.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{\mathsf{fma}\left(-2, \frac{a}{\frac{b}{c}}, b + b\right)}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{\mathsf{fma}\left(0.5, \frac{a}{\frac{\frac{b}{c}}{-4}}, b \cdot 2\right)}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (>= b 0.0)
   (* c (/ -2.0 (fma -2.0 (/ a (/ b c)) (+ b b))))
   (* -0.5 (/ (fma 0.5 (/ a (/ (/ b c) -4.0)) (* b 2.0)) a))))
double code(double a, double b, double c) {
	double tmp;
	if (b >= 0.0) {
		tmp = c * (-2.0 / fma(-2.0, (a / (b / c)), (b + b)));
	} else {
		tmp = -0.5 * (fma(0.5, (a / ((b / c) / -4.0)), (b * 2.0)) / a);
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b >= 0.0)
		tmp = Float64(c * Float64(-2.0 / fma(-2.0, Float64(a / Float64(b / c)), Float64(b + b))));
	else
		tmp = Float64(-0.5 * Float64(fma(0.5, Float64(a / Float64(Float64(b / c) / -4.0)), Float64(b * 2.0)) / a));
	end
	return tmp
end
code[a_, b_, c_] := If[GreaterEqual[b, 0.0], N[(c * N[(-2.0 / N[(-2.0 * N[(a / N[(b / c), $MachinePrecision]), $MachinePrecision] + N[(b + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(N[(0.5 * N[(a / N[(N[(b / c), $MachinePrecision] / -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * 2.0), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b - e^{\log \left(\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)\right)}}{a} \cdot -0.5\\ \end{array} \]
  4. Applied egg-rr65.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 68.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\frac{c \cdot -2}{\mathsf{fma}\left(-2, c \cdot \frac{a}{b}, b + b\right)}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{\mathsf{fma}\left(0.5, \frac{a}{\frac{\frac{b}{c}}{-4}}, b \cdot 2\right)}{a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (>= b 0.0)
   (/ (* c -2.0) (fma -2.0 (* c (/ a b)) (+ b b)))
   (* -0.5 (/ (fma 0.5 (/ a (/ (/ b c) -4.0)) (* b 2.0)) a))))
double code(double a, double b, double c) {
	double tmp;
	if (b >= 0.0) {
		tmp = (c * -2.0) / fma(-2.0, (c * (a / b)), (b + b));
	} else {
		tmp = -0.5 * (fma(0.5, (a / ((b / c) / -4.0)), (b * 2.0)) / a);
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b >= 0.0)
		tmp = Float64(Float64(c * -2.0) / fma(-2.0, Float64(c * Float64(a / b)), Float64(b + b)));
	else
		tmp = Float64(-0.5 * Float64(fma(0.5, Float64(a / Float64(Float64(b / c) / -4.0)), Float64(b * 2.0)) / a));
	end
	return tmp
end
code[a_, b_, c_] := If[GreaterEqual[b, 0.0], N[(N[(c * -2.0), $MachinePrecision] / N[(-2.0 * N[(c * N[(a / b), $MachinePrecision]), $MachinePrecision] + N[(b + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(N[(0.5 * N[(a / N[(N[(b / c), $MachinePrecision] / -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * 2.0), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{b + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -4\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b - e^{\log \left(\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -4\right)}\right)\right)}}{a} \cdot -0.5\\ \end{array} \]
  4. Applied egg-rr65.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 67.7% accurate, 13.0× speedup?

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

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

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


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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;c \cdot \frac{-2}{b + \color{blue}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b - -1 \cdot b}{a} \cdot -0.5\\ \end{array} \]
  5. Final simplification62.7%

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

Alternative 7: 67.8% accurate, 13.0× speedup?

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

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

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


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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \geq 0:\\ \;\;\;\;\color{blue}{-1 \cdot \frac{c}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{b - -1 \cdot b}{a} \cdot -0.5\\ \end{array} \]
  5. Step-by-step derivation
    1. mul-1-neg62.8%

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

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

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

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

Reproduce

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