Cubic critical

Percentage Accurate: 51.8% → 85.5%
Time: 12.6s
Alternatives: 10
Speedup: 11.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 51.8% accurate, 1.0× speedup?

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

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

Alternative 1: 85.5% accurate, 0.9× speedup?

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

\mathbf{elif}\;b \leq 9.5 \cdot 10^{-59}:\\
\;\;\;\;\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 < -1e152

    1. Initial program 48.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. Simplified48.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 96.9%

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

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

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

      if -1e152 < b < 9.4999999999999994e-59

      1. Initial program 87.1%

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

      if 9.4999999999999994e-59 < b

      1. Initial program 18.0%

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

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

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

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

      Alternative 2: 85.5% accurate, 0.9× speedup?

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

        1. Initial program 48.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. Simplified48.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 96.9%

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

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

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

          if -5.00000000000000009e150 < b < 2.1500000000000002e-61

          1. Initial program 87.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-neg87.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-neg87.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*87.0%

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

          if 2.1500000000000002e-61 < b

          1. Initial program 18.0%

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

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

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{+150}:\\ \;\;\;\;\frac{b \cdot -2}{3 \cdot a}\\ \mathbf{elif}\;b \leq 2.15 \cdot 10^{-61}:\\ \;\;\;\;\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: 80.6% accurate, 1.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -2.2 \cdot 10^{-41}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5\\ \mathbf{elif}\;b \leq 1.05 \cdot 10^{-66}:\\ \;\;\;\;\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 -2.2e-41)
             (+ (* -0.6666666666666666 (/ b a)) (* (/ c b) 0.5))
             (if (<= b 1.05e-66)
               (/ (- (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 <= -2.2e-41) {
          		tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
          	} else if (b <= 1.05e-66) {
          		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 <= (-2.2d-41)) then
                  tmp = ((-0.6666666666666666d0) * (b / a)) + ((c / b) * 0.5d0)
              else if (b <= 1.05d-66) 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 <= -2.2e-41) {
          		tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
          	} else if (b <= 1.05e-66) {
          		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 <= -2.2e-41:
          		tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5)
          	elif b <= 1.05e-66:
          		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 <= -2.2e-41)
          		tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(Float64(c / b) * 0.5));
          	elseif (b <= 1.05e-66)
          		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 <= -2.2e-41)
          		tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
          	elseif (b <= 1.05e-66)
          		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, -2.2e-41], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.05e-66], 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 -2.2 \cdot 10^{-41}:\\
          \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5\\
          
          \mathbf{elif}\;b \leq 1.05 \cdot 10^{-66}:\\
          \;\;\;\;\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 < -2.2e-41

            1. Initial program 74.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. Simplified74.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 87.9%

                \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-0.5 \cdot \frac{c}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right)\right)} \]
              4. Step-by-step derivation
                1. mul-1-neg87.9%

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

                  \[\leadsto -\color{blue}{\left(-0.5 \cdot \frac{c}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right) \cdot b} \]
                3. distribute-rgt-neg-in87.9%

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

                  \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, 0.6666666666666666 \cdot \frac{1}{a}\right)} \cdot \left(-b\right) \]
                5. associate-*r/88.0%

                  \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \color{blue}{\frac{0.6666666666666666 \cdot 1}{a}}\right) \cdot \left(-b\right) \]
                6. metadata-eval88.0%

                  \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{\color{blue}{0.6666666666666666}}{a}\right) \cdot \left(-b\right) \]
              5. Simplified88.0%

                \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{0.6666666666666666}{a}\right) \cdot \left(-b\right)} \]
              6. Taylor expanded in c around 0 88.1%

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

              if -2.2e-41 < b < 1.05e-66

              1. Initial program 84.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. Simplified84.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 0 77.5%

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

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

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

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

                if 1.05e-66 < b

                1. Initial program 18.0%

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

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.2 \cdot 10^{-41}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5\\ \mathbf{elif}\;b \leq 1.05 \cdot 10^{-66}:\\ \;\;\;\;\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.4% accurate, 1.0× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -8.4 \cdot 10^{-39}:\\ \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5\\ \mathbf{elif}\;b \leq 3.6 \cdot 10^{-60}:\\ \;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -3} - b}{3 \cdot a}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \end{array} \]
                (FPCore (a b c)
                 :precision binary64
                 (if (<= b -8.4e-39)
                   (+ (* -0.6666666666666666 (/ b a)) (* (/ c b) 0.5))
                   (if (<= b 3.6e-60)
                     (/ (- (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 <= -8.4e-39) {
                		tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
                	} else if (b <= 3.6e-60) {
                		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 <= (-8.4d-39)) then
                        tmp = ((-0.6666666666666666d0) * (b / a)) + ((c / b) * 0.5d0)
                    else if (b <= 3.6d-60) 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 <= -8.4e-39) {
                		tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
                	} else if (b <= 3.6e-60) {
                		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 <= -8.4e-39:
                		tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5)
                	elif b <= 3.6e-60:
                		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 <= -8.4e-39)
                		tmp = Float64(Float64(-0.6666666666666666 * Float64(b / a)) + Float64(Float64(c / b) * 0.5));
                	elseif (b <= 3.6e-60)
                		tmp = Float64(Float64(sqrt(Float64(Float64(a * 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 <= -8.4e-39)
                		tmp = (-0.6666666666666666 * (b / a)) + ((c / b) * 0.5);
                	elseif (b <= 3.6e-60)
                		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, -8.4e-39], N[(N[(-0.6666666666666666 * N[(b / a), $MachinePrecision]), $MachinePrecision] + N[(N[(c / b), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.6e-60], N[(N[(N[Sqrt[N[(N[(a * c), $MachinePrecision] * -3.0), $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 -8.4 \cdot 10^{-39}:\\
                \;\;\;\;-0.6666666666666666 \cdot \frac{b}{a} + \frac{c}{b} \cdot 0.5\\
                
                \mathbf{elif}\;b \leq 3.6 \cdot 10^{-60}:\\
                \;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -3} - 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 < -8.39999999999999973e-39

                  1. Initial program 74.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. Simplified74.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 87.9%

                      \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-0.5 \cdot \frac{c}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right)\right)} \]
                    4. Step-by-step derivation
                      1. mul-1-neg87.9%

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

                        \[\leadsto -\color{blue}{\left(-0.5 \cdot \frac{c}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right) \cdot b} \]
                      3. distribute-rgt-neg-in87.9%

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

                        \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, 0.6666666666666666 \cdot \frac{1}{a}\right)} \cdot \left(-b\right) \]
                      5. associate-*r/88.0%

                        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \color{blue}{\frac{0.6666666666666666 \cdot 1}{a}}\right) \cdot \left(-b\right) \]
                      6. metadata-eval88.0%

                        \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{\color{blue}{0.6666666666666666}}{a}\right) \cdot \left(-b\right) \]
                    5. Simplified88.0%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{0.6666666666666666}{a}\right) \cdot \left(-b\right)} \]
                    6. Taylor expanded in c around 0 88.1%

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

                    if -8.39999999999999973e-39 < b < 3.6e-60

                    1. Initial program 84.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. Simplified84.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 0 77.5%

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

                      if 3.6e-60 < b

                      1. Initial program 18.0%

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

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

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

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

                      Alternative 5: 80.5% accurate, 1.0× speedup?

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

                        1. Initial program 74.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. Simplified74.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 87.9%

                            \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-0.5 \cdot \frac{c}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right)\right)} \]
                          4. Step-by-step derivation
                            1. mul-1-neg87.9%

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

                              \[\leadsto -\color{blue}{\left(-0.5 \cdot \frac{c}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right) \cdot b} \]
                            3. distribute-rgt-neg-in87.9%

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

                              \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, 0.6666666666666666 \cdot \frac{1}{a}\right)} \cdot \left(-b\right) \]
                            5. associate-*r/88.0%

                              \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \color{blue}{\frac{0.6666666666666666 \cdot 1}{a}}\right) \cdot \left(-b\right) \]
                            6. metadata-eval88.0%

                              \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{\color{blue}{0.6666666666666666}}{a}\right) \cdot \left(-b\right) \]
                          5. Simplified88.0%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{0.6666666666666666}{a}\right) \cdot \left(-b\right)} \]
                          6. Taylor expanded in c around 0 88.1%

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

                          if -1.92000000000000002e-41 < b < 4.90000000000000002e-61

                          1. Initial program 84.5%

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

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

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

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

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

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

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

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

                              \[\leadsto \left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right) \cdot \frac{1}{a \cdot \color{blue}{\left(-3\right)}} \]
                            2. distribute-rgt-neg-in84.4%

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

                              \[\leadsto \left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right) \cdot \frac{1}{-\color{blue}{3 \cdot a}} \]
                            4. distribute-neg-frac284.4%

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

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

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

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

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

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

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

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

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

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

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

                          if 4.90000000000000002e-61 < b

                          1. Initial program 18.0%

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

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

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

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

                          Alternative 6: 80.3% accurate, 1.0× speedup?

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

                            1. Initial program 74.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. Simplified74.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 87.9%

                                \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-0.5 \cdot \frac{c}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right)\right)} \]
                              4. Step-by-step derivation
                                1. mul-1-neg87.9%

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

                                  \[\leadsto -\color{blue}{\left(-0.5 \cdot \frac{c}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right) \cdot b} \]
                                3. distribute-rgt-neg-in87.9%

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

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, 0.6666666666666666 \cdot \frac{1}{a}\right)} \cdot \left(-b\right) \]
                                5. associate-*r/88.0%

                                  \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \color{blue}{\frac{0.6666666666666666 \cdot 1}{a}}\right) \cdot \left(-b\right) \]
                                6. metadata-eval88.0%

                                  \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{\color{blue}{0.6666666666666666}}{a}\right) \cdot \left(-b\right) \]
                              5. Simplified88.0%

                                \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{0.6666666666666666}{a}\right) \cdot \left(-b\right)} \]
                              6. Taylor expanded in c around 0 88.1%

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

                              if -2.8000000000000002e-41 < b < 2.20000000000000006e-58

                              1. Initial program 84.5%

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

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

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

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

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

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

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

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

                                  \[\leadsto \left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right) \cdot \frac{1}{a \cdot \color{blue}{\left(-3\right)}} \]
                                2. distribute-rgt-neg-in84.4%

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

                                  \[\leadsto \left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right) \cdot \frac{1}{-\color{blue}{3 \cdot a}} \]
                                4. distribute-neg-frac284.4%

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

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

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

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

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

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

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

                              if 2.20000000000000006e-58 < b

                              1. Initial program 18.0%

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

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

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

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

                              Alternative 7: 67.6% accurate, 7.2× speedup?

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

                                1. Initial program 79.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. Simplified79.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 63.6%

                                    \[\leadsto \color{blue}{-1 \cdot \left(b \cdot \left(-0.5 \cdot \frac{c}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right)\right)} \]
                                  4. Step-by-step derivation
                                    1. mul-1-neg63.6%

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

                                      \[\leadsto -\color{blue}{\left(-0.5 \cdot \frac{c}{{b}^{2}} + 0.6666666666666666 \cdot \frac{1}{a}\right) \cdot b} \]
                                    3. distribute-rgt-neg-in63.6%

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

                                      \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, 0.6666666666666666 \cdot \frac{1}{a}\right)} \cdot \left(-b\right) \]
                                    5. associate-*r/63.6%

                                      \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \color{blue}{\frac{0.6666666666666666 \cdot 1}{a}}\right) \cdot \left(-b\right) \]
                                    6. metadata-eval63.6%

                                      \[\leadsto \mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{\color{blue}{0.6666666666666666}}{a}\right) \cdot \left(-b\right) \]
                                  5. Simplified63.6%

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(-0.5, \frac{c}{{b}^{2}}, \frac{0.6666666666666666}{a}\right) \cdot \left(-b\right)} \]
                                  6. Taylor expanded in c around 0 64.7%

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

                                  if -1.999999999999994e-310 < b

                                  1. Initial program 37.2%

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

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

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

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

                                  Alternative 8: 67.4% accurate, 11.6× speedup?

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

                                    1. Initial program 80.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. Simplified80.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 61.3%

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

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

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

                                      if 1.85000000000000013e-296 < b

                                      1. Initial program 34.2%

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

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

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

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

                                      Alternative 9: 67.4% accurate, 11.6× speedup?

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

                                        1. Initial program 80.8%

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

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

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

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

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

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

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

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

                                          \[\leadsto \color{blue}{\left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right) \cdot \frac{1}{a \cdot -3}} \]
                                        8. Step-by-step derivation
                                          1. rem-cube-cbrt80.2%

                                            \[\leadsto \left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right) \cdot \frac{1}{a \cdot \color{blue}{{\left(\sqrt[3]{-3}\right)}^{3}}} \]
                                          2. associate-/r*80.2%

                                            \[\leadsto \left(b - \sqrt{\mathsf{fma}\left(b, b, c \cdot \left(a \cdot -3\right)\right)}\right) \cdot \color{blue}{\frac{\frac{1}{a}}{{\left(\sqrt[3]{-3}\right)}^{3}}} \]
                                          3. rem-cube-cbrt80.7%

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

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

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

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

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

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

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

                                        if 2.75000000000000015e-297 < b

                                        1. Initial program 34.2%

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

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

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

                                        Alternative 10: 35.0% accurate, 23.2× speedup?

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

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

                                          Reproduce

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