Cubic critical

Percentage Accurate: 52.3% → 85.5%
Time: 12.1s
Alternatives: 14
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 14 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: 52.3% 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.5% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 54.9%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified54.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. Taylor expanded in b around -inf 95.2%

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{a}{b \cdot -0.6666666666666666}\right)}^{-1}} \]
      3. *-un-lft-identity95.3%

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

        \[\leadsto {\left(\frac{1 \cdot a}{\color{blue}{-0.6666666666666666 \cdot b}}\right)}^{-1} \]
      5. times-frac95.4%

        \[\leadsto {\color{blue}{\left(\frac{1}{-0.6666666666666666} \cdot \frac{a}{b}\right)}}^{-1} \]
      6. metadata-eval95.4%

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

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

        \[\leadsto \color{blue}{\frac{1}{-1.5 \cdot \frac{a}{b}}} \]
    13. Simplified95.4%

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

    if -2.3e154 < b < 2.35e-84

    1. Initial program 87.1%

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

    if 2.35e-84 < b

    1. Initial program 12.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-neg12.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-neg12.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*12.3%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified12.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 91.1%

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

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

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

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

Alternative 2: 85.4% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 54.9%

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified54.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. Taylor expanded in b around -inf 95.2%

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

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

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

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

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

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

        \[\leadsto \color{blue}{{\left(\frac{a}{b \cdot -0.6666666666666666}\right)}^{-1}} \]
      3. *-un-lft-identity95.3%

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

        \[\leadsto {\left(\frac{1 \cdot a}{\color{blue}{-0.6666666666666666 \cdot b}}\right)}^{-1} \]
      5. times-frac95.4%

        \[\leadsto {\color{blue}{\left(\frac{1}{-0.6666666666666666} \cdot \frac{a}{b}\right)}}^{-1} \]
      6. metadata-eval95.4%

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

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

        \[\leadsto \color{blue}{\frac{1}{-1.5 \cdot \frac{a}{b}}} \]
    13. Simplified95.4%

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

    if -2.3e154 < b < 1.01999999999999998e-81

    1. Initial program 87.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-neg87.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-neg87.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*87.1%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified87.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 1.01999999999999998e-81 < b

    1. Initial program 12.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-neg12.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-neg12.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*12.3%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified12.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 91.1%

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

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

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

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

Alternative 3: 80.3% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 78.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-neg78.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-neg78.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*78.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified78.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. Taylor expanded in b around -inf 90.2%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, 0.6666666666666666 \cdot \frac{1}{a}\right)} \cdot \left(-b\right) \]
      5. associate-*r/90.4%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \color{blue}{\frac{0.6666666666666666 \cdot 1}{a}}\right) \cdot \left(-b\right) \]
      6. metadata-eval90.4%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{\color{blue}{0.6666666666666666}}{a}\right) \cdot \left(-b\right) \]
    7. Simplified90.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{0.6666666666666666}{a}\right) \cdot \left(-b\right)} \]
    8. Taylor expanded in c around 0 90.2%

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

    if -8.1999999999999993e-114 < b < 1.08e-83

    1. Initial program 78.6%

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

        \[\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-neg78.6%

        \[\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.6%

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

      \[\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. frac-2neg78.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    9. Step-by-step derivation
      1. add-cube-cbrt78.0%

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

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

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

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

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

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

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

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

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

    if 1.08e-83 < b

    1. Initial program 12.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-neg12.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-neg12.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*12.3%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified12.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 91.1%

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

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

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

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

Alternative 4: 80.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 78.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-neg78.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-neg78.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*78.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified78.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. Taylor expanded in b around -inf 90.2%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, 0.6666666666666666 \cdot \frac{1}{a}\right)} \cdot \left(-b\right) \]
      5. associate-*r/90.4%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \color{blue}{\frac{0.6666666666666666 \cdot 1}{a}}\right) \cdot \left(-b\right) \]
      6. metadata-eval90.4%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{\color{blue}{0.6666666666666666}}{a}\right) \cdot \left(-b\right) \]
    7. Simplified90.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{0.6666666666666666}{a}\right) \cdot \left(-b\right)} \]
    8. Taylor expanded in c around 0 90.2%

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

    if -8.1999999999999993e-114 < b < 1e-82

    1. Initial program 78.6%

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

        \[\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-neg78.6%

        \[\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.6%

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

      \[\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. frac-2neg78.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    9. Step-by-step derivation
      1. add-cube-cbrt78.0%

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

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

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot \sqrt{a \cdot \left(c \cdot {\left(\sqrt[3]{-3}\right)}^{3}\right)}\right)} \cdot \frac{\frac{1}{a}}{-3} \]
    12. Step-by-step derivation
      1. mul-1-neg75.8%

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

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

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

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

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

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

    if 1e-82 < b

    1. Initial program 12.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-neg12.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-neg12.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*12.3%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified12.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 91.1%

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

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

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

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

Alternative 5: 80.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 78.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-neg78.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-neg78.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*78.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified78.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. Taylor expanded in b around -inf 90.2%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, 0.6666666666666666 \cdot \frac{1}{a}\right)} \cdot \left(-b\right) \]
      5. associate-*r/90.4%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \color{blue}{\frac{0.6666666666666666 \cdot 1}{a}}\right) \cdot \left(-b\right) \]
      6. metadata-eval90.4%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{\color{blue}{0.6666666666666666}}{a}\right) \cdot \left(-b\right) \]
    7. Simplified90.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{0.6666666666666666}{a}\right) \cdot \left(-b\right)} \]
    8. Taylor expanded in c around 0 90.2%

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

    if -8.1999999999999993e-114 < b < 3.14999999999999983e-83

    1. Initial program 78.6%

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

        \[\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-neg78.6%

        \[\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.6%

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

      \[\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. frac-2neg78.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    9. Step-by-step derivation
      1. add-cube-cbrt78.0%

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

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

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot \sqrt{a \cdot \left(c \cdot {\left(\sqrt[3]{-3}\right)}^{3}\right)}\right)} \cdot \frac{\frac{1}{a}}{-3} \]
    12. Step-by-step derivation
      1. mul-1-neg75.8%

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

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

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

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

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

      \[\leadsto \color{blue}{\left(-\sqrt{-3 \cdot \left(c \cdot a\right)}\right)} \cdot \frac{\frac{1}{a}}{-3} \]
    14. Taylor expanded in a around 0 75.9%

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

    if 3.14999999999999983e-83 < b

    1. Initial program 12.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-neg12.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-neg12.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*12.3%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified12.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 91.1%

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

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

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

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

Alternative 6: 80.2% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 78.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-neg78.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-neg78.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*78.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified78.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. Taylor expanded in b around -inf 90.2%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, 0.6666666666666666 \cdot \frac{1}{a}\right)} \cdot \left(-b\right) \]
      5. associate-*r/90.4%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \color{blue}{\frac{0.6666666666666666 \cdot 1}{a}}\right) \cdot \left(-b\right) \]
      6. metadata-eval90.4%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{\color{blue}{0.6666666666666666}}{a}\right) \cdot \left(-b\right) \]
    7. Simplified90.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{0.6666666666666666}{a}\right) \cdot \left(-b\right)} \]
    8. Taylor expanded in c around 0 90.2%

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

    if -8.1999999999999993e-114 < b < 1.55000000000000001e-84

    1. Initial program 78.6%

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

        \[\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-neg78.6%

        \[\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.6%

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

      \[\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. frac-2neg78.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    9. Step-by-step derivation
      1. add-cube-cbrt78.0%

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

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

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot \sqrt{a \cdot \left(c \cdot {\left(\sqrt[3]{-3}\right)}^{3}\right)}\right)} \cdot \frac{\frac{1}{a}}{-3} \]
    12. Step-by-step derivation
      1. mul-1-neg75.8%

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

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

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

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

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

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

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

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

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

    if 1.55000000000000001e-84 < b

    1. Initial program 12.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-neg12.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-neg12.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*12.3%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified12.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 91.1%

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

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

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

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

Alternative 7: 80.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 78.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-neg78.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-neg78.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*78.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified78.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. Taylor expanded in b around -inf 90.2%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, 0.6666666666666666 \cdot \frac{1}{a}\right)} \cdot \left(-b\right) \]
      5. associate-*r/90.4%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \color{blue}{\frac{0.6666666666666666 \cdot 1}{a}}\right) \cdot \left(-b\right) \]
      6. metadata-eval90.4%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{\color{blue}{0.6666666666666666}}{a}\right) \cdot \left(-b\right) \]
    7. Simplified90.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{0.6666666666666666}{a}\right) \cdot \left(-b\right)} \]
    8. Taylor expanded in c around 0 90.2%

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

    if -8.1999999999999993e-114 < b < 1.69999999999999988e-82

    1. Initial program 78.6%

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

        \[\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-neg78.6%

        \[\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.6%

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

      \[\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. frac-2neg78.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    9. Step-by-step derivation
      1. add-cube-cbrt78.0%

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

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

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

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

      \[\leadsto \color{blue}{\left(-1 \cdot \sqrt{a \cdot \left(c \cdot {\left(\sqrt[3]{-3}\right)}^{3}\right)}\right)} \cdot \frac{\frac{1}{a}}{-3} \]
    12. Step-by-step derivation
      1. mul-1-neg75.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{0 - \sqrt{-3 \cdot \left(c \cdot a\right)} \cdot \frac{\frac{1}{a}}{-3}} \]
      3. associate-/l/75.8%

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

        \[\leadsto 0 - \sqrt{-3 \cdot \left(c \cdot a\right)} \cdot \frac{1}{\color{blue}{a \cdot -3}} \]
      5. un-div-inv75.9%

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{\sqrt{a \cdot \left(-3 \cdot c\right)}}{a \cdot -3}} \]
      2. distribute-neg-frac275.8%

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

        \[\leadsto \frac{\sqrt{a \cdot \color{blue}{\left(c \cdot -3\right)}}}{-a \cdot -3} \]
      4. distribute-rgt-neg-in75.8%

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

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

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

    if 1.69999999999999988e-82 < b

    1. Initial program 12.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-neg12.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-neg12.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*12.3%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified12.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 91.1%

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

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

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

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

Alternative 8: 71.3% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 78.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-neg78.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-neg78.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*78.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified78.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. Taylor expanded in b around -inf 90.2%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, 0.6666666666666666 \cdot \frac{1}{a}\right)} \cdot \left(-b\right) \]
      5. associate-*r/90.4%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \color{blue}{\frac{0.6666666666666666 \cdot 1}{a}}\right) \cdot \left(-b\right) \]
      6. metadata-eval90.4%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{\color{blue}{0.6666666666666666}}{a}\right) \cdot \left(-b\right) \]
    7. Simplified90.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{0.6666666666666666}{a}\right) \cdot \left(-b\right)} \]
    8. Taylor expanded in c around 0 90.2%

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

    if -7.20000000000000036e-114 < b < 1.30000000000000006e-227

    1. Initial program 78.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-neg78.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-neg78.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*78.5%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified78.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. frac-2neg78.5%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    9. Step-by-step derivation
      1. add-cube-cbrt78.0%

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

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

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

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

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \sqrt{\frac{c \cdot {\left(\sqrt[3]{-3}\right)}^{3}}{a}}} \]
    12. Step-by-step derivation
      1. rem-cube-cbrt38.4%

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

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

    if 1.30000000000000006e-227 < b

    1. Initial program 20.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-neg20.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-neg20.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*20.8%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified20.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. Taylor expanded in b around inf 81.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7.2 \cdot 10^{-114}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5\\ \mathbf{elif}\;b \leq 1.3 \cdot 10^{-227}:\\ \;\;\;\;0.3333333333333333 \cdot \sqrt{\frac{c \cdot -3}{a}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 67.8% accurate, 7.2× speedup?

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

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

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


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

    1. Initial program 79.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-neg79.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-neg79.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*79.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, 0.6666666666666666 \cdot \frac{1}{a}\right)} \cdot \left(-b\right) \]
      5. associate-*r/73.4%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \color{blue}{\frac{0.6666666666666666 \cdot 1}{a}}\right) \cdot \left(-b\right) \]
      6. metadata-eval73.4%

        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{\color{blue}{0.6666666666666666}}{a}\right) \cdot \left(-b\right) \]
    7. Simplified73.4%

      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{0.6666666666666666}{a}\right) \cdot \left(-b\right)} \]
    8. Taylor expanded in c around 0 74.2%

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

    if -3.999999999999988e-310 < b

    1. Initial program 27.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-neg27.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-neg27.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*27.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified27.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 72.5%

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

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

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

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

Alternative 10: 67.6% accurate, 9.7× speedup?

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

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

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


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

    1. Initial program 79.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-neg79.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-neg79.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*79.3%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified79.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. frac-2neg79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < b

    1. Initial program 27.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-neg27.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-neg27.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*27.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified27.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 72.5%

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

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

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

Alternative 11: 67.6% accurate, 11.6× speedup?

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

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

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


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

    1. Initial program 79.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-neg79.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-neg79.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*79.3%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified79.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. frac-2neg79.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    9. Step-by-step derivation
      1. add-cube-cbrt79.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < b

    1. Initial program 27.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-neg27.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-neg27.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*27.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified27.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 72.5%

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

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

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

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

Alternative 12: 67.6% accurate, 11.6× speedup?

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

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

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


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

    1. Initial program 79.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-neg79.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-neg79.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*79.3%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified79.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. frac-2neg79.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    9. Step-by-step derivation
      1. add-cube-cbrt79.0%

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

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < b

    1. Initial program 27.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-neg27.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-neg27.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*27.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified27.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 72.5%

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

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

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

Alternative 13: 67.5% accurate, 11.6× speedup?

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

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

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


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

    1. Initial program 79.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-neg79.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-neg79.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*79.3%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified79.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. frac-2neg79.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}\right) \cdot \frac{\frac{1}{a}}{-3}} \]
    9. Step-by-step derivation
      1. add-cube-cbrt79.0%

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

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < b

    1. Initial program 27.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-neg27.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-neg27.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*27.2%

        \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
    3. Simplified27.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 56.7%

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{a \cdot c}{b}}}{3 \cdot a} \]
    6. Step-by-step derivation
      1. clear-num56.3%

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

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

        \[\leadsto {\color{blue}{\left(\frac{3}{-1.5} \cdot \frac{a}{\frac{a \cdot c}{b}}\right)}}^{-1} \]
      4. metadata-eval56.4%

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

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

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

        \[\leadsto \color{blue}{\frac{1}{-2 \cdot \frac{a}{a \cdot \frac{c}{b}}}} \]
      2. associate-/r*72.0%

        \[\leadsto \frac{1}{-2 \cdot \color{blue}{\frac{\frac{a}{a}}{\frac{c}{b}}}} \]
      3. *-inverses72.0%

        \[\leadsto \frac{1}{-2 \cdot \frac{\color{blue}{1}}{\frac{c}{b}}} \]
    9. Simplified72.0%

      \[\leadsto \color{blue}{\frac{1}{-2 \cdot \frac{1}{\frac{c}{b}}}} \]
    10. Step-by-step derivation
      1. *-un-lft-identity72.0%

        \[\leadsto \color{blue}{1 \cdot \frac{1}{-2 \cdot \frac{1}{\frac{c}{b}}}} \]
      2. associate-/r*72.0%

        \[\leadsto 1 \cdot \color{blue}{\frac{\frac{1}{-2}}{\frac{1}{\frac{c}{b}}}} \]
      3. metadata-eval72.0%

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

        \[\leadsto 1 \cdot \frac{-0.5}{\color{blue}{\frac{b}{c}}} \]
    11. Applied egg-rr71.9%

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

        \[\leadsto \color{blue}{\frac{-0.5}{\frac{b}{c}}} \]
      2. associate-/r/72.2%

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

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

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

Alternative 14: 35.5% accurate, 23.2× speedup?

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

\\
b \cdot \frac{-0.6666666666666666}{a}
\end{array}
Derivation
  1. Initial program 54.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-neg54.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-neg54.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*54.1%

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
  3. Simplified54.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. frac-2neg54.1%

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}\right) \cdot \frac{\frac{1}{a}}{-3}} \]
  9. Step-by-step derivation
    1. add-cube-cbrt53.8%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{-0.6666666666666666 \cdot b}{a}} \]
    2. *-commutative39.0%

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

      \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
  13. Simplified39.0%

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

Reproduce

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