Cubic critical

Percentage Accurate: 51.4% → 86.1%
Time: 13.8s
Alternatives: 12
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 12 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.4% accurate, 1.0× speedup?

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

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

Alternative 1: 86.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.1 \cdot 10^{+101}:\\ \;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\ \mathbf{elif}\;b \leq 7 \cdot 10^{-54}:\\ \;\;\;\;\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 -1.1e+101)
   (/ (* b -2.0) (* 3.0 a))
   (if (<= b 7e-54)
     (/ (- (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.1e+101) {
		tmp = (b * -2.0) / (3.0 * a);
	} else if (b <= 7e-54) {
		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.1d+101)) then
        tmp = (b * (-2.0d0)) / (3.0d0 * a)
    else if (b <= 7d-54) 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.1e+101) {
		tmp = (b * -2.0) / (3.0 * a);
	} else if (b <= 7e-54) {
		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.1e+101:
		tmp = (b * -2.0) / (3.0 * a)
	elif b <= 7e-54:
		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.1e+101)
		tmp = Float64(Float64(b * -2.0) / Float64(3.0 * a));
	elseif (b <= 7e-54)
		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 <= -1.1e+101)
		tmp = (b * -2.0) / (3.0 * a);
	elseif (b <= 7e-54)
		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.1e+101], N[(N[(b * -2.0), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7e-54], 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 -1.1 \cdot 10^{+101}:\\
\;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\

\mathbf{elif}\;b \leq 7 \cdot 10^{-54}:\\
\;\;\;\;\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 < -1.1e101

    1. Initial program 45.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. Simplified45.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 95.9%

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

          \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
      5. Simplified95.9%

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

      if -1.1e101 < b < 6.99999999999999964e-54

      1. Initial program 80.4%

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

      if 6.99999999999999964e-54 < b

      1. Initial program 17.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. Simplified17.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 84.4%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.1 \cdot 10^{+101}:\\ \;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\ \mathbf{elif}\;b \leq 7 \cdot 10^{-54}:\\ \;\;\;\;\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: 86.2% accurate, 0.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -3.9 \cdot 10^{+101}:\\ \;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\ \mathbf{elif}\;b \leq 5.6 \cdot 10^{-52}:\\ \;\;\;\;\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 -3.9e+101)
         (/ (* b -2.0) (* 3.0 a))
         (if (<= b 5.6e-52)
           (/ (- (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 <= -3.9e+101) {
      		tmp = (b * -2.0) / (3.0 * a);
      	} else if (b <= 5.6e-52) {
      		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 <= (-3.9d+101)) then
              tmp = (b * (-2.0d0)) / (3.0d0 * a)
          else if (b <= 5.6d-52) 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 <= -3.9e+101) {
      		tmp = (b * -2.0) / (3.0 * a);
      	} else if (b <= 5.6e-52) {
      		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 <= -3.9e+101:
      		tmp = (b * -2.0) / (3.0 * a)
      	elif b <= 5.6e-52:
      		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 <= -3.9e+101)
      		tmp = Float64(Float64(b * -2.0) / Float64(3.0 * a));
      	elseif (b <= 5.6e-52)
      		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 <= -3.9e+101)
      		tmp = (b * -2.0) / (3.0 * a);
      	elseif (b <= 5.6e-52)
      		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, -3.9e+101], N[(N[(b * -2.0), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.6e-52], 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 -3.9 \cdot 10^{+101}:\\
      \;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\
      
      \mathbf{elif}\;b \leq 5.6 \cdot 10^{-52}:\\
      \;\;\;\;\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 < -3.9e101

        1. Initial program 45.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. Simplified45.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 95.9%

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

              \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
          5. Simplified95.9%

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

          if -3.9e101 < b < 5.59999999999999989e-52

          1. Initial program 80.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-neg80.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-neg80.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*80.2%

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

            \[\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 5.59999999999999989e-52 < b

          1. Initial program 17.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. Simplified17.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 84.4%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.9 \cdot 10^{+101}:\\ \;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\ \mathbf{elif}\;b \leq 5.6 \cdot 10^{-52}:\\ \;\;\;\;\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 3: 81.1% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-99}:\\ \;\;\;\;b \cdot \left(0.6666666666666666 \cdot \frac{-1}{a} - -0.5 \cdot \frac{c}{{b}^{2}}\right)\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{-56}:\\ \;\;\;\;\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 -5e-99)
             (* b (- (* 0.6666666666666666 (/ -1.0 a)) (* -0.5 (/ c (pow b 2.0)))))
             (if (<= b 1.8e-56)
               (/ (- (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 <= -5e-99) {
          		tmp = b * ((0.6666666666666666 * (-1.0 / a)) - (-0.5 * (c / pow(b, 2.0))));
          	} else if (b <= 1.8e-56) {
          		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 <= (-5d-99)) then
                  tmp = b * ((0.6666666666666666d0 * ((-1.0d0) / a)) - ((-0.5d0) * (c / (b ** 2.0d0))))
              else if (b <= 1.8d-56) 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 <= -5e-99) {
          		tmp = b * ((0.6666666666666666 * (-1.0 / a)) - (-0.5 * (c / Math.pow(b, 2.0))));
          	} else if (b <= 1.8e-56) {
          		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 <= -5e-99:
          		tmp = b * ((0.6666666666666666 * (-1.0 / a)) - (-0.5 * (c / math.pow(b, 2.0))))
          	elif b <= 1.8e-56:
          		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 <= -5e-99)
          		tmp = Float64(b * Float64(Float64(0.6666666666666666 * Float64(-1.0 / a)) - Float64(-0.5 * Float64(c / (b ^ 2.0)))));
          	elseif (b <= 1.8e-56)
          		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 <= -5e-99)
          		tmp = b * ((0.6666666666666666 * (-1.0 / a)) - (-0.5 * (c / (b ^ 2.0))));
          	elseif (b <= 1.8e-56)
          		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, -5e-99], 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, 1.8e-56], 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 -5 \cdot 10^{-99}:\\
          \;\;\;\;b \cdot \left(0.6666666666666666 \cdot \frac{-1}{a} - -0.5 \cdot \frac{c}{{b}^{2}}\right)\\
          
          \mathbf{elif}\;b \leq 1.8 \cdot 10^{-56}:\\
          \;\;\;\;\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 < -4.99999999999999969e-99

            1. Initial program 65.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. Simplified65.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 80.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 -4.99999999999999969e-99 < b < 1.79999999999999989e-56

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

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

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

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

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

                if 1.79999999999999989e-56 < b

                1. Initial program 17.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. Simplified17.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 84.4%

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-99}:\\ \;\;\;\;b \cdot \left(0.6666666666666666 \cdot \frac{-1}{a} - -0.5 \cdot \frac{c}{{b}^{2}}\right)\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{-56}:\\ \;\;\;\;\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 4: 80.9% accurate, 1.0× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -6.9 \cdot 10^{-99}:\\ \;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\ \mathbf{elif}\;b \leq 7.5 \cdot 10^{-49}:\\ \;\;\;\;\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 -6.9e-99)
                   (/ (* b -2.0) (* 3.0 a))
                   (if (<= b 7.5e-49)
                     (/ (- (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 <= -6.9e-99) {
                		tmp = (b * -2.0) / (3.0 * a);
                	} else if (b <= 7.5e-49) {
                		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 <= (-6.9d-99)) then
                        tmp = (b * (-2.0d0)) / (3.0d0 * a)
                    else if (b <= 7.5d-49) 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 <= -6.9e-99) {
                		tmp = (b * -2.0) / (3.0 * a);
                	} else if (b <= 7.5e-49) {
                		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 <= -6.9e-99:
                		tmp = (b * -2.0) / (3.0 * a)
                	elif b <= 7.5e-49:
                		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 <= -6.9e-99)
                		tmp = Float64(Float64(b * -2.0) / Float64(3.0 * a));
                	elseif (b <= 7.5e-49)
                		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 <= -6.9e-99)
                		tmp = (b * -2.0) / (3.0 * a);
                	elseif (b <= 7.5e-49)
                		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, -6.9e-99], N[(N[(b * -2.0), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.5e-49], 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 -6.9 \cdot 10^{-99}:\\
                \;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\
                
                \mathbf{elif}\;b \leq 7.5 \cdot 10^{-49}:\\
                \;\;\;\;\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.9000000000000003e-99

                  1. Initial program 65.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. Simplified65.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 80.4%

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

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

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

                    if -6.9000000000000003e-99 < b < 7.4999999999999998e-49

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

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

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

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

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

                      if 7.4999999999999998e-49 < b

                      1. Initial program 17.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. Simplified17.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 84.4%

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -6.9 \cdot 10^{-99}:\\ \;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\ \mathbf{elif}\;b \leq 7.5 \cdot 10^{-49}:\\ \;\;\;\;\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: 80.9% accurate, 1.0× speedup?

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

                        1. Initial program 65.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. Simplified65.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 80.4%

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

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

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

                          if -3.40000000000000007e-99 < b < 1.5199999999999999e-52

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

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

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

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

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

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

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

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

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

                            if 1.5199999999999999e-52 < b

                            1. Initial program 17.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. Simplified17.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 84.4%

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

                            Alternative 6: 80.4% accurate, 1.0× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -6.2 \cdot 10^{-111}:\\ \;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\ \mathbf{elif}\;b \leq 1.85 \cdot 10^{-51}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{b + \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 -6.2e-111)
                               (/ (* b -2.0) (* 3.0 a))
                               (if (<= b 1.85e-51)
                                 (* 0.3333333333333333 (/ (+ b (sqrt (* a (* c -3.0)))) a))
                                 (* -0.5 (/ c b)))))
                            double code(double a, double b, double c) {
                            	double tmp;
                            	if (b <= -6.2e-111) {
                            		tmp = (b * -2.0) / (3.0 * a);
                            	} else if (b <= 1.85e-51) {
                            		tmp = 0.3333333333333333 * ((b + 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 <= (-6.2d-111)) then
                                    tmp = (b * (-2.0d0)) / (3.0d0 * a)
                                else if (b <= 1.85d-51) then
                                    tmp = 0.3333333333333333d0 * ((b + 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 <= -6.2e-111) {
                            		tmp = (b * -2.0) / (3.0 * a);
                            	} else if (b <= 1.85e-51) {
                            		tmp = 0.3333333333333333 * ((b + Math.sqrt((a * (c * -3.0)))) / a);
                            	} else {
                            		tmp = -0.5 * (c / b);
                            	}
                            	return tmp;
                            }
                            
                            def code(a, b, c):
                            	tmp = 0
                            	if b <= -6.2e-111:
                            		tmp = (b * -2.0) / (3.0 * a)
                            	elif b <= 1.85e-51:
                            		tmp = 0.3333333333333333 * ((b + 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 <= -6.2e-111)
                            		tmp = Float64(Float64(b * -2.0) / Float64(3.0 * a));
                            	elseif (b <= 1.85e-51)
                            		tmp = Float64(0.3333333333333333 * Float64(Float64(b + 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 <= -6.2e-111)
                            		tmp = (b * -2.0) / (3.0 * a);
                            	elseif (b <= 1.85e-51)
                            		tmp = 0.3333333333333333 * ((b + sqrt((a * (c * -3.0)))) / a);
                            	else
                            		tmp = -0.5 * (c / b);
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[a_, b_, c_] := If[LessEqual[b, -6.2e-111], N[(N[(b * -2.0), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.85e-51], N[(0.3333333333333333 * N[(N[(b + N[Sqrt[N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;b \leq -6.2 \cdot 10^{-111}:\\
                            \;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\
                            
                            \mathbf{elif}\;b \leq 1.85 \cdot 10^{-51}:\\
                            \;\;\;\;0.3333333333333333 \cdot \frac{b + \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 < -6.20000000000000029e-111

                              1. Initial program 66.6%

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

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

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

                                    \[\leadsto \frac{\color{blue}{b \cdot -2}}{3 \cdot a} \]
                                5. Simplified79.8%

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

                                if -6.20000000000000029e-111 < b < 1.84999999999999987e-51

                                1. Initial program 76.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. Simplified76.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 0 74.0%

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

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

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

                                    \[\leadsto \frac{\sqrt{\color{blue}{\left(a \cdot -3\right) \cdot c}} - b}{3 \cdot a} \]
                                  6. Step-by-step derivation
                                    1. *-un-lft-identity74.2%

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

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

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

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

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

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

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

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

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

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

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

                                  if 1.84999999999999987e-51 < b

                                  1. Initial program 17.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. Simplified17.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 84.4%

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

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -6.2 \cdot 10^{-111}:\\ \;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\ \mathbf{elif}\;b \leq 1.85 \cdot 10^{-51}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{b + \sqrt{a \cdot \left(c \cdot -3\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]
                                  5. Add Preprocessing

                                  Alternative 7: 72.6% accurate, 1.0× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.4 \cdot 10^{-125}:\\ \;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\ \mathbf{elif}\;b \leq 7 \cdot 10^{-109}:\\ \;\;\;\;\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.4e-125)
                                     (/ (* b -2.0) (* 3.0 a))
                                     (if (<= b 7e-109)
                                       (* (sqrt (/ (* c -3.0) a)) (- -0.3333333333333333))
                                       (* -0.5 (/ c b)))))
                                  double code(double a, double b, double c) {
                                  	double tmp;
                                  	if (b <= -1.4e-125) {
                                  		tmp = (b * -2.0) / (3.0 * a);
                                  	} else if (b <= 7e-109) {
                                  		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.4d-125)) then
                                          tmp = (b * (-2.0d0)) / (3.0d0 * a)
                                      else if (b <= 7d-109) 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.4e-125) {
                                  		tmp = (b * -2.0) / (3.0 * a);
                                  	} else if (b <= 7e-109) {
                                  		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.4e-125:
                                  		tmp = (b * -2.0) / (3.0 * a)
                                  	elif b <= 7e-109:
                                  		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.4e-125)
                                  		tmp = Float64(Float64(b * -2.0) / Float64(3.0 * a));
                                  	elseif (b <= 7e-109)
                                  		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.4e-125)
                                  		tmp = (b * -2.0) / (3.0 * a);
                                  	elseif (b <= 7e-109)
                                  		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.4e-125], N[(N[(b * -2.0), $MachinePrecision] / N[(3.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7e-109], 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.4 \cdot 10^{-125}:\\
                                  \;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\
                                  
                                  \mathbf{elif}\;b \leq 7 \cdot 10^{-109}:\\
                                  \;\;\;\;\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.4e-125

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

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

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

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

                                      if -1.4e-125 < b < 7e-109

                                      1. Initial program 78.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. sqr-neg78.7%

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

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

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

                                          \[\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. pow378.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-rr78.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. *-commutative0.0%

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

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

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

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

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

                                      if 7e-109 < b

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

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

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.4 \cdot 10^{-125}:\\ \;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\ \mathbf{elif}\;b \leq 7 \cdot 10^{-109}:\\ \;\;\;\;\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: 69.1% accurate, 9.7× speedup?

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

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

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

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

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

                                          if 4.49999999999999981e-294 < b

                                          1. Initial program 32.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. Simplified32.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.7%

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

                                          Alternative 9: 69.0% accurate, 11.6× speedup?

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

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

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

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

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

                                              if 4.49999999999999981e-294 < b

                                              1. Initial program 32.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. Simplified32.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.7%

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

                                              Alternative 10: 69.0% accurate, 11.6× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 4.5 \cdot 10^{-294}:\\ \;\;\;\;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 4.5e-294) (* b (/ -0.6666666666666666 a)) (* -0.5 (/ c b))))
                                              double code(double a, double b, double c) {
                                              	double tmp;
                                              	if (b <= 4.5e-294) {
                                              		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 <= 4.5d-294) 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 <= 4.5e-294) {
                                              		tmp = b * (-0.6666666666666666 / a);
                                              	} else {
                                              		tmp = -0.5 * (c / b);
                                              	}
                                              	return tmp;
                                              }
                                              
                                              def code(a, b, c):
                                              	tmp = 0
                                              	if b <= 4.5e-294:
                                              		tmp = b * (-0.6666666666666666 / a)
                                              	else:
                                              		tmp = -0.5 * (c / b)
                                              	return tmp
                                              
                                              function code(a, b, c)
                                              	tmp = 0.0
                                              	if (b <= 4.5e-294)
                                              		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 <= 4.5e-294)
                                              		tmp = b * (-0.6666666666666666 / a);
                                              	else
                                              		tmp = -0.5 * (c / b);
                                              	end
                                              	tmp_2 = tmp;
                                              end
                                              
                                              code[a_, b_, c_] := If[LessEqual[b, 4.5e-294], N[(b * N[(-0.6666666666666666 / a), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(c / b), $MachinePrecision]), $MachinePrecision]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              \mathbf{if}\;b \leq 4.5 \cdot 10^{-294}:\\
                                              \;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;-0.5 \cdot \frac{c}{b}\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 2 regimes
                                              2. if b < 4.49999999999999981e-294

                                                1. Initial program 70.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. sqr-neg70.1%

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

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

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

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

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

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

                                                  \[\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. Step-by-step derivation
                                                  1. add-sqr-sqrt69.7%

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

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

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

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

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

                                                    \[\leadsto \frac{\left(-b\right) + {\left({\left({b}^{2} - \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)}}\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
                                                  7. add-cube-cbrt69.9%

                                                    \[\leadsto \frac{\left(-b\right) + {\left({\left({b}^{2} - \color{blue}{3 \cdot \left(a \cdot c\right)}\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
                                                  8. associate-*r*70.0%

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

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

                                                    \[\leadsto \frac{\left(-b\right) + {\left({\left({b}^{2} - c \cdot \color{blue}{\left(a \cdot 3\right)}\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{3 \cdot a} \]
                                                  11. metadata-eval70.0%

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

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

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

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

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

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

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

                                                if 4.49999999999999981e-294 < b

                                                1. Initial program 32.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. Simplified32.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.7%

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

                                                Alternative 11: 35.5% 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 52.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. Simplified52.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 31.2%

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

                                                  Alternative 12: 10.8% 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 52.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. Simplified52.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 9.9%

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

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

                                                    Reproduce

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