Cubic critical

Percentage Accurate: 51.9% → 84.5%
Time: 16.8s
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: 51.9% accurate, 1.0× speedup?

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

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

Alternative 1: 84.5% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 53.9%

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

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

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

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

    if -3e135 < b < 1.04999999999999999e-152

    1. Initial program 86.5%

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

    if 1.04999999999999999e-152 < b

    1. Initial program 22.9%

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

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

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{a}{\frac{b}{c}}}}{3 \cdot a} \]
      2. associate-/r/65.0%

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

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

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

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

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

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

Alternative 2: 78.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -650000:\\
\;\;\;\;\mathsf{fma}\left(-0.6666666666666666, \frac{b}{a}, 0.5 \cdot \frac{c}{b}\right)\\

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

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


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

    1. Initial program 69.4%

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. fma-define94.2%

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

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

    if -6.5e5 < b < 1.04999999999999999e-152

    1. Initial program 81.0%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l*80.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.04999999999999999e-152 < b

    1. Initial program 22.9%

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

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

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{a}{\frac{b}{c}}}}{3 \cdot a} \]
      2. associate-/r/65.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -650000:\\ \;\;\;\;\mathsf{fma}\left(-0.6666666666666666, \frac{b}{a}, 0.5 \cdot \frac{c}{b}\right)\\ \mathbf{elif}\;b \leq 1.05 \cdot 10^{-152}:\\ \;\;\;\;\frac{\frac{\sqrt{c \cdot \left(a \cdot -3\right)}}{a}}{3} - \frac{b}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 78.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -10000:\\
\;\;\;\;\mathsf{fma}\left(-0.6666666666666666, \frac{b}{a}, 0.5 \cdot \frac{c}{b}\right)\\

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

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


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

    1. Initial program 69.4%

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. fma-define94.2%

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

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

    if -1e4 < b < 1.90000000000000004e-156

    1. Initial program 81.0%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l*80.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.90000000000000004e-156 < b

    1. Initial program 22.9%

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

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

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{a}{\frac{b}{c}}}}{3 \cdot a} \]
      2. associate-/r/65.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -10000:\\ \;\;\;\;\mathsf{fma}\left(-0.6666666666666666, \frac{b}{a}, 0.5 \cdot \frac{c}{b}\right)\\ \mathbf{elif}\;b \leq 1.9 \cdot 10^{-156}:\\ \;\;\;\;\frac{\sqrt{-3 \cdot \left(a \cdot c\right)} - b}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 78.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -10000:\\
\;\;\;\;\mathsf{fma}\left(-0.6666666666666666, \frac{b}{a}, 0.5 \cdot \frac{c}{b}\right)\\

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

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


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

    1. Initial program 69.4%

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. fma-define94.2%

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

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

    if -1e4 < b < 1.04999999999999999e-152

    1. Initial program 81.0%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*l*80.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.04999999999999999e-152 < b

    1. Initial program 22.9%

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

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

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{a}{\frac{b}{c}}}}{3 \cdot a} \]
      2. associate-/r/65.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -10000:\\ \;\;\;\;\mathsf{fma}\left(-0.6666666666666666, \frac{b}{a}, 0.5 \cdot \frac{c}{b}\right)\\ \mathbf{elif}\;b \leq 1.05 \cdot 10^{-152}:\\ \;\;\;\;\frac{\sqrt{a \cdot \left(c \cdot -3\right)} - b}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 78.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -19000:\\
\;\;\;\;\mathsf{fma}\left(-0.6666666666666666, \frac{b}{a}, 0.5 \cdot \frac{c}{b}\right)\\

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

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


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

    1. Initial program 69.4%

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. fma-define94.2%

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

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

    if -19000 < b < 1.00000000000000007e-152

    1. Initial program 81.0%

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

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

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

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

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

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

    if 1.00000000000000007e-152 < b

    1. Initial program 22.9%

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

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

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{a}{\frac{b}{c}}}}{3 \cdot a} \]
      2. associate-/r/65.0%

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

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

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

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

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

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

Alternative 6: 79.4% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 71.6%

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

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

    if -2.1000000000000002e-67 < b < 9.3999999999999998e-153

    1. Initial program 79.4%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. 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} \]
      2. prod-diff79.0%

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(-\color{blue}{a \cdot 3}\right)\right) + \mathsf{fma}\left(-a \cdot c, 3, \left(a \cdot c\right) \cdot 3\right)}}{3 \cdot a} \]
      8. distribute-rgt-neg-in79.0%

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

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

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

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

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

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

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

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

        \[\leadsto 0.3333333333333333 \cdot \color{blue}{\frac{1 \cdot \sqrt{-6 \cdot \left(a \cdot c\right) + 3 \cdot \left(a \cdot c\right)}}{a}} \]
      2. distribute-rgt-out70.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.3999999999999998e-153 < b

    1. Initial program 22.9%

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

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

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{a}{\frac{b}{c}}}}{3 \cdot a} \]
      2. associate-/r/65.0%

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

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

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

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

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

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

Alternative 7: 79.5% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 71.6%

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

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

    if -7.79999999999999961e-69 < b < 1.04999999999999999e-152

    1. Initial program 79.4%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. 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} \]
      2. prod-diff79.0%

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(-\color{blue}{a \cdot 3}\right)\right) + \mathsf{fma}\left(-a \cdot c, 3, \left(a \cdot c\right) \cdot 3\right)}}{3 \cdot a} \]
      8. distribute-rgt-neg-in79.0%

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

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

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

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

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

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

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

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

        \[\leadsto 0.3333333333333333 \cdot \color{blue}{\frac{1 \cdot \sqrt{-6 \cdot \left(a \cdot c\right) + 3 \cdot \left(a \cdot c\right)}}{a}} \]
      2. distribute-rgt-out70.0%

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

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

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

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

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

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

    if 1.04999999999999999e-152 < b

    1. Initial program 22.9%

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

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

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{a}{\frac{b}{c}}}}{3 \cdot a} \]
      2. associate-/r/65.0%

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

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

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

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

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

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

Alternative 8: 79.4% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 71.6%

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

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

    if -6.00000000000000065e-67 < b < 1.04999999999999999e-152

    1. Initial program 79.4%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right) + \color{blue}{\left(\left(-c\right) \cdot \left(3 \cdot a\right) + \left(3 \cdot a\right) \cdot c\right)}}}{3 \cdot a} \]
      8. distribute-lft-neg-in79.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.04999999999999999e-152 < b

    1. Initial program 22.9%

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

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

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{a}{\frac{b}{c}}}}{3 \cdot a} \]
      2. associate-/r/65.0%

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

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

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

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

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

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

Alternative 9: 79.4% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 71.6%

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. fma-define88.8%

        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.6666666666666666, \frac{b}{a}, 0.5 \cdot \frac{c}{b}\right)} \]
    5. Simplified88.8%

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

    if -1.12000000000000004e-66 < b < 1.04999999999999999e-152

    1. Initial program 79.4%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right) + \color{blue}{\left(\left(-c\right) \cdot \left(3 \cdot a\right) + \left(3 \cdot a\right) \cdot c\right)}}}{3 \cdot a} \]
      8. distribute-lft-neg-in79.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.04999999999999999e-152 < b

    1. Initial program 22.9%

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

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

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{a}{\frac{b}{c}}}}{3 \cdot a} \]
      2. associate-/r/65.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.12 \cdot 10^{-66}:\\ \;\;\;\;\mathsf{fma}\left(-0.6666666666666666, \frac{b}{a}, 0.5 \cdot \frac{c}{b}\right)\\ \mathbf{elif}\;b \leq 1.05 \cdot 10^{-152}:\\ \;\;\;\;\frac{\sqrt{a \cdot \left(c \cdot -3\right)}}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 67.9% accurate, 7.2× speedup?

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

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

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


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

    1. Initial program 74.4%

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 31.1%

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

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

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{a}{\frac{b}{c}}}}{3 \cdot a} \]
      2. associate-/r/55.5%

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

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

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

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

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

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

Alternative 11: 67.7% accurate, 9.7× speedup?

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

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

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


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

    1. Initial program 74.4%

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

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

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 31.1%

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

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

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{a}{\frac{b}{c}}}}{3 \cdot a} \]
      2. associate-/r/55.5%

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

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

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

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

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

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

Alternative 12: 67.7% accurate, 11.6× speedup?

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

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

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


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

    1. Initial program 74.4%

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

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

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 31.1%

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

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

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

Alternative 13: 67.7% accurate, 11.6× speedup?

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

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

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


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

    1. Initial program 74.4%

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

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

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 31.1%

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

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

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{a}{\frac{b}{c}}}}{3 \cdot a} \]
      2. associate-/r/55.5%

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

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

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

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

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

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

Alternative 14: 35.0% accurate, 23.2× speedup?

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

\\
-0.5 \cdot \frac{c}{b}
\end{array}
Derivation
  1. Initial program 52.8%

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

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

    \[\leadsto -0.5 \cdot \frac{c}{b} \]
  5. Add Preprocessing

Reproduce

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