Cubic critical

Percentage Accurate: 52.0% → 84.9%
Time: 16.2s
Alternatives: 14
Speedup: 11.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 52.0% accurate, 1.0× speedup?

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

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

Alternative 1: 84.9% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 54.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
      2. clear-num95.1%

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

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

    if -9.80000000000000043e113 < b < 2.0999999999999999e-32

    1. Initial program 79.7%

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

    if 2.0999999999999999e-32 < b

    1. Initial program 7.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-neg7.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-neg7.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*7.3%

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

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

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

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

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

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

Alternative 2: 84.8% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 54.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
      2. clear-num95.1%

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

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

    if -9.80000000000000043e113 < b < 8.1999999999999995e-32

    1. Initial program 79.7%

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

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

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

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

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

    if 8.1999999999999995e-32 < b

    1. Initial program 7.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-neg7.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-neg7.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*7.3%

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

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

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

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

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

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

Alternative 3: 79.4% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 69.0%

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

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

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

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

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

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

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

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

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

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

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

    if -2.1e-82 < b < 9.3999999999999997e-29

    1. Initial program 73.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-neg73.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-neg73.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*73.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{0.3333333333333333}{\frac{a}{\color{blue}{\sqrt{a} \cdot \sqrt{c \cdot -3} + b}}} \]
      4. sqrt-prod63.8%

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

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

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

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

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

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

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

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

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

    if 9.3999999999999997e-29 < b

    1. Initial program 7.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-neg7.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-neg7.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*7.3%

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

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

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

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

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

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

Alternative 4: 79.4% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 69.0%

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

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

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

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

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

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

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

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

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

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

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

    if -1.40000000000000012e-82 < b < 7.19999999999999948e-29

    1. Initial program 73.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-neg73.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-neg73.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*73.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.19999999999999948e-29 < b

    1. Initial program 7.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-neg7.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-neg7.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*7.3%

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

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

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

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

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

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

Alternative 5: 79.3% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 69.0%

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

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

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

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

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

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

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

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

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

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

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

    if -4e-82 < b < 6.9999999999999997e-26

    1. Initial program 73.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-neg73.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-neg73.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*73.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.9999999999999997e-26 < b

    1. Initial program 7.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-neg7.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-neg7.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*7.3%

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

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

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

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

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

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

Alternative 6: 80.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 69.0%

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

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

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

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

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

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

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

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

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

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

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

    if -4.59999999999999994e-82 < b < 3.69999999999999988e-34

    1. Initial program 73.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-neg73.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-neg73.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*73.8%

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

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

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

    if 3.69999999999999988e-34 < b

    1. Initial program 7.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-neg7.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-neg7.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*7.3%

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

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

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

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

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

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

Alternative 7: 79.9% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 69.0%

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

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

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

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

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

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

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

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

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

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

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

    if -1.44999999999999989e-82 < b < 3.0999999999999998e-34

    1. Initial program 73.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-neg73.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-neg73.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*73.8%

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

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

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

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

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

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

    if 3.0999999999999998e-34 < b

    1. Initial program 7.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-neg7.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-neg7.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*7.3%

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

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

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

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

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

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

Alternative 8: 80.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 69.0%

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

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

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

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

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

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

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

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

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

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

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

    if -2.4999999999999999e-82 < b < 7.79999999999999982e-34

    1. Initial program 73.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-neg73.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-neg73.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*73.8%

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

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

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

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

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

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

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

    if 7.79999999999999982e-34 < b

    1. Initial program 7.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-neg7.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-neg7.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*7.3%

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

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

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

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

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

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

Alternative 9: 80.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.6 \cdot 10^{-82}:\\
\;\;\;\;\frac{1}{\frac{3}{\mathsf{fma}\left(\frac{b}{a}, -2, \frac{c}{b} \cdot 1.5\right)}}\\

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

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


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

    1. Initial program 69.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{a \cdot \left(-2 \cdot \frac{b}{a} + 1.5 \cdot \frac{c}{b}\right)}}{3 \cdot a} \]
    9. Step-by-step derivation
      1. clear-num89.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(\frac{a}{a} \cdot \frac{3}{\mathsf{fma}\left(-2, \frac{b}{a}, \frac{1.5 \cdot c}{b}\right)}\right)}^{-1}} \]
    11. Step-by-step derivation
      1. unpow-189.3%

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

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

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

        \[\leadsto \frac{1}{\frac{3}{\color{blue}{-2 \cdot \frac{b}{a} + \frac{1.5 \cdot c}{b}}}} \]
      5. *-commutative89.3%

        \[\leadsto \frac{1}{\frac{3}{\color{blue}{\frac{b}{a} \cdot -2} + \frac{1.5 \cdot c}{b}}} \]
      6. fma-undefine89.3%

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

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

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

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

    if -4.59999999999999994e-82 < b < 6.59999999999999965e-34

    1. Initial program 73.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-neg73.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-neg73.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*73.8%

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

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

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

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

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

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

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

    if 6.59999999999999965e-34 < b

    1. Initial program 7.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-neg7.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-neg7.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*7.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.6 \cdot 10^{-82}:\\ \;\;\;\;\frac{1}{\frac{3}{\mathsf{fma}\left(\frac{b}{a}, -2, \frac{c}{b} \cdot 1.5\right)}}\\ \mathbf{elif}\;b \leq 6.6 \cdot 10^{-34}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 67.3% accurate, 7.2× speedup?

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

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

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


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

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 26.4%

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

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

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

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

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

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

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

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

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

Alternative 11: 42.3% accurate, 11.6× speedup?

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

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

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


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

    1. Initial program 70.4%

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

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

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

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

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

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

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

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

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

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

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

    if 1.15e-20 < b

    1. Initial program 7.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 67.1% accurate, 11.6× speedup?

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

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

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


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

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

    if 4.999999999999985e-310 < b

    1. Initial program 26.4%

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \left(a \cdot \frac{c}{b}\right)}}{3 \cdot a} \]
    8. Step-by-step derivation
      1. *-un-lft-identity63.9%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c \cdot \frac{0.16666666666666666 \cdot \color{blue}{-3}}{b} \]
      9. metadata-eval73.6%

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

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

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

Alternative 13: 67.2% accurate, 11.6× speedup?

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

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

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


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

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 26.4%

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

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

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

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

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

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

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

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

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

Alternative 14: 10.7% accurate, 23.2× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{0.5 \cdot \frac{c}{b}} \]
  9. Final simplification9.0%

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

Reproduce

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