Cubic critical

Percentage Accurate: 53.3% → 82.8%
Time: 13.9s
Alternatives: 15
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 15 alternatives:

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

Initial Program: 53.3% accurate, 1.0× speedup?

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

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

Alternative 1: 82.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -7.5 \cdot 10^{-54}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 3.5 \cdot 10^{-65}:\\ \;\;\;\;\frac{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a} \cdot -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (if (<= b -7.5e-54)
   (/ (* b -0.6666666666666666) a)
   (if (<= b 3.5e-65)
     (* (/ (- b (hypot b (sqrt (* c (* a -3.0))))) a) -0.3333333333333333)
     (/ (* c -0.5) b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -7.5e-54) {
		tmp = (b * -0.6666666666666666) / a;
	} else if (b <= 3.5e-65) {
		tmp = ((b - hypot(b, sqrt((c * (a * -3.0))))) / a) * -0.3333333333333333;
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -7.5e-54) {
		tmp = (b * -0.6666666666666666) / a;
	} else if (b <= 3.5e-65) {
		tmp = ((b - Math.hypot(b, Math.sqrt((c * (a * -3.0))))) / a) * -0.3333333333333333;
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -7.5e-54:
		tmp = (b * -0.6666666666666666) / a
	elif b <= 3.5e-65:
		tmp = ((b - math.hypot(b, math.sqrt((c * (a * -3.0))))) / a) * -0.3333333333333333
	else:
		tmp = (c * -0.5) / b
	return tmp
function code(a, b, c)
	tmp = 0.0
	if (b <= -7.5e-54)
		tmp = Float64(Float64(b * -0.6666666666666666) / a);
	elseif (b <= 3.5e-65)
		tmp = Float64(Float64(Float64(b - hypot(b, sqrt(Float64(c * Float64(a * -3.0))))) / a) * -0.3333333333333333);
	else
		tmp = Float64(Float64(c * -0.5) / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -7.5e-54)
		tmp = (b * -0.6666666666666666) / a;
	elseif (b <= 3.5e-65)
		tmp = ((b - hypot(b, sqrt((c * (a * -3.0))))) / a) * -0.3333333333333333;
	else
		tmp = (c * -0.5) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -7.5e-54], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 3.5e-65], N[(N[(N[(b - N[Sqrt[b ^ 2 + N[Sqrt[N[(c * N[(a * -3.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 68.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 93.8%

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

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

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

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

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

    if -7.5000000000000005e-54 < b < 3.50000000000000005e-65

    1. Initial program 76.5%

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

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

        \[\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-/r/76.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto {\left(\frac{a}{\left(b - \color{blue}{\mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)}\right) \cdot -0.3333333333333333}\right)}^{-1} \]
    5. Applied egg-rr79.0%

      \[\leadsto \color{blue}{{\left(\frac{a}{\left(b - \mathsf{hypot}\left(b, \sqrt{a \cdot \left(c \cdot -3\right)}\right)\right) \cdot -0.3333333333333333}\right)}^{-1}} \]
    6. Step-by-step derivation
      1. unpow-179.0%

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

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

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

        \[\leadsto \frac{1}{\frac{a}{-0.3333333333333333 \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{\left(c \cdot a\right)} \cdot -3}\right)\right)}} \]
      5. associate-*l*79.0%

        \[\leadsto \frac{1}{\frac{a}{-0.3333333333333333 \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{\color{blue}{c \cdot \left(a \cdot -3\right)}}\right)\right)}} \]
    7. Simplified79.0%

      \[\leadsto \color{blue}{\frac{1}{\frac{a}{-0.3333333333333333 \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)\right)}}} \]
    8. Step-by-step derivation
      1. expm1-log1p-u54.0%

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{1}{\frac{a}{-0.3333333333333333 \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)\right)}}\right)} - 1} \]
      3. associate-/r/28.6%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{1}{a} \cdot \left(-0.3333333333333333 \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)\right)\right)}\right)} - 1 \]
      4. *-commutative28.6%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{1}{a} \cdot \color{blue}{\left(\left(b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)\right) \cdot -0.3333333333333333\right)}\right)} - 1 \]
    9. Applied egg-rr28.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{1 \cdot \left(b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)\right)}{a}} \cdot -0.3333333333333333 \]
      5. *-lft-identity79.1%

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

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

    if 3.50000000000000005e-65 < b

    1. Initial program 14.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 67.4%

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{c \cdot a}{b}}}{3 \cdot a} \]
    3. Step-by-step derivation
      1. associate-/l*68.4%

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{c}{\frac{b}{a}}}}{3 \cdot a} \]
    4. Simplified68.4%

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

        \[\leadsto \color{blue}{\left(-1.5 \cdot \frac{c}{\frac{b}{a}}\right) \cdot \frac{1}{3 \cdot a}} \]
      2. associate-/r/73.6%

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

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

      \[\leadsto \color{blue}{\left(-1.5 \cdot \left(\frac{c}{b} \cdot a\right)\right) \cdot \frac{1}{a \cdot 3}} \]
    7. Step-by-step derivation
      1. associate-*l/67.3%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{\color{blue}{0.3333333333333333}}{a}}{b} \]
    8. Simplified77.1%

      \[\leadsto \color{blue}{\frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{0.3333333333333333}{a}}{b}} \]
    9. Taylor expanded in a around 0 87.8%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative87.8%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
    11. Simplified87.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7.5 \cdot 10^{-54}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 3.5 \cdot 10^{-65}:\\ \;\;\;\;\frac{b - \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}{a} \cdot -0.3333333333333333\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 2: 85.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 59.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 96.5%

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

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

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

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

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

    if -1.00000000000000002e64 < b < 6.5999999999999999e-64

    1. Initial program 79.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. /-rgt-identity79.6%

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

        \[\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*79.6%

        \[\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/79.4%

        \[\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. *-commutative79.4%

        \[\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/79.6%

        \[\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/79.6%

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

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

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

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

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

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

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

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

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

      \[\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-udef79.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*79.4%

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

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

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

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

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

    if 6.5999999999999999e-64 < b

    1. Initial program 14.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 67.4%

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{c \cdot a}{b}}}{3 \cdot a} \]
    3. Step-by-step derivation
      1. associate-/l*68.4%

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{c}{\frac{b}{a}}}}{3 \cdot a} \]
    4. Simplified68.4%

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

        \[\leadsto \color{blue}{\left(-1.5 \cdot \frac{c}{\frac{b}{a}}\right) \cdot \frac{1}{3 \cdot a}} \]
      2. associate-/r/73.6%

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

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

      \[\leadsto \color{blue}{\left(-1.5 \cdot \left(\frac{c}{b} \cdot a\right)\right) \cdot \frac{1}{a \cdot 3}} \]
    7. Step-by-step derivation
      1. associate-*l/67.3%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{\color{blue}{0.3333333333333333}}{a}}{b} \]
    8. Simplified77.1%

      \[\leadsto \color{blue}{\frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{0.3333333333333333}{a}}{b}} \]
    9. Taylor expanded in a around 0 87.8%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative87.8%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
    11. Simplified87.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+64}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 6.6 \cdot 10^{-64}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 3: 84.0% accurate, 1.0× speedup?

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

\mathbf{elif}\;b \leq 5.5 \cdot 10^{-64}:\\
\;\;\;\;\left(\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\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 < -3.65000000000000021e-6

    1. Initial program 65.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 -inf 95.8%

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

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

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

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

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

    if -3.65000000000000021e-6 < b < 5.4999999999999999e-64

    1. Initial program 77.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-sub077.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-77.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-neg77.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-177.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/77.8%

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

        \[\leadsto \color{blue}{\frac{b - \sqrt{b \cdot b - \left(3 \cdot a\right) \cdot c}}{3 \cdot a} \cdot -1} \]
      7. metadata-eval77.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-eval77.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-frac77.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. *-commutative77.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-frac77.7%

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

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

        \[\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*77.6%

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

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

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

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

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

    if 5.4999999999999999e-64 < b

    1. Initial program 14.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 67.4%

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{c \cdot a}{b}}}{3 \cdot a} \]
    3. Step-by-step derivation
      1. associate-/l*68.4%

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{c}{\frac{b}{a}}}}{3 \cdot a} \]
    4. Simplified68.4%

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

        \[\leadsto \color{blue}{\left(-1.5 \cdot \frac{c}{\frac{b}{a}}\right) \cdot \frac{1}{3 \cdot a}} \]
      2. associate-/r/73.6%

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

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

      \[\leadsto \color{blue}{\left(-1.5 \cdot \left(\frac{c}{b} \cdot a\right)\right) \cdot \frac{1}{a \cdot 3}} \]
    7. Step-by-step derivation
      1. associate-*l/67.3%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{\color{blue}{0.3333333333333333}}{a}}{b} \]
    8. Simplified77.1%

      \[\leadsto \color{blue}{\frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{0.3333333333333333}{a}}{b}} \]
    9. Taylor expanded in a around 0 87.8%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative87.8%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
    11. Simplified87.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.65 \cdot 10^{-6}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 5.5 \cdot 10^{-64}:\\ \;\;\;\;\left(\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b\right) \cdot \frac{0.3333333333333333}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 4: 84.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -4.8 \cdot 10^{+39}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 9.6 \cdot 10^{-64}:\\ \;\;\;\;\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 -4.8e+39)
   (/ (* b -0.6666666666666666) a)
   (if (<= b 9.6e-64)
     (/ (- (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 <= -4.8e+39) {
		tmp = (b * -0.6666666666666666) / a;
	} else if (b <= 9.6e-64) {
		tmp = (sqrt(((b * b) + (a * (c * -3.0)))) - b) / (a * 3.0);
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-4.8d+39)) then
        tmp = (b * (-0.6666666666666666d0)) / a
    else if (b <= 9.6d-64) then
        tmp = (sqrt(((b * b) + (a * (c * (-3.0d0))))) - b) / (a * 3.0d0)
    else
        tmp = (c * (-0.5d0)) / b
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -4.8e+39) {
		tmp = (b * -0.6666666666666666) / a;
	} else if (b <= 9.6e-64) {
		tmp = (Math.sqrt(((b * b) + (a * (c * -3.0)))) - b) / (a * 3.0);
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -4.8e+39:
		tmp = (b * -0.6666666666666666) / a
	elif b <= 9.6e-64:
		tmp = (math.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 <= -4.8e+39)
		tmp = Float64(Float64(b * -0.6666666666666666) / a);
	elseif (b <= 9.6e-64)
		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
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -4.8e+39)
		tmp = (b * -0.6666666666666666) / a;
	elseif (b <= 9.6e-64)
		tmp = (sqrt(((b * b) + (a * (c * -3.0)))) - b) / (a * 3.0);
	else
		tmp = (c * -0.5) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -4.8e+39], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 9.6e-64], 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 -4.8 \cdot 10^{+39}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\

\mathbf{elif}\;b \leq 9.6 \cdot 10^{-64}:\\
\;\;\;\;\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 < -4.8000000000000002e39

    1. Initial program 62.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 96.7%

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

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

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

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

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

    if -4.8000000000000002e39 < b < 9.59999999999999994e-64

    1. Initial program 78.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. associate-*r*78.7%

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

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

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

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

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

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

    if 9.59999999999999994e-64 < b

    1. Initial program 14.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 67.4%

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{c \cdot a}{b}}}{3 \cdot a} \]
    3. Step-by-step derivation
      1. associate-/l*68.4%

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{c}{\frac{b}{a}}}}{3 \cdot a} \]
    4. Simplified68.4%

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

        \[\leadsto \color{blue}{\left(-1.5 \cdot \frac{c}{\frac{b}{a}}\right) \cdot \frac{1}{3 \cdot a}} \]
      2. associate-/r/73.6%

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

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

      \[\leadsto \color{blue}{\left(-1.5 \cdot \left(\frac{c}{b} \cdot a\right)\right) \cdot \frac{1}{a \cdot 3}} \]
    7. Step-by-step derivation
      1. associate-*l/67.3%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{\color{blue}{0.3333333333333333}}{a}}{b} \]
    8. Simplified77.1%

      \[\leadsto \color{blue}{\frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{0.3333333333333333}{a}}{b}} \]
    9. Taylor expanded in a around 0 87.8%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative87.8%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
    11. Simplified87.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.8 \cdot 10^{+39}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 9.6 \cdot 10^{-64}:\\ \;\;\;\;\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: 84.9% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 62.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 96.7%

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

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

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

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

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

    if -4.8000000000000002e39 < b < 2.80000000000000004e-64

    1. Initial program 78.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-sub078.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-78.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-neg78.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-178.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/78.8%

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

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

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

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

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

        \[\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/78.8%

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

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

    if 2.80000000000000004e-64 < b

    1. Initial program 14.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 67.4%

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{c \cdot a}{b}}}{3 \cdot a} \]
    3. Step-by-step derivation
      1. associate-/l*68.4%

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{c}{\frac{b}{a}}}}{3 \cdot a} \]
    4. Simplified68.4%

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

        \[\leadsto \color{blue}{\left(-1.5 \cdot \frac{c}{\frac{b}{a}}\right) \cdot \frac{1}{3 \cdot a}} \]
      2. associate-/r/73.6%

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

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

      \[\leadsto \color{blue}{\left(-1.5 \cdot \left(\frac{c}{b} \cdot a\right)\right) \cdot \frac{1}{a \cdot 3}} \]
    7. Step-by-step derivation
      1. associate-*l/67.3%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{\color{blue}{0.3333333333333333}}{a}}{b} \]
    8. Simplified77.1%

      \[\leadsto \color{blue}{\frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{0.3333333333333333}{a}}{b}} \]
    9. Taylor expanded in a around 0 87.8%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative87.8%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
    11. Simplified87.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.8 \cdot 10^{+39}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 2.8 \cdot 10^{-64}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 6: 84.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -4.8 \cdot 10^{+39}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 4.3 \cdot 10^{-63}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 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 -4.8e+39)
   (/ (* b -0.6666666666666666) a)
   (if (<= b 4.3e-63)
     (/ (- (sqrt (- (* b b) (* c (* a 3.0)))) b) (* a 3.0))
     (/ (* c -0.5) b))))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -4.8e+39) {
		tmp = (b * -0.6666666666666666) / a;
	} else if (b <= 4.3e-63) {
		tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
real(8) function code(a, b, c)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8) :: tmp
    if (b <= (-4.8d+39)) then
        tmp = (b * (-0.6666666666666666d0)) / a
    else if (b <= 4.3d-63) then
        tmp = (sqrt(((b * b) - (c * (a * 3.0d0)))) - b) / (a * 3.0d0)
    else
        tmp = (c * (-0.5d0)) / b
    end if
    code = tmp
end function
public static double code(double a, double b, double c) {
	double tmp;
	if (b <= -4.8e+39) {
		tmp = (b * -0.6666666666666666) / a;
	} else if (b <= 4.3e-63) {
		tmp = (Math.sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
def code(a, b, c):
	tmp = 0
	if b <= -4.8e+39:
		tmp = (b * -0.6666666666666666) / a
	elif b <= 4.3e-63:
		tmp = (math.sqrt(((b * b) - (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 <= -4.8e+39)
		tmp = Float64(Float64(b * -0.6666666666666666) / a);
	elseif (b <= 4.3e-63)
		tmp = Float64(Float64(sqrt(Float64(Float64(b * b) - Float64(c * Float64(a * 3.0)))) - b) / Float64(a * 3.0));
	else
		tmp = Float64(Float64(c * -0.5) / b);
	end
	return tmp
end
function tmp_2 = code(a, b, c)
	tmp = 0.0;
	if (b <= -4.8e+39)
		tmp = (b * -0.6666666666666666) / a;
	elseif (b <= 4.3e-63)
		tmp = (sqrt(((b * b) - (c * (a * 3.0)))) - b) / (a * 3.0);
	else
		tmp = (c * -0.5) / b;
	end
	tmp_2 = tmp;
end
code[a_, b_, c_] := If[LessEqual[b, -4.8e+39], N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[b, 4.3e-63], N[(N[(N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(c * N[(a * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision] / N[(a * 3.0), $MachinePrecision]), $MachinePrecision], N[(N[(c * -0.5), $MachinePrecision] / b), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.8 \cdot 10^{+39}:\\
\;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\

\mathbf{elif}\;b \leq 4.3 \cdot 10^{-63}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - 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 < -4.8000000000000002e39

    1. Initial program 62.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 96.7%

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

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

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

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

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

    if -4.8000000000000002e39 < b < 4.2999999999999999e-63

    1. Initial program 78.8%

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

    if 4.2999999999999999e-63 < b

    1. Initial program 14.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 67.4%

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{c \cdot a}{b}}}{3 \cdot a} \]
    3. Step-by-step derivation
      1. associate-/l*68.4%

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{c}{\frac{b}{a}}}}{3 \cdot a} \]
    4. Simplified68.4%

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

        \[\leadsto \color{blue}{\left(-1.5 \cdot \frac{c}{\frac{b}{a}}\right) \cdot \frac{1}{3 \cdot a}} \]
      2. associate-/r/73.6%

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

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

      \[\leadsto \color{blue}{\left(-1.5 \cdot \left(\frac{c}{b} \cdot a\right)\right) \cdot \frac{1}{a \cdot 3}} \]
    7. Step-by-step derivation
      1. associate-*l/67.3%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{\color{blue}{0.3333333333333333}}{a}}{b} \]
    8. Simplified77.1%

      \[\leadsto \color{blue}{\frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{0.3333333333333333}{a}}{b}} \]
    9. Taylor expanded in a around 0 87.8%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative87.8%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
    11. Simplified87.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.8 \cdot 10^{+39}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 4.3 \cdot 10^{-63}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 7: 80.5% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 68.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 93.8%

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

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

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

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

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

    if -1.64999999999999992e-56 < b < 4.8000000000000003e-65

    1. Initial program 76.5%

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

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

    if 4.8000000000000003e-65 < b

    1. Initial program 14.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 67.4%

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{c \cdot a}{b}}}{3 \cdot a} \]
    3. Step-by-step derivation
      1. associate-/l*68.4%

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{c}{\frac{b}{a}}}}{3 \cdot a} \]
    4. Simplified68.4%

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

        \[\leadsto \color{blue}{\left(-1.5 \cdot \frac{c}{\frac{b}{a}}\right) \cdot \frac{1}{3 \cdot a}} \]
      2. associate-/r/73.6%

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

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

      \[\leadsto \color{blue}{\left(-1.5 \cdot \left(\frac{c}{b} \cdot a\right)\right) \cdot \frac{1}{a \cdot 3}} \]
    7. Step-by-step derivation
      1. associate-*l/67.3%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{\color{blue}{0.3333333333333333}}{a}}{b} \]
    8. Simplified77.1%

      \[\leadsto \color{blue}{\frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{0.3333333333333333}{a}}{b}} \]
    9. Taylor expanded in a around 0 87.8%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative87.8%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
    11. Simplified87.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.65 \cdot 10^{-56}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 4.8 \cdot 10^{-65}:\\ \;\;\;\;\frac{\sqrt{-3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 8: 80.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;b \leq 7.6 \cdot 10^{-65}:\\
\;\;\;\;\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.02000000000000003e-56

    1. Initial program 68.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 93.8%

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

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

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

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

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

    if -2.02000000000000003e-56 < b < 7.6000000000000003e-65

    1. Initial program 76.5%

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

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

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

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

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

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

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

    if 7.6000000000000003e-65 < b

    1. Initial program 14.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 67.4%

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{c \cdot a}{b}}}{3 \cdot a} \]
    3. Step-by-step derivation
      1. associate-/l*68.4%

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{c}{\frac{b}{a}}}}{3 \cdot a} \]
    4. Simplified68.4%

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

        \[\leadsto \color{blue}{\left(-1.5 \cdot \frac{c}{\frac{b}{a}}\right) \cdot \frac{1}{3 \cdot a}} \]
      2. associate-/r/73.6%

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

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

      \[\leadsto \color{blue}{\left(-1.5 \cdot \left(\frac{c}{b} \cdot a\right)\right) \cdot \frac{1}{a \cdot 3}} \]
    7. Step-by-step derivation
      1. associate-*l/67.3%

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{\color{blue}{0.3333333333333333}}{a}}{b} \]
    8. Simplified77.1%

      \[\leadsto \color{blue}{\frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{0.3333333333333333}{a}}{b}} \]
    9. Taylor expanded in a around 0 87.8%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative87.8%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
    11. Simplified87.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.02 \cdot 10^{-56}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 7.6 \cdot 10^{-65}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]

Alternative 9: 67.5% accurate, 6.8× speedup?

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

    1. Initial program 71.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + \left(a \cdot \color{blue}{\left(1.5 \cdot \frac{c}{b}\right)} - b\right)}{3 \cdot a} \]
    6. Simplified67.1%

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

    if -1.999999999999994e-310 < b

    1. Initial program 31.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 inf 49.7%

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{c \cdot a}{b}}}{3 \cdot a} \]
    3. Step-by-step derivation
      1. associate-/l*52.8%

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{c}{\frac{b}{a}}}}{3 \cdot a} \]
    4. Simplified52.8%

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

        \[\leadsto \color{blue}{\left(-1.5 \cdot \frac{c}{\frac{b}{a}}\right) \cdot \frac{1}{3 \cdot a}} \]
      2. associate-/r/56.7%

        \[\leadsto \left(-1.5 \cdot \color{blue}{\left(\frac{c}{b} \cdot a\right)}\right) \cdot \frac{1}{3 \cdot a} \]
      3. *-commutative56.7%

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

      \[\leadsto \color{blue}{\left(-1.5 \cdot \left(\frac{c}{b} \cdot a\right)\right) \cdot \frac{1}{a \cdot 3}} \]
    7. Step-by-step derivation
      1. associate-*l/49.7%

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

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

        \[\leadsto \color{blue}{\frac{\left(-1.5 \cdot \left(c \cdot a\right)\right) \cdot \frac{1}{a \cdot 3}}{b}} \]
      4. *-commutative56.7%

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

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

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

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

        \[\leadsto \frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{\color{blue}{0.3333333333333333}}{a}}{b} \]
    8. Simplified56.7%

      \[\leadsto \color{blue}{\frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{0.3333333333333333}{a}}{b}} \]
    9. Taylor expanded in a around 0 68.9%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative68.9%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
    11. Simplified68.9%

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

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

Alternative 10: 67.5% accurate, 8.9× speedup?

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

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

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


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

    1. Initial program 71.5%

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

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

    if -1.999999999999994e-310 < b

    1. Initial program 31.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 inf 49.7%

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{c \cdot a}{b}}}{3 \cdot a} \]
    3. Step-by-step derivation
      1. associate-/l*52.8%

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{c}{\frac{b}{a}}}}{3 \cdot a} \]
    4. Simplified52.8%

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

        \[\leadsto \color{blue}{\left(-1.5 \cdot \frac{c}{\frac{b}{a}}\right) \cdot \frac{1}{3 \cdot a}} \]
      2. associate-/r/56.7%

        \[\leadsto \left(-1.5 \cdot \color{blue}{\left(\frac{c}{b} \cdot a\right)}\right) \cdot \frac{1}{3 \cdot a} \]
      3. *-commutative56.7%

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

      \[\leadsto \color{blue}{\left(-1.5 \cdot \left(\frac{c}{b} \cdot a\right)\right) \cdot \frac{1}{a \cdot 3}} \]
    7. Step-by-step derivation
      1. associate-*l/49.7%

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

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

        \[\leadsto \color{blue}{\frac{\left(-1.5 \cdot \left(c \cdot a\right)\right) \cdot \frac{1}{a \cdot 3}}{b}} \]
      4. *-commutative56.7%

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

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

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

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

        \[\leadsto \frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{\color{blue}{0.3333333333333333}}{a}}{b} \]
    8. Simplified56.7%

      \[\leadsto \color{blue}{\frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{0.3333333333333333}{a}}{b}} \]
    9. Taylor expanded in a around 0 68.9%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative68.9%

        \[\leadsto \frac{\color{blue}{c \cdot -0.5}}{b} \]
    11. Simplified68.9%

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

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

Alternative 11: 67.3% accurate, 16.4× speedup?

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

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

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


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

    1. Initial program 72.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 65.4%

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

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

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

    if 9.19999999999999956e-281 < b

    1. Initial program 30.1%

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

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

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

Alternative 12: 67.3% accurate, 16.4× speedup?

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

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

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


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

    1. Initial program 72.2%

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

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

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

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

        \[\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/72.2%

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

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

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

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

        \[\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. *-commutative72.2%

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

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

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

        \[\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*72.1%

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

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

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

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

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

        \[\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)} \]
    7. Applied egg-rr72.0%

      \[\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)} \]
    8. Taylor expanded in b around -inf 65.4%

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

        \[\leadsto \color{blue}{\frac{b}{a} \cdot -0.6666666666666666} \]
      2. associate-/r/65.4%

        \[\leadsto \color{blue}{\frac{b}{\frac{a}{-0.6666666666666666}}} \]
    10. Simplified65.4%

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

    if 9.19999999999999956e-281 < b

    1. Initial program 30.1%

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

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

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

Alternative 13: 67.4% accurate, 16.4× speedup?

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

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

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


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

    1. Initial program 72.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 65.4%

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

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

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

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

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

    if 9.19999999999999956e-281 < b

    1. Initial program 30.1%

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

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

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

Alternative 14: 67.4% accurate, 16.4× speedup?

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

    1. Initial program 72.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 65.4%

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

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

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

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

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

    if 9.19999999999999956e-281 < b

    1. Initial program 30.1%

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

      \[\leadsto \frac{\color{blue}{-1.5 \cdot \frac{c \cdot a}{b}}}{3 \cdot a} \]
    3. Step-by-step derivation
      1. associate-/l*54.0%

        \[\leadsto \frac{-1.5 \cdot \color{blue}{\frac{c}{\frac{b}{a}}}}{3 \cdot a} \]
    4. Simplified54.0%

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

        \[\leadsto \color{blue}{\left(-1.5 \cdot \frac{c}{\frac{b}{a}}\right) \cdot \frac{1}{3 \cdot a}} \]
      2. associate-/r/57.9%

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

        \[\leadsto \left(-1.5 \cdot \left(\frac{c}{b} \cdot a\right)\right) \cdot \frac{1}{\color{blue}{a \cdot 3}} \]
    6. Applied egg-rr57.9%

      \[\leadsto \color{blue}{\left(-1.5 \cdot \left(\frac{c}{b} \cdot a\right)\right) \cdot \frac{1}{a \cdot 3}} \]
    7. Step-by-step derivation
      1. associate-*l/50.8%

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

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

        \[\leadsto \color{blue}{\frac{\left(-1.5 \cdot \left(c \cdot a\right)\right) \cdot \frac{1}{a \cdot 3}}{b}} \]
      4. *-commutative58.0%

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

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

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

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

        \[\leadsto \frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{\color{blue}{0.3333333333333333}}{a}}{b} \]
    8. Simplified58.0%

      \[\leadsto \color{blue}{\frac{\left(\left(-1.5 \cdot a\right) \cdot c\right) \cdot \frac{0.3333333333333333}{a}}{b}} \]
    9. Taylor expanded in a around 0 70.5%

      \[\leadsto \frac{\color{blue}{-0.5 \cdot c}}{b} \]
    10. Step-by-step derivation
      1. *-commutative70.5%

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

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

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

Alternative 15: 34.3% 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 51.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 35.6%

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

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

Reproduce

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