Cubic critical

Percentage Accurate: 53.1% → 85.3%
Time: 12.0s
Alternatives: 9
Speedup: 11.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 9 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: 53.1% 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.3% accurate, 0.9× speedup?

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

\mathbf{elif}\;b \leq 4.2 \cdot 10^{-57}:\\
\;\;\;\;\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 < -2.3000000000000001e153

    1. Initial program 46.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3000000000000001e153 < b < 4.1999999999999999e-57

    1. Initial program 86.1%

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

    if 4.1999999999999999e-57 < b

    1. Initial program 8.7%

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{a \cdot c}{b}}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. associate-/l*79.4%

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

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \left(a \cdot \frac{c}{b}\right)}}{3 \cdot a} \]
    8. Taylor expanded in a around 0 93.8%

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

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

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

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

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

Alternative 2: 85.2% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 46.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.0000000000000002e153 < b < 3.7e-47

    1. Initial program 86.1%

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

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

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

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

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

    if 3.7e-47 < b

    1. Initial program 8.7%

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{a \cdot c}{b}}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. associate-/l*79.4%

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

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \left(a \cdot \frac{c}{b}\right)}}{3 \cdot a} \]
    8. Taylor expanded in a around 0 93.8%

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

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

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

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

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

Alternative 3: 79.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5.5 \cdot 10^{-128}:\\ \;\;\;\;b \cdot \left(\frac{c \cdot -0.5}{-{b}^{2}} - \frac{0.6666666666666666}{a}\right)\\ \mathbf{elif}\;b \leq 4.9 \cdot 10^{-52}:\\ \;\;\;\;\frac{\sqrt{a \cdot \left(c \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 -5.5e-128)
   (* b (- (/ (* c -0.5) (- (pow b 2.0))) (/ 0.6666666666666666 a)))
   (if (<= b 4.9e-52)
     (/ (- (sqrt (* a (* c -3.0))) b) (* a 3.0))
     (/ (* c -0.5) b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5.5e-128) {
		tmp = b * (((c * -0.5) / -pow(b, 2.0)) - (0.6666666666666666 / a));
	} else if (b <= 4.9e-52) {
		tmp = (sqrt((a * (c * -3.0))) - b) / (a * 3.0);
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-5.5d-128)) then
        tmp = b * (((c * (-0.5d0)) / -(b ** 2.0d0)) - (0.6666666666666666d0 / a))
    else if (b <= 4.9d-52) then
        tmp = (sqrt((a * (c * (-3.0d0)))) - b) / (a * 3.0d0)
    else
        tmp = (c * (-0.5d0)) / b
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -5.5e-128) {
		tmp = b * (((c * -0.5) / -Math.pow(b, 2.0)) - (0.6666666666666666 / a));
	} else if (b <= 4.9e-52) {
		tmp = (Math.sqrt((a * (c * -3.0))) - b) / (a * 3.0);
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -5.5e-128:
		tmp = b * (((c * -0.5) / -math.pow(b, 2.0)) - (0.6666666666666666 / a))
	elif b <= 4.9e-52:
		tmp = (math.sqrt((a * (c * -3.0))) - b) / (a * 3.0)
	else:
		tmp = (c * -0.5) / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -5.5e-128)
		tmp = Float64(b * Float64(Float64(Float64(c * -0.5) / Float64(-(b ^ 2.0))) - Float64(0.6666666666666666 / a)));
	elseif (b <= 4.9e-52)
		tmp = Float64(Float64(sqrt(Float64(a * Float64(c * -3.0))) - b) / Float64(a * 3.0));
	else
		tmp = Float64(Float64(c * -0.5) / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -5.5e-128)
		tmp = b * (((c * -0.5) / -(b ^ 2.0)) - (0.6666666666666666 / a));
	elseif (b <= 4.9e-52)
		tmp = (sqrt((a * (c * -3.0))) - b) / (a * 3.0);
	else
		tmp = (c * -0.5) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -5.5e-128], N[(b * N[(N[(N[(c * -0.5), $MachinePrecision] / (-N[Power[b, 2.0], $MachinePrecision])), $MachinePrecision] - N[(0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.9e-52], N[(N[(N[Sqrt[N[(a * N[(c * -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 -5.5 \cdot 10^{-128}:\\
\;\;\;\;b \cdot \left(\frac{c \cdot -0.5}{-{b}^{2}} - \frac{0.6666666666666666}{a}\right)\\

\mathbf{elif}\;b \leq 4.9 \cdot 10^{-52}:\\
\;\;\;\;\frac{\sqrt{a \cdot \left(c \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 < -5.5000000000000004e-128

    1. Initial program 80.0%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(0.16666666666666666 \cdot \frac{c \cdot {\left(\sqrt{-3}\right)}^{2}}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg0.0%

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

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

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

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

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

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

        \[\leadsto \left(\frac{\left(0.16666666666666666 \cdot \color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)}\right) \cdot c}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right) \cdot \left(-b\right) \]
      8. rem-square-sqrt81.3%

        \[\leadsto \left(\frac{\left(0.16666666666666666 \cdot \color{blue}{-3}\right) \cdot c}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right) \cdot \left(-b\right) \]
      9. metadata-eval81.3%

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

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

        \[\leadsto \left(\frac{c \cdot -0.5}{{b}^{2}} + \color{blue}{\frac{0.6666666666666666 \cdot 1}{a}}\right) \cdot \left(-b\right) \]
      12. metadata-eval81.3%

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

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

    if -5.5000000000000004e-128 < b < 4.90000000000000019e-52

    1. Initial program 75.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt74.9%

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \color{blue}{{\left(\sqrt[3]{a \cdot c}\right)}^{3}}}}{3 \cdot a} \]
    7. Step-by-step derivation
      1. add-cube-cbrt74.4%

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{{\left(\sqrt[3]{3 \cdot \left(a \cdot c\right)}\right)}^{3}}}}{3 \cdot a} \]
    9. Taylor expanded in a around -inf 0.0%

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

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

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

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

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

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

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

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

    if 4.90000000000000019e-52 < b

    1. Initial program 8.7%

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{a \cdot c}{b}}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. associate-/l*79.4%

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

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \left(a \cdot \frac{c}{b}\right)}}{3 \cdot a} \]
    8. Taylor expanded in a around 0 93.8%

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

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

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

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

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

Alternative 4: 71.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.12 \cdot 10^{-147}:\\
\;\;\;\;b \cdot \left(\frac{c \cdot -0.5}{-{b}^{2}} - \frac{0.6666666666666666}{a}\right)\\

\mathbf{elif}\;b \leq 4.8 \cdot 10^{-105}:\\
\;\;\;\;\sqrt{c \cdot \frac{-3}{a}} \cdot 0.3333333333333333\\

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


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

    1. Initial program 80.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(0.16666666666666666 \cdot \frac{c \cdot {\left(\sqrt{-3}\right)}^{2}}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right)\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg0.0%

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

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

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

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

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

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

        \[\leadsto \left(\frac{\left(0.16666666666666666 \cdot \color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)}\right) \cdot c}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right) \cdot \left(-b\right) \]
      8. rem-square-sqrt80.7%

        \[\leadsto \left(\frac{\left(0.16666666666666666 \cdot \color{blue}{-3}\right) \cdot c}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right) \cdot \left(-b\right) \]
      9. metadata-eval80.7%

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

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

        \[\leadsto \left(\frac{c \cdot -0.5}{{b}^{2}} + \color{blue}{\frac{0.6666666666666666 \cdot 1}{a}}\right) \cdot \left(-b\right) \]
      12. metadata-eval80.7%

        \[\leadsto \left(\frac{c \cdot -0.5}{{b}^{2}} + \frac{\color{blue}{0.6666666666666666}}{a}\right) \cdot \left(-b\right) \]
    9. Simplified80.7%

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

    if -1.12e-147 < b < 4.8000000000000003e-105

    1. Initial program 76.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. sqr-neg76.8%

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \color{blue}{{\left(\sqrt[3]{a \cdot c}\right)}^{3}}}}{3 \cdot a} \]
    7. Step-by-step derivation
      1. add-cube-cbrt75.6%

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{{\left(\sqrt[3]{3 \cdot \left(a \cdot c\right)}\right)}^{3}}}}{3 \cdot a} \]
    9. Taylor expanded in a around -inf 0.0%

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

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

        \[\leadsto \left(\sqrt{\frac{c \cdot {\left(\sqrt[3]{-3}\right)}^{3}}{a}} \cdot \color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)}\right) \cdot -0.3333333333333333 \]
      3. rem-square-sqrt30.1%

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

        \[\leadsto \color{blue}{\sqrt{\frac{c \cdot {\left(\sqrt[3]{-3}\right)}^{3}}{a}} \cdot \left(-1 \cdot -0.3333333333333333\right)} \]
      5. associate-/l*30.1%

        \[\leadsto \sqrt{\color{blue}{c \cdot \frac{{\left(\sqrt[3]{-3}\right)}^{3}}{a}}} \cdot \left(-1 \cdot -0.3333333333333333\right) \]
      6. rem-cube-cbrt30.3%

        \[\leadsto \sqrt{c \cdot \frac{\color{blue}{-3}}{a}} \cdot \left(-1 \cdot -0.3333333333333333\right) \]
      7. metadata-eval30.3%

        \[\leadsto \sqrt{c \cdot \frac{-3}{a}} \cdot \color{blue}{0.3333333333333333} \]
    11. Simplified30.3%

      \[\leadsto \color{blue}{\sqrt{c \cdot \frac{-3}{a}} \cdot 0.3333333333333333} \]

    if 4.8000000000000003e-105 < b

    1. Initial program 13.3%

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{a \cdot c}{b}}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. associate-/l*75.5%

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\left(a \cdot \frac{c}{b}\right)}}{3 \cdot a} \]
    7. Simplified75.5%

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \left(a \cdot \frac{c}{b}\right)}}{3 \cdot a} \]
    8. Taylor expanded in a around 0 89.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.12 \cdot 10^{-147}:\\ \;\;\;\;b \cdot \left(\frac{c \cdot -0.5}{-{b}^{2}} - \frac{0.6666666666666666}{a}\right)\\ \mathbf{elif}\;b \leq 4.8 \cdot 10^{-105}:\\ \;\;\;\;\sqrt{c \cdot \frac{-3}{a}} \cdot 0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 71.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.35 \cdot 10^{-186}:\\
\;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\

\mathbf{elif}\;b \leq 4.8 \cdot 10^{-105}:\\
\;\;\;\;\sqrt{c \cdot \frac{-3}{a}} \cdot 0.3333333333333333\\

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


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

    1. Initial program 79.2%

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

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

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

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

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

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

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

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

    if -3.35000000000000017e-186 < b < 4.8000000000000003e-105

    1. Initial program 79.0%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{{\left(\sqrt[3]{3 \cdot \left(a \cdot c\right)}\right)}^{3}}}}{3 \cdot a} \]
    9. Taylor expanded in a around -inf 0.0%

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

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

        \[\leadsto \left(\sqrt{\frac{c \cdot {\left(\sqrt[3]{-3}\right)}^{3}}{a}} \cdot \color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)}\right) \cdot -0.3333333333333333 \]
      3. rem-square-sqrt30.1%

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

        \[\leadsto \color{blue}{\sqrt{\frac{c \cdot {\left(\sqrt[3]{-3}\right)}^{3}}{a}} \cdot \left(-1 \cdot -0.3333333333333333\right)} \]
      5. associate-/l*30.2%

        \[\leadsto \sqrt{\color{blue}{c \cdot \frac{{\left(\sqrt[3]{-3}\right)}^{3}}{a}}} \cdot \left(-1 \cdot -0.3333333333333333\right) \]
      6. rem-cube-cbrt30.4%

        \[\leadsto \sqrt{c \cdot \frac{\color{blue}{-3}}{a}} \cdot \left(-1 \cdot -0.3333333333333333\right) \]
      7. metadata-eval30.4%

        \[\leadsto \sqrt{c \cdot \frac{-3}{a}} \cdot \color{blue}{0.3333333333333333} \]
    11. Simplified30.4%

      \[\leadsto \color{blue}{\sqrt{c \cdot \frac{-3}{a}} \cdot 0.3333333333333333} \]

    if 4.8000000000000003e-105 < b

    1. Initial program 13.3%

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{a \cdot c}{b}}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. associate-/l*75.5%

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\left(a \cdot \frac{c}{b}\right)}}{3 \cdot a} \]
    7. Simplified75.5%

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \left(a \cdot \frac{c}{b}\right)}}{3 \cdot a} \]
    8. Taylor expanded in a around 0 89.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.35 \cdot 10^{-186}:\\ \;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\ \mathbf{elif}\;b \leq 4.8 \cdot 10^{-105}:\\ \;\;\;\;\sqrt{c \cdot \frac{-3}{a}} \cdot 0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 67.3% accurate, 9.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.85 \cdot 10^{-290}:\\ \;\;\;\;\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.85e-290) (/ (* b -2.0) (* a 3.0)) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 1.85e-290) {
		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.85d-290) 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.85e-290) {
		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.85e-290:
		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.85e-290)
		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.85e-290)
		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.85e-290], 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.85 \cdot 10^{-290}:\\
\;\;\;\;\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.84999999999999989e-290

    1. Initial program 79.7%

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

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

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

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

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

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

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

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

    if 1.84999999999999989e-290 < b

    1. Initial program 27.0%

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{a \cdot c}{b}}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. associate-/l*60.9%

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\left(a \cdot \frac{c}{b}\right)}}{3 \cdot a} \]
    7. Simplified60.9%

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \left(a \cdot \frac{c}{b}\right)}}{3 \cdot a} \]
    8. Taylor expanded in a around 0 73.4%

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

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

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

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

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

Alternative 7: 67.2% accurate, 11.6× speedup?

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

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

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


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

    1. Initial program 79.7%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg79.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.84999999999999989e-290 < b

    1. Initial program 27.0%

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{a \cdot c}{b}}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. associate-/l*60.9%

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\left(a \cdot \frac{c}{b}\right)}}{3 \cdot a} \]
    7. Simplified60.9%

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \left(a \cdot \frac{c}{b}\right)}}{3 \cdot a} \]
    8. Taylor expanded in a around 0 73.4%

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

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

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

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

Alternative 8: 67.2% accurate, 11.6× speedup?

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

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

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


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

    1. Initial program 79.7%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg79.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.84999999999999989e-290 < b

    1. Initial program 27.0%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg27.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(0.16666666666666666 \cdot \color{blue}{-3}\right) \cdot c}{b} \]
      6. metadata-eval73.4%

        \[\leadsto \frac{\color{blue}{-0.5} \cdot c}{b} \]
      7. associate-*r/73.4%

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

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

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

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

Alternative 9: 35.7% accurate, 23.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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