Cubic critical

Percentage Accurate: 52.1% → 85.3%
Time: 13.7s
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.1% accurate, 1.0× speedup?

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

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

Alternative 1: 85.3% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 54.2%

      \[\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 93.2%

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

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

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

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    6. Applied egg-rr93.5%

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

    if -5.5999999999999997e76 < b < 7.3000000000000002e-81

    1. Initial program 80.1%

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

    if 7.3000000000000002e-81 < b

    1. Initial program 19.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. associate-*r*19.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.6 \cdot 10^{+76}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 7.3 \cdot 10^{-81}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - \left(a \cdot 3\right) \cdot c} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 2: 85.3% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 50.0%

      \[\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 92.6%

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

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

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

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

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

    if -1.17999999999999998e95 < b < 6.70000000000000021e-81

    1. Initial program 81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.3333333333333333 \cdot \frac{b - \sqrt{b \cdot b + \color{blue}{\left(-3\right)} \cdot \left(a \cdot c\right)}}{a} \]
      5. cancel-sign-sub-inv80.9%

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

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

    if 6.70000000000000021e-81 < b

    1. Initial program 19.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. associate-*r*19.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 85.3% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 54.2%

      \[\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 93.2%

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

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

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

        \[\leadsto \color{blue}{\frac{b \cdot -0.6666666666666666}{a}} \]
    6. Applied egg-rr93.5%

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

    if -1.06000000000000003e77 < b < 2.1999999999999999e-81

    1. Initial program 80.1%

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

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

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

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

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

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

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

    if 2.1999999999999999e-81 < b

    1. Initial program 19.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. associate-*r*19.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 80.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 63.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.60000000000000034e-33 < b < 3.49999999999999986e-81

    1. Initial program 77.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. /-rgt-identity77.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.3333333333333333 \cdot \frac{b - \sqrt{b \cdot b + \color{blue}{\left(-3\right)} \cdot \left(a \cdot c\right)}}{a} \]
      5. cancel-sign-sub-inv77.2%

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-0.3333333333333333 \cdot \frac{b - \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{a}\right)} - 1} \]
      3. *-commutative21.9%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{b - \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{a} \cdot -0.3333333333333333}\right)} - 1 \]
      4. cancel-sign-sub-inv21.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{b - \sqrt{\color{blue}{b \cdot b + \left(-3\right) \cdot \left(a \cdot c\right)}}}{a} \cdot -0.3333333333333333\right)} - 1 \]
      5. fma-def21.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{b - \sqrt{\color{blue}{\mathsf{fma}\left(b, b, \left(-3\right) \cdot \left(a \cdot c\right)\right)}}}{a} \cdot -0.3333333333333333\right)} - 1 \]
      6. metadata-eval21.9%

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{b - \sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}{a} \cdot -0.3333333333333333\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def57.8%

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

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

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

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

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

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

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

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

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

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

    if 3.49999999999999986e-81 < b

    1. Initial program 19.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. associate-*r*19.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 80.7% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 63.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.4999999999999999e-33 < b < 2.3999999999999999e-81

    1. Initial program 77.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. /-rgt-identity77.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.3333333333333333 \cdot \frac{b - \sqrt{b \cdot b + \color{blue}{\left(-3\right)} \cdot \left(a \cdot c\right)}}{a} \]
      5. cancel-sign-sub-inv77.2%

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-0.3333333333333333 \cdot \frac{b - \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{a}\right)} - 1} \]
      3. *-commutative21.9%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{b - \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{a} \cdot -0.3333333333333333}\right)} - 1 \]
      4. cancel-sign-sub-inv21.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{b - \sqrt{\color{blue}{b \cdot b + \left(-3\right) \cdot \left(a \cdot c\right)}}}{a} \cdot -0.3333333333333333\right)} - 1 \]
      5. fma-def21.9%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{b - \sqrt{\color{blue}{\mathsf{fma}\left(b, b, \left(-3\right) \cdot \left(a \cdot c\right)\right)}}}{a} \cdot -0.3333333333333333\right)} - 1 \]
      6. metadata-eval21.9%

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{b - \sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}{a} \cdot -0.3333333333333333\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def57.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.3999999999999999e-81 < b

    1. Initial program 19.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. associate-*r*19.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 80.7% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 63.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.19999999999999988e-33 < b < 7.90000000000000016e-81

    1. Initial program 77.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 0 70.4%

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

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

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

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

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

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

    if 7.90000000000000016e-81 < b

    1. Initial program 19.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. associate-*r*19.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.2 \cdot 10^{-33}:\\ \;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 7.9 \cdot 10^{-81}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 7: 68.3% accurate, 7.7× speedup?

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

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

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


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

    1. Initial program 69.9%

      \[\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}} \]
    3. Step-by-step derivation
      1. metadata-eval67.6%

        \[\leadsto \color{blue}{\frac{-2}{3}} \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b} \]
      2. times-frac67.7%

        \[\leadsto \color{blue}{\frac{-2 \cdot b}{3 \cdot a}} + 0.5 \cdot \frac{c}{b} \]
      3. *-commutative67.7%

        \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} + 0.5 \cdot \frac{c}{b} \]
      4. frac-2neg67.7%

        \[\leadsto \color{blue}{\frac{-b \cdot -2}{-3 \cdot a}} + 0.5 \cdot \frac{c}{b} \]
      5. distribute-rgt-neg-in67.7%

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

        \[\leadsto \frac{b \cdot \color{blue}{2}}{-3 \cdot a} + 0.5 \cdot \frac{c}{b} \]
      7. distribute-lft-neg-in67.7%

        \[\leadsto \frac{b \cdot 2}{\color{blue}{\left(-3\right) \cdot a}} + 0.5 \cdot \frac{c}{b} \]
      8. metadata-eval67.7%

        \[\leadsto \frac{b \cdot 2}{\color{blue}{-3} \cdot a} + 0.5 \cdot \frac{c}{b} \]
      9. *-commutative67.7%

        \[\leadsto \frac{b \cdot 2}{\color{blue}{a \cdot -3}} + 0.5 \cdot \frac{c}{b} \]
    4. Applied egg-rr67.7%

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

    if -4.999999999999985e-310 < b

    1. Initial program 33.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 68.3% accurate, 8.9× speedup?

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

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

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


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

    1. Initial program 69.9%

      \[\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 -4.999999999999985e-310 < b

    1. Initial program 33.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 68.2% accurate, 12.8× speedup?

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

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

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


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

    1. Initial program 69.9%

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

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

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 33.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 68.1% accurate, 16.4× speedup?

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

    1. Initial program 69.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 33.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 65.0%

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

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

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

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


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

    1. Initial program 69.9%

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

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

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

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

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 33.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 65.0%

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

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

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

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


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

    1. Initial program 69.9%

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

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

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

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

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

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

    if 6.4999999999999999e-309 < b

    1. Initial program 33.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 35.0% accurate, 23.2× speedup?

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

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

    \[\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 36.8%

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

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

Reproduce

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