Cubic critical

Percentage Accurate: 51.9% → 84.6%
Time: 11.4s
Alternatives: 10
Speedup: 16.4×

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 10 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.9% 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: 84.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.5 \cdot 10^{+33}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + \frac{c}{b} \cdot 0.5\\ \mathbf{elif}\;b \leq 8 \cdot 10^{-127}:\\ \;\;\;\;\left({\left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)\right)}^{0.5} - b\right) \cdot \frac{1}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -1.5e+33)
   (+ (/ (* b -0.6666666666666666) a) (* (/ c b) 0.5))
   (if (<= b 8e-127)
     (* (- (pow (fma b b (* c (* a -3.0))) 0.5) b) (/ 1.0 (* a 3.0)))
     (* (/ c b) -0.5))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.5e+33) {
		tmp = ((b * -0.6666666666666666) / a) + ((c / b) * 0.5);
	} else if (b <= 8e-127) {
		tmp = (pow(fma(b, b, (c * (a * -3.0))), 0.5) - b) * (1.0 / (a * 3.0));
	} else {
		tmp = (c / b) * -0.5;
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= -1.5e+33)
		tmp = Float64(Float64(Float64(b * -0.6666666666666666) / a) + Float64(Float64(c / b) * 0.5));
	elseif (b <= 8e-127)
		tmp = Float64(Float64((fma(b, b, Float64(c * Float64(a * -3.0))) ^ 0.5) - b) * Float64(1.0 / Float64(a * 3.0)));
	else
		tmp = Float64(Float64(c / b) * -0.5);
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -1.5e+33], N[(N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8e-127], N[(N[(N[Power[N[(b * b + N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision] - b), $MachinePrecision] * N[(1.0 / N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.5 \cdot 10^{+33}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + \frac{c}{b} \cdot 0.5\\

\mathbf{elif}\;b \leq 8 \cdot 10^{-127}:\\
\;\;\;\;\left({\left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)\right)}^{0.5} - b\right) \cdot \frac{1}{a \cdot 3}\\

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


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

    1. Initial program 56.6%

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + {\color{blue}{\left({\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2}}{3 \cdot a} \]
      5. fma-neg56.8%

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

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, -\color{blue}{c \cdot \left(3 \cdot a\right)}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
      7. distribute-rgt-neg-in56.8%

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

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, c \cdot \left(-\color{blue}{a \cdot 3}\right)\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
      9. distribute-rgt-neg-in56.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{-0.6666666666666666} \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b} \]
      3. *-commutative96.3%

        \[\leadsto -0.6666666666666666 \cdot \frac{b}{a} + \color{blue}{\frac{c}{b} \cdot 0.5} \]
    6. Simplified96.3%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5} \]
    7. Step-by-step derivation
      1. associate-*r/96.3%

        \[\leadsto \color{blue}{\frac{-0.6666666666666666 \cdot b}{a}} + \frac{c}{b} \cdot 0.5 \]
    8. Applied egg-rr96.3%

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

    if -1.49999999999999992e33 < b < 8.0000000000000002e-127

    1. Initial program 84.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. add-sqr-sqrt84.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.0000000000000002e-127 < b

    1. Initial program 21.4%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Taylor expanded in b around inf 84.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.5 \cdot 10^{+33}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + \frac{c}{b} \cdot 0.5\\ \mathbf{elif}\;b \leq 8 \cdot 10^{-127}:\\ \;\;\;\;\left({\left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)\right)}^{0.5} - b\right) \cdot \frac{1}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]

Alternative 2: 84.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.5 \cdot 10^{+33}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + \frac{c}{b} \cdot 0.5\\

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

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


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

    1. Initial program 56.6%

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + {\color{blue}{\left({\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2}}{3 \cdot a} \]
      5. fma-neg56.8%

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

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, -\color{blue}{c \cdot \left(3 \cdot a\right)}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
      7. distribute-rgt-neg-in56.8%

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

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, c \cdot \left(-\color{blue}{a \cdot 3}\right)\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
      9. distribute-rgt-neg-in56.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{-0.6666666666666666} \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b} \]
      3. *-commutative96.3%

        \[\leadsto -0.6666666666666666 \cdot \frac{b}{a} + \color{blue}{\frac{c}{b} \cdot 0.5} \]
    6. Simplified96.3%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5} \]
    7. Step-by-step derivation
      1. associate-*r/96.3%

        \[\leadsto \color{blue}{\frac{-0.6666666666666666 \cdot b}{a}} + \frac{c}{b} \cdot 0.5 \]
    8. Applied egg-rr96.3%

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

    if -1.49999999999999992e33 < b < 1.34999999999999998e-126

    1. Initial program 84.4%

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

    if 1.34999999999999998e-126 < b

    1. Initial program 21.4%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Taylor expanded in b around inf 84.7%

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

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

Alternative 3: 80.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.2 \cdot 10^{-71}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + \frac{c}{b} \cdot 0.5\\

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

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


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

    1. Initial program 64.8%

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, -\color{blue}{c \cdot \left(3 \cdot a\right)}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
      7. distribute-rgt-neg-in64.9%

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

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, c \cdot \left(-\color{blue}{a \cdot 3}\right)\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
      9. distribute-rgt-neg-in64.9%

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot \left(-3\right)\right)}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
      10. metadata-eval64.9%

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

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)\right)}^{\color{blue}{0.25}}\right)}^{2}}{3 \cdot a} \]
    3. Applied egg-rr64.9%

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

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

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

        \[\leadsto \color{blue}{-0.6666666666666666} \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b} \]
      3. *-commutative90.9%

        \[\leadsto -0.6666666666666666 \cdot \frac{b}{a} + \color{blue}{\frac{c}{b} \cdot 0.5} \]
    6. Simplified90.9%

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5} \]
    7. Step-by-step derivation
      1. associate-*r/91.0%

        \[\leadsto \color{blue}{\frac{-0.6666666666666666 \cdot b}{a}} + \frac{c}{b} \cdot 0.5 \]
    8. Applied egg-rr91.0%

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

    if -2.19999999999999997e-71 < b < 1.34999999999999998e-126

    1. Initial program 81.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. add-sqr-sqrt81.2%

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

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

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

        \[\leadsto \frac{\left(-b\right) + {\color{blue}{\left({\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2}}{3 \cdot a} \]
      5. fma-neg81.3%

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

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

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

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, c \cdot \left(-\color{blue}{a \cdot 3}\right)\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
      9. distribute-rgt-neg-in81.3%

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + {\color{blue}{\left({\left(-3 \cdot \left(c \cdot a\right)\right)}^{0.25}\right)}}^{2}}{3 \cdot a} \]
    5. Taylor expanded in c around 0 45.1%

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

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

      if 1.34999999999999998e-126 < b

      1. Initial program 21.4%

        \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      2. Taylor expanded in b around inf 84.7%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.2 \cdot 10^{-71}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + \frac{c}{b} \cdot 0.5\\ \mathbf{elif}\;b \leq 1.35 \cdot 10^{-126}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]

    Alternative 4: 80.5% accurate, 1.0× speedup?

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

      1. Initial program 64.8%

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

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

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

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

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

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

          \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, -\color{blue}{c \cdot \left(3 \cdot a\right)}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
        7. distribute-rgt-neg-in64.9%

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

          \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, c \cdot \left(-\color{blue}{a \cdot 3}\right)\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
        9. distribute-rgt-neg-in64.9%

          \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot \left(-3\right)\right)}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
        10. metadata-eval64.9%

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

          \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)\right)}^{\color{blue}{0.25}}\right)}^{2}}{3 \cdot a} \]
      3. Applied egg-rr64.9%

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

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

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

          \[\leadsto \color{blue}{-0.6666666666666666} \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b} \]
        3. *-commutative90.9%

          \[\leadsto -0.6666666666666666 \cdot \frac{b}{a} + \color{blue}{\frac{c}{b} \cdot 0.5} \]
      6. Simplified90.9%

        \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5} \]
      7. Step-by-step derivation
        1. associate-*r/91.0%

          \[\leadsto \color{blue}{\frac{-0.6666666666666666 \cdot b}{a}} + \frac{c}{b} \cdot 0.5 \]
      8. Applied egg-rr91.0%

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

      if -1.5000000000000001e-70 < b < 2.4999999999999999e-127

      1. Initial program 81.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. add-sqr-sqrt81.2%

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

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

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

          \[\leadsto \frac{\left(-b\right) + {\color{blue}{\left({\left(b \cdot b - \left(3 \cdot a\right) \cdot c\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2}}{3 \cdot a} \]
        5. fma-neg81.3%

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

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

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

          \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, c \cdot \left(-\color{blue}{a \cdot 3}\right)\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
        9. distribute-rgt-neg-in81.3%

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + {\color{blue}{\left({\left(-3 \cdot \left(c \cdot a\right)\right)}^{0.25}\right)}}^{2}}{3 \cdot a} \]
      5. Taylor expanded in c around 0 45.1%

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

          \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a}} \]
        2. Taylor expanded in c around 0 75.6%

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

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

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

        if 2.4999999999999999e-127 < b

        1. Initial program 21.4%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
        2. Taylor expanded in b around inf 84.7%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.5 \cdot 10^{-70}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + \frac{c}{b} \cdot 0.5\\ \mathbf{elif}\;b \leq 2.5 \cdot 10^{-127}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{-3 \cdot \left(a \cdot c\right)} - b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]

      Alternative 5: 80.6% accurate, 1.0× speedup?

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

        1. Initial program 64.8%

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

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

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

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

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

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

            \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, -\color{blue}{c \cdot \left(3 \cdot a\right)}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
          7. distribute-rgt-neg-in64.9%

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

            \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, c \cdot \left(-\color{blue}{a \cdot 3}\right)\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
          9. distribute-rgt-neg-in64.9%

            \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, c \cdot \color{blue}{\left(a \cdot \left(-3\right)\right)}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
          10. metadata-eval64.9%

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

            \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)\right)}^{\color{blue}{0.25}}\right)}^{2}}{3 \cdot a} \]
        3. Applied egg-rr64.9%

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

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

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

            \[\leadsto \color{blue}{-0.6666666666666666} \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b} \]
          3. *-commutative90.9%

            \[\leadsto -0.6666666666666666 \cdot \frac{b}{a} + \color{blue}{\frac{c}{b} \cdot 0.5} \]
        6. Simplified90.9%

          \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5} \]
        7. Step-by-step derivation
          1. associate-*r/91.0%

            \[\leadsto \color{blue}{\frac{-0.6666666666666666 \cdot b}{a}} + \frac{c}{b} \cdot 0.5 \]
        8. Applied egg-rr91.0%

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

        if -1.14000000000000006e-69 < b < 1.8999999999999999e-126

        1. Initial program 81.5%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
        2. Taylor expanded in b around 0 75.5%

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

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

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

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

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

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

        if 1.8999999999999999e-126 < b

        1. Initial program 21.4%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
        2. Taylor expanded in b around inf 84.7%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.14 \cdot 10^{-69}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a} + \frac{c}{b} \cdot 0.5\\ \mathbf{elif}\;b \leq 1.9 \cdot 10^{-126}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]

      Alternative 6: 68.4% accurate, 8.9× speedup?

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

        1. Initial program 70.5%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
        2. Taylor expanded in b around -inf 70.8%

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

        if -1.999999999999994e-310 < b

        1. Initial program 34.3%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
        2. Taylor expanded in b around inf 66.3%

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

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

      Alternative 7: 68.4% accurate, 8.9× speedup?

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

        1. Initial program 70.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. add-sqr-sqrt70.3%

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

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

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

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

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

            \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, -\color{blue}{c \cdot \left(3 \cdot a\right)}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
          7. distribute-rgt-neg-in70.5%

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

            \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, c \cdot \left(-\color{blue}{a \cdot 3}\right)\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
          9. distribute-rgt-neg-in70.5%

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

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

            \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)\right)}^{\color{blue}{0.25}}\right)}^{2}}{3 \cdot a} \]
        3. Applied egg-rr70.5%

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

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

            \[\leadsto \color{blue}{\left(2 \cdot -0.3333333333333333\right) \cdot \frac{b}{a}} + 0.5 \cdot \frac{c}{b} \]
          2. metadata-eval70.8%

            \[\leadsto \color{blue}{-0.6666666666666666} \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b} \]
          3. *-commutative70.8%

            \[\leadsto -0.6666666666666666 \cdot \frac{b}{a} + \color{blue}{\frac{c}{b} \cdot 0.5} \]
        6. Simplified70.8%

          \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5} \]
        7. Step-by-step derivation
          1. associate-*r/70.8%

            \[\leadsto \color{blue}{\frac{-0.6666666666666666 \cdot b}{a}} + \frac{c}{b} \cdot 0.5 \]
        8. Applied egg-rr70.8%

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

        if -1.999999999999994e-310 < b

        1. Initial program 34.3%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
        2. Taylor expanded in b around inf 66.3%

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

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

      Alternative 8: 68.3% accurate, 16.4× speedup?

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

        1. Initial program 70.5%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
        2. Taylor expanded in b around -inf 70.5%

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

            \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
        4. Simplified70.5%

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

        if -1.999999999999994e-310 < b

        1. Initial program 34.3%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
        2. Taylor expanded in b around inf 66.3%

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

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

      Alternative 9: 68.3% accurate, 16.4× speedup?

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

        1. Initial program 70.5%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
        2. Taylor expanded in b around -inf 70.5%

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

            \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
        4. Simplified70.5%

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

            \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
        6. Applied egg-rr70.5%

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

        if -1.999999999999994e-310 < b

        1. Initial program 34.3%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
        2. Taylor expanded in b around inf 66.3%

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

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

      Alternative 10: 35.1% accurate, 23.2× speedup?

      \[\begin{array}{l} \\ \frac{c}{b} \cdot -0.5 \end{array} \]
      (FPCore (a b c) :precision binary64 (* (/ c b) -0.5))
      double code(double a, double b, double c) {
      	return (c / b) * -0.5;
      }
      
      real(8) function code(a, b, c)
          real(8), intent (in) :: a
          real(8), intent (in) :: b
          real(8), intent (in) :: c
          code = (c / b) * (-0.5d0)
      end function
      
      public static double code(double a, double b, double c) {
      	return (c / b) * -0.5;
      }
      
      def code(a, b, c):
      	return (c / b) * -0.5
      
      function code(a, b, c)
      	return Float64(Float64(c / b) * -0.5)
      end
      
      function tmp = code(a, b, c)
      	tmp = (c / b) * -0.5;
      end
      
      code[a_, b_, c_] := N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]
      
      \begin{array}{l}
      
      \\
      \frac{c}{b} \cdot -0.5
      \end{array}
      
      Derivation
      1. Initial program 55.0%

        \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      2. Taylor expanded in b around inf 29.6%

        \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
      3. Final simplification29.6%

        \[\leadsto \frac{c}{b} \cdot -0.5 \]

      Reproduce

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