Cubic critical

Percentage Accurate: 51.3% → 86.7%
Time: 13.9s
Alternatives: 8
Speedup: 16.4×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 8 alternatives:

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

Initial Program: 51.3% accurate, 1.0× speedup?

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

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

Alternative 1: 86.7% accurate, 0.5× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{-c}{\mathsf{fma}\left(0.5, -3 \cdot \left(a \cdot \frac{c}{b}\right), b \cdot 2\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -1.35e42

    1. Initial program 62.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot c}}{b + \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg12.9%

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

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

      \[\leadsto \color{blue}{2 \cdot \frac{b}{a \cdot {\left(\sqrt{-3}\right)}^{2}}} \]
    11. Step-by-step derivation
      1. associate-*r/0.0%

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

        \[\leadsto \frac{2 \cdot b}{\color{blue}{{\left(\sqrt{-3}\right)}^{2} \cdot a}} \]
      3. times-frac0.0%

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{-3} \cdot \sqrt{-3}}} \cdot \frac{b}{a} \]
      5. rem-square-sqrt95.1%

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

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

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

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

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

    if -1.35e42 < b < -3.59999999999999984e-254

    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. /-rgt-identity82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.59999999999999984e-254 < b < 1e-30

    1. Initial program 62.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot c}}{b + \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg86.2%

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

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

    if 1e-30 < b

    1. Initial program 15.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. neg-sub015.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot c}}{b + \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg59.2%

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

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

      \[\leadsto \frac{-c}{\color{blue}{0.5 \cdot \frac{c \cdot \left(a \cdot {\left(\sqrt{-3}\right)}^{2}\right)}{b} + 2 \cdot b}} \]
    11. Step-by-step derivation
      1. fma-def0.0%

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

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

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

        \[\leadsto \frac{-c}{\mathsf{fma}\left(0.5, \frac{\left(c \cdot a\right) \cdot \color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)}}{b \cdot 1}, 2 \cdot b\right)} \]
      5. rem-square-sqrt87.5%

        \[\leadsto \frac{-c}{\mathsf{fma}\left(0.5, \frac{\left(c \cdot a\right) \cdot \color{blue}{-3}}{b \cdot 1}, 2 \cdot b\right)} \]
      6. times-frac87.5%

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

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

        \[\leadsto \frac{-c}{\mathsf{fma}\left(0.5, \color{blue}{\left(a \cdot \frac{c}{b}\right)} \cdot \frac{-3}{1}, 2 \cdot b\right)} \]
      9. metadata-eval89.9%

        \[\leadsto \frac{-c}{\mathsf{fma}\left(0.5, \left(a \cdot \frac{c}{b}\right) \cdot \color{blue}{-3}, 2 \cdot b\right)} \]
      10. *-commutative89.9%

        \[\leadsto \frac{-c}{\mathsf{fma}\left(0.5, \left(a \cdot \frac{c}{b}\right) \cdot -3, \color{blue}{b \cdot 2}\right)} \]
    12. Simplified89.9%

      \[\leadsto \frac{-c}{\color{blue}{\mathsf{fma}\left(0.5, \left(a \cdot \frac{c}{b}\right) \cdot -3, b \cdot 2\right)}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification89.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.35 \cdot 10^{+42}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq -3.6 \cdot 10^{-254}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{\mathsf{fma}\left(b, b, a \cdot \left(c \cdot -3\right)\right)}}{a}\\ \mathbf{elif}\;b \leq 10^{-30}:\\ \;\;\;\;\frac{-c}{b + \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{\mathsf{fma}\left(0.5, -3 \cdot \left(a \cdot \frac{c}{b}\right), b \cdot 2\right)}\\ \end{array} \]

Alternative 2: 86.7% accurate, 0.5× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{-c}{\mathsf{fma}\left(0.5, -3 \cdot \left(a \cdot \frac{c}{b}\right), b \cdot 2\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -1.35e42

    1. Initial program 62.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot c}}{b + \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg12.9%

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

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

      \[\leadsto \color{blue}{2 \cdot \frac{b}{a \cdot {\left(\sqrt{-3}\right)}^{2}}} \]
    11. Step-by-step derivation
      1. associate-*r/0.0%

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

        \[\leadsto \frac{2 \cdot b}{\color{blue}{{\left(\sqrt{-3}\right)}^{2} \cdot a}} \]
      3. times-frac0.0%

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{-3} \cdot \sqrt{-3}}} \cdot \frac{b}{a} \]
      5. rem-square-sqrt95.1%

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

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

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

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

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

    if -1.35e42 < b < -3.7000000000000004e-254

    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. /-rgt-identity82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.7000000000000004e-254 < b < 9.5000000000000008e-31

    1. Initial program 62.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot c}}{b + \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg86.2%

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

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

    if 9.5000000000000008e-31 < b

    1. Initial program 15.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. neg-sub015.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot c}}{b + \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg59.2%

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

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

      \[\leadsto \frac{-c}{\color{blue}{0.5 \cdot \frac{c \cdot \left(a \cdot {\left(\sqrt{-3}\right)}^{2}\right)}{b} + 2 \cdot b}} \]
    11. Step-by-step derivation
      1. fma-def0.0%

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

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

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

        \[\leadsto \frac{-c}{\mathsf{fma}\left(0.5, \frac{\left(c \cdot a\right) \cdot \color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)}}{b \cdot 1}, 2 \cdot b\right)} \]
      5. rem-square-sqrt87.5%

        \[\leadsto \frac{-c}{\mathsf{fma}\left(0.5, \frac{\left(c \cdot a\right) \cdot \color{blue}{-3}}{b \cdot 1}, 2 \cdot b\right)} \]
      6. times-frac87.5%

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

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

        \[\leadsto \frac{-c}{\mathsf{fma}\left(0.5, \color{blue}{\left(a \cdot \frac{c}{b}\right)} \cdot \frac{-3}{1}, 2 \cdot b\right)} \]
      9. metadata-eval89.9%

        \[\leadsto \frac{-c}{\mathsf{fma}\left(0.5, \left(a \cdot \frac{c}{b}\right) \cdot \color{blue}{-3}, 2 \cdot b\right)} \]
      10. *-commutative89.9%

        \[\leadsto \frac{-c}{\mathsf{fma}\left(0.5, \left(a \cdot \frac{c}{b}\right) \cdot -3, \color{blue}{b \cdot 2}\right)} \]
    12. Simplified89.9%

      \[\leadsto \frac{-c}{\color{blue}{\mathsf{fma}\left(0.5, \left(a \cdot \frac{c}{b}\right) \cdot -3, b \cdot 2\right)}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification89.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.35 \cdot 10^{+42}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq -3.7 \cdot 10^{-254}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}}{a}\\ \mathbf{elif}\;b \leq 9.5 \cdot 10^{-31}:\\ \;\;\;\;\frac{-c}{b + \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{\mathsf{fma}\left(0.5, -3 \cdot \left(a \cdot \frac{c}{b}\right), b \cdot 2\right)}\\ \end{array} \]

Alternative 3: 83.6% accurate, 1.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{-c}{\mathsf{fma}\left(0.5, -3 \cdot \left(a \cdot \frac{c}{b}\right), b \cdot 2\right)}\\


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

    1. Initial program 62.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot c}}{b + \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg12.9%

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

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

      \[\leadsto \color{blue}{2 \cdot \frac{b}{a \cdot {\left(\sqrt{-3}\right)}^{2}}} \]
    11. Step-by-step derivation
      1. associate-*r/0.0%

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

        \[\leadsto \frac{2 \cdot b}{\color{blue}{{\left(\sqrt{-3}\right)}^{2} \cdot a}} \]
      3. times-frac0.0%

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{-3} \cdot \sqrt{-3}}} \cdot \frac{b}{a} \]
      5. rem-square-sqrt95.1%

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

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

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

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

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

    if -1.35e42 < b < 1.25e-137

    1. Initial program 81.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.25e-137 < b

    1. Initial program 19.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot c}}{b + \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg64.6%

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

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

      \[\leadsto \frac{-c}{\color{blue}{0.5 \cdot \frac{c \cdot \left(a \cdot {\left(\sqrt{-3}\right)}^{2}\right)}{b} + 2 \cdot b}} \]
    11. Step-by-step derivation
      1. fma-def0.0%

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

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

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

        \[\leadsto \frac{-c}{\mathsf{fma}\left(0.5, \frac{\left(c \cdot a\right) \cdot \color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)}}{b \cdot 1}, 2 \cdot b\right)} \]
      5. rem-square-sqrt82.3%

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

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

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

        \[\leadsto \frac{-c}{\mathsf{fma}\left(0.5, \color{blue}{\left(a \cdot \frac{c}{b}\right)} \cdot \frac{-3}{1}, 2 \cdot b\right)} \]
      9. metadata-eval84.2%

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

        \[\leadsto \frac{-c}{\mathsf{fma}\left(0.5, \left(a \cdot \frac{c}{b}\right) \cdot -3, \color{blue}{b \cdot 2}\right)} \]
    12. Simplified84.2%

      \[\leadsto \frac{-c}{\color{blue}{\mathsf{fma}\left(0.5, \left(a \cdot \frac{c}{b}\right) \cdot -3, b \cdot 2\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification86.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.35 \cdot 10^{+42}:\\ \;\;\;\;\frac{b \cdot -0.6666666666666666}{a}\\ \mathbf{elif}\;b \leq 1.25 \cdot 10^{-137}:\\ \;\;\;\;-0.3333333333333333 \cdot \frac{b - \sqrt{b \cdot b - c \cdot \left(a \cdot 3\right)}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{\mathsf{fma}\left(0.5, -3 \cdot \left(a \cdot \frac{c}{b}\right), b \cdot 2\right)}\\ \end{array} \]

Alternative 4: 79.3% accurate, 1.0× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{-c}{\mathsf{fma}\left(0.5, -3 \cdot \left(a \cdot \frac{c}{b}\right), b \cdot 2\right)}\\


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

    1. Initial program 67.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \frac{b}{a \cdot {\left(\sqrt{-3}\right)}^{2}}} \]
    11. Step-by-step derivation
      1. associate-*r/0.0%

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

        \[\leadsto \frac{2 \cdot b}{\color{blue}{{\left(\sqrt{-3}\right)}^{2} \cdot a}} \]
      3. times-frac0.0%

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{-3} \cdot \sqrt{-3}}} \cdot \frac{b}{a} \]
      5. rem-square-sqrt90.7%

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

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

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

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

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

    if -2.09999999999999993e-39 < b < 9.99999999999999978e-138

    1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999978e-138 < b

    1. Initial program 19.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{\color{blue}{-1 \cdot c}}{b + \mathsf{hypot}\left(b, \sqrt{c \cdot \left(a \cdot -3\right)}\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg64.6%

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

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

      \[\leadsto \frac{-c}{\color{blue}{0.5 \cdot \frac{c \cdot \left(a \cdot {\left(\sqrt{-3}\right)}^{2}\right)}{b} + 2 \cdot b}} \]
    11. Step-by-step derivation
      1. fma-def0.0%

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

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

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

        \[\leadsto \frac{-c}{\mathsf{fma}\left(0.5, \frac{\left(c \cdot a\right) \cdot \color{blue}{\left(\sqrt{-3} \cdot \sqrt{-3}\right)}}{b \cdot 1}, 2 \cdot b\right)} \]
      5. rem-square-sqrt82.3%

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

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

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

        \[\leadsto \frac{-c}{\mathsf{fma}\left(0.5, \color{blue}{\left(a \cdot \frac{c}{b}\right)} \cdot \frac{-3}{1}, 2 \cdot b\right)} \]
      9. metadata-eval84.2%

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

        \[\leadsto \frac{-c}{\mathsf{fma}\left(0.5, \left(a \cdot \frac{c}{b}\right) \cdot -3, \color{blue}{b \cdot 2}\right)} \]
    12. Simplified84.2%

      \[\leadsto \frac{-c}{\color{blue}{\mathsf{fma}\left(0.5, \left(a \cdot \frac{c}{b}\right) \cdot -3, b \cdot 2\right)}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.9%

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

Alternative 5: 79.2% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 67.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \frac{b}{a \cdot {\left(\sqrt{-3}\right)}^{2}}} \]
    11. Step-by-step derivation
      1. associate-*r/0.0%

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

        \[\leadsto \frac{2 \cdot b}{\color{blue}{{\left(\sqrt{-3}\right)}^{2} \cdot a}} \]
      3. times-frac0.0%

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{-3} \cdot \sqrt{-3}}} \cdot \frac{b}{a} \]
      5. rem-square-sqrt90.7%

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

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

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

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

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

    if -1.9999999999999999e-40 < b < 1.2e-137

    1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2e-137 < b

    1. Initial program 19.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 67.9% accurate, 16.4× speedup?

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

    1. Initial program 72.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 29.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 67.9% accurate, 16.4× speedup?

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

    1. Initial program 72.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \frac{b}{a \cdot {\left(\sqrt{-3}\right)}^{2}}} \]
    11. Step-by-step derivation
      1. associate-*r/0.0%

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

        \[\leadsto \frac{2 \cdot b}{\color{blue}{{\left(\sqrt{-3}\right)}^{2} \cdot a}} \]
      3. times-frac0.0%

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

        \[\leadsto \frac{2}{\color{blue}{\sqrt{-3} \cdot \sqrt{-3}}} \cdot \frac{b}{a} \]
      5. rem-square-sqrt63.0%

        \[\leadsto \frac{2}{\color{blue}{-3}} \cdot \frac{b}{a} \]
      6. metadata-eval63.0%

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

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

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

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

    if -4.999999999999985e-310 < b

    1. Initial program 29.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 35.5% 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 50.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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