Cubic critical

Percentage Accurate: 52.8% → 85.7%
Time: 12.0s
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.8% accurate, 1.0× speedup?

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

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

Alternative 1: 85.7% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 44.9%

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

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

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

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

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

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

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

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

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

      if -2.49999999999999992e117 < b < 2.6999999999999999e-44

      1. Initial program 80.3%

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

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

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

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

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

      if 2.6999999999999999e-44 < b

      1. Initial program 19.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. Simplified19.1%

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

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

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

      Alternative 2: 80.9% accurate, 1.0× speedup?

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

        1. Initial program 64.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. Simplified64.8%

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

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

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

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

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

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

          if -1.2599999999999999e-61 < b < 6.5000000000000004e-47

          1. Initial program 73.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. Simplified73.8%

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

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

            if 6.5000000000000004e-47 < b

            1. Initial program 19.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. Simplified19.1%

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.26 \cdot 10^{-61}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 6.5 \cdot 10^{-47}:\\ \;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -3} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
            5. Add Preprocessing

            Alternative 3: 80.5% accurate, 1.0× speedup?

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

              1. Initial program 64.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. Simplified64.8%

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

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

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

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

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

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

                if -5.1999999999999999e-62 < b < 4.2000000000000001e-43

                1. Initial program 73.8%

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

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

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

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

                  \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
                4. Add Preprocessing
                5. Step-by-step derivation
                  1. add-cube-cbrt73.3%

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

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

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

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

                    \[\leadsto \frac{\color{blue}{-\sqrt{a \cdot \left(c \cdot {\left(\sqrt[3]{-3}\right)}^{3}\right)} \cdot {\left(\sqrt{-1}\right)}^{2}}}{3 \cdot a} \]
                  2. rem-cube-cbrt0.0%

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

                    \[\leadsto \frac{-\sqrt{a \cdot \left(c \cdot -3\right)} \cdot \color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)}}{3 \cdot a} \]
                  4. rem-square-sqrt69.7%

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

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

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

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

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

                    \[\leadsto \frac{\color{blue}{\sqrt{a} \cdot \sqrt{c \cdot -3}}}{3 \cdot a} \]
                  5. *-commutative43.3%

                    \[\leadsto \frac{\color{blue}{\sqrt{c \cdot -3} \cdot \sqrt{a}}}{3 \cdot a} \]
                11. Applied egg-rr43.3%

                  \[\leadsto \frac{\color{blue}{\sqrt{c \cdot -3} \cdot \sqrt{a}}}{3 \cdot a} \]
                12. Step-by-step derivation
                  1. add-sqr-sqrt43.2%

                    \[\leadsto \frac{\color{blue}{\sqrt{\sqrt{c \cdot -3} \cdot \sqrt{a}} \cdot \sqrt{\sqrt{c \cdot -3} \cdot \sqrt{a}}}}{3 \cdot a} \]
                  2. *-commutative43.2%

                    \[\leadsto \frac{\sqrt{\sqrt{c \cdot -3} \cdot \sqrt{a}} \cdot \sqrt{\sqrt{c \cdot -3} \cdot \sqrt{a}}}{\color{blue}{a \cdot 3}} \]
                  3. times-frac43.2%

                    \[\leadsto \color{blue}{\frac{\sqrt{\sqrt{c \cdot -3} \cdot \sqrt{a}}}{a} \cdot \frac{\sqrt{\sqrt{c \cdot -3} \cdot \sqrt{a}}}{3}} \]
                  4. *-commutative43.2%

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

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

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

                    \[\leadsto \frac{\sqrt{\sqrt{\color{blue}{\left(a \cdot -3\right) \cdot c}}}}{a} \cdot \frac{\sqrt{\sqrt{c \cdot -3} \cdot \sqrt{a}}}{3} \]
                  8. pow1/234.6%

                    \[\leadsto \frac{\sqrt{\color{blue}{{\left(\left(a \cdot -3\right) \cdot c\right)}^{0.5}}}}{a} \cdot \frac{\sqrt{\sqrt{c \cdot -3} \cdot \sqrt{a}}}{3} \]
                  9. sqrt-pow134.6%

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

                    \[\leadsto \frac{{\color{blue}{\left(a \cdot \left(-3 \cdot c\right)\right)}}^{\left(\frac{0.5}{2}\right)}}{a} \cdot \frac{\sqrt{\sqrt{c \cdot -3} \cdot \sqrt{a}}}{3} \]
                  11. *-commutative34.6%

                    \[\leadsto \frac{{\left(a \cdot \color{blue}{\left(c \cdot -3\right)}\right)}^{\left(\frac{0.5}{2}\right)}}{a} \cdot \frac{\sqrt{\sqrt{c \cdot -3} \cdot \sqrt{a}}}{3} \]
                  12. metadata-eval34.6%

                    \[\leadsto \frac{{\left(a \cdot \left(c \cdot -3\right)\right)}^{\color{blue}{0.25}}}{a} \cdot \frac{\sqrt{\sqrt{c \cdot -3} \cdot \sqrt{a}}}{3} \]
                13. Applied egg-rr69.5%

                  \[\leadsto \color{blue}{\frac{{\left(a \cdot \left(c \cdot -3\right)\right)}^{0.25}}{a} \cdot \frac{{\left(a \cdot \left(c \cdot -3\right)\right)}^{0.25}}{3}} \]
                14. Step-by-step derivation
                  1. associate-*r/69.6%

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

                    \[\leadsto \frac{\color{blue}{\frac{{\left(a \cdot \left(c \cdot -3\right)\right)}^{0.25} \cdot {\left(a \cdot \left(c \cdot -3\right)\right)}^{0.25}}{a}}}{3} \]
                  3. pow-sqr69.7%

                    \[\leadsto \frac{\frac{\color{blue}{{\left(a \cdot \left(c \cdot -3\right)\right)}^{\left(2 \cdot 0.25\right)}}}{a}}{3} \]
                  4. metadata-eval69.7%

                    \[\leadsto \frac{\frac{{\left(a \cdot \left(c \cdot -3\right)\right)}^{\color{blue}{0.5}}}{a}}{3} \]
                  5. unpow1/269.7%

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

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

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

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

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

                if 4.2000000000000001e-43 < b

                1. Initial program 19.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. Simplified19.1%

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

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

                Alternative 4: 80.5% accurate, 1.0× speedup?

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

                  1. Initial program 64.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. Simplified64.8%

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

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

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

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

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

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

                    if -2.25e-61 < b < 2.7e-46

                    1. Initial program 73.8%

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

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

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

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

                      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
                    4. Add Preprocessing
                    5. Step-by-step derivation
                      1. add-cube-cbrt73.3%

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

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

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

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

                        \[\leadsto \frac{\color{blue}{-\sqrt{a \cdot \left(c \cdot {\left(\sqrt[3]{-3}\right)}^{3}\right)} \cdot {\left(\sqrt{-1}\right)}^{2}}}{3 \cdot a} \]
                      2. rem-cube-cbrt0.0%

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

                        \[\leadsto \frac{-\sqrt{a \cdot \left(c \cdot -3\right)} \cdot \color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)}}{3 \cdot a} \]
                      4. rem-square-sqrt69.7%

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

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

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

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

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

                        \[\leadsto \frac{\color{blue}{\sqrt{a} \cdot \sqrt{c \cdot -3}}}{3 \cdot a} \]
                      5. *-commutative43.3%

                        \[\leadsto \frac{\color{blue}{\sqrt{c \cdot -3} \cdot \sqrt{a}}}{3 \cdot a} \]
                    11. Applied egg-rr43.3%

                      \[\leadsto \frac{\color{blue}{\sqrt{c \cdot -3} \cdot \sqrt{a}}}{3 \cdot a} \]
                    12. Step-by-step derivation
                      1. div-inv43.3%

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

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

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

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

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

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

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

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

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

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

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

                    if 2.7e-46 < b

                    1. Initial program 19.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. Simplified19.1%

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

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.25 \cdot 10^{-61}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 2.7 \cdot 10^{-46}:\\ \;\;\;\;\sqrt{c \cdot \left(a \cdot -3\right)} \cdot \frac{0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 5: 80.4% accurate, 1.0× speedup?

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

                      1. Initial program 64.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. Simplified64.8%

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

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

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

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

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

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

                        if -1.2599999999999999e-61 < b < 3.9499999999999999e-38

                        1. Initial program 73.8%

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

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

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

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

                          \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
                        4. Add Preprocessing
                        5. Step-by-step derivation
                          1. add-cube-cbrt73.3%

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

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

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

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

                            \[\leadsto \frac{\color{blue}{-\sqrt{a \cdot \left(c \cdot {\left(\sqrt[3]{-3}\right)}^{3}\right)} \cdot {\left(\sqrt{-1}\right)}^{2}}}{3 \cdot a} \]
                          2. rem-cube-cbrt0.0%

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

                            \[\leadsto \frac{-\sqrt{a \cdot \left(c \cdot -3\right)} \cdot \color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)}}{3 \cdot a} \]
                          4. rem-square-sqrt69.7%

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

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

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

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

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

                            \[\leadsto \frac{\color{blue}{\sqrt{a} \cdot \sqrt{c \cdot -3}}}{3 \cdot a} \]
                          5. *-commutative43.3%

                            \[\leadsto \frac{\color{blue}{\sqrt{c \cdot -3} \cdot \sqrt{a}}}{3 \cdot a} \]
                        11. Applied egg-rr43.3%

                          \[\leadsto \frac{\color{blue}{\sqrt{c \cdot -3} \cdot \sqrt{a}}}{3 \cdot a} \]
                        12. Step-by-step derivation
                          1. *-commutative43.3%

                            \[\leadsto \frac{\color{blue}{\sqrt{a} \cdot \sqrt{c \cdot -3}}}{3 \cdot a} \]
                          2. sqrt-prod69.7%

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

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

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

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

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

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

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

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

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

                        if 3.9499999999999999e-38 < b

                        1. Initial program 19.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. Simplified19.1%

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

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

                        Alternative 6: 71.6% accurate, 1.0× speedup?

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

                          1. Initial program 66.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. Simplified66.8%

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

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

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

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

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

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

                            if -2.40000000000000003e-121 < b < 4.59999999999999979e-83

                            1. Initial program 73.4%

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

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

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

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

                              \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
                            4. Add Preprocessing
                            5. Step-by-step derivation
                              1. add-cube-cbrt72.9%

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

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

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

                              \[\leadsto \color{blue}{-0.3333333333333333 \cdot \left(\sqrt{\frac{c \cdot {\left(\sqrt[3]{-3}\right)}^{3}}{a}} \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
                            8. Step-by-step derivation
                              1. rem-cube-cbrt0.0%

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

                                \[\leadsto -0.3333333333333333 \cdot \left(\sqrt{\frac{c \cdot -3}{a}} \cdot \color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)}\right) \]
                              3. rem-square-sqrt37.6%

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

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

                            if 4.59999999999999979e-83 < b

                            1. Initial program 20.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. Simplified20.8%

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

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

                              \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.4 \cdot 10^{-121}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 4.6 \cdot 10^{-83}:\\ \;\;\;\;-0.3333333333333333 \cdot \left(-\sqrt{\frac{c \cdot -3}{a}}\right)\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
                            5. Add Preprocessing

                            Alternative 7: 67.6% accurate, 11.6× speedup?

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

                              1. Initial program 67.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. Simplified67.8%

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

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

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

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

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

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

                                if 2.3000000000000002e-301 < b

                                1. Initial program 36.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. Simplified36.8%

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

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

                                Alternative 8: 67.6% accurate, 11.6× speedup?

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

                                  1. Initial program 67.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. Simplified67.8%

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

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

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

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

                                    if 2.3000000000000002e-301 < b

                                    1. Initial program 36.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. Simplified36.8%

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

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

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

                                    Alternative 9: 67.6% accurate, 11.6× speedup?

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

                                      1. Initial program 67.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. Simplified67.8%

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

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

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

                                          \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
                                        6. Taylor expanded in b around 0 64.2%

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

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

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

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

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

                                        if 2.3000000000000002e-301 < b

                                        1. Initial program 36.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. Simplified36.8%

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

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

                                        Alternative 10: 34.4% accurate, 23.2× speedup?

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

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

                                            \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
                                          4. Add Preprocessing

                                          Alternative 11: 11.2% accurate, 116.0× speedup?

                                          \[\begin{array}{l} \\ 0 \end{array} \]
                                          (FPCore (a b c) :precision binary64 0.0)
                                          double code(double a, double b, double c) {
                                          	return 0.0;
                                          }
                                          
                                          real(8) function code(a, b, c)
                                              real(8), intent (in) :: a
                                              real(8), intent (in) :: b
                                              real(8), intent (in) :: c
                                              code = 0.0d0
                                          end function
                                          
                                          public static double code(double a, double b, double c) {
                                          	return 0.0;
                                          }
                                          
                                          def code(a, b, c):
                                          	return 0.0
                                          
                                          function code(a, b, c)
                                          	return 0.0
                                          end
                                          
                                          function tmp = code(a, b, c)
                                          	tmp = 0.0;
                                          end
                                          
                                          code[a_, b_, c_] := 0.0
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          0
                                          \end{array}
                                          
                                          Derivation
                                          1. Initial program 54.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. Simplified54.5%

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

                                              \[\leadsto \frac{\color{blue}{b} - b}{3 \cdot a} \]
                                            4. Taylor expanded in b around 0 7.4%

                                              \[\leadsto \color{blue}{0} \]
                                            5. Add Preprocessing

                                            Reproduce

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