Cubic critical

Percentage Accurate: 52.5% → 85.1%
Time: 15.0s
Alternatives: 18
Speedup: 16.4×

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 18 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: 52.5% accurate, 1.0× speedup?

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

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

Alternative 1: 85.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.2 \cdot 10^{+107}:\\
\;\;\;\;\frac{\mathsf{fma}\left(b, -2, \frac{c}{\frac{b}{a}} \cdot 1.5\right)}{a \cdot 3}\\

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

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


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

    1. Initial program 44.2%

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

      \[\leadsto \frac{\color{blue}{1.5 \cdot \frac{c \cdot a}{b} + -2 \cdot b}}{3 \cdot a} \]
    3. Step-by-step derivation
      1. +-commutative95.5%

        \[\leadsto \frac{\color{blue}{-2 \cdot b + 1.5 \cdot \frac{c \cdot a}{b}}}{3 \cdot a} \]
      2. *-commutative95.5%

        \[\leadsto \frac{\color{blue}{b \cdot -2} + 1.5 \cdot \frac{c \cdot a}{b}}{3 \cdot a} \]
      3. fma-def95.5%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(b, -2, 1.5 \cdot \frac{c \cdot a}{b}\right)}}{3 \cdot a} \]
      4. *-commutative95.5%

        \[\leadsto \frac{\mathsf{fma}\left(b, -2, \color{blue}{\frac{c \cdot a}{b} \cdot 1.5}\right)}{3 \cdot a} \]
      5. associate-/l*97.7%

        \[\leadsto \frac{\mathsf{fma}\left(b, -2, \color{blue}{\frac{c}{\frac{b}{a}}} \cdot 1.5\right)}{3 \cdot a} \]
    4. Simplified97.7%

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

    if -7.1999999999999995e107 < b < 5.9999999999999997e-144

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.9999999999999997e-144 < b

    1. Initial program 16.4%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/80.6%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    4. Applied egg-rr80.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7.2 \cdot 10^{+107}:\\ \;\;\;\;\frac{\mathsf{fma}\left(b, -2, \frac{c}{\frac{b}{a}} \cdot 1.5\right)}{a \cdot 3}\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-144}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(c \cdot a\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 2: 85.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.3 \cdot 10^{+107}:\\
\;\;\;\;\frac{\mathsf{fma}\left(b, -2, \frac{c}{\frac{b}{a}} \cdot 1.5\right)}{a \cdot 3}\\

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

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


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

    1. Initial program 44.2%

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

      \[\leadsto \frac{\color{blue}{1.5 \cdot \frac{c \cdot a}{b} + -2 \cdot b}}{3 \cdot a} \]
    3. Step-by-step derivation
      1. +-commutative95.5%

        \[\leadsto \frac{\color{blue}{-2 \cdot b + 1.5 \cdot \frac{c \cdot a}{b}}}{3 \cdot a} \]
      2. *-commutative95.5%

        \[\leadsto \frac{\color{blue}{b \cdot -2} + 1.5 \cdot \frac{c \cdot a}{b}}{3 \cdot a} \]
      3. fma-def95.5%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(b, -2, 1.5 \cdot \frac{c \cdot a}{b}\right)}}{3 \cdot a} \]
      4. *-commutative95.5%

        \[\leadsto \frac{\mathsf{fma}\left(b, -2, \color{blue}{\frac{c \cdot a}{b} \cdot 1.5}\right)}{3 \cdot a} \]
      5. associate-/l*97.7%

        \[\leadsto \frac{\mathsf{fma}\left(b, -2, \color{blue}{\frac{c}{\frac{b}{a}}} \cdot 1.5\right)}{3 \cdot a} \]
    4. Simplified97.7%

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

    if -2.3e107 < b < 7.3000000000000003e-144

    1. Initial program 86.9%

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

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

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

        \[\leadsto \color{blue}{\frac{\left(\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) \cdot \left(--1\right)}{3 \cdot a}} \]
      4. associate-*r/87.0%

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

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

        \[\leadsto \color{blue}{\frac{\left(--1\right) \cdot \left(\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}{3 \cdot a}} \]
      7. associate-*r/86.9%

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

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

        \[\leadsto \color{blue}{\frac{-1}{-1}} \cdot \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \]
      10. times-frac86.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot \left(\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}{-1 \cdot \left(3 \cdot a\right)}} \]
      11. neg-mul-186.9%

        \[\leadsto \frac{-1 \cdot \left(\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right)}{\color{blue}{-3 \cdot a}} \]
      12. distribute-rgt-neg-in86.9%

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

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

        \[\leadsto \color{blue}{-0.3333333333333333} \cdot \frac{\left(-b\right) + \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{-a} \]
      15. neg-mul-186.8%

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

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

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

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

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

        \[\leadsto \left(\sqrt{b \cdot b + \color{blue}{\left(-3\right)} \cdot \left(a \cdot c\right)} - b\right) \cdot \frac{0.3333333333333333}{a} \]
      5. cancel-sign-sub-inv86.9%

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

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

    if 7.3000000000000003e-144 < b

    1. Initial program 16.4%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/80.6%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    4. Applied egg-rr80.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.3 \cdot 10^{+107}:\\ \;\;\;\;\frac{\mathsf{fma}\left(b, -2, \frac{c}{\frac{b}{a}} \cdot 1.5\right)}{a \cdot 3}\\ \mathbf{elif}\;b \leq 7.3 \cdot 10^{-144}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{b \cdot b - 3 \cdot \left(c \cdot a\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 3: 85.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.5 \cdot 10^{+107}:\\
\;\;\;\;\frac{\mathsf{fma}\left(b, -2, \frac{c}{\frac{b}{a}} \cdot 1.5\right)}{a \cdot 3}\\

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

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


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

    1. Initial program 44.2%

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

      \[\leadsto \frac{\color{blue}{1.5 \cdot \frac{c \cdot a}{b} + -2 \cdot b}}{3 \cdot a} \]
    3. Step-by-step derivation
      1. +-commutative95.5%

        \[\leadsto \frac{\color{blue}{-2 \cdot b + 1.5 \cdot \frac{c \cdot a}{b}}}{3 \cdot a} \]
      2. *-commutative95.5%

        \[\leadsto \frac{\color{blue}{b \cdot -2} + 1.5 \cdot \frac{c \cdot a}{b}}{3 \cdot a} \]
      3. fma-def95.5%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(b, -2, 1.5 \cdot \frac{c \cdot a}{b}\right)}}{3 \cdot a} \]
      4. *-commutative95.5%

        \[\leadsto \frac{\mathsf{fma}\left(b, -2, \color{blue}{\frac{c \cdot a}{b} \cdot 1.5}\right)}{3 \cdot a} \]
      5. associate-/l*97.7%

        \[\leadsto \frac{\mathsf{fma}\left(b, -2, \color{blue}{\frac{c}{\frac{b}{a}}} \cdot 1.5\right)}{3 \cdot a} \]
    4. Simplified97.7%

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

    if -8.4999999999999999e107 < b < 7.3000000000000003e-144

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(b - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) \cdot \left(--1\right)}{\left(3 \cdot a\right) \cdot -1}} \]
      10. *-commutative86.9%

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{b \cdot b + \color{blue}{\left(-3\right)} \cdot \left(a \cdot c\right)} - b\right) \cdot \frac{0.3333333333333333}{a} \]
      5. cancel-sign-sub-inv86.9%

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

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

    if 7.3000000000000003e-144 < b

    1. Initial program 16.4%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/80.6%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    4. Applied egg-rr80.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -8.5 \cdot 10^{+107}:\\ \;\;\;\;\frac{\mathsf{fma}\left(b, -2, \frac{c}{\frac{b}{a}} \cdot 1.5\right)}{a \cdot 3}\\ \mathbf{elif}\;b \leq 7.3 \cdot 10^{-144}:\\ \;\;\;\;\left(\sqrt{b \cdot b - 3 \cdot \left(c \cdot a\right)} - b\right) \cdot \frac{0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 4: 85.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -8 \cdot 10^{+107}:\\
\;\;\;\;\frac{\mathsf{fma}\left(b, -2, \frac{c}{\frac{b}{a}} \cdot 1.5\right)}{a \cdot 3}\\

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

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


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

    1. Initial program 44.2%

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

      \[\leadsto \frac{\color{blue}{1.5 \cdot \frac{c \cdot a}{b} + -2 \cdot b}}{3 \cdot a} \]
    3. Step-by-step derivation
      1. +-commutative95.5%

        \[\leadsto \frac{\color{blue}{-2 \cdot b + 1.5 \cdot \frac{c \cdot a}{b}}}{3 \cdot a} \]
      2. *-commutative95.5%

        \[\leadsto \frac{\color{blue}{b \cdot -2} + 1.5 \cdot \frac{c \cdot a}{b}}{3 \cdot a} \]
      3. fma-def95.5%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(b, -2, 1.5 \cdot \frac{c \cdot a}{b}\right)}}{3 \cdot a} \]
      4. *-commutative95.5%

        \[\leadsto \frac{\mathsf{fma}\left(b, -2, \color{blue}{\frac{c \cdot a}{b} \cdot 1.5}\right)}{3 \cdot a} \]
      5. associate-/l*97.7%

        \[\leadsto \frac{\mathsf{fma}\left(b, -2, \color{blue}{\frac{c}{\frac{b}{a}}} \cdot 1.5\right)}{3 \cdot a} \]
    4. Simplified97.7%

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

    if -7.9999999999999998e107 < b < 2.69999999999999995e-146

    1. Initial program 86.9%

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

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

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

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

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

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

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

    if 2.69999999999999995e-146 < b

    1. Initial program 16.4%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/80.6%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    4. Applied egg-rr80.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -8 \cdot 10^{+107}:\\ \;\;\;\;\frac{\mathsf{fma}\left(b, -2, \frac{c}{\frac{b}{a}} \cdot 1.5\right)}{a \cdot 3}\\ \mathbf{elif}\;b \leq 2.7 \cdot 10^{-146}:\\ \;\;\;\;\frac{\sqrt{b \cdot b + a \cdot \left(c \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 5: 79.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.7 \cdot 10^{-155}:\\
\;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b}, \frac{-0.6666666666666666}{\frac{a}{b}}\right)\\

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

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


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

    1. Initial program 70.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{b \cdot b + \color{blue}{\left(-3\right)} \cdot \left(a \cdot c\right)} - b\right) \cdot \frac{0.3333333333333333}{a} \]
      5. cancel-sign-sub-inv70.5%

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}} \]
    7. Step-by-step derivation
      1. +-commutative84.9%

        \[\leadsto \color{blue}{0.5 \cdot \frac{c}{b} + -0.6666666666666666 \cdot \frac{b}{a}} \]
      2. fma-def84.9%

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

        \[\leadsto \mathsf{fma}\left(0.5, \frac{c}{b}, \color{blue}{\frac{-0.6666666666666666 \cdot b}{a}}\right) \]
      4. associate-/l*84.9%

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

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

    if -2.69999999999999981e-155 < b < 7.3000000000000003e-144

    1. Initial program 79.7%

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{\color{blue}{-3 \cdot \left(c \cdot a\right)}}}{3 \cdot a} \]
    3. Step-by-step derivation
      1. expm1-log1p-u59.5%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{\left(-b\right) + \sqrt{-3 \cdot \left(c \cdot a\right)}}{3 \cdot a}\right)} - 1} \]
    4. Applied egg-rr20.0%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\mathsf{fma}\left(-1, b, \sqrt{c \cdot \left(a \cdot -3\right)}\right) \cdot \frac{0.3333333333333333}{a}\right)} - 1} \]
    5. Step-by-step derivation
      1. expm1-def59.5%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(-1, b, \sqrt{c \cdot \left(a \cdot -3\right)}\right) \cdot \frac{0.3333333333333333}{a}\right)\right)} \]
      2. expm1-log1p79.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.3000000000000003e-144 < b

    1. Initial program 16.4%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/80.6%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    4. Applied egg-rr80.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.7 \cdot 10^{-155}:\\ \;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b}, \frac{-0.6666666666666666}{\frac{a}{b}}\right)\\ \mathbf{elif}\;b \leq 7.3 \cdot 10^{-144}:\\ \;\;\;\;0.3333333333333333 \cdot \frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 6: 79.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.7 \cdot 10^{-155}:\\
\;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b}, \frac{-0.6666666666666666}{\frac{a}{b}}\right)\\

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

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


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

    1. Initial program 70.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{b \cdot b + \color{blue}{\left(-3\right)} \cdot \left(a \cdot c\right)} - b\right) \cdot \frac{0.3333333333333333}{a} \]
      5. cancel-sign-sub-inv70.5%

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}} \]
    7. Step-by-step derivation
      1. +-commutative84.9%

        \[\leadsto \color{blue}{0.5 \cdot \frac{c}{b} + -0.6666666666666666 \cdot \frac{b}{a}} \]
      2. fma-def84.9%

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

        \[\leadsto \mathsf{fma}\left(0.5, \frac{c}{b}, \color{blue}{\frac{-0.6666666666666666 \cdot b}{a}}\right) \]
      4. associate-/l*84.9%

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

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

    if -2.69999999999999981e-155 < b < 7.3000000000000003e-144

    1. Initial program 79.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.3000000000000003e-144 < b

    1. Initial program 16.4%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/80.6%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    4. Applied egg-rr80.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.7 \cdot 10^{-155}:\\ \;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b}, \frac{-0.6666666666666666}{\frac{a}{b}}\right)\\ \mathbf{elif}\;b \leq 7.3 \cdot 10^{-144}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 7: 79.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.7 \cdot 10^{-155}:\\
\;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b}, \frac{-0.6666666666666666}{\frac{a}{b}}\right)\\

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

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


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

    1. Initial program 70.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{b \cdot b + \color{blue}{\left(-3\right)} \cdot \left(a \cdot c\right)} - b\right) \cdot \frac{0.3333333333333333}{a} \]
      5. cancel-sign-sub-inv70.5%

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}} \]
    7. Step-by-step derivation
      1. +-commutative84.9%

        \[\leadsto \color{blue}{0.5 \cdot \frac{c}{b} + -0.6666666666666666 \cdot \frac{b}{a}} \]
      2. fma-def84.9%

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

        \[\leadsto \mathsf{fma}\left(0.5, \frac{c}{b}, \color{blue}{\frac{-0.6666666666666666 \cdot b}{a}}\right) \]
      4. associate-/l*84.9%

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

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

    if -2.69999999999999981e-155 < b < 7.3000000000000003e-144

    1. Initial program 79.7%

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

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

    if 7.3000000000000003e-144 < b

    1. Initial program 16.4%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/80.6%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    4. Applied egg-rr80.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.7 \cdot 10^{-155}:\\ \;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b}, \frac{-0.6666666666666666}{\frac{a}{b}}\right)\\ \mathbf{elif}\;b \leq 7.3 \cdot 10^{-144}:\\ \;\;\;\;\frac{\sqrt{\left(c \cdot a\right) \cdot -3} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 8: 79.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.7 \cdot 10^{-155}:\\
\;\;\;\;\frac{\mathsf{fma}\left(b, -2, \frac{c}{\frac{b}{a}} \cdot 1.5\right)}{a \cdot 3}\\

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

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


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

    1. Initial program 70.6%

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

      \[\leadsto \frac{\color{blue}{1.5 \cdot \frac{c \cdot a}{b} + -2 \cdot b}}{3 \cdot a} \]
    3. Step-by-step derivation
      1. +-commutative84.0%

        \[\leadsto \frac{\color{blue}{-2 \cdot b + 1.5 \cdot \frac{c \cdot a}{b}}}{3 \cdot a} \]
      2. *-commutative84.0%

        \[\leadsto \frac{\color{blue}{b \cdot -2} + 1.5 \cdot \frac{c \cdot a}{b}}{3 \cdot a} \]
      3. fma-def84.0%

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

        \[\leadsto \frac{\mathsf{fma}\left(b, -2, \color{blue}{\frac{c \cdot a}{b} \cdot 1.5}\right)}{3 \cdot a} \]
      5. associate-/l*85.1%

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

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

    if -2.69999999999999981e-155 < b < 7.3000000000000003e-144

    1. Initial program 79.7%

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

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

    if 7.3000000000000003e-144 < b

    1. Initial program 16.4%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/80.6%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    4. Applied egg-rr80.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.7 \cdot 10^{-155}:\\ \;\;\;\;\frac{\mathsf{fma}\left(b, -2, \frac{c}{\frac{b}{a}} \cdot 1.5\right)}{a \cdot 3}\\ \mathbf{elif}\;b \leq 7.3 \cdot 10^{-144}:\\ \;\;\;\;\frac{\sqrt{\left(c \cdot a\right) \cdot -3} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 9: 68.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-311}:\\ \;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b}, \frac{-0.6666666666666666}{\frac{a}{b}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -5e-311)
   (fma 0.5 (/ c b) (/ -0.6666666666666666 (/ a b)))
   (/ (* c -0.5) b)))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-311) {
		tmp = fma(0.5, (c / b), (-0.6666666666666666 / (a / b)));
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= -5e-311)
		tmp = fma(0.5, Float64(c / b), Float64(-0.6666666666666666 / Float64(a / b)));
	else
		tmp = Float64(Float64(c * -0.5) / b);
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -5e-311], N[(0.5 * N[(c / b), $MachinePrecision] + N[(-0.6666666666666666 / N[(a / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b}, \frac{-0.6666666666666666}{\frac{a}{b}}\right)\\

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


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

    1. Initial program 70.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{b \cdot b + \color{blue}{\left(-3\right)} \cdot \left(a \cdot c\right)} - b\right) \cdot \frac{0.3333333333333333}{a} \]
      5. cancel-sign-sub-inv70.3%

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

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

      \[\leadsto \color{blue}{-0.6666666666666666 \cdot \frac{b}{a} + 0.5 \cdot \frac{c}{b}} \]
    7. Step-by-step derivation
      1. +-commutative66.3%

        \[\leadsto \color{blue}{0.5 \cdot \frac{c}{b} + -0.6666666666666666 \cdot \frac{b}{a}} \]
      2. fma-def66.3%

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

        \[\leadsto \mathsf{fma}\left(0.5, \frac{c}{b}, \color{blue}{\frac{-0.6666666666666666 \cdot b}{a}}\right) \]
      4. associate-/l*66.3%

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

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

    if -5.00000000000023e-311 < b

    1. Initial program 29.9%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/67.6%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    4. Applied egg-rr67.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-311}:\\ \;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b}, \frac{-0.6666666666666666}{\frac{a}{b}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 10: 68.4% accurate, 8.9× speedup?

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

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

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


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

    1. Initial program 70.3%

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

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

    if -5.00000000000023e-311 < b

    1. Initial program 29.9%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/67.6%

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    4. Applied egg-rr67.6%

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

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

Alternative 11: 68.2% accurate, 12.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.75 \cdot 10^{-307}:\\
\;\;\;\;\frac{0.3333333333333333}{a} \cdot \left(b \cdot -2\right)\\

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


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

    1. Initial program 70.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(b - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) \cdot \left(--1\right)}{\left(3 \cdot a\right) \cdot -1}} \]
      10. *-commutative70.8%

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{b \cdot b + \color{blue}{\left(-3\right)} \cdot \left(a \cdot c\right)} - b\right) \cdot \frac{0.3333333333333333}{a} \]
      5. cancel-sign-sub-inv70.7%

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

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

      \[\leadsto \color{blue}{\left(-2 \cdot b\right)} \cdot \frac{0.3333333333333333}{a} \]
    7. Step-by-step derivation
      1. *-commutative64.8%

        \[\leadsto \color{blue}{\left(b \cdot -2\right)} \cdot \frac{0.3333333333333333}{a} \]
    8. Simplified64.8%

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

    if 1.7500000000000001e-307 < b

    1. Initial program 28.8%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/68.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.75 \cdot 10^{-307}:\\ \;\;\;\;\frac{0.3333333333333333}{a} \cdot \left(b \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 12: 68.2% accurate, 12.8× speedup?

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

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

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


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

    1. Initial program 70.8%

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

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

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

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

    if 3.3e-307 < b

    1. Initial program 28.8%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/68.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 3.3 \cdot 10^{-307}:\\ \;\;\;\;\frac{b \cdot -2}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 13: 47.9% accurate, 16.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.75 \cdot 10^{-307}:\\
\;\;\;\;\frac{b}{a} \cdot -0.3333333333333333\\

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


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

    1. Initial program 70.8%

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

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

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

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

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

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

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

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

    if 1.7500000000000001e-307 < b

    1. Initial program 28.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.75 \cdot 10^{-307}:\\ \;\;\;\;\frac{b}{a} \cdot -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]

Alternative 14: 68.2% accurate, 16.4× speedup?

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

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

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


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

    1. Initial program 70.8%

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

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

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

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

    if 1.80000000000000003e-307 < b

    1. Initial program 28.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.8 \cdot 10^{-307}:\\ \;\;\;\;\frac{b}{a} \cdot -0.6666666666666666\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]

Alternative 15: 68.2% accurate, 16.4× speedup?

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

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

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


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

    1. Initial program 70.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(b - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) \cdot \left(--1\right)}{\left(3 \cdot a\right) \cdot -1}} \]
      10. *-commutative70.8%

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{b \cdot b + \color{blue}{\left(-3\right)} \cdot \left(a \cdot c\right)} - b\right) \cdot \frac{0.3333333333333333}{a} \]
      5. cancel-sign-sub-inv70.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]
    8. Simplified64.7%

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

    if 2.50000000000000007e-307 < b

    1. Initial program 28.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2.5 \cdot 10^{-307}:\\ \;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\ \mathbf{else}:\\ \;\;\;\;-0.5 \cdot \frac{c}{b}\\ \end{array} \]

Alternative 16: 68.2% accurate, 16.4× speedup?

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

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

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


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

    1. Initial program 70.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(b - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) \cdot \left(--1\right)}{\left(3 \cdot a\right) \cdot -1}} \]
      10. *-commutative70.8%

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{b \cdot b + \color{blue}{\left(-3\right)} \cdot \left(a \cdot c\right)} - b\right) \cdot \frac{0.3333333333333333}{a} \]
      5. cancel-sign-sub-inv70.7%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.6666666666666666}{\frac{a}{b}}} \]
    8. Simplified64.7%

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

    if 1.7500000000000001e-307 < b

    1. Initial program 28.8%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/68.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 1.75 \cdot 10^{-307}:\\ \;\;\;\;\frac{-0.6666666666666666}{\frac{a}{b}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 17: 68.2% accurate, 16.4× speedup?

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

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

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


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

    1. Initial program 70.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\left(b - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}\right) \cdot \left(--1\right)}{\left(3 \cdot a\right) \cdot -1}} \]
      10. *-commutative70.8%

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{b \cdot b + \color{blue}{\left(-3\right)} \cdot \left(a \cdot c\right)} - b\right) \cdot \frac{0.3333333333333333}{a} \]
      5. cancel-sign-sub-inv70.7%

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

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

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

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

        \[\leadsto \left(\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b\right) \cdot \left({3}^{-1} \cdot \color{blue}{{a}^{-1}}\right) \]
      4. unpow-prod-down70.8%

        \[\leadsto \left(\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b\right) \cdot \color{blue}{{\left(3 \cdot a\right)}^{-1}} \]
      5. *-commutative70.8%

        \[\leadsto \left(\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b\right) \cdot {\color{blue}{\left(a \cdot 3\right)}}^{-1} \]
      6. unpow-prod-down70.7%

        \[\leadsto \left(\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b\right) \cdot \color{blue}{\left({a}^{-1} \cdot {3}^{-1}\right)} \]
      7. inv-pow70.7%

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

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

      \[\leadsto \left(\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b\right) \cdot \color{blue}{\left(\frac{1}{a} \cdot 0.3333333333333333\right)} \]
    8. Taylor expanded in b around -inf 64.7%

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

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

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

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

    if 2.00000000000000006e-306 < b

    1. Initial program 28.8%

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
    3. Step-by-step derivation
      1. associate-*r/68.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 2 \cdot 10^{-306}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 18: 35.2% accurate, 23.2× speedup?

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

\\
-0.5 \cdot \frac{c}{b}
\end{array}
Derivation
  1. Initial program 48.4%

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

    \[\leadsto \color{blue}{-0.5 \cdot \frac{c}{b}} \]
  3. Final simplification37.8%

    \[\leadsto -0.5 \cdot \frac{c}{b} \]

Reproduce

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