quadm (p42, negative)

Percentage Accurate: 52.3% → 85.2%
Time: 14.5s
Alternatives: 6
Speedup: 12.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 6 alternatives:

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

Initial Program: 52.3% accurate, 1.0× speedup?

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

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

Alternative 1: 85.2% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;b \leq 4.6 \cdot 10^{+114}:\\
\;\;\;\;\frac{\left(-b\right) - \sqrt{b \cdot b - 4 \cdot \left(c \cdot a\right)}}{a \cdot 2}\\

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


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

    1. Initial program 17.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around -inf 91.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. mul-1-neg91.0%

        \[\leadsto \color{blue}{-\frac{c}{b}} \]
    7. Simplified91.0%

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

    if -5e-80 < b < 4.6000000000000001e114

    1. Initial program 77.6%

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

    if 4.6000000000000001e114 < b

    1. Initial program 59.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around inf 96.1%

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

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

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

        \[\leadsto \color{blue}{\frac{c}{b} - \frac{b}{a}} \]
    7. Simplified96.1%

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

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

Alternative 2: 80.3% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 17.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around -inf 91.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. mul-1-neg91.0%

        \[\leadsto \color{blue}{-\frac{c}{b}} \]
    7. Simplified91.0%

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

    if -9.0000000000000006e-80 < b < 5.6000000000000002e-68

    1. Initial program 70.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around 0 66.0%

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

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

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

      \[\leadsto \frac{\left(-b\right) - \sqrt{\color{blue}{a \cdot \left(c \cdot -4\right)}}}{a \cdot 2} \]
    8. Step-by-step derivation
      1. div-sub66.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.6000000000000002e-68 < b

    1. Initial program 74.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around inf 91.3%

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    7. Simplified91.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -9 \cdot 10^{-80}:\\ \;\;\;\;-\frac{c}{b}\\ \mathbf{elif}\;b \leq 5.6 \cdot 10^{-68}:\\ \;\;\;\;\frac{0.5}{a} \cdot \left(b - \sqrt{c \cdot \left(a \cdot -4\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-b}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 80.8% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;b \leq 5.4 \cdot 10^{-60}:\\
\;\;\;\;\frac{b + \sqrt{c \cdot \left(a \cdot -4\right)}}{a \cdot -2}\\

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


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

    1. Initial program 17.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around -inf 91.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
    6. Step-by-step derivation
      1. mul-1-neg91.0%

        \[\leadsto \color{blue}{-\frac{c}{b}} \]
    7. Simplified91.0%

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

    if -3.30000000000000022e-82 < b < 5.40000000000000001e-60

    1. Initial program 70.1%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around 0 66.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-\left(\left(-b\right) - \sqrt{a \cdot \left(c \cdot -4\right)}\right)\right) \cdot \frac{1}{-a \cdot 2}} \]
      3. neg-sub065.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.40000000000000001e-60 < b

    1. Initial program 74.5%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around inf 91.3%

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    7. Simplified91.3%

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

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

Alternative 4: 67.4% accurate, 12.9× speedup?

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

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

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


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

    1. Initial program 33.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around -inf 67.1%

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

        \[\leadsto \color{blue}{-\frac{c}{b}} \]
    7. Simplified67.1%

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

    if -9.999999999999969e-311 < b

    1. Initial program 74.7%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Taylor expanded in b around inf 71.7%

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

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

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

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

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

Alternative 5: 34.4% accurate, 29.0× speedup?

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
  4. Add Preprocessing
  5. Taylor expanded in b around -inf 36.7%

    \[\leadsto \color{blue}{-1 \cdot \frac{c}{b}} \]
  6. Step-by-step derivation
    1. mul-1-neg36.7%

      \[\leadsto \color{blue}{-\frac{c}{b}} \]
  7. Simplified36.7%

    \[\leadsto \color{blue}{-\frac{c}{b}} \]
  8. Final simplification36.7%

    \[\leadsto -\frac{c}{b} \]
  9. Add Preprocessing

Alternative 6: 10.9% accurate, 38.7× speedup?

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{\left(-b\right) - \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{a \cdot 2}} \]
  4. Add Preprocessing
  5. Taylor expanded in b around -inf 25.6%

    \[\leadsto \frac{\color{blue}{-2 \cdot \frac{a \cdot c}{b}}}{a \cdot 2} \]
  6. Step-by-step derivation
    1. associate-/l*30.5%

      \[\leadsto \frac{-2 \cdot \color{blue}{\frac{a}{\frac{b}{c}}}}{a \cdot 2} \]
  7. Simplified30.5%

    \[\leadsto \frac{\color{blue}{-2 \cdot \frac{a}{\frac{b}{c}}}}{a \cdot 2} \]
  8. Step-by-step derivation
    1. div-inv30.5%

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

      \[\leadsto \color{blue}{-2 \cdot \left(\frac{a}{\frac{b}{c}} \cdot \frac{1}{a \cdot 2}\right)} \]
    3. div-inv30.5%

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

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

      \[\leadsto -2 \cdot \left(\left(a \cdot \frac{c}{b}\right) \cdot \frac{1}{\color{blue}{2 \cdot a}}\right) \]
    6. associate-/r*30.5%

      \[\leadsto -2 \cdot \left(\left(a \cdot \frac{c}{b}\right) \cdot \color{blue}{\frac{\frac{1}{2}}{a}}\right) \]
    7. metadata-eval30.5%

      \[\leadsto -2 \cdot \left(\left(a \cdot \frac{c}{b}\right) \cdot \frac{\color{blue}{0.5}}{a}\right) \]
  9. Applied egg-rr30.5%

    \[\leadsto \color{blue}{-2 \cdot \left(\left(a \cdot \frac{c}{b}\right) \cdot \frac{0.5}{a}\right)} \]
  10. Step-by-step derivation
    1. associate-*r*30.5%

      \[\leadsto \color{blue}{\left(-2 \cdot \left(a \cdot \frac{c}{b}\right)\right) \cdot \frac{0.5}{a}} \]
    2. *-commutative30.5%

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

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

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

      \[\leadsto \left(a \cdot \frac{c}{b}\right) \cdot \frac{\color{blue}{-1}}{a} \]
  11. Simplified30.5%

    \[\leadsto \color{blue}{\left(a \cdot \frac{c}{b}\right) \cdot \frac{-1}{a}} \]
  12. Step-by-step derivation
    1. associate-*r/25.6%

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

      \[\leadsto \color{blue}{\frac{-a \cdot c}{-b}} \cdot \frac{-1}{a} \]
    3. add-sqr-sqrt24.5%

      \[\leadsto \frac{-a \cdot c}{\color{blue}{\sqrt{-b} \cdot \sqrt{-b}}} \cdot \frac{-1}{a} \]
    4. sqrt-unprod19.5%

      \[\leadsto \frac{-a \cdot c}{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}} \cdot \frac{-1}{a} \]
    5. sqr-neg19.5%

      \[\leadsto \frac{-a \cdot c}{\sqrt{\color{blue}{b \cdot b}}} \cdot \frac{-1}{a} \]
    6. sqrt-unprod1.7%

      \[\leadsto \frac{-a \cdot c}{\color{blue}{\sqrt{b} \cdot \sqrt{b}}} \cdot \frac{-1}{a} \]
    7. add-sqr-sqrt10.0%

      \[\leadsto \frac{-a \cdot c}{\color{blue}{b}} \cdot \frac{-1}{a} \]
  13. Applied egg-rr10.0%

    \[\leadsto \color{blue}{\frac{-a \cdot c}{b}} \cdot \frac{-1}{a} \]
  14. Step-by-step derivation
    1. distribute-rgt-neg-in10.0%

      \[\leadsto \frac{\color{blue}{a \cdot \left(-c\right)}}{b} \cdot \frac{-1}{a} \]
  15. Simplified10.0%

    \[\leadsto \color{blue}{\frac{a \cdot \left(-c\right)}{b}} \cdot \frac{-1}{a} \]
  16. Taylor expanded in a around 0 10.0%

    \[\leadsto \color{blue}{\frac{c}{b}} \]
  17. Final simplification10.0%

    \[\leadsto \frac{c}{b} \]
  18. Add Preprocessing

Developer target: 99.7% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left|\frac{b}{2}\right|\\ t_1 := \sqrt{\left|a\right|} \cdot \sqrt{\left|c\right|}\\ t_2 := \begin{array}{l} \mathbf{if}\;\mathsf{copysign}\left(a, c\right) = a:\\ \;\;\;\;\sqrt{t_0 - t_1} \cdot \sqrt{t_0 + t_1}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{hypot}\left(\frac{b}{2}, t_1\right)\\ \end{array}\\ \mathbf{if}\;b < 0:\\ \;\;\;\;\frac{c}{t_2 - \frac{b}{2}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{b}{2} + t_2}{-a}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (fabs (/ b 2.0)))
        (t_1 (* (sqrt (fabs a)) (sqrt (fabs c))))
        (t_2
         (if (== (copysign a c) a)
           (* (sqrt (- t_0 t_1)) (sqrt (+ t_0 t_1)))
           (hypot (/ b 2.0) t_1))))
   (if (< b 0.0) (/ c (- t_2 (/ b 2.0))) (/ (+ (/ b 2.0) t_2) (- a)))))
double code(double a, double b, double c) {
	double t_0 = fabs((b / 2.0));
	double t_1 = sqrt(fabs(a)) * sqrt(fabs(c));
	double tmp;
	if (copysign(a, c) == a) {
		tmp = sqrt((t_0 - t_1)) * sqrt((t_0 + t_1));
	} else {
		tmp = hypot((b / 2.0), t_1);
	}
	double t_2 = tmp;
	double tmp_1;
	if (b < 0.0) {
		tmp_1 = c / (t_2 - (b / 2.0));
	} else {
		tmp_1 = ((b / 2.0) + t_2) / -a;
	}
	return tmp_1;
}
public static double code(double a, double b, double c) {
	double t_0 = Math.abs((b / 2.0));
	double t_1 = Math.sqrt(Math.abs(a)) * Math.sqrt(Math.abs(c));
	double tmp;
	if (Math.copySign(a, c) == a) {
		tmp = Math.sqrt((t_0 - t_1)) * Math.sqrt((t_0 + t_1));
	} else {
		tmp = Math.hypot((b / 2.0), t_1);
	}
	double t_2 = tmp;
	double tmp_1;
	if (b < 0.0) {
		tmp_1 = c / (t_2 - (b / 2.0));
	} else {
		tmp_1 = ((b / 2.0) + t_2) / -a;
	}
	return tmp_1;
}
def code(a, b, c):
	t_0 = math.fabs((b / 2.0))
	t_1 = math.sqrt(math.fabs(a)) * math.sqrt(math.fabs(c))
	tmp = 0
	if math.copysign(a, c) == a:
		tmp = math.sqrt((t_0 - t_1)) * math.sqrt((t_0 + t_1))
	else:
		tmp = math.hypot((b / 2.0), t_1)
	t_2 = tmp
	tmp_1 = 0
	if b < 0.0:
		tmp_1 = c / (t_2 - (b / 2.0))
	else:
		tmp_1 = ((b / 2.0) + t_2) / -a
	return tmp_1
function code(a, b, c)
	t_0 = abs(Float64(b / 2.0))
	t_1 = Float64(sqrt(abs(a)) * sqrt(abs(c)))
	tmp = 0.0
	if (copysign(a, c) == a)
		tmp = Float64(sqrt(Float64(t_0 - t_1)) * sqrt(Float64(t_0 + t_1)));
	else
		tmp = hypot(Float64(b / 2.0), t_1);
	end
	t_2 = tmp
	tmp_1 = 0.0
	if (b < 0.0)
		tmp_1 = Float64(c / Float64(t_2 - Float64(b / 2.0)));
	else
		tmp_1 = Float64(Float64(Float64(b / 2.0) + t_2) / Float64(-a));
	end
	return tmp_1
end
function tmp_3 = code(a, b, c)
	t_0 = abs((b / 2.0));
	t_1 = sqrt(abs(a)) * sqrt(abs(c));
	tmp = 0.0;
	if ((sign(c) * abs(a)) == a)
		tmp = sqrt((t_0 - t_1)) * sqrt((t_0 + t_1));
	else
		tmp = hypot((b / 2.0), t_1);
	end
	t_2 = tmp;
	tmp_2 = 0.0;
	if (b < 0.0)
		tmp_2 = c / (t_2 - (b / 2.0));
	else
		tmp_2 = ((b / 2.0) + t_2) / -a;
	end
	tmp_3 = tmp_2;
end
code[a_, b_, c_] := Block[{t$95$0 = N[Abs[N[(b / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[Abs[a], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Abs[c], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = If[Equal[N[With[{TMP1 = Abs[a], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision], a], N[(N[Sqrt[N[(t$95$0 - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(t$95$0 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(b / 2.0), $MachinePrecision] ^ 2 + t$95$1 ^ 2], $MachinePrecision]]}, If[Less[b, 0.0], N[(c / N[(t$95$2 - N[(b / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b / 2.0), $MachinePrecision] + t$95$2), $MachinePrecision] / (-a)), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left|\frac{b}{2}\right|\\
t_1 := \sqrt{\left|a\right|} \cdot \sqrt{\left|c\right|}\\
t_2 := \begin{array}{l}
\mathbf{if}\;\mathsf{copysign}\left(a, c\right) = a:\\
\;\;\;\;\sqrt{t_0 - t_1} \cdot \sqrt{t_0 + t_1}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{hypot}\left(\frac{b}{2}, t_1\right)\\


\end{array}\\
\mathbf{if}\;b < 0:\\
\;\;\;\;\frac{c}{t_2 - \frac{b}{2}}\\

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


\end{array}
\end{array}

Reproduce

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

  :herbie-target
  (if (< b 0.0) (/ c (- (if (== (copysign a c) a) (* (sqrt (- (fabs (/ b 2.0)) (* (sqrt (fabs a)) (sqrt (fabs c))))) (sqrt (+ (fabs (/ b 2.0)) (* (sqrt (fabs a)) (sqrt (fabs c)))))) (hypot (/ b 2.0) (* (sqrt (fabs a)) (sqrt (fabs c))))) (/ b 2.0))) (/ (+ (/ b 2.0) (if (== (copysign a c) a) (* (sqrt (- (fabs (/ b 2.0)) (* (sqrt (fabs a)) (sqrt (fabs c))))) (sqrt (+ (fabs (/ b 2.0)) (* (sqrt (fabs a)) (sqrt (fabs c)))))) (hypot (/ b 2.0) (* (sqrt (fabs a)) (sqrt (fabs c)))))) (- a)))

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