Cubic critical

Percentage Accurate: 52.1% → 86.0%
Time: 13.2s
Alternatives: 17
Speedup: 16.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 52.1% accurate, 1.0× speedup?

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

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

Alternative 1: 86.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 39.7%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
    6. Simplified99.8%

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

    if -1.00000000000000002e151 < b < 2.05000000000000001e-47

    1. Initial program 88.7%

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

    if 2.05000000000000001e-47 < b

    1. Initial program 18.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+151}:\\ \;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\ \mathbf{elif}\;b \leq 2.05 \cdot 10^{-47}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} - b}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]

Alternative 2: 85.9% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 42.7%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
    6. Simplified99.8%

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

    if -3.6e140 < b < 8.4999999999999999e-47

    1. Initial program 88.5%

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

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

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

        \[\leadsto \frac{\color{blue}{0 - \left(b - \sqrt{\left(-b\right) \cdot \left(-b\right) - \left(3 \cdot a\right) \cdot c}\right)}}{3 \cdot a} \]
      4. sub0-neg88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.4999999999999999e-47 < b

    1. Initial program 18.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.6 \cdot 10^{+140}:\\ \;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\ \mathbf{elif}\;b \leq 8.5 \cdot 10^{-47}:\\ \;\;\;\;\left(\sqrt{b \cdot b - a \cdot \left(3 \cdot c\right)} - b\right) \cdot \frac{0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]

Alternative 3: 85.9% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 51.2%

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

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

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

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

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

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

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

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

    if -7.0000000000000005e108 < b < 4.2999999999999998e-47

    1. Initial program 87.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.2999999999999998e-47 < b

    1. Initial program 18.6%

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

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

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

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

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

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

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

Alternative 4: 85.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.95 \cdot 10^{+105}:\\
\;\;\;\;\frac{b \cdot -2 + \left|\frac{a}{b} \cdot \left(c \cdot 1.5\right)\right|}{3 \cdot a}\\

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

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


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

    1. Initial program 52.2%

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-2 \cdot b + 1.5 \cdot \frac{a \cdot c}{b}}}{3 \cdot a} \]
    5. Step-by-step derivation
      1. add-sqr-sqrt68.6%

        \[\leadsto \frac{-2 \cdot b + \color{blue}{\sqrt{1.5 \cdot \frac{a \cdot c}{b}} \cdot \sqrt{1.5 \cdot \frac{a \cdot c}{b}}}}{3 \cdot a} \]
      2. sqrt-unprod95.9%

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

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

        \[\leadsto \frac{-2 \cdot b + \sqrt{{\color{blue}{\left(\frac{a \cdot c}{b} \cdot 1.5\right)}}^{2}}}{3 \cdot a} \]
      5. associate-/l*99.8%

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

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

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

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

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

        \[\leadsto \frac{-2 \cdot b + \color{blue}{\left|1.5 \cdot \frac{a \cdot c}{b}\right|}}{3 \cdot a} \]
      5. associate-/l*99.8%

        \[\leadsto \frac{-2 \cdot b + \left|1.5 \cdot \color{blue}{\frac{a}{\frac{b}{c}}}\right|}{3 \cdot a} \]
      6. *-commutative99.8%

        \[\leadsto \frac{-2 \cdot b + \left|\color{blue}{\frac{a}{\frac{b}{c}} \cdot 1.5}\right|}{3 \cdot a} \]
      7. associate-/r/99.8%

        \[\leadsto \frac{-2 \cdot b + \left|\color{blue}{\left(\frac{a}{b} \cdot c\right)} \cdot 1.5\right|}{3 \cdot a} \]
      8. associate-*l*99.8%

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

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

    if -1.94999999999999989e105 < b < 1.7499999999999999e-47

    1. Initial program 87.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.7499999999999999e-47 < b

    1. Initial program 18.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.95 \cdot 10^{+105}:\\ \;\;\;\;\frac{b \cdot -2 + \left|\frac{a}{b} \cdot \left(c \cdot 1.5\right)\right|}{3 \cdot a}\\ \mathbf{elif}\;b \leq 1.75 \cdot 10^{-47}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - a \cdot \left(3 \cdot c\right)} - b}{a} \cdot 0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]

Alternative 5: 85.9% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 39.7%

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

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

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

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

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

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

        \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
    6. Simplified99.8%

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

    if -2.00000000000000007e154 < b < 2.40000000000000013e-46

    1. Initial program 88.7%

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

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

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

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

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

    if 2.40000000000000013e-46 < b

    1. Initial program 18.6%

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

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

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

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

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

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

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

Alternative 6: 79.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -0.5:\\
\;\;\;\;\frac{\left(\frac{a}{b} \cdot \left(c \cdot 1.5\right) - b\right) - b}{\frac{a}{0.3333333333333333}}\\

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

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


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

    1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\left(-1 \cdot b + 1.5 \cdot \frac{a \cdot c}{b}\right)} - b}{\frac{a}{0.3333333333333333}} \]
    9. Step-by-step derivation
      1. neg-mul-193.0%

        \[\leadsto \frac{\left(\color{blue}{\left(-b\right)} + 1.5 \cdot \frac{a \cdot c}{b}\right) - b}{\frac{a}{0.3333333333333333}} \]
      2. +-commutative93.0%

        \[\leadsto \frac{\color{blue}{\left(1.5 \cdot \frac{a \cdot c}{b} + \left(-b\right)\right)} - b}{\frac{a}{0.3333333333333333}} \]
      3. unsub-neg93.0%

        \[\leadsto \frac{\color{blue}{\left(1.5 \cdot \frac{a \cdot c}{b} - b\right)} - b}{\frac{a}{0.3333333333333333}} \]
      4. associate-/l*95.7%

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

        \[\leadsto \frac{\left(\color{blue}{\frac{a}{\frac{b}{c}} \cdot 1.5} - b\right) - b}{\frac{a}{0.3333333333333333}} \]
      6. associate-/r/95.7%

        \[\leadsto \frac{\left(\color{blue}{\left(\frac{a}{b} \cdot c\right)} \cdot 1.5 - b\right) - b}{\frac{a}{0.3333333333333333}} \]
      7. associate-*l*95.7%

        \[\leadsto \frac{\left(\color{blue}{\frac{a}{b} \cdot \left(c \cdot 1.5\right)} - b\right) - b}{\frac{a}{0.3333333333333333}} \]
    10. Simplified95.7%

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

    if -0.5 < b < 1.11999999999999997e-46

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.11999999999999997e-46 < b

    1. Initial program 18.6%

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

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

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

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

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

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

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

Alternative 7: 79.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.4:\\
\;\;\;\;\frac{\left(\frac{a}{b} \cdot \left(c \cdot 1.5\right) - b\right) - b}{\frac{a}{0.3333333333333333}}\\

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

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


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

    1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\left(-1 \cdot b + 1.5 \cdot \frac{a \cdot c}{b}\right)} - b}{\frac{a}{0.3333333333333333}} \]
    9. Step-by-step derivation
      1. neg-mul-193.0%

        \[\leadsto \frac{\left(\color{blue}{\left(-b\right)} + 1.5 \cdot \frac{a \cdot c}{b}\right) - b}{\frac{a}{0.3333333333333333}} \]
      2. +-commutative93.0%

        \[\leadsto \frac{\color{blue}{\left(1.5 \cdot \frac{a \cdot c}{b} + \left(-b\right)\right)} - b}{\frac{a}{0.3333333333333333}} \]
      3. unsub-neg93.0%

        \[\leadsto \frac{\color{blue}{\left(1.5 \cdot \frac{a \cdot c}{b} - b\right)} - b}{\frac{a}{0.3333333333333333}} \]
      4. associate-/l*95.7%

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

        \[\leadsto \frac{\left(\color{blue}{\frac{a}{\frac{b}{c}} \cdot 1.5} - b\right) - b}{\frac{a}{0.3333333333333333}} \]
      6. associate-/r/95.7%

        \[\leadsto \frac{\left(\color{blue}{\left(\frac{a}{b} \cdot c\right)} \cdot 1.5 - b\right) - b}{\frac{a}{0.3333333333333333}} \]
      7. associate-*l*95.7%

        \[\leadsto \frac{\left(\color{blue}{\frac{a}{b} \cdot \left(c \cdot 1.5\right)} - b\right) - b}{\frac{a}{0.3333333333333333}} \]
    10. Simplified95.7%

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

    if -3.39999999999999991 < b < 3.7999999999999997e-46

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.7999999999999997e-46 < b

    1. Initial program 18.6%

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

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

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

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

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

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

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

Alternative 8: 79.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -0.15:\\
\;\;\;\;\frac{\left(\frac{a}{b} \cdot \left(c \cdot 1.5\right) - b\right) - b}{\frac{a}{0.3333333333333333}}\\

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

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


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

    1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{\left(-1 \cdot b + 1.5 \cdot \frac{a \cdot c}{b}\right)} - b}{\frac{a}{0.3333333333333333}} \]
    9. Step-by-step derivation
      1. neg-mul-193.0%

        \[\leadsto \frac{\left(\color{blue}{\left(-b\right)} + 1.5 \cdot \frac{a \cdot c}{b}\right) - b}{\frac{a}{0.3333333333333333}} \]
      2. +-commutative93.0%

        \[\leadsto \frac{\color{blue}{\left(1.5 \cdot \frac{a \cdot c}{b} + \left(-b\right)\right)} - b}{\frac{a}{0.3333333333333333}} \]
      3. unsub-neg93.0%

        \[\leadsto \frac{\color{blue}{\left(1.5 \cdot \frac{a \cdot c}{b} - b\right)} - b}{\frac{a}{0.3333333333333333}} \]
      4. associate-/l*95.7%

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

        \[\leadsto \frac{\left(\color{blue}{\frac{a}{\frac{b}{c}} \cdot 1.5} - b\right) - b}{\frac{a}{0.3333333333333333}} \]
      6. associate-/r/95.7%

        \[\leadsto \frac{\left(\color{blue}{\left(\frac{a}{b} \cdot c\right)} \cdot 1.5 - b\right) - b}{\frac{a}{0.3333333333333333}} \]
      7. associate-*l*95.7%

        \[\leadsto \frac{\left(\color{blue}{\frac{a}{b} \cdot \left(c \cdot 1.5\right)} - b\right) - b}{\frac{a}{0.3333333333333333}} \]
    10. Simplified95.7%

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

    if -0.149999999999999994 < b < 8.4999999999999999e-47

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 8.4999999999999999e-47 < b

    1. Initial program 18.6%

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

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

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

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

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

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

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

Alternative 9: 68.4% accurate, 8.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{c}{b} \cdot 0.5 + -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)
   (+ (* (/ c b) 0.5) (* -0.6666666666666666 (/ b a)))
   (* -0.5 (/ c b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-310) {
		tmp = ((c / b) * 0.5) + (-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 = ((c / b) * 0.5d0) + ((-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 = ((c / b) * 0.5) + (-0.6666666666666666 * (b / a));
	} else {
		tmp = -0.5 * (c / b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -5e-310:
		tmp = ((c / b) * 0.5) + (-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(Float64(Float64(c / b) * 0.5) + 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 = ((c / b) * 0.5) + (-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[(N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision] + N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c}{b} \cdot 0.5 + -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.9%

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

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

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

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

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 36.9%

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

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

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

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

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

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

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

Alternative 10: 68.4% accurate, 8.9× speedup?

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

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

\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.9%

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 36.9%

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

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

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

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

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

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

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

Alternative 11: 68.1% accurate, 12.8× speedup?

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

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

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


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

    1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{b \cdot b - \color{blue}{a \cdot \left(3 \cdot c\right)}} - b}{\frac{a}{0.3333333333333333}} \]
    5. Applied egg-rr75.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{3 \cdot \color{blue}{\frac{-0.5 \cdot a}{b}}} \]
    14. Simplified68.4%

      \[\leadsto \frac{1}{3 \cdot \color{blue}{\frac{-0.5 \cdot a}{b}}} \]
    15. Taylor expanded in a around 0 68.4%

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

    if 4.1999999999999999e-277 < b

    1. Initial program 35.9%

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

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

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

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

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

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

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

Alternative 12: 68.1% accurate, 12.8× speedup?

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

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

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


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

    1. Initial program 75.3%

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

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

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

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

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

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

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

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

    if 4.1999999999999999e-277 < b

    1. Initial program 35.9%

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

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

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

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

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

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

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

Alternative 13: 68.1% accurate, 16.4× speedup?

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

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

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


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

    1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{b \cdot b - \color{blue}{a \cdot \left(3 \cdot c\right)}} - b}{\frac{a}{0.3333333333333333}} \]
    5. Applied egg-rr75.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{3 \cdot \color{blue}{\frac{-0.5 \cdot a}{b}}} \]
    14. Simplified68.4%

      \[\leadsto \frac{1}{3 \cdot \color{blue}{\frac{-0.5 \cdot a}{b}}} \]
    15. Step-by-step derivation
      1. expm1-log1p-u36.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{1}{3 \cdot \frac{-0.5 \cdot a}{b}}\right)\right)} \]
      2. expm1-udef26.0%

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{1}{3 \cdot \frac{-0.5 \cdot a}{b}}\right)} - 1} \]
      3. associate-/r*26.0%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{\frac{1}{3}}{\frac{-0.5 \cdot a}{b}}}\right)} - 1 \]
      4. metadata-eval26.0%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{\color{blue}{0.3333333333333333}}{\frac{-0.5 \cdot a}{b}}\right)} - 1 \]
      5. *-commutative26.0%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{0.3333333333333333}{\frac{\color{blue}{a \cdot -0.5}}{b}}\right)} - 1 \]
    16. Applied egg-rr26.0%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{0.3333333333333333}{\frac{a \cdot -0.5}{b}}\right)} - 1} \]
    17. Step-by-step derivation
      1. expm1-def36.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{0.3333333333333333}{\frac{a \cdot -0.5}{b}}\right)\right)} \]
      2. expm1-log1p68.2%

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{\frac{a \cdot -0.5}{b}}} \]
      3. associate-/r/68.2%

        \[\leadsto \color{blue}{\frac{0.3333333333333333}{a \cdot -0.5} \cdot b} \]
      4. *-commutative68.2%

        \[\leadsto \color{blue}{b \cdot \frac{0.3333333333333333}{a \cdot -0.5}} \]
      5. *-commutative68.2%

        \[\leadsto b \cdot \frac{0.3333333333333333}{\color{blue}{-0.5 \cdot a}} \]
      6. associate-/r*68.2%

        \[\leadsto b \cdot \color{blue}{\frac{\frac{0.3333333333333333}{-0.5}}{a}} \]
      7. metadata-eval68.2%

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

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

    if 4.1999999999999999e-277 < b

    1. Initial program 35.9%

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

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

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

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

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

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

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

Alternative 14: 68.1% accurate, 16.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 4.2 \cdot 10^{-277}:\\ \;\;\;\;-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 4.2e-277) (* -0.6666666666666666 (/ b a)) (* -0.5 (/ c b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 4.2e-277) {
		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 <= 4.2d-277) 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 <= 4.2e-277) {
		tmp = -0.6666666666666666 * (b / a);
	} else {
		tmp = -0.5 * (c / b);
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 4.2e-277:
		tmp = -0.6666666666666666 * (b / a)
	else:
		tmp = -0.5 * (c / b)
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 4.2e-277)
		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 <= 4.2e-277)
		tmp = -0.6666666666666666 * (b / a);
	else
		tmp = -0.5 * (c / b);
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 4.2e-277], 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 4.2 \cdot 10^{-277}:\\
\;\;\;\;-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.1999999999999999e-277

    1. Initial program 75.3%

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

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

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

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

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

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

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

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

    if 4.1999999999999999e-277 < b

    1. Initial program 35.9%

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

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

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

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

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

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

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

Alternative 15: 68.1% accurate, 16.4× speedup?

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

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

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


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

    1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{b \cdot b - \color{blue}{a \cdot \left(3 \cdot c\right)}} - b}{\frac{a}{0.3333333333333333}} \]
    5. Applied egg-rr75.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.6666666666666666 \cdot b}{a}} \]
      2. associate-/l*68.2%

        \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]
    10. Simplified68.2%

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

    if 5.2e-277 < b

    1. Initial program 35.9%

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

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

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

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

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

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

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

Alternative 16: 68.1% accurate, 16.4× speedup?

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

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

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


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

    1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{b \cdot b - \color{blue}{a \cdot \left(3 \cdot c\right)}} - b}{\frac{a}{0.3333333333333333}} \]
    5. Applied egg-rr75.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.1999999999999999e-277 < b

    1. Initial program 35.9%

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

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

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

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

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

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

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

Alternative 17: 35.8% 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 55.2%

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

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

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

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

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

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

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

Reproduce

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