ABCF->ab-angle b

Percentage Accurate: 19.0% → 47.0%
Time: 32.6s
Alternatives: 11
Speedup: 5.1×

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: 19.0% 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.0% accurate, 2.0× 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}^{2} \leq 10^{-15}:\\ \;\;\;\;-\frac{\sqrt{2 \cdot \left(\left(t_0 \cdot F\right) \cdot \left(A + A\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot \left(2 \cdot F\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
 (let* ((t_0 (- (* B B) (* 4.0 (* A C)))))
   (if (<= (pow B 2.0) 1e-15)
     (- (/ (sqrt (* 2.0 (* (* t_0 F) (+ A A)))) t_0))
     (/ (- (sqrt (* (- A (hypot A B)) (* 2.0 F)))) 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 (pow(B, 2.0) <= 1e-15) {
		tmp = -(sqrt((2.0 * ((t_0 * F) * (A + A)))) / t_0);
	} else {
		tmp = -sqrt(((A - hypot(A, B)) * (2.0 * F))) / B;
	}
	return tmp;
}
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 (Math.pow(B, 2.0) <= 1e-15) {
		tmp = -(Math.sqrt((2.0 * ((t_0 * F) * (A + A)))) / t_0);
	} else {
		tmp = -Math.sqrt(((A - Math.hypot(A, B)) * (2.0 * F))) / 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 math.pow(B, 2.0) <= 1e-15:
		tmp = -(math.sqrt((2.0 * ((t_0 * F) * (A + A)))) / t_0)
	else:
		tmp = -math.sqrt(((A - math.hypot(A, B)) * (2.0 * F))) / 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 ^ 2.0) <= 1e-15)
		tmp = Float64(-Float64(sqrt(Float64(2.0 * Float64(Float64(t_0 * F) * Float64(A + A)))) / t_0));
	else
		tmp = Float64(Float64(-sqrt(Float64(Float64(A - hypot(A, B)) * Float64(2.0 * F)))) / 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 ^ 2.0) <= 1e-15)
		tmp = -(sqrt((2.0 * ((t_0 * F) * (A + A)))) / t_0);
	else
		tmp = -sqrt(((A - hypot(A, B)) * (2.0 * F))) / 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[N[Power[B, 2.0], $MachinePrecision], 1e-15], (-N[(N[Sqrt[N[(2.0 * N[(N[(t$95$0 * F), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), N[((-N[Sqrt[N[(N[(A - N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]) / B), $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}^{2} \leq 10^{-15}:\\
\;\;\;\;-\frac{\sqrt{2 \cdot \left(\left(t_0 \cdot F\right) \cdot \left(A + A\right)\right)}}{t_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 B 2) < 1.0000000000000001e-15

    1. Initial program 17.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. Simplified17.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)}} \]
    3. Taylor expanded in C around inf 18.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 - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv18.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(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval18.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 + \color{blue}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity18.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 + \color{blue}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified18.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 + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if 1.0000000000000001e-15 < (pow.f64 B 2)

    1. Initial program 17.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. Simplified17.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)}} \]
    3. Taylor expanded in C around 0 11.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 43.6% accurate, 3.0× 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 1.2 \cdot 10^{+43}:\\ \;\;\;\;-\frac{\sqrt{2 \cdot \left(\left(t_0 \cdot F\right) \cdot \left(A + A\right)\right)}}{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(A - B\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)))))
   (if (<= B 1.2e+43)
     (- (/ (sqrt (* 2.0 (* (* t_0 F) (+ A A)))) t_0))
     (* (/ (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 t_0 = (B * B) - (4.0 * (A * C));
	double tmp;
	if (B <= 1.2e+43) {
		tmp = -(sqrt((2.0 * ((t_0 * F) * (A + A)))) / t_0);
	} 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) :: t_0
    real(8) :: tmp
    t_0 = (b * b) - (4.0d0 * (a * c))
    if (b <= 1.2d+43) then
        tmp = -(sqrt((2.0d0 * ((t_0 * f) * (a + a)))) / t_0)
    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 t_0 = (B * B) - (4.0 * (A * C));
	double tmp;
	if (B <= 1.2e+43) {
		tmp = -(Math.sqrt((2.0 * ((t_0 * F) * (A + A)))) / t_0);
	} 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):
	t_0 = (B * B) - (4.0 * (A * C))
	tmp = 0
	if B <= 1.2e+43:
		tmp = -(math.sqrt((2.0 * ((t_0 * F) * (A + A)))) / t_0)
	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)
	t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))
	tmp = 0.0
	if (B <= 1.2e+43)
		tmp = Float64(-Float64(sqrt(Float64(2.0 * Float64(Float64(t_0 * F) * Float64(A + A)))) / t_0));
	else
		tmp = Float64(Float64(sqrt(2.0) / B) * Float64(-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)
	t_0 = (B * B) - (4.0 * (A * C));
	tmp = 0.0;
	if (B <= 1.2e+43)
		tmp = -(sqrt((2.0 * ((t_0 * F) * (A + A)))) / t_0);
	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_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 1.2e+43], (-N[(N[Sqrt[N[(2.0 * N[(N[(t$95$0 * F), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $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}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 1.2 \cdot 10^{+43}:\\
\;\;\;\;-\frac{\sqrt{2 \cdot \left(\left(t_0 \cdot F\right) \cdot \left(A + A\right)\right)}}{t_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 1.20000000000000012e43

    1. Initial program 17.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. Simplified17.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)}} \]
    3. Taylor expanded in C around inf 13.0%

      \[\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 - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv13.0%

        \[\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(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval13.0%

        \[\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}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity13.0%

        \[\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}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified13.0%

      \[\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 + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if 1.20000000000000012e43 < B

    1. Initial program 17.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. Simplified17.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)}} \]
    3. Taylor expanded in C around 0 21.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 43.3% accurate, 3.0× 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 1.5 \cdot 10^{+43}:\\ \;\;\;\;-\frac{\sqrt{2 \cdot \left(\left(t_0 \cdot F\right) \cdot \left(A + A\right)\right)}}{t_0}\\ \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
 (let* ((t_0 (- (* B B) (* 4.0 (* A C)))))
   (if (<= B 1.5e+43)
     (- (/ (sqrt (* 2.0 (* (* t_0 F) (+ A A)))) t_0))
     (* (/ (sqrt 2.0) B) (- (sqrt (* B (- F))))))))
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 <= 1.5e+43) {
		tmp = -(sqrt((2.0 * ((t_0 * F) * (A + A)))) / t_0);
	} 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) :: t_0
    real(8) :: tmp
    t_0 = (b * b) - (4.0d0 * (a * c))
    if (b <= 1.5d+43) then
        tmp = -(sqrt((2.0d0 * ((t_0 * f) * (a + a)))) / t_0)
    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 t_0 = (B * B) - (4.0 * (A * C));
	double tmp;
	if (B <= 1.5e+43) {
		tmp = -(Math.sqrt((2.0 * ((t_0 * F) * (A + A)))) / t_0);
	} 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):
	t_0 = (B * B) - (4.0 * (A * C))
	tmp = 0
	if B <= 1.5e+43:
		tmp = -(math.sqrt((2.0 * ((t_0 * F) * (A + A)))) / t_0)
	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)
	t_0 = Float64(Float64(B * B) - Float64(4.0 * Float64(A * C)))
	tmp = 0.0
	if (B <= 1.5e+43)
		tmp = Float64(-Float64(sqrt(Float64(2.0 * Float64(Float64(t_0 * F) * Float64(A + A)))) / t_0));
	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)
	t_0 = (B * B) - (4.0 * (A * C));
	tmp = 0.0;
	if (B <= 1.5e+43)
		tmp = -(sqrt((2.0 * ((t_0 * F) * (A + A)))) / t_0);
	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_] := Block[{t$95$0 = N[(N[(B * B), $MachinePrecision] - N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 1.5e+43], (-N[(N[Sqrt[N[(2.0 * N[(N[(t$95$0 * F), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $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}
t_0 := B \cdot B - 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B \leq 1.5 \cdot 10^{+43}:\\
\;\;\;\;-\frac{\sqrt{2 \cdot \left(\left(t_0 \cdot F\right) \cdot \left(A + A\right)\right)}}{t_0}\\

\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.50000000000000008e43

    1. Initial program 17.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. Simplified17.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)}} \]
    3. Taylor expanded in C around inf 13.0%

      \[\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 - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv13.0%

        \[\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(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval13.0%

        \[\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}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity13.0%

        \[\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}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified13.0%

      \[\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 + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if 1.50000000000000008e43 < B

    1. Initial program 17.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. Simplified17.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)}} \]
    3. Taylor expanded in C around 0 21.3%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.5 \cdot 10^{+43}:\\ \;\;\;\;-\frac{\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + A\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 4: 31.0% 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)\\ t_1 := t_0 \cdot F\\ \mathbf{if}\;B \leq 6.2 \cdot 10^{+43}:\\ \;\;\;\;-\frac{\sqrt{2 \cdot \left(t_1 \cdot \left(A + A\right)\right)}}{t_0}\\ \mathbf{elif}\;B \leq 8.2 \cdot 10^{+144}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(\left(A + C\right) - B\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)))) (t_1 (* t_0 F)))
   (if (<= B 6.2e+43)
     (- (/ (sqrt (* 2.0 (* t_1 (+ A A)))) t_0))
     (if (<= B 8.2e+144)
       (/ (- (sqrt (* 2.0 (* t_1 (- (+ 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 t_1 = t_0 * F;
	double tmp;
	if (B <= 6.2e+43) {
		tmp = -(sqrt((2.0 * (t_1 * (A + A)))) / t_0);
	} else if (B <= 8.2e+144) {
		tmp = -sqrt((2.0 * (t_1 * ((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) :: t_1
    real(8) :: tmp
    t_0 = (b * b) - (4.0d0 * (a * c))
    t_1 = t_0 * f
    if (b <= 6.2d+43) then
        tmp = -(sqrt((2.0d0 * (t_1 * (a + a)))) / t_0)
    else if (b <= 8.2d+144) then
        tmp = -sqrt((2.0d0 * (t_1 * ((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 t_1 = t_0 * F;
	double tmp;
	if (B <= 6.2e+43) {
		tmp = -(Math.sqrt((2.0 * (t_1 * (A + A)))) / t_0);
	} else if (B <= 8.2e+144) {
		tmp = -Math.sqrt((2.0 * (t_1 * ((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))
	t_1 = t_0 * F
	tmp = 0
	if B <= 6.2e+43:
		tmp = -(math.sqrt((2.0 * (t_1 * (A + A)))) / t_0)
	elif B <= 8.2e+144:
		tmp = -math.sqrt((2.0 * (t_1 * ((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)))
	t_1 = Float64(t_0 * F)
	tmp = 0.0
	if (B <= 6.2e+43)
		tmp = Float64(-Float64(sqrt(Float64(2.0 * Float64(t_1 * Float64(A + A)))) / t_0));
	elseif (B <= 8.2e+144)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_1 * Float64(Float64(A + 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));
	t_1 = t_0 * F;
	tmp = 0.0;
	if (B <= 6.2e+43)
		tmp = -(sqrt((2.0 * (t_1 * (A + A)))) / t_0);
	elseif (B <= 8.2e+144)
		tmp = -sqrt((2.0 * (t_1 * ((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]}, Block[{t$95$1 = N[(t$95$0 * F), $MachinePrecision]}, If[LessEqual[B, 6.2e+43], (-N[(N[Sqrt[N[(2.0 * N[(t$95$1 * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), If[LessEqual[B, 8.2e+144], N[((-N[Sqrt[N[(2.0 * N[(t$95$1 * N[(N[(A + C), $MachinePrecision] - B), $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)\\
t_1 := t_0 \cdot F\\
\mathbf{if}\;B \leq 6.2 \cdot 10^{+43}:\\
\;\;\;\;-\frac{\sqrt{2 \cdot \left(t_1 \cdot \left(A + A\right)\right)}}{t_0}\\

\mathbf{elif}\;B \leq 8.2 \cdot 10^{+144}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_1 \cdot \left(\left(A + C\right) - B\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 < 6.2000000000000003e43

    1. Initial program 17.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. Simplified17.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)}} \]
    3. Taylor expanded in C around inf 13.0%

      \[\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 - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv13.0%

        \[\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(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval13.0%

        \[\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}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity13.0%

        \[\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}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified13.0%

      \[\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 + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if 6.2000000000000003e43 < B < 8.20000000000000002e144

    1. Initial program 48.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. Simplified48.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)}} \]
    3. Taylor expanded in B around inf 40.7%

      \[\leadsto \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) - \color{blue}{B}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if 8.20000000000000002e144 < B

    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. Simplified0.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)}} \]
    3. Taylor expanded in C around inf 0.0%

      \[\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 - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv0.0%

        \[\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(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval0.0%

        \[\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}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity0.0%

        \[\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}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified0.0%

      \[\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 + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in B around inf 2.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 6.2 \cdot 10^{+43}:\\ \;\;\;\;-\frac{\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;B \leq 8.2 \cdot 10^{+144}:\\ \;\;\;\;\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) - B\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 5: 29.6% accurate, 4.9× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} t_0 := B \cdot B + \left(A \cdot C\right) \cdot -4\\ \mathbf{if}\;B \leq 7.6 \cdot 10^{+134}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(A + A\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) (* (* A C) -4.0))))
   (if (<= B 7.6e+134)
     (/ (- (sqrt (* 2.0 (* t_0 (* F (+ A 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) + ((A * C) * -4.0);
	double tmp;
	if (B <= 7.6e+134) {
		tmp = -sqrt((2.0 * (t_0 * (F * (A + 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) + ((a * c) * (-4.0d0))
    if (b <= 7.6d+134) then
        tmp = -sqrt((2.0d0 * (t_0 * (f * (a + 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) + ((A * C) * -4.0);
	double tmp;
	if (B <= 7.6e+134) {
		tmp = -Math.sqrt((2.0 * (t_0 * (F * (A + 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) + ((A * C) * -4.0)
	tmp = 0
	if B <= 7.6e+134:
		tmp = -math.sqrt((2.0 * (t_0 * (F * (A + 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(Float64(A * C) * -4.0))
	tmp = 0.0
	if (B <= 7.6e+134)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(t_0 * Float64(F * Float64(A + 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) + ((A * C) * -4.0);
	tmp = 0.0;
	if (B <= 7.6e+134)
		tmp = -sqrt((2.0 * (t_0 * (F * (A + 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[(N[(A * C), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 7.6e+134], N[((-N[Sqrt[N[(2.0 * N[(t$95$0 * N[(F * N[(A + A), $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 + \left(A \cdot C\right) \cdot -4\\
\mathbf{if}\;B \leq 7.6 \cdot 10^{+134}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(t_0 \cdot \left(F \cdot \left(A + A\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 2 regimes
  2. if B < 7.59999999999999997e134

    1. Initial program 19.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. Simplified19.5%

      \[\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)}} \]
    3. Taylor expanded in C around inf 13.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(A - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv13.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(A + \left(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval13.2%

        \[\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}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity13.2%

        \[\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}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified13.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(A + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Step-by-step derivation
      1. distribute-frac-neg13.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(A + A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)}} \]
      2. associate-*l*13.3%

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

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

        \[\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 + A\right)\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      5. cancel-sign-sub-inv13.3%

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

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

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

    if 7.59999999999999997e134 < B

    1. Initial program 2.9%

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

      \[\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)}} \]
    3. Taylor expanded in C around inf 0.1%

      \[\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 - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv0.1%

        \[\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(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval0.1%

        \[\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}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity0.1%

        \[\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}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified0.1%

      \[\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 + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in B around inf 2.8%

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

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

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

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

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

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

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

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

Alternative 6: 29.4% 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 7.6 \cdot 10^{+134}:\\ \;\;\;\;-\frac{\sqrt{2 \cdot \left(\left(t_0 \cdot F\right) \cdot \left(A + 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 7.6e+134)
     (- (/ (sqrt (* 2.0 (* (* t_0 F) (+ A 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 <= 7.6e+134) {
		tmp = -(sqrt((2.0 * ((t_0 * F) * (A + 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 <= 7.6d+134) then
        tmp = -(sqrt((2.0d0 * ((t_0 * f) * (a + 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 <= 7.6e+134) {
		tmp = -(Math.sqrt((2.0 * ((t_0 * F) * (A + 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 <= 7.6e+134:
		tmp = -(math.sqrt((2.0 * ((t_0 * F) * (A + 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 <= 7.6e+134)
		tmp = Float64(-Float64(sqrt(Float64(2.0 * Float64(Float64(t_0 * F) * Float64(A + 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 <= 7.6e+134)
		tmp = -(sqrt((2.0 * ((t_0 * F) * (A + 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, 7.6e+134], (-N[(N[Sqrt[N[(2.0 * N[(N[(t$95$0 * F), $MachinePrecision] * N[(A + 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 7.6 \cdot 10^{+134}:\\
\;\;\;\;-\frac{\sqrt{2 \cdot \left(\left(t_0 \cdot F\right) \cdot \left(A + 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 < 7.59999999999999997e134

    1. Initial program 19.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. Simplified19.5%

      \[\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)}} \]
    3. Taylor expanded in C around inf 13.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(A - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv13.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(A + \left(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval13.2%

        \[\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}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity13.2%

        \[\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}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified13.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(A + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]

    if 7.59999999999999997e134 < B

    1. Initial program 2.9%

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

      \[\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)}} \]
    3. Taylor expanded in C around inf 0.1%

      \[\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 - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv0.1%

        \[\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(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval0.1%

        \[\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}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity0.1%

        \[\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}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified0.1%

      \[\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 + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in B around inf 2.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 7.6 \cdot 10^{+134}:\\ \;\;\;\;-\frac{\sqrt{2 \cdot \left(\left(\left(B \cdot B - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right) \cdot \left(A + 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: 23.1% accurate, 5.0× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 3.7 \cdot 10^{-10}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + 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 3.7e-10)
   (/
    (- (sqrt (* 2.0 (* (+ A 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 <= 3.7e-10) {
		tmp = -sqrt((2.0 * ((A + 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 <= 3.7d-10) then
        tmp = -sqrt((2.0d0 * ((a + 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 <= 3.7e-10) {
		tmp = -Math.sqrt((2.0 * ((A + 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 <= 3.7e-10:
		tmp = -math.sqrt((2.0 * ((A + 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 <= 3.7e-10)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(A + 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 <= 3.7e-10)
		tmp = -sqrt((2.0 * ((A + 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, 3.7e-10], N[((-N[Sqrt[N[(2.0 * N[(N[(A + 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 3.7 \cdot 10^{-10}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + 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 < 3.70000000000000015e-10

    1. Initial program 16.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. Simplified16.5%

      \[\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)}} \]
    3. Taylor expanded in C around inf 12.6%

      \[\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 - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv12.6%

        \[\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(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval12.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 + \color{blue}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity12.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 + \color{blue}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified12.6%

      \[\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 + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in B around 0 11.3%

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

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

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

    if 3.70000000000000015e-10 < B

    1. Initial program 19.7%

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

      \[\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)}} \]
    3. Taylor expanded in C around inf 7.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 - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv7.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(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval7.7%

        \[\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}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity7.7%

        \[\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}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified7.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 + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in B around inf 6.1%

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

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

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

        \[\leadsto -2 \cdot \frac{\sqrt{\color{blue}{F \cdot A}}}{B} \]
    8. Simplified6.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 3.7 \cdot 10^{-10}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + 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 8: 27.1% accurate, 5.0× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 4.5 \cdot 10^{+42}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot \left(-4 \cdot \left(\left(A \cdot C\right) \cdot F\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 4.5e+42)
   (/
    (- (sqrt (* 2.0 (* (+ A 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 <= 4.5e+42) {
		tmp = -sqrt((2.0 * ((A + 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 <= 4.5d+42) then
        tmp = -sqrt((2.0d0 * ((a + 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 <= 4.5e+42) {
		tmp = -Math.sqrt((2.0 * ((A + 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 <= 4.5e+42:
		tmp = -math.sqrt((2.0 * ((A + 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 <= 4.5e+42)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(Float64(A + A) * Float64(-4.0 * Float64(Float64(A * 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 <= 4.5e+42)
		tmp = -sqrt((2.0 * ((A + 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, 4.5e+42], N[((-N[Sqrt[N[(2.0 * N[(N[(A + A), $MachinePrecision] * N[(-4.0 * N[(N[(A * C), $MachinePrecision] * F), $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 4.5 \cdot 10^{+42}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot \left(-4 \cdot \left(\left(A \cdot C\right) \cdot F\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 < 4.50000000000000012e42

    1. Initial program 16.7%

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

      \[\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)}} \]
    3. Taylor expanded in C around inf 13.1%

      \[\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 - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv13.1%

        \[\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(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval13.1%

        \[\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}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity13.1%

        \[\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}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified13.1%

      \[\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 + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in B around 0 10.9%

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

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

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

    if 4.50000000000000012e42 < B

    1. Initial program 19.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. Simplified19.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)}} \]
    3. Taylor expanded in C around inf 4.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}{\left(A - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv4.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}{\left(A + \left(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval4.9%

        \[\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}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity4.9%

        \[\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}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified4.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}{\left(A + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in B around inf 6.7%

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

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

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

        \[\leadsto -2 \cdot \frac{\sqrt{\color{blue}{F \cdot A}}}{B} \]
    8. Simplified6.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 4.5 \cdot 10^{+42}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(\left(A + A\right) \cdot \left(-4 \cdot \left(\left(A \cdot C\right) \cdot F\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: 23.1% accurate, 5.1× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 8.2 \cdot 10^{-10}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(-8 \cdot \left(A \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 8.2e-10)
   (/
    (- (sqrt (* 2.0 (* -8.0 (* A (* 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 <= 8.2e-10) {
		tmp = -sqrt((2.0 * (-8.0 * (A * (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 <= 8.2d-10) then
        tmp = -sqrt((2.0d0 * ((-8.0d0) * (a * (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 <= 8.2e-10) {
		tmp = -Math.sqrt((2.0 * (-8.0 * (A * (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 <= 8.2e-10:
		tmp = -math.sqrt((2.0 * (-8.0 * (A * (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 <= 8.2e-10)
		tmp = Float64(Float64(-sqrt(Float64(2.0 * Float64(-8.0 * Float64(A * 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 <= 8.2e-10)
		tmp = -sqrt((2.0 * (-8.0 * (A * (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, 8.2e-10], N[((-N[Sqrt[N[(2.0 * N[(-8.0 * N[(A * 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 8.2 \cdot 10^{-10}:\\
\;\;\;\;\frac{-\sqrt{2 \cdot \left(-8 \cdot \left(A \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 < 8.1999999999999996e-10

    1. Initial program 16.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. Simplified16.5%

      \[\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)}} \]
    3. Taylor expanded in C around inf 12.6%

      \[\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 - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv12.6%

        \[\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(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval12.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 + \color{blue}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity12.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 + \color{blue}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified12.6%

      \[\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 + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Step-by-step derivation
      1. add-cbrt-cube5.0%

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

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

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

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

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

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

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

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

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

      \[\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)} \]
    9. Step-by-step derivation
      1. *-commutative7.8%

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

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

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

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

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

    if 8.1999999999999996e-10 < B

    1. Initial program 19.7%

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

      \[\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)}} \]
    3. Taylor expanded in C around inf 7.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 - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv7.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(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      2. metadata-eval7.7%

        \[\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}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
      3. *-lft-identity7.7%

        \[\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}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    5. Simplified7.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 + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    6. Taylor expanded in B around inf 6.1%

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

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

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

        \[\leadsto -2 \cdot \frac{\sqrt{\color{blue}{F \cdot A}}}{B} \]
    8. Simplified6.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 8.2 \cdot 10^{-10}:\\ \;\;\;\;\frac{-\sqrt{2 \cdot \left(-8 \cdot \left(A \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 10: 8.9% 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 17.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. Simplified17.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)}} \]
  3. Taylor expanded in C around inf 11.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 - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
  4. Step-by-step derivation
    1. cancel-sign-sub-inv11.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(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    2. metadata-eval11.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 + \color{blue}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    3. *-lft-identity11.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 + \color{blue}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
  5. Simplified11.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 + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
  6. Taylor expanded in B around inf 2.5%

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

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

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

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

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

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

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

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

Alternative 11: 8.9% 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 17.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. Simplified17.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)}} \]
  3. Taylor expanded in C around inf 11.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 - -1 \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
  4. Step-by-step derivation
    1. cancel-sign-sub-inv11.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(--1\right) \cdot A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    2. metadata-eval11.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 + \color{blue}{1} \cdot A\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
    3. *-lft-identity11.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 + \color{blue}{A}\right)\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
  5. Simplified11.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 + A\right)}\right)}}{B \cdot B - 4 \cdot \left(A \cdot C\right)} \]
  6. Taylor expanded in B around inf 2.5%

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

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

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

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

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

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

Reproduce

?
herbie shell --seed 2023285 
(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))))