Cubic critical

Percentage Accurate: 51.3% → 84.8%
Time: 10.6s
Alternatives: 14
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 14 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.3% 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: 84.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.35 \cdot 10^{+67}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\

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

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


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

    1. Initial program 46.8%

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

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(2 \cdot \frac{b}{a}\right)}, -3\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot b}{a}\right), -3\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot b\right), a\right), -3\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(b \cdot 2\right), a\right), -3\right) \]
      4. *-lowering-*.f6496.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, 2\right), a\right), -3\right) \]
    6. Simplified96.8%

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

    if -2.35000000000000009e67 < b < 1.2799999999999999e-73

    1. Initial program 90.2%

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

    if 1.2799999999999999e-73 < b

    1. Initial program 16.2%

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

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{\frac{-1}{2} \cdot c}{\color{blue}{b}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot c\right), \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6490.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified90.4%

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

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

Alternative 2: 84.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.5 \cdot 10^{+74}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\

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

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


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

    1. Initial program 45.9%

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

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(2 \cdot \frac{b}{a}\right)}, -3\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot b}{a}\right), -3\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot b\right), a\right), -3\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(b \cdot 2\right), a\right), -3\right) \]
      4. *-lowering-*.f6496.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, 2\right), a\right), -3\right) \]
    6. Simplified96.7%

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

    if -7.5e74 < b < 2.6000000000000001e-73

    1. Initial program 90.3%

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

      \[\leadsto \color{blue}{\frac{\frac{b - \sqrt{b \cdot b + a \cdot \left(-3 \cdot c\right)}}{a}}{-3}} \]
    4. Step-by-step derivation
      1. associate-/l/N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{b - \sqrt{b \cdot b + a \cdot \left(-3 \cdot c\right)}}{-3}\right), \color{blue}{a}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(b - \sqrt{b \cdot b + a \cdot \left(-3 \cdot c\right)}\right), -3\right), a\right) \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \left(\sqrt{b \cdot b + a \cdot \left(-3 \cdot c\right)}\right)\right), -3\right), a\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(b \cdot b + a \cdot \left(-3 \cdot c\right)\right)\right)\right), -3\right), a\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(a \cdot \left(-3 \cdot c\right)\right)\right)\right)\right), -3\right), a\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(-3 \cdot c\right)\right)\right)\right)\right), -3\right), a\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\left(-3 \cdot c\right) \cdot a\right)\right)\right)\right), -3\right), a\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(-3 \cdot \left(c \cdot a\right)\right)\right)\right)\right), -3\right), a\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(-3 \cdot \left(a \cdot c\right)\right)\right)\right)\right), -3\right), a\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(-3, \left(a \cdot c\right)\right)\right)\right)\right), -3\right), a\right) \]
      13. *-lowering-*.f6490.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(-3, \mathsf{*.f64}\left(a, c\right)\right)\right)\right)\right), -3\right), a\right) \]
    5. Applied egg-rr90.3%

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

    if 2.6000000000000001e-73 < b

    1. Initial program 16.2%

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

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{\frac{-1}{2} \cdot c}{\color{blue}{b}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot c\right), \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6490.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified90.4%

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

Alternative 3: 84.9% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.2 \cdot 10^{+89}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\

\mathbf{elif}\;b \leq 4 \cdot 10^{-76}:\\
\;\;\;\;\frac{b - \sqrt{b \cdot b + -3 \cdot \left(a \cdot c\right)}}{a} \cdot -0.3333333333333333\\

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


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

    1. Initial program 43.0%

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

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(2 \cdot \frac{b}{a}\right)}, -3\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot b}{a}\right), -3\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot b\right), a\right), -3\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(b \cdot 2\right), a\right), -3\right) \]
      4. *-lowering-*.f6496.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, 2\right), a\right), -3\right) \]
    6. Simplified96.5%

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

    if -4.19999999999999972e89 < b < 3.99999999999999971e-76

    1. Initial program 90.5%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{b - \sqrt{b \cdot b + a \cdot \left(-3 \cdot c\right)}}{a}\right), \color{blue}{\left(\frac{1}{-3}\right)}\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(b - \sqrt{b \cdot b + a \cdot \left(-3 \cdot c\right)}\right), a\right), \left(\frac{\color{blue}{1}}{-3}\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \left(\sqrt{b \cdot b + a \cdot \left(-3 \cdot c\right)}\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(b \cdot b + a \cdot \left(-3 \cdot c\right)\right)\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\left(b \cdot b\right), \left(a \cdot \left(-3 \cdot c\right)\right)\right)\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(a \cdot \left(-3 \cdot c\right)\right)\right)\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(\left(-3 \cdot c\right) \cdot a\right)\right)\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      9. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(-3 \cdot \left(c \cdot a\right)\right)\right)\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \left(-3 \cdot \left(a \cdot c\right)\right)\right)\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(-3, \left(a \cdot c\right)\right)\right)\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(-3, \mathsf{*.f64}\left(a, c\right)\right)\right)\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      13. metadata-eval90.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(b, b\right), \mathsf{*.f64}\left(-3, \mathsf{*.f64}\left(a, c\right)\right)\right)\right)\right), a\right), \frac{-1}{3}\right) \]
    5. Applied egg-rr90.2%

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

    if 3.99999999999999971e-76 < b

    1. Initial program 16.2%

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

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{\frac{-1}{2} \cdot c}{\color{blue}{b}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot c\right), \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6490.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified90.4%

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

Alternative 4: 80.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.8 \cdot 10^{-44}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -6.80000000000000033e-44

    1. Initial program 60.2%

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

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(2 \cdot \frac{b}{a}\right)}, -3\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot b}{a}\right), -3\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot b\right), a\right), -3\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(b \cdot 2\right), a\right), -3\right) \]
      4. *-lowering-*.f6490.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, 2\right), a\right), -3\right) \]
    6. Simplified90.5%

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

    if -6.80000000000000033e-44 < b < 1.39999999999999994e-74

    1. Initial program 87.7%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right)}\right)\right), \mathsf{*.f64}\left(3, a\right)\right) \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\left(\left(a \cdot c\right) \cdot -3\right)\right)\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\left(a \cdot \left(c \cdot -3\right)\right)\right)\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\left(a \cdot \left(-3 \cdot c\right)\right)\right)\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(a, \left(-3 \cdot c\right)\right)\right)\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(a, \left(c \cdot -3\right)\right)\right)\right), \mathsf{*.f64}\left(3, a\right)\right) \]
      6. *-lowering-*.f6484.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(b\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(a, \mathsf{*.f64}\left(c, -3\right)\right)\right)\right), \mathsf{*.f64}\left(3, a\right)\right) \]
    5. Simplified84.5%

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

    if 1.39999999999999994e-74 < b

    1. Initial program 16.2%

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

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{\frac{-1}{2} \cdot c}{\color{blue}{b}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot c\right), \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6490.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified90.4%

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

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

Alternative 5: 80.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-44}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -5.00000000000000039e-44

    1. Initial program 60.2%

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

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(2 \cdot \frac{b}{a}\right)}, -3\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot b}{a}\right), -3\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot b\right), a\right), -3\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(b \cdot 2\right), a\right), -3\right) \]
      4. *-lowering-*.f6490.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, 2\right), a\right), -3\right) \]
    6. Simplified90.5%

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

    if -5.00000000000000039e-44 < b < 5.8000000000000001e-79

    1. Initial program 87.7%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right)}\right)\right), a\right), -3\right) \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(\left(a \cdot c\right) \cdot -3\right)\right)\right), a\right), -3\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(\left(c \cdot a\right) \cdot -3\right)\right)\right), a\right), -3\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(c \cdot \left(a \cdot -3\right)\right)\right)\right), a\right), -3\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(c \cdot \left(-3 \cdot a\right)\right)\right)\right), a\right), -3\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(-3 \cdot a\right)\right)\right)\right), a\right), -3\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(a \cdot -3\right)\right)\right)\right), a\right), -3\right) \]
      7. *-lowering-*.f6484.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), a\right), -3\right) \]
    6. Simplified84.4%

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

    if 5.8000000000000001e-79 < b

    1. Initial program 16.2%

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

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{\frac{-1}{2} \cdot c}{\color{blue}{b}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot c\right), \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6490.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified90.4%

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

Alternative 6: 80.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.7 \cdot 10^{-44}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -3.7e-44

    1. Initial program 60.2%

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

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(2 \cdot \frac{b}{a}\right)}, -3\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot b}{a}\right), -3\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot b\right), a\right), -3\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(b \cdot 2\right), a\right), -3\right) \]
      4. *-lowering-*.f6490.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, 2\right), a\right), -3\right) \]
    6. Simplified90.5%

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

    if -3.7e-44 < b < 1.26000000000000001e-73

    1. Initial program 87.7%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right)}\right)\right), a\right), -3\right) \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(\left(a \cdot c\right) \cdot -3\right)\right)\right), a\right), -3\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(\left(c \cdot a\right) \cdot -3\right)\right)\right), a\right), -3\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(c \cdot \left(a \cdot -3\right)\right)\right)\right), a\right), -3\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(c \cdot \left(-3 \cdot a\right)\right)\right)\right), a\right), -3\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(-3 \cdot a\right)\right)\right)\right), a\right), -3\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(a \cdot -3\right)\right)\right)\right), a\right), -3\right) \]
      7. *-lowering-*.f6484.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), a\right), -3\right) \]
    6. Simplified84.4%

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

        \[\leadsto \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{\color{blue}{a \cdot -3}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right), \color{blue}{\left(a \cdot -3\right)}\right) \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \left(\sqrt{c \cdot \left(a \cdot -3\right)}\right)\right), \left(\color{blue}{a} \cdot -3\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \left(\sqrt{\left(c \cdot a\right) \cdot -3}\right)\right), \left(a \cdot -3\right)\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \left(\sqrt{\left(a \cdot c\right) \cdot -3}\right)\right), \left(a \cdot -3\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \left(\sqrt{-3 \cdot \left(a \cdot c\right)}\right)\right), \left(a \cdot -3\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(-3 \cdot \left(a \cdot c\right)\right)\right)\right), \left(a \cdot -3\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-3, \left(a \cdot c\right)\right)\right)\right), \left(a \cdot -3\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-3, \mathsf{*.f64}\left(a, c\right)\right)\right)\right), \left(a \cdot -3\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-3, \mathsf{*.f64}\left(a, c\right)\right)\right)\right), \left(-3 \cdot \color{blue}{a}\right)\right) \]
      11. *-lowering-*.f6484.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-3, \mathsf{*.f64}\left(a, c\right)\right)\right)\right), \mathsf{*.f64}\left(-3, \color{blue}{a}\right)\right) \]
    8. Applied egg-rr84.4%

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

    if 1.26000000000000001e-73 < b

    1. Initial program 16.2%

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

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{\frac{-1}{2} \cdot c}{\color{blue}{b}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot c\right), \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6490.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified90.4%

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

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

Alternative 7: 80.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.8 \cdot 10^{-43}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.7999999999999999e-43

    1. Initial program 60.2%

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

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(2 \cdot \frac{b}{a}\right)}, -3\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot b}{a}\right), -3\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot b\right), a\right), -3\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(b \cdot 2\right), a\right), -3\right) \]
      4. *-lowering-*.f6490.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, 2\right), a\right), -3\right) \]
    6. Simplified90.5%

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

    if -1.7999999999999999e-43 < b < 1.2799999999999999e-73

    1. Initial program 87.7%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right)}\right)\right), a\right), -3\right) \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(\left(a \cdot c\right) \cdot -3\right)\right)\right), a\right), -3\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(\left(c \cdot a\right) \cdot -3\right)\right)\right), a\right), -3\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(c \cdot \left(a \cdot -3\right)\right)\right)\right), a\right), -3\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(c \cdot \left(-3 \cdot a\right)\right)\right)\right), a\right), -3\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(-3 \cdot a\right)\right)\right)\right), a\right), -3\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(a \cdot -3\right)\right)\right)\right), a\right), -3\right) \]
      7. *-lowering-*.f6484.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), a\right), -3\right) \]
    6. Simplified84.4%

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

        \[\leadsto \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{a} \cdot \color{blue}{\frac{1}{-3}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{a}\right), \color{blue}{\left(\frac{1}{-3}\right)}\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right), a\right), \left(\frac{\color{blue}{1}}{-3}\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \left(\sqrt{c \cdot \left(a \cdot -3\right)}\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \left(\sqrt{\left(c \cdot a\right) \cdot -3}\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \left(\sqrt{\left(a \cdot c\right) \cdot -3}\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \left(\sqrt{-3 \cdot \left(a \cdot c\right)}\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      8. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(-3 \cdot \left(a \cdot c\right)\right)\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-3, \left(a \cdot c\right)\right)\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-3, \mathsf{*.f64}\left(a, c\right)\right)\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      11. metadata-eval84.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-3, \mathsf{*.f64}\left(a, c\right)\right)\right)\right), a\right), \frac{-1}{3}\right) \]
    8. Applied egg-rr84.2%

      \[\leadsto \color{blue}{\frac{b - \sqrt{-3 \cdot \left(a \cdot c\right)}}{a} \cdot -0.3333333333333333} \]
    9. Step-by-step derivation
      1. associate-*l/N/A

        \[\leadsto \frac{\left(b - \sqrt{-3 \cdot \left(a \cdot c\right)}\right) \cdot \frac{-1}{3}}{\color{blue}{a}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(b - \sqrt{-3 \cdot \left(a \cdot c\right)}\right) \cdot \frac{-1}{3}\right), \color{blue}{a}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(b - \sqrt{-3 \cdot \left(a \cdot c\right)}\right), \frac{-1}{3}\right), a\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \left(\sqrt{-3 \cdot \left(a \cdot c\right)}\right)\right), \frac{-1}{3}\right), a\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(-3 \cdot \left(a \cdot c\right)\right)\right)\right), \frac{-1}{3}\right), a\right) \]
      6. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(\left(-3 \cdot a\right) \cdot c\right)\right)\right), \frac{-1}{3}\right), a\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(c \cdot \left(-3 \cdot a\right)\right)\right)\right), \frac{-1}{3}\right), a\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(-3 \cdot a\right)\right)\right)\right), \frac{-1}{3}\right), a\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(a \cdot -3\right)\right)\right)\right), \frac{-1}{3}\right), a\right) \]
      10. *-lowering-*.f6484.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), \frac{-1}{3}\right), a\right) \]
    10. Applied egg-rr84.4%

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

    if 1.2799999999999999e-73 < b

    1. Initial program 16.2%

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

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{\frac{-1}{2} \cdot c}{\color{blue}{b}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot c\right), \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6490.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified90.4%

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

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

Alternative 8: 80.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.6 \cdot 10^{-44}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -6.60000000000000011e-44

    1. Initial program 60.2%

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

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(2 \cdot \frac{b}{a}\right)}, -3\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot b}{a}\right), -3\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot b\right), a\right), -3\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(b \cdot 2\right), a\right), -3\right) \]
      4. *-lowering-*.f6490.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, 2\right), a\right), -3\right) \]
    6. Simplified90.5%

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

    if -6.60000000000000011e-44 < b < 3.05000000000000021e-75

    1. Initial program 87.7%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right)}\right)\right), a\right), -3\right) \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(\left(a \cdot c\right) \cdot -3\right)\right)\right), a\right), -3\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(\left(c \cdot a\right) \cdot -3\right)\right)\right), a\right), -3\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(c \cdot \left(a \cdot -3\right)\right)\right)\right), a\right), -3\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(c \cdot \left(-3 \cdot a\right)\right)\right)\right), a\right), -3\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(-3 \cdot a\right)\right)\right)\right), a\right), -3\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(a \cdot -3\right)\right)\right)\right), a\right), -3\right) \]
      7. *-lowering-*.f6484.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), a\right), -3\right) \]
    6. Simplified84.4%

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

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

        \[\leadsto \frac{1}{-3} \cdot \color{blue}{\frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{a}} \]
      3. clear-numN/A

        \[\leadsto \frac{1}{-3} \cdot \frac{1}{\color{blue}{\frac{a}{b - \sqrt{c \cdot \left(a \cdot -3\right)}}}} \]
      4. div-invN/A

        \[\leadsto \frac{\frac{1}{-3}}{\color{blue}{\frac{a}{b - \sqrt{c \cdot \left(a \cdot -3\right)}}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{1}{-3}\right), \color{blue}{\left(\frac{a}{b - \sqrt{c \cdot \left(a \cdot -3\right)}}\right)}\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\frac{-1}{3}, \left(\frac{\color{blue}{a}}{b - \sqrt{c \cdot \left(a \cdot -3\right)}}\right)\right) \]
      7. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(a, \color{blue}{\left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right)}\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(a, \mathsf{\_.f64}\left(b, \color{blue}{\left(\sqrt{c \cdot \left(a \cdot -3\right)}\right)}\right)\right)\right) \]
      9. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(a, \mathsf{\_.f64}\left(b, \left(\sqrt{\left(c \cdot a\right) \cdot -3}\right)\right)\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(a, \mathsf{\_.f64}\left(b, \left(\sqrt{\left(a \cdot c\right) \cdot -3}\right)\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(a, \mathsf{\_.f64}\left(b, \left(\sqrt{-3 \cdot \left(a \cdot c\right)}\right)\right)\right)\right) \]
      12. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(a, \mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(-3 \cdot \left(a \cdot c\right)\right)\right)\right)\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(a, \mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-3, \left(a \cdot c\right)\right)\right)\right)\right)\right) \]
      14. *-lowering-*.f6484.3%

        \[\leadsto \mathsf{/.f64}\left(\frac{-1}{3}, \mathsf{/.f64}\left(a, \mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-3, \mathsf{*.f64}\left(a, c\right)\right)\right)\right)\right)\right) \]
    8. Applied egg-rr84.3%

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

    if 3.05000000000000021e-75 < b

    1. Initial program 16.2%

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

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{\frac{-1}{2} \cdot c}{\color{blue}{b}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot c\right), \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6490.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified90.4%

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

Alternative 9: 80.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.15 \cdot 10^{-43}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.1499999999999999e-43

    1. Initial program 60.2%

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

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(2 \cdot \frac{b}{a}\right)}, -3\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot b}{a}\right), -3\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot b\right), a\right), -3\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(b \cdot 2\right), a\right), -3\right) \]
      4. *-lowering-*.f6490.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, 2\right), a\right), -3\right) \]
    6. Simplified90.5%

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

    if -1.1499999999999999e-43 < b < 2.6000000000000001e-73

    1. Initial program 87.7%

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\color{blue}{\left(-3 \cdot \left(a \cdot c\right)\right)}\right)\right), a\right), -3\right) \]
    5. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(\left(a \cdot c\right) \cdot -3\right)\right)\right), a\right), -3\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(\left(c \cdot a\right) \cdot -3\right)\right)\right), a\right), -3\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(c \cdot \left(a \cdot -3\right)\right)\right)\right), a\right), -3\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(c \cdot \left(-3 \cdot a\right)\right)\right)\right), a\right), -3\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(-3 \cdot a\right)\right)\right)\right), a\right), -3\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \left(a \cdot -3\right)\right)\right)\right), a\right), -3\right) \]
      7. *-lowering-*.f6484.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(c, \mathsf{*.f64}\left(a, -3\right)\right)\right)\right), a\right), -3\right) \]
    6. Simplified84.4%

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

        \[\leadsto \frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{a} \cdot \color{blue}{\frac{1}{-3}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{b - \sqrt{c \cdot \left(a \cdot -3\right)}}{a}\right), \color{blue}{\left(\frac{1}{-3}\right)}\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\left(b - \sqrt{c \cdot \left(a \cdot -3\right)}\right), a\right), \left(\frac{\color{blue}{1}}{-3}\right)\right) \]
      4. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \left(\sqrt{c \cdot \left(a \cdot -3\right)}\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      5. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \left(\sqrt{\left(c \cdot a\right) \cdot -3}\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \left(\sqrt{\left(a \cdot c\right) \cdot -3}\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \left(\sqrt{-3 \cdot \left(a \cdot c\right)}\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      8. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\left(-3 \cdot \left(a \cdot c\right)\right)\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-3, \left(a \cdot c\right)\right)\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-3, \mathsf{*.f64}\left(a, c\right)\right)\right)\right), a\right), \left(\frac{1}{-3}\right)\right) \]
      11. metadata-eval84.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(b, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-3, \mathsf{*.f64}\left(a, c\right)\right)\right)\right), a\right), \frac{-1}{3}\right) \]
    8. Applied egg-rr84.2%

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

    if 2.6000000000000001e-73 < b

    1. Initial program 16.2%

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

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{\frac{-1}{2} \cdot c}{\color{blue}{b}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot c\right), \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6490.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified90.4%

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

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

Alternative 10: 67.9% accurate, 9.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 1.7 \cdot 10^{-299}:\\ \;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b 1.7e-299) (/ (/ (* b 2.0) a) -3.0) (/ (* c -0.5) b)))
double code(double a, double b, double c) {
	double tmp;
	if (b <= 1.7e-299) {
		tmp = ((b * 2.0) / a) / -3.0;
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= 1.7d-299) then
        tmp = ((b * 2.0d0) / a) / (-3.0d0)
    else
        tmp = (c * (-0.5d0)) / b
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= 1.7e-299) {
		tmp = ((b * 2.0) / a) / -3.0;
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= 1.7e-299:
		tmp = ((b * 2.0) / a) / -3.0
	else:
		tmp = (c * -0.5) / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= 1.7e-299)
		tmp = Float64(Float64(Float64(b * 2.0) / a) / -3.0);
	else
		tmp = Float64(Float64(c * -0.5) / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= 1.7e-299)
		tmp = ((b * 2.0) / a) / -3.0;
	else
		tmp = (c * -0.5) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, 1.7e-299], N[(N[(N[(b * 2.0), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.7 \cdot 10^{-299}:\\
\;\;\;\;\frac{\frac{b \cdot 2}{a}}{-3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.6999999999999999e-299

    1. Initial program 71.6%

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

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(2 \cdot \frac{b}{a}\right)}, -3\right) \]
    5. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{2 \cdot b}{a}\right), -3\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(2 \cdot b\right), a\right), -3\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(b \cdot 2\right), a\right), -3\right) \]
      4. *-lowering-*.f6463.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(b, 2\right), a\right), -3\right) \]
    6. Simplified63.1%

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

    if 1.6999999999999999e-299 < b

    1. Initial program 33.1%

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

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{\frac{-1}{2} \cdot c}{\color{blue}{b}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot c\right), \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6470.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified70.5%

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

Alternative 11: 67.9% accurate, 11.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.55 \cdot 10^{-299}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.55e-299

    1. Initial program 71.6%

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

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

        \[\leadsto \frac{b}{a} \cdot \color{blue}{\frac{-2}{3}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{b}{a}\right), \color{blue}{\frac{-2}{3}}\right) \]
      3. /-lowering-/.f6463.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(b, a\right), \frac{-2}{3}\right) \]
    5. Simplified63.0%

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

    if 1.55e-299 < b

    1. Initial program 33.1%

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

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{\frac{-1}{2} \cdot c}{\color{blue}{b}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot c\right), \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6470.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified70.5%

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

Alternative 12: 67.8% accurate, 11.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.4 \cdot 10^{-299}:\\
\;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.4000000000000001e-299

    1. Initial program 71.6%

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

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

        \[\leadsto \frac{b}{a} \cdot \color{blue}{\frac{-2}{3}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{b}{a}\right), \color{blue}{\frac{-2}{3}}\right) \]
      3. /-lowering-/.f6463.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(b, a\right), \frac{-2}{3}\right) \]
    5. Simplified63.0%

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

    if 1.4000000000000001e-299 < b

    1. Initial program 33.1%

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

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{\frac{-1}{2} \cdot c}{\color{blue}{b}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot c\right), \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6470.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified70.5%

      \[\leadsto \color{blue}{\frac{c \cdot -0.5}{b}} \]
    6. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto c \cdot \color{blue}{\frac{\frac{-1}{2}}{b}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\frac{-1}{2}}{b} \cdot \color{blue}{c} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{-1}{2}}{b}\right), \color{blue}{c}\right) \]
      4. /-lowering-/.f6470.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, b\right), c\right) \]
    7. Applied egg-rr70.3%

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

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

Alternative 13: 67.8% accurate, 11.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.55 \cdot 10^{-299}:\\
\;\;\;\;b \cdot \frac{-0.6666666666666666}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < 1.55e-299

    1. Initial program 71.6%

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

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

        \[\leadsto \frac{b}{a} \cdot \color{blue}{\frac{-2}{3}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{b}{a}\right), \color{blue}{\frac{-2}{3}}\right) \]
      3. /-lowering-/.f6463.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(b, a\right), \frac{-2}{3}\right) \]
    5. Simplified63.0%

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

        \[\leadsto \frac{b \cdot \frac{-2}{3}}{\color{blue}{a}} \]
      2. associate-/l*N/A

        \[\leadsto b \cdot \color{blue}{\frac{\frac{-2}{3}}{a}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{\frac{-2}{3}}{a}\right)}\right) \]
      4. /-lowering-/.f6462.9%

        \[\leadsto \mathsf{*.f64}\left(b, \mathsf{/.f64}\left(\frac{-2}{3}, \color{blue}{a}\right)\right) \]
    7. Applied egg-rr62.9%

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

    if 1.55e-299 < b

    1. Initial program 33.1%

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

      \[\leadsto \color{blue}{\frac{-1}{2} \cdot \frac{c}{b}} \]
    4. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \frac{\frac{-1}{2} \cdot c}{\color{blue}{b}} \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot c\right), \color{blue}{b}\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\left(c \cdot \frac{-1}{2}\right), b\right) \]
      4. *-lowering-*.f6470.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c, \frac{-1}{2}\right), b\right) \]
    5. Simplified70.5%

      \[\leadsto \color{blue}{\frac{c \cdot -0.5}{b}} \]
    6. Step-by-step derivation
      1. associate-/l*N/A

        \[\leadsto c \cdot \color{blue}{\frac{\frac{-1}{2}}{b}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{\frac{-1}{2}}{b} \cdot \color{blue}{c} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{\frac{-1}{2}}{b}\right), \color{blue}{c}\right) \]
      4. /-lowering-/.f6470.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\frac{-1}{2}, b\right), c\right) \]
    7. Applied egg-rr70.3%

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

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

Alternative 14: 35.1% accurate, 23.2× speedup?

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

\\
b \cdot \frac{-0.6666666666666666}{a}
\end{array}
Derivation
  1. Initial program 51.3%

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

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

      \[\leadsto \frac{b}{a} \cdot \color{blue}{\frac{-2}{3}} \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\frac{b}{a}\right), \color{blue}{\frac{-2}{3}}\right) \]
    3. /-lowering-/.f6431.2%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(b, a\right), \frac{-2}{3}\right) \]
  5. Simplified31.2%

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

      \[\leadsto \frac{b \cdot \frac{-2}{3}}{\color{blue}{a}} \]
    2. associate-/l*N/A

      \[\leadsto b \cdot \color{blue}{\frac{\frac{-2}{3}}{a}} \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(b, \color{blue}{\left(\frac{\frac{-2}{3}}{a}\right)}\right) \]
    4. /-lowering-/.f6431.2%

      \[\leadsto \mathsf{*.f64}\left(b, \mathsf{/.f64}\left(\frac{-2}{3}, \color{blue}{a}\right)\right) \]
  7. Applied egg-rr31.2%

    \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
  8. Add Preprocessing

Reproduce

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