Quadratic roots, full range

Percentage Accurate: 51.8% → 84.5%
Time: 13.8s
Alternatives: 13
Speedup: 12.9×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{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(Float64(4.0 * 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[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{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 13 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.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(4 \cdot a\right) \cdot c}}{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(Float64(4.0 * 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[(N[(4.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 84.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+146}:\\ \;\;\;\;\frac{b}{-a}\\ \mathbf{elif}\;b \leq 7.4 \cdot 10^{-174}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1e+146)
   (/ b (- a))
   (if (<= b 7.4e-174)
     (/ (- (sqrt (fma a (* c -4.0) (* b b))) b) (* a 2.0))
     (/ c (- b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1e+146) {
		tmp = b / -a;
	} else if (b <= 7.4e-174) {
		tmp = (sqrt(fma(a, (c * -4.0), (b * b))) - b) / (a * 2.0);
	} else {
		tmp = c / -b;
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= -1e+146)
		tmp = Float64(b / Float64(-a));
	elseif (b <= 7.4e-174)
		tmp = Float64(Float64(sqrt(fma(a, Float64(c * -4.0), Float64(b * b))) - b) / Float64(a * 2.0));
	else
		tmp = Float64(c / Float64(-b));
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -1e+146], N[(b / (-a)), $MachinePrecision], If[LessEqual[b, 7.4e-174], N[(N[(N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision] + N[(b * b), $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 -1 \cdot 10^{+146}:\\
\;\;\;\;\frac{b}{-a}\\

\mathbf{elif}\;b \leq 7.4 \cdot 10^{-174}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}\\

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


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

    1. Initial program 39.5%

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

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

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

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

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

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

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

    if -9.99999999999999934e145 < b < 7.40000000000000019e-174

    1. Initial program 85.8%

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

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

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

    if 7.40000000000000019e-174 < b

    1. Initial program 22.1%

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

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

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

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

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

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

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

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

Alternative 2: 84.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+146}:\\ \;\;\;\;\frac{b}{-a}\\ \mathbf{elif}\;b \leq 7.4 \cdot 10^{-174}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1e+146)
   (/ b (- a))
   (if (<= b 7.4e-174)
     (/ (- (sqrt (- (* b b) (* c (* a 4.0)))) b) (* a 2.0))
     (/ c (- b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1e+146) {
		tmp = b / -a;
	} else if (b <= 7.4e-174) {
		tmp = (sqrt(((b * b) - (c * (a * 4.0)))) - 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 <= (-1d+146)) then
        tmp = b / -a
    else if (b <= 7.4d-174) then
        tmp = (sqrt(((b * b) - (c * (a * 4.0d0)))) - 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 <= -1e+146) {
		tmp = b / -a;
	} else if (b <= 7.4e-174) {
		tmp = (Math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	} else {
		tmp = c / -b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -1e+146:
		tmp = b / -a
	elif b <= 7.4e-174:
		tmp = (math.sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0)
	else:
		tmp = c / -b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -1e+146)
		tmp = Float64(b / Float64(-a));
	elseif (b <= 7.4e-174)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 4.0)))) - b) / Float64(a * 2.0));
	else
		tmp = Float64(c / Float64(-b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -1e+146)
		tmp = b / -a;
	elseif (b <= 7.4e-174)
		tmp = (sqrt(((b * b) - (c * (a * 4.0)))) - b) / (a * 2.0);
	else
		tmp = c / -b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -1e+146], N[(b / (-a)), $MachinePrecision], If[LessEqual[b, 7.4e-174], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 4.0), $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 -1 \cdot 10^{+146}:\\
\;\;\;\;\frac{b}{-a}\\

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

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


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

    1. Initial program 39.5%

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

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

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

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

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

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

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

    if -9.99999999999999934e145 < b < 7.40000000000000019e-174

    1. Initial program 85.8%

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

    if 7.40000000000000019e-174 < b

    1. Initial program 22.1%

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

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

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

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

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

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

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

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

Alternative 3: 79.4% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -6.5 \cdot 10^{-70}:\\ \;\;\;\;b \cdot \left(\frac{c}{{b}^{2}} + \frac{-1}{a}\right)\\ \mathbf{elif}\;b \leq 7.4 \cdot 10^{-174}:\\ \;\;\;\;\frac{\sqrt{a \cdot \left(c \cdot -4\right)}}{a \cdot 2} - \frac{b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -6.5e-70)
   (* b (+ (/ c (pow b 2.0)) (/ -1.0 a)))
   (if (<= b 7.4e-174)
     (- (/ (sqrt (* a (* c -4.0))) (* a 2.0)) (/ b (* a 2.0)))
     (/ c (- b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -6.5e-70) {
		tmp = b * ((c / pow(b, 2.0)) + (-1.0 / a));
	} else if (b <= 7.4e-174) {
		tmp = (sqrt((a * (c * -4.0))) / (a * 2.0)) - (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 <= (-6.5d-70)) then
        tmp = b * ((c / (b ** 2.0d0)) + ((-1.0d0) / a))
    else if (b <= 7.4d-174) then
        tmp = (sqrt((a * (c * (-4.0d0)))) / (a * 2.0d0)) - (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 <= -6.5e-70) {
		tmp = b * ((c / Math.pow(b, 2.0)) + (-1.0 / a));
	} else if (b <= 7.4e-174) {
		tmp = (Math.sqrt((a * (c * -4.0))) / (a * 2.0)) - (b / (a * 2.0));
	} else {
		tmp = c / -b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -6.5e-70:
		tmp = b * ((c / math.pow(b, 2.0)) + (-1.0 / a))
	elif b <= 7.4e-174:
		tmp = (math.sqrt((a * (c * -4.0))) / (a * 2.0)) - (b / (a * 2.0))
	else:
		tmp = c / -b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -6.5e-70)
		tmp = Float64(b * Float64(Float64(c / (b ^ 2.0)) + Float64(-1.0 / a)));
	elseif (b <= 7.4e-174)
		tmp = Float64(Float64(sqrt(Float64(a * Float64(c * -4.0))) / Float64(a * 2.0)) - Float64(b / Float64(a * 2.0)));
	else
		tmp = Float64(c / Float64(-b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -6.5e-70)
		tmp = b * ((c / (b ^ 2.0)) + (-1.0 / a));
	elseif (b <= 7.4e-174)
		tmp = (sqrt((a * (c * -4.0))) / (a * 2.0)) - (b / (a * 2.0));
	else
		tmp = c / -b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -6.5e-70], N[(b * N[(N[(c / N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.4e-174], N[(N[(N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(a * 2.0), $MachinePrecision]), $MachinePrecision] - N[(b / N[(a * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c / (-b)), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.5 \cdot 10^{-70}:\\
\;\;\;\;b \cdot \left(\frac{c}{{b}^{2}} + \frac{-1}{a}\right)\\

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

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


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

    1. Initial program 69.2%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg85.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right) \cdot \left(-b\right)} \]

    if -6.5000000000000005e-70 < b < 7.40000000000000019e-174

    1. Initial program 77.7%

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

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

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

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

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

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

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

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

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

    if 7.40000000000000019e-174 < b

    1. Initial program 22.1%

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

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

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

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

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

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

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

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

Alternative 4: 79.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -9.2 \cdot 10^{-70}:\\ \;\;\;\;b \cdot \left(\frac{c}{{b}^{2}} + \frac{-1}{a}\right)\\ \mathbf{elif}\;b \leq 7.4 \cdot 10^{-174}:\\ \;\;\;\;\frac{\sqrt{a \cdot \left(c \cdot -4\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -9.2e-70)
   (* b (+ (/ c (pow b 2.0)) (/ -1.0 a)))
   (if (<= b 7.4e-174)
     (/ (- (sqrt (* a (* c -4.0))) b) (* a 2.0))
     (/ c (- b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -9.2e-70) {
		tmp = b * ((c / pow(b, 2.0)) + (-1.0 / a));
	} else if (b <= 7.4e-174) {
		tmp = (sqrt((a * (c * -4.0))) - 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 <= (-9.2d-70)) then
        tmp = b * ((c / (b ** 2.0d0)) + ((-1.0d0) / a))
    else if (b <= 7.4d-174) then
        tmp = (sqrt((a * (c * (-4.0d0)))) - 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 <= -9.2e-70) {
		tmp = b * ((c / Math.pow(b, 2.0)) + (-1.0 / a));
	} else if (b <= 7.4e-174) {
		tmp = (Math.sqrt((a * (c * -4.0))) - b) / (a * 2.0);
	} else {
		tmp = c / -b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -9.2e-70:
		tmp = b * ((c / math.pow(b, 2.0)) + (-1.0 / a))
	elif b <= 7.4e-174:
		tmp = (math.sqrt((a * (c * -4.0))) - b) / (a * 2.0)
	else:
		tmp = c / -b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -9.2e-70)
		tmp = Float64(b * Float64(Float64(c / (b ^ 2.0)) + Float64(-1.0 / a)));
	elseif (b <= 7.4e-174)
		tmp = Float64(Float64(sqrt(Float64(a * Float64(c * -4.0))) - b) / Float64(a * 2.0));
	else
		tmp = Float64(c / Float64(-b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -9.2e-70)
		tmp = b * ((c / (b ^ 2.0)) + (-1.0 / a));
	elseif (b <= 7.4e-174)
		tmp = (sqrt((a * (c * -4.0))) - b) / (a * 2.0);
	else
		tmp = c / -b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -9.2e-70], N[(b * N[(N[(c / N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.4e-174], N[(N[(N[Sqrt[N[(a * N[(c * -4.0), $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 -9.2 \cdot 10^{-70}:\\
\;\;\;\;b \cdot \left(\frac{c}{{b}^{2}} + \frac{-1}{a}\right)\\

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

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


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

    1. Initial program 69.2%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg85.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right) \cdot \left(-b\right)} \]

    if -9.20000000000000002e-70 < b < 7.40000000000000019e-174

    1. Initial program 77.7%

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

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

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

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

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

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

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

    if 7.40000000000000019e-174 < b

    1. Initial program 22.1%

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

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

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

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

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

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

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

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

Alternative 5: 79.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{-70}:\\ \;\;\;\;b \cdot \left(\frac{c}{{b}^{2}} + \frac{-1}{a}\right)\\ \mathbf{elif}\;b \leq 7.4 \cdot 10^{-174}:\\ \;\;\;\;\left(\sqrt{a \cdot \left(c \cdot -4\right)} - b\right) \cdot \frac{0.5}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -4e-70)
   (* b (+ (/ c (pow b 2.0)) (/ -1.0 a)))
   (if (<= b 7.4e-174)
     (* (- (sqrt (* a (* c -4.0))) b) (/ 0.5 a))
     (/ c (- b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -4e-70) {
		tmp = b * ((c / pow(b, 2.0)) + (-1.0 / a));
	} else if (b <= 7.4e-174) {
		tmp = (sqrt((a * (c * -4.0))) - b) * (0.5 / 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 <= (-4d-70)) then
        tmp = b * ((c / (b ** 2.0d0)) + ((-1.0d0) / a))
    else if (b <= 7.4d-174) then
        tmp = (sqrt((a * (c * (-4.0d0)))) - b) * (0.5d0 / 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 <= -4e-70) {
		tmp = b * ((c / Math.pow(b, 2.0)) + (-1.0 / a));
	} else if (b <= 7.4e-174) {
		tmp = (Math.sqrt((a * (c * -4.0))) - b) * (0.5 / a);
	} else {
		tmp = c / -b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -4e-70:
		tmp = b * ((c / math.pow(b, 2.0)) + (-1.0 / a))
	elif b <= 7.4e-174:
		tmp = (math.sqrt((a * (c * -4.0))) - b) * (0.5 / a)
	else:
		tmp = c / -b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -4e-70)
		tmp = Float64(b * Float64(Float64(c / (b ^ 2.0)) + Float64(-1.0 / a)));
	elseif (b <= 7.4e-174)
		tmp = Float64(Float64(sqrt(Float64(a * Float64(c * -4.0))) - b) * Float64(0.5 / a));
	else
		tmp = Float64(c / Float64(-b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -4e-70)
		tmp = b * ((c / (b ^ 2.0)) + (-1.0 / a));
	elseif (b <= 7.4e-174)
		tmp = (sqrt((a * (c * -4.0))) - b) * (0.5 / a);
	else
		tmp = c / -b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -4e-70], N[(b * N[(N[(c / N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.4e-174], N[(N[(N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] * N[(0.5 / a), $MachinePrecision]), $MachinePrecision], N[(c / (-b)), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{-70}:\\
\;\;\;\;b \cdot \left(\frac{c}{{b}^{2}} + \frac{-1}{a}\right)\\

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

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


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

    1. Initial program 69.2%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg85.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right) \cdot \left(-b\right)} \]

    if -3.99999999999999998e-70 < b < 7.40000000000000019e-174

    1. Initial program 77.7%

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. div-sub79.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{0.5}{a} \cdot \color{blue}{\left(\sqrt{a \cdot \left(c \cdot {\left(\sqrt[3]{-4}\right)}^{3}\right)} + -1 \cdot b\right)} \]
    12. Step-by-step derivation
      1. neg-mul-169.0%

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

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

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

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

    if 7.40000000000000019e-174 < b

    1. Initial program 22.1%

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

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

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

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

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

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

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

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

Alternative 6: 78.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -3.8 \cdot 10^{-70}:\\ \;\;\;\;b \cdot \left(\frac{c}{{b}^{2}} + \frac{-1}{a}\right)\\ \mathbf{elif}\;b \leq 7.4 \cdot 10^{-174}:\\ \;\;\;\;\sqrt{a \cdot \left(c \cdot -4\right)} \cdot \frac{0.5}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -3.8e-70)
   (* b (+ (/ c (pow b 2.0)) (/ -1.0 a)))
   (if (<= b 7.4e-174) (* (sqrt (* a (* c -4.0))) (/ 0.5 a)) (/ c (- b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -3.8e-70) {
		tmp = b * ((c / pow(b, 2.0)) + (-1.0 / a));
	} else if (b <= 7.4e-174) {
		tmp = sqrt((a * (c * -4.0))) * (0.5 / 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 <= (-3.8d-70)) then
        tmp = b * ((c / (b ** 2.0d0)) + ((-1.0d0) / a))
    else if (b <= 7.4d-174) then
        tmp = sqrt((a * (c * (-4.0d0)))) * (0.5d0 / 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 <= -3.8e-70) {
		tmp = b * ((c / Math.pow(b, 2.0)) + (-1.0 / a));
	} else if (b <= 7.4e-174) {
		tmp = Math.sqrt((a * (c * -4.0))) * (0.5 / a);
	} else {
		tmp = c / -b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -3.8e-70:
		tmp = b * ((c / math.pow(b, 2.0)) + (-1.0 / a))
	elif b <= 7.4e-174:
		tmp = math.sqrt((a * (c * -4.0))) * (0.5 / a)
	else:
		tmp = c / -b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -3.8e-70)
		tmp = Float64(b * Float64(Float64(c / (b ^ 2.0)) + Float64(-1.0 / a)));
	elseif (b <= 7.4e-174)
		tmp = Float64(sqrt(Float64(a * Float64(c * -4.0))) * Float64(0.5 / a));
	else
		tmp = Float64(c / Float64(-b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -3.8e-70)
		tmp = b * ((c / (b ^ 2.0)) + (-1.0 / a));
	elseif (b <= 7.4e-174)
		tmp = sqrt((a * (c * -4.0))) * (0.5 / a);
	else
		tmp = c / -b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -3.8e-70], N[(b * N[(N[(c / N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.4e-174], N[(N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.5 / a), $MachinePrecision]), $MachinePrecision], N[(c / (-b)), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{-70}:\\
\;\;\;\;b \cdot \left(\frac{c}{{b}^{2}} + \frac{-1}{a}\right)\\

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

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


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

    1. Initial program 69.2%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-1 \cdot \frac{c}{{b}^{2}} + \frac{1}{a}\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg85.2%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{c}{{b}^{2}}\right) \cdot \left(-b\right)} \]

    if -3.7999999999999998e-70 < b < 7.40000000000000019e-174

    1. Initial program 77.7%

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. div-sub79.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{0.5}{a} \cdot \color{blue}{\sqrt{a \cdot \left(c \cdot {\left(\sqrt[3]{-4}\right)}^{3}\right)}} \]
    12. Step-by-step derivation
      1. rem-cube-cbrt67.5%

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

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

    if 7.40000000000000019e-174 < b

    1. Initial program 22.1%

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

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

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

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

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

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

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

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

Alternative 7: 78.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -6.5 \cdot 10^{-70}:\\ \;\;\;\;\frac{b}{-a}\\ \mathbf{elif}\;b \leq 7.4 \cdot 10^{-174}:\\ \;\;\;\;\sqrt{a \cdot \left(c \cdot -4\right)} \cdot \frac{0.5}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -6.5e-70)
   (/ b (- a))
   (if (<= b 7.4e-174) (* (sqrt (* a (* c -4.0))) (/ 0.5 a)) (/ c (- b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -6.5e-70) {
		tmp = b / -a;
	} else if (b <= 7.4e-174) {
		tmp = sqrt((a * (c * -4.0))) * (0.5 / 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 <= (-6.5d-70)) then
        tmp = b / -a
    else if (b <= 7.4d-174) then
        tmp = sqrt((a * (c * (-4.0d0)))) * (0.5d0 / 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 <= -6.5e-70) {
		tmp = b / -a;
	} else if (b <= 7.4e-174) {
		tmp = Math.sqrt((a * (c * -4.0))) * (0.5 / a);
	} else {
		tmp = c / -b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -6.5e-70:
		tmp = b / -a
	elif b <= 7.4e-174:
		tmp = math.sqrt((a * (c * -4.0))) * (0.5 / a)
	else:
		tmp = c / -b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -6.5e-70)
		tmp = Float64(b / Float64(-a));
	elseif (b <= 7.4e-174)
		tmp = Float64(sqrt(Float64(a * Float64(c * -4.0))) * Float64(0.5 / a));
	else
		tmp = Float64(c / Float64(-b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -6.5e-70)
		tmp = b / -a;
	elseif (b <= 7.4e-174)
		tmp = sqrt((a * (c * -4.0))) * (0.5 / a);
	else
		tmp = c / -b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -6.5e-70], N[(b / (-a)), $MachinePrecision], If[LessEqual[b, 7.4e-174], N[(N[Sqrt[N[(a * N[(c * -4.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.5 / a), $MachinePrecision]), $MachinePrecision], N[(c / (-b)), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.5 \cdot 10^{-70}:\\
\;\;\;\;\frac{b}{-a}\\

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

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


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

    1. Initial program 69.2%

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

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

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

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

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

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

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

    if -6.5000000000000005e-70 < b < 7.40000000000000019e-174

    1. Initial program 77.7%

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. div-sub79.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{0.5}{a} \cdot \color{blue}{\sqrt{a \cdot \left(c \cdot {\left(\sqrt[3]{-4}\right)}^{3}\right)}} \]
    12. Step-by-step derivation
      1. rem-cube-cbrt67.5%

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

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

    if 7.40000000000000019e-174 < b

    1. Initial program 22.1%

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

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

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

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

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

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

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

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

Alternative 8: 71.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5.6 \cdot 10^{-160}:\\ \;\;\;\;\frac{b}{-a}\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{-198}:\\ \;\;\;\;0.5 \cdot \sqrt{\frac{c \cdot -4}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -5.6e-160)
   (/ b (- a))
   (if (<= b 2.3e-198) (* 0.5 (sqrt (/ (* c -4.0) a))) (/ c (- b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5.6e-160) {
		tmp = b / -a;
	} else if (b <= 2.3e-198) {
		tmp = 0.5 * sqrt(((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 <= (-5.6d-160)) then
        tmp = b / -a
    else if (b <= 2.3d-198) then
        tmp = 0.5d0 * sqrt(((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 <= -5.6e-160) {
		tmp = b / -a;
	} else if (b <= 2.3e-198) {
		tmp = 0.5 * Math.sqrt(((c * -4.0) / a));
	} else {
		tmp = c / -b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -5.6e-160:
		tmp = b / -a
	elif b <= 2.3e-198:
		tmp = 0.5 * math.sqrt(((c * -4.0) / a))
	else:
		tmp = c / -b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -5.6e-160)
		tmp = Float64(b / Float64(-a));
	elseif (b <= 2.3e-198)
		tmp = Float64(0.5 * sqrt(Float64(Float64(c * -4.0) / a)));
	else
		tmp = Float64(c / Float64(-b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -5.6e-160)
		tmp = b / -a;
	elseif (b <= 2.3e-198)
		tmp = 0.5 * sqrt(((c * -4.0) / a));
	else
		tmp = c / -b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -5.6e-160], N[(b / (-a)), $MachinePrecision], If[LessEqual[b, 2.3e-198], N[(0.5 * N[Sqrt[N[(N[(c * -4.0), $MachinePrecision] / a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c / (-b)), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.6 \cdot 10^{-160}:\\
\;\;\;\;\frac{b}{-a}\\

\mathbf{elif}\;b \leq 2.3 \cdot 10^{-198}:\\
\;\;\;\;0.5 \cdot \sqrt{\frac{c \cdot -4}{a}}\\

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


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

    1. Initial program 72.6%

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

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

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

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

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

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

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

    if -5.60000000000000032e-160 < b < 2.30000000000000013e-198

    1. Initial program 72.7%

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. div-sub75.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \sqrt{\frac{c \cdot {\left(\sqrt[3]{-4}\right)}^{3}}{a}}} \]
    12. Step-by-step derivation
      1. rem-cube-cbrt42.4%

        \[\leadsto 0.5 \cdot \sqrt{\frac{c \cdot \color{blue}{-4}}{a}} \]
      2. *-commutative42.4%

        \[\leadsto 0.5 \cdot \sqrt{\frac{\color{blue}{-4 \cdot c}}{a}} \]
      3. associate-*r/42.2%

        \[\leadsto 0.5 \cdot \sqrt{\color{blue}{-4 \cdot \frac{c}{a}}} \]
    13. Simplified42.2%

      \[\leadsto \color{blue}{0.5 \cdot \sqrt{-4 \cdot \frac{c}{a}}} \]
    14. Step-by-step derivation
      1. pow142.2%

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

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

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

      \[\leadsto \color{blue}{{\left(0.5 \cdot \sqrt{\frac{c \cdot -4}{a}}\right)}^{1}} \]
    16. Step-by-step derivation
      1. unpow142.4%

        \[\leadsto \color{blue}{0.5 \cdot \sqrt{\frac{c \cdot -4}{a}}} \]
    17. Simplified42.4%

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

    if 2.30000000000000013e-198 < b

    1. Initial program 24.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.6 \cdot 10^{-160}:\\ \;\;\;\;\frac{b}{-a}\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{-198}:\\ \;\;\;\;0.5 \cdot \sqrt{\frac{c \cdot -4}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 71.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.45 \cdot 10^{-158}:\\ \;\;\;\;\frac{b}{-a}\\ \mathbf{elif}\;b \leq 1.9 \cdot 10^{-198}:\\ \;\;\;\;0.5 \cdot \sqrt{-4 \cdot \frac{c}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1.45e-158)
   (/ b (- a))
   (if (<= b 1.9e-198) (* 0.5 (sqrt (* -4.0 (/ c a)))) (/ c (- b)))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.45e-158) {
		tmp = b / -a;
	} else if (b <= 1.9e-198) {
		tmp = 0.5 * sqrt((-4.0 * (c / 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.45d-158)) then
        tmp = b / -a
    else if (b <= 1.9d-198) then
        tmp = 0.5d0 * sqrt(((-4.0d0) * (c / 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.45e-158) {
		tmp = b / -a;
	} else if (b <= 1.9e-198) {
		tmp = 0.5 * Math.sqrt((-4.0 * (c / a)));
	} else {
		tmp = c / -b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -1.45e-158:
		tmp = b / -a
	elif b <= 1.9e-198:
		tmp = 0.5 * math.sqrt((-4.0 * (c / a)))
	else:
		tmp = c / -b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -1.45e-158)
		tmp = Float64(b / Float64(-a));
	elseif (b <= 1.9e-198)
		tmp = Float64(0.5 * sqrt(Float64(-4.0 * Float64(c / a))));
	else
		tmp = Float64(c / Float64(-b));
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -1.45e-158)
		tmp = b / -a;
	elseif (b <= 1.9e-198)
		tmp = 0.5 * sqrt((-4.0 * (c / a)));
	else
		tmp = c / -b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -1.45e-158], N[(b / (-a)), $MachinePrecision], If[LessEqual[b, 1.9e-198], N[(0.5 * N[Sqrt[N[(-4.0 * N[(c / a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c / (-b)), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.45 \cdot 10^{-158}:\\
\;\;\;\;\frac{b}{-a}\\

\mathbf{elif}\;b \leq 1.9 \cdot 10^{-198}:\\
\;\;\;\;0.5 \cdot \sqrt{-4 \cdot \frac{c}{a}}\\

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


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

    1. Initial program 72.6%

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

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

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

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

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

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

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

    if -1.4499999999999999e-158 < b < 1.9000000000000001e-198

    1. Initial program 72.7%

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. div-sub75.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{0.5 \cdot \sqrt{\frac{c \cdot {\left(\sqrt[3]{-4}\right)}^{3}}{a}}} \]
    12. Step-by-step derivation
      1. rem-cube-cbrt42.4%

        \[\leadsto 0.5 \cdot \sqrt{\frac{c \cdot \color{blue}{-4}}{a}} \]
      2. *-commutative42.4%

        \[\leadsto 0.5 \cdot \sqrt{\frac{\color{blue}{-4 \cdot c}}{a}} \]
      3. associate-*r/42.2%

        \[\leadsto 0.5 \cdot \sqrt{\color{blue}{-4 \cdot \frac{c}{a}}} \]
    13. Simplified42.2%

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

    if 1.9000000000000001e-198 < b

    1. Initial program 24.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.45 \cdot 10^{-158}:\\ \;\;\;\;\frac{b}{-a}\\ \mathbf{elif}\;b \leq 1.9 \cdot 10^{-198}:\\ \;\;\;\;0.5 \cdot \sqrt{-4 \cdot \frac{c}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 68.0% accurate, 12.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.5 \cdot 10^{-308}:\\
\;\;\;\;\frac{b}{-a}\\

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


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

    1. Initial program 73.1%

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

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

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

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

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

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

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

    if 3.5e-308 < b

    1. Initial program 29.0%

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

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

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

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

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

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

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

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

Alternative 11: 42.8% accurate, 12.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 4400000:\\
\;\;\;\;\frac{b}{-a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 4.4e6

    1. Initial program 66.7%

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

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

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

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

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

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

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

    if 4.4e6 < b

    1. Initial program 11.2%

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. div-sub9.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{0.5}{a} \cdot \frac{{b}^{2} - \left({b}^{2} + \color{blue}{\left(-4\right)} \cdot \left(a \cdot c\right)\right)}{b - \mathsf{hypot}\left(\sqrt{a \cdot \left(c \cdot -4\right)}, b\right)} \]
      6. cancel-sign-sub-inv3.3%

        \[\leadsto \frac{0.5}{a} \cdot \frac{{b}^{2} - \color{blue}{\left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}}{b - \mathsf{hypot}\left(\sqrt{a \cdot \left(c \cdot -4\right)}, b\right)} \]
      7. associate--r-3.5%

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

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

        \[\leadsto \frac{0.5}{a} \cdot \frac{0 + 4 \cdot \color{blue}{\left(c \cdot a\right)}}{b - \mathsf{hypot}\left(\sqrt{a \cdot \left(c \cdot -4\right)}, b\right)} \]
    12. Simplified3.7%

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

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

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

Alternative 12: 10.7% 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 53.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{0.5}{a} \cdot \frac{\color{blue}{{b}^{2}} - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)} \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}}{b - \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}} \]
    10. add-sqr-sqrt27.7%

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

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

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

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

      \[\leadsto \frac{0.5}{a} \cdot \frac{{b}^{2} - \mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}{b - \color{blue}{\mathsf{hypot}\left(\sqrt{a \cdot \left(c \cdot -4\right)}, b\right)}} \]
  10. Applied egg-rr27.6%

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

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

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

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

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

      \[\leadsto \frac{0.5}{a} \cdot \frac{{b}^{2} - \left({b}^{2} + \color{blue}{\left(-4\right)} \cdot \left(a \cdot c\right)\right)}{b - \mathsf{hypot}\left(\sqrt{a \cdot \left(c \cdot -4\right)}, b\right)} \]
    6. cancel-sign-sub-inv27.5%

      \[\leadsto \frac{0.5}{a} \cdot \frac{{b}^{2} - \color{blue}{\left({b}^{2} - 4 \cdot \left(a \cdot c\right)\right)}}{b - \mathsf{hypot}\left(\sqrt{a \cdot \left(c \cdot -4\right)}, b\right)} \]
    7. associate--r-27.7%

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

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

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

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

    \[\leadsto \color{blue}{\frac{c}{b}} \]
  14. Add Preprocessing

Alternative 13: 2.5% accurate, 38.7× speedup?

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

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

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

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

    \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} - b}{a \cdot 2}} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. *-un-lft-identity53.9%

      \[\leadsto \frac{\color{blue}{1 \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)}} - b}{a \cdot 2} \]
    2. *-un-lft-identity53.9%

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

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

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

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

      \[\leadsto \frac{\color{blue}{\left(1 \cdot \sqrt{\mathsf{fma}\left(a, c \cdot -4, b \cdot b\right)} + \left(-b\right)\right)} + \mathsf{fma}\left(-b, 1, b \cdot 1\right)}{a \cdot 2} \]
    7. *-un-lft-identity53.9%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \mathsf{fma}\left(\color{blue}{\sqrt{b} \cdot \sqrt{b}}, 1, b \cdot 1\right)}{a \cdot 2} \]
    19. add-sqr-sqrt35.3%

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

      \[\leadsto \frac{\left(b + \sqrt{\mathsf{fma}\left(a, c \cdot -4, {b}^{2}\right)}\right) + \mathsf{fma}\left(b, 1, \color{blue}{1 \cdot b}\right)}{a \cdot 2} \]
    21. *-un-lft-identity35.3%

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{b}{a}} \]
  10. Add Preprocessing

Reproduce

?
herbie shell --seed 2024130 
(FPCore (a b c)
  :name "Quadratic roots, full range"
  :precision binary64
  (/ (+ (- b) (sqrt (- (* b b) (* (* 4.0 a) c)))) (* 2.0 a)))