Cubic critical

Percentage Accurate: 53.0% → 84.7%
Time: 9.4s
Alternatives: 14
Speedup: 2.2×

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: 53.0% 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.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -3.1 \cdot 10^{+169}:\\ \;\;\;\;\frac{b}{a \cdot -1.5}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-29}:\\ \;\;\;\;\frac{\frac{b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}}{a}}{-3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -3.1e+169)
   (/ b (* a -1.5))
   (if (<= b 1.25e-29)
     (/ (/ (- b (sqrt (fma b b (* a (* c -3.0))))) a) -3.0)
     (* (/ c b) -0.5))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -3.1e+169) {
		tmp = b / (a * -1.5);
	} else if (b <= 1.25e-29) {
		tmp = ((b - sqrt(fma(b, b, (a * (c * -3.0))))) / a) / -3.0;
	} else {
		tmp = (c / b) * -0.5;
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= -3.1e+169)
		tmp = Float64(b / Float64(a * -1.5));
	elseif (b <= 1.25e-29)
		tmp = Float64(Float64(Float64(b - sqrt(fma(b, b, Float64(a * Float64(c * -3.0))))) / a) / -3.0);
	else
		tmp = Float64(Float64(c / b) * -0.5);
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -3.1e+169], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.25e-29], N[(N[(N[(b - N[Sqrt[N[(b * b + N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.1 \cdot 10^{+169}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\

\mathbf{elif}\;b \leq 1.25 \cdot 10^{-29}:\\
\;\;\;\;\frac{\frac{b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}}{a}}{-3}\\

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


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

    1. Initial program 51.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{-2}{3} \cdot \frac{b}{a}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      3. lower-/.f6499.7

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

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

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

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

        \[\leadsto \color{blue}{b \cdot \frac{\frac{-2}{3}}{a}} \]
      4. lower-/.f6499.7

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

      \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto b \cdot \color{blue}{\frac{1}{\frac{a}{\frac{-2}{3}}}} \]
      2. un-div-invN/A

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

        \[\leadsto \color{blue}{\frac{b}{\frac{a}{\frac{-2}{3}}}} \]
      4. div-invN/A

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

        \[\leadsto \frac{b}{\color{blue}{a \cdot \frac{1}{\frac{-2}{3}}}} \]
      6. metadata-eval99.9

        \[\leadsto \frac{b}{a \cdot \color{blue}{-1.5}} \]
    9. Applied egg-rr99.9%

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

    if -3.1e169 < b < 1.24999999999999996e-29

    1. Initial program 83.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-rr83.9%

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

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

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

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

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

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

    if 1.24999999999999996e-29 < b

    1. Initial program 13.4%

      \[\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. *-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{c}{b} \cdot \frac{-1}{2}} \]
      3. lower-/.f6490.5

        \[\leadsto \color{blue}{\frac{c}{b}} \cdot -0.5 \]
    5. Simplified90.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.1 \cdot 10^{+169}:\\ \;\;\;\;\frac{b}{a \cdot -1.5}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-29}:\\ \;\;\;\;\frac{\frac{b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}}{a}}{-3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 84.8% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -3.1 \cdot 10^{+169}:\\ \;\;\;\;\frac{b}{a \cdot -1.5}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-29}:\\ \;\;\;\;\frac{\frac{b - \sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}{a}}{-3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -3.1e+169)
   (/ b (* a -1.5))
   (if (<= b 1.25e-29)
     (/ (/ (- b (sqrt (fma b b (* -3.0 (* a c))))) a) -3.0)
     (* (/ c b) -0.5))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -3.1e+169) {
		tmp = b / (a * -1.5);
	} else if (b <= 1.25e-29) {
		tmp = ((b - sqrt(fma(b, b, (-3.0 * (a * c))))) / a) / -3.0;
	} else {
		tmp = (c / b) * -0.5;
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= -3.1e+169)
		tmp = Float64(b / Float64(a * -1.5));
	elseif (b <= 1.25e-29)
		tmp = Float64(Float64(Float64(b - sqrt(fma(b, b, Float64(-3.0 * Float64(a * c))))) / a) / -3.0);
	else
		tmp = Float64(Float64(c / b) * -0.5);
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -3.1e+169], N[(b / N[(a * -1.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.25e-29], N[(N[(N[(b - N[Sqrt[N[(b * b + N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] / -3.0), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.1 \cdot 10^{+169}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\

\mathbf{elif}\;b \leq 1.25 \cdot 10^{-29}:\\
\;\;\;\;\frac{\frac{b - \sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}{a}}{-3}\\

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


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

    1. Initial program 51.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{-2}{3} \cdot \frac{b}{a}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      3. lower-/.f6499.7

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

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

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

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

        \[\leadsto \color{blue}{b \cdot \frac{\frac{-2}{3}}{a}} \]
      4. lower-/.f6499.7

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

      \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto b \cdot \color{blue}{\frac{1}{\frac{a}{\frac{-2}{3}}}} \]
      2. un-div-invN/A

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

        \[\leadsto \color{blue}{\frac{b}{\frac{a}{\frac{-2}{3}}}} \]
      4. div-invN/A

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

        \[\leadsto \frac{b}{\color{blue}{a \cdot \frac{1}{\frac{-2}{3}}}} \]
      6. metadata-eval99.9

        \[\leadsto \frac{b}{a \cdot \color{blue}{-1.5}} \]
    9. Applied egg-rr99.9%

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

    if -3.1e169 < b < 1.24999999999999996e-29

    1. Initial program 83.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-rr83.9%

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

    if 1.24999999999999996e-29 < b

    1. Initial program 13.4%

      \[\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. *-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{c}{b} \cdot \frac{-1}{2}} \]
      3. lower-/.f6490.5

        \[\leadsto \color{blue}{\frac{c}{b}} \cdot -0.5 \]
    5. Simplified90.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.1 \cdot 10^{+169}:\\ \;\;\;\;\frac{b}{a \cdot -1.5}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-29}:\\ \;\;\;\;\frac{\frac{b - \sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}}{a}}{-3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 85.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.5 \cdot 10^{+47}:\\
\;\;\;\;\frac{\frac{b}{a}}{-1.5}\\

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

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


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

    1. Initial program 71.0%

      \[\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 \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      3. lower-/.f6498.5

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

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

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

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

        \[\leadsto \color{blue}{b \cdot \frac{\frac{-2}{3}}{a}} \]
      4. lower-/.f6498.4

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

      \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{\frac{-2}{3}}{a}} \cdot b \]
      4. clear-numN/A

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

        \[\leadsto \color{blue}{\frac{1 \cdot b}{\frac{a}{\frac{-2}{3}}}} \]
      6. div-invN/A

        \[\leadsto \frac{1 \cdot b}{\color{blue}{a \cdot \frac{1}{\frac{-2}{3}}}} \]
      7. times-fracN/A

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

        \[\leadsto \color{blue}{\frac{1}{a} \cdot \frac{b}{\frac{1}{\frac{-2}{3}}}} \]
      9. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{1}{a}} \cdot \frac{b}{\frac{1}{\frac{-2}{3}}} \]
      10. lower-/.f64N/A

        \[\leadsto \frac{1}{a} \cdot \color{blue}{\frac{b}{\frac{1}{\frac{-2}{3}}}} \]
      11. metadata-eval98.4

        \[\leadsto \frac{1}{a} \cdot \frac{b}{\color{blue}{-1.5}} \]
    9. Applied egg-rr98.4%

      \[\leadsto \color{blue}{\frac{1}{a} \cdot \frac{b}{-1.5}} \]
    10. Step-by-step derivation
      1. lift-/.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{a} \cdot b}{\frac{-3}{2}}} \]
      4. lift-/.f64N/A

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

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot b}{a}}}{\frac{-3}{2}} \]
      6. *-lft-identityN/A

        \[\leadsto \frac{\frac{\color{blue}{b}}{a}}{\frac{-3}{2}} \]
      7. lower-/.f6498.7

        \[\leadsto \frac{\color{blue}{\frac{b}{a}}}{-1.5} \]
    11. Applied egg-rr98.7%

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

    if -4.49999999999999979e47 < b < 1.24999999999999996e-29

    1. Initial program 79.7%

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

    if 1.24999999999999996e-29 < b

    1. Initial program 13.4%

      \[\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. *-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{c}{b} \cdot \frac{-1}{2}} \]
      3. lower-/.f6490.5

        \[\leadsto \color{blue}{\frac{c}{b}} \cdot -0.5 \]
    5. Simplified90.5%

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

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

Alternative 4: 85.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -4.5 \cdot 10^{+47}:\\ \;\;\;\;\frac{\frac{b}{a}}{-1.5}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -4.5e+47)
   (/ (/ b a) -1.5)
   (if (<= b 1.25e-29)
     (/ (- (sqrt (fma b b (* a (* c -3.0)))) b) (* a 3.0))
     (* (/ c b) -0.5))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -4.5e+47) {
		tmp = (b / a) / -1.5;
	} else if (b <= 1.25e-29) {
		tmp = (sqrt(fma(b, b, (a * (c * -3.0)))) - b) / (a * 3.0);
	} else {
		tmp = (c / b) * -0.5;
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= -4.5e+47)
		tmp = Float64(Float64(b / a) / -1.5);
	elseif (b <= 1.25e-29)
		tmp = Float64(Float64(sqrt(fma(b, b, Float64(a * Float64(c * -3.0)))) - b) / Float64(a * 3.0));
	else
		tmp = Float64(Float64(c / b) * -0.5);
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -4.5e+47], N[(N[(b / a), $MachinePrecision] / -1.5), $MachinePrecision], If[LessEqual[b, 1.25e-29], N[(N[(N[Sqrt[N[(b * b + N[(a * N[(c * -3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.5 \cdot 10^{+47}:\\
\;\;\;\;\frac{\frac{b}{a}}{-1.5}\\

\mathbf{elif}\;b \leq 1.25 \cdot 10^{-29}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{a \cdot 3}\\

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


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

    1. Initial program 71.0%

      \[\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 \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      3. lower-/.f6498.5

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

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

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

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

        \[\leadsto \color{blue}{b \cdot \frac{\frac{-2}{3}}{a}} \]
      4. lower-/.f6498.4

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

      \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{\frac{-2}{3}}{a}} \cdot b \]
      4. clear-numN/A

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

        \[\leadsto \color{blue}{\frac{1 \cdot b}{\frac{a}{\frac{-2}{3}}}} \]
      6. div-invN/A

        \[\leadsto \frac{1 \cdot b}{\color{blue}{a \cdot \frac{1}{\frac{-2}{3}}}} \]
      7. times-fracN/A

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

        \[\leadsto \color{blue}{\frac{1}{a} \cdot \frac{b}{\frac{1}{\frac{-2}{3}}}} \]
      9. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{1}{a}} \cdot \frac{b}{\frac{1}{\frac{-2}{3}}} \]
      10. lower-/.f64N/A

        \[\leadsto \frac{1}{a} \cdot \color{blue}{\frac{b}{\frac{1}{\frac{-2}{3}}}} \]
      11. metadata-eval98.4

        \[\leadsto \frac{1}{a} \cdot \frac{b}{\color{blue}{-1.5}} \]
    9. Applied egg-rr98.4%

      \[\leadsto \color{blue}{\frac{1}{a} \cdot \frac{b}{-1.5}} \]
    10. Step-by-step derivation
      1. lift-/.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{a} \cdot b}{\frac{-3}{2}}} \]
      4. lift-/.f64N/A

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

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot b}{a}}}{\frac{-3}{2}} \]
      6. *-lft-identityN/A

        \[\leadsto \frac{\frac{\color{blue}{b}}{a}}{\frac{-3}{2}} \]
      7. lower-/.f6498.7

        \[\leadsto \frac{\color{blue}{\frac{b}{a}}}{-1.5} \]
    11. Applied egg-rr98.7%

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

    if -4.49999999999999979e47 < b < 1.24999999999999996e-29

    1. Initial program 79.7%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-neg.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}}{3 \cdot a} \]
      9. unsub-negN/A

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\mathsf{fma}\left(b, b, \color{blue}{\left(c \cdot -3\right)} \cdot a\right)} - b}{3 \cdot a} \]
    6. Applied egg-rr79.7%

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

    if 1.24999999999999996e-29 < b

    1. Initial program 13.4%

      \[\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. *-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{c}{b} \cdot \frac{-1}{2}} \]
      3. lower-/.f6490.5

        \[\leadsto \color{blue}{\frac{c}{b}} \cdot -0.5 \]
    5. Simplified90.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.5 \cdot 10^{+47}:\\ \;\;\;\;\frac{\frac{b}{a}}{-1.5}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 85.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -4.5 \cdot 10^{+47}:\\ \;\;\;\;\frac{\frac{b}{a}}{-1.5}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -4.5e+47)
   (/ (/ b a) -1.5)
   (if (<= b 1.25e-29)
     (/ (- (sqrt (fma b b (* -3.0 (* a c)))) b) (* a 3.0))
     (* (/ c b) -0.5))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -4.5e+47) {
		tmp = (b / a) / -1.5;
	} else if (b <= 1.25e-29) {
		tmp = (sqrt(fma(b, b, (-3.0 * (a * c)))) - b) / (a * 3.0);
	} else {
		tmp = (c / b) * -0.5;
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= -4.5e+47)
		tmp = Float64(Float64(b / a) / -1.5);
	elseif (b <= 1.25e-29)
		tmp = Float64(Float64(sqrt(fma(b, b, Float64(-3.0 * Float64(a * c)))) - b) / Float64(a * 3.0));
	else
		tmp = Float64(Float64(c / b) * -0.5);
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -4.5e+47], N[(N[(b / a), $MachinePrecision] / -1.5), $MachinePrecision], If[LessEqual[b, 1.25e-29], N[(N[(N[Sqrt[N[(b * b + N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.5 \cdot 10^{+47}:\\
\;\;\;\;\frac{\frac{b}{a}}{-1.5}\\

\mathbf{elif}\;b \leq 1.25 \cdot 10^{-29}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)} - b}{a \cdot 3}\\

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


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

    1. Initial program 71.0%

      \[\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 \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      3. lower-/.f6498.5

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

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

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

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

        \[\leadsto \color{blue}{b \cdot \frac{\frac{-2}{3}}{a}} \]
      4. lower-/.f6498.4

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

      \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{\frac{-2}{3}}{a}} \cdot b \]
      4. clear-numN/A

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

        \[\leadsto \color{blue}{\frac{1 \cdot b}{\frac{a}{\frac{-2}{3}}}} \]
      6. div-invN/A

        \[\leadsto \frac{1 \cdot b}{\color{blue}{a \cdot \frac{1}{\frac{-2}{3}}}} \]
      7. times-fracN/A

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

        \[\leadsto \color{blue}{\frac{1}{a} \cdot \frac{b}{\frac{1}{\frac{-2}{3}}}} \]
      9. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{1}{a}} \cdot \frac{b}{\frac{1}{\frac{-2}{3}}} \]
      10. lower-/.f64N/A

        \[\leadsto \frac{1}{a} \cdot \color{blue}{\frac{b}{\frac{1}{\frac{-2}{3}}}} \]
      11. metadata-eval98.4

        \[\leadsto \frac{1}{a} \cdot \frac{b}{\color{blue}{-1.5}} \]
    9. Applied egg-rr98.4%

      \[\leadsto \color{blue}{\frac{1}{a} \cdot \frac{b}{-1.5}} \]
    10. Step-by-step derivation
      1. lift-/.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{a} \cdot b}{\frac{-3}{2}}} \]
      4. lift-/.f64N/A

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

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot b}{a}}}{\frac{-3}{2}} \]
      6. *-lft-identityN/A

        \[\leadsto \frac{\frac{\color{blue}{b}}{a}}{\frac{-3}{2}} \]
      7. lower-/.f6498.7

        \[\leadsto \frac{\color{blue}{\frac{b}{a}}}{-1.5} \]
    11. Applied egg-rr98.7%

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

    if -4.49999999999999979e47 < b < 1.24999999999999996e-29

    1. Initial program 79.7%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-neg.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}}{3 \cdot a} \]
      9. unsub-negN/A

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

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

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

    if 1.24999999999999996e-29 < b

    1. Initial program 13.4%

      \[\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. *-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{c}{b} \cdot \frac{-1}{2}} \]
      3. lower-/.f6490.5

        \[\leadsto \color{blue}{\frac{c}{b}} \cdot -0.5 \]
    5. Simplified90.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.5 \cdot 10^{+47}:\\ \;\;\;\;\frac{\frac{b}{a}}{-1.5}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 85.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -4.5 \cdot 10^{+47}:\\ \;\;\;\;\frac{\frac{b}{a}}{-1.5}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-29}:\\ \;\;\;\;\frac{\left(\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)} - b\right) \cdot 0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -4.5e+47)
   (/ (/ b a) -1.5)
   (if (<= b 1.25e-29)
     (/ (* (- (sqrt (fma c (* a -3.0) (* b b))) b) 0.3333333333333333) a)
     (* (/ c b) -0.5))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -4.5e+47) {
		tmp = (b / a) / -1.5;
	} else if (b <= 1.25e-29) {
		tmp = ((sqrt(fma(c, (a * -3.0), (b * b))) - b) * 0.3333333333333333) / a;
	} else {
		tmp = (c / b) * -0.5;
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= -4.5e+47)
		tmp = Float64(Float64(b / a) / -1.5);
	elseif (b <= 1.25e-29)
		tmp = Float64(Float64(Float64(sqrt(fma(c, Float64(a * -3.0), Float64(b * b))) - b) * 0.3333333333333333) / a);
	else
		tmp = Float64(Float64(c / b) * -0.5);
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -4.5e+47], N[(N[(b / a), $MachinePrecision] / -1.5), $MachinePrecision], If[LessEqual[b, 1.25e-29], N[(N[(N[(N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] / a), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.5 \cdot 10^{+47}:\\
\;\;\;\;\frac{\frac{b}{a}}{-1.5}\\

\mathbf{elif}\;b \leq 1.25 \cdot 10^{-29}:\\
\;\;\;\;\frac{\left(\sqrt{\mathsf{fma}\left(c, a \cdot -3, b \cdot b\right)} - b\right) \cdot 0.3333333333333333}{a}\\

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


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

    1. Initial program 71.0%

      \[\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 \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      3. lower-/.f6498.5

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

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

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

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

        \[\leadsto \color{blue}{b \cdot \frac{\frac{-2}{3}}{a}} \]
      4. lower-/.f6498.4

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

      \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{\frac{-2}{3}}{a}} \cdot b \]
      4. clear-numN/A

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

        \[\leadsto \color{blue}{\frac{1 \cdot b}{\frac{a}{\frac{-2}{3}}}} \]
      6. div-invN/A

        \[\leadsto \frac{1 \cdot b}{\color{blue}{a \cdot \frac{1}{\frac{-2}{3}}}} \]
      7. times-fracN/A

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

        \[\leadsto \color{blue}{\frac{1}{a} \cdot \frac{b}{\frac{1}{\frac{-2}{3}}}} \]
      9. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{1}{a}} \cdot \frac{b}{\frac{1}{\frac{-2}{3}}} \]
      10. lower-/.f64N/A

        \[\leadsto \frac{1}{a} \cdot \color{blue}{\frac{b}{\frac{1}{\frac{-2}{3}}}} \]
      11. metadata-eval98.4

        \[\leadsto \frac{1}{a} \cdot \frac{b}{\color{blue}{-1.5}} \]
    9. Applied egg-rr98.4%

      \[\leadsto \color{blue}{\frac{1}{a} \cdot \frac{b}{-1.5}} \]
    10. Step-by-step derivation
      1. lift-/.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{a} \cdot b}{\frac{-3}{2}}} \]
      4. lift-/.f64N/A

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

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot b}{a}}}{\frac{-3}{2}} \]
      6. *-lft-identityN/A

        \[\leadsto \frac{\frac{\color{blue}{b}}{a}}{\frac{-3}{2}} \]
      7. lower-/.f6498.7

        \[\leadsto \frac{\color{blue}{\frac{b}{a}}}{-1.5} \]
    11. Applied egg-rr98.7%

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

    if -4.49999999999999979e47 < b < 1.24999999999999996e-29

    1. Initial program 79.7%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-neg.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}}{3 \cdot a} \]
      9. unsub-negN/A

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

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

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

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

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

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

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

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

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

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

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

    if 1.24999999999999996e-29 < b

    1. Initial program 13.4%

      \[\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. *-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{c}{b} \cdot \frac{-1}{2}} \]
      3. lower-/.f6490.5

        \[\leadsto \color{blue}{\frac{c}{b}} \cdot -0.5 \]
    5. Simplified90.5%

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

Alternative 7: 85.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -4.4 \cdot 10^{+47}:\\ \;\;\;\;\frac{\frac{b}{a}}{-1.5}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-29}:\\ \;\;\;\;\left(b - \sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}\right) \cdot \frac{-0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -4.4e+47)
   (/ (/ b a) -1.5)
   (if (<= b 1.25e-29)
     (* (- b (sqrt (fma b b (* -3.0 (* a c))))) (/ -0.3333333333333333 a))
     (* (/ c b) -0.5))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -4.4e+47) {
		tmp = (b / a) / -1.5;
	} else if (b <= 1.25e-29) {
		tmp = (b - sqrt(fma(b, b, (-3.0 * (a * c))))) * (-0.3333333333333333 / a);
	} else {
		tmp = (c / b) * -0.5;
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= -4.4e+47)
		tmp = Float64(Float64(b / a) / -1.5);
	elseif (b <= 1.25e-29)
		tmp = Float64(Float64(b - sqrt(fma(b, b, Float64(-3.0 * Float64(a * c))))) * Float64(-0.3333333333333333 / a));
	else
		tmp = Float64(Float64(c / b) * -0.5);
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -4.4e+47], N[(N[(b / a), $MachinePrecision] / -1.5), $MachinePrecision], If[LessEqual[b, 1.25e-29], N[(N[(b - N[Sqrt[N[(b * b + N[(-3.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / a), $MachinePrecision]), $MachinePrecision], N[(N[(c / b), $MachinePrecision] * -0.5), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.4 \cdot 10^{+47}:\\
\;\;\;\;\frac{\frac{b}{a}}{-1.5}\\

\mathbf{elif}\;b \leq 1.25 \cdot 10^{-29}:\\
\;\;\;\;\left(b - \sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}\right) \cdot \frac{-0.3333333333333333}{a}\\

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


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

    1. Initial program 71.0%

      \[\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 \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      3. lower-/.f6498.5

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

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

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

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

        \[\leadsto \color{blue}{b \cdot \frac{\frac{-2}{3}}{a}} \]
      4. lower-/.f6498.4

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

      \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
    8. Step-by-step derivation
      1. lift-/.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{\frac{-2}{3}}{a}} \cdot b \]
      4. clear-numN/A

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

        \[\leadsto \color{blue}{\frac{1 \cdot b}{\frac{a}{\frac{-2}{3}}}} \]
      6. div-invN/A

        \[\leadsto \frac{1 \cdot b}{\color{blue}{a \cdot \frac{1}{\frac{-2}{3}}}} \]
      7. times-fracN/A

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

        \[\leadsto \color{blue}{\frac{1}{a} \cdot \frac{b}{\frac{1}{\frac{-2}{3}}}} \]
      9. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{1}{a}} \cdot \frac{b}{\frac{1}{\frac{-2}{3}}} \]
      10. lower-/.f64N/A

        \[\leadsto \frac{1}{a} \cdot \color{blue}{\frac{b}{\frac{1}{\frac{-2}{3}}}} \]
      11. metadata-eval98.4

        \[\leadsto \frac{1}{a} \cdot \frac{b}{\color{blue}{-1.5}} \]
    9. Applied egg-rr98.4%

      \[\leadsto \color{blue}{\frac{1}{a} \cdot \frac{b}{-1.5}} \]
    10. Step-by-step derivation
      1. lift-/.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{\frac{1}{a} \cdot b}{\frac{-3}{2}}} \]
      4. lift-/.f64N/A

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

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot b}{a}}}{\frac{-3}{2}} \]
      6. *-lft-identityN/A

        \[\leadsto \frac{\frac{\color{blue}{b}}{a}}{\frac{-3}{2}} \]
      7. lower-/.f6498.7

        \[\leadsto \frac{\color{blue}{\frac{b}{a}}}{-1.5} \]
    11. Applied egg-rr98.7%

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

    if -4.3999999999999999e47 < b < 1.24999999999999996e-29

    1. Initial program 79.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-rr79.6%

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

    if 1.24999999999999996e-29 < b

    1. Initial program 13.4%

      \[\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. *-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{c}{b} \cdot \frac{-1}{2}} \]
      3. lower-/.f6490.5

        \[\leadsto \color{blue}{\frac{c}{b}} \cdot -0.5 \]
    5. Simplified90.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.4 \cdot 10^{+47}:\\ \;\;\;\;\frac{\frac{b}{a}}{-1.5}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-29}:\\ \;\;\;\;\left(b - \sqrt{\mathsf{fma}\left(b, b, -3 \cdot \left(a \cdot c\right)\right)}\right) \cdot \frac{-0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 80.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -6 \cdot 10^{-115}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\

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

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


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

    1. Initial program 78.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{-2}{3} \cdot \frac{b}{a}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      3. lower-/.f6488.7

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

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

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

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

        \[\leadsto \color{blue}{b \cdot \frac{\frac{-2}{3}}{a}} \]
      4. lower-/.f6488.6

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

      \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto b \cdot \color{blue}{\frac{1}{\frac{a}{\frac{-2}{3}}}} \]
      2. un-div-invN/A

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

        \[\leadsto \color{blue}{\frac{b}{\frac{a}{\frac{-2}{3}}}} \]
      4. div-invN/A

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

        \[\leadsto \frac{b}{\color{blue}{a \cdot \frac{1}{\frac{-2}{3}}}} \]
      6. metadata-eval88.8

        \[\leadsto \frac{b}{a \cdot \color{blue}{-1.5}} \]
    9. Applied egg-rr88.8%

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

    if -6.0000000000000003e-115 < b < 7.99999999999999939e-65

    1. Initial program 76.6%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-neg.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}}{3 \cdot a} \]
      9. unsub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.99999999999999939e-65 < b

    1. Initial program 17.8%

      \[\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. *-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{c}{b} \cdot \frac{-1}{2}} \]
      3. lower-/.f6485.4

        \[\leadsto \color{blue}{\frac{c}{b}} \cdot -0.5 \]
    5. Simplified85.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -6 \cdot 10^{-115}:\\ \;\;\;\;\frac{b}{a \cdot -1.5}\\ \mathbf{elif}\;b \leq 8 \cdot 10^{-65}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{b} \cdot -0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 80.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -6 \cdot 10^{-115}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\

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

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


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

    1. Initial program 78.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{-2}{3} \cdot \frac{b}{a}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      3. lower-/.f6488.7

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

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

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

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

        \[\leadsto \color{blue}{b \cdot \frac{\frac{-2}{3}}{a}} \]
      4. lower-/.f6488.6

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

      \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto b \cdot \color{blue}{\frac{1}{\frac{a}{\frac{-2}{3}}}} \]
      2. un-div-invN/A

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

        \[\leadsto \color{blue}{\frac{b}{\frac{a}{\frac{-2}{3}}}} \]
      4. div-invN/A

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

        \[\leadsto \frac{b}{\color{blue}{a \cdot \frac{1}{\frac{-2}{3}}}} \]
      6. metadata-eval88.8

        \[\leadsto \frac{b}{a \cdot \color{blue}{-1.5}} \]
    9. Applied egg-rr88.8%

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

    if -6.0000000000000003e-115 < b < 7.99999999999999939e-65

    1. Initial program 76.6%

      \[\frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-neg.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c} + \color{blue}{\left(\mathsf{neg}\left(b\right)\right)}}{3 \cdot a} \]
      9. unsub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{-1}{-3}}{a}} \cdot \left(\sqrt{\left(a \cdot c\right) \cdot -3} - b\right) \]
      14. metadata-eval72.4

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

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

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

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

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

        \[\leadsto \frac{\frac{1}{3}}{a} \cdot \left(\sqrt{c \cdot \color{blue}{\left(a \cdot -3\right)}} - b\right) \]
      20. lower-*.f6472.3

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

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

    if 7.99999999999999939e-65 < b

    1. Initial program 17.8%

      \[\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. *-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{c}{b} \cdot \frac{-1}{2}} \]
      3. lower-/.f6485.4

        \[\leadsto \color{blue}{\frac{c}{b}} \cdot -0.5 \]
    5. Simplified85.4%

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

Alternative 10: 67.1% accurate, 2.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2 \cdot 10^{-311}:\\
\;\;\;\;\frac{b}{a \cdot -1.5}\\

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


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

    1. Initial program 79.0%

      \[\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 \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      3. lower-/.f6472.6

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

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

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

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

        \[\leadsto \color{blue}{b \cdot \frac{\frac{-2}{3}}{a}} \]
      4. lower-/.f6472.5

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

      \[\leadsto \color{blue}{b \cdot \frac{-0.6666666666666666}{a}} \]
    8. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto b \cdot \color{blue}{\frac{1}{\frac{a}{\frac{-2}{3}}}} \]
      2. un-div-invN/A

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

        \[\leadsto \color{blue}{\frac{b}{\frac{a}{\frac{-2}{3}}}} \]
      4. div-invN/A

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

        \[\leadsto \frac{b}{\color{blue}{a \cdot \frac{1}{\frac{-2}{3}}}} \]
      6. metadata-eval72.7

        \[\leadsto \frac{b}{a \cdot \color{blue}{-1.5}} \]
    9. Applied egg-rr72.7%

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

    if -1.9999999999999e-311 < b

    1. Initial program 32.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. *-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{c}{b} \cdot \frac{-1}{2}} \]
      3. lower-/.f6467.0

        \[\leadsto \color{blue}{\frac{c}{b}} \cdot -0.5 \]
    5. Simplified67.0%

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

Alternative 11: 67.1% accurate, 2.2× speedup?

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

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

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


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

    1. Initial program 79.0%

      \[\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 \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      3. lower-/.f6472.6

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

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

    if -1.9999999999999e-311 < b

    1. Initial program 32.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. *-commutativeN/A

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

        \[\leadsto \color{blue}{\frac{c}{b} \cdot \frac{-1}{2}} \]
      3. lower-/.f6467.0

        \[\leadsto \color{blue}{\frac{c}{b}} \cdot -0.5 \]
    5. Simplified67.0%

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

Alternative 12: 43.2% accurate, 2.2× speedup?

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

    1. Initial program 74.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 \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      3. lower-/.f6455.2

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

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

    if 8600 < b

    1. Initial program 12.8%

      \[\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}{-1 \cdot \left(b \cdot \left(\frac{-1}{2} \cdot \frac{c}{{b}^{2}} + \frac{2}{3} \cdot \frac{1}{a}\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\frac{-1}{2} \cdot \frac{c}{{b}^{2}} + \frac{2}{3} \cdot \frac{1}{a}\right) \cdot b}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot \frac{c}{{b}^{2}} + \frac{2}{3} \cdot \frac{1}{a}\right) \cdot \left(\mathsf{neg}\left(b\right)\right)} \]
      4. lower-*.f64N/A

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

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

        \[\leadsto \left(\frac{\color{blue}{c \cdot \frac{-1}{2}}}{{b}^{2}} + \frac{2}{3} \cdot \frac{1}{a}\right) \cdot \left(\mathsf{neg}\left(b\right)\right) \]
      7. associate-/l*N/A

        \[\leadsto \left(\color{blue}{c \cdot \frac{\frac{-1}{2}}{{b}^{2}}} + \frac{2}{3} \cdot \frac{1}{a}\right) \cdot \left(\mathsf{neg}\left(b\right)\right) \]
      8. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(c, \frac{\frac{-1}{2}}{{b}^{2}}, \frac{2}{3} \cdot \frac{1}{a}\right)} \cdot \left(\mathsf{neg}\left(b\right)\right) \]
      9. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(c, \color{blue}{\frac{\frac{-1}{2}}{{b}^{2}}}, \frac{2}{3} \cdot \frac{1}{a}\right) \cdot \left(\mathsf{neg}\left(b\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{fma}\left(c, \frac{\frac{-1}{2}}{\color{blue}{b \cdot b}}, \frac{2}{3} \cdot \frac{1}{a}\right) \cdot \left(\mathsf{neg}\left(b\right)\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, \frac{\frac{-1}{2}}{\color{blue}{b \cdot b}}, \frac{2}{3} \cdot \frac{1}{a}\right) \cdot \left(\mathsf{neg}\left(b\right)\right) \]
      12. associate-*r/N/A

        \[\leadsto \mathsf{fma}\left(c, \frac{\frac{-1}{2}}{b \cdot b}, \color{blue}{\frac{\frac{2}{3} \cdot 1}{a}}\right) \cdot \left(\mathsf{neg}\left(b\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(c, \frac{\frac{-1}{2}}{b \cdot b}, \frac{\color{blue}{\frac{2}{3}}}{a}\right) \cdot \left(\mathsf{neg}\left(b\right)\right) \]
      14. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(c, \frac{\frac{-1}{2}}{b \cdot b}, \color{blue}{\frac{\frac{2}{3}}{a}}\right) \cdot \left(\mathsf{neg}\left(b\right)\right) \]
      15. lower-neg.f642.1

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

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

      \[\leadsto \color{blue}{c \cdot \left(\frac{-2}{3} \cdot \frac{b}{a \cdot c} + \frac{1}{2} \cdot \frac{1}{b}\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

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

        \[\leadsto c \cdot \color{blue}{\mathsf{fma}\left(\frac{b}{a \cdot c}, \frac{-2}{3}, \frac{1}{2} \cdot \frac{1}{b}\right)} \]
      4. lower-/.f64N/A

        \[\leadsto c \cdot \mathsf{fma}\left(\color{blue}{\frac{b}{a \cdot c}}, \frac{-2}{3}, \frac{1}{2} \cdot \frac{1}{b}\right) \]
      5. lower-*.f64N/A

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

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

        \[\leadsto c \cdot \mathsf{fma}\left(\frac{b}{a \cdot c}, \frac{-2}{3}, \frac{\color{blue}{\frac{1}{2}}}{b}\right) \]
      8. lower-/.f642.0

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

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

      \[\leadsto c \cdot \color{blue}{\frac{\frac{1}{2}}{b}} \]
    10. Step-by-step derivation
      1. lower-/.f6430.3

        \[\leadsto c \cdot \color{blue}{\frac{0.5}{b}} \]
    11. Simplified30.3%

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

Alternative 13: 43.2% accurate, 2.2× speedup?

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

    1. Initial program 74.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 \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
      3. lower-/.f6455.2

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

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

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

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

        \[\leadsto \color{blue}{b \cdot \frac{\frac{-2}{3}}{a}} \]
      4. lower-/.f6455.2

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

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

    if 8600 < b

    1. Initial program 12.8%

      \[\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}{-1 \cdot \left(b \cdot \left(\frac{-1}{2} \cdot \frac{c}{{b}^{2}} + \frac{2}{3} \cdot \frac{1}{a}\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\left(\frac{-1}{2} \cdot \frac{c}{{b}^{2}} + \frac{2}{3} \cdot \frac{1}{a}\right) \cdot b}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \color{blue}{\left(\frac{-1}{2} \cdot \frac{c}{{b}^{2}} + \frac{2}{3} \cdot \frac{1}{a}\right) \cdot \left(\mathsf{neg}\left(b\right)\right)} \]
      4. lower-*.f64N/A

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

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

        \[\leadsto \left(\frac{\color{blue}{c \cdot \frac{-1}{2}}}{{b}^{2}} + \frac{2}{3} \cdot \frac{1}{a}\right) \cdot \left(\mathsf{neg}\left(b\right)\right) \]
      7. associate-/l*N/A

        \[\leadsto \left(\color{blue}{c \cdot \frac{\frac{-1}{2}}{{b}^{2}}} + \frac{2}{3} \cdot \frac{1}{a}\right) \cdot \left(\mathsf{neg}\left(b\right)\right) \]
      8. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(c, \frac{\frac{-1}{2}}{{b}^{2}}, \frac{2}{3} \cdot \frac{1}{a}\right)} \cdot \left(\mathsf{neg}\left(b\right)\right) \]
      9. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(c, \color{blue}{\frac{\frac{-1}{2}}{{b}^{2}}}, \frac{2}{3} \cdot \frac{1}{a}\right) \cdot \left(\mathsf{neg}\left(b\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{fma}\left(c, \frac{\frac{-1}{2}}{\color{blue}{b \cdot b}}, \frac{2}{3} \cdot \frac{1}{a}\right) \cdot \left(\mathsf{neg}\left(b\right)\right) \]
      11. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(c, \frac{\frac{-1}{2}}{\color{blue}{b \cdot b}}, \frac{2}{3} \cdot \frac{1}{a}\right) \cdot \left(\mathsf{neg}\left(b\right)\right) \]
      12. associate-*r/N/A

        \[\leadsto \mathsf{fma}\left(c, \frac{\frac{-1}{2}}{b \cdot b}, \color{blue}{\frac{\frac{2}{3} \cdot 1}{a}}\right) \cdot \left(\mathsf{neg}\left(b\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{fma}\left(c, \frac{\frac{-1}{2}}{b \cdot b}, \frac{\color{blue}{\frac{2}{3}}}{a}\right) \cdot \left(\mathsf{neg}\left(b\right)\right) \]
      14. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(c, \frac{\frac{-1}{2}}{b \cdot b}, \color{blue}{\frac{\frac{2}{3}}{a}}\right) \cdot \left(\mathsf{neg}\left(b\right)\right) \]
      15. lower-neg.f642.1

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

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

      \[\leadsto \color{blue}{c \cdot \left(\frac{-2}{3} \cdot \frac{b}{a \cdot c} + \frac{1}{2} \cdot \frac{1}{b}\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

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

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

        \[\leadsto c \cdot \color{blue}{\mathsf{fma}\left(\frac{b}{a \cdot c}, \frac{-2}{3}, \frac{1}{2} \cdot \frac{1}{b}\right)} \]
      4. lower-/.f64N/A

        \[\leadsto c \cdot \mathsf{fma}\left(\color{blue}{\frac{b}{a \cdot c}}, \frac{-2}{3}, \frac{1}{2} \cdot \frac{1}{b}\right) \]
      5. lower-*.f64N/A

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

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

        \[\leadsto c \cdot \mathsf{fma}\left(\frac{b}{a \cdot c}, \frac{-2}{3}, \frac{\color{blue}{\frac{1}{2}}}{b}\right) \]
      8. lower-/.f642.0

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

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

      \[\leadsto c \cdot \color{blue}{\frac{\frac{1}{2}}{b}} \]
    10. Step-by-step derivation
      1. lower-/.f6430.3

        \[\leadsto c \cdot \color{blue}{\frac{0.5}{b}} \]
    11. Simplified30.3%

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

Alternative 14: 35.3% accurate, 2.9× 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 58.0%

    \[\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 \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
    2. lower-*.f64N/A

      \[\leadsto \color{blue}{\frac{b}{a} \cdot \frac{-2}{3}} \]
    3. lower-/.f6441.1

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

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

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

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

      \[\leadsto \color{blue}{b \cdot \frac{\frac{-2}{3}}{a}} \]
    4. lower-/.f6441.1

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

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

Reproduce

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