Cubic critical

Percentage Accurate: 52.5% → 84.3%
Time: 14.4s
Alternatives: 13
Speedup: 16.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 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.5% 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.3% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 62.1%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Applied egg-rr44.5%

      \[\leadsto \color{blue}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right) \cdot \frac{0.3333333333333333}{a} + \left(-b \cdot \frac{0.3333333333333333}{a}\right)} \]
    3. Step-by-step derivation
      1. sub-neg44.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{b \cdot \color{blue}{\frac{1}{-1.5}}}{a} \]
      3. div-inv92.7%

        \[\leadsto \frac{\color{blue}{\frac{b}{-1.5}}}{a} \]
      4. associate-/l/92.7%

        \[\leadsto \color{blue}{\frac{b}{a \cdot -1.5}} \]
      5. associate-/r*92.8%

        \[\leadsto \color{blue}{\frac{\frac{b}{a}}{-1.5}} \]
    9. Applied egg-rr92.8%

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

    if -5.9999999999999997e-7 < b < 2.49999999999999999e-91

    1. Initial program 75.3%

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

    if 2.49999999999999999e-91 < b

    1. Initial program 10.7%

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

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

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

Alternative 2: 80.9% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 66.6%

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

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

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

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

    if -1.69999999999999988e-100 < b < 1.45999999999999999e-95

    1. Initial program 72.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.45999999999999999e-95 < b

    1. Initial program 11.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.7 \cdot 10^{-100}:\\ \;\;\;\;\mathsf{fma}\left(-0.6666666666666666, \frac{b}{a}, \frac{c}{b} \cdot 0.5\right)\\ \mathbf{elif}\;b \leq 1.46 \cdot 10^{-95}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]

Alternative 3: 80.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 66.6%

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

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

    if -2.54999999999999986e-92 < b < 4.4000000000000002e-91

    1. Initial program 72.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. prod-diff71.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.4000000000000002e-91 < b

    1. Initial program 10.7%

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

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

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

Alternative 4: 80.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 66.6%

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

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

    if -2.1999999999999999e-103 < b < 1.70000000000000013e-91

    1. Initial program 72.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. prod-diff71.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{0.3333333333333333}{\frac{a}{\color{blue}{\sqrt{c} \cdot \sqrt{-3 \cdot a}}}} \]
      4. *-commutative39.9%

        \[\leadsto \frac{0.3333333333333333}{\frac{a}{\sqrt{c} \cdot \sqrt{\color{blue}{a \cdot -3}}}} \]
      5. sqrt-prod66.6%

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

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

    if 1.70000000000000013e-91 < b

    1. Initial program 10.7%

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

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

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

Alternative 5: 80.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 66.6%

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

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

    if -5.0000000000000001e-100 < b < 1.3600000000000001e-91

    1. Initial program 72.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. prod-diff71.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3600000000000001e-91 < b

    1. Initial program 10.7%

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

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

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

Alternative 6: 80.7% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 66.6%

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

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

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

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

    if -5.9000000000000003e-102 < b < 4.7999999999999999e-88

    1. Initial program 72.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. prod-diff71.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.7999999999999999e-88 < b

    1. Initial program 10.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.9 \cdot 10^{-102}:\\ \;\;\;\;\mathsf{fma}\left(-0.6666666666666666, \frac{b}{a}, \frac{c}{b} \cdot 0.5\right)\\ \mathbf{elif}\;b \leq 4.8 \cdot 10^{-88}:\\ \;\;\;\;\frac{0.3333333333333333 \cdot \sqrt{-3 \cdot \left(a \cdot c\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]

Alternative 7: 72.4% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;b \leq 5.6 \cdot 10^{-171}:\\
\;\;\;\;\sqrt{0.1111111111111111 \cdot \frac{c}{\frac{a}{-3}}}\\

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


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

    1. Initial program 67.4%

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

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

    if -2.4000000000000001e-181 < b < 5.60000000000000046e-171

    1. Initial program 76.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. prod-diff76.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{0.3333333333333333 \cdot \frac{\sqrt{c \cdot \left(-3 \cdot a\right)}}{a}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt42.2%

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{c \cdot \left(a \cdot -3\right)}{\color{blue}{{a}^{2}}} \cdot \left(0.3333333333333333 \cdot 0.3333333333333333\right)} \]
      10. metadata-eval25.8%

        \[\leadsto \sqrt{\frac{c \cdot \left(a \cdot -3\right)}{{a}^{2}} \cdot \color{blue}{0.1111111111111111}} \]
    10. Applied egg-rr25.8%

      \[\leadsto \color{blue}{\sqrt{\frac{c \cdot \left(a \cdot -3\right)}{{a}^{2}} \cdot 0.1111111111111111}} \]
    11. Step-by-step derivation
      1. *-commutative25.8%

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

        \[\leadsto \sqrt{0.1111111111111111 \cdot \color{blue}{\frac{c}{\frac{{a}^{2}}{a \cdot -3}}}} \]
      3. unpow228.4%

        \[\leadsto \sqrt{0.1111111111111111 \cdot \frac{c}{\frac{\color{blue}{a \cdot a}}{a \cdot -3}}} \]
      4. times-frac36.8%

        \[\leadsto \sqrt{0.1111111111111111 \cdot \frac{c}{\color{blue}{\frac{a}{a} \cdot \frac{a}{-3}}}} \]
      5. *-rgt-identity36.8%

        \[\leadsto \sqrt{0.1111111111111111 \cdot \frac{c}{\frac{\color{blue}{a \cdot 1}}{a} \cdot \frac{a}{-3}}} \]
      6. associate-*r/36.8%

        \[\leadsto \sqrt{0.1111111111111111 \cdot \frac{c}{\color{blue}{\left(a \cdot \frac{1}{a}\right)} \cdot \frac{a}{-3}}} \]
      7. rgt-mult-inverse36.8%

        \[\leadsto \sqrt{0.1111111111111111 \cdot \frac{c}{\color{blue}{1} \cdot \frac{a}{-3}}} \]
    12. Simplified36.8%

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

    if 5.60000000000000046e-171 < b

    1. Initial program 18.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.4 \cdot 10^{-181}:\\ \;\;\;\;\frac{c}{b} \cdot 0.5 + \frac{b}{a} \cdot -0.6666666666666666\\ \mathbf{elif}\;b \leq 5.6 \cdot 10^{-171}:\\ \;\;\;\;\sqrt{0.1111111111111111 \cdot \frac{c}{\frac{a}{-3}}}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]

Alternative 8: 68.2% accurate, 8.9× speedup?

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

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

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


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

    1. Initial program 69.5%

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

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

    if -3.999999999999988e-310 < b

    1. Initial program 27.4%

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

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

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

Alternative 9: 68.1% accurate, 16.4× speedup?

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

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

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


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

    1. Initial program 69.5%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Applied egg-rr56.0%

      \[\leadsto \color{blue}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right) \cdot \frac{0.3333333333333333}{a} + \left(-b \cdot \frac{0.3333333333333333}{a}\right)} \]
    3. Step-by-step derivation
      1. sub-neg56.0%

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < b

    1. Initial program 27.4%

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

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

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

Alternative 10: 68.1% accurate, 16.4× speedup?

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

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

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


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

    1. Initial program 69.5%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Applied egg-rr56.0%

      \[\leadsto \color{blue}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right) \cdot \frac{0.3333333333333333}{a} + \left(-b \cdot \frac{0.3333333333333333}{a}\right)} \]
    3. Step-by-step derivation
      1. sub-neg56.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{b}{a \cdot \color{blue}{-1.5}} \]
      5. *-commutative67.4%

        \[\leadsto \frac{b}{\color{blue}{-1.5 \cdot a}} \]
    9. Applied egg-rr67.4%

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

    if -3.999999999999988e-310 < b

    1. Initial program 27.4%

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

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

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

Alternative 11: 68.1% accurate, 16.4× speedup?

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

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

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


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

    1. Initial program 69.5%

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

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

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

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    5. Step-by-step derivation
      1. metadata-eval67.3%

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

        \[\leadsto \color{blue}{\frac{b \cdot -2}{a \cdot 3}} \]
      3. associate-/l/67.4%

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

        \[\leadsto \frac{\color{blue}{\frac{b}{\frac{3}{-2}}}}{a} \]
      5. metadata-eval67.4%

        \[\leadsto \frac{\frac{b}{\color{blue}{-1.5}}}{a} \]
    6. Applied egg-rr67.4%

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

    if -3.999999999999988e-310 < b

    1. Initial program 27.4%

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

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

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

Alternative 12: 68.1% accurate, 16.4× speedup?

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

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

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


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

    1. Initial program 69.5%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Applied egg-rr56.0%

      \[\leadsto \color{blue}{\mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right) \cdot \frac{0.3333333333333333}{a} + \left(-b \cdot \frac{0.3333333333333333}{a}\right)} \]
    3. Step-by-step derivation
      1. sub-neg56.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{b \cdot \color{blue}{\frac{1}{-1.5}}}{a} \]
      3. div-inv67.4%

        \[\leadsto \frac{\color{blue}{\frac{b}{-1.5}}}{a} \]
      4. associate-/l/67.4%

        \[\leadsto \color{blue}{\frac{b}{a \cdot -1.5}} \]
      5. associate-/r*67.5%

        \[\leadsto \color{blue}{\frac{\frac{b}{a}}{-1.5}} \]
    9. Applied egg-rr67.5%

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

    if -3.999999999999988e-310 < b

    1. Initial program 27.4%

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

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

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

Alternative 13: 34.8% accurate, 23.2× speedup?

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

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

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

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

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

Reproduce

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