ABCF->ab-angle b

Percentage Accurate: 18.9% → 47.8%
Time: 26.3s
Alternatives: 11
Speedup: 5.0×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ \frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0} \end{array} \end{array} \]
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
   (/
    (-
     (sqrt
      (*
       (* 2.0 (* t_0 F))
       (- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
    t_0)))
double code(double A, double B, double C, double F) {
	double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
	return -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
    code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) - sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
	double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
	return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F):
	t_0 = math.pow(B, 2.0) - ((4.0 * A) * C)
	return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F)
	t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
	return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0)
end
function tmp = code(A, B, C, F)
	t_0 = (B ^ 2.0) - ((4.0 * A) * C);
	tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0;
end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0}
\end{array}
\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 11 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: 18.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ \frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0} \end{array} \end{array} \]
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (- (pow B 2.0) (* (* 4.0 A) C))))
   (/
    (-
     (sqrt
      (*
       (* 2.0 (* t_0 F))
       (- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
    t_0)))
double code(double A, double B, double C, double F) {
	double t_0 = pow(B, 2.0) - ((4.0 * A) * C);
	return -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_0;
}
real(8) function code(a, b, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: t_0
    t_0 = (b ** 2.0d0) - ((4.0d0 * a) * c)
    code = -sqrt(((2.0d0 * (t_0 * f)) * ((a + c) - sqrt((((a - c) ** 2.0d0) + (b ** 2.0d0)))))) / t_0
end function
public static double code(double A, double B, double C, double F) {
	double t_0 = Math.pow(B, 2.0) - ((4.0 * A) * C);
	return -Math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - Math.sqrt((Math.pow((A - C), 2.0) + Math.pow(B, 2.0)))))) / t_0;
}
def code(A, B, C, F):
	t_0 = math.pow(B, 2.0) - ((4.0 * A) * C)
	return -math.sqrt(((2.0 * (t_0 * F)) * ((A + C) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0)))))) / t_0
function code(A, B, C, F)
	t_0 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
	return Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_0 * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_0)
end
function tmp = code(A, B, C, F)
	t_0 = (B ^ 2.0) - ((4.0 * A) * C);
	tmp = -sqrt(((2.0 * (t_0 * F)) * ((A + C) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / t_0;
end
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
\frac{-\sqrt{\left(2 \cdot \left(t_0 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t_0}
\end{array}
\end{array}

Alternative 1: 47.8% accurate, 0.4× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ t_1 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ t_2 := \frac{-\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_1}\\ \mathbf{if}\;t_2 \leq -2 \cdot 10^{-184}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \left(-\sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}\right)}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(A + -0.5 \cdot \frac{B \cdot B + \left(A \cdot A - A \cdot A\right)}{C}\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{B}{\sqrt{F \cdot \left(2 \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}}}\\ \end{array} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (let* ((t_0 (- (* B B) (* 4.0 (* A C))))
        (t_1 (- (pow B 2.0) (* (* 4.0 A) C)))
        (t_2
         (/
          (-
           (sqrt
            (*
             (* 2.0 (* t_1 F))
             (- (+ A C) (sqrt (+ (pow B 2.0) (pow (- A C) 2.0)))))))
          t_1)))
   (if (<= t_2 -2e-184)
     (/
      (*
       (sqrt (fma B B (* C (* A -4.0))))
       (- (sqrt (* (+ A (- C (hypot B (- A C)))) (* 2.0 F)))))
      (fma B B (* A (* C -4.0))))
     (if (<= t_2 INFINITY)
       (/
        (-
         (sqrt
          (*
           2.0
           (*
            (* F t_0)
            (+ A (+ A (* -0.5 (/ (+ (* B B) (- (* A A) (* A A))) C))))))))
        t_0)
       (/ -1.0 (/ B (sqrt (* F (* 2.0 (- A (hypot B A)))))))))))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	double t_0 = (B * B) - (4.0 * (A * C));
	double t_1 = pow(B, 2.0) - ((4.0 * A) * C);
	double t_2 = -sqrt(((2.0 * (t_1 * F)) * ((A + C) - sqrt((pow(B, 2.0) + pow((A - C), 2.0)))))) / t_1;
	double tmp;
	if (t_2 <= -2e-184) {
		tmp = (sqrt(fma(B, B, (C * (A * -4.0)))) * -sqrt(((A + (C - hypot(B, (A - C)))) * (2.0 * F)))) / fma(B, B, (A * (C * -4.0)));
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = -sqrt((2.0 * ((F * t_0) * (A + (A + (-0.5 * (((B * B) + ((A * A) - (A * A))) / C))))))) / t_0;
	} else {
		tmp = -1.0 / (B / sqrt((F * (2.0 * (A - hypot(B, A))))));
	}
	return tmp;
}
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))
	t_1 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
	t_2 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_1 * F)) * Float64(Float64(A + C) - sqrt(Float64((B ^ 2.0) + (Float64(A - C) ^ 2.0))))))) / t_1)
	tmp = 0.0
	if (t_2 <= -2e-184)
		tmp = Float64(Float64(sqrt(fma(B, B, Float64(C * Float64(A * -4.0)))) * Float64(-sqrt(Float64(Float64(A + Float64(C - hypot(B, Float64(A - C)))) * Float64(2.0 * F))))) / fma(B, B, Float64(A * Float64(C * -4.0))));
	elseif (t_2 <= Inf)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(A + Float64(-0.5 * Float64(Float64(Float64(B * B) + Float64(Float64(A * A) - Float64(A * A))) / C)))))))) / t_0);
	else
		tmp = Float64(-1.0 / Float64(B / sqrt(Float64(F * Float64(2.0 * Float64(A - hypot(B, A)))))));
	end
	return tmp
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$1 * F), $MachinePrecision]), $MachinePrecision] * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[B, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-184], N[(N[(N[Sqrt[N[(B * B + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[N[(N[(A + N[(C - N[Sqrt[B ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision] / N[(B * B + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + N[(A + N[(-0.5 * N[(N[(N[(B * B), $MachinePrecision] + N[(N[(A * A), $MachinePrecision] - N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(-1.0 / N[(B / N[Sqrt[N[(F * N[(2.0 * N[(A - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\begin{array}{l}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
t_1 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
t_2 := \frac{-\sqrt{\left(2 \cdot \left(t_1 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{t_1}\\
\mathbf{if}\;t_2 \leq -2 \cdot 10^{-184}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \left(-\sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}\right)}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(A + -0.5 \cdot \frac{B \cdot B + \left(A \cdot A - A \cdot A\right)}{C}\right)\right)\right)}}{t_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{B}{\sqrt{F \cdot \left(2 \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -2.0000000000000001e-184

    1. Initial program 44.5%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Step-by-step derivation
      1. Simplified55.5%

        \[\leadsto \color{blue}{\frac{-\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right) \cdot \left(\left(2 \cdot F\right) \cdot \left(C - \left(\mathsf{hypot}\left(B, A - C\right) - A\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)}} \]
      2. Step-by-step derivation
        1. sqrt-prod70.5%

          \[\leadsto \frac{-\color{blue}{\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \cdot \sqrt{\left(2 \cdot F\right) \cdot \left(C - \left(\mathsf{hypot}\left(B, A - C\right) - A\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \]
        2. associate-*r*70.5%

          \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(B, B, \color{blue}{\left(A \cdot -4\right) \cdot C}\right)} \cdot \sqrt{\left(2 \cdot F\right) \cdot \left(C - \left(\mathsf{hypot}\left(B, A - C\right) - A\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \]
        3. *-commutative70.5%

          \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(B, B, \color{blue}{C \cdot \left(A \cdot -4\right)}\right)} \cdot \sqrt{\left(2 \cdot F\right) \cdot \left(C - \left(\mathsf{hypot}\left(B, A - C\right) - A\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \]
        4. associate--r-70.3%

          \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \sqrt{\left(2 \cdot F\right) \cdot \color{blue}{\left(\left(C - \mathsf{hypot}\left(B, A - C\right)\right) + A\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \]
        5. +-commutative70.3%

          \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \sqrt{\left(2 \cdot F\right) \cdot \color{blue}{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \]
        6. *-commutative70.3%

          \[\leadsto \frac{-\sqrt{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \sqrt{\color{blue}{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \]
      3. Applied egg-rr70.3%

        \[\leadsto \frac{-\color{blue}{\sqrt{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}}}{\mathsf{fma}\left(B, B, A \cdot \left(-4 \cdot C\right)\right)} \]

      if -2.0000000000000001e-184 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < +inf.0

      1. Initial program 16.4%

        \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      2. Step-by-step derivation
        1. Simplified16.4%

          \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
        2. Taylor expanded in C around inf 20.7%

          \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(\left(A + -0.5 \cdot \frac{\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}}{C}\right) - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
        3. Step-by-step derivation
          1. associate--l+20.7%

            \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(A + \left(-0.5 \cdot \frac{\left({B}^{2} + {A}^{2}\right) - {\left(-1 \cdot A\right)}^{2}}{C} - -1 \cdot A\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
          2. associate--l+20.8%

            \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \left(-0.5 \cdot \frac{\color{blue}{{B}^{2} + \left({A}^{2} - {\left(-1 \cdot A\right)}^{2}\right)}}{C} - -1 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
          3. unpow220.8%

            \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \left(-0.5 \cdot \frac{\color{blue}{B \cdot B} + \left({A}^{2} - {\left(-1 \cdot A\right)}^{2}\right)}{C} - -1 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
          4. unpow220.8%

            \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \left(-0.5 \cdot \frac{B \cdot B + \left(\color{blue}{A \cdot A} - {\left(-1 \cdot A\right)}^{2}\right)}{C} - -1 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
          5. unpow220.8%

            \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \left(-0.5 \cdot \frac{B \cdot B + \left(A \cdot A - \color{blue}{\left(-1 \cdot A\right) \cdot \left(-1 \cdot A\right)}\right)}{C} - -1 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
          6. mul-1-neg20.8%

            \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \left(-0.5 \cdot \frac{B \cdot B + \left(A \cdot A - \color{blue}{\left(-A\right)} \cdot \left(-1 \cdot A\right)\right)}{C} - -1 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
          7. mul-1-neg20.8%

            \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \left(-0.5 \cdot \frac{B \cdot B + \left(A \cdot A - \left(-A\right) \cdot \color{blue}{\left(-A\right)}\right)}{C} - -1 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
          8. sqr-neg20.8%

            \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \left(-0.5 \cdot \frac{B \cdot B + \left(A \cdot A - \color{blue}{A \cdot A}\right)}{C} - -1 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
          9. mul-1-neg20.8%

            \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \left(-0.5 \cdot \frac{B \cdot B + \left(A \cdot A - A \cdot A\right)}{C} - \color{blue}{\left(-A\right)}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
        4. Simplified20.8%

          \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(A + \left(-0.5 \cdot \frac{B \cdot B + \left(A \cdot A - A \cdot A\right)}{C} - \left(-A\right)\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

        if +inf.0 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)))

        1. Initial program 0.0%

          \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
        2. Step-by-step derivation
          1. Simplified0.9%

            \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot F\right)\right) \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}} \]
          2. Taylor expanded in C around 0 1.8%

            \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}\right)} \]
          3. Step-by-step derivation
            1. mul-1-neg1.8%

              \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}} \]
            2. +-commutative1.8%

              \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{\color{blue}{{A}^{2} + {B}^{2}}}\right) \cdot F} \]
            3. unpow21.8%

              \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{\color{blue}{A \cdot A} + {B}^{2}}\right) \cdot F} \]
            4. unpow21.8%

              \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{A \cdot A + \color{blue}{B \cdot B}}\right) \cdot F} \]
            5. hypot-def18.9%

              \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \color{blue}{\mathsf{hypot}\left(A, B\right)}\right) \cdot F} \]
          4. Simplified18.9%

            \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F}} \]
          5. Step-by-step derivation
            1. associate-*l/18.9%

              \[\leadsto -\color{blue}{\frac{\sqrt{2} \cdot \sqrt{\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F}}{B}} \]
          6. Applied egg-rr18.9%

            \[\leadsto -\color{blue}{\frac{\sqrt{2} \cdot \sqrt{\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F}}{B}} \]
          7. Step-by-step derivation
            1. clear-num18.9%

              \[\leadsto -\color{blue}{\frac{1}{\frac{B}{\sqrt{2} \cdot \sqrt{\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F}}}} \]
            2. inv-pow18.9%

              \[\leadsto -\color{blue}{{\left(\frac{B}{\sqrt{2} \cdot \sqrt{\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F}}\right)}^{-1}} \]
            3. sqrt-unprod19.0%

              \[\leadsto -{\left(\frac{B}{\color{blue}{\sqrt{2 \cdot \left(\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F\right)}}}\right)}^{-1} \]
          8. Applied egg-rr19.0%

            \[\leadsto -\color{blue}{{\left(\frac{B}{\sqrt{2 \cdot \left(\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F\right)}}\right)}^{-1}} \]
          9. Step-by-step derivation
            1. unpow-119.0%

              \[\leadsto -\color{blue}{\frac{1}{\frac{B}{\sqrt{2 \cdot \left(\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F\right)}}}} \]
            2. *-commutative19.0%

              \[\leadsto -\frac{1}{\frac{B}{\sqrt{\color{blue}{\left(\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F\right) \cdot 2}}}} \]
            3. *-commutative19.0%

              \[\leadsto -\frac{1}{\frac{B}{\sqrt{\color{blue}{\left(F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)\right)} \cdot 2}}} \]
            4. associate-*l*19.0%

              \[\leadsto -\frac{1}{\frac{B}{\sqrt{\color{blue}{F \cdot \left(\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot 2\right)}}}} \]
            5. hypot-def1.8%

              \[\leadsto -\frac{1}{\frac{B}{\sqrt{F \cdot \left(\left(A - \color{blue}{\sqrt{A \cdot A + B \cdot B}}\right) \cdot 2\right)}}} \]
            6. unpow21.8%

              \[\leadsto -\frac{1}{\frac{B}{\sqrt{F \cdot \left(\left(A - \sqrt{\color{blue}{{A}^{2}} + B \cdot B}\right) \cdot 2\right)}}} \]
            7. unpow21.8%

              \[\leadsto -\frac{1}{\frac{B}{\sqrt{F \cdot \left(\left(A - \sqrt{{A}^{2} + \color{blue}{{B}^{2}}}\right) \cdot 2\right)}}} \]
            8. +-commutative1.8%

              \[\leadsto -\frac{1}{\frac{B}{\sqrt{F \cdot \left(\left(A - \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right) \cdot 2\right)}}} \]
            9. unpow21.8%

              \[\leadsto -\frac{1}{\frac{B}{\sqrt{F \cdot \left(\left(A - \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right) \cdot 2\right)}}} \]
            10. unpow21.8%

              \[\leadsto -\frac{1}{\frac{B}{\sqrt{F \cdot \left(\left(A - \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right) \cdot 2\right)}}} \]
            11. hypot-def19.0%

              \[\leadsto -\frac{1}{\frac{B}{\sqrt{F \cdot \left(\left(A - \color{blue}{\mathsf{hypot}\left(B, A\right)}\right) \cdot 2\right)}}} \]
          10. Simplified19.0%

            \[\leadsto -\color{blue}{\frac{1}{\frac{B}{\sqrt{F \cdot \left(\left(A - \mathsf{hypot}\left(B, A\right)\right) \cdot 2\right)}}}} \]
        3. Recombined 3 regimes into one program.
        4. Final simplification37.9%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \leq -2 \cdot 10^{-184}:\\ \;\;\;\;\frac{\sqrt{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)} \cdot \left(-\sqrt{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(2 \cdot F\right)}\right)}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{elif}\;\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \leq \infty:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(A + \left(A + -0.5 \cdot \frac{B \cdot B + \left(A \cdot A - A \cdot A\right)}{C}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{B}{\sqrt{F \cdot \left(2 \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}}}\\ \end{array} \]

        Alternative 2: 47.0% accurate, 3.0× speedup?

        \[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 8 \cdot 10^{-9}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{F \cdot \left(2 \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}}{B}\\ \end{array} \end{array} \]
        NOTE: B should be positive before calling this function
        NOTE: A and C should be sorted in increasing order before calling this function.
        (FPCore (A B C F)
         :precision binary64
         (if (<= B 8e-9)
           (/
            (- (sqrt (* 2.0 (* (+ (* B B) (* -4.0 (* A C))) (* F (* 2.0 A))))))
            (- (* B B) (* 4.0 (* A C))))
           (/ (- (sqrt (* F (* 2.0 (- A (hypot B A)))))) B)))
        B = abs(B);
        assert(A < C);
        double code(double A, double B, double C, double F) {
        	double tmp;
        	if (B <= 8e-9) {
        		tmp = -sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / ((B * B) - (4.0 * (A * C)));
        	} else {
        		tmp = -sqrt((F * (2.0 * (A - hypot(B, A))))) / B;
        	}
        	return tmp;
        }
        
        B = Math.abs(B);
        assert A < C;
        public static double code(double A, double B, double C, double F) {
        	double tmp;
        	if (B <= 8e-9) {
        		tmp = -Math.sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / ((B * B) - (4.0 * (A * C)));
        	} else {
        		tmp = -Math.sqrt((F * (2.0 * (A - Math.hypot(B, A))))) / B;
        	}
        	return tmp;
        }
        
        B = abs(B)
        [A, C] = sort([A, C])
        def code(A, B, C, F):
        	tmp = 0
        	if B <= 8e-9:
        		tmp = -math.sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / ((B * B) - (4.0 * (A * C)))
        	else:
        		tmp = -math.sqrt((F * (2.0 * (A - math.hypot(B, A))))) / B
        	return tmp
        
        B = abs(B)
        A, C = sort([A, C])
        function code(A, B, C, F)
        	tmp = 0.0
        	if (B <= 8e-9)
        		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) * Float64(F * Float64(2.0 * A)))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))));
        	else
        		tmp = Float64(Float64(-sqrt(Float64(F * Float64(2.0 * Float64(A - hypot(B, A)))))) / B);
        	end
        	return tmp
        end
        
        B = abs(B)
        A, C = num2cell(sort([A, C])){:}
        function tmp_2 = code(A, B, C, F)
        	tmp = 0.0;
        	if (B <= 8e-9)
        		tmp = -sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / ((B * B) - (4.0 * (A * C)));
        	else
        		tmp = -sqrt((F * (2.0 * (A - hypot(B, A))))) / B;
        	end
        	tmp_2 = tmp;
        end
        
        NOTE: B should be positive before calling this function
        NOTE: A and C should be sorted in increasing order before calling this function.
        code[A_, B_, C_, F_] := If[LessEqual[B, 8e-9], N[((-N[Sqrt[N[(2.0 * N[(N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[N[(F * N[(2.0 * N[(A - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $MachinePrecision]]
        
        \begin{array}{l}
        B = |B|\\
        [A, C] = \mathsf{sort}([A, C])\\
        \\
        \begin{array}{l}
        \mathbf{if}\;B \leq 8 \cdot 10^{-9}:\\
        \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{-\sqrt{F \cdot \left(2 \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}}{B}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if B < 8.0000000000000005e-9

          1. Initial program 21.3%

            \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
          2. Step-by-step derivation
            1. Simplified21.3%

              \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
            2. Taylor expanded in A around -inf 16.3%

              \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(2 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
            3. Step-by-step derivation
              1. *-un-lft-identity16.3%

                \[\leadsto \frac{-\color{blue}{1 \cdot \sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(2 \cdot A\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
              2. associate-*l*15.7%

                \[\leadsto \frac{-1 \cdot \sqrt{2 \cdot \color{blue}{\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
              3. *-commutative15.7%

                \[\leadsto \frac{-1 \cdot \sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \color{blue}{\left(A \cdot 2\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
            4. Applied egg-rr15.7%

              \[\leadsto \frac{-\color{blue}{1 \cdot \sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
            5. Step-by-step derivation
              1. *-lft-identity15.7%

                \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
              2. unpow215.7%

                \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\color{blue}{{B}^{2}} - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
              3. cancel-sign-sub-inv15.7%

                \[\leadsto \frac{-\sqrt{2 \cdot \left(\color{blue}{\left({B}^{2} + \left(-4\right) \cdot \left(A \cdot C\right)\right)} \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
              4. unpow215.7%

                \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\color{blue}{B \cdot B} + \left(-4\right) \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
              5. metadata-eval15.7%

                \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(B \cdot B + \color{blue}{-4} \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
            6. Simplified15.7%

              \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

            if 8.0000000000000005e-9 < B

            1. Initial program 15.0%

              \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
            2. Step-by-step derivation
              1. Simplified19.8%

                \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot F\right)\right) \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}} \]
              2. Taylor expanded in C around 0 13.8%

                \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}\right)} \]
              3. Step-by-step derivation
                1. mul-1-neg13.8%

                  \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}} \]
                2. +-commutative13.8%

                  \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{\color{blue}{{A}^{2} + {B}^{2}}}\right) \cdot F} \]
                3. unpow213.8%

                  \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{\color{blue}{A \cdot A} + {B}^{2}}\right) \cdot F} \]
                4. unpow213.8%

                  \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{A \cdot A + \color{blue}{B \cdot B}}\right) \cdot F} \]
                5. hypot-def43.5%

                  \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \color{blue}{\mathsf{hypot}\left(A, B\right)}\right) \cdot F} \]
              4. Simplified43.5%

                \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F}} \]
              5. Step-by-step derivation
                1. associate-*l/43.4%

                  \[\leadsto -\color{blue}{\frac{\sqrt{2} \cdot \sqrt{\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F}}{B}} \]
              6. Applied egg-rr43.4%

                \[\leadsto -\color{blue}{\frac{\sqrt{2} \cdot \sqrt{\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F}}{B}} \]
              7. Step-by-step derivation
                1. expm1-log1p-u42.0%

                  \[\leadsto -\frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2} \cdot \sqrt{\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F}\right)\right)}}{B} \]
                2. expm1-udef31.1%

                  \[\leadsto -\frac{\color{blue}{e^{\mathsf{log1p}\left(\sqrt{2} \cdot \sqrt{\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F}\right)} - 1}}{B} \]
                3. sqrt-unprod31.1%

                  \[\leadsto -\frac{e^{\mathsf{log1p}\left(\color{blue}{\sqrt{2 \cdot \left(\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F\right)}}\right)} - 1}{B} \]
              8. Applied egg-rr31.1%

                \[\leadsto -\frac{\color{blue}{e^{\mathsf{log1p}\left(\sqrt{2 \cdot \left(\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F\right)}\right)} - 1}}{B} \]
              9. Step-by-step derivation
                1. expm1-def42.0%

                  \[\leadsto -\frac{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{2 \cdot \left(\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F\right)}\right)\right)}}{B} \]
                2. expm1-log1p43.5%

                  \[\leadsto -\frac{\color{blue}{\sqrt{2 \cdot \left(\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F\right)}}}{B} \]
                3. *-commutative43.5%

                  \[\leadsto -\frac{\sqrt{\color{blue}{\left(\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F\right) \cdot 2}}}{B} \]
                4. *-commutative43.5%

                  \[\leadsto -\frac{\sqrt{\color{blue}{\left(F \cdot \left(A - \mathsf{hypot}\left(A, B\right)\right)\right)} \cdot 2}}{B} \]
                5. associate-*l*43.5%

                  \[\leadsto -\frac{\sqrt{\color{blue}{F \cdot \left(\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot 2\right)}}}{B} \]
                6. hypot-def13.8%

                  \[\leadsto -\frac{\sqrt{F \cdot \left(\left(A - \color{blue}{\sqrt{A \cdot A + B \cdot B}}\right) \cdot 2\right)}}{B} \]
                7. unpow213.8%

                  \[\leadsto -\frac{\sqrt{F \cdot \left(\left(A - \sqrt{\color{blue}{{A}^{2}} + B \cdot B}\right) \cdot 2\right)}}{B} \]
                8. unpow213.8%

                  \[\leadsto -\frac{\sqrt{F \cdot \left(\left(A - \sqrt{{A}^{2} + \color{blue}{{B}^{2}}}\right) \cdot 2\right)}}{B} \]
                9. +-commutative13.8%

                  \[\leadsto -\frac{\sqrt{F \cdot \left(\left(A - \sqrt{\color{blue}{{B}^{2} + {A}^{2}}}\right) \cdot 2\right)}}{B} \]
                10. unpow213.8%

                  \[\leadsto -\frac{\sqrt{F \cdot \left(\left(A - \sqrt{\color{blue}{B \cdot B} + {A}^{2}}\right) \cdot 2\right)}}{B} \]
                11. unpow213.8%

                  \[\leadsto -\frac{\sqrt{F \cdot \left(\left(A - \sqrt{B \cdot B + \color{blue}{A \cdot A}}\right) \cdot 2\right)}}{B} \]
                12. hypot-def43.5%

                  \[\leadsto -\frac{\sqrt{F \cdot \left(\left(A - \color{blue}{\mathsf{hypot}\left(B, A\right)}\right) \cdot 2\right)}}{B} \]
              10. Simplified43.5%

                \[\leadsto -\frac{\color{blue}{\sqrt{F \cdot \left(\left(A - \mathsf{hypot}\left(B, A\right)\right) \cdot 2\right)}}}{B} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification22.2%

              \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 8 \cdot 10^{-9}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{F \cdot \left(2 \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)\right)}}{B}\\ \end{array} \]

            Alternative 3: 43.6% accurate, 3.0× speedup?

            \[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 0.00097:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - B\right)}\\ \end{array} \end{array} \]
            NOTE: B should be positive before calling this function
            NOTE: A and C should be sorted in increasing order before calling this function.
            (FPCore (A B C F)
             :precision binary64
             (if (<= B 0.00097)
               (/
                (- (sqrt (* 2.0 (* (+ (* B B) (* -4.0 (* A C))) (* F (* 2.0 A))))))
                (- (* B B) (* 4.0 (* A C))))
               (- (* (/ (sqrt 2.0) B) (sqrt (* F (- A B)))))))
            B = abs(B);
            assert(A < C);
            double code(double A, double B, double C, double F) {
            	double tmp;
            	if (B <= 0.00097) {
            		tmp = -sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / ((B * B) - (4.0 * (A * C)));
            	} else {
            		tmp = -((sqrt(2.0) / B) * sqrt((F * (A - B))));
            	}
            	return tmp;
            }
            
            NOTE: B should be positive before calling this function
            NOTE: A and C should be sorted in increasing order before calling this function.
            real(8) function code(a, b, c, f)
                real(8), intent (in) :: a
                real(8), intent (in) :: b
                real(8), intent (in) :: c
                real(8), intent (in) :: f
                real(8) :: tmp
                if (b <= 0.00097d0) then
                    tmp = -sqrt((2.0d0 * (((b * b) + ((-4.0d0) * (a * c))) * (f * (2.0d0 * a))))) / ((b * b) - (4.0d0 * (a * c)))
                else
                    tmp = -((sqrt(2.0d0) / b) * sqrt((f * (a - b))))
                end if
                code = tmp
            end function
            
            B = Math.abs(B);
            assert A < C;
            public static double code(double A, double B, double C, double F) {
            	double tmp;
            	if (B <= 0.00097) {
            		tmp = -Math.sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / ((B * B) - (4.0 * (A * C)));
            	} else {
            		tmp = -((Math.sqrt(2.0) / B) * Math.sqrt((F * (A - B))));
            	}
            	return tmp;
            }
            
            B = abs(B)
            [A, C] = sort([A, C])
            def code(A, B, C, F):
            	tmp = 0
            	if B <= 0.00097:
            		tmp = -math.sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / ((B * B) - (4.0 * (A * C)))
            	else:
            		tmp = -((math.sqrt(2.0) / B) * math.sqrt((F * (A - B))))
            	return tmp
            
            B = abs(B)
            A, C = sort([A, C])
            function code(A, B, C, F)
            	tmp = 0.0
            	if (B <= 0.00097)
            		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) * Float64(F * Float64(2.0 * A)))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))));
            	else
            		tmp = Float64(-Float64(Float64(sqrt(2.0) / B) * sqrt(Float64(F * Float64(A - B)))));
            	end
            	return tmp
            end
            
            B = abs(B)
            A, C = num2cell(sort([A, C])){:}
            function tmp_2 = code(A, B, C, F)
            	tmp = 0.0;
            	if (B <= 0.00097)
            		tmp = -sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / ((B * B) - (4.0 * (A * C)));
            	else
            		tmp = -((sqrt(2.0) / B) * sqrt((F * (A - B))));
            	end
            	tmp_2 = tmp;
            end
            
            NOTE: B should be positive before calling this function
            NOTE: A and C should be sorted in increasing order before calling this function.
            code[A_, B_, C_, F_] := If[LessEqual[B, 0.00097], N[((-N[Sqrt[N[(2.0 * N[(N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * N[Sqrt[N[(F * N[(A - B), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision])]
            
            \begin{array}{l}
            B = |B|\\
            [A, C] = \mathsf{sort}([A, C])\\
            \\
            \begin{array}{l}
            \mathbf{if}\;B \leq 0.00097:\\
            \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
            
            \mathbf{else}:\\
            \;\;\;\;-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - B\right)}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if B < 9.70000000000000051e-4

              1. Initial program 21.2%

                \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
              2. Step-by-step derivation
                1. Simplified21.2%

                  \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
                2. Taylor expanded in A around -inf 16.2%

                  \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(2 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                3. Step-by-step derivation
                  1. *-un-lft-identity16.2%

                    \[\leadsto \frac{-\color{blue}{1 \cdot \sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(2 \cdot A\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                  2. associate-*l*15.7%

                    \[\leadsto \frac{-1 \cdot \sqrt{2 \cdot \color{blue}{\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                  3. *-commutative15.7%

                    \[\leadsto \frac{-1 \cdot \sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \color{blue}{\left(A \cdot 2\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                4. Applied egg-rr15.7%

                  \[\leadsto \frac{-\color{blue}{1 \cdot \sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                5. Step-by-step derivation
                  1. *-lft-identity15.7%

                    \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                  2. unpow215.7%

                    \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\color{blue}{{B}^{2}} - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                  3. cancel-sign-sub-inv15.7%

                    \[\leadsto \frac{-\sqrt{2 \cdot \left(\color{blue}{\left({B}^{2} + \left(-4\right) \cdot \left(A \cdot C\right)\right)} \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                  4. unpow215.7%

                    \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\color{blue}{B \cdot B} + \left(-4\right) \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                  5. metadata-eval15.7%

                    \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(B \cdot B + \color{blue}{-4} \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                6. Simplified15.7%

                  \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

                if 9.70000000000000051e-4 < B

                1. Initial program 15.2%

                  \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                2. Step-by-step derivation
                  1. Simplified18.5%

                    \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot F\right)\right) \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}} \]
                  2. Taylor expanded in C around 0 13.9%

                    \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}\right)} \]
                  3. Step-by-step derivation
                    1. mul-1-neg13.9%

                      \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}} \]
                    2. +-commutative13.9%

                      \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{\color{blue}{{A}^{2} + {B}^{2}}}\right) \cdot F} \]
                    3. unpow213.9%

                      \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{\color{blue}{A \cdot A} + {B}^{2}}\right) \cdot F} \]
                    4. unpow213.9%

                      \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{A \cdot A + \color{blue}{B \cdot B}}\right) \cdot F} \]
                    5. hypot-def44.2%

                      \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \color{blue}{\mathsf{hypot}\left(A, B\right)}\right) \cdot F} \]
                  4. Simplified44.2%

                    \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F}} \]
                  5. Taylor expanded in A around 0 38.3%

                    \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\color{blue}{\left(A + -1 \cdot B\right)} \cdot F} \]
                  6. Step-by-step derivation
                    1. mul-1-neg38.3%

                      \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A + \color{blue}{\left(-B\right)}\right) \cdot F} \]
                    2. unsub-neg38.3%

                      \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\color{blue}{\left(A - B\right)} \cdot F} \]
                  7. Simplified38.3%

                    \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\color{blue}{\left(A - B\right)} \cdot F} \]
                3. Recombined 2 regimes into one program.
                4. Final simplification20.9%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 0.00097:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;-\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - B\right)}\\ \end{array} \]

                Alternative 4: 43.0% accurate, 3.0× speedup?

                \[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 0.000145:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot \left(-F\right)}\right)\\ \end{array} \end{array} \]
                NOTE: B should be positive before calling this function
                NOTE: A and C should be sorted in increasing order before calling this function.
                (FPCore (A B C F)
                 :precision binary64
                 (if (<= B 0.000145)
                   (/
                    (- (sqrt (* 2.0 (* (+ (* B B) (* -4.0 (* A C))) (* F (* 2.0 A))))))
                    (- (* B B) (* 4.0 (* A C))))
                   (* (/ (sqrt 2.0) B) (- (sqrt (* B (- F)))))))
                B = abs(B);
                assert(A < C);
                double code(double A, double B, double C, double F) {
                	double tmp;
                	if (B <= 0.000145) {
                		tmp = -sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / ((B * B) - (4.0 * (A * C)));
                	} else {
                		tmp = (sqrt(2.0) / B) * -sqrt((B * -F));
                	}
                	return tmp;
                }
                
                NOTE: B should be positive before calling this function
                NOTE: A and C should be sorted in increasing order before calling this function.
                real(8) function code(a, b, c, f)
                    real(8), intent (in) :: a
                    real(8), intent (in) :: b
                    real(8), intent (in) :: c
                    real(8), intent (in) :: f
                    real(8) :: tmp
                    if (b <= 0.000145d0) then
                        tmp = -sqrt((2.0d0 * (((b * b) + ((-4.0d0) * (a * c))) * (f * (2.0d0 * a))))) / ((b * b) - (4.0d0 * (a * c)))
                    else
                        tmp = (sqrt(2.0d0) / b) * -sqrt((b * -f))
                    end if
                    code = tmp
                end function
                
                B = Math.abs(B);
                assert A < C;
                public static double code(double A, double B, double C, double F) {
                	double tmp;
                	if (B <= 0.000145) {
                		tmp = -Math.sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / ((B * B) - (4.0 * (A * C)));
                	} else {
                		tmp = (Math.sqrt(2.0) / B) * -Math.sqrt((B * -F));
                	}
                	return tmp;
                }
                
                B = abs(B)
                [A, C] = sort([A, C])
                def code(A, B, C, F):
                	tmp = 0
                	if B <= 0.000145:
                		tmp = -math.sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / ((B * B) - (4.0 * (A * C)))
                	else:
                		tmp = (math.sqrt(2.0) / B) * -math.sqrt((B * -F))
                	return tmp
                
                B = abs(B)
                A, C = sort([A, C])
                function code(A, B, C, F)
                	tmp = 0.0
                	if (B <= 0.000145)
                		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) * Float64(F * Float64(2.0 * A)))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))));
                	else
                		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-sqrt(Float64(B * Float64(-F)))));
                	end
                	return tmp
                end
                
                B = abs(B)
                A, C = num2cell(sort([A, C])){:}
                function tmp_2 = code(A, B, C, F)
                	tmp = 0.0;
                	if (B <= 0.000145)
                		tmp = -sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / ((B * B) - (4.0 * (A * C)));
                	else
                		tmp = (sqrt(2.0) / B) * -sqrt((B * -F));
                	end
                	tmp_2 = tmp;
                end
                
                NOTE: B should be positive before calling this function
                NOTE: A and C should be sorted in increasing order before calling this function.
                code[A_, B_, C_, F_] := If[LessEqual[B, 0.000145], N[((-N[Sqrt[N[(2.0 * N[(N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B), $MachinePrecision] * (-N[Sqrt[N[(B * (-F)), $MachinePrecision]], $MachinePrecision])), $MachinePrecision]]
                
                \begin{array}{l}
                B = |B|\\
                [A, C] = \mathsf{sort}([A, C])\\
                \\
                \begin{array}{l}
                \mathbf{if}\;B \leq 0.000145:\\
                \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot \left(-F\right)}\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if B < 1.45e-4

                  1. Initial program 21.2%

                    \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                  2. Step-by-step derivation
                    1. Simplified21.2%

                      \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
                    2. Taylor expanded in A around -inf 16.2%

                      \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(2 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                    3. Step-by-step derivation
                      1. *-un-lft-identity16.2%

                        \[\leadsto \frac{-\color{blue}{1 \cdot \sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(2 \cdot A\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                      2. associate-*l*15.7%

                        \[\leadsto \frac{-1 \cdot \sqrt{2 \cdot \color{blue}{\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                      3. *-commutative15.7%

                        \[\leadsto \frac{-1 \cdot \sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \color{blue}{\left(A \cdot 2\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                    4. Applied egg-rr15.7%

                      \[\leadsto \frac{-\color{blue}{1 \cdot \sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                    5. Step-by-step derivation
                      1. *-lft-identity15.7%

                        \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                      2. unpow215.7%

                        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\color{blue}{{B}^{2}} - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                      3. cancel-sign-sub-inv15.7%

                        \[\leadsto \frac{-\sqrt{2 \cdot \left(\color{blue}{\left({B}^{2} + \left(-4\right) \cdot \left(A \cdot C\right)\right)} \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                      4. unpow215.7%

                        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\color{blue}{B \cdot B} + \left(-4\right) \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                      5. metadata-eval15.7%

                        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(B \cdot B + \color{blue}{-4} \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                    6. Simplified15.7%

                      \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

                    if 1.45e-4 < B

                    1. Initial program 15.2%

                      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                    2. Step-by-step derivation
                      1. Simplified18.5%

                        \[\leadsto \color{blue}{\frac{-\sqrt{\left(2 \cdot \left(\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right) \cdot F\right)\right) \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}}{\mathsf{fma}\left(B, B, C \cdot \left(A \cdot -4\right)\right)}} \]
                      2. Taylor expanded in C around 0 13.9%

                        \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}\right)} \]
                      3. Step-by-step derivation
                        1. mul-1-neg13.9%

                          \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{{B}^{2} + {A}^{2}}\right) \cdot F}} \]
                        2. +-commutative13.9%

                          \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{\color{blue}{{A}^{2} + {B}^{2}}}\right) \cdot F} \]
                        3. unpow213.9%

                          \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{\color{blue}{A \cdot A} + {B}^{2}}\right) \cdot F} \]
                        4. unpow213.9%

                          \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \sqrt{A \cdot A + \color{blue}{B \cdot B}}\right) \cdot F} \]
                        5. hypot-def44.2%

                          \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \color{blue}{\mathsf{hypot}\left(A, B\right)}\right) \cdot F} \]
                      4. Simplified44.2%

                        \[\leadsto \color{blue}{-\frac{\sqrt{2}}{B} \cdot \sqrt{\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F}} \]
                      5. Taylor expanded in A around 0 38.1%

                        \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\color{blue}{-1 \cdot \left(F \cdot B\right)}} \]
                      6. Step-by-step derivation
                        1. associate-*r*38.1%

                          \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\color{blue}{\left(-1 \cdot F\right) \cdot B}} \]
                        2. mul-1-neg38.1%

                          \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\color{blue}{\left(-F\right)} \cdot B} \]
                      7. Simplified38.1%

                        \[\leadsto -\frac{\sqrt{2}}{B} \cdot \sqrt{\color{blue}{\left(-F\right) \cdot B}} \]
                    3. Recombined 2 regimes into one program.
                    4. Final simplification20.8%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 0.000145:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{B \cdot \left(-F\right)}\right)\\ \end{array} \]

                    Alternative 5: 29.4% accurate, 4.7× speedup?

                    \[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq 4.7 \cdot 10^{-5}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 7.5 \cdot 10^{+76}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(C - B\right)\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}\\ \end{array} \end{array} \]
                    NOTE: B should be positive before calling this function
                    NOTE: A and C should be sorted in increasing order before calling this function.
                    (FPCore (A B C F)
                     :precision binary64
                     (let* ((t_0 (- (* B B) (* 4.0 (* A C)))))
                       (if (<= B 4.7e-5)
                         (/
                          (- (sqrt (* 2.0 (* (+ (* B B) (* -4.0 (* A C))) (* F (* 2.0 A))))))
                          t_0)
                         (if (<= B 7.5e+76)
                           (/ (- (sqrt (* 2.0 (* (* F t_0) (+ A (- C B)))))) t_0)
                           (* -2.0 (/ (pow (* A F) 0.5) B))))))
                    B = abs(B);
                    assert(A < C);
                    double code(double A, double B, double C, double F) {
                    	double t_0 = (B * B) - (4.0 * (A * C));
                    	double tmp;
                    	if (B <= 4.7e-5) {
                    		tmp = -sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / t_0;
                    	} else if (B <= 7.5e+76) {
                    		tmp = -sqrt((2.0 * ((F * t_0) * (A + (C - B))))) / t_0;
                    	} else {
                    		tmp = -2.0 * (pow((A * F), 0.5) / B);
                    	}
                    	return tmp;
                    }
                    
                    NOTE: B should be positive before calling this function
                    NOTE: A and C should be sorted in increasing order before calling this function.
                    real(8) function code(a, b, c, f)
                        real(8), intent (in) :: a
                        real(8), intent (in) :: b
                        real(8), intent (in) :: c
                        real(8), intent (in) :: f
                        real(8) :: t_0
                        real(8) :: tmp
                        t_0 = (b * b) - (4.0d0 * (a * c))
                        if (b <= 4.7d-5) then
                            tmp = -sqrt((2.0d0 * (((b * b) + ((-4.0d0) * (a * c))) * (f * (2.0d0 * a))))) / t_0
                        else if (b <= 7.5d+76) then
                            tmp = -sqrt((2.0d0 * ((f * t_0) * (a + (c - b))))) / t_0
                        else
                            tmp = (-2.0d0) * (((a * f) ** 0.5d0) / b)
                        end if
                        code = tmp
                    end function
                    
                    B = Math.abs(B);
                    assert A < C;
                    public static double code(double A, double B, double C, double F) {
                    	double t_0 = (B * B) - (4.0 * (A * C));
                    	double tmp;
                    	if (B <= 4.7e-5) {
                    		tmp = -Math.sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / t_0;
                    	} else if (B <= 7.5e+76) {
                    		tmp = -Math.sqrt((2.0 * ((F * t_0) * (A + (C - B))))) / t_0;
                    	} else {
                    		tmp = -2.0 * (Math.pow((A * F), 0.5) / B);
                    	}
                    	return tmp;
                    }
                    
                    B = abs(B)
                    [A, C] = sort([A, C])
                    def code(A, B, C, F):
                    	t_0 = (B * B) - (4.0 * (A * C))
                    	tmp = 0
                    	if B <= 4.7e-5:
                    		tmp = -math.sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / t_0
                    	elif B <= 7.5e+76:
                    		tmp = -math.sqrt((2.0 * ((F * t_0) * (A + (C - B))))) / t_0
                    	else:
                    		tmp = -2.0 * (math.pow((A * F), 0.5) / B)
                    	return tmp
                    
                    B = abs(B)
                    A, C = sort([A, C])
                    function code(A, B, C, F)
                    	t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))
                    	tmp = 0.0
                    	if (B <= 4.7e-5)
                    		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) * Float64(F * Float64(2.0 * A)))))) / t_0);
                    	elseif (B <= 7.5e+76)
                    		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(A + Float64(C - B)))))) / t_0);
                    	else
                    		tmp = Float64(-2.0 * Float64((Float64(A * F) ^ 0.5) / B));
                    	end
                    	return tmp
                    end
                    
                    B = abs(B)
                    A, C = num2cell(sort([A, C])){:}
                    function tmp_2 = code(A, B, C, F)
                    	t_0 = (B * B) - (4.0 * (A * C));
                    	tmp = 0.0;
                    	if (B <= 4.7e-5)
                    		tmp = -sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / t_0;
                    	elseif (B <= 7.5e+76)
                    		tmp = -sqrt((2.0 * ((F * t_0) * (A + (C - B))))) / t_0;
                    	else
                    		tmp = -2.0 * (((A * F) ^ 0.5) / B);
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    NOTE: B should be positive before calling this function
                    NOTE: A and C should be sorted in increasing order before calling this function.
                    code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 4.7e-5], N[((-N[Sqrt[N[(2.0 * N[(N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], If[LessEqual[B, 7.5e+76], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(A + N[(C - B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(-2.0 * N[(N[Power[N[(A * F), $MachinePrecision], 0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]
                    
                    \begin{array}{l}
                    B = |B|\\
                    [A, C] = \mathsf{sort}([A, C])\\
                    \\
                    \begin{array}{l}
                    t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
                    \mathbf{if}\;B \leq 4.7 \cdot 10^{-5}:\\
                    \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{t_0}\\
                    
                    \mathbf{elif}\;B \leq 7.5 \cdot 10^{+76}:\\
                    \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(A + \left(C - B\right)\right)\right)}}{t_0}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;-2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if B < 4.69999999999999972e-5

                      1. Initial program 21.2%

                        \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                      2. Step-by-step derivation
                        1. Simplified21.2%

                          \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
                        2. Taylor expanded in A around -inf 16.2%

                          \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(2 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                        3. Step-by-step derivation
                          1. *-un-lft-identity16.2%

                            \[\leadsto \frac{-\color{blue}{1 \cdot \sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(2 \cdot A\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                          2. associate-*l*15.7%

                            \[\leadsto \frac{-1 \cdot \sqrt{2 \cdot \color{blue}{\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                          3. *-commutative15.7%

                            \[\leadsto \frac{-1 \cdot \sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \color{blue}{\left(A \cdot 2\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                        4. Applied egg-rr15.7%

                          \[\leadsto \frac{-\color{blue}{1 \cdot \sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                        5. Step-by-step derivation
                          1. *-lft-identity15.7%

                            \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                          2. unpow215.7%

                            \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\color{blue}{{B}^{2}} - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                          3. cancel-sign-sub-inv15.7%

                            \[\leadsto \frac{-\sqrt{2 \cdot \left(\color{blue}{\left({B}^{2} + \left(-4\right) \cdot \left(A \cdot C\right)\right)} \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                          4. unpow215.7%

                            \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\color{blue}{B \cdot B} + \left(-4\right) \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                          5. metadata-eval15.7%

                            \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(B \cdot B + \color{blue}{-4} \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                        6. Simplified15.7%

                          \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

                        if 4.69999999999999972e-5 < B < 7.4999999999999995e76

                        1. Initial program 37.6%

                          \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                        2. Step-by-step derivation
                          1. Simplified37.6%

                            \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
                          2. Step-by-step derivation
                            1. associate--l+37.4%

                              \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(A + \left(C - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                            2. unpow237.4%

                              \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \left(C - \sqrt{B \cdot B + \color{blue}{\left(A - C\right) \cdot \left(A - C\right)}}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                            3. hypot-udef42.6%

                              \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \left(C - \color{blue}{\mathsf{hypot}\left(B, A - C\right)}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                            4. add-cbrt-cube31.9%

                              \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\sqrt[3]{\left(\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right) \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                          3. Applied egg-rr31.9%

                            \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\sqrt[3]{\left(\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right) \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                          4. Step-by-step derivation
                            1. associate-*l*31.9%

                              \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \sqrt[3]{\color{blue}{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right) \cdot \left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                            2. cube-unmult31.9%

                              \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \sqrt[3]{\color{blue}{{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}^{3}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                          5. Simplified31.9%

                            \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\sqrt[3]{{\left(A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)\right)}^{3}}}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                          6. Taylor expanded in B around inf 26.5%

                            \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(A + \left(C + -1 \cdot B\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                          7. Step-by-step derivation
                            1. mul-1-neg26.5%

                              \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \left(C + \color{blue}{\left(-B\right)}\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                            2. unsub-neg26.5%

                              \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + \color{blue}{\left(C - B\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                          8. Simplified26.5%

                            \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(A + \left(C - B\right)\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

                          if 7.4999999999999995e76 < B

                          1. Initial program 5.4%

                            \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                          2. Step-by-step derivation
                            1. Simplified5.4%

                              \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
                            2. Taylor expanded in A around -inf 3.8%

                              \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(2 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                            3. Taylor expanded in B around inf 12.5%

                              \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)} \]
                            4. Step-by-step derivation
                              1. associate-*r/12.5%

                                \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{A \cdot F} \cdot 1}{B}} \]
                              2. *-rgt-identity12.5%

                                \[\leadsto -2 \cdot \frac{\color{blue}{\sqrt{A \cdot F}}}{B} \]
                              3. *-commutative12.5%

                                \[\leadsto -2 \cdot \frac{\sqrt{\color{blue}{F \cdot A}}}{B} \]
                            5. Simplified12.5%

                              \[\leadsto \color{blue}{-2 \cdot \frac{\sqrt{F \cdot A}}{B}} \]
                            6. Step-by-step derivation
                              1. pow1/212.6%

                                \[\leadsto -2 \cdot \frac{\color{blue}{{\left(F \cdot A\right)}^{0.5}}}{B} \]
                              2. *-commutative12.6%

                                \[\leadsto -2 \cdot \frac{{\color{blue}{\left(A \cdot F\right)}}^{0.5}}{B} \]
                            7. Applied egg-rr12.6%

                              \[\leadsto -2 \cdot \frac{\color{blue}{{\left(A \cdot F\right)}^{0.5}}}{B} \]
                          3. Recombined 3 regimes into one program.
                          4. Final simplification15.9%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 4.7 \cdot 10^{-5}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;B \leq 7.5 \cdot 10^{+76}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(A + \left(C - B\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}\\ \end{array} \]

                          Alternative 6: 27.2% accurate, 4.9× speedup?

                          \[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B \leq 3.2 \cdot 10^{-8}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(2 \cdot A\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}\\ \end{array} \end{array} \]
                          NOTE: B should be positive before calling this function
                          NOTE: A and C should be sorted in increasing order before calling this function.
                          (FPCore (A B C F)
                           :precision binary64
                           (let* ((t_0 (- (* B B) (* 4.0 (* A C)))))
                             (if (<= B 3.2e-8)
                               (/ (- (sqrt (* 2.0 (* (* F t_0) (* 2.0 A))))) t_0)
                               (* -2.0 (/ (pow (* A F) 0.5) B)))))
                          B = abs(B);
                          assert(A < C);
                          double code(double A, double B, double C, double F) {
                          	double t_0 = (B * B) - (4.0 * (A * C));
                          	double tmp;
                          	if (B <= 3.2e-8) {
                          		tmp = -sqrt((2.0 * ((F * t_0) * (2.0 * A)))) / t_0;
                          	} else {
                          		tmp = -2.0 * (pow((A * F), 0.5) / B);
                          	}
                          	return tmp;
                          }
                          
                          NOTE: B should be positive before calling this function
                          NOTE: A and C should be sorted in increasing order before calling this function.
                          real(8) function code(a, b, c, f)
                              real(8), intent (in) :: a
                              real(8), intent (in) :: b
                              real(8), intent (in) :: c
                              real(8), intent (in) :: f
                              real(8) :: t_0
                              real(8) :: tmp
                              t_0 = (b * b) - (4.0d0 * (a * c))
                              if (b <= 3.2d-8) then
                                  tmp = -sqrt((2.0d0 * ((f * t_0) * (2.0d0 * a)))) / t_0
                              else
                                  tmp = (-2.0d0) * (((a * f) ** 0.5d0) / b)
                              end if
                              code = tmp
                          end function
                          
                          B = Math.abs(B);
                          assert A < C;
                          public static double code(double A, double B, double C, double F) {
                          	double t_0 = (B * B) - (4.0 * (A * C));
                          	double tmp;
                          	if (B <= 3.2e-8) {
                          		tmp = -Math.sqrt((2.0 * ((F * t_0) * (2.0 * A)))) / t_0;
                          	} else {
                          		tmp = -2.0 * (Math.pow((A * F), 0.5) / B);
                          	}
                          	return tmp;
                          }
                          
                          B = abs(B)
                          [A, C] = sort([A, C])
                          def code(A, B, C, F):
                          	t_0 = (B * B) - (4.0 * (A * C))
                          	tmp = 0
                          	if B <= 3.2e-8:
                          		tmp = -math.sqrt((2.0 * ((F * t_0) * (2.0 * A)))) / t_0
                          	else:
                          		tmp = -2.0 * (math.pow((A * F), 0.5) / B)
                          	return tmp
                          
                          B = abs(B)
                          A, C = sort([A, C])
                          function code(A, B, C, F)
                          	t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))
                          	tmp = 0.0
                          	if (B <= 3.2e-8)
                          		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(F * t_0) * Float64(2.0 * A))))) / t_0);
                          	else
                          		tmp = Float64(-2.0 * Float64((Float64(A * F) ^ 0.5) / B));
                          	end
                          	return tmp
                          end
                          
                          B = abs(B)
                          A, C = num2cell(sort([A, C])){:}
                          function tmp_2 = code(A, B, C, F)
                          	t_0 = (B * B) - (4.0 * (A * C));
                          	tmp = 0.0;
                          	if (B <= 3.2e-8)
                          		tmp = -sqrt((2.0 * ((F * t_0) * (2.0 * A)))) / t_0;
                          	else
                          		tmp = -2.0 * (((A * F) ^ 0.5) / B);
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          NOTE: B should be positive before calling this function
                          NOTE: A and C should be sorted in increasing order before calling this function.
                          code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 3.2e-8], N[((-N[Sqrt[N[(2.0 * N[(N[(F * t$95$0), $MachinePrecision] * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / t$95$0), $MachinePrecision], N[(-2.0 * N[(N[Power[N[(A * F), $MachinePrecision], 0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
                          
                          \begin{array}{l}
                          B = |B|\\
                          [A, C] = \mathsf{sort}([A, C])\\
                          \\
                          \begin{array}{l}
                          t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
                          \mathbf{if}\;B \leq 3.2 \cdot 10^{-8}:\\
                          \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot t_0\right) \cdot \left(2 \cdot A\right)\right)}}{t_0}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;-2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if B < 3.2000000000000002e-8

                            1. Initial program 21.3%

                              \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                            2. Step-by-step derivation
                              1. Simplified21.3%

                                \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
                              2. Taylor expanded in A around -inf 16.3%

                                \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(2 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

                              if 3.2000000000000002e-8 < B

                              1. Initial program 15.0%

                                \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                              2. Step-by-step derivation
                                1. Simplified15.0%

                                  \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
                                2. Taylor expanded in A around -inf 3.4%

                                  \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(2 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                3. Taylor expanded in B around inf 9.5%

                                  \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)} \]
                                4. Step-by-step derivation
                                  1. associate-*r/9.5%

                                    \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{A \cdot F} \cdot 1}{B}} \]
                                  2. *-rgt-identity9.5%

                                    \[\leadsto -2 \cdot \frac{\color{blue}{\sqrt{A \cdot F}}}{B} \]
                                  3. *-commutative9.5%

                                    \[\leadsto -2 \cdot \frac{\sqrt{\color{blue}{F \cdot A}}}{B} \]
                                5. Simplified9.5%

                                  \[\leadsto \color{blue}{-2 \cdot \frac{\sqrt{F \cdot A}}{B}} \]
                                6. Step-by-step derivation
                                  1. pow1/29.6%

                                    \[\leadsto -2 \cdot \frac{\color{blue}{{\left(F \cdot A\right)}^{0.5}}}{B} \]
                                  2. *-commutative9.6%

                                    \[\leadsto -2 \cdot \frac{{\color{blue}{\left(A \cdot F\right)}}^{0.5}}{B} \]
                                7. Applied egg-rr9.6%

                                  \[\leadsto -2 \cdot \frac{\color{blue}{{\left(A \cdot F\right)}^{0.5}}}{B} \]
                              3. Recombined 2 regimes into one program.
                              4. Final simplification14.7%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 3.2 \cdot 10^{-8}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(F \cdot \left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right)\right) \cdot \left(2 \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}\\ \end{array} \]

                              Alternative 7: 27.2% accurate, 4.9× speedup?

                              \[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 3.2 \cdot 10^{-8}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}\\ \end{array} \end{array} \]
                              NOTE: B should be positive before calling this function
                              NOTE: A and C should be sorted in increasing order before calling this function.
                              (FPCore (A B C F)
                               :precision binary64
                               (if (<= B 3.2e-8)
                                 (/
                                  (- (sqrt (* 2.0 (* (+ (* B B) (* -4.0 (* A C))) (* F (* 2.0 A))))))
                                  (- (* B B) (* 4.0 (* A C))))
                                 (* -2.0 (/ (pow (* A F) 0.5) B))))
                              B = abs(B);
                              assert(A < C);
                              double code(double A, double B, double C, double F) {
                              	double tmp;
                              	if (B <= 3.2e-8) {
                              		tmp = -sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / ((B * B) - (4.0 * (A * C)));
                              	} else {
                              		tmp = -2.0 * (pow((A * F), 0.5) / B);
                              	}
                              	return tmp;
                              }
                              
                              NOTE: B should be positive before calling this function
                              NOTE: A and C should be sorted in increasing order before calling this function.
                              real(8) function code(a, b, c, f)
                                  real(8), intent (in) :: a
                                  real(8), intent (in) :: b
                                  real(8), intent (in) :: c
                                  real(8), intent (in) :: f
                                  real(8) :: tmp
                                  if (b <= 3.2d-8) then
                                      tmp = -sqrt((2.0d0 * (((b * b) + ((-4.0d0) * (a * c))) * (f * (2.0d0 * a))))) / ((b * b) - (4.0d0 * (a * c)))
                                  else
                                      tmp = (-2.0d0) * (((a * f) ** 0.5d0) / b)
                                  end if
                                  code = tmp
                              end function
                              
                              B = Math.abs(B);
                              assert A < C;
                              public static double code(double A, double B, double C, double F) {
                              	double tmp;
                              	if (B <= 3.2e-8) {
                              		tmp = -Math.sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / ((B * B) - (4.0 * (A * C)));
                              	} else {
                              		tmp = -2.0 * (Math.pow((A * F), 0.5) / B);
                              	}
                              	return tmp;
                              }
                              
                              B = abs(B)
                              [A, C] = sort([A, C])
                              def code(A, B, C, F):
                              	tmp = 0
                              	if B <= 3.2e-8:
                              		tmp = -math.sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / ((B * B) - (4.0 * (A * C)))
                              	else:
                              		tmp = -2.0 * (math.pow((A * F), 0.5) / B)
                              	return tmp
                              
                              B = abs(B)
                              A, C = sort([A, C])
                              function code(A, B, C, F)
                              	tmp = 0.0
                              	if (B <= 3.2e-8)
                              		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(Float64(B * B) + Float64(-4.0 * Float64(A * C))) * Float64(F * Float64(2.0 * A)))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))));
                              	else
                              		tmp = Float64(-2.0 * Float64((Float64(A * F) ^ 0.5) / B));
                              	end
                              	return tmp
                              end
                              
                              B = abs(B)
                              A, C = num2cell(sort([A, C])){:}
                              function tmp_2 = code(A, B, C, F)
                              	tmp = 0.0;
                              	if (B <= 3.2e-8)
                              		tmp = -sqrt((2.0 * (((B * B) + (-4.0 * (A * C))) * (F * (2.0 * A))))) / ((B * B) - (4.0 * (A * C)));
                              	else
                              		tmp = -2.0 * (((A * F) ^ 0.5) / B);
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              NOTE: B should be positive before calling this function
                              NOTE: A and C should be sorted in increasing order before calling this function.
                              code[A_, B_, C_, F_] := If[LessEqual[B, 3.2e-8], N[((-N[Sqrt[N[(2.0 * N[(N[(N[(B * B), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(2.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Power[N[(A * F), $MachinePrecision], 0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]
                              
                              \begin{array}{l}
                              B = |B|\\
                              [A, C] = \mathsf{sort}([A, C])\\
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;B \leq 3.2 \cdot 10^{-8}:\\
                              \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;-2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if B < 3.2000000000000002e-8

                                1. Initial program 21.3%

                                  \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                2. Step-by-step derivation
                                  1. Simplified21.3%

                                    \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
                                  2. Taylor expanded in A around -inf 16.3%

                                    \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(2 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                  3. Step-by-step derivation
                                    1. *-un-lft-identity16.3%

                                      \[\leadsto \frac{-\color{blue}{1 \cdot \sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(2 \cdot A\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                    2. associate-*l*15.7%

                                      \[\leadsto \frac{-1 \cdot \sqrt{2 \cdot \color{blue}{\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                    3. *-commutative15.7%

                                      \[\leadsto \frac{-1 \cdot \sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \color{blue}{\left(A \cdot 2\right)}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                  4. Applied egg-rr15.7%

                                    \[\leadsto \frac{-\color{blue}{1 \cdot \sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                  5. Step-by-step derivation
                                    1. *-lft-identity15.7%

                                      \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                    2. unpow215.7%

                                      \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\color{blue}{{B}^{2}} - 4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                    3. cancel-sign-sub-inv15.7%

                                      \[\leadsto \frac{-\sqrt{2 \cdot \left(\color{blue}{\left({B}^{2} + \left(-4\right) \cdot \left(A \cdot C\right)\right)} \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                    4. unpow215.7%

                                      \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\color{blue}{B \cdot B} + \left(-4\right) \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                    5. metadata-eval15.7%

                                      \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(B \cdot B + \color{blue}{-4} \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                  6. Simplified15.7%

                                    \[\leadsto \frac{-\color{blue}{\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(A \cdot 2\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

                                  if 3.2000000000000002e-8 < B

                                  1. Initial program 15.0%

                                    \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                  2. Step-by-step derivation
                                    1. Simplified15.0%

                                      \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
                                    2. Taylor expanded in A around -inf 3.4%

                                      \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(2 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                    3. Taylor expanded in B around inf 9.5%

                                      \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)} \]
                                    4. Step-by-step derivation
                                      1. associate-*r/9.5%

                                        \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{A \cdot F} \cdot 1}{B}} \]
                                      2. *-rgt-identity9.5%

                                        \[\leadsto -2 \cdot \frac{\color{blue}{\sqrt{A \cdot F}}}{B} \]
                                      3. *-commutative9.5%

                                        \[\leadsto -2 \cdot \frac{\sqrt{\color{blue}{F \cdot A}}}{B} \]
                                    5. Simplified9.5%

                                      \[\leadsto \color{blue}{-2 \cdot \frac{\sqrt{F \cdot A}}{B}} \]
                                    6. Step-by-step derivation
                                      1. pow1/29.6%

                                        \[\leadsto -2 \cdot \frac{\color{blue}{{\left(F \cdot A\right)}^{0.5}}}{B} \]
                                      2. *-commutative9.6%

                                        \[\leadsto -2 \cdot \frac{{\color{blue}{\left(A \cdot F\right)}}^{0.5}}{B} \]
                                    7. Applied egg-rr9.6%

                                      \[\leadsto -2 \cdot \frac{\color{blue}{{\left(A \cdot F\right)}^{0.5}}}{B} \]
                                  3. Recombined 2 regimes into one program.
                                  4. Final simplification14.3%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 3.2 \cdot 10^{-8}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(B \cdot B + -4 \cdot \left(A \cdot C\right)\right) \cdot \left(F \cdot \left(2 \cdot A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}\\ \end{array} \]

                                  Alternative 8: 22.4% accurate, 5.0× speedup?

                                  \[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 2.3 \cdot 10^{-8}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(2 \cdot A\right) \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}\\ \end{array} \end{array} \]
                                  NOTE: B should be positive before calling this function
                                  NOTE: A and C should be sorted in increasing order before calling this function.
                                  (FPCore (A B C F)
                                   :precision binary64
                                   (if (<= B 2.3e-8)
                                     (/
                                      (- (sqrt (* 2.0 (* (* 2.0 A) (* -4.0 (* A (* C F)))))))
                                      (- (* B B) (* 4.0 (* A C))))
                                     (* -2.0 (/ (pow (* A F) 0.5) B))))
                                  B = abs(B);
                                  assert(A < C);
                                  double code(double A, double B, double C, double F) {
                                  	double tmp;
                                  	if (B <= 2.3e-8) {
                                  		tmp = -sqrt((2.0 * ((2.0 * A) * (-4.0 * (A * (C * F)))))) / ((B * B) - (4.0 * (A * C)));
                                  	} else {
                                  		tmp = -2.0 * (pow((A * F), 0.5) / B);
                                  	}
                                  	return tmp;
                                  }
                                  
                                  NOTE: B should be positive before calling this function
                                  NOTE: A and C should be sorted in increasing order before calling this function.
                                  real(8) function code(a, b, c, f)
                                      real(8), intent (in) :: a
                                      real(8), intent (in) :: b
                                      real(8), intent (in) :: c
                                      real(8), intent (in) :: f
                                      real(8) :: tmp
                                      if (b <= 2.3d-8) then
                                          tmp = -sqrt((2.0d0 * ((2.0d0 * a) * ((-4.0d0) * (a * (c * f)))))) / ((b * b) - (4.0d0 * (a * c)))
                                      else
                                          tmp = (-2.0d0) * (((a * f) ** 0.5d0) / b)
                                      end if
                                      code = tmp
                                  end function
                                  
                                  B = Math.abs(B);
                                  assert A < C;
                                  public static double code(double A, double B, double C, double F) {
                                  	double tmp;
                                  	if (B <= 2.3e-8) {
                                  		tmp = -Math.sqrt((2.0 * ((2.0 * A) * (-4.0 * (A * (C * F)))))) / ((B * B) - (4.0 * (A * C)));
                                  	} else {
                                  		tmp = -2.0 * (Math.pow((A * F), 0.5) / B);
                                  	}
                                  	return tmp;
                                  }
                                  
                                  B = abs(B)
                                  [A, C] = sort([A, C])
                                  def code(A, B, C, F):
                                  	tmp = 0
                                  	if B <= 2.3e-8:
                                  		tmp = -math.sqrt((2.0 * ((2.0 * A) * (-4.0 * (A * (C * F)))))) / ((B * B) - (4.0 * (A * C)))
                                  	else:
                                  		tmp = -2.0 * (math.pow((A * F), 0.5) / B)
                                  	return tmp
                                  
                                  B = abs(B)
                                  A, C = sort([A, C])
                                  function code(A, B, C, F)
                                  	tmp = 0.0
                                  	if (B <= 2.3e-8)
                                  		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(2.0 * A) * Float64(-4.0 * Float64(A * Float64(C * F))))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))));
                                  	else
                                  		tmp = Float64(-2.0 * Float64((Float64(A * F) ^ 0.5) / B));
                                  	end
                                  	return tmp
                                  end
                                  
                                  B = abs(B)
                                  A, C = num2cell(sort([A, C])){:}
                                  function tmp_2 = code(A, B, C, F)
                                  	tmp = 0.0;
                                  	if (B <= 2.3e-8)
                                  		tmp = -sqrt((2.0 * ((2.0 * A) * (-4.0 * (A * (C * F)))))) / ((B * B) - (4.0 * (A * C)));
                                  	else
                                  		tmp = -2.0 * (((A * F) ^ 0.5) / B);
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  NOTE: B should be positive before calling this function
                                  NOTE: A and C should be sorted in increasing order before calling this function.
                                  code[A_, B_, C_, F_] := If[LessEqual[B, 2.3e-8], N[((-N[Sqrt[N[(2.0 * N[(N[(2.0 * A), $MachinePrecision] * N[(-4.0 * N[(A * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Power[N[(A * F), $MachinePrecision], 0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]
                                  
                                  \begin{array}{l}
                                  B = |B|\\
                                  [A, C] = \mathsf{sort}([A, C])\\
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;B \leq 2.3 \cdot 10^{-8}:\\
                                  \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(2 \cdot A\right) \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;-2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if B < 2.3000000000000001e-8

                                    1. Initial program 21.3%

                                      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                    2. Step-by-step derivation
                                      1. Simplified21.3%

                                        \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
                                      2. Taylor expanded in A around -inf 16.3%

                                        \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(2 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                      3. Taylor expanded in B around 0 12.9%

                                        \[\leadsto \frac{-\sqrt{2 \cdot \left(\color{blue}{\left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)} \cdot \left(2 \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                      4. Step-by-step derivation
                                        1. *-commutative12.9%

                                          \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(-4 \cdot \left(A \cdot \color{blue}{\left(F \cdot C\right)}\right)\right) \cdot \left(2 \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                      5. Simplified12.9%

                                        \[\leadsto \frac{-\sqrt{2 \cdot \left(\color{blue}{\left(-4 \cdot \left(A \cdot \left(F \cdot C\right)\right)\right)} \cdot \left(2 \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

                                      if 2.3000000000000001e-8 < B

                                      1. Initial program 15.0%

                                        \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                      2. Step-by-step derivation
                                        1. Simplified15.0%

                                          \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
                                        2. Taylor expanded in A around -inf 3.4%

                                          \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(2 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                        3. Taylor expanded in B around inf 9.5%

                                          \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)} \]
                                        4. Step-by-step derivation
                                          1. associate-*r/9.5%

                                            \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{A \cdot F} \cdot 1}{B}} \]
                                          2. *-rgt-identity9.5%

                                            \[\leadsto -2 \cdot \frac{\color{blue}{\sqrt{A \cdot F}}}{B} \]
                                          3. *-commutative9.5%

                                            \[\leadsto -2 \cdot \frac{\sqrt{\color{blue}{F \cdot A}}}{B} \]
                                        5. Simplified9.5%

                                          \[\leadsto \color{blue}{-2 \cdot \frac{\sqrt{F \cdot A}}{B}} \]
                                        6. Step-by-step derivation
                                          1. pow1/29.6%

                                            \[\leadsto -2 \cdot \frac{\color{blue}{{\left(F \cdot A\right)}^{0.5}}}{B} \]
                                          2. *-commutative9.6%

                                            \[\leadsto -2 \cdot \frac{{\color{blue}{\left(A \cdot F\right)}}^{0.5}}{B} \]
                                        7. Applied egg-rr9.6%

                                          \[\leadsto -2 \cdot \frac{\color{blue}{{\left(A \cdot F\right)}^{0.5}}}{B} \]
                                      3. Recombined 2 regimes into one program.
                                      4. Final simplification12.2%

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 2.3 \cdot 10^{-8}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(2 \cdot A\right) \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}\\ \end{array} \]

                                      Alternative 9: 18.9% accurate, 5.1× speedup?

                                      \[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 3.1 \cdot 10^{-9}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(C \cdot F\right) \cdot \left(\left(A \cdot A\right) \cdot -8\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}\\ \end{array} \end{array} \]
                                      NOTE: B should be positive before calling this function
                                      NOTE: A and C should be sorted in increasing order before calling this function.
                                      (FPCore (A B C F)
                                       :precision binary64
                                       (if (<= B 3.1e-9)
                                         (/
                                          (- (sqrt (* 2.0 (* (* C F) (* (* A A) -8.0)))))
                                          (- (* B B) (* 4.0 (* A C))))
                                         (* -2.0 (/ (pow (* A F) 0.5) B))))
                                      B = abs(B);
                                      assert(A < C);
                                      double code(double A, double B, double C, double F) {
                                      	double tmp;
                                      	if (B <= 3.1e-9) {
                                      		tmp = -sqrt((2.0 * ((C * F) * ((A * A) * -8.0)))) / ((B * B) - (4.0 * (A * C)));
                                      	} else {
                                      		tmp = -2.0 * (pow((A * F), 0.5) / B);
                                      	}
                                      	return tmp;
                                      }
                                      
                                      NOTE: B should be positive before calling this function
                                      NOTE: A and C should be sorted in increasing order before calling this function.
                                      real(8) function code(a, b, c, f)
                                          real(8), intent (in) :: a
                                          real(8), intent (in) :: b
                                          real(8), intent (in) :: c
                                          real(8), intent (in) :: f
                                          real(8) :: tmp
                                          if (b <= 3.1d-9) then
                                              tmp = -sqrt((2.0d0 * ((c * f) * ((a * a) * (-8.0d0))))) / ((b * b) - (4.0d0 * (a * c)))
                                          else
                                              tmp = (-2.0d0) * (((a * f) ** 0.5d0) / b)
                                          end if
                                          code = tmp
                                      end function
                                      
                                      B = Math.abs(B);
                                      assert A < C;
                                      public static double code(double A, double B, double C, double F) {
                                      	double tmp;
                                      	if (B <= 3.1e-9) {
                                      		tmp = -Math.sqrt((2.0 * ((C * F) * ((A * A) * -8.0)))) / ((B * B) - (4.0 * (A * C)));
                                      	} else {
                                      		tmp = -2.0 * (Math.pow((A * F), 0.5) / B);
                                      	}
                                      	return tmp;
                                      }
                                      
                                      B = abs(B)
                                      [A, C] = sort([A, C])
                                      def code(A, B, C, F):
                                      	tmp = 0
                                      	if B <= 3.1e-9:
                                      		tmp = -math.sqrt((2.0 * ((C * F) * ((A * A) * -8.0)))) / ((B * B) - (4.0 * (A * C)))
                                      	else:
                                      		tmp = -2.0 * (math.pow((A * F), 0.5) / B)
                                      	return tmp
                                      
                                      B = abs(B)
                                      A, C = sort([A, C])
                                      function code(A, B, C, F)
                                      	tmp = 0.0
                                      	if (B <= 3.1e-9)
                                      		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(C * F) * Float64(Float64(A * A) * -8.0))))) / Float64(Float64(B * B) - Float64(4.0 * Float64(A * C))));
                                      	else
                                      		tmp = Float64(-2.0 * Float64((Float64(A * F) ^ 0.5) / B));
                                      	end
                                      	return tmp
                                      end
                                      
                                      B = abs(B)
                                      A, C = num2cell(sort([A, C])){:}
                                      function tmp_2 = code(A, B, C, F)
                                      	tmp = 0.0;
                                      	if (B <= 3.1e-9)
                                      		tmp = -sqrt((2.0 * ((C * F) * ((A * A) * -8.0)))) / ((B * B) - (4.0 * (A * C)));
                                      	else
                                      		tmp = -2.0 * (((A * F) ^ 0.5) / B);
                                      	end
                                      	tmp_2 = tmp;
                                      end
                                      
                                      NOTE: B should be positive before calling this function
                                      NOTE: A and C should be sorted in increasing order before calling this function.
                                      code[A_, B_, C_, F_] := If[LessEqual[B, 3.1e-9], N[((-N[Sqrt[N[(2.0 * N[(N[(C * F), $MachinePrecision] * N[(N[(A * A), $MachinePrecision] * -8.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-2.0 * N[(N[Power[N[(A * F), $MachinePrecision], 0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]
                                      
                                      \begin{array}{l}
                                      B = |B|\\
                                      [A, C] = \mathsf{sort}([A, C])\\
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;B \leq 3.1 \cdot 10^{-9}:\\
                                      \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(C \cdot F\right) \cdot \left(\left(A \cdot A\right) \cdot -8\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;-2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 2 regimes
                                      2. if B < 3.10000000000000005e-9

                                        1. Initial program 21.3%

                                          \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                        2. Step-by-step derivation
                                          1. Simplified21.3%

                                            \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
                                          2. Taylor expanded in A around -inf 16.3%

                                            \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(2 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                          3. Taylor expanded in B around 0 10.4%

                                            \[\leadsto \frac{-\sqrt{2 \cdot \color{blue}{\left(-8 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                          4. Step-by-step derivation
                                            1. associate-*r*10.4%

                                              \[\leadsto \frac{-\sqrt{2 \cdot \color{blue}{\left(\left(-8 \cdot {A}^{2}\right) \cdot \left(C \cdot F\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                            2. unpow210.4%

                                              \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(-8 \cdot \color{blue}{\left(A \cdot A\right)}\right) \cdot \left(C \cdot F\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                            3. *-commutative10.4%

                                              \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(-8 \cdot \left(A \cdot A\right)\right) \cdot \color{blue}{\left(F \cdot C\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                          5. Simplified10.4%

                                            \[\leadsto \frac{-\sqrt{2 \cdot \color{blue}{\left(\left(-8 \cdot \left(A \cdot A\right)\right) \cdot \left(F \cdot C\right)\right)}}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

                                          if 3.10000000000000005e-9 < B

                                          1. Initial program 15.0%

                                            \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                          2. Step-by-step derivation
                                            1. Simplified15.0%

                                              \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
                                            2. Taylor expanded in A around -inf 3.4%

                                              \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(2 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                            3. Taylor expanded in B around inf 9.5%

                                              \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)} \]
                                            4. Step-by-step derivation
                                              1. associate-*r/9.5%

                                                \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{A \cdot F} \cdot 1}{B}} \]
                                              2. *-rgt-identity9.5%

                                                \[\leadsto -2 \cdot \frac{\color{blue}{\sqrt{A \cdot F}}}{B} \]
                                              3. *-commutative9.5%

                                                \[\leadsto -2 \cdot \frac{\sqrt{\color{blue}{F \cdot A}}}{B} \]
                                            5. Simplified9.5%

                                              \[\leadsto \color{blue}{-2 \cdot \frac{\sqrt{F \cdot A}}{B}} \]
                                            6. Step-by-step derivation
                                              1. pow1/29.6%

                                                \[\leadsto -2 \cdot \frac{\color{blue}{{\left(F \cdot A\right)}^{0.5}}}{B} \]
                                              2. *-commutative9.6%

                                                \[\leadsto -2 \cdot \frac{{\color{blue}{\left(A \cdot F\right)}}^{0.5}}{B} \]
                                            7. Applied egg-rr9.6%

                                              \[\leadsto -2 \cdot \frac{\color{blue}{{\left(A \cdot F\right)}^{0.5}}}{B} \]
                                          3. Recombined 2 regimes into one program.
                                          4. Final simplification10.2%

                                            \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 3.1 \cdot 10^{-9}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(C \cdot F\right) \cdot \left(\left(A \cdot A\right) \cdot -8\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}\\ \end{array} \]

                                          Alternative 10: 9.1% accurate, 5.9× speedup?

                                          \[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ -2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B} \end{array} \]
                                          NOTE: B should be positive before calling this function
                                          NOTE: A and C should be sorted in increasing order before calling this function.
                                          (FPCore (A B C F) :precision binary64 (* -2.0 (/ (pow (* A F) 0.5) B)))
                                          B = abs(B);
                                          assert(A < C);
                                          double code(double A, double B, double C, double F) {
                                          	return -2.0 * (pow((A * F), 0.5) / B);
                                          }
                                          
                                          NOTE: B should be positive before calling this function
                                          NOTE: A and C should be sorted in increasing order before calling this function.
                                          real(8) function code(a, b, c, f)
                                              real(8), intent (in) :: a
                                              real(8), intent (in) :: b
                                              real(8), intent (in) :: c
                                              real(8), intent (in) :: f
                                              code = (-2.0d0) * (((a * f) ** 0.5d0) / b)
                                          end function
                                          
                                          B = Math.abs(B);
                                          assert A < C;
                                          public static double code(double A, double B, double C, double F) {
                                          	return -2.0 * (Math.pow((A * F), 0.5) / B);
                                          }
                                          
                                          B = abs(B)
                                          [A, C] = sort([A, C])
                                          def code(A, B, C, F):
                                          	return -2.0 * (math.pow((A * F), 0.5) / B)
                                          
                                          B = abs(B)
                                          A, C = sort([A, C])
                                          function code(A, B, C, F)
                                          	return Float64(-2.0 * Float64((Float64(A * F) ^ 0.5) / B))
                                          end
                                          
                                          B = abs(B)
                                          A, C = num2cell(sort([A, C])){:}
                                          function tmp = code(A, B, C, F)
                                          	tmp = -2.0 * (((A * F) ^ 0.5) / B);
                                          end
                                          
                                          NOTE: B should be positive before calling this function
                                          NOTE: A and C should be sorted in increasing order before calling this function.
                                          code[A_, B_, C_, F_] := N[(-2.0 * N[(N[Power[N[(A * F), $MachinePrecision], 0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]
                                          
                                          \begin{array}{l}
                                          B = |B|\\
                                          [A, C] = \mathsf{sort}([A, C])\\
                                          \\
                                          -2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B}
                                          \end{array}
                                          
                                          Derivation
                                          1. Initial program 19.8%

                                            \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                          2. Step-by-step derivation
                                            1. Simplified19.8%

                                              \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
                                            2. Taylor expanded in A around -inf 13.3%

                                              \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(2 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                            3. Taylor expanded in B around inf 3.3%

                                              \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)} \]
                                            4. Step-by-step derivation
                                              1. associate-*r/3.3%

                                                \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{A \cdot F} \cdot 1}{B}} \]
                                              2. *-rgt-identity3.3%

                                                \[\leadsto -2 \cdot \frac{\color{blue}{\sqrt{A \cdot F}}}{B} \]
                                              3. *-commutative3.3%

                                                \[\leadsto -2 \cdot \frac{\sqrt{\color{blue}{F \cdot A}}}{B} \]
                                            5. Simplified3.3%

                                              \[\leadsto \color{blue}{-2 \cdot \frac{\sqrt{F \cdot A}}{B}} \]
                                            6. Step-by-step derivation
                                              1. pow1/23.5%

                                                \[\leadsto -2 \cdot \frac{\color{blue}{{\left(F \cdot A\right)}^{0.5}}}{B} \]
                                              2. *-commutative3.5%

                                                \[\leadsto -2 \cdot \frac{{\color{blue}{\left(A \cdot F\right)}}^{0.5}}{B} \]
                                            7. Applied egg-rr3.5%

                                              \[\leadsto -2 \cdot \frac{\color{blue}{{\left(A \cdot F\right)}^{0.5}}}{B} \]
                                            8. Final simplification3.5%

                                              \[\leadsto -2 \cdot \frac{{\left(A \cdot F\right)}^{0.5}}{B} \]

                                            Alternative 11: 9.0% accurate, 5.9× speedup?

                                            \[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ -2 \cdot \frac{\sqrt{A \cdot F}}{B} \end{array} \]
                                            NOTE: B should be positive before calling this function
                                            NOTE: A and C should be sorted in increasing order before calling this function.
                                            (FPCore (A B C F) :precision binary64 (* -2.0 (/ (sqrt (* A F)) B)))
                                            B = abs(B);
                                            assert(A < C);
                                            double code(double A, double B, double C, double F) {
                                            	return -2.0 * (sqrt((A * F)) / B);
                                            }
                                            
                                            NOTE: B should be positive before calling this function
                                            NOTE: A and C should be sorted in increasing order before calling this function.
                                            real(8) function code(a, b, c, f)
                                                real(8), intent (in) :: a
                                                real(8), intent (in) :: b
                                                real(8), intent (in) :: c
                                                real(8), intent (in) :: f
                                                code = (-2.0d0) * (sqrt((a * f)) / b)
                                            end function
                                            
                                            B = Math.abs(B);
                                            assert A < C;
                                            public static double code(double A, double B, double C, double F) {
                                            	return -2.0 * (Math.sqrt((A * F)) / B);
                                            }
                                            
                                            B = abs(B)
                                            [A, C] = sort([A, C])
                                            def code(A, B, C, F):
                                            	return -2.0 * (math.sqrt((A * F)) / B)
                                            
                                            B = abs(B)
                                            A, C = sort([A, C])
                                            function code(A, B, C, F)
                                            	return Float64(-2.0 * Float64(sqrt(Float64(A * F)) / B))
                                            end
                                            
                                            B = abs(B)
                                            A, C = num2cell(sort([A, C])){:}
                                            function tmp = code(A, B, C, F)
                                            	tmp = -2.0 * (sqrt((A * F)) / B);
                                            end
                                            
                                            NOTE: B should be positive before calling this function
                                            NOTE: A and C should be sorted in increasing order before calling this function.
                                            code[A_, B_, C_, F_] := N[(-2.0 * N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]
                                            
                                            \begin{array}{l}
                                            B = |B|\\
                                            [A, C] = \mathsf{sort}([A, C])\\
                                            \\
                                            -2 \cdot \frac{\sqrt{A \cdot F}}{B}
                                            \end{array}
                                            
                                            Derivation
                                            1. Initial program 19.8%

                                              \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                            2. Step-by-step derivation
                                              1. Simplified19.8%

                                                \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{B \cdot B + {\left(A - C\right)}^{2}}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
                                              2. Taylor expanded in A around -inf 13.3%

                                                \[\leadsto \frac{-\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \color{blue}{\left(2 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
                                              3. Taylor expanded in B around inf 3.3%

                                                \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)} \]
                                              4. Step-by-step derivation
                                                1. associate-*r/3.3%

                                                  \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{A \cdot F} \cdot 1}{B}} \]
                                                2. *-rgt-identity3.3%

                                                  \[\leadsto -2 \cdot \frac{\color{blue}{\sqrt{A \cdot F}}}{B} \]
                                                3. *-commutative3.3%

                                                  \[\leadsto -2 \cdot \frac{\sqrt{\color{blue}{F \cdot A}}}{B} \]
                                              5. Simplified3.3%

                                                \[\leadsto \color{blue}{-2 \cdot \frac{\sqrt{F \cdot A}}{B}} \]
                                              6. Final simplification3.3%

                                                \[\leadsto -2 \cdot \frac{\sqrt{A \cdot F}}{B} \]

                                              Reproduce

                                              ?
                                              herbie shell --seed 2023257 
                                              (FPCore (A B C F)
                                                :name "ABCF->ab-angle b"
                                                :precision binary64
                                                (/ (- (sqrt (* (* 2.0 (* (- (pow B 2.0) (* (* 4.0 A) C)) F)) (- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))) (- (pow B 2.0) (* (* 4.0 A) C))))