quadp (p42, positive)

Percentage Accurate: 52.0% → 86.7%
Time: 12.8s
Alternatives: 8
Speedup: 12.9×

Specification

?
\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - (4.0 * (a * c))))) / (2.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) - (4.0d0 * (a * c))))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
	return (-b + Math.sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a);
}
def code(a, b, c):
	return (-b + math.sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a)
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(a * c))))) / Float64(2.0 * a))
end
function tmp = code(a, b, c)
	tmp = (-b + sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a);
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\left(-b\right) + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \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: 52.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(-b\right) + \sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)}}{2 \cdot a} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (/ (+ (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))
double code(double a, double b, double c) {
	return (-b + sqrt(((b * b) - (4.0 * (a * c))))) / (2.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) - (4.0d0 * (a * c))))) / (2.0d0 * a)
end function
public static double code(double a, double b, double c) {
	return (-b + Math.sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a);
}
def code(a, b, c):
	return (-b + math.sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a)
function code(a, b, c)
	return Float64(Float64(Float64(-b) + sqrt(Float64(Float64(b * b) - Float64(4.0 * Float64(a * c))))) / Float64(2.0 * a))
end
function tmp = code(a, b, c)
	tmp = (-b + sqrt(((b * b) - (4.0 * (a * c))))) / (2.0 * a);
end
code[a_, b_, c_] := N[(N[((-b) + N[Sqrt[N[(N[(b * b), $MachinePrecision] - N[(4.0 * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(2.0 * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 86.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.2 \cdot 10^{+63}:\\
\;\;\;\;\frac{b}{-a}\\

\mathbf{elif}\;b \leq 1.52 \cdot 10^{-93}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - b}{a \cdot 2}\\

\mathbf{elif}\;b \leq 9.6 \cdot 10^{+60}:\\
\;\;\;\;\frac{\frac{a \cdot \left(c \cdot \left(-4\right)\right)}{b + \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)}}}{a \cdot 2}\\

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


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

    1. Initial program 64.8%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg96.7%

        \[\leadsto \color{blue}{-\frac{b}{a}} \]
      2. distribute-neg-frac296.7%

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

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

    if -7.19999999999999998e63 < b < 1.52e-93

    1. Initial program 82.2%

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

    if 1.52e-93 < b < 9.6000000000000001e60

    1. Initial program 44.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \sqrt{{b}^{2} - {\left(\sqrt[3]{a \cdot \left(c \cdot 4\right)}\right)}^{3}} \cdot \sqrt{\color{blue}{{b}^{2}} - {\left(\sqrt[3]{a \cdot \left(c \cdot 4\right)}\right)}^{3}}}{\left(-b\right) - \sqrt{b \cdot b - {\left(\sqrt[3]{a \cdot \left(c \cdot 4\right)}\right)}^{3}}}}{a \cdot 2} \]
      5. add-sqr-sqrt43.6%

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

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \color{blue}{\left(\sqrt[3]{a \cdot \left(c \cdot 4\right)} \cdot \sqrt[3]{a \cdot \left(c \cdot 4\right)}\right) \cdot \sqrt[3]{a \cdot \left(c \cdot 4\right)}}\right)}{\left(-b\right) - \sqrt{b \cdot b - {\left(\sqrt[3]{a \cdot \left(c \cdot 4\right)}\right)}^{3}}}}{a \cdot 2} \]
      7. add-cube-cbrt43.7%

        \[\leadsto \frac{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - \color{blue}{a \cdot \left(c \cdot 4\right)}\right)}{\left(-b\right) - \sqrt{b \cdot b - {\left(\sqrt[3]{a \cdot \left(c \cdot 4\right)}\right)}^{3}}}}{a \cdot 2} \]
    8. Applied egg-rr43.7%

      \[\leadsto \frac{\color{blue}{\frac{{\left(-b\right)}^{2} - \left({b}^{2} - a \cdot \left(c \cdot 4\right)\right)}{\left(-b\right) - \sqrt{{b}^{2} - a \cdot \left(c \cdot 4\right)}}}}{a \cdot 2} \]
    9. Step-by-step derivation
      1. associate--r-79.6%

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

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

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

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

      \[\leadsto \frac{\color{blue}{\frac{\left({b}^{2} - {b}^{2}\right) + a \cdot \left(c \cdot 4\right)}{\left(-b\right) - \sqrt{{b}^{2} - a \cdot \left(c \cdot 4\right)}}}}{a \cdot 2} \]
    11. Step-by-step derivation
      1. div-inv79.5%

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

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

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

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

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(a, c \cdot 4, 0\right) \cdot \frac{1}{\left(-b\right) - \sqrt{{b}^{2} - a \cdot \left(c \cdot 4\right)}}}}{a \cdot 2} \]
    13. Step-by-step derivation
      1. associate-*r/79.6%

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

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

        \[\leadsto \frac{\frac{\color{blue}{a \cdot \left(c \cdot 4\right) + 0}}{\left(-b\right) - \sqrt{{b}^{2} - a \cdot \left(c \cdot 4\right)}}}{a \cdot 2} \]
      4. +-rgt-identity79.6%

        \[\leadsto \frac{\frac{\color{blue}{a \cdot \left(c \cdot 4\right)}}{\left(-b\right) - \sqrt{{b}^{2} - a \cdot \left(c \cdot 4\right)}}}{a \cdot 2} \]
      5. unpow279.6%

        \[\leadsto \frac{\frac{a \cdot \left(c \cdot 4\right)}{\left(-b\right) - \sqrt{\color{blue}{b \cdot b} - a \cdot \left(c \cdot 4\right)}}}{a \cdot 2} \]
      6. fma-neg79.6%

        \[\leadsto \frac{\frac{a \cdot \left(c \cdot 4\right)}{\left(-b\right) - \sqrt{\color{blue}{\mathsf{fma}\left(b, b, -a \cdot \left(c \cdot 4\right)\right)}}}}{a \cdot 2} \]
      7. associate-*r*79.6%

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

        \[\leadsto \frac{\frac{a \cdot \left(c \cdot 4\right)}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, -\color{blue}{4 \cdot \left(a \cdot c\right)}\right)}}}{a \cdot 2} \]
      9. distribute-lft-neg-in79.6%

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

        \[\leadsto \frac{\frac{a \cdot \left(c \cdot 4\right)}{\left(-b\right) - \sqrt{\mathsf{fma}\left(b, b, \color{blue}{-4} \cdot \left(a \cdot c\right)\right)}}}{a \cdot 2} \]
    14. Simplified79.6%

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

    if 9.6000000000000001e60 < b

    1. Initial program 9.3%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-196.1%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    7. Simplified96.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7.2 \cdot 10^{+63}:\\ \;\;\;\;\frac{b}{-a}\\ \mathbf{elif}\;b \leq 1.52 \cdot 10^{-93}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - b}{a \cdot 2}\\ \mathbf{elif}\;b \leq 9.6 \cdot 10^{+60}:\\ \;\;\;\;\frac{\frac{a \cdot \left(c \cdot \left(-4\right)\right)}{b + \sqrt{\mathsf{fma}\left(b, b, \left(a \cdot c\right) \cdot -4\right)}}}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 85.9% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.2 \cdot 10^{+63}:\\
\;\;\;\;\frac{b}{-a}\\

\mathbf{elif}\;b \leq 3.1 \cdot 10^{-79}:\\
\;\;\;\;\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - b}{a \cdot 2}\\

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


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

    1. Initial program 64.8%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg96.7%

        \[\leadsto \color{blue}{-\frac{b}{a}} \]
      2. distribute-neg-frac296.7%

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

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

    if -7.19999999999999998e63 < b < 3.0999999999999999e-79

    1. Initial program 82.4%

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

    if 3.0999999999999999e-79 < b

    1. Initial program 18.6%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-186.4%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    7. Simplified86.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7.2 \cdot 10^{+63}:\\ \;\;\;\;\frac{b}{-a}\\ \mathbf{elif}\;b \leq 3.1 \cdot 10^{-79}:\\ \;\;\;\;\frac{\sqrt{b \cdot b - 4 \cdot \left(a \cdot c\right)} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 80.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 72.8%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg95.4%

        \[\leadsto \color{blue}{-\frac{b}{a}} \]
      2. distribute-neg-frac295.4%

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

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

    if -3.29999999999999998e-27 < b < 6.00000000000000033e-87

    1. Initial program 78.0%

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + {\color{blue}{\left({\left(b \cdot b - 4 \cdot \left(a \cdot c\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2}}{a \cdot 2} \]
      5. sub-neg77.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\color{blue}{\left(b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)\right)}}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      6. +-commutative77.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\color{blue}{\left(\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b\right)}}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      7. distribute-lft-neg-in77.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\color{blue}{\left(-4\right) \cdot \left(a \cdot c\right)} + b \cdot b\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      8. *-commutative77.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\left(-4\right) \cdot \color{blue}{\left(c \cdot a\right)} + b \cdot b\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      9. associate-*r*77.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\color{blue}{\left(\left(-4\right) \cdot c\right) \cdot a} + b \cdot b\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      10. fma-define77.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\color{blue}{\left(\mathsf{fma}\left(\left(-4\right) \cdot c, a, b \cdot b\right)\right)}}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      11. metadata-eval77.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(\color{blue}{-4} \cdot c, a, b \cdot b\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      12. pow277.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(-4 \cdot c, a, \color{blue}{{b}^{2}}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      13. metadata-eval77.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(-4 \cdot c, a, {b}^{2}\right)\right)}^{\color{blue}{0.25}}\right)}^{2}}{a \cdot 2} \]
    6. Applied egg-rr77.8%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left({\left(\mathsf{fma}\left(-4 \cdot c, a, {b}^{2}\right)\right)}^{0.25}\right)}^{2}}}{a \cdot 2} \]
    7. Taylor expanded in b around 0 68.5%

      \[\leadsto \frac{\left(-b\right) + {\color{blue}{\left({\left(-4 \cdot \left(a \cdot c\right)\right)}^{0.25}\right)}}^{2}}{a \cdot 2} \]
    8. Step-by-step derivation
      1. pow-pow68.6%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left(-4 \cdot \left(a \cdot c\right)\right)}^{\left(0.25 \cdot 2\right)}}}{a \cdot 2} \]
      2. pow-to-exp64.2%

        \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(-4 \cdot \left(a \cdot c\right)\right) \cdot \left(0.25 \cdot 2\right)}}}{a \cdot 2} \]
      3. associate-*r*64.2%

        \[\leadsto \frac{\left(-b\right) + e^{\log \color{blue}{\left(\left(-4 \cdot a\right) \cdot c\right)} \cdot \left(0.25 \cdot 2\right)}}{a \cdot 2} \]
      4. metadata-eval64.2%

        \[\leadsto \frac{\left(-b\right) + e^{\log \left(\left(-4 \cdot a\right) \cdot c\right) \cdot \color{blue}{0.5}}}{a \cdot 2} \]
    9. Applied egg-rr64.2%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{e^{\log \left(\left(-4 \cdot a\right) \cdot c\right) \cdot 0.5}}}{a \cdot 2} \]
    10. Step-by-step derivation
      1. +-commutative64.2%

        \[\leadsto \frac{\color{blue}{e^{\log \left(\left(-4 \cdot a\right) \cdot c\right) \cdot 0.5} + \left(-b\right)}}{a \cdot 2} \]
      2. *-un-lft-identity64.2%

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

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(1, e^{\log \left(\left(-4 \cdot a\right) \cdot c\right) \cdot 0.5}, -b\right)}}{a \cdot 2} \]
      4. exp-to-pow68.6%

        \[\leadsto \frac{\mathsf{fma}\left(1, \color{blue}{{\left(\left(-4 \cdot a\right) \cdot c\right)}^{0.5}}, -b\right)}{a \cdot 2} \]
      5. pow1/268.6%

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

        \[\leadsto \frac{\mathsf{fma}\left(1, \sqrt{\color{blue}{c \cdot \left(-4 \cdot a\right)}}, -b\right)}{a \cdot 2} \]
      7. *-commutative68.6%

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\left(a \cdot c\right) \cdot \color{blue}{\left(-4\right)}} - b}{a \cdot 2} \]
      7. distribute-rgt-neg-in68.6%

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

        \[\leadsto \frac{\sqrt{-\color{blue}{4 \cdot \left(a \cdot c\right)}} - b}{a \cdot 2} \]
      9. distribute-lft-neg-in68.6%

        \[\leadsto \frac{\sqrt{\color{blue}{\left(-4\right) \cdot \left(a \cdot c\right)}} - b}{a \cdot 2} \]
      10. metadata-eval68.6%

        \[\leadsto \frac{\sqrt{\color{blue}{-4} \cdot \left(a \cdot c\right)} - b}{a \cdot 2} \]
    13. Simplified68.6%

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

    if 6.00000000000000033e-87 < b

    1. Initial program 19.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-186.0%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    7. Simplified86.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.3 \cdot 10^{-27}:\\ \;\;\;\;\frac{b}{-a}\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-87}:\\ \;\;\;\;\frac{\sqrt{\left(a \cdot c\right) \cdot -4} - b}{a \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 79.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.55 \cdot 10^{-27}:\\
\;\;\;\;\frac{b}{-a}\\

\mathbf{elif}\;b \leq 3.1 \cdot 10^{-83}:\\
\;\;\;\;\frac{0.5}{a} \cdot \left(b + \sqrt{c \cdot \left(a \cdot -4\right)}\right)\\

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


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

    1. Initial program 72.8%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg95.4%

        \[\leadsto \color{blue}{-\frac{b}{a}} \]
      2. distribute-neg-frac295.4%

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

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

    if -1.5499999999999999e-27 < b < 3.09999999999999992e-83

    1. Initial program 78.0%

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

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

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

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

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

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

        \[\leadsto \frac{\left(-b\right) + {\color{blue}{\left({\left(b \cdot b - 4 \cdot \left(a \cdot c\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}}^{2}}{a \cdot 2} \]
      5. sub-neg77.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\color{blue}{\left(b \cdot b + \left(-4 \cdot \left(a \cdot c\right)\right)\right)}}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      6. +-commutative77.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\color{blue}{\left(\left(-4 \cdot \left(a \cdot c\right)\right) + b \cdot b\right)}}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      7. distribute-lft-neg-in77.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\color{blue}{\left(-4\right) \cdot \left(a \cdot c\right)} + b \cdot b\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      8. *-commutative77.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\left(-4\right) \cdot \color{blue}{\left(c \cdot a\right)} + b \cdot b\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      9. associate-*r*77.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\color{blue}{\left(\left(-4\right) \cdot c\right) \cdot a} + b \cdot b\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      10. fma-define77.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\color{blue}{\left(\mathsf{fma}\left(\left(-4\right) \cdot c, a, b \cdot b\right)\right)}}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      11. metadata-eval77.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(\color{blue}{-4} \cdot c, a, b \cdot b\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      12. pow277.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(-4 \cdot c, a, \color{blue}{{b}^{2}}\right)\right)}^{\left(\frac{0.5}{2}\right)}\right)}^{2}}{a \cdot 2} \]
      13. metadata-eval77.8%

        \[\leadsto \frac{\left(-b\right) + {\left({\left(\mathsf{fma}\left(-4 \cdot c, a, {b}^{2}\right)\right)}^{\color{blue}{0.25}}\right)}^{2}}{a \cdot 2} \]
    6. Applied egg-rr77.8%

      \[\leadsto \frac{\left(-b\right) + \color{blue}{{\left({\left(\mathsf{fma}\left(-4 \cdot c, a, {b}^{2}\right)\right)}^{0.25}\right)}^{2}}}{a \cdot 2} \]
    7. Taylor expanded in b around 0 68.5%

      \[\leadsto \frac{\left(-b\right) + {\color{blue}{\left({\left(-4 \cdot \left(a \cdot c\right)\right)}^{0.25}\right)}}^{2}}{a \cdot 2} \]
    8. Step-by-step derivation
      1. *-un-lft-identity68.5%

        \[\leadsto \color{blue}{1 \cdot \frac{\left(-b\right) + {\left({\left(-4 \cdot \left(a \cdot c\right)\right)}^{0.25}\right)}^{2}}{a \cdot 2}} \]
      2. *-un-lft-identity68.5%

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

        \[\leadsto 1 \cdot \frac{1 \cdot \left(\left(-b\right) + {\left({\left(-4 \cdot \left(a \cdot c\right)\right)}^{0.25}\right)}^{2}\right)}{\color{blue}{2 \cdot a}} \]
      4. times-frac68.5%

        \[\leadsto 1 \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{\left(-b\right) + {\left({\left(-4 \cdot \left(a \cdot c\right)\right)}^{0.25}\right)}^{2}}{a}\right)} \]
      5. metadata-eval68.5%

        \[\leadsto 1 \cdot \left(\color{blue}{0.5} \cdot \frac{\left(-b\right) + {\left({\left(-4 \cdot \left(a \cdot c\right)\right)}^{0.25}\right)}^{2}}{a}\right) \]
      6. add-sqr-sqrt42.5%

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

        \[\leadsto 1 \cdot \left(0.5 \cdot \frac{\color{blue}{\sqrt{\left(-b\right) \cdot \left(-b\right)}} + {\left({\left(-4 \cdot \left(a \cdot c\right)\right)}^{0.25}\right)}^{2}}{a}\right) \]
      8. sqr-neg68.1%

        \[\leadsto 1 \cdot \left(0.5 \cdot \frac{\sqrt{\color{blue}{b \cdot b}} + {\left({\left(-4 \cdot \left(a \cdot c\right)\right)}^{0.25}\right)}^{2}}{a}\right) \]
      9. sqrt-prod25.7%

        \[\leadsto 1 \cdot \left(0.5 \cdot \frac{\color{blue}{\sqrt{b} \cdot \sqrt{b}} + {\left({\left(-4 \cdot \left(a \cdot c\right)\right)}^{0.25}\right)}^{2}}{a}\right) \]
      10. add-sqr-sqrt66.9%

        \[\leadsto 1 \cdot \left(0.5 \cdot \frac{\color{blue}{b} + {\left({\left(-4 \cdot \left(a \cdot c\right)\right)}^{0.25}\right)}^{2}}{a}\right) \]
      11. pow-pow67.0%

        \[\leadsto 1 \cdot \left(0.5 \cdot \frac{b + \color{blue}{{\left(-4 \cdot \left(a \cdot c\right)\right)}^{\left(0.25 \cdot 2\right)}}}{a}\right) \]
      12. metadata-eval67.0%

        \[\leadsto 1 \cdot \left(0.5 \cdot \frac{b + {\left(-4 \cdot \left(a \cdot c\right)\right)}^{\color{blue}{0.5}}}{a}\right) \]
      13. pow1/267.0%

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

        \[\leadsto 1 \cdot \left(0.5 \cdot \frac{b + \sqrt{\color{blue}{\left(-4 \cdot a\right) \cdot c}}}{a}\right) \]
    9. Applied egg-rr67.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.09999999999999992e-83 < b

    1. Initial program 19.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-186.0%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    7. Simplified86.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.55 \cdot 10^{-27}:\\ \;\;\;\;\frac{b}{-a}\\ \mathbf{elif}\;b \leq 3.1 \cdot 10^{-83}:\\ \;\;\;\;\frac{0.5}{a} \cdot \left(b + \sqrt{c \cdot \left(a \cdot -4\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 72.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.2 \cdot 10^{-158}:\\
\;\;\;\;\frac{b}{-a}\\

\mathbf{elif}\;b \leq 1.85 \cdot 10^{-82}:\\
\;\;\;\;\sqrt{c \cdot \frac{-4}{a}} \cdot \left(--0.5\right)\\

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


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

    1. Initial program 76.7%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg79.5%

        \[\leadsto \color{blue}{-\frac{b}{a}} \]
      2. distribute-neg-frac279.5%

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

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

    if -7.19999999999999982e-158 < b < 1.85e-82

    1. Initial program 72.0%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \left(\sqrt{\frac{c \cdot {\left(\sqrt[3]{-4}\right)}^{3}}{a}} \cdot {\left(\sqrt{-1}\right)}^{2}\right)} \]
    8. Step-by-step derivation
      1. *-commutative0.0%

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

        \[\leadsto -0.5 \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot \sqrt{\frac{c \cdot {\left(\sqrt[3]{-4}\right)}^{3}}{a}}\right) \]
      3. rem-square-sqrt43.4%

        \[\leadsto -0.5 \cdot \left(\color{blue}{-1} \cdot \sqrt{\frac{c \cdot {\left(\sqrt[3]{-4}\right)}^{3}}{a}}\right) \]
      4. rem-cube-cbrt43.8%

        \[\leadsto -0.5 \cdot \left(-1 \cdot \sqrt{\frac{c \cdot \color{blue}{-4}}{a}}\right) \]
      5. associate-/l*43.8%

        \[\leadsto -0.5 \cdot \left(-1 \cdot \sqrt{\color{blue}{c \cdot \frac{-4}{a}}}\right) \]
    9. Simplified43.8%

      \[\leadsto \color{blue}{-0.5 \cdot \left(-1 \cdot \sqrt{c \cdot \frac{-4}{a}}\right)} \]

    if 1.85e-82 < b

    1. Initial program 19.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-186.0%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    7. Simplified86.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -7.2 \cdot 10^{-158}:\\ \;\;\;\;\frac{b}{-a}\\ \mathbf{elif}\;b \leq 1.85 \cdot 10^{-82}:\\ \;\;\;\;\sqrt{c \cdot \frac{-4}{a}} \cdot \left(--0.5\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c}{-b}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 69.1% accurate, 12.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.5 \cdot 10^{-302}:\\
\;\;\;\;\frac{b}{-a}\\

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


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

    1. Initial program 76.5%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg68.1%

        \[\leadsto \color{blue}{-\frac{b}{a}} \]
      2. distribute-neg-frac268.1%

        \[\leadsto \color{blue}{\frac{b}{-a}} \]
    7. Simplified68.1%

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

    if 3.5000000000000001e-302 < b

    1. Initial program 30.9%

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

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

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

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

        \[\leadsto \color{blue}{\frac{-1 \cdot c}{b}} \]
      2. neg-mul-168.8%

        \[\leadsto \frac{\color{blue}{-c}}{b} \]
    7. Simplified68.8%

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

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

Alternative 7: 45.0% accurate, 12.9× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{0}{a}\\


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

    1. Initial program 77.1%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{b}{a}} \]
    6. Step-by-step derivation
      1. mul-1-neg68.6%

        \[\leadsto \color{blue}{-\frac{b}{a}} \]
      2. distribute-neg-frac268.6%

        \[\leadsto \color{blue}{\frac{b}{-a}} \]
    7. Simplified68.6%

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

    if -1.9999999999999e-311 < b

    1. Initial program 30.7%

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

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

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

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

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

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

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

      \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{{\left(\sqrt[3]{a \cdot \left(c \cdot 4\right)}\right)}^{3}}}}{a \cdot 2} \]
    7. Step-by-step derivation
      1. clear-num30.6%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\frac{a \cdot 2}{\mathsf{fma}\left(-1, b, \sqrt{{b}^{2} - a \cdot \left(c \cdot 4\right)}\right)}}} \]
    11. Taylor expanded in a around 0 21.2%

      \[\leadsto \color{blue}{0.5 \cdot \frac{b + -1 \cdot b}{a}} \]
    12. Step-by-step derivation
      1. associate-*r/21.2%

        \[\leadsto \color{blue}{\frac{0.5 \cdot \left(b + -1 \cdot b\right)}{a}} \]
      2. distribute-rgt1-in21.2%

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

        \[\leadsto \frac{0.5 \cdot \left(\color{blue}{0} \cdot b\right)}{a} \]
      4. mul0-lft21.2%

        \[\leadsto \frac{0.5 \cdot \color{blue}{0}}{a} \]
      5. metadata-eval21.2%

        \[\leadsto \frac{\color{blue}{0}}{a} \]
    13. Simplified21.2%

      \[\leadsto \color{blue}{\frac{0}{a}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 8: 11.2% accurate, 38.7× speedup?

\[\begin{array}{l} \\ \frac{0}{a} \end{array} \]
(FPCore (a b c) :precision binary64 (/ 0.0 a))
double code(double a, double b, double c) {
	return 0.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 = 0.0d0 / a
end function
public static double code(double a, double b, double c) {
	return 0.0 / a;
}
def code(a, b, c):
	return 0.0 / a
function code(a, b, c)
	return Float64(0.0 / a)
end
function tmp = code(a, b, c)
	tmp = 0.0 / a;
end
code[a_, b_, c_] := N[(0.0 / a), $MachinePrecision]
\begin{array}{l}

\\
\frac{0}{a}
\end{array}
Derivation
  1. Initial program 54.2%

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

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

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

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

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

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

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

    \[\leadsto \frac{\left(-b\right) + \sqrt{b \cdot b - \color{blue}{{\left(\sqrt[3]{a \cdot \left(c \cdot 4\right)}\right)}^{3}}}}{a \cdot 2} \]
  7. Step-by-step derivation
    1. clear-num54.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\frac{1}{\frac{a \cdot 2}{\mathsf{fma}\left(-1, b, \sqrt{{b}^{2} - a \cdot \left(c \cdot 4\right)}\right)}}} \]
  11. Taylor expanded in a around 0 11.8%

    \[\leadsto \color{blue}{0.5 \cdot \frac{b + -1 \cdot b}{a}} \]
  12. Step-by-step derivation
    1. associate-*r/11.8%

      \[\leadsto \color{blue}{\frac{0.5 \cdot \left(b + -1 \cdot b\right)}{a}} \]
    2. distribute-rgt1-in11.8%

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

      \[\leadsto \frac{0.5 \cdot \left(\color{blue}{0} \cdot b\right)}{a} \]
    4. mul0-lft11.8%

      \[\leadsto \frac{0.5 \cdot \color{blue}{0}}{a} \]
    5. metadata-eval11.8%

      \[\leadsto \frac{\color{blue}{0}}{a} \]
  13. Simplified11.8%

    \[\leadsto \color{blue}{\frac{0}{a}} \]
  14. Add Preprocessing

Developer Target 1: 99.7% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left|\frac{b}{2}\right|\\ t_1 := \sqrt{\left|a\right|} \cdot \sqrt{\left|c\right|}\\ t_2 := \begin{array}{l} \mathbf{if}\;\mathsf{copysign}\left(a, c\right) = a:\\ \;\;\;\;\sqrt{t\_0 - t\_1} \cdot \sqrt{t\_0 + t\_1}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{hypot}\left(\frac{b}{2}, t\_1\right)\\ \end{array}\\ \mathbf{if}\;b < 0:\\ \;\;\;\;\frac{t\_2 - \frac{b}{2}}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{-c}{\frac{b}{2} + t\_2}\\ \end{array} \end{array} \]
(FPCore (a b c)
 :precision binary64
 (let* ((t_0 (fabs (/ b 2.0)))
        (t_1 (* (sqrt (fabs a)) (sqrt (fabs c))))
        (t_2
         (if (== (copysign a c) a)
           (* (sqrt (- t_0 t_1)) (sqrt (+ t_0 t_1)))
           (hypot (/ b 2.0) t_1))))
   (if (< b 0.0) (/ (- t_2 (/ b 2.0)) a) (/ (- c) (+ (/ b 2.0) t_2)))))
double code(double a, double b, double c) {
	double t_0 = fabs((b / 2.0));
	double t_1 = sqrt(fabs(a)) * sqrt(fabs(c));
	double tmp;
	if (copysign(a, c) == a) {
		tmp = sqrt((t_0 - t_1)) * sqrt((t_0 + t_1));
	} else {
		tmp = hypot((b / 2.0), t_1);
	}
	double t_2 = tmp;
	double tmp_1;
	if (b < 0.0) {
		tmp_1 = (t_2 - (b / 2.0)) / a;
	} else {
		tmp_1 = -c / ((b / 2.0) + t_2);
	}
	return tmp_1;
}
public static double code(double a, double b, double c) {
	double t_0 = Math.abs((b / 2.0));
	double t_1 = Math.sqrt(Math.abs(a)) * Math.sqrt(Math.abs(c));
	double tmp;
	if (Math.copySign(a, c) == a) {
		tmp = Math.sqrt((t_0 - t_1)) * Math.sqrt((t_0 + t_1));
	} else {
		tmp = Math.hypot((b / 2.0), t_1);
	}
	double t_2 = tmp;
	double tmp_1;
	if (b < 0.0) {
		tmp_1 = (t_2 - (b / 2.0)) / a;
	} else {
		tmp_1 = -c / ((b / 2.0) + t_2);
	}
	return tmp_1;
}
def code(a, b, c):
	t_0 = math.fabs((b / 2.0))
	t_1 = math.sqrt(math.fabs(a)) * math.sqrt(math.fabs(c))
	tmp = 0
	if math.copysign(a, c) == a:
		tmp = math.sqrt((t_0 - t_1)) * math.sqrt((t_0 + t_1))
	else:
		tmp = math.hypot((b / 2.0), t_1)
	t_2 = tmp
	tmp_1 = 0
	if b < 0.0:
		tmp_1 = (t_2 - (b / 2.0)) / a
	else:
		tmp_1 = -c / ((b / 2.0) + t_2)
	return tmp_1
function code(a, b, c)
	t_0 = abs(Float64(b / 2.0))
	t_1 = Float64(sqrt(abs(a)) * sqrt(abs(c)))
	tmp = 0.0
	if (copysign(a, c) == a)
		tmp = Float64(sqrt(Float64(t_0 - t_1)) * sqrt(Float64(t_0 + t_1)));
	else
		tmp = hypot(Float64(b / 2.0), t_1);
	end
	t_2 = tmp
	tmp_1 = 0.0
	if (b < 0.0)
		tmp_1 = Float64(Float64(t_2 - Float64(b / 2.0)) / a);
	else
		tmp_1 = Float64(Float64(-c) / Float64(Float64(b / 2.0) + t_2));
	end
	return tmp_1
end
function tmp_3 = code(a, b, c)
	t_0 = abs((b / 2.0));
	t_1 = sqrt(abs(a)) * sqrt(abs(c));
	tmp = 0.0;
	if ((sign(c) * abs(a)) == a)
		tmp = sqrt((t_0 - t_1)) * sqrt((t_0 + t_1));
	else
		tmp = hypot((b / 2.0), t_1);
	end
	t_2 = tmp;
	tmp_2 = 0.0;
	if (b < 0.0)
		tmp_2 = (t_2 - (b / 2.0)) / a;
	else
		tmp_2 = -c / ((b / 2.0) + t_2);
	end
	tmp_3 = tmp_2;
end
code[a_, b_, c_] := Block[{t$95$0 = N[Abs[N[(b / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[Abs[a], $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Abs[c], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = If[Equal[N[With[{TMP1 = Abs[a], TMP2 = Sign[c]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision], a], N[(N[Sqrt[N[(t$95$0 - t$95$1), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(t$95$0 + t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(b / 2.0), $MachinePrecision] ^ 2 + t$95$1 ^ 2], $MachinePrecision]]}, If[Less[b, 0.0], N[(N[(t$95$2 - N[(b / 2.0), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[((-c) / N[(N[(b / 2.0), $MachinePrecision] + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left|\frac{b}{2}\right|\\
t_1 := \sqrt{\left|a\right|} \cdot \sqrt{\left|c\right|}\\
t_2 := \begin{array}{l}
\mathbf{if}\;\mathsf{copysign}\left(a, c\right) = a:\\
\;\;\;\;\sqrt{t\_0 - t\_1} \cdot \sqrt{t\_0 + t\_1}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{hypot}\left(\frac{b}{2}, t\_1\right)\\


\end{array}\\
\mathbf{if}\;b < 0:\\
\;\;\;\;\frac{t\_2 - \frac{b}{2}}{a}\\

\mathbf{else}:\\
\;\;\;\;\frac{-c}{\frac{b}{2} + t\_2}\\


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024121 
(FPCore (a b c)
  :name "quadp (p42, positive)"
  :precision binary64
  :herbie-expected 10

  :alt
  (! :herbie-platform default (let ((sqtD (let ((x (* (sqrt (fabs a)) (sqrt (fabs c))))) (if (== (copysign a c) a) (* (sqrt (- (fabs (/ b 2)) x)) (sqrt (+ (fabs (/ b 2)) x))) (hypot (/ b 2) x))))) (if (< b 0) (/ (- sqtD (/ b 2)) a) (/ (- c) (+ (/ b 2) sqtD)))))

  (/ (+ (- b) (sqrt (- (* b b) (* 4.0 (* a c))))) (* 2.0 a)))