Cubic critical

Percentage Accurate: 52.8% → 85.3%
Time: 19.7s
Alternatives: 16
Speedup: 11.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 52.8% accurate, 1.0× speedup?

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

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

Alternative 1: 85.3% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{+153}:\\
\;\;\;\;\left(b + \left(b - a \cdot \left(\frac{c}{b} \cdot 1.5\right)\right)\right) \cdot \frac{-0.3333333333333333}{a}\\

\mathbf{elif}\;b \leq 5 \cdot 10^{-112}:\\
\;\;\;\;\left(b - \sqrt{\mathsf{fma}\left(c, a \cdot -3, {b}^{2}\right)}\right) \cdot \frac{1}{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 < -5.00000000000000018e153

    1. Initial program 45.8%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. frac-2neg45.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{-0.3333333333333333}}} \cdot \left(b - \left(1.5 \cdot \left(a \cdot \frac{c}{b}\right) - b\right)\right) \]
      4. clear-num99.5%

        \[\leadsto \color{blue}{\frac{-0.3333333333333333}{a}} \cdot \left(b - \left(1.5 \cdot \left(a \cdot \frac{c}{b}\right) - b\right)\right) \]
      5. add-log-exp48.3%

        \[\leadsto \color{blue}{\log \left(e^{\frac{-0.3333333333333333}{a} \cdot \left(b - \left(1.5 \cdot \left(a \cdot \frac{c}{b}\right) - b\right)\right)}\right)} \]
      6. exp-prod45.5%

        \[\leadsto \log \color{blue}{\left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\left(b - \left(1.5 \cdot \left(a \cdot \frac{c}{b}\right) - b\right)\right)}\right)} \]
      7. associate--r-45.5%

        \[\leadsto \log \left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\color{blue}{\left(\left(b - 1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) + b\right)}}\right) \]
      8. *-commutative45.5%

        \[\leadsto \log \left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\left(\left(b - 1.5 \cdot \color{blue}{\left(\frac{c}{b} \cdot a\right)}\right) + b\right)}\right) \]
      9. associate-*r*45.5%

        \[\leadsto \log \left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\left(\left(b - \color{blue}{\left(1.5 \cdot \frac{c}{b}\right) \cdot a}\right) + b\right)}\right) \]
    13. Applied egg-rr45.5%

      \[\leadsto \color{blue}{\log \left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\left(\left(b - \left(1.5 \cdot \frac{c}{b}\right) \cdot a\right) + b\right)}\right)} \]
    14. Step-by-step derivation
      1. log-pow49.5%

        \[\leadsto \color{blue}{\left(\left(b - \left(1.5 \cdot \frac{c}{b}\right) \cdot a\right) + b\right) \cdot \log \left(e^{\frac{-0.3333333333333333}{a}}\right)} \]
      2. +-commutative49.5%

        \[\leadsto \color{blue}{\left(b + \left(b - \left(1.5 \cdot \frac{c}{b}\right) \cdot a\right)\right)} \cdot \log \left(e^{\frac{-0.3333333333333333}{a}}\right) \]
      3. *-commutative49.5%

        \[\leadsto \left(b + \left(b - \color{blue}{a \cdot \left(1.5 \cdot \frac{c}{b}\right)}\right)\right) \cdot \log \left(e^{\frac{-0.3333333333333333}{a}}\right) \]
      4. *-commutative49.5%

        \[\leadsto \left(b + \left(b - a \cdot \color{blue}{\left(\frac{c}{b} \cdot 1.5\right)}\right)\right) \cdot \log \left(e^{\frac{-0.3333333333333333}{a}}\right) \]
      5. rem-log-exp99.5%

        \[\leadsto \left(b + \left(b - a \cdot \left(\frac{c}{b} \cdot 1.5\right)\right)\right) \cdot \color{blue}{\frac{-0.3333333333333333}{a}} \]
    15. Simplified99.5%

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

    if -5.00000000000000018e153 < b < 5.00000000000000044e-112

    1. Initial program 82.7%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. frac-2neg82.6%

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

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

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

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

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

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

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

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

    if 5.00000000000000044e-112 < b

    1. Initial program 17.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Applied egg-rr86.8%

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

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

Alternative 2: 85.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{+153}:\\
\;\;\;\;\left(b + \left(b - a \cdot \left(\frac{c}{b} \cdot 1.5\right)\right)\right) \cdot \frac{-0.3333333333333333}{a}\\

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

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


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

    1. Initial program 45.8%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. frac-2neg45.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{-0.3333333333333333}}} \cdot \left(b - \left(1.5 \cdot \left(a \cdot \frac{c}{b}\right) - b\right)\right) \]
      4. clear-num99.5%

        \[\leadsto \color{blue}{\frac{-0.3333333333333333}{a}} \cdot \left(b - \left(1.5 \cdot \left(a \cdot \frac{c}{b}\right) - b\right)\right) \]
      5. add-log-exp48.3%

        \[\leadsto \color{blue}{\log \left(e^{\frac{-0.3333333333333333}{a} \cdot \left(b - \left(1.5 \cdot \left(a \cdot \frac{c}{b}\right) - b\right)\right)}\right)} \]
      6. exp-prod45.5%

        \[\leadsto \log \color{blue}{\left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\left(b - \left(1.5 \cdot \left(a \cdot \frac{c}{b}\right) - b\right)\right)}\right)} \]
      7. associate--r-45.5%

        \[\leadsto \log \left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\color{blue}{\left(\left(b - 1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) + b\right)}}\right) \]
      8. *-commutative45.5%

        \[\leadsto \log \left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\left(\left(b - 1.5 \cdot \color{blue}{\left(\frac{c}{b} \cdot a\right)}\right) + b\right)}\right) \]
      9. associate-*r*45.5%

        \[\leadsto \log \left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\left(\left(b - \color{blue}{\left(1.5 \cdot \frac{c}{b}\right) \cdot a}\right) + b\right)}\right) \]
    13. Applied egg-rr45.5%

      \[\leadsto \color{blue}{\log \left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\left(\left(b - \left(1.5 \cdot \frac{c}{b}\right) \cdot a\right) + b\right)}\right)} \]
    14. Step-by-step derivation
      1. log-pow49.5%

        \[\leadsto \color{blue}{\left(\left(b - \left(1.5 \cdot \frac{c}{b}\right) \cdot a\right) + b\right) \cdot \log \left(e^{\frac{-0.3333333333333333}{a}}\right)} \]
      2. +-commutative49.5%

        \[\leadsto \color{blue}{\left(b + \left(b - \left(1.5 \cdot \frac{c}{b}\right) \cdot a\right)\right)} \cdot \log \left(e^{\frac{-0.3333333333333333}{a}}\right) \]
      3. *-commutative49.5%

        \[\leadsto \left(b + \left(b - \color{blue}{a \cdot \left(1.5 \cdot \frac{c}{b}\right)}\right)\right) \cdot \log \left(e^{\frac{-0.3333333333333333}{a}}\right) \]
      4. *-commutative49.5%

        \[\leadsto \left(b + \left(b - a \cdot \color{blue}{\left(\frac{c}{b} \cdot 1.5\right)}\right)\right) \cdot \log \left(e^{\frac{-0.3333333333333333}{a}}\right) \]
      5. rem-log-exp99.5%

        \[\leadsto \left(b + \left(b - a \cdot \left(\frac{c}{b} \cdot 1.5\right)\right)\right) \cdot \color{blue}{\frac{-0.3333333333333333}{a}} \]
    15. Simplified99.5%

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

    if -5.00000000000000018e153 < b < 2.59999999999999983e-117

    1. Initial program 82.7%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. frac-2neg82.6%

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

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

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

    if 2.59999999999999983e-117 < b

    1. Initial program 17.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Applied egg-rr86.8%

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

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

Alternative 3: 85.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+145}:\\ \;\;\;\;\left(b + \left(b - a \cdot \left(\frac{c}{b} \cdot 1.5\right)\right)\right) \cdot \frac{-0.3333333333333333}{a}\\ \mathbf{elif}\;b \leq 3.85 \cdot 10^{-118}:\\ \;\;\;\;\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 -1e+145)
   (* (+ b (- b (* a (* (/ c b) 1.5)))) (/ -0.3333333333333333 a))
   (if (<= b 3.85e-118)
     (/ (- (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 <= -1e+145) {
		tmp = (b + (b - (a * ((c / b) * 1.5)))) * (-0.3333333333333333 / a);
	} else if (b <= 3.85e-118) {
		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 <= (-1d+145)) then
        tmp = (b + (b - (a * ((c / b) * 1.5d0)))) * ((-0.3333333333333333d0) / a)
    else if (b <= 3.85d-118) 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 <= -1e+145) {
		tmp = (b + (b - (a * ((c / b) * 1.5)))) * (-0.3333333333333333 / a);
	} else if (b <= 3.85e-118) {
		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 <= -1e+145:
		tmp = (b + (b - (a * ((c / b) * 1.5)))) * (-0.3333333333333333 / a)
	elif b <= 3.85e-118:
		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 <= -1e+145)
		tmp = Float64(Float64(b + Float64(b - Float64(a * Float64(Float64(c / b) * 1.5)))) * Float64(-0.3333333333333333 / a));
	elseif (b <= 3.85e-118)
		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 <= -1e+145)
		tmp = (b + (b - (a * ((c / b) * 1.5)))) * (-0.3333333333333333 / a);
	elseif (b <= 3.85e-118)
		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, -1e+145], N[(N[(b + N[(b - N[(a * N[(N[(c / b), $MachinePrecision] * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.85e-118], 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 -1 \cdot 10^{+145}:\\
\;\;\;\;\left(b + \left(b - a \cdot \left(\frac{c}{b} \cdot 1.5\right)\right)\right) \cdot \frac{-0.3333333333333333}{a}\\

\mathbf{elif}\;b \leq 3.85 \cdot 10^{-118}:\\
\;\;\;\;\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 < -9.9999999999999999e144

    1. Initial program 48.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{-0.3333333333333333}}} \cdot \left(b - \left(1.5 \cdot \left(a \cdot \frac{c}{b}\right) - b\right)\right) \]
      4. clear-num99.5%

        \[\leadsto \color{blue}{\frac{-0.3333333333333333}{a}} \cdot \left(b - \left(1.5 \cdot \left(a \cdot \frac{c}{b}\right) - b\right)\right) \]
      5. add-log-exp46.4%

        \[\leadsto \color{blue}{\log \left(e^{\frac{-0.3333333333333333}{a} \cdot \left(b - \left(1.5 \cdot \left(a \cdot \frac{c}{b}\right) - b\right)\right)}\right)} \]
      6. exp-prod43.7%

        \[\leadsto \log \color{blue}{\left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\left(b - \left(1.5 \cdot \left(a \cdot \frac{c}{b}\right) - b\right)\right)}\right)} \]
      7. associate--r-43.7%

        \[\leadsto \log \left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\color{blue}{\left(\left(b - 1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) + b\right)}}\right) \]
      8. *-commutative43.7%

        \[\leadsto \log \left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\left(\left(b - 1.5 \cdot \color{blue}{\left(\frac{c}{b} \cdot a\right)}\right) + b\right)}\right) \]
      9. associate-*r*43.7%

        \[\leadsto \log \left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\left(\left(b - \color{blue}{\left(1.5 \cdot \frac{c}{b}\right) \cdot a}\right) + b\right)}\right) \]
    13. Applied egg-rr43.7%

      \[\leadsto \color{blue}{\log \left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\left(\left(b - \left(1.5 \cdot \frac{c}{b}\right) \cdot a\right) + b\right)}\right)} \]
    14. Step-by-step derivation
      1. log-pow47.6%

        \[\leadsto \color{blue}{\left(\left(b - \left(1.5 \cdot \frac{c}{b}\right) \cdot a\right) + b\right) \cdot \log \left(e^{\frac{-0.3333333333333333}{a}}\right)} \]
      2. +-commutative47.6%

        \[\leadsto \color{blue}{\left(b + \left(b - \left(1.5 \cdot \frac{c}{b}\right) \cdot a\right)\right)} \cdot \log \left(e^{\frac{-0.3333333333333333}{a}}\right) \]
      3. *-commutative47.6%

        \[\leadsto \left(b + \left(b - \color{blue}{a \cdot \left(1.5 \cdot \frac{c}{b}\right)}\right)\right) \cdot \log \left(e^{\frac{-0.3333333333333333}{a}}\right) \]
      4. *-commutative47.6%

        \[\leadsto \left(b + \left(b - a \cdot \color{blue}{\left(\frac{c}{b} \cdot 1.5\right)}\right)\right) \cdot \log \left(e^{\frac{-0.3333333333333333}{a}}\right) \]
      5. rem-log-exp99.5%

        \[\leadsto \left(b + \left(b - a \cdot \left(\frac{c}{b} \cdot 1.5\right)\right)\right) \cdot \color{blue}{\frac{-0.3333333333333333}{a}} \]
    15. Simplified99.5%

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

    if -9.9999999999999999e144 < b < 3.8499999999999998e-118

    1. Initial program 82.4%

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

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

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

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

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

    if 3.8499999999999998e-118 < b

    1. Initial program 17.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Applied egg-rr86.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1 \cdot 10^{+145}:\\ \;\;\;\;\left(b + \left(b - a \cdot \left(\frac{c}{b} \cdot 1.5\right)\right)\right) \cdot \frac{-0.3333333333333333}{a}\\ \mathbf{elif}\;b \leq 3.85 \cdot 10^{-118}:\\ \;\;\;\;\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} \]
  5. Add Preprocessing

Alternative 4: 85.3% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.1 \cdot 10^{+142}:\\ \;\;\;\;\left(b + \left(b - a \cdot \left(\frac{c}{b} \cdot 1.5\right)\right)\right) \cdot \frac{-0.3333333333333333}{a}\\ \mathbf{elif}\;b \leq 1.26 \cdot 10^{-112}:\\ \;\;\;\;\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 -1.1e+142)
   (* (+ b (- b (* a (* (/ c b) 1.5)))) (/ -0.3333333333333333 a))
   (if (<= b 1.26e-112)
     (/ (- (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 <= -1.1e+142) {
		tmp = (b + (b - (a * ((c / b) * 1.5)))) * (-0.3333333333333333 / a);
	} else if (b <= 1.26e-112) {
		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 <= (-1.1d+142)) then
        tmp = (b + (b - (a * ((c / b) * 1.5d0)))) * ((-0.3333333333333333d0) / a)
    else if (b <= 1.26d-112) 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 <= -1.1e+142) {
		tmp = (b + (b - (a * ((c / b) * 1.5)))) * (-0.3333333333333333 / a);
	} else if (b <= 1.26e-112) {
		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 <= -1.1e+142:
		tmp = (b + (b - (a * ((c / b) * 1.5)))) * (-0.3333333333333333 / a)
	elif b <= 1.26e-112:
		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 <= -1.1e+142)
		tmp = Float64(Float64(b + Float64(b - Float64(a * Float64(Float64(c / b) * 1.5)))) * Float64(-0.3333333333333333 / a));
	elseif (b <= 1.26e-112)
		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 <= -1.1e+142)
		tmp = (b + (b - (a * ((c / b) * 1.5)))) * (-0.3333333333333333 / a);
	elseif (b <= 1.26e-112)
		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, -1.1e+142], N[(N[(b + N[(b - N[(a * N[(N[(c / b), $MachinePrecision] * 1.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.26e-112], 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 -1.1 \cdot 10^{+142}:\\
\;\;\;\;\left(b + \left(b - a \cdot \left(\frac{c}{b} \cdot 1.5\right)\right)\right) \cdot \frac{-0.3333333333333333}{a}\\

\mathbf{elif}\;b \leq 1.26 \cdot 10^{-112}:\\
\;\;\;\;\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 < -1.09999999999999993e142

    1. Initial program 48.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\color{blue}{\frac{a}{-0.3333333333333333}}} \cdot \left(b - \left(1.5 \cdot \left(a \cdot \frac{c}{b}\right) - b\right)\right) \]
      4. clear-num99.5%

        \[\leadsto \color{blue}{\frac{-0.3333333333333333}{a}} \cdot \left(b - \left(1.5 \cdot \left(a \cdot \frac{c}{b}\right) - b\right)\right) \]
      5. add-log-exp46.4%

        \[\leadsto \color{blue}{\log \left(e^{\frac{-0.3333333333333333}{a} \cdot \left(b - \left(1.5 \cdot \left(a \cdot \frac{c}{b}\right) - b\right)\right)}\right)} \]
      6. exp-prod43.7%

        \[\leadsto \log \color{blue}{\left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\left(b - \left(1.5 \cdot \left(a \cdot \frac{c}{b}\right) - b\right)\right)}\right)} \]
      7. associate--r-43.7%

        \[\leadsto \log \left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\color{blue}{\left(\left(b - 1.5 \cdot \left(a \cdot \frac{c}{b}\right)\right) + b\right)}}\right) \]
      8. *-commutative43.7%

        \[\leadsto \log \left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\left(\left(b - 1.5 \cdot \color{blue}{\left(\frac{c}{b} \cdot a\right)}\right) + b\right)}\right) \]
      9. associate-*r*43.7%

        \[\leadsto \log \left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\left(\left(b - \color{blue}{\left(1.5 \cdot \frac{c}{b}\right) \cdot a}\right) + b\right)}\right) \]
    13. Applied egg-rr43.7%

      \[\leadsto \color{blue}{\log \left({\left(e^{\frac{-0.3333333333333333}{a}}\right)}^{\left(\left(b - \left(1.5 \cdot \frac{c}{b}\right) \cdot a\right) + b\right)}\right)} \]
    14. Step-by-step derivation
      1. log-pow47.6%

        \[\leadsto \color{blue}{\left(\left(b - \left(1.5 \cdot \frac{c}{b}\right) \cdot a\right) + b\right) \cdot \log \left(e^{\frac{-0.3333333333333333}{a}}\right)} \]
      2. +-commutative47.6%

        \[\leadsto \color{blue}{\left(b + \left(b - \left(1.5 \cdot \frac{c}{b}\right) \cdot a\right)\right)} \cdot \log \left(e^{\frac{-0.3333333333333333}{a}}\right) \]
      3. *-commutative47.6%

        \[\leadsto \left(b + \left(b - \color{blue}{a \cdot \left(1.5 \cdot \frac{c}{b}\right)}\right)\right) \cdot \log \left(e^{\frac{-0.3333333333333333}{a}}\right) \]
      4. *-commutative47.6%

        \[\leadsto \left(b + \left(b - a \cdot \color{blue}{\left(\frac{c}{b} \cdot 1.5\right)}\right)\right) \cdot \log \left(e^{\frac{-0.3333333333333333}{a}}\right) \]
      5. rem-log-exp99.5%

        \[\leadsto \left(b + \left(b - a \cdot \left(\frac{c}{b} \cdot 1.5\right)\right)\right) \cdot \color{blue}{\frac{-0.3333333333333333}{a}} \]
    15. Simplified99.5%

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

    if -1.09999999999999993e142 < b < 1.2599999999999999e-112

    1. Initial program 82.4%

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

    if 1.2599999999999999e-112 < b

    1. Initial program 17.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Applied egg-rr86.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.1 \cdot 10^{+142}:\\ \;\;\;\;\left(b + \left(b - a \cdot \left(\frac{c}{b} \cdot 1.5\right)\right)\right) \cdot \frac{-0.3333333333333333}{a}\\ \mathbf{elif}\;b \leq 1.26 \cdot 10^{-112}:\\ \;\;\;\;\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} \]
  5. Add Preprocessing

Alternative 5: 79.4% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 67.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.0499999999999999e-34 < b < 3.79999999999999972e-117

    1. Initial program 77.9%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num77.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.79999999999999972e-117 < b

    1. Initial program 17.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Applied egg-rr86.8%

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

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

Alternative 6: 79.8% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 67.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1e-46 < b < 2.89999999999999992e-112

    1. Initial program 77.9%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num77.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{0.3333333333333333}{a} \cdot b + \frac{0.3333333333333333}{a} \cdot \sqrt{c \cdot \left(a \cdot -3\right)}} \]
    10. Step-by-step derivation
      1. distribute-lft-out68.2%

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

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

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

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

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

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

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

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

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

    if 2.89999999999999992e-112 < b

    1. Initial program 17.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Applied egg-rr86.8%

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

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

Alternative 7: 79.7% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 67.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.00000000000000053e-37 < b < 6.1999999999999995e-112

    1. Initial program 77.9%

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

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

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

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

      \[\leadsto \color{blue}{\frac{\left(-b\right) + \sqrt{b \cdot b - 3 \cdot \left(a \cdot c\right)}}{3 \cdot a}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. clear-num77.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.1999999999999995e-112 < b

    1. Initial program 17.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Applied egg-rr86.8%

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

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

Alternative 8: 80.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -3.5 \cdot 10^{-30}:\\ \;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b}, \frac{b \cdot -0.6666666666666666}{a}\right)\\ \mathbf{elif}\;b \leq 1.26 \cdot 10^{-113}:\\ \;\;\;\;\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 -3.5e-30)
   (fma 0.5 (/ c b) (/ (* b -0.6666666666666666) a))
   (if (<= b 1.26e-113)
     (/ (- (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 <= -3.5e-30) {
		tmp = fma(0.5, (c / b), ((b * -0.6666666666666666) / a));
	} else if (b <= 1.26e-113) {
		tmp = (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 <= -3.5e-30)
		tmp = fma(0.5, Float64(c / b), Float64(Float64(b * -0.6666666666666666) / a));
	elseif (b <= 1.26e-113)
		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
code[a_, b_, c_] := If[LessEqual[b, -3.5e-30], N[(0.5 * N[(c / b), $MachinePrecision] + N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.26e-113], 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 -3.5 \cdot 10^{-30}:\\
\;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b}, \frac{b \cdot -0.6666666666666666}{a}\right)\\

\mathbf{elif}\;b \leq 1.26 \cdot 10^{-113}:\\
\;\;\;\;\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 < -3.5000000000000003e-30

    1. Initial program 67.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.5000000000000003e-30 < b < 1.26000000000000003e-113

    1. Initial program 77.9%

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

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

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

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

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

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

    if 1.26000000000000003e-113 < b

    1. Initial program 17.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Applied egg-rr86.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.5 \cdot 10^{-30}:\\ \;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b}, \frac{b \cdot -0.6666666666666666}{a}\right)\\ \mathbf{elif}\;b \leq 1.26 \cdot 10^{-113}:\\ \;\;\;\;\frac{\sqrt{-3 \cdot \left(a \cdot c\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 80.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -1.42 \cdot 10^{-34}:\\ \;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b}, \frac{b \cdot -0.6666666666666666}{a}\right)\\ \mathbf{elif}\;b \leq 1.3 \cdot 10^{-114}:\\ \;\;\;\;\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 -1.42e-34)
   (fma 0.5 (/ c b) (/ (* b -0.6666666666666666) a))
   (if (<= b 1.3e-114)
     (/ (- (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 <= -1.42e-34) {
		tmp = fma(0.5, (c / b), ((b * -0.6666666666666666) / a));
	} else if (b <= 1.3e-114) {
		tmp = (sqrt((c * (a * -3.0))) - b) / (a * 3.0);
	} else {
		tmp = (c * -0.5) / b;
	}
	return tmp;
}
function code(a, b, c)
	tmp = 0.0
	if (b <= -1.42e-34)
		tmp = fma(0.5, Float64(c / b), Float64(Float64(b * -0.6666666666666666) / a));
	elseif (b <= 1.3e-114)
		tmp = Float64(Float64(sqrt(Float64(c * Float64(a * -3.0))) - b) / Float64(a * 3.0));
	else
		tmp = Float64(Float64(c * -0.5) / b);
	end
	return tmp
end
code[a_, b_, c_] := If[LessEqual[b, -1.42e-34], N[(0.5 * N[(c / b), $MachinePrecision] + N[(N[(b * -0.6666666666666666), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.3e-114], 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 -1.42 \cdot 10^{-34}:\\
\;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b}, \frac{b \cdot -0.6666666666666666}{a}\right)\\

\mathbf{elif}\;b \leq 1.3 \cdot 10^{-114}:\\
\;\;\;\;\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 < -1.42000000000000003e-34

    1. Initial program 67.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.42000000000000003e-34 < b < 1.30000000000000007e-114

    1. Initial program 77.9%

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

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

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

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

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

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

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

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

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

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

    if 1.30000000000000007e-114 < b

    1. Initial program 17.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Applied egg-rr86.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.42 \cdot 10^{-34}:\\ \;\;\;\;\mathsf{fma}\left(0.5, \frac{c}{b}, \frac{b \cdot -0.6666666666666666}{a}\right)\\ \mathbf{elif}\;b \leq 1.3 \cdot 10^{-114}:\\ \;\;\;\;\frac{\sqrt{c \cdot \left(a \cdot -3\right)} - b}{a \cdot 3}\\ \mathbf{else}:\\ \;\;\;\;\frac{c \cdot -0.5}{b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 66.6% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 73.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. sqr-neg73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000023e-311 < b

    1. Initial program 26.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Applied egg-rr74.0%

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

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

Alternative 11: 66.6% accurate, 7.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -5 \cdot 10^{-311}:\\ \;\;\;\;-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 -5e-311)
   (+ (* -0.6666666666666666 (/ b a)) (* (/ c b) 0.5))
   (/ (* c -0.5) b)))
double code(double a, double b, double c) {
	double tmp;
	if (b <= -5e-311) {
		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 <= (-5d-311)) 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 <= -5e-311) {
		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 <= -5e-311:
		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 <= -5e-311)
		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 <= -5e-311)
		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, -5e-311], 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 -5 \cdot 10^{-311}:\\
\;\;\;\;-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 < -5.00000000000023e-311

    1. Initial program 73.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. sqr-neg73.2%

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

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

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

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

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

    if -5.00000000000023e-311 < b

    1. Initial program 26.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Applied egg-rr74.0%

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

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

Alternative 12: 66.4% accurate, 8.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\frac{1}{a \cdot -3} \cdot \left(b \cdot 2\right)\\

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


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

    1. Initial program 73.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. sqr-neg73.2%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(2 \cdot b\right)} \cdot \frac{1}{a \cdot -3} \]
    10. Step-by-step derivation
      1. *-commutative68.0%

        \[\leadsto \color{blue}{\left(b \cdot 2\right)} \cdot \frac{1}{a \cdot -3} \]
    11. Simplified68.0%

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

    if -5.00000000000023e-311 < b

    1. Initial program 26.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Applied egg-rr74.0%

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

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

Alternative 13: 66.4% accurate, 11.6× speedup?

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

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

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


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

    1. Initial program 73.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. sqr-neg73.2%

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

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

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

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

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

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

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

    if -5.00000000000023e-311 < b

    1. Initial program 26.8%

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

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

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

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

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

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

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

Alternative 14: 66.5% accurate, 11.6× speedup?

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

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

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


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

    1. Initial program 73.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. sqr-neg73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.6666666666666666 \cdot b}{a}} \]
    11. Simplified68.0%

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

    if -5.00000000000023e-311 < b

    1. Initial program 26.8%

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

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

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

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

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

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

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

Alternative 15: 66.5% accurate, 11.6× speedup?

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

    1. Initial program 73.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. sqr-neg73.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.6666666666666666 \cdot b}{a}} \]
    11. Simplified68.0%

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

    if -5.00000000000023e-311 < b

    1. Initial program 26.8%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{-0.5 \cdot c}{b}} \]
    7. Applied egg-rr74.0%

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

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

Alternative 16: 34.3% accurate, 23.2× speedup?

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

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

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

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

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

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

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

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

    \[\leadsto \frac{c}{b} \cdot -0.5 \]
  7. Add Preprocessing

Reproduce

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