quadp (p42, positive)

Percentage Accurate: 51.0% → 85.6%
Time: 10.4s
Alternatives: 7
Speedup: 19.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 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: 51.0% 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.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2 \cdot 10^{+148}:\\
\;\;\;\;\frac{-b}{a}\\

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

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


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

    1. Initial program 42.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{-b}}{a} \]
    6. Simplified97.8%

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

    if -2.0000000000000001e148 < b < 3.90000000000000001e-118

    1. Initial program 82.8%

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

    if 3.90000000000000001e-118 < b

    1. Initial program 17.8%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2 \cdot 10^{+148}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{elif}\;b \leq 3.9 \cdot 10^{-118}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \]

Alternative 2: 81.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.35 \cdot 10^{-58}:\\
\;\;\;\;\frac{c}{b} - \frac{b}{a}\\

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

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


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

    1. Initial program 73.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. neg-sub073.1%

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

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

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

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

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

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

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

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

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

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

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

    if -1.3499999999999999e-58 < b < 1.49999999999999996e-117

    1. Initial program 70.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. neg-sub070.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{b - {\left(e^{0.25 \cdot \left(-1 \cdot \log \left(\frac{1}{a}\right) + \log \left(-4 \cdot c\right)\right)}\right)}^{2}}{a}} \]
    7. Step-by-step derivation
      1. Simplified66.4%

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

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

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

      if 1.49999999999999996e-117 < b

      1. Initial program 17.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 3: 81.2% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -7.2 \cdot 10^{-59}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{elif}\;b \leq 1.5 \cdot 10^{-117}:\\ \;\;\;\;-0.5 \cdot \frac{b - \sqrt{a \cdot \left(c \cdot -4\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= b -7.2e-59)
       (- (/ c b) (/ b a))
       (if (<= b 1.5e-117)
         (* -0.5 (/ (- b (sqrt (* a (* c -4.0)))) a))
         (/ (- c) b))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (b <= -7.2e-59) {
    		tmp = (c / b) - (b / a);
    	} else if (b <= 1.5e-117) {
    		tmp = -0.5 * ((b - sqrt((a * (c * -4.0)))) / a);
    	} else {
    		tmp = -c / b;
    	}
    	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 <= (-7.2d-59)) then
            tmp = (c / b) - (b / a)
        else if (b <= 1.5d-117) then
            tmp = (-0.5d0) * ((b - sqrt((a * (c * (-4.0d0))))) / a)
        else
            tmp = -c / b
        end if
        code = tmp
    end function
    
    public static double code(double a, double b, double c) {
    	double tmp;
    	if (b <= -7.2e-59) {
    		tmp = (c / b) - (b / a);
    	} else if (b <= 1.5e-117) {
    		tmp = -0.5 * ((b - Math.sqrt((a * (c * -4.0)))) / a);
    	} else {
    		tmp = -c / b;
    	}
    	return tmp;
    }
    
    def code(a, b, c):
    	tmp = 0
    	if b <= -7.2e-59:
    		tmp = (c / b) - (b / a)
    	elif b <= 1.5e-117:
    		tmp = -0.5 * ((b - math.sqrt((a * (c * -4.0)))) / a)
    	else:
    		tmp = -c / b
    	return tmp
    
    function code(a, b, c)
    	tmp = 0.0
    	if (b <= -7.2e-59)
    		tmp = Float64(Float64(c / b) - Float64(b / a));
    	elseif (b <= 1.5e-117)
    		tmp = Float64(-0.5 * Float64(Float64(b - sqrt(Float64(a * Float64(c * -4.0)))) / a));
    	else
    		tmp = Float64(Float64(-c) / b);
    	end
    	return tmp
    end
    
    function tmp_2 = code(a, b, c)
    	tmp = 0.0;
    	if (b <= -7.2e-59)
    		tmp = (c / b) - (b / a);
    	elseif (b <= 1.5e-117)
    		tmp = -0.5 * ((b - sqrt((a * (c * -4.0)))) / a);
    	else
    		tmp = -c / b;
    	end
    	tmp_2 = tmp;
    end
    
    code[a_, b_, c_] := If[LessEqual[b, -7.2e-59], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.5e-117], N[(-0.5 * N[(N[(b - N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq -7.2 \cdot 10^{-59}:\\
    \;\;\;\;\frac{c}{b} - \frac{b}{a}\\
    
    \mathbf{elif}\;b \leq 1.5 \cdot 10^{-117}:\\
    \;\;\;\;-0.5 \cdot \frac{b - \sqrt{a \cdot \left(c \cdot -4\right)}}{a}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{-c}{b}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if b < -7.20000000000000001e-59

      1. Initial program 73.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. neg-sub073.1%

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

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

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

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

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

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

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

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

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

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

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

      if -7.20000000000000001e-59 < b < 1.49999999999999996e-117

      1. Initial program 70.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. neg-sub070.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-0.5 \cdot \frac{b - {\left(e^{0.25 \cdot \left(-1 \cdot \log \left(\frac{1}{a}\right) + \log \left(-4 \cdot c\right)\right)}\right)}^{2}}{a}} \]
      7. Step-by-step derivation
        1. Simplified66.4%

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

        if 1.49999999999999996e-117 < b

        1. Initial program 17.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 4: 68.5% accurate, 12.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\frac{c}{b} - \frac{b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{b}\\ \end{array} \end{array} \]
      (FPCore (a b c)
       :precision binary64
       (if (<= b -1e-310) (- (/ c b) (/ b a)) (/ (- c) b)))
      double code(double a, double b, double c) {
      	double tmp;
      	if (b <= -1e-310) {
      		tmp = (c / b) - (b / a);
      	} else {
      		tmp = -c / b;
      	}
      	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) - (b / a)
          else
              tmp = -c / b
          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) - (b / a);
      	} else {
      		tmp = -c / b;
      	}
      	return tmp;
      }
      
      def code(a, b, c):
      	tmp = 0
      	if b <= -1e-310:
      		tmp = (c / b) - (b / a)
      	else:
      		tmp = -c / b
      	return tmp
      
      function code(a, b, c)
      	tmp = 0.0
      	if (b <= -1e-310)
      		tmp = Float64(Float64(c / b) - Float64(b / a));
      	else
      		tmp = Float64(Float64(-c) / b);
      	end
      	return tmp
      end
      
      function tmp_2 = code(a, b, c)
      	tmp = 0.0;
      	if (b <= -1e-310)
      		tmp = (c / b) - (b / a);
      	else
      		tmp = -c / b;
      	end
      	tmp_2 = tmp;
      end
      
      code[a_, b_, c_] := If[LessEqual[b, -1e-310], N[(N[(c / b), $MachinePrecision] - N[(b / a), $MachinePrecision]), $MachinePrecision], N[((-c) / b), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;b \leq -1 \cdot 10^{-310}:\\
      \;\;\;\;\frac{c}{b} - \frac{b}{a}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{-c}{b}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if b < -9.999999999999969e-311

        1. Initial program 70.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. neg-sub070.7%

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

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

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

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

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

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

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

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

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

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

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

        if -9.999999999999969e-311 < b

        1. Initial program 31.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. neg-sub031.5%

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\color{blue}{-c}}{b} \]
        6. Simplified69.0%

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

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

      Alternative 5: 43.3% accurate, 19.1× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 7.4 \cdot 10^{+47}:\\ \;\;\;\;\frac{-b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b}\\ \end{array} \end{array} \]
      (FPCore (a b c) :precision binary64 (if (<= b 7.4e+47) (/ (- b) a) (/ c b)))
      double code(double a, double b, double c) {
      	double tmp;
      	if (b <= 7.4e+47) {
      		tmp = -b / a;
      	} else {
      		tmp = c / b;
      	}
      	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 <= 7.4d+47) then
              tmp = -b / a
          else
              tmp = c / b
          end if
          code = tmp
      end function
      
      public static double code(double a, double b, double c) {
      	double tmp;
      	if (b <= 7.4e+47) {
      		tmp = -b / a;
      	} else {
      		tmp = c / b;
      	}
      	return tmp;
      }
      
      def code(a, b, c):
      	tmp = 0
      	if b <= 7.4e+47:
      		tmp = -b / a
      	else:
      		tmp = c / b
      	return tmp
      
      function code(a, b, c)
      	tmp = 0.0
      	if (b <= 7.4e+47)
      		tmp = Float64(Float64(-b) / a);
      	else
      		tmp = Float64(c / b);
      	end
      	return tmp
      end
      
      function tmp_2 = code(a, b, c)
      	tmp = 0.0;
      	if (b <= 7.4e+47)
      		tmp = -b / a;
      	else
      		tmp = c / b;
      	end
      	tmp_2 = tmp;
      end
      
      code[a_, b_, c_] := If[LessEqual[b, 7.4e+47], N[((-b) / a), $MachinePrecision], N[(c / b), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;b \leq 7.4 \cdot 10^{+47}:\\
      \;\;\;\;\frac{-b}{a}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{c}{b}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if b < 7.40000000000000081e47

        1. Initial program 65.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. neg-sub065.7%

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

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

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

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

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

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

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

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

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

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

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

        if 7.40000000000000081e47 < b

        1. Initial program 12.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\frac{1 \cdot \color{blue}{\left(c \cdot a\right)}}{b}}{-a} \]
          6. *-lft-identity85.9%

            \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{b}}{-a} \]
          7. associate-*r/80.7%

            \[\leadsto \frac{\color{blue}{c \cdot \frac{a}{b}}}{-a} \]
        8. Simplified80.7%

          \[\leadsto \color{blue}{\frac{c \cdot \frac{a}{b}}{-a}} \]
        9. Step-by-step derivation
          1. expm1-log1p-u76.9%

            \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{c \cdot \frac{a}{b}}{-a}\right)\right)} \]
          2. expm1-udef49.1%

            \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{c \cdot \frac{a}{b}}{-a}\right)} - 1} \]
          3. associate-/l*49.1%

            \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{c}{\frac{-a}{\frac{a}{b}}}}\right)} - 1 \]
          4. add-sqr-sqrt25.3%

            \[\leadsto e^{\mathsf{log1p}\left(\frac{c}{\frac{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}}{\frac{a}{b}}}\right)} - 1 \]
          5. sqrt-unprod32.4%

            \[\leadsto e^{\mathsf{log1p}\left(\frac{c}{\frac{\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}}}{\frac{a}{b}}}\right)} - 1 \]
          6. sqr-neg32.4%

            \[\leadsto e^{\mathsf{log1p}\left(\frac{c}{\frac{\sqrt{\color{blue}{a \cdot a}}}{\frac{a}{b}}}\right)} - 1 \]
          7. sqrt-unprod15.4%

            \[\leadsto e^{\mathsf{log1p}\left(\frac{c}{\frac{\color{blue}{\sqrt{a} \cdot \sqrt{a}}}{\frac{a}{b}}}\right)} - 1 \]
          8. add-sqr-sqrt34.0%

            \[\leadsto e^{\mathsf{log1p}\left(\frac{c}{\frac{\color{blue}{a}}{\frac{a}{b}}}\right)} - 1 \]
        10. Applied egg-rr34.0%

          \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{c}{\frac{a}{\frac{a}{b}}}\right)} - 1} \]
        11. Step-by-step derivation
          1. expm1-def33.5%

            \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{c}{\frac{a}{\frac{a}{b}}}\right)\right)} \]
          2. expm1-log1p33.7%

            \[\leadsto \color{blue}{\frac{c}{\frac{a}{\frac{a}{b}}}} \]
          3. associate-/r/33.5%

            \[\leadsto \frac{c}{\color{blue}{\frac{a}{a} \cdot b}} \]
          4. *-inverses33.5%

            \[\leadsto \frac{c}{\color{blue}{1} \cdot b} \]
          5. *-lft-identity33.5%

            \[\leadsto \frac{c}{\color{blue}{b}} \]
        12. Simplified33.5%

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

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

      Alternative 6: 68.4% accurate, 19.1× speedup?

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

        1. Initial program 70.9%

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.1e-301 < b

        1. Initial program 30.9%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\color{blue}{-c}}{b} \]
        6. Simplified69.5%

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

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

      Alternative 7: 11.0% 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 51.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. neg-sub051.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{\frac{1 \cdot \color{blue}{\left(c \cdot a\right)}}{b}}{-a} \]
        6. *-lft-identity30.9%

          \[\leadsto \frac{\frac{\color{blue}{c \cdot a}}{b}}{-a} \]
        7. associate-*r/29.8%

          \[\leadsto \frac{\color{blue}{c \cdot \frac{a}{b}}}{-a} \]
      8. Simplified29.8%

        \[\leadsto \color{blue}{\frac{c \cdot \frac{a}{b}}{-a}} \]
      9. Step-by-step derivation
        1. expm1-log1p-u27.8%

          \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{c \cdot \frac{a}{b}}{-a}\right)\right)} \]
        2. expm1-udef16.1%

          \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{c \cdot \frac{a}{b}}{-a}\right)} - 1} \]
        3. associate-/l*16.1%

          \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{c}{\frac{-a}{\frac{a}{b}}}}\right)} - 1 \]
        4. add-sqr-sqrt7.9%

          \[\leadsto e^{\mathsf{log1p}\left(\frac{c}{\frac{\color{blue}{\sqrt{-a} \cdot \sqrt{-a}}}{\frac{a}{b}}}\right)} - 1 \]
        5. sqrt-unprod10.5%

          \[\leadsto e^{\mathsf{log1p}\left(\frac{c}{\frac{\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}}}{\frac{a}{b}}}\right)} - 1 \]
        6. sqr-neg10.5%

          \[\leadsto e^{\mathsf{log1p}\left(\frac{c}{\frac{\sqrt{\color{blue}{a \cdot a}}}{\frac{a}{b}}}\right)} - 1 \]
        7. sqrt-unprod5.2%

          \[\leadsto e^{\mathsf{log1p}\left(\frac{c}{\frac{\color{blue}{\sqrt{a} \cdot \sqrt{a}}}{\frac{a}{b}}}\right)} - 1 \]
        8. add-sqr-sqrt10.7%

          \[\leadsto e^{\mathsf{log1p}\left(\frac{c}{\frac{\color{blue}{a}}{\frac{a}{b}}}\right)} - 1 \]
      10. Applied egg-rr10.7%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{c}{\frac{a}{\frac{a}{b}}}\right)} - 1} \]
      11. Step-by-step derivation
        1. expm1-def10.6%

          \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{c}{\frac{a}{\frac{a}{b}}}\right)\right)} \]
        2. expm1-log1p11.1%

          \[\leadsto \color{blue}{\frac{c}{\frac{a}{\frac{a}{b}}}} \]
        3. associate-/r/11.1%

          \[\leadsto \frac{c}{\color{blue}{\frac{a}{a} \cdot b}} \]
        4. *-inverses11.1%

          \[\leadsto \frac{c}{\color{blue}{1} \cdot b} \]
        5. *-lft-identity11.1%

          \[\leadsto \frac{c}{\color{blue}{b}} \]
      12. Simplified11.1%

        \[\leadsto \color{blue}{\frac{c}{b}} \]
      13. Final simplification11.1%

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

      Developer target: 69.8% accurate, 1.0× speedup?

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

      Reproduce

      ?
      herbie shell --seed 2023181 
      (FPCore (a b c)
        :name "quadp (p42, positive)"
        :precision binary64
      
        :herbie-target
        (if (< b 0.0) (/ (+ (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)) (/ c (* a (/ (- (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))))
      
        (/ (+ (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))