Cubic critical

Percentage Accurate: 51.2% → 85.7%
Time: 11.8s
Alternatives: 12
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 12 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.2% 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.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.76 \cdot 10^{+99}:\\ \;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\ \mathbf{elif}\;b \leq 1.6 \cdot 10^{-37}:\\ \;\;\;\;\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 -1.76e+99)
   (/ 1.0 (* (/ a b) -1.5))
   (if (<= b 1.6e-37)
     (/ (- (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 <= -1.76e+99) {
		tmp = 1.0 / ((a / b) * -1.5);
	} else if (b <= 1.6e-37) {
		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 <= (-1.76d+99)) then
        tmp = 1.0d0 / ((a / b) * (-1.5d0))
    else if (b <= 1.6d-37) 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 <= -1.76e+99) {
		tmp = 1.0 / ((a / b) * -1.5);
	} else if (b <= 1.6e-37) {
		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 <= -1.76e+99:
		tmp = 1.0 / ((a / b) * -1.5)
	elif b <= 1.6e-37:
		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 <= -1.76e+99)
		tmp = Float64(1.0 / Float64(Float64(a / b) * -1.5));
	elseif (b <= 1.6e-37)
		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 <= -1.76e+99)
		tmp = 1.0 / ((a / b) * -1.5);
	elseif (b <= 1.6e-37)
		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, -1.76e+99], N[(1.0 / N[(N[(a / b), $MachinePrecision] * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.6e-37], 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 -1.76 \cdot 10^{+99}:\\
\;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\

\mathbf{elif}\;b \leq 1.6 \cdot 10^{-37}:\\
\;\;\;\;\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 < -1.76000000000000007e99

    1. Initial program 54.1%

      \[\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 95.9%

      \[\leadsto \frac{\color{blue}{-2 \cdot b}}{3 \cdot a} \]
    3. Step-by-step derivation
      1. *-commutative95.9%

        \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
    4. Simplified95.9%

      \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
    5. Step-by-step derivation
      1. clear-num95.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{3 \cdot a}{b \cdot -2}}} \]
      2. inv-pow95.8%

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot a}{b \cdot -2}\right)}^{-1}} \]
      3. *-commutative95.8%

        \[\leadsto {\left(\frac{\color{blue}{a \cdot 3}}{b \cdot -2}\right)}^{-1} \]
      4. times-frac96.0%

        \[\leadsto {\color{blue}{\left(\frac{a}{b} \cdot \frac{3}{-2}\right)}}^{-1} \]
      5. metadata-eval96.0%

        \[\leadsto {\left(\frac{a}{b} \cdot \color{blue}{-1.5}\right)}^{-1} \]
    6. Applied egg-rr96.0%

      \[\leadsto \color{blue}{{\left(\frac{a}{b} \cdot -1.5\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-196.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{b} \cdot -1.5}} \]
    8. Simplified96.0%

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

    if -1.76000000000000007e99 < b < 1.5999999999999999e-37

    1. Initial program 76.2%

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

    if 1.5999999999999999e-37 < b

    1. Initial program 12.9%

      \[\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 92.3%

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

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
      2. associate-*l/92.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.76 \cdot 10^{+99}:\\ \;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\ \mathbf{elif}\;b \leq 1.6 \cdot 10^{-37}:\\ \;\;\;\;\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} \]

Alternative 2: 85.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5.6 \cdot 10^{+97}:\\ \;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\ \mathbf{elif}\;b \leq 2.35 \cdot 10^{-37}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - a \cdot \left(3 \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 -5.6e+97)
   (/ 1.0 (* (/ a b) -1.5))
   (if (<= b 2.35e-37)
     (/ (- (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 <= -5.6e+97) {
		tmp = 1.0 / ((a / b) * -1.5);
	} else if (b <= 2.35e-37) {
		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 <= (-5.6d+97)) then
        tmp = 1.0d0 / ((a / b) * (-1.5d0))
    else if (b <= 2.35d-37) 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 <= -5.6e+97) {
		tmp = 1.0 / ((a / b) * -1.5);
	} else if (b <= 2.35e-37) {
		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 <= -5.6e+97:
		tmp = 1.0 / ((a / b) * -1.5)
	elif b <= 2.35e-37:
		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 <= -5.6e+97)
		tmp = Float64(1.0 / Float64(Float64(a / b) * -1.5));
	elseif (b <= 2.35e-37)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(a * Float64(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 <= -5.6e+97)
		tmp = 1.0 / ((a / b) * -1.5);
	elseif (b <= 2.35e-37)
		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, -5.6e+97], N[(1.0 / N[(N[(a / b), $MachinePrecision] * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.35e-37], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(a * N[(3.0 * 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 -5.6 \cdot 10^{+97}:\\
\;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\

\mathbf{elif}\;b \leq 2.35 \cdot 10^{-37}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - a \cdot \left(3 \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 < -5.5999999999999998e97

    1. Initial program 54.1%

      \[\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 95.9%

      \[\leadsto \frac{\color{blue}{-2 \cdot b}}{3 \cdot a} \]
    3. Step-by-step derivation
      1. *-commutative95.9%

        \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
    4. Simplified95.9%

      \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
    5. Step-by-step derivation
      1. clear-num95.8%

        \[\leadsto \color{blue}{\frac{1}{\frac{3 \cdot a}{b \cdot -2}}} \]
      2. inv-pow95.8%

        \[\leadsto \color{blue}{{\left(\frac{3 \cdot a}{b \cdot -2}\right)}^{-1}} \]
      3. *-commutative95.8%

        \[\leadsto {\left(\frac{\color{blue}{a \cdot 3}}{b \cdot -2}\right)}^{-1} \]
      4. times-frac96.0%

        \[\leadsto {\color{blue}{\left(\frac{a}{b} \cdot \frac{3}{-2}\right)}}^{-1} \]
      5. metadata-eval96.0%

        \[\leadsto {\left(\frac{a}{b} \cdot \color{blue}{-1.5}\right)}^{-1} \]
    6. Applied egg-rr96.0%

      \[\leadsto \color{blue}{{\left(\frac{a}{b} \cdot -1.5\right)}^{-1}} \]
    7. Step-by-step derivation
      1. unpow-196.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{a}{b} \cdot -1.5}} \]
    8. Simplified96.0%

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

    if -5.5999999999999998e97 < b < 2.3500000000000001e-37

    1. Initial program 76.2%

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

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

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

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

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

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

    if 2.3500000000000001e-37 < b

    1. Initial program 12.9%

      \[\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 92.3%

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

        \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
      2. associate-*l/92.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.6 \cdot 10^{+97}:\\ \;\;\;\;\frac{1}{\frac{a}{b} \cdot -1.5}\\ \mathbf{elif}\;b \leq 2.35 \cdot 10^{-37}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - a \cdot \left(3 \cdot c\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 3: 80.0% accurate, 1.0× speedup?

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

\mathbf{elif}\;b \leq 7.6 \cdot 10^{-38}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{b + \sqrt{c \cdot \left(a \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 < -9.79999999999999942e-30

    1. Initial program 62.8%

      \[\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 82.8%

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

    if -9.79999999999999942e-30 < b < 7.5999999999999999e-38

    1. Initial program 75.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. Simplified75.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 7.5999999999999999e-38 < b

      1. Initial program 12.9%

        \[\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 92.3%

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

          \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
        2. associate-*l/92.3%

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

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

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

    Alternative 4: 80.6% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.1 \cdot 10^{-29}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{-36}:\\ \;\;\;\;\frac{\sqrt{-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 -1.1e-29)
       (+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
       (if (<= b 1.8e-36)
         (/ (- (sqrt (* -3.0 (* a c))) b) (* a 3.0))
         (/ (* c -0.5) b))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (b <= -1.1e-29) {
    		tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
    	} else if (b <= 1.8e-36) {
    		tmp = (sqrt((-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 <= (-1.1d-29)) then
            tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
        else if (b <= 1.8d-36) then
            tmp = (sqrt(((-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 <= -1.1e-29) {
    		tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
    	} else if (b <= 1.8e-36) {
    		tmp = (Math.sqrt((-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 <= -1.1e-29:
    		tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b))
    	elif b <= 1.8e-36:
    		tmp = (math.sqrt((-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 <= -1.1e-29)
    		tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b)));
    	elseif (b <= 1.8e-36)
    		tmp = Float64(Float64(sqrt(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 <= -1.1e-29)
    		tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
    	elseif (b <= 1.8e-36)
    		tmp = (sqrt((-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, -1.1e-29], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.8e-36], N[(N[(N[Sqrt[N[(-3.0 * N[(a * 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 -1.1 \cdot 10^{-29}:\\
    \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
    
    \mathbf{elif}\;b \leq 1.8 \cdot 10^{-36}:\\
    \;\;\;\;\frac{\sqrt{-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 < -1.09999999999999995e-29

      1. Initial program 62.8%

        \[\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 82.8%

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

      if -1.09999999999999995e-29 < b < 1.80000000000000016e-36

      1. Initial program 75.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. Simplified75.5%

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

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

        if 1.80000000000000016e-36 < b

        1. Initial program 12.9%

          \[\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 92.3%

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

            \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
          2. associate-*l/92.3%

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

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

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

      Alternative 5: 80.7% accurate, 1.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.1 \cdot 10^{-29}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\ \mathbf{elif}\;b \leq 1.1 \cdot 10^{-37}:\\ \;\;\;\;\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 -1.1e-29)
         (+ (* -0.6666666666666666 (/ b a)) (* 0.5 (/ c b)))
         (if (<= b 1.1e-37)
           (/ (- (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 <= -1.1e-29) {
      		tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
      	} else if (b <= 1.1e-37) {
      		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 <= (-1.1d-29)) then
              tmp = ((-0.6666666666666666d0) * (b / a)) + (0.5d0 * (c / b))
          else if (b <= 1.1d-37) 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 <= -1.1e-29) {
      		tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
      	} else if (b <= 1.1e-37) {
      		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 <= -1.1e-29:
      		tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b))
      	elif b <= 1.1e-37:
      		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 <= -1.1e-29)
      		tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(0.5 * Float64(c / b)));
      	elseif (b <= 1.1e-37)
      		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 <= -1.1e-29)
      		tmp = (-0.6666666666666666 * (b / a)) + (0.5 * (c / b));
      	elseif (b <= 1.1e-37)
      		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, -1.1e-29], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.1e-37], 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 -1.1 \cdot 10^{-29}:\\
      \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}\\
      
      \mathbf{elif}\;b \leq 1.1 \cdot 10^{-37}:\\
      \;\;\;\;\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 < -1.09999999999999995e-29

        1. Initial program 62.8%

          \[\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 82.8%

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

        if -1.09999999999999995e-29 < b < 1.10000000000000001e-37

        1. Initial program 75.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. Simplified75.5%

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

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

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

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

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

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

          if 1.10000000000000001e-37 < b

          1. Initial program 12.9%

            \[\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 92.3%

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

              \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
            2. associate-*l/92.3%

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

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

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

        Alternative 6: 68.3% accurate, 8.9× speedup?

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

          1. Initial program 69.2%

            \[\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 58.2%

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

          if -4.999999999999985e-310 < b

          1. Initial program 36.6%

            \[\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 62.4%

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

              \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
            2. associate-*l/62.4%

              \[\leadsto \color{blue}{\frac{c \cdot -0.5}{b}} \]
          4. Simplified62.4%

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

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

        Alternative 7: 68.1% accurate, 12.8× speedup?

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

          1. Initial program 69.7%

            \[\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 57.2%

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

              \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
          4. Simplified57.2%

            \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
          5. Step-by-step derivation
            1. clear-num57.1%

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

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

              \[\leadsto {\left(\frac{\color{blue}{a \cdot 3}}{b \cdot -2}\right)}^{-1} \]
            4. times-frac57.2%

              \[\leadsto {\color{blue}{\left(\frac{a}{b} \cdot \frac{3}{-2}\right)}}^{-1} \]
            5. metadata-eval57.2%

              \[\leadsto {\left(\frac{a}{b} \cdot \color{blue}{-1.5}\right)}^{-1} \]
          6. Applied egg-rr57.2%

            \[\leadsto \color{blue}{{\left(\frac{a}{b} \cdot -1.5\right)}^{-1}} \]
          7. Step-by-step derivation
            1. unpow-157.2%

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

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

          if 1.64999999999999997e-292 < b

          1. Initial program 35.7%

            \[\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 63.2%

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

              \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
            2. associate-*l/63.2%

              \[\leadsto \color{blue}{\frac{c \cdot -0.5}{b}} \]
          4. Simplified63.2%

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

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

        Alternative 8: 68.1% accurate, 12.8× speedup?

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

          1. Initial program 69.7%

            \[\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 57.2%

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

              \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
          4. Simplified57.2%

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

          if 1.64999999999999997e-292 < b

          1. Initial program 35.7%

            \[\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 63.2%

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

              \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
            2. associate-*l/63.2%

              \[\leadsto \color{blue}{\frac{c \cdot -0.5}{b}} \]
          4. Simplified63.2%

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

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

        Alternative 9: 43.2% accurate, 16.4× speedup?

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

          1. Initial program 69.7%

            \[\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 40.3%

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

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

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

          if 3.69999999999999988e-34 < b

          1. Initial program 13.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. Simplified13.0%

              \[\leadsto \color{blue}{\frac{\sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)} - b}{3 \cdot a}} \]
            2. Step-by-step derivation
              1. *-un-lft-identity13.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\color{blue}{1.5 \cdot \frac{a \cdot c}{b} + 2 \cdot b}}{3 \cdot a} \]
            7. Taylor expanded in a around inf 23.5%

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

                \[\leadsto \color{blue}{\frac{0.5 \cdot c}{b}} \]
            9. Simplified23.5%

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

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

          Alternative 10: 68.1% accurate, 16.4× speedup?

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

            1. Initial program 69.7%

              \[\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 57.1%

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

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

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

            if 1.64999999999999997e-292 < b

            1. Initial program 35.7%

              \[\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 63.2%

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

                \[\leadsto \color{blue}{\frac{c}{b} \cdot -0.5} \]
              2. associate-*l/63.2%

                \[\leadsto \color{blue}{\frac{c \cdot -0.5}{b}} \]
            4. Simplified63.2%

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

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

          Alternative 11: 2.5% accurate, 23.2× speedup?

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\left(\sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)} + \color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}}\right) + \mathsf{fma}\left(-b, 1, b \cdot 1\right)}{3 \cdot a} \]
              10. sqr-neg48.8%

                \[\leadsto \frac{\left(\sqrt{\mathsf{fma}\left(a, c \cdot -3, b \cdot b\right)} + \sqrt{\color{blue}{b \cdot b}}\right) + \mathsf{fma}\left(-b, 1, b \cdot 1\right)}{3 \cdot a} \]
              11. sqrt-prod16.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\frac{b}{a} \cdot 1.3333333333333333} \]
            8. Simplified2.8%

              \[\leadsto \color{blue}{\frac{b}{a} \cdot 1.3333333333333333} \]
            9. Step-by-step derivation
              1. *-commutative2.8%

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

                \[\leadsto 1.3333333333333333 \cdot \color{blue}{\frac{1}{\frac{a}{b}}} \]
              3. un-div-inv2.8%

                \[\leadsto \color{blue}{\frac{1.3333333333333333}{\frac{a}{b}}} \]
            10. Applied egg-rr2.8%

              \[\leadsto \color{blue}{\frac{1.3333333333333333}{\frac{a}{b}}} \]
            11. Step-by-step derivation
              1. associate-/r/2.8%

                \[\leadsto \color{blue}{\frac{1.3333333333333333}{a} \cdot b} \]
            12. Applied egg-rr2.8%

              \[\leadsto \color{blue}{\frac{1.3333333333333333}{a} \cdot b} \]
            13. Final simplification2.8%

              \[\leadsto b \cdot \frac{1.3333333333333333}{a} \]

            Alternative 12: 35.6% accurate, 23.2× speedup?

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

              \[\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 28.3%

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

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

              \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
            5. Final simplification28.3%

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

            Reproduce

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