The quadratic formula (r2)

Percentage Accurate: 51.5% → 85.3%
Time: 19.6s
Alternatives: 8
Speedup: 12.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 8 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.5% accurate, 1.0× speedup?

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

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

Alternative 1: 85.3% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 23.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(\frac{c}{b} + a \cdot \color{blue}{\left(c \cdot \frac{c}{{b}^{3}}\right)}\right) \]
    9. Applied egg-rr85.7%

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

    if -6.50000000000000034e-89 < b < 1.5500000000000001e92

    1. Initial program 79.9%

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

    if 1.5500000000000001e92 < b

    1. Initial program 55.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 81.2% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 24.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{c}{b}} \]
      2. distribute-neg-frac285.0%

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

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

    if -1.15000000000000008e-92 < b < 3.8e-86

    1. Initial program 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.8e-86 < b

    1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 80.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.6 \cdot 10^{-90}:\\
\;\;\;\;\frac{c}{-b} - a \cdot \left(c \cdot \frac{c}{{b}^{3}}\right)\\

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

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


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

    1. Initial program 23.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -1 \cdot \left(\frac{c}{b} + a \cdot \color{blue}{\left(c \cdot \frac{c}{{b}^{3}}\right)}\right) \]
    9. Applied egg-rr85.7%

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

    if -7.6e-90 < b < 1.4999999999999999e-82

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4999999999999999e-82 < b

    1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 68.2% accurate, 9.7× speedup?

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

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

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


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

    1. Initial program 33.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{c}{b}} \]
      2. distribute-neg-frac270.1%

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

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

    if -9.999999999999969e-311 < b

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 68.1% accurate, 12.9× speedup?

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

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

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


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

    1. Initial program 33.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{c}{b}} \]
      2. distribute-neg-frac270.1%

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

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

    if -7.4000000000000006e-304 < b

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 35.3% accurate, 29.0× speedup?

\[\begin{array}{l} \\ \frac{c}{-b} \end{array} \]
(FPCore (a b c) :precision binary64 (/ c (- b)))
double code(double a, double b, double c) {
	return c / -b;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    code = c / -b
end function
public static double code(double a, double b, double c) {
	return c / -b;
}
def code(a, b, c):
	return c / -b
function code(a, b, c)
	return Float64(c / Float64(-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 49.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{c}{b}} \]
    2. distribute-neg-frac241.9%

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

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

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

Alternative 7: 2.4% accurate, 38.7× speedup?

\[\begin{array}{l} \\ b \cdot 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}

\\
b \cdot a
\end{array}
Derivation
  1. Initial program 49.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto {\color{blue}{\left({\left(\frac{1 \cdot b}{a}\right)}^{0.3333333333333333} \cdot \left(\sqrt[3]{-0.5} \cdot \sqrt[3]{2}\right)\right)}}^{3} \]
  8. Step-by-step derivation
    1. unpow1/330.9%

      \[\leadsto {\left(\color{blue}{\sqrt[3]{\frac{1 \cdot b}{a}}} \cdot \left(\sqrt[3]{-0.5} \cdot \sqrt[3]{2}\right)\right)}^{3} \]
    2. *-lft-identity30.9%

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

    \[\leadsto {\color{blue}{\left(\sqrt[3]{\frac{b}{a}} \cdot \left(\sqrt[3]{-0.5} \cdot \sqrt[3]{2}\right)\right)}}^{3} \]
  10. Applied egg-rr2.7%

    \[\leadsto \color{blue}{b \cdot a} \]
  11. Final simplification2.7%

    \[\leadsto b \cdot a \]
  12. Add Preprocessing

Alternative 8: 5.1% accurate, 38.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto {\color{blue}{\left({\left(\frac{1 \cdot b}{a}\right)}^{0.3333333333333333} \cdot \left(\sqrt[3]{-0.5} \cdot \sqrt[3]{2}\right)\right)}}^{3} \]
  8. Step-by-step derivation
    1. unpow1/330.9%

      \[\leadsto {\left(\color{blue}{\sqrt[3]{\frac{1 \cdot b}{a}}} \cdot \left(\sqrt[3]{-0.5} \cdot \sqrt[3]{2}\right)\right)}^{3} \]
    2. *-lft-identity30.9%

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

    \[\leadsto {\color{blue}{\left(\sqrt[3]{\frac{b}{a}} \cdot \left(\sqrt[3]{-0.5} \cdot \sqrt[3]{2}\right)\right)}}^{3} \]
  10. Applied egg-rr6.9%

    \[\leadsto \color{blue}{\frac{a}{b}} \]
  11. Final simplification6.9%

    \[\leadsto \frac{a}{b} \]
  12. Add Preprocessing

Developer target: 70.3% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024047 
(FPCore (a b c)
  :name "The quadratic formula (r2)"
  :precision binary64

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

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