Cubic critical

Percentage Accurate: 52.6% → 86.1%
Time: 18.1s
Alternatives: 11
Speedup: 11.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 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.6% accurate, 1.0× speedup?

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

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

Alternative 1: 86.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.02 \cdot 10^{+134}:\\ \;\;\;\;\frac{-1}{\left(-\frac{a}{b}\right) \cdot -1.5}\\ \mathbf{elif}\;b \leq 8 \cdot 10^{-70}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\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.02e+134)
   (/ -1.0 (* (- (/ a b)) -1.5))
   (if (<= b 8e-70)
     (/ (- (sqrt (fma b b (* c (* a -3.0)))) b) (* a 3.0))
     (/ (* c -0.5) b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -1.02e+134) {
		tmp = -1.0 / (-(a / b) * -1.5);
	} else if (b <= 8e-70) {
		tmp = (sqrt(fma(b, b, (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 <= -1.02e+134)
		tmp = Float64(-1.0 / Float64(Float64(-Float64(a / b)) * -1.5));
	elseif (b <= 8e-70)
		tmp = Float64(Float64(sqrt(fma(b, b, Float64(c * Float64(a * -3.0)))) - b) / Float64(a * 3.0));
	else
		tmp = Float64(Float64(c * -0.5) / b);
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -1.02e+134], N[(-1.0 / N[((-N[(a / b), $MachinePrecision]) * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8e-70], N[(N[(N[Sqrt[N[(b * b + N[(c * N[(a * -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.02 \cdot 10^{+134}:\\
\;\;\;\;\frac{-1}{\left(-\frac{a}{b}\right) \cdot -1.5}\\

\mathbf{elif}\;b \leq 8 \cdot 10^{-70}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\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.02e134

    1. Initial program 43.8%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt48.3%

        \[\leadsto \color{blue}{\sqrt{\frac{b}{a} \cdot -0.6666666666666666} \cdot \sqrt{\frac{b}{a} \cdot -0.6666666666666666}} \]
      2. sqrt-unprod36.9%

        \[\leadsto \color{blue}{\sqrt{\left(\frac{b}{a} \cdot -0.6666666666666666\right) \cdot \left(\frac{b}{a} \cdot -0.6666666666666666\right)}} \]
      3. swap-sqr36.9%

        \[\leadsto \sqrt{\color{blue}{\left(\frac{b}{a} \cdot \frac{b}{a}\right) \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)}} \]
      4. pow136.9%

        \[\leadsto \sqrt{\left(\color{blue}{{\left(\frac{b}{a}\right)}^{1}} \cdot \frac{b}{a}\right) \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
      5. metadata-eval36.9%

        \[\leadsto \sqrt{\left({\left(\frac{b}{a}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot \frac{b}{a}\right) \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
      6. pow136.9%

        \[\leadsto \sqrt{\left({\left(\frac{b}{a}\right)}^{\left(\frac{2}{2}\right)} \cdot \color{blue}{{\left(\frac{b}{a}\right)}^{1}}\right) \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
      7. metadata-eval36.9%

        \[\leadsto \sqrt{\left({\left(\frac{b}{a}\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(\frac{b}{a}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}}\right) \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
      8. pow-sqr36.9%

        \[\leadsto \sqrt{\color{blue}{{\left(\frac{b}{a}\right)}^{\left(2 \cdot \frac{2}{2}\right)}} \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
      9. metadata-eval36.9%

        \[\leadsto \sqrt{{\left(\frac{b}{a}\right)}^{\left(2 \cdot \color{blue}{1}\right)} \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
      10. metadata-eval36.9%

        \[\leadsto \sqrt{{\left(\frac{b}{a}\right)}^{\color{blue}{2}} \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
      11. metadata-eval36.9%

        \[\leadsto \sqrt{{\left(\frac{b}{a}\right)}^{2} \cdot \color{blue}{0.4444444444444444}} \]
    8. Applied egg-rr36.9%

      \[\leadsto \color{blue}{\sqrt{{\left(\frac{b}{a}\right)}^{2} \cdot 0.4444444444444444}} \]
    9. Step-by-step derivation
      1. *-commutative36.9%

        \[\leadsto \sqrt{\color{blue}{0.4444444444444444 \cdot {\left(\frac{b}{a}\right)}^{2}}} \]
      2. metadata-eval36.9%

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

        \[\leadsto \sqrt{\left(-0.6666666666666666 \cdot -0.6666666666666666\right) \cdot \color{blue}{\left(\frac{b}{a} \cdot \frac{b}{a}\right)}} \]
      4. swap-sqr36.9%

        \[\leadsto \sqrt{\color{blue}{\left(-0.6666666666666666 \cdot \frac{b}{a}\right) \cdot \left(-0.6666666666666666 \cdot \frac{b}{a}\right)}} \]
      5. clear-num36.9%

        \[\leadsto \sqrt{\left(-0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}}\right) \cdot \left(-0.6666666666666666 \cdot \frac{b}{a}\right)} \]
      6. div-inv36.9%

        \[\leadsto \sqrt{\color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \cdot \left(-0.6666666666666666 \cdot \frac{b}{a}\right)} \]
      7. clear-num36.9%

        \[\leadsto \sqrt{\frac{-0.6666666666666666}{\frac{a}{b}} \cdot \left(-0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}}\right)} \]
      8. div-inv36.9%

        \[\leadsto \sqrt{\frac{-0.6666666666666666}{\frac{a}{b}} \cdot \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}}} \]
      9. sqrt-unprod48.3%

        \[\leadsto \color{blue}{\sqrt{\frac{-0.6666666666666666}{\frac{a}{b}}} \cdot \sqrt{\frac{-0.6666666666666666}{\frac{a}{b}}}} \]
      10. add-sqr-sqrt99.5%

        \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]
      11. clear-num99.4%

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

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

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

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

        \[\leadsto \frac{\color{blue}{-1}}{-\frac{\frac{a}{b}}{-0.6666666666666666}} \]
      16. div-inv99.7%

        \[\leadsto \frac{-1}{-\color{blue}{\frac{a}{b} \cdot \frac{1}{-0.6666666666666666}}} \]
      17. metadata-eval99.7%

        \[\leadsto \frac{-1}{-\frac{a}{b} \cdot \color{blue}{-1.5}} \]
      18. distribute-lft-neg-in99.7%

        \[\leadsto \frac{-1}{\color{blue}{\left(-\frac{a}{b}\right) \cdot -1.5}} \]
      19. distribute-neg-frac99.7%

        \[\leadsto \frac{-1}{\color{blue}{\frac{-a}{b}} \cdot -1.5} \]
    10. Applied egg-rr99.7%

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

    if -1.02e134 < b < 7.99999999999999997e-70

    1. Initial program 86.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. Simplified86.1%

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

      if 7.99999999999999997e-70 < b

      1. Initial program 16.3%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.02 \cdot 10^{+134}:\\ \;\;\;\;\frac{-1}{\left(-\frac{a}{b}\right) \cdot -1.5}\\ \mathbf{elif}\;b \leq 8 \cdot 10^{-70}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

    Alternative 2: 86.1% accurate, 0.9× speedup?

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

      1. Initial program 43.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
      7. Step-by-step derivation
        1. add-sqr-sqrt48.3%

          \[\leadsto \color{blue}{\sqrt{\frac{b}{a} \cdot -0.6666666666666666} \cdot \sqrt{\frac{b}{a} \cdot -0.6666666666666666}} \]
        2. sqrt-unprod36.9%

          \[\leadsto \color{blue}{\sqrt{\left(\frac{b}{a} \cdot -0.6666666666666666\right) \cdot \left(\frac{b}{a} \cdot -0.6666666666666666\right)}} \]
        3. swap-sqr36.9%

          \[\leadsto \sqrt{\color{blue}{\left(\frac{b}{a} \cdot \frac{b}{a}\right) \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)}} \]
        4. pow136.9%

          \[\leadsto \sqrt{\left(\color{blue}{{\left(\frac{b}{a}\right)}^{1}} \cdot \frac{b}{a}\right) \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
        5. metadata-eval36.9%

          \[\leadsto \sqrt{\left({\left(\frac{b}{a}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot \frac{b}{a}\right) \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
        6. pow136.9%

          \[\leadsto \sqrt{\left({\left(\frac{b}{a}\right)}^{\left(\frac{2}{2}\right)} \cdot \color{blue}{{\left(\frac{b}{a}\right)}^{1}}\right) \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
        7. metadata-eval36.9%

          \[\leadsto \sqrt{\left({\left(\frac{b}{a}\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(\frac{b}{a}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}}\right) \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
        8. pow-sqr36.9%

          \[\leadsto \sqrt{\color{blue}{{\left(\frac{b}{a}\right)}^{\left(2 \cdot \frac{2}{2}\right)}} \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
        9. metadata-eval36.9%

          \[\leadsto \sqrt{{\left(\frac{b}{a}\right)}^{\left(2 \cdot \color{blue}{1}\right)} \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
        10. metadata-eval36.9%

          \[\leadsto \sqrt{{\left(\frac{b}{a}\right)}^{\color{blue}{2}} \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
        11. metadata-eval36.9%

          \[\leadsto \sqrt{{\left(\frac{b}{a}\right)}^{2} \cdot \color{blue}{0.4444444444444444}} \]
      8. Applied egg-rr36.9%

        \[\leadsto \color{blue}{\sqrt{{\left(\frac{b}{a}\right)}^{2} \cdot 0.4444444444444444}} \]
      9. Step-by-step derivation
        1. *-commutative36.9%

          \[\leadsto \sqrt{\color{blue}{0.4444444444444444 \cdot {\left(\frac{b}{a}\right)}^{2}}} \]
        2. metadata-eval36.9%

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

          \[\leadsto \sqrt{\left(-0.6666666666666666 \cdot -0.6666666666666666\right) \cdot \color{blue}{\left(\frac{b}{a} \cdot \frac{b}{a}\right)}} \]
        4. swap-sqr36.9%

          \[\leadsto \sqrt{\color{blue}{\left(-0.6666666666666666 \cdot \frac{b}{a}\right) \cdot \left(-0.6666666666666666 \cdot \frac{b}{a}\right)}} \]
        5. clear-num36.9%

          \[\leadsto \sqrt{\left(-0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}}\right) \cdot \left(-0.6666666666666666 \cdot \frac{b}{a}\right)} \]
        6. div-inv36.9%

          \[\leadsto \sqrt{\color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \cdot \left(-0.6666666666666666 \cdot \frac{b}{a}\right)} \]
        7. clear-num36.9%

          \[\leadsto \sqrt{\frac{-0.6666666666666666}{\frac{a}{b}} \cdot \left(-0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}}\right)} \]
        8. div-inv36.9%

          \[\leadsto \sqrt{\frac{-0.6666666666666666}{\frac{a}{b}} \cdot \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}}} \]
        9. sqrt-unprod48.3%

          \[\leadsto \color{blue}{\sqrt{\frac{-0.6666666666666666}{\frac{a}{b}}} \cdot \sqrt{\frac{-0.6666666666666666}{\frac{a}{b}}}} \]
        10. add-sqr-sqrt99.5%

          \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]
        11. clear-num99.4%

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

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

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

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

          \[\leadsto \frac{\color{blue}{-1}}{-\frac{\frac{a}{b}}{-0.6666666666666666}} \]
        16. div-inv99.7%

          \[\leadsto \frac{-1}{-\color{blue}{\frac{a}{b} \cdot \frac{1}{-0.6666666666666666}}} \]
        17. metadata-eval99.7%

          \[\leadsto \frac{-1}{-\frac{a}{b} \cdot \color{blue}{-1.5}} \]
        18. distribute-lft-neg-in99.7%

          \[\leadsto \frac{-1}{\color{blue}{\left(-\frac{a}{b}\right) \cdot -1.5}} \]
        19. distribute-neg-frac99.7%

          \[\leadsto \frac{-1}{\color{blue}{\frac{-a}{b}} \cdot -1.5} \]
      10. Applied egg-rr99.7%

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

      if -3.90000000000000014e133 < b < 4.49999999999999999e-68

      1. Initial program 86.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. neg-sub086.1%

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

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

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

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

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

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

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

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

      if 4.49999999999999999e-68 < b

      1. Initial program 16.3%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.9 \cdot 10^{+133}:\\ \;\;\;\;\frac{-1}{\left(-\frac{a}{b}\right) \cdot -1.5}\\ \mathbf{elif}\;b \leq 4.5 \cdot 10^{-68}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

    Alternative 3: 86.1% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.5 \cdot 10^{+134}:\\ \;\;\;\;\frac{-1}{\left(-\frac{a}{b}\right) \cdot -1.5}\\ \mathbf{elif}\;b \leq 4.6 \cdot 10^{-66}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 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 -1.5e+134)
       (/ -1.0 (* (- (/ a b)) -1.5))
       (if (<= b 4.6e-66)
         (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
         (/ (* c -0.5) b))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (b <= -1.5e+134) {
    		tmp = -1.0 / (-(a / b) * -1.5);
    	} else if (b <= 4.6e-66) {
    		tmp = (sqrt(((b * b) - (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 <= (-1.5d+134)) then
            tmp = (-1.0d0) / (-(a / b) * (-1.5d0))
        else if (b <= 4.6d-66) then
            tmp = (sqrt(((b * b) - (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 <= -1.5e+134) {
    		tmp = -1.0 / (-(a / b) * -1.5);
    	} else if (b <= 4.6e-66) {
    		tmp = (Math.sqrt(((b * b) - (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 <= -1.5e+134:
    		tmp = -1.0 / (-(a / b) * -1.5)
    	elif b <= 4.6e-66:
    		tmp = (math.sqrt(((b * b) - (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 <= -1.5e+134)
    		tmp = Float64(-1.0 / Float64(Float64(-Float64(a / b)) * -1.5));
    	elseif (b <= 4.6e-66)
    		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - 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 <= -1.5e+134)
    		tmp = -1.0 / (-(a / b) * -1.5);
    	elseif (b <= 4.6e-66)
    		tmp = (sqrt(((b * b) - (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, -1.5e+134], N[(-1.0 / N[((-N[(a / b), $MachinePrecision]) * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.6e-66], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 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.5 \cdot 10^{+134}:\\
    \;\;\;\;\frac{-1}{\left(-\frac{a}{b}\right) \cdot -1.5}\\
    
    \mathbf{elif}\;b \leq 4.6 \cdot 10^{-66}:\\
    \;\;\;\;\frac{\sqrt{b \cdot b - 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 < -1.49999999999999998e134

      1. Initial program 43.8%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
      7. Step-by-step derivation
        1. add-sqr-sqrt48.3%

          \[\leadsto \color{blue}{\sqrt{\frac{b}{a} \cdot -0.6666666666666666} \cdot \sqrt{\frac{b}{a} \cdot -0.6666666666666666}} \]
        2. sqrt-unprod36.9%

          \[\leadsto \color{blue}{\sqrt{\left(\frac{b}{a} \cdot -0.6666666666666666\right) \cdot \left(\frac{b}{a} \cdot -0.6666666666666666\right)}} \]
        3. swap-sqr36.9%

          \[\leadsto \sqrt{\color{blue}{\left(\frac{b}{a} \cdot \frac{b}{a}\right) \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)}} \]
        4. pow136.9%

          \[\leadsto \sqrt{\left(\color{blue}{{\left(\frac{b}{a}\right)}^{1}} \cdot \frac{b}{a}\right) \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
        5. metadata-eval36.9%

          \[\leadsto \sqrt{\left({\left(\frac{b}{a}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} \cdot \frac{b}{a}\right) \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
        6. pow136.9%

          \[\leadsto \sqrt{\left({\left(\frac{b}{a}\right)}^{\left(\frac{2}{2}\right)} \cdot \color{blue}{{\left(\frac{b}{a}\right)}^{1}}\right) \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
        7. metadata-eval36.9%

          \[\leadsto \sqrt{\left({\left(\frac{b}{a}\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(\frac{b}{a}\right)}^{\color{blue}{\left(\frac{2}{2}\right)}}\right) \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
        8. pow-sqr36.9%

          \[\leadsto \sqrt{\color{blue}{{\left(\frac{b}{a}\right)}^{\left(2 \cdot \frac{2}{2}\right)}} \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
        9. metadata-eval36.9%

          \[\leadsto \sqrt{{\left(\frac{b}{a}\right)}^{\left(2 \cdot \color{blue}{1}\right)} \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
        10. metadata-eval36.9%

          \[\leadsto \sqrt{{\left(\frac{b}{a}\right)}^{\color{blue}{2}} \cdot \left(-0.6666666666666666 \cdot -0.6666666666666666\right)} \]
        11. metadata-eval36.9%

          \[\leadsto \sqrt{{\left(\frac{b}{a}\right)}^{2} \cdot \color{blue}{0.4444444444444444}} \]
      8. Applied egg-rr36.9%

        \[\leadsto \color{blue}{\sqrt{{\left(\frac{b}{a}\right)}^{2} \cdot 0.4444444444444444}} \]
      9. Step-by-step derivation
        1. *-commutative36.9%

          \[\leadsto \sqrt{\color{blue}{0.4444444444444444 \cdot {\left(\frac{b}{a}\right)}^{2}}} \]
        2. metadata-eval36.9%

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

          \[\leadsto \sqrt{\left(-0.6666666666666666 \cdot -0.6666666666666666\right) \cdot \color{blue}{\left(\frac{b}{a} \cdot \frac{b}{a}\right)}} \]
        4. swap-sqr36.9%

          \[\leadsto \sqrt{\color{blue}{\left(-0.6666666666666666 \cdot \frac{b}{a}\right) \cdot \left(-0.6666666666666666 \cdot \frac{b}{a}\right)}} \]
        5. clear-num36.9%

          \[\leadsto \sqrt{\left(-0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}}\right) \cdot \left(-0.6666666666666666 \cdot \frac{b}{a}\right)} \]
        6. div-inv36.9%

          \[\leadsto \sqrt{\color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \cdot \left(-0.6666666666666666 \cdot \frac{b}{a}\right)} \]
        7. clear-num36.9%

          \[\leadsto \sqrt{\frac{-0.6666666666666666}{\frac{a}{b}} \cdot \left(-0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}}\right)} \]
        8. div-inv36.9%

          \[\leadsto \sqrt{\frac{-0.6666666666666666}{\frac{a}{b}} \cdot \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}}} \]
        9. sqrt-unprod48.3%

          \[\leadsto \color{blue}{\sqrt{\frac{-0.6666666666666666}{\frac{a}{b}}} \cdot \sqrt{\frac{-0.6666666666666666}{\frac{a}{b}}}} \]
        10. add-sqr-sqrt99.5%

          \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]
        11. clear-num99.4%

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

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

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

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

          \[\leadsto \frac{\color{blue}{-1}}{-\frac{\frac{a}{b}}{-0.6666666666666666}} \]
        16. div-inv99.7%

          \[\leadsto \frac{-1}{-\color{blue}{\frac{a}{b} \cdot \frac{1}{-0.6666666666666666}}} \]
        17. metadata-eval99.7%

          \[\leadsto \frac{-1}{-\frac{a}{b} \cdot \color{blue}{-1.5}} \]
        18. distribute-lft-neg-in99.7%

          \[\leadsto \frac{-1}{\color{blue}{\left(-\frac{a}{b}\right) \cdot -1.5}} \]
        19. distribute-neg-frac99.7%

          \[\leadsto \frac{-1}{\color{blue}{\frac{-a}{b}} \cdot -1.5} \]
      10. Applied egg-rr99.7%

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

      if -1.49999999999999998e134 < b < 4.59999999999999984e-66

      1. Initial program 86.1%

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

      if 4.59999999999999984e-66 < b

      1. Initial program 16.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 4: 80.3% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.05 \cdot 10^{-66}:\\ \;\;\;\;\frac{\left(\frac{a \cdot 1.5}{\frac{b}{c}} - b\right) - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 1.35 \cdot 10^{-69}:\\ \;\;\;\;\frac{0.3333333333333333}{a} \cdot \left(b + \sqrt{c \cdot \left(a \cdot -3\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= b -1.05e-66)
       (/ (- (- (/ (* a 1.5) (/ b c)) b) b) (* a 3.0))
       (if (<= b 1.35e-69)
         (* (/ 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 <= -1.05e-66) {
    		tmp = ((((a * 1.5) / (b / c)) - b) - b) / (a * 3.0);
    	} else if (b <= 1.35e-69) {
    		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 <= (-1.05d-66)) then
            tmp = ((((a * 1.5d0) / (b / c)) - b) - b) / (a * 3.0d0)
        else if (b <= 1.35d-69) 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 <= -1.05e-66) {
    		tmp = ((((a * 1.5) / (b / c)) - b) - b) / (a * 3.0);
    	} else if (b <= 1.35e-69) {
    		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 <= -1.05e-66:
    		tmp = ((((a * 1.5) / (b / c)) - b) - b) / (a * 3.0)
    	elif b <= 1.35e-69:
    		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 <= -1.05e-66)
    		tmp = Float64(Float64(Float64(Float64(Float64(a * 1.5) / Float64(b / c)) - b) - b) / Float64(a * 3.0));
    	elseif (b <= 1.35e-69)
    		tmp = Float64(Float64(0.3333333333333333 / 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 <= -1.05e-66)
    		tmp = ((((a * 1.5) / (b / c)) - b) - b) / (a * 3.0);
    	elseif (b <= 1.35e-69)
    		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, -1.05e-66], N[(N[(N[(N[(N[(a * 1.5), $MachinePrecision] / N[(b / c), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.35e-69], N[(N[(0.3333333333333333 / a), $MachinePrecision] * N[(b + N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq -1.05 \cdot 10^{-66}:\\
    \;\;\;\;\frac{\left(\frac{a \cdot 1.5}{\frac{b}{c}} - b\right) - b}{a \cdot 3}\\
    
    \mathbf{elif}\;b \leq 1.35 \cdot 10^{-69}:\\
    \;\;\;\;\frac{0.3333333333333333}{a} \cdot \left(b + \sqrt{c \cdot \left(a \cdot -3\right)}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{c \cdot -0.5}{b}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if b < -1.05e-66

      1. Initial program 67.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.05e-66 < b < 1.3499999999999999e-69

      1. Initial program 83.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 1.3499999999999999e-69 < b

      1. Initial program 16.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 80.5% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.05 \cdot 10^{-23}:\\ \;\;\;\;\frac{\left(\frac{a \cdot 1.5}{\frac{b}{c}} - b\right) - b}{a \cdot 3}\\ \mathbf{elif}\;b \leq 10^{-67}:\\ \;\;\;\;\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 -1.05e-23)
       (/ (- (- (/ (* a 1.5) (/ b c)) b) b) (* a 3.0))
       (if (<= b 1e-67)
         (/ (- (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 <= -1.05e-23) {
    		tmp = ((((a * 1.5) / (b / c)) - b) - b) / (a * 3.0);
    	} else if (b <= 1e-67) {
    		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 <= (-1.05d-23)) then
            tmp = ((((a * 1.5d0) / (b / c)) - b) - b) / (a * 3.0d0)
        else if (b <= 1d-67) 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 <= -1.05e-23) {
    		tmp = ((((a * 1.5) / (b / c)) - b) - b) / (a * 3.0);
    	} else if (b <= 1e-67) {
    		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 <= -1.05e-23:
    		tmp = ((((a * 1.5) / (b / c)) - b) - b) / (a * 3.0)
    	elif b <= 1e-67:
    		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 <= -1.05e-23)
    		tmp = Float64(Float64(Float64(Float64(Float64(a * 1.5) / Float64(b / c)) - b) - b) / Float64(a * 3.0));
    	elseif (b <= 1e-67)
    		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 <= -1.05e-23)
    		tmp = ((((a * 1.5) / (b / c)) - b) - b) / (a * 3.0);
    	elseif (b <= 1e-67)
    		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, -1.05e-23], N[(N[(N[(N[(N[(a * 1.5), $MachinePrecision] / N[(b / c), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1e-67], 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 -1.05 \cdot 10^{-23}:\\
    \;\;\;\;\frac{\left(\frac{a \cdot 1.5}{\frac{b}{c}} - b\right) - b}{a \cdot 3}\\
    
    \mathbf{elif}\;b \leq 10^{-67}:\\
    \;\;\;\;\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 < -1.05e-23

      1. Initial program 66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.05e-23 < b < 9.99999999999999943e-68

      1. Initial program 83.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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} \]
      8. Step-by-step derivation
        1. distribute-rgt-out78.8%

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

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

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

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

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

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

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

      if 9.99999999999999943e-68 < b

      1. Initial program 16.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 6: 67.1% accurate, 7.2× speedup?

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

      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. neg-sub072.0%

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

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

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

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

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

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

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

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

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

      if -3.999999999999988e-310 < b

      1. Initial program 33.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. neg-sub033.4%

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 7: 66.6% accurate, 11.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\ \;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5}{\frac{b}{c}}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= b -4e-310) (* b (/ -0.6666666666666666 a)) (/ -0.5 (/ b c))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (b <= -4e-310) {
    		tmp = b * (-0.6666666666666666 / a);
    	} else {
    		tmp = -0.5 / (b / c);
    	}
    	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) / (b / c)
        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 / (b / c);
    	}
    	return tmp;
    }
    
    def code(a, b, c):
    	tmp = 0
    	if b <= -4e-310:
    		tmp = b * (-0.6666666666666666 / a)
    	else:
    		tmp = -0.5 / (b / c)
    	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(b / c));
    	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 / (b / c);
    	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[(b / c), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
    \;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{-0.5}{\frac{b}{c}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b < -3.999999999999988e-310

      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. neg-sub072.0%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto -0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}} \]
        3. un-div-inv63.2%

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

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

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

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

      if -3.999999999999988e-310 < b

      1. Initial program 33.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. neg-sub033.4%

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
        2. associate-/l*68.8%

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

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

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

    Alternative 8: 66.6% accurate, 11.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\ \;\;\;\;\frac{b}{a \cdot -1.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{-0.5}{\frac{b}{c}}\\ \end{array} \end{array} \]
    (FPCore (a b c)
     :precision binary64
     (if (<= b -4e-310) (/ b (* a -1.5)) (/ -0.5 (/ b c))))
    double code(double a, double b, double c) {
    	double tmp;
    	if (b <= -4e-310) {
    		tmp = b / (a * -1.5);
    	} else {
    		tmp = -0.5 / (b / c);
    	}
    	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) / (b / c)
        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 / (b / c);
    	}
    	return tmp;
    }
    
    def code(a, b, c):
    	tmp = 0
    	if b <= -4e-310:
    		tmp = b / (a * -1.5)
    	else:
    		tmp = -0.5 / (b / c)
    	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(b / c));
    	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 / (b / c);
    	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[(b / c), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq -4 \cdot 10^{-310}:\\
    \;\;\;\;\frac{b}{a \cdot -1.5}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{-0.5}{\frac{b}{c}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b < -3.999999999999988e-310

      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. neg-sub072.0%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto -0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}} \]
        3. un-div-inv63.2%

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

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

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

        \[\leadsto \color{blue}{\frac{-0.6666666666666666}{a} \cdot b} \]
      11. Step-by-step derivation
        1. clear-num63.1%

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

          \[\leadsto \color{blue}{\frac{1 \cdot b}{\frac{a}{-0.6666666666666666}}} \]
        3. *-un-lft-identity63.2%

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

          \[\leadsto \frac{b}{\color{blue}{a \cdot \frac{1}{-0.6666666666666666}}} \]
        5. metadata-eval63.2%

          \[\leadsto \frac{b}{a \cdot \color{blue}{-1.5}} \]
      12. Applied egg-rr63.2%

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

      if -3.999999999999988e-310 < b

      1. Initial program 33.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. neg-sub033.4%

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
        2. associate-/l*68.8%

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

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

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

    Alternative 9: 67.0% accurate, 11.6× speedup?

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

      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. neg-sub072.0%

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto -0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}} \]
        3. un-div-inv63.2%

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

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

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

        \[\leadsto \color{blue}{\frac{-0.6666666666666666}{a} \cdot b} \]
      11. Step-by-step derivation
        1. clear-num63.1%

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

          \[\leadsto \color{blue}{\frac{1 \cdot b}{\frac{a}{-0.6666666666666666}}} \]
        3. *-un-lft-identity63.2%

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

          \[\leadsto \frac{b}{\color{blue}{a \cdot \frac{1}{-0.6666666666666666}}} \]
        5. metadata-eval63.2%

          \[\leadsto \frac{b}{a \cdot \color{blue}{-1.5}} \]
      12. Applied egg-rr63.2%

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

      if -3.999999999999988e-310 < b

      1. Initial program 33.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. neg-sub033.4%

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 10: 67.0% accurate, 11.6× speedup?

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

      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. neg-sub072.0%

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

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

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

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

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

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

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

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

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

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

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

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

      if -3.999999999999988e-310 < b

      1. Initial program 33.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. neg-sub033.4%

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 11: 34.6% accurate, 23.2× speedup?

    \[\begin{array}{l} \\ b \cdot \frac{-0.6666666666666666}{a} \end{array} \]
    (FPCore (a b c) :precision binary64 (* b (/ -0.6666666666666666 a)))
    double code(double a, double b, double c) {
    	return b * (-0.6666666666666666 / 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 * ((-0.6666666666666666d0) / a)
    end function
    
    public static double code(double a, double b, double c) {
    	return b * (-0.6666666666666666 / a);
    }
    
    def code(a, b, c):
    	return b * (-0.6666666666666666 / a)
    
    function code(a, b, c)
    	return Float64(b * Float64(-0.6666666666666666 / a))
    end
    
    function tmp = code(a, b, c)
    	tmp = b * (-0.6666666666666666 / a);
    end
    
    code[a_, b_, c_] := N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    b \cdot \frac{-0.6666666666666666}{a}
    \end{array}
    
    Derivation
    1. Initial program 51.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. neg-sub051.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -0.6666666666666666 \cdot \color{blue}{\frac{1}{\frac{a}{b}}} \]
      3. un-div-inv30.4%

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

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

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

      \[\leadsto \color{blue}{\frac{-0.6666666666666666}{a} \cdot b} \]
    11. Final simplification30.4%

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

    Reproduce

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