Cubic critical

Percentage Accurate: 51.5% → 85.2%
Time: 14.1s
Alternatives: 15
Speedup: 11.6×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.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) - ((3.0d0 * a) * c)))) / (3.0d0 * a)
end function
public static double code(double a, double b, double c) {
	return (-b + Math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
def code(a, b, c):
	return (-b + math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a))
end
function tmp = code(a, b, c)
	tmp = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \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 15 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 - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.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) - ((3.0d0 * a) * c)))) / (3.0d0 * a)
end function
public static double code(double a, double b, double c) {
	return (-b + Math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
}
def code(a, b, c):
	return (-b + math.sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a)
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(Float64(3.0 * a) * c)))) / Float64(3.0 * a))
end
function tmp = code(a, b, c)
	tmp = (-b + sqrt(((b * b) - ((3.0 * a) * c)))) / (3.0 * a);
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 85.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{+89}:\\
\;\;\;\;\frac{\frac{b}{a}}{-1.5}\\

\mathbf{elif}\;b \leq 9.5 \cdot 10^{-44}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c} - b}{a \cdot 3}\\

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


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

    1. Initial program 46.3%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*46.3%

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative93.8%

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

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. associate-*l/93.9%

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
      2. clear-num93.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{b \cdot -0.6666666666666666}}} \]
    9. Applied egg-rr93.8%

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{b \cdot -0.6666666666666666}}} \]
    10. Step-by-step derivation
      1. associate-/r/93.7%

        \[\leadsto \color{blue}{\frac{1}{a} \cdot \left(b \cdot -0.6666666666666666\right)} \]
    11. Simplified93.7%

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot b}{a}} \cdot -0.6666666666666666 \]
      3. *-un-lft-identity93.8%

        \[\leadsto \frac{\color{blue}{b}}{a} \cdot -0.6666666666666666 \]
      4. metadata-eval93.8%

        \[\leadsto \frac{b}{a} \cdot \color{blue}{\frac{1}{-1.5}} \]
      5. div-inv93.9%

        \[\leadsto \color{blue}{\frac{\frac{b}{a}}{-1.5}} \]
    13. Applied egg-rr93.9%

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

    if -3.80000000000000023e89 < b < 9.49999999999999924e-44

    1. Initial program 83.5%

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

    if 9.49999999999999924e-44 < b

    1. Initial program 16.0%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*16.0%

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Applied egg-rr27.0%

      \[\leadsto \color{blue}{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{-3} \cdot \frac{1}{a}} \]
    6. Taylor expanded in b around inf 0.0%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \frac{c \cdot {\left(\sqrt{-3}\right)}^{2}}{b}} \]
    7. Step-by-step derivation
      1. associate-*r/0.0%

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

        \[\leadsto \frac{\color{blue}{\left(c \cdot {\left(\sqrt{-3}\right)}^{2}\right) \cdot 0.16666666666666666}}{b} \]
      3. unpow20.0%

        \[\leadsto \frac{\left(c \cdot \color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)}\right) \cdot 0.16666666666666666}{b} \]
      4. rem-square-sqrt91.9%

        \[\leadsto \frac{\left(c \cdot \color{blue}{-3}\right) \cdot 0.16666666666666666}{b} \]
    8. Simplified91.9%

      \[\leadsto \color{blue}{\frac{\left(c \cdot -3\right) \cdot 0.16666666666666666}{b}} \]
    9. Taylor expanded in c around 0 92.1%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative92.1%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
    11. Simplified92.1%

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

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

Alternative 2: 85.1% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.5 \cdot 10^{+88}:\\
\;\;\;\;\frac{\frac{b}{a}}{-1.5}\\

\mathbf{elif}\;b \leq 1.45 \cdot 10^{-43}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\

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


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

    1. Initial program 46.3%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*46.3%

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative93.8%

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

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. associate-*l/93.9%

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
      2. clear-num93.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{b \cdot -0.6666666666666666}}} \]
    9. Applied egg-rr93.8%

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{b \cdot -0.6666666666666666}}} \]
    10. Step-by-step derivation
      1. associate-/r/93.7%

        \[\leadsto \color{blue}{\frac{1}{a} \cdot \left(b \cdot -0.6666666666666666\right)} \]
    11. Simplified93.7%

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot b}{a}} \cdot -0.6666666666666666 \]
      3. *-un-lft-identity93.8%

        \[\leadsto \frac{\color{blue}{b}}{a} \cdot -0.6666666666666666 \]
      4. metadata-eval93.8%

        \[\leadsto \frac{b}{a} \cdot \color{blue}{\frac{1}{-1.5}} \]
      5. div-inv93.9%

        \[\leadsto \color{blue}{\frac{\frac{b}{a}}{-1.5}} \]
    13. Applied egg-rr93.9%

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

    if -2.49999999999999999e88 < b < 1.4500000000000001e-43

    1. Initial program 83.5%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*83.5%

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

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

    if 1.4500000000000001e-43 < b

    1. Initial program 16.0%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*16.0%

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Applied egg-rr27.0%

      \[\leadsto \color{blue}{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{-3} \cdot \frac{1}{a}} \]
    6. Taylor expanded in b around inf 0.0%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \frac{c \cdot {\left(\sqrt{-3}\right)}^{2}}{b}} \]
    7. Step-by-step derivation
      1. associate-*r/0.0%

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

        \[\leadsto \frac{\color{blue}{\left(c \cdot {\left(\sqrt{-3}\right)}^{2}\right) \cdot 0.16666666666666666}}{b} \]
      3. unpow20.0%

        \[\leadsto \frac{\left(c \cdot \color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)}\right) \cdot 0.16666666666666666}{b} \]
      4. rem-square-sqrt91.9%

        \[\leadsto \frac{\left(c \cdot \color{blue}{-3}\right) \cdot 0.16666666666666666}{b} \]
    8. Simplified91.9%

      \[\leadsto \color{blue}{\frac{\left(c \cdot -3\right) \cdot 0.16666666666666666}{b}} \]
    9. Taylor expanded in c around 0 92.1%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative92.1%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
    11. Simplified92.1%

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

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

Alternative 3: 80.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.2 \cdot 10^{-92}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\

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

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


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

    1. Initial program 64.5%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*64.5%

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative85.7%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified85.7%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. associate-*l/85.8%

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    9. Applied egg-rr85.8%

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

    if -8.2000000000000005e-92 < b < 1.32e-68

    1. Initial program 76.2%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*76.1%

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

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

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

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

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

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

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

    if 1.32e-68 < b

    1. Initial program 17.4%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*17.4%

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

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

      \[\leadsto \color{blue}{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{-3} \cdot \frac{1}{a}} \]
    6. Taylor expanded in b around inf 0.0%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \frac{c \cdot {\left(\sqrt{-3}\right)}^{2}}{b}} \]
    7. Step-by-step derivation
      1. associate-*r/0.0%

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

        \[\leadsto \frac{\color{blue}{\left(c \cdot {\left(\sqrt{-3}\right)}^{2}\right) \cdot 0.16666666666666666}}{b} \]
      3. unpow20.0%

        \[\leadsto \frac{\left(c \cdot \color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)}\right) \cdot 0.16666666666666666}{b} \]
      4. rem-square-sqrt90.5%

        \[\leadsto \frac{\left(c \cdot \color{blue}{-3}\right) \cdot 0.16666666666666666}{b} \]
    8. Simplified90.5%

      \[\leadsto \color{blue}{\frac{\left(c \cdot -3\right) \cdot 0.16666666666666666}{b}} \]
    9. Taylor expanded in c around 0 90.8%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative90.8%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
    11. Simplified90.8%

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

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

Alternative 4: 80.3% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.9 \cdot 10^{-91}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\

\mathbf{elif}\;b \leq 5.8 \cdot 10^{-65}:\\
\;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -3} - b}{a \cdot 3}\\

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


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

    1. Initial program 64.5%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*64.5%

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative85.7%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified85.7%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. associate-*l/85.8%

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    9. Applied egg-rr85.8%

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

    if -5.90000000000000025e-91 < b < 5.7999999999999996e-65

    1. Initial program 76.2%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*76.1%

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

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

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

    if 5.7999999999999996e-65 < b

    1. Initial program 17.4%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*17.4%

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

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

      \[\leadsto \color{blue}{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{-3} \cdot \frac{1}{a}} \]
    6. Taylor expanded in b around inf 0.0%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \frac{c \cdot {\left(\sqrt{-3}\right)}^{2}}{b}} \]
    7. Step-by-step derivation
      1. associate-*r/0.0%

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

        \[\leadsto \frac{\color{blue}{\left(c \cdot {\left(\sqrt{-3}\right)}^{2}\right) \cdot 0.16666666666666666}}{b} \]
      3. unpow20.0%

        \[\leadsto \frac{\left(c \cdot \color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)}\right) \cdot 0.16666666666666666}{b} \]
      4. rem-square-sqrt90.5%

        \[\leadsto \frac{\left(c \cdot \color{blue}{-3}\right) \cdot 0.16666666666666666}{b} \]
    8. Simplified90.5%

      \[\leadsto \color{blue}{\frac{\left(c \cdot -3\right) \cdot 0.16666666666666666}{b}} \]
    9. Taylor expanded in c around 0 90.8%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative90.8%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
    11. Simplified90.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.9 \cdot 10^{-91}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 5.8 \cdot 10^{-65}:\\ \;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -3} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 80.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.9 \cdot 10^{-90}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\

\mathbf{elif}\;b \leq 1.35 \cdot 10^{-65}:\\
\;\;\;\;\frac{\frac{b + \sqrt{c \cdot \left(a \cdot -3\right)}}{3}}{a}\\

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


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

    1. Initial program 64.5%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*64.5%

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative85.7%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified85.7%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. associate-*l/85.8%

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    9. Applied egg-rr85.8%

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

    if -1.9e-90 < b < 1.3499999999999999e-65

    1. Initial program 76.2%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*76.1%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot a}{\left(-b\right) + \sqrt{c \cdot \left(a \cdot -3\right)}}\right)}^{-1}} \]
      3. *-un-lft-identity76.0%

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

        \[\leadsto {\color{blue}{\left(\frac{3}{1} \cdot \frac{a}{\left(-b\right) + \sqrt{c \cdot \left(a \cdot -3\right)}}\right)}}^{-1} \]
      5. metadata-eval75.7%

        \[\leadsto {\left(\color{blue}{3} \cdot \frac{a}{\left(-b\right) + \sqrt{c \cdot \left(a \cdot -3\right)}}\right)}^{-1} \]
      6. add-sqr-sqrt43.9%

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

        \[\leadsto {\left(3 \cdot \frac{a}{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}} + \sqrt{c \cdot \left(a \cdot -3\right)}}\right)}^{-1} \]
      8. sqr-neg74.8%

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

        \[\leadsto {\left(3 \cdot \frac{a}{\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \sqrt{c \cdot \left(a \cdot -3\right)}}\right)}^{-1} \]
      10. add-sqr-sqrt74.9%

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

      \[\leadsto \color{blue}{{\left(3 \cdot \frac{a}{b + \sqrt{c \cdot \left(a \cdot -3\right)}}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-174.9%

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\frac{a \cdot 3}{b + \sqrt{c \cdot \left(a \cdot -3\right)}}}} \]
    12. Step-by-step derivation
      1. clear-num75.2%

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

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

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

        \[\leadsto \frac{1}{a} \cdot \frac{b + \sqrt{c \cdot \color{blue}{\left(-3 \cdot a\right)}}}{3} \]
      5. associate-*r*74.9%

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

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

      \[\leadsto \color{blue}{\frac{1}{a} \cdot \frac{b + \sqrt{a \cdot \left(c \cdot -3\right)}}{3}} \]
    14. Step-by-step derivation
      1. associate-*l/75.3%

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

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

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

        \[\leadsto \frac{\frac{b + \sqrt{\color{blue}{\left(c \cdot a\right)} \cdot -3}}{3}}{a} \]
      5. associate-*l*75.2%

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

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

    if 1.3499999999999999e-65 < b

    1. Initial program 17.4%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*17.4%

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

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

      \[\leadsto \color{blue}{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{-3} \cdot \frac{1}{a}} \]
    6. Taylor expanded in b around inf 0.0%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \frac{c \cdot {\left(\sqrt{-3}\right)}^{2}}{b}} \]
    7. Step-by-step derivation
      1. associate-*r/0.0%

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

        \[\leadsto \frac{\color{blue}{\left(c \cdot {\left(\sqrt{-3}\right)}^{2}\right) \cdot 0.16666666666666666}}{b} \]
      3. unpow20.0%

        \[\leadsto \frac{\left(c \cdot \color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)}\right) \cdot 0.16666666666666666}{b} \]
      4. rem-square-sqrt90.5%

        \[\leadsto \frac{\left(c \cdot \color{blue}{-3}\right) \cdot 0.16666666666666666}{b} \]
    8. Simplified90.5%

      \[\leadsto \color{blue}{\frac{\left(c \cdot -3\right) \cdot 0.16666666666666666}{b}} \]
    9. Taylor expanded in c around 0 90.8%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative90.8%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
    11. Simplified90.8%

      \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 6: 80.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -9 \cdot 10^{-92}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\

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

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


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

    1. Initial program 64.5%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*64.5%

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative85.7%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified85.7%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. associate-*l/85.8%

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    9. Applied egg-rr85.8%

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

    if -9.0000000000000001e-92 < b < 3.8000000000000002e-65

    1. Initial program 76.2%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*76.1%

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. *-un-lft-identity76.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{1 \cdot \frac{b + \sqrt{c \cdot \left(a \cdot -3\right)}}{a \cdot 3}} \]
    10. Step-by-step derivation
      1. *-lft-identity75.2%

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

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

    if 3.8000000000000002e-65 < b

    1. Initial program 17.4%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*17.4%

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

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

      \[\leadsto \color{blue}{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{-3} \cdot \frac{1}{a}} \]
    6. Taylor expanded in b around inf 0.0%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \frac{c \cdot {\left(\sqrt{-3}\right)}^{2}}{b}} \]
    7. Step-by-step derivation
      1. associate-*r/0.0%

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

        \[\leadsto \frac{\color{blue}{\left(c \cdot {\left(\sqrt{-3}\right)}^{2}\right) \cdot 0.16666666666666666}}{b} \]
      3. unpow20.0%

        \[\leadsto \frac{\left(c \cdot \color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)}\right) \cdot 0.16666666666666666}{b} \]
      4. rem-square-sqrt90.5%

        \[\leadsto \frac{\left(c \cdot \color{blue}{-3}\right) \cdot 0.16666666666666666}{b} \]
    8. Simplified90.5%

      \[\leadsto \color{blue}{\frac{\left(c \cdot -3\right) \cdot 0.16666666666666666}{b}} \]
    9. Taylor expanded in c around 0 90.8%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative90.8%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
    11. Simplified90.8%

      \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 80.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.2 \cdot 10^{-92}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\

\mathbf{elif}\;b \leq 8.2 \cdot 10^{-66}:\\
\;\;\;\;\frac{0.3333333333333333}{a} \cdot \left(b + \sqrt{a \cdot \left(c \cdot -3\right)}\right)\\

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


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

    1. Initial program 64.5%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*64.5%

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative85.7%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified85.7%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. associate-*l/85.8%

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    9. Applied egg-rr85.8%

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

    if -8.2000000000000005e-92 < b < 8.19999999999999996e-66

    1. Initial program 76.2%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*76.1%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot a}{\left(-b\right) + \sqrt{c \cdot \left(a \cdot -3\right)}}\right)}^{-1}} \]
      3. *-un-lft-identity76.0%

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

        \[\leadsto {\color{blue}{\left(\frac{3}{1} \cdot \frac{a}{\left(-b\right) + \sqrt{c \cdot \left(a \cdot -3\right)}}\right)}}^{-1} \]
      5. metadata-eval75.7%

        \[\leadsto {\left(\color{blue}{3} \cdot \frac{a}{\left(-b\right) + \sqrt{c \cdot \left(a \cdot -3\right)}}\right)}^{-1} \]
      6. add-sqr-sqrt43.9%

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

        \[\leadsto {\left(3 \cdot \frac{a}{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}} + \sqrt{c \cdot \left(a \cdot -3\right)}}\right)}^{-1} \]
      8. sqr-neg74.8%

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

        \[\leadsto {\left(3 \cdot \frac{a}{\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \sqrt{c \cdot \left(a \cdot -3\right)}}\right)}^{-1} \]
      10. add-sqr-sqrt74.9%

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

      \[\leadsto \color{blue}{{\left(3 \cdot \frac{a}{b + \sqrt{c \cdot \left(a \cdot -3\right)}}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-174.9%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{3}}{a}} \cdot \left(1 \cdot \left(b + \sqrt{c \cdot \left(a \cdot -3\right)}\right)\right) \]
      5. metadata-eval75.0%

        \[\leadsto \frac{\color{blue}{0.3333333333333333}}{a} \cdot \left(1 \cdot \left(b + \sqrt{c \cdot \left(a \cdot -3\right)}\right)\right) \]
      6. *-un-lft-identity75.0%

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

        \[\leadsto \frac{0.3333333333333333}{a} \cdot \left(b + \sqrt{c \cdot \color{blue}{\left(-3 \cdot a\right)}}\right) \]
      8. associate-*r*75.1%

        \[\leadsto \frac{0.3333333333333333}{a} \cdot \left(b + \sqrt{\color{blue}{\left(c \cdot -3\right) \cdot a}}\right) \]
      9. *-commutative75.1%

        \[\leadsto \frac{0.3333333333333333}{a} \cdot \left(b + \sqrt{\color{blue}{a \cdot \left(c \cdot -3\right)}}\right) \]
    13. Applied egg-rr75.1%

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

    if 8.19999999999999996e-66 < b

    1. Initial program 17.4%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*17.4%

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

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

      \[\leadsto \color{blue}{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{-3} \cdot \frac{1}{a}} \]
    6. Taylor expanded in b around inf 0.0%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \frac{c \cdot {\left(\sqrt{-3}\right)}^{2}}{b}} \]
    7. Step-by-step derivation
      1. associate-*r/0.0%

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

        \[\leadsto \frac{\color{blue}{\left(c \cdot {\left(\sqrt{-3}\right)}^{2}\right) \cdot 0.16666666666666666}}{b} \]
      3. unpow20.0%

        \[\leadsto \frac{\left(c \cdot \color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)}\right) \cdot 0.16666666666666666}{b} \]
      4. rem-square-sqrt90.5%

        \[\leadsto \frac{\left(c \cdot \color{blue}{-3}\right) \cdot 0.16666666666666666}{b} \]
    8. Simplified90.5%

      \[\leadsto \color{blue}{\frac{\left(c \cdot -3\right) \cdot 0.16666666666666666}{b}} \]
    9. Taylor expanded in c around 0 90.8%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative90.8%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
    11. Simplified90.8%

      \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 8: 80.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.2 \cdot 10^{-92}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\

\mathbf{elif}\;b \leq 2.7 \cdot 10^{-66}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{b + \sqrt{a \cdot \left(c \cdot -3\right)}}{a}\\

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


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

    1. Initial program 64.5%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*64.5%

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative85.7%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Simplified85.7%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. associate-*l/85.8%

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    9. Applied egg-rr85.8%

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

    if -8.2000000000000005e-92 < b < 2.69999999999999996e-66

    1. Initial program 76.2%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*76.1%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot a}{\left(-b\right) + \sqrt{c \cdot \left(a \cdot -3\right)}}\right)}^{-1}} \]
      3. *-un-lft-identity76.0%

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

        \[\leadsto {\color{blue}{\left(\frac{3}{1} \cdot \frac{a}{\left(-b\right) + \sqrt{c \cdot \left(a \cdot -3\right)}}\right)}}^{-1} \]
      5. metadata-eval75.7%

        \[\leadsto {\left(\color{blue}{3} \cdot \frac{a}{\left(-b\right) + \sqrt{c \cdot \left(a \cdot -3\right)}}\right)}^{-1} \]
      6. add-sqr-sqrt43.9%

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

        \[\leadsto {\left(3 \cdot \frac{a}{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}} + \sqrt{c \cdot \left(a \cdot -3\right)}}\right)}^{-1} \]
      8. sqr-neg74.8%

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

        \[\leadsto {\left(3 \cdot \frac{a}{\color{blue}{\sqrt{b} \cdot \sqrt{b}} + \sqrt{c \cdot \left(a \cdot -3\right)}}\right)}^{-1} \]
      10. add-sqr-sqrt74.9%

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

      \[\leadsto \color{blue}{{\left(3 \cdot \frac{a}{b + \sqrt{c \cdot \left(a \cdot -3\right)}}\right)}^{-1}} \]
    10. Step-by-step derivation
      1. unpow-174.9%

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{0.3333333333333333}}{a} \cdot b + \frac{1}{a \cdot 3} \cdot \sqrt{c \cdot \left(a \cdot -3\right)} \]
      6. *-commutative75.1%

        \[\leadsto \frac{0.3333333333333333}{a} \cdot b + \frac{1}{\color{blue}{3 \cdot a}} \cdot \sqrt{c \cdot \left(a \cdot -3\right)} \]
      7. associate-/r*75.0%

        \[\leadsto \frac{0.3333333333333333}{a} \cdot b + \color{blue}{\frac{\frac{1}{3}}{a}} \cdot \sqrt{c \cdot \left(a \cdot -3\right)} \]
      8. metadata-eval75.0%

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

        \[\leadsto \frac{0.3333333333333333}{a} \cdot b + \frac{0.3333333333333333}{a} \cdot \sqrt{c \cdot \color{blue}{\left(-3 \cdot a\right)}} \]
      10. associate-*r*75.1%

        \[\leadsto \frac{0.3333333333333333}{a} \cdot b + \frac{0.3333333333333333}{a} \cdot \sqrt{\color{blue}{\left(c \cdot -3\right) \cdot a}} \]
      11. *-commutative75.1%

        \[\leadsto \frac{0.3333333333333333}{a} \cdot b + \frac{0.3333333333333333}{a} \cdot \sqrt{\color{blue}{a \cdot \left(c \cdot -3\right)}} \]
    13. Applied egg-rr75.1%

      \[\leadsto \color{blue}{\frac{0.3333333333333333}{a} \cdot b + \frac{0.3333333333333333}{a} \cdot \sqrt{a \cdot \left(c \cdot -3\right)}} \]
    14. Step-by-step derivation
      1. distribute-lft-in75.1%

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

        \[\leadsto \color{blue}{\frac{0.3333333333333333 \cdot \left(b + \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{a}} \]
      3. associate-*r/75.1%

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

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

    if 2.69999999999999996e-66 < b

    1. Initial program 17.4%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*17.4%

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

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

      \[\leadsto \color{blue}{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{-3} \cdot \frac{1}{a}} \]
    6. Taylor expanded in b around inf 0.0%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \frac{c \cdot {\left(\sqrt{-3}\right)}^{2}}{b}} \]
    7. Step-by-step derivation
      1. associate-*r/0.0%

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

        \[\leadsto \frac{\color{blue}{\left(c \cdot {\left(\sqrt{-3}\right)}^{2}\right) \cdot 0.16666666666666666}}{b} \]
      3. unpow20.0%

        \[\leadsto \frac{\left(c \cdot \color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)}\right) \cdot 0.16666666666666666}{b} \]
      4. rem-square-sqrt90.5%

        \[\leadsto \frac{\left(c \cdot \color{blue}{-3}\right) \cdot 0.16666666666666666}{b} \]
    8. Simplified90.5%

      \[\leadsto \color{blue}{\frac{\left(c \cdot -3\right) \cdot 0.16666666666666666}{b}} \]
    9. Taylor expanded in c around 0 90.8%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative90.8%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
    11. Simplified90.8%

      \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 9: 67.2% accurate, 11.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3 \cdot 10^{-223}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\

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


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

    1. Initial program 70.3%

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

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

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

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative66.3%

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

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. associate-*l/66.3%

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    9. Applied egg-rr66.3%

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

    if 2.99999999999999991e-223 < b

    1. Initial program 25.7%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*25.7%

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Applied egg-rr33.5%

      \[\leadsto \color{blue}{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{-3} \cdot \frac{1}{a}} \]
    6. Taylor expanded in b around inf 0.0%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \frac{c \cdot {\left(\sqrt{-3}\right)}^{2}}{b}} \]
    7. Step-by-step derivation
      1. associate-*r/0.0%

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

        \[\leadsto \frac{\color{blue}{\left(c \cdot {\left(\sqrt{-3}\right)}^{2}\right) \cdot 0.16666666666666666}}{b} \]
      3. unpow20.0%

        \[\leadsto \frac{\left(c \cdot \color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)}\right) \cdot 0.16666666666666666}{b} \]
      4. rem-square-sqrt79.9%

        \[\leadsto \frac{\left(c \cdot \color{blue}{-3}\right) \cdot 0.16666666666666666}{b} \]
    8. Simplified79.9%

      \[\leadsto \color{blue}{\frac{\left(c \cdot -3\right) \cdot 0.16666666666666666}{b}} \]
    9. Taylor expanded in c around 0 80.1%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative80.1%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
    11. Simplified80.1%

      \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 10: 67.2% accurate, 11.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3 \cdot 10^{-223}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\

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


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

    1. Initial program 70.3%

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

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

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

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative66.3%

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

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    8. Step-by-step derivation
      1. associate-*l/66.3%

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    9. Applied egg-rr66.3%

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

    if 2.99999999999999991e-223 < b

    1. Initial program 25.7%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*25.7%

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

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

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

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

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

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

Alternative 11: 67.2% accurate, 11.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3 \cdot 10^{-223}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\

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


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

    1. Initial program 70.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{-3} \cdot \frac{1}{a}} \]
    6. Taylor expanded in b around -inf 66.3%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    7. Step-by-step derivation
      1. *-commutative66.3%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
      2. associate-*l/66.3%

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
      3. associate-/l*66.2%

        \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
    8. Simplified66.2%

      \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
    9. Step-by-step derivation
      1. clear-num66.2%

        \[\leadsto b \cdot \color{blue}{\frac{1}{\frac{a}{-0.6666666666666666}}} \]
      2. un-div-inv66.3%

        \[\leadsto \color{blue}{\frac{b}{\frac{a}{-0.6666666666666666}}} \]
      3. div-inv66.3%

        \[\leadsto \frac{b}{\color{blue}{a \cdot \frac{1}{-0.6666666666666666}}} \]
      4. metadata-eval66.3%

        \[\leadsto \frac{b}{a \cdot \color{blue}{-1.5}} \]
    10. Applied egg-rr66.3%

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

    if 2.99999999999999991e-223 < b

    1. Initial program 25.7%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*25.7%

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

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

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

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

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

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

Alternative 12: 67.2% accurate, 11.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3 \cdot 10^{-223}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\

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


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

    1. Initial program 70.3%

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

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

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

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative66.3%

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

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

    if 2.99999999999999991e-223 < b

    1. Initial program 25.7%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*25.7%

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

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

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

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

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

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

Alternative 13: 67.1% accurate, 11.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3 \cdot 10^{-223}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\

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


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

    1. Initial program 70.3%

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

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

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

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. *-commutative66.3%

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

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

    if 2.99999999999999991e-223 < b

    1. Initial program 25.7%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*25.7%

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Applied egg-rr33.5%

      \[\leadsto \color{blue}{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{-3} \cdot \frac{1}{a}} \]
    6. Step-by-step derivation
      1. un-div-inv33.5%

        \[\leadsto \color{blue}{\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{-3}}{a}} \]
      2. div-inv33.6%

        \[\leadsto \frac{\color{blue}{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{1}{-3}}}{a} \]
      3. metadata-eval33.6%

        \[\leadsto \frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \color{blue}{-0.3333333333333333}}{a} \]
    7. Applied egg-rr33.6%

      \[\leadsto \color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot -0.3333333333333333}{a}} \]
    8. Taylor expanded in b around inf 0.0%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \frac{c \cdot {\left(\sqrt{-3}\right)}^{2}}{b}} \]
    9. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\frac{c \cdot {\left(\sqrt{-3}\right)}^{2}}{b} \cdot 0.16666666666666666} \]
      2. associate-/l*0.0%

        \[\leadsto \color{blue}{\left(c \cdot \frac{{\left(\sqrt{-3}\right)}^{2}}{b}\right)} \cdot 0.16666666666666666 \]
      3. associate-*r*0.0%

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

        \[\leadsto c \cdot \color{blue}{\left(0.16666666666666666 \cdot \frac{{\left(\sqrt{-3}\right)}^{2}}{b}\right)} \]
      5. associate-*r/0.0%

        \[\leadsto c \cdot \color{blue}{\frac{0.16666666666666666 \cdot {\left(\sqrt{-3}\right)}^{2}}{b}} \]
      6. unpow20.0%

        \[\leadsto c \cdot \frac{0.16666666666666666 \cdot \color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)}}{b} \]
      7. rem-square-sqrt79.9%

        \[\leadsto c \cdot \frac{0.16666666666666666 \cdot \color{blue}{-3}}{b} \]
      8. metadata-eval79.9%

        \[\leadsto c \cdot \frac{\color{blue}{-0.5}}{b} \]
    10. Simplified79.9%

      \[\leadsto \color{blue}{c \cdot \frac{-0.5}{b}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 14: 67.1% accurate, 11.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3 \cdot 10^{-223}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\

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


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

    1. Initial program 70.3%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{-3} \cdot \frac{1}{a}} \]
    6. Taylor expanded in b around -inf 66.3%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
    7. Step-by-step derivation
      1. *-commutative66.3%

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
      2. associate-*l/66.3%

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
      3. associate-/l*66.2%

        \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
    8. Simplified66.2%

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

    if 2.99999999999999991e-223 < b

    1. Initial program 25.7%

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      3. associate-*l*25.7%

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Applied egg-rr33.5%

      \[\leadsto \color{blue}{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{-3} \cdot \frac{1}{a}} \]
    6. Step-by-step derivation
      1. un-div-inv33.5%

        \[\leadsto \color{blue}{\frac{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{-3}}{a}} \]
      2. div-inv33.6%

        \[\leadsto \frac{\color{blue}{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \frac{1}{-3}}}{a} \]
      3. metadata-eval33.6%

        \[\leadsto \frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot \color{blue}{-0.3333333333333333}}{a} \]
    7. Applied egg-rr33.6%

      \[\leadsto \color{blue}{\frac{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot -0.3333333333333333}{a}} \]
    8. Taylor expanded in b around inf 0.0%

      \[\leadsto \color{blue}{0.16666666666666666 \cdot \frac{c \cdot {\left(\sqrt{-3}\right)}^{2}}{b}} \]
    9. Step-by-step derivation
      1. *-commutative0.0%

        \[\leadsto \color{blue}{\frac{c \cdot {\left(\sqrt{-3}\right)}^{2}}{b} \cdot 0.16666666666666666} \]
      2. associate-/l*0.0%

        \[\leadsto \color{blue}{\left(c \cdot \frac{{\left(\sqrt{-3}\right)}^{2}}{b}\right)} \cdot 0.16666666666666666 \]
      3. associate-*r*0.0%

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

        \[\leadsto c \cdot \color{blue}{\left(0.16666666666666666 \cdot \frac{{\left(\sqrt{-3}\right)}^{2}}{b}\right)} \]
      5. associate-*r/0.0%

        \[\leadsto c \cdot \color{blue}{\frac{0.16666666666666666 \cdot {\left(\sqrt{-3}\right)}^{2}}{b}} \]
      6. unpow20.0%

        \[\leadsto c \cdot \frac{0.16666666666666666 \cdot \color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)}}{b} \]
      7. rem-square-sqrt79.9%

        \[\leadsto c \cdot \frac{0.16666666666666666 \cdot \color{blue}{-3}}{b} \]
      8. metadata-eval79.9%

        \[\leadsto c \cdot \frac{\color{blue}{-0.5}}{b} \]
    10. Simplified79.9%

      \[\leadsto \color{blue}{c \cdot \frac{-0.5}{b}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 15: 35.3% accurate, 23.2× speedup?

\[\begin{array}{l} \\ b \cdot \frac{-0.6666666666666666}{a} \end{array} \]
(FPCore (a b c) :precision binary64 (* b (/ -0.6666666666666666 a)))
double code(double a, double b, double c) {
	return b * (-0.6666666666666666 / 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 * ((-0.6666666666666666d0) / a)
end function
public static double code(double a, double b, double c) {
	return b * (-0.6666666666666666 / a);
}
def code(a, b, c):
	return b * (-0.6666666666666666 / a)
function code(a, b, c)
	return Float64(b * Float64(-0.6666666666666666 / a))
end
function tmp = code(a, b, c)
	tmp = b * (-0.6666666666666666 / a);
end
code[a_, b_, c_] := N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
b \cdot \frac{-0.6666666666666666}{a}
\end{array}
Derivation
  1. Initial program 48.9%

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{b \cdot b} - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    3. associate-*l*48.9%

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

    \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
  4. Add Preprocessing
  5. Applied egg-rr50.7%

    \[\leadsto \color{blue}{\frac{b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}{-3} \cdot \frac{1}{a}} \]
  6. Taylor expanded in b around -inf 35.7%

    \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a}} \]
  7. Step-by-step derivation
    1. *-commutative35.7%

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    2. associate-*l/35.7%

      \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    3. associate-/l*35.7%

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

    \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
  9. Add Preprocessing

Reproduce

?
herbie shell --seed 2024103 
(FPCore (a b c)
  :name "Cubic critical"
  :precision binary64
  (/ (+ (- b) (sqrt (- (* b b) (* (* 3.0 a) c)))) (* 3.0 a)))