Cubic critical

Percentage Accurate: 51.9% → 86.0%
Time: 13.3s
Alternatives: 10
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 10 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: 51.9% accurate, 1.0× speedup?

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

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

Alternative 1: 86.0% accurate, 0.9× speedup?

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

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

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

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


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

    1. Initial program 49.0%

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

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

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

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

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

      if -5.5e88 < b < 1.8e-41

      1. Initial program 79.5%

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

      if 1.8e-41 < b

      1. Initial program 14.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. Simplified14.3%

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

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

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

      Alternative 2: 85.2% accurate, 0.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 2.1 \cdot 10^{-41}:\\ \;\;\;\;\left(b - \mathsf{hypot}\left(b, \sqrt{\left|\left(3 \cdot a\right) \cdot c\right|}\right)\right) \cdot \frac{1}{a \cdot -3}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
      (FPCore (a b c)
       :precision binary64
       (if (<= b 2.1e-41)
         (* (- b (hypot b (sqrt (fabs (* (* 3.0 a) c))))) (/ 1.0 (* a -3.0)))
         (* -0.5 (/ c b))))
      double code(double a, double b, double c) {
      	double tmp;
      	if (b <= 2.1e-41) {
      		tmp = (b - hypot(b, sqrt(fabs(((3.0 * a) * c))))) * (1.0 / (a * -3.0));
      	} else {
      		tmp = -0.5 * (c / b);
      	}
      	return tmp;
      }
      
      public static double code(double a, double b, double c) {
      	double tmp;
      	if (b <= 2.1e-41) {
      		tmp = (b - Math.hypot(b, Math.sqrt(Math.abs(((3.0 * a) * c))))) * (1.0 / (a * -3.0));
      	} else {
      		tmp = -0.5 * (c / b);
      	}
      	return tmp;
      }
      
      def code(a, b, c):
      	tmp = 0
      	if b <= 2.1e-41:
      		tmp = (b - math.hypot(b, math.sqrt(math.fabs(((3.0 * a) * c))))) * (1.0 / (a * -3.0))
      	else:
      		tmp = -0.5 * (c / b)
      	return tmp
      
      function code(a, b, c)
      	tmp = 0.0
      	if (b <= 2.1e-41)
      		tmp = Float64(Float64(b - hypot(b, sqrt(abs(Float64(Float64(3.0 * a) * c))))) * Float64(1.0 / 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.1e-41)
      		tmp = (b - hypot(b, sqrt(abs(((3.0 * a) * c))))) * (1.0 / (a * -3.0));
      	else
      		tmp = -0.5 * (c / b);
      	end
      	tmp_2 = tmp;
      end
      
      code[a_, b_, c_] := If[LessEqual[b, 2.1e-41], N[(N[(b - N[Sqrt[b ^ 2 + N[Sqrt[N[Abs[N[(N[(3.0 * a), $MachinePrecision] * c), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(a * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;b \leq 2.1 \cdot 10^{-41}:\\
      \;\;\;\;\left(b - \mathsf{hypot}\left(b, \sqrt{\left|\left(3 \cdot a\right) \cdot c\right|}\right)\right) \cdot \frac{1}{a \cdot -3}\\
      
      \mathbf{else}:\\
      \;\;\;\;-0.5 \cdot \frac{c}{b}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if b < 2.10000000000000013e-41

        1. Initial program 70.0%

          \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
        2. Step-by-step derivation
          1. Simplified69.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. Applied egg-rr32.6%

            \[\leadsto \color{blue}{\left(b - \mathsf{hypot}\left(b, \sqrt{3 \cdot \left(a \cdot c\right)}\right)\right) \cdot \frac{1}{a \cdot -3}} \]
          4. Step-by-step derivation
            1. add-sqr-sqrt32.6%

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

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

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

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

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

              \[\leadsto \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left|3 \cdot \left(a \cdot c\right)\right|}}\right)\right) \cdot \frac{1}{a \cdot -3} \]
            3. associate-*r*83.7%

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

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

          if 2.10000000000000013e-41 < b

          1. Initial program 14.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. Simplified14.3%

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

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

          Alternative 3: 85.9% accurate, 0.9× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.45 \cdot 10^{+89}:\\ \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{-41}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
          (FPCore (a b c)
           :precision binary64
           (if (<= b -1.45e+89)
             (* (/ b a) -0.6666666666666666)
             (if (<= b 1.8e-41)
               (/ (- (sqrt (- (* b b) (* 3.0 (* a c)))) b) (* 3.0 a))
               (* -0.5 (/ c b)))))
          double code(double a, double b, double c) {
          	double tmp;
          	if (b <= -1.45e+89) {
          		tmp = (b / a) * -0.6666666666666666;
          	} else if (b <= 1.8e-41) {
          		tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - b) / (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.45d+89)) then
                  tmp = (b / a) * (-0.6666666666666666d0)
              else if (b <= 1.8d-41) then
                  tmp = (sqrt(((b * b) - (3.0d0 * (a * c)))) - b) / (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.45e+89) {
          		tmp = (b / a) * -0.6666666666666666;
          	} else if (b <= 1.8e-41) {
          		tmp = (Math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (3.0 * a);
          	} else {
          		tmp = -0.5 * (c / b);
          	}
          	return tmp;
          }
          
          def code(a, b, c):
          	tmp = 0
          	if b <= -1.45e+89:
          		tmp = (b / a) * -0.6666666666666666
          	elif b <= 1.8e-41:
          		tmp = (math.sqrt(((b * b) - (3.0 * (a * c)))) - b) / (3.0 * a)
          	else:
          		tmp = -0.5 * (c / b)
          	return tmp
          
          function code(a, b, c)
          	tmp = 0.0
          	if (b <= -1.45e+89)
          		tmp = Float64(Float64(b / a) * -0.6666666666666666);
          	elseif (b <= 1.8e-41)
          		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(3.0 * Float64(a * c)))) - b) / Float64(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.45e+89)
          		tmp = (b / a) * -0.6666666666666666;
          	elseif (b <= 1.8e-41)
          		tmp = (sqrt(((b * b) - (3.0 * (a * c)))) - b) / (3.0 * a);
          	else
          		tmp = -0.5 * (c / b);
          	end
          	tmp_2 = tmp;
          end
          
          code[a_, b_, c_] := If[LessEqual[b, -1.45e+89], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], If[LessEqual[b, 1.8e-41], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;b \leq -1.45 \cdot 10^{+89}:\\
          \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
          
          \mathbf{elif}\;b \leq 1.8 \cdot 10^{-41}:\\
          \;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b}{3 \cdot a}\\
          
          \mathbf{else}:\\
          \;\;\;\;-0.5 \cdot \frac{c}{b}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if b < -1.45000000000000013e89

            1. Initial program 49.0%

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

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

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

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

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

              if -1.45000000000000013e89 < b < 1.8e-41

              1. Initial program 79.5%

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

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

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

                  \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{3 \cdot \left(a \cdot c\right)}}}{3 \cdot a} \]
              3. Simplified79.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

              if 1.8e-41 < b

              1. Initial program 14.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. Simplified14.3%

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

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

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

              Alternative 4: 81.4% accurate, 1.0× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -7 \cdot 10^{-58}:\\ \;\;\;\;b \cdot \left(0.6666666666666666 \cdot \frac{-1}{a} - -0.5 \cdot \frac{c}{{b}^{2}}\right)\\ \mathbf{elif}\;b \leq 7.2 \cdot 10^{-87}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
              (FPCore (a b c)
               :precision binary64
               (if (<= b -7e-58)
                 (* b (- (* 0.6666666666666666 (/ -1.0 a)) (* -0.5 (/ c (pow b 2.0)))))
                 (if (<= b 7.2e-87)
                   (/ (- (sqrt (* c (* a -3.0))) b) (* 3.0 a))
                   (* -0.5 (/ c b)))))
              double code(double a, double b, double c) {
              	double tmp;
              	if (b <= -7e-58) {
              		tmp = b * ((0.6666666666666666 * (-1.0 / a)) - (-0.5 * (c / pow(b, 2.0))));
              	} else if (b <= 7.2e-87) {
              		tmp = (sqrt((c * (a * -3.0))) - b) / (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 <= (-7d-58)) then
                      tmp = b * ((0.6666666666666666d0 * ((-1.0d0) / a)) - ((-0.5d0) * (c / (b ** 2.0d0))))
                  else if (b <= 7.2d-87) then
                      tmp = (sqrt((c * (a * (-3.0d0)))) - b) / (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 <= -7e-58) {
              		tmp = b * ((0.6666666666666666 * (-1.0 / a)) - (-0.5 * (c / Math.pow(b, 2.0))));
              	} else if (b <= 7.2e-87) {
              		tmp = (Math.sqrt((c * (a * -3.0))) - b) / (3.0 * a);
              	} else {
              		tmp = -0.5 * (c / b);
              	}
              	return tmp;
              }
              
              def code(a, b, c):
              	tmp = 0
              	if b <= -7e-58:
              		tmp = b * ((0.6666666666666666 * (-1.0 / a)) - (-0.5 * (c / math.pow(b, 2.0))))
              	elif b <= 7.2e-87:
              		tmp = (math.sqrt((c * (a * -3.0))) - b) / (3.0 * a)
              	else:
              		tmp = -0.5 * (c / b)
              	return tmp
              
              function code(a, b, c)
              	tmp = 0.0
              	if (b <= -7e-58)
              		tmp = Float64(b * Float64(Float64(0.6666666666666666 * Float64(-1.0 / a)) - Float64(-0.5 * Float64(c / (b ^ 2.0)))));
              	elseif (b <= 7.2e-87)
              		tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / Float64(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 <= -7e-58)
              		tmp = b * ((0.6666666666666666 * (-1.0 / a)) - (-0.5 * (c / (b ^ 2.0))));
              	elseif (b <= 7.2e-87)
              		tmp = (sqrt((c * (a * -3.0))) - b) / (3.0 * a);
              	else
              		tmp = -0.5 * (c / b);
              	end
              	tmp_2 = tmp;
              end
              
              code[a_, b_, c_] := If[LessEqual[b, -7e-58], N[(b * N[(N[(0.6666666666666666 * N[(-1.0 / a), $MachinePrecision]), $MachinePrecision] - N[(-0.5 * N[(c / N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.2e-87], N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;b \leq -7 \cdot 10^{-58}:\\
              \;\;\;\;b \cdot \left(0.6666666666666666 \cdot \frac{-1}{a} - -0.5 \cdot \frac{c}{{b}^{2}}\right)\\
              
              \mathbf{elif}\;b \leq 7.2 \cdot 10^{-87}:\\
              \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a}\\
              
              \mathbf{else}:\\
              \;\;\;\;-0.5 \cdot \frac{c}{b}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if b < -6.9999999999999998e-58

                1. Initial program 66.7%

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

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

                    \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-0.5 \cdot \frac{c}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right)\right)} \]

                  if -6.9999999999999998e-58 < b < 7.19999999999999986e-87

                  1. Initial program 78.0%

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

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

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

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

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

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

                    if 7.19999999999999986e-87 < b

                    1. Initial program 18.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. Simplified18.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 83.3%

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7 \cdot 10^{-58}:\\ \;\;\;\;b \cdot \left(0.6666666666666666 \cdot \frac{-1}{a} - -0.5 \cdot \frac{c}{{b}^{2}}\right)\\ \mathbf{elif}\;b \leq 7.2 \cdot 10^{-87}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 5: 81.4% accurate, 1.0× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.65 \cdot 10^{-53}:\\ \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\ \mathbf{elif}\;b \leq 7.5 \cdot 10^{-87}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
                    (FPCore (a b c)
                     :precision binary64
                     (if (<= b -1.65e-53)
                       (* (/ b a) -0.6666666666666666)
                       (if (<= b 7.5e-87)
                         (/ (- (sqrt (* c (* a -3.0))) b) (* 3.0 a))
                         (* -0.5 (/ c b)))))
                    double code(double a, double b, double c) {
                    	double tmp;
                    	if (b <= -1.65e-53) {
                    		tmp = (b / a) * -0.6666666666666666;
                    	} else if (b <= 7.5e-87) {
                    		tmp = (sqrt((c * (a * -3.0))) - b) / (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.65d-53)) then
                            tmp = (b / a) * (-0.6666666666666666d0)
                        else if (b <= 7.5d-87) then
                            tmp = (sqrt((c * (a * (-3.0d0)))) - b) / (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.65e-53) {
                    		tmp = (b / a) * -0.6666666666666666;
                    	} else if (b <= 7.5e-87) {
                    		tmp = (Math.sqrt((c * (a * -3.0))) - b) / (3.0 * a);
                    	} else {
                    		tmp = -0.5 * (c / b);
                    	}
                    	return tmp;
                    }
                    
                    def code(a, b, c):
                    	tmp = 0
                    	if b <= -1.65e-53:
                    		tmp = (b / a) * -0.6666666666666666
                    	elif b <= 7.5e-87:
                    		tmp = (math.sqrt((c * (a * -3.0))) - b) / (3.0 * a)
                    	else:
                    		tmp = -0.5 * (c / b)
                    	return tmp
                    
                    function code(a, b, c)
                    	tmp = 0.0
                    	if (b <= -1.65e-53)
                    		tmp = Float64(Float64(b / a) * -0.6666666666666666);
                    	elseif (b <= 7.5e-87)
                    		tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / Float64(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.65e-53)
                    		tmp = (b / a) * -0.6666666666666666;
                    	elseif (b <= 7.5e-87)
                    		tmp = (sqrt((c * (a * -3.0))) - b) / (3.0 * a);
                    	else
                    		tmp = -0.5 * (c / b);
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[a_, b_, c_] := If[LessEqual[b, -1.65e-53], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], If[LessEqual[b, 7.5e-87], N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;b \leq -1.65 \cdot 10^{-53}:\\
                    \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
                    
                    \mathbf{elif}\;b \leq 7.5 \cdot 10^{-87}:\\
                    \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{3 \cdot a}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;-0.5 \cdot \frac{c}{b}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if b < -1.65000000000000002e-53

                      1. Initial program 66.7%

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

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

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

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

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

                        if -1.65000000000000002e-53 < b < 7.5000000000000002e-87

                        1. Initial program 78.0%

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

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

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

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

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

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

                          if 7.5000000000000002e-87 < b

                          1. Initial program 18.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. Simplified18.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 83.3%

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

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

                          Alternative 6: 81.4% accurate, 1.0× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5.7 \cdot 10^{-61}:\\ \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\ \mathbf{elif}\;b \leq 7.3 \cdot 10^{-87}:\\ \;\;\;\;\frac{\sqrt{-3 \cdot \left(a \cdot c\right)} - b}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
                          (FPCore (a b c)
                           :precision binary64
                           (if (<= b -5.7e-61)
                             (* (/ b a) -0.6666666666666666)
                             (if (<= b 7.3e-87)
                               (/ (- (sqrt (* -3.0 (* a c))) b) (* 3.0 a))
                               (* -0.5 (/ c b)))))
                          double code(double a, double b, double c) {
                          	double tmp;
                          	if (b <= -5.7e-61) {
                          		tmp = (b / a) * -0.6666666666666666;
                          	} else if (b <= 7.3e-87) {
                          		tmp = (sqrt((-3.0 * (a * c))) - b) / (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 <= (-5.7d-61)) then
                                  tmp = (b / a) * (-0.6666666666666666d0)
                              else if (b <= 7.3d-87) then
                                  tmp = (sqrt(((-3.0d0) * (a * c))) - b) / (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 <= -5.7e-61) {
                          		tmp = (b / a) * -0.6666666666666666;
                          	} else if (b <= 7.3e-87) {
                          		tmp = (Math.sqrt((-3.0 * (a * c))) - b) / (3.0 * a);
                          	} else {
                          		tmp = -0.5 * (c / b);
                          	}
                          	return tmp;
                          }
                          
                          def code(a, b, c):
                          	tmp = 0
                          	if b <= -5.7e-61:
                          		tmp = (b / a) * -0.6666666666666666
                          	elif b <= 7.3e-87:
                          		tmp = (math.sqrt((-3.0 * (a * c))) - b) / (3.0 * a)
                          	else:
                          		tmp = -0.5 * (c / b)
                          	return tmp
                          
                          function code(a, b, c)
                          	tmp = 0.0
                          	if (b <= -5.7e-61)
                          		tmp = Float64(Float64(b / a) * -0.6666666666666666);
                          	elseif (b <= 7.3e-87)
                          		tmp = Float64(Float64(sqrt(Float64(-3.0 * Float64(a * c))) - b) / Float64(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 <= -5.7e-61)
                          		tmp = (b / a) * -0.6666666666666666;
                          	elseif (b <= 7.3e-87)
                          		tmp = (sqrt((-3.0 * (a * c))) - b) / (3.0 * a);
                          	else
                          		tmp = -0.5 * (c / b);
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[a_, b_, c_] := If[LessEqual[b, -5.7e-61], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], If[LessEqual[b, 7.3e-87], N[(N[(N[Sqrt[N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;b \leq -5.7 \cdot 10^{-61}:\\
                          \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
                          
                          \mathbf{elif}\;b \leq 7.3 \cdot 10^{-87}:\\
                          \;\;\;\;\frac{\sqrt{-3 \cdot \left(a \cdot c\right)} - b}{3 \cdot a}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;-0.5 \cdot \frac{c}{b}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if b < -5.70000000000000005e-61

                            1. Initial program 66.7%

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

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

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

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

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

                              if -5.70000000000000005e-61 < b < 7.29999999999999967e-87

                              1. Initial program 78.0%

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

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

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

                                if 7.29999999999999967e-87 < b

                                1. Initial program 18.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. Simplified18.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 83.3%

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

                                Alternative 7: 72.3% accurate, 1.0× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.1 \cdot 10^{-148}:\\ \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\ \mathbf{elif}\;b \leq 8.4 \cdot 10^{-107}:\\ \;\;\;\;\sqrt{\frac{c \cdot -3}{a}} \cdot \left(--0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
                                (FPCore (a b c)
                                 :precision binary64
                                 (if (<= b -1.1e-148)
                                   (* (/ b a) -0.6666666666666666)
                                   (if (<= b 8.4e-107)
                                     (* (sqrt (/ (* c -3.0) a)) (- -0.3333333333333333))
                                     (* -0.5 (/ c b)))))
                                double code(double a, double b, double c) {
                                	double tmp;
                                	if (b <= -1.1e-148) {
                                		tmp = (b / a) * -0.6666666666666666;
                                	} else if (b <= 8.4e-107) {
                                		tmp = sqrt(((c * -3.0) / a)) * -(-0.3333333333333333);
                                	} 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.1d-148)) then
                                        tmp = (b / a) * (-0.6666666666666666d0)
                                    else if (b <= 8.4d-107) then
                                        tmp = sqrt(((c * (-3.0d0)) / a)) * -(-0.3333333333333333d0)
                                    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.1e-148) {
                                		tmp = (b / a) * -0.6666666666666666;
                                	} else if (b <= 8.4e-107) {
                                		tmp = Math.sqrt(((c * -3.0) / a)) * -(-0.3333333333333333);
                                	} else {
                                		tmp = -0.5 * (c / b);
                                	}
                                	return tmp;
                                }
                                
                                def code(a, b, c):
                                	tmp = 0
                                	if b <= -1.1e-148:
                                		tmp = (b / a) * -0.6666666666666666
                                	elif b <= 8.4e-107:
                                		tmp = math.sqrt(((c * -3.0) / a)) * -(-0.3333333333333333)
                                	else:
                                		tmp = -0.5 * (c / b)
                                	return tmp
                                
                                function code(a, b, c)
                                	tmp = 0.0
                                	if (b <= -1.1e-148)
                                		tmp = Float64(Float64(b / a) * -0.6666666666666666);
                                	elseif (b <= 8.4e-107)
                                		tmp = Float64(sqrt(Float64(Float64(c * -3.0) / a)) * Float64(-(-0.3333333333333333)));
                                	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.1e-148)
                                		tmp = (b / a) * -0.6666666666666666;
                                	elseif (b <= 8.4e-107)
                                		tmp = sqrt(((c * -3.0) / a)) * -(-0.3333333333333333);
                                	else
                                		tmp = -0.5 * (c / b);
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[a_, b_, c_] := If[LessEqual[b, -1.1e-148], N[(N[(b / a), $MachinePrecision] * -0.6666666666666666), $MachinePrecision], If[LessEqual[b, 8.4e-107], N[(N[Sqrt[N[(N[(c * -3.0), $MachinePrecision] / a), $MachinePrecision]], $MachinePrecision] * (--0.3333333333333333)), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;b \leq -1.1 \cdot 10^{-148}:\\
                                \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\
                                
                                \mathbf{elif}\;b \leq 8.4 \cdot 10^{-107}:\\
                                \;\;\;\;\sqrt{\frac{c \cdot -3}{a}} \cdot \left(--0.3333333333333333\right)\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;-0.5 \cdot \frac{c}{b}\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 3 regimes
                                2. if b < -1.10000000000000009e-148

                                  1. Initial program 70.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. Simplified70.3%

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

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

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

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

                                    if -1.10000000000000009e-148 < b < 8.3999999999999997e-107

                                    1. Initial program 74.2%

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

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

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

                                      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{{\left(\sqrt[3]{3 \cdot a}\right)}^{3}} \cdot c}}{3 \cdot a} \]
                                    5. 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)} \]
                                    6. 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) \]
                                    7. Simplified37.6%

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

                                    if 8.3999999999999997e-107 < b

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

                                        \[\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 -1.1 \cdot 10^{-148}:\\ \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\ \mathbf{elif}\;b \leq 8.4 \cdot 10^{-107}:\\ \;\;\;\;\sqrt{\frac{c \cdot -3}{a}} \cdot \left(--0.3333333333333333\right)\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
                                    5. Add Preprocessing

                                    Alternative 8: 68.3% accurate, 11.6× speedup?

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

                                      1. Initial program 70.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. Simplified70.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 66.9%

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

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

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

                                        if -9.999999999999969e-311 < b

                                        1. Initial program 34.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. Simplified34.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.5 \cdot \frac{c}{b}} \]
                                        3. Recombined 2 regimes into one program.
                                        4. Add Preprocessing

                                        Alternative 9: 35.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 53.2%

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

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

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

                                          Alternative 10: 11.3% 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 53.2%

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

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

                                              \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
                                            4. Step-by-step derivation
                                              1. expm1-log1p-u29.2%

                                                \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-0.5 \cdot \frac{c}{b}\right)\right)} \]
                                              2. expm1-undefine12.5%

                                                \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-0.5 \cdot \frac{c}{b}\right)} - 1} \]
                                            5. Applied egg-rr12.5%

                                              \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(-0.5 \cdot \frac{c}{b}\right)} - 1} \]
                                            6. Taylor expanded in c around 0 9.3%

                                              \[\leadsto \color{blue}{1} - 1 \]
                                            7. Step-by-step derivation
                                              1. metadata-eval9.3%

                                                \[\leadsto \color{blue}{0} \]
                                            8. Applied egg-rr9.3%

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

                                            Reproduce

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