ABCF->ab-angle a

Percentage Accurate: 19.2% → 58.5%
Time: 34.3s
Alternatives: 14
Speedup: 6.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 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.2% 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: 58.5% accurate, 1.2× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := 4 \cdot \left(A \cdot C\right)\\ t_1 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;B\_m \leq 4 \cdot 10^{-149}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0 - {B\_m}^{2}}\\ \mathbf{elif}\;B\_m \leq 2.1 \cdot 10^{+20}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot t\_1\right)} \cdot \sqrt{\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)}}{-t\_1}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(C, B\_m\right)} \cdot \sqrt{F}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* 4.0 (* A C))) (t_1 (fma B_m B_m (* A (* C -4.0)))))
   (if (<= B_m 4e-149)
     (/
      (sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_0) F)) (* 2.0 C)))
      (- t_0 (pow B_m 2.0)))
     (if (<= B_m 2.1e+20)
       (/
        (* (sqrt (* 2.0 (* F t_1))) (sqrt (+ (+ A C) (hypot B_m (- A C)))))
        (- t_1))
       (* (* (sqrt (+ C (hypot C B_m))) (sqrt F)) (/ (sqrt 2.0) (- B_m)))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = 4.0 * (A * C);
	double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
	double tmp;
	if (B_m <= 4e-149) {
		tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (2.0 * C))) / (t_0 - pow(B_m, 2.0));
	} else if (B_m <= 2.1e+20) {
		tmp = (sqrt((2.0 * (F * t_1))) * sqrt(((A + C) + hypot(B_m, (A - C))))) / -t_1;
	} else {
		tmp = (sqrt((C + hypot(C, B_m))) * sqrt(F)) * (sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = Float64(4.0 * Float64(A * C))
	t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if (B_m <= 4e-149)
		tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(2.0 * C))) / Float64(t_0 - (B_m ^ 2.0)));
	elseif (B_m <= 2.1e+20)
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(F * t_1))) * sqrt(Float64(Float64(A + C) + hypot(B_m, Float64(A - C))))) / Float64(-t_1));
	else
		tmp = Float64(Float64(sqrt(Float64(C + hypot(C, B_m))) * sqrt(F)) * Float64(sqrt(2.0) / Float64(-B_m)));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 4e-149], N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 2.1e+20], N[(N[(N[Sqrt[N[(2.0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(N[(A + C), $MachinePrecision] + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / (-t$95$1)), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := 4 \cdot \left(A \cdot C\right)\\
t_1 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;B\_m \leq 4 \cdot 10^{-149}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0 - {B\_m}^{2}}\\

\mathbf{elif}\;B\_m \leq 2.1 \cdot 10^{+20}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot t\_1\right)} \cdot \sqrt{\left(A + C\right) + \mathsf{hypot}\left(B\_m, A - C\right)}}{-t\_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 3.99999999999999992e-149

    1. Initial program 22.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. Simplified23.0%

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

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

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

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

    if 3.99999999999999992e-149 < B < 2.1e20

    1. Initial program 26.4%

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

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

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

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

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

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

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

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

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

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

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

    if 2.1e20 < B

    1. Initial program 5.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right)} \]
    7. Step-by-step derivation
      1. pow1/234.3%

        \[\leadsto \color{blue}{{\left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)}^{0.5}} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      2. *-commutative34.3%

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

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

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

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

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

        \[\leadsto \color{blue}{\left({\left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}^{0.5} \cdot {F}^{0.5}\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      8. pow1/211.4%

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

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

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

        \[\leadsto \left(\sqrt{C + \sqrt{C \cdot C + \color{blue}{B \cdot B}}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      12. hypot-undefine53.7%

        \[\leadsto \left(\sqrt{C + \color{blue}{\mathsf{hypot}\left(C, B\right)}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      13. pow1/253.7%

        \[\leadsto \left(\sqrt{C + \mathsf{hypot}\left(C, B\right)} \cdot \color{blue}{\sqrt{F}}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
    8. Applied egg-rr53.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 4 \cdot 10^{-149}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{4 \cdot \left(A \cdot C\right) - {B}^{2}}\\ \mathbf{elif}\;B \leq 2.1 \cdot 10^{+20}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)\right)} \cdot \sqrt{\left(A + C\right) + \mathsf{hypot}\left(B, A - C\right)}}{-\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(C, B\right)} \cdot \sqrt{F}\right) \cdot \frac{\sqrt{2}}{-B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 58.4% accurate, 0.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := 4 \cdot \left(A \cdot C\right)\\ t_1 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\ \mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{-299}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0 - {B\_m}^{2}}\\ \mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+36}:\\ \;\;\;\;\sqrt{F \cdot \left(2 \cdot t\_1\right)} \cdot \left(-\frac{\sqrt{A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)}}{t\_1}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(C, B\_m\right)} \cdot \sqrt{F}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* 4.0 (* A C))) (t_1 (fma B_m B_m (* A (* C -4.0)))))
   (if (<= (pow B_m 2.0) 5e-299)
     (/
      (sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_0) F)) (* 2.0 C)))
      (- t_0 (pow B_m 2.0)))
     (if (<= (pow B_m 2.0) 2e+36)
       (*
        (sqrt (* F (* 2.0 t_1)))
        (- (/ (sqrt (+ A (+ C (hypot B_m (- A C))))) t_1)))
       (* (* (sqrt (+ C (hypot C B_m))) (sqrt F)) (/ (sqrt 2.0) (- B_m)))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = 4.0 * (A * C);
	double t_1 = fma(B_m, B_m, (A * (C * -4.0)));
	double tmp;
	if (pow(B_m, 2.0) <= 5e-299) {
		tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (2.0 * C))) / (t_0 - pow(B_m, 2.0));
	} else if (pow(B_m, 2.0) <= 2e+36) {
		tmp = sqrt((F * (2.0 * t_1))) * -(sqrt((A + (C + hypot(B_m, (A - C))))) / t_1);
	} else {
		tmp = (sqrt((C + hypot(C, B_m))) * sqrt(F)) * (sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = Float64(4.0 * Float64(A * C))
	t_1 = fma(B_m, B_m, Float64(A * Float64(C * -4.0)))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 5e-299)
		tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(2.0 * C))) / Float64(t_0 - (B_m ^ 2.0)));
	elseif ((B_m ^ 2.0) <= 2e+36)
		tmp = Float64(sqrt(Float64(F * Float64(2.0 * t_1))) * Float64(-Float64(sqrt(Float64(A + Float64(C + hypot(B_m, Float64(A - C))))) / t_1)));
	else
		tmp = Float64(Float64(sqrt(Float64(C + hypot(C, B_m))) * sqrt(F)) * Float64(sqrt(2.0) / Float64(-B_m)));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(B$95$m * B$95$m + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-299], N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+36], N[(N[Sqrt[N[(F * N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[(N[Sqrt[N[(A + N[(C + N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision])), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := 4 \cdot \left(A \cdot C\right)\\
t_1 := \mathsf{fma}\left(B\_m, B\_m, A \cdot \left(C \cdot -4\right)\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 5 \cdot 10^{-299}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0 - {B\_m}^{2}}\\

\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+36}:\\
\;\;\;\;\sqrt{F \cdot \left(2 \cdot t\_1\right)} \cdot \left(-\frac{\sqrt{A + \left(C + \mathsf{hypot}\left(B\_m, A - C\right)\right)}}{t\_1}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (pow.f64 B #s(literal 2 binary64)) < 4.99999999999999956e-299

    1. Initial program 25.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. Simplified26.1%

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

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

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

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

    if 4.99999999999999956e-299 < (pow.f64 B #s(literal 2 binary64)) < 2.00000000000000008e36

    1. Initial program 30.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. Simplified38.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000008e36 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 10.8%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified10.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right)} \]
    7. Step-by-step derivation
      1. pow1/217.0%

        \[\leadsto \color{blue}{{\left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)}^{0.5}} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      2. *-commutative17.0%

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

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

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

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

        \[\leadsto {\left(\left(C + \sqrt{\color{blue}{{B}^{2} + {C}^{2}}}\right) \cdot F\right)}^{0.5} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      7. unpow-prod-down5.9%

        \[\leadsto \color{blue}{\left({\left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}^{0.5} \cdot {F}^{0.5}\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      8. pow1/25.9%

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

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

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

        \[\leadsto \left(\sqrt{C + \sqrt{C \cdot C + \color{blue}{B \cdot B}}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      12. hypot-undefine26.0%

        \[\leadsto \left(\sqrt{C + \color{blue}{\mathsf{hypot}\left(C, B\right)}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      13. pow1/226.0%

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

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

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

Alternative 3: 52.8% accurate, 1.2× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{-117}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0 - {B\_m}^{2}}\\ \mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+267}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \frac{-\sqrt{F}}{\sqrt{B\_m}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* 4.0 (* A C))))
   (if (<= (pow B_m 2.0) 2e-117)
     (/
      (sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_0) F)) (* 2.0 C)))
      (- t_0 (pow B_m 2.0)))
     (if (<= (pow B_m 2.0) 2e+267)
       (/ (sqrt (* 2.0 (* F (+ C (hypot C B_m))))) (- B_m))
       (* (sqrt 2.0) (/ (- (sqrt F)) (sqrt B_m)))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = 4.0 * (A * C);
	double tmp;
	if (pow(B_m, 2.0) <= 2e-117) {
		tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (2.0 * C))) / (t_0 - pow(B_m, 2.0));
	} else if (pow(B_m, 2.0) <= 2e+267) {
		tmp = sqrt((2.0 * (F * (C + hypot(C, B_m))))) / -B_m;
	} else {
		tmp = sqrt(2.0) * (-sqrt(F) / sqrt(B_m));
	}
	return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double t_0 = 4.0 * (A * C);
	double tmp;
	if (Math.pow(B_m, 2.0) <= 2e-117) {
		tmp = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * C))) / (t_0 - Math.pow(B_m, 2.0));
	} else if (Math.pow(B_m, 2.0) <= 2e+267) {
		tmp = Math.sqrt((2.0 * (F * (C + Math.hypot(C, B_m))))) / -B_m;
	} else {
		tmp = Math.sqrt(2.0) * (-Math.sqrt(F) / Math.sqrt(B_m));
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	t_0 = 4.0 * (A * C)
	tmp = 0
	if math.pow(B_m, 2.0) <= 2e-117:
		tmp = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * C))) / (t_0 - math.pow(B_m, 2.0))
	elif math.pow(B_m, 2.0) <= 2e+267:
		tmp = math.sqrt((2.0 * (F * (C + math.hypot(C, B_m))))) / -B_m
	else:
		tmp = math.sqrt(2.0) * (-math.sqrt(F) / math.sqrt(B_m))
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = Float64(4.0 * Float64(A * C))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 2e-117)
		tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(2.0 * C))) / Float64(t_0 - (B_m ^ 2.0)));
	elseif ((B_m ^ 2.0) <= 2e+267)
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C + hypot(C, B_m))))) / Float64(-B_m));
	else
		tmp = Float64(sqrt(2.0) * Float64(Float64(-sqrt(F)) / sqrt(B_m)));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	t_0 = 4.0 * (A * C);
	tmp = 0.0;
	if ((B_m ^ 2.0) <= 2e-117)
		tmp = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (2.0 * C))) / (t_0 - (B_m ^ 2.0));
	elseif ((B_m ^ 2.0) <= 2e+267)
		tmp = sqrt((2.0 * (F * (C + hypot(C, B_m))))) / -B_m;
	else
		tmp = sqrt(2.0) * (-sqrt(F) / sqrt(B_m));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e-117], N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 2e+267], N[(N[Sqrt[N[(2.0 * N[(F * N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[((-N[Sqrt[F], $MachinePrecision]) / N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 2 \cdot 10^{-117}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0 - {B\_m}^{2}}\\

\mathbf{elif}\;{B\_m}^{2} \leq 2 \cdot 10^{+267}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{-\sqrt{F}}{\sqrt{B\_m}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (pow.f64 B #s(literal 2 binary64)) < 2.00000000000000006e-117

    1. Initial program 24.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. Simplified24.9%

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

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

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

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

    if 2.00000000000000006e-117 < (pow.f64 B #s(literal 2 binary64)) < 1.9999999999999999e267

    1. Initial program 35.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. Simplified35.9%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(-\frac{{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{B}\right)}^{1}} \]
    9. Step-by-step derivation
      1. unpow115.5%

        \[\leadsto \color{blue}{-\frac{{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{B}} \]
      2. distribute-neg-frac215.5%

        \[\leadsto \color{blue}{\frac{{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{-B}} \]
      3. unpow1/215.4%

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

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

    if 1.9999999999999999e267 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 0.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. Simplified0.2%

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. distribute-rgt-neg-in17.9%

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

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

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

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

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

Alternative 4: 57.4% accurate, 1.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} t_0 := 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;B\_m \leq 7.2 \cdot 10^{-59}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0 - {B\_m}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{C + \mathsf{hypot}\left(C, B\_m\right)} \cdot \sqrt{F}\right) \cdot \frac{\sqrt{2}}{-B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* 4.0 (* A C))))
   (if (<= B_m 7.2e-59)
     (/
      (sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_0) F)) (* 2.0 C)))
      (- t_0 (pow B_m 2.0)))
     (* (* (sqrt (+ C (hypot C B_m))) (sqrt F)) (/ (sqrt 2.0) (- B_m))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double t_0 = 4.0 * (A * C);
	double tmp;
	if (B_m <= 7.2e-59) {
		tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (2.0 * C))) / (t_0 - pow(B_m, 2.0));
	} else {
		tmp = (sqrt((C + hypot(C, B_m))) * sqrt(F)) * (sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double t_0 = 4.0 * (A * C);
	double tmp;
	if (B_m <= 7.2e-59) {
		tmp = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * C))) / (t_0 - Math.pow(B_m, 2.0));
	} else {
		tmp = (Math.sqrt((C + Math.hypot(C, B_m))) * Math.sqrt(F)) * (Math.sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	t_0 = 4.0 * (A * C)
	tmp = 0
	if B_m <= 7.2e-59:
		tmp = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (2.0 * C))) / (t_0 - math.pow(B_m, 2.0))
	else:
		tmp = (math.sqrt((C + math.hypot(C, B_m))) * math.sqrt(F)) * (math.sqrt(2.0) / -B_m)
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = Float64(4.0 * Float64(A * C))
	tmp = 0.0
	if (B_m <= 7.2e-59)
		tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(2.0 * C))) / Float64(t_0 - (B_m ^ 2.0)));
	else
		tmp = Float64(Float64(sqrt(Float64(C + hypot(C, B_m))) * sqrt(F)) * Float64(sqrt(2.0) / Float64(-B_m)));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	t_0 = 4.0 * (A * C);
	tmp = 0.0;
	if (B_m <= 7.2e-59)
		tmp = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (2.0 * C))) / (t_0 - (B_m ^ 2.0));
	else
		tmp = (sqrt((C + hypot(C, B_m))) * sqrt(F)) * (sqrt(2.0) / -B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 7.2e-59], N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(2.0 * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[F], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
t_0 := 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;B\_m \leq 7.2 \cdot 10^{-59}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_0 - {B\_m}^{2}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 7.20000000000000001e-59

    1. Initial program 23.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. Simplified23.5%

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

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

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

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

    if 7.20000000000000001e-59 < B

    1. Initial program 8.1%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right)} \]
    7. Step-by-step derivation
      1. pow1/234.2%

        \[\leadsto \color{blue}{{\left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)}^{0.5}} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      2. *-commutative34.2%

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

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

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

        \[\leadsto {\left(\left(C + \sqrt{{C}^{2} + \color{blue}{{B}^{2}}}\right) \cdot F\right)}^{0.5} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      6. +-commutative14.5%

        \[\leadsto {\left(\left(C + \sqrt{\color{blue}{{B}^{2} + {C}^{2}}}\right) \cdot F\right)}^{0.5} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      7. unpow-prod-down14.5%

        \[\leadsto \color{blue}{\left({\left(C + \sqrt{{B}^{2} + {C}^{2}}\right)}^{0.5} \cdot {F}^{0.5}\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      8. pow1/214.5%

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

        \[\leadsto \left(\sqrt{C + \sqrt{\color{blue}{{C}^{2} + {B}^{2}}}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      10. unpow214.5%

        \[\leadsto \left(\sqrt{C + \sqrt{\color{blue}{C \cdot C} + {B}^{2}}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      11. unpow214.5%

        \[\leadsto \left(\sqrt{C + \sqrt{C \cdot C + \color{blue}{B \cdot B}}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      12. hypot-undefine50.8%

        \[\leadsto \left(\sqrt{C + \color{blue}{\mathsf{hypot}\left(C, B\right)}} \cdot {F}^{0.5}\right) \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
      13. pow1/250.8%

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

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

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

Alternative 5: 39.3% accurate, 2.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;F \leq 5.4 \cdot 10^{+18}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{F} \cdot {B\_m}^{-0.5}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F 5.4e+18)
   (/ (sqrt (* 2.0 (* F (+ C (hypot C B_m))))) (- B_m))
   (* (sqrt 2.0) (- (* (sqrt F) (pow B_m -0.5))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 5.4e+18) {
		tmp = sqrt((2.0 * (F * (C + hypot(C, B_m))))) / -B_m;
	} else {
		tmp = sqrt(2.0) * -(sqrt(F) * pow(B_m, -0.5));
	}
	return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 5.4e+18) {
		tmp = Math.sqrt((2.0 * (F * (C + Math.hypot(C, B_m))))) / -B_m;
	} else {
		tmp = Math.sqrt(2.0) * -(Math.sqrt(F) * Math.pow(B_m, -0.5));
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	tmp = 0
	if F <= 5.4e+18:
		tmp = math.sqrt((2.0 * (F * (C + math.hypot(C, B_m))))) / -B_m
	else:
		tmp = math.sqrt(2.0) * -(math.sqrt(F) * math.pow(B_m, -0.5))
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= 5.4e+18)
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C + hypot(C, B_m))))) / Float64(-B_m));
	else
		tmp = Float64(sqrt(2.0) * Float64(-Float64(sqrt(F) * (B_m ^ -0.5))));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (F <= 5.4e+18)
		tmp = sqrt((2.0 * (F * (C + hypot(C, B_m))))) / -B_m;
	else
		tmp = sqrt(2.0) * -(sqrt(F) * (B_m ^ -0.5));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 5.4e+18], N[(N[Sqrt[N[(2.0 * N[(F * N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[(N[Sqrt[F], $MachinePrecision] * N[Power[B$95$m, -0.5], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 5.4 \cdot 10^{+18}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-\sqrt{F} \cdot {B\_m}^{-0.5}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 5.4e18

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(-\frac{{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{B}\right)}^{1}} \]
    9. Step-by-step derivation
      1. unpow114.6%

        \[\leadsto \color{blue}{-\frac{{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{B}} \]
      2. distribute-neg-frac214.6%

        \[\leadsto \color{blue}{\frac{{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{-B}} \]
      3. unpow1/214.5%

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

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

    if 5.4e18 < F

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. distribute-rgt-neg-in16.4%

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

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

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

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

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

        \[\leadsto \left(\sqrt{F} \cdot \frac{1}{\color{blue}{{B}^{0.5}}}\right) \cdot \left(-\sqrt{2}\right) \]
      3. pow-flip16.7%

        \[\leadsto \left(\sqrt{F} \cdot \color{blue}{{B}^{\left(-0.5\right)}}\right) \cdot \left(-\sqrt{2}\right) \]
      4. metadata-eval16.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 5.4 \cdot 10^{+18}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)}}{-B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-\sqrt{F} \cdot {B}^{-0.5}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 39.2% accurate, 2.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;F \leq 64000000000000:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F} \cdot \frac{\sqrt{2}}{-\sqrt{B\_m}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F 64000000000000.0)
   (/ (sqrt (* 2.0 (* F (+ C (hypot C B_m))))) (- B_m))
   (* (sqrt F) (/ (sqrt 2.0) (- (sqrt B_m))))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 64000000000000.0) {
		tmp = sqrt((2.0 * (F * (C + hypot(C, B_m))))) / -B_m;
	} else {
		tmp = sqrt(F) * (sqrt(2.0) / -sqrt(B_m));
	}
	return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 64000000000000.0) {
		tmp = Math.sqrt((2.0 * (F * (C + Math.hypot(C, B_m))))) / -B_m;
	} else {
		tmp = Math.sqrt(F) * (Math.sqrt(2.0) / -Math.sqrt(B_m));
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	tmp = 0
	if F <= 64000000000000.0:
		tmp = math.sqrt((2.0 * (F * (C + math.hypot(C, B_m))))) / -B_m
	else:
		tmp = math.sqrt(F) * (math.sqrt(2.0) / -math.sqrt(B_m))
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= 64000000000000.0)
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C + hypot(C, B_m))))) / Float64(-B_m));
	else
		tmp = Float64(sqrt(F) * Float64(sqrt(2.0) / Float64(-sqrt(B_m))));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (F <= 64000000000000.0)
		tmp = sqrt((2.0 * (F * (C + hypot(C, B_m))))) / -B_m;
	else
		tmp = sqrt(F) * (sqrt(2.0) / -sqrt(B_m));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 64000000000000.0], N[(N[Sqrt[N[(2.0 * N[(F * N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[F], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-N[Sqrt[B$95$m], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 64000000000000:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{F} \cdot \frac{\sqrt{2}}{-\sqrt{B\_m}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 6.4e13

    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.8%

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{F \cdot \left(C + \color{blue}{\mathsf{hypot}\left(C, B\right)}\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
    6. Simplified14.5%

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

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

      \[\leadsto \color{blue}{{\left(-\frac{{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{B}\right)}^{1}} \]
    9. Step-by-step derivation
      1. unpow114.7%

        \[\leadsto \color{blue}{-\frac{{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{B}} \]
      2. distribute-neg-frac214.7%

        \[\leadsto \color{blue}{\frac{{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{-B}} \]
      3. unpow1/214.6%

        \[\leadsto \frac{\color{blue}{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)}}}{-B} \]
    10. Simplified14.6%

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

    if 6.4e13 < F

    1. Initial program 18.8%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified18.9%

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. distribute-rgt-neg-in16.3%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\sqrt{F} \cdot \left(-\sqrt{2}\right)}{\sqrt{B}}} \]
    10. Applied egg-rr16.5%

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

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

      \[\leadsto \color{blue}{\sqrt{F} \cdot \frac{-\sqrt{2}}{\sqrt{B}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification15.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 64000000000000:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)}}{-B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F} \cdot \frac{\sqrt{2}}{-\sqrt{B}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 39.3% accurate, 2.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;F \leq 1.06 \cdot 10^{+15}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \frac{-\sqrt{F}}{\sqrt{B\_m}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F 1.06e+15)
   (/ (sqrt (* 2.0 (* F (+ C (hypot C B_m))))) (- B_m))
   (* (sqrt 2.0) (/ (- (sqrt F)) (sqrt B_m)))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 1.06e+15) {
		tmp = sqrt((2.0 * (F * (C + hypot(C, B_m))))) / -B_m;
	} else {
		tmp = sqrt(2.0) * (-sqrt(F) / sqrt(B_m));
	}
	return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 1.06e+15) {
		tmp = Math.sqrt((2.0 * (F * (C + Math.hypot(C, B_m))))) / -B_m;
	} else {
		tmp = Math.sqrt(2.0) * (-Math.sqrt(F) / Math.sqrt(B_m));
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	tmp = 0
	if F <= 1.06e+15:
		tmp = math.sqrt((2.0 * (F * (C + math.hypot(C, B_m))))) / -B_m
	else:
		tmp = math.sqrt(2.0) * (-math.sqrt(F) / math.sqrt(B_m))
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= 1.06e+15)
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C + hypot(C, B_m))))) / Float64(-B_m));
	else
		tmp = Float64(sqrt(2.0) * Float64(Float64(-sqrt(F)) / sqrt(B_m)));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (F <= 1.06e+15)
		tmp = sqrt((2.0 * (F * (C + hypot(C, B_m))))) / -B_m;
	else
		tmp = sqrt(2.0) * (-sqrt(F) / sqrt(B_m));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 1.06e+15], N[(N[Sqrt[N[(2.0 * N[(F * N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * N[((-N[Sqrt[F], $MachinePrecision]) / N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.06 \cdot 10^{+15}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \frac{-\sqrt{F}}{\sqrt{B\_m}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 1.06e15

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(-\frac{{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{B}\right)}^{1}} \]
    9. Step-by-step derivation
      1. unpow114.6%

        \[\leadsto \color{blue}{-\frac{{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{B}} \]
      2. distribute-neg-frac214.6%

        \[\leadsto \color{blue}{\frac{{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{-B}} \]
      3. unpow1/214.5%

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

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

    if 1.06e15 < F

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. distribute-rgt-neg-in16.4%

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

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

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

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

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

Alternative 8: 39.3% accurate, 2.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;F \leq 5.5 \cdot 10^{+17}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{F} \cdot \sqrt{2}}{\sqrt{B\_m}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F 5.5e+17)
   (/ (sqrt (* 2.0 (* F (+ C (hypot C B_m))))) (- B_m))
   (/ (- (* (sqrt F) (sqrt 2.0))) (sqrt B_m))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 5.5e+17) {
		tmp = sqrt((2.0 * (F * (C + hypot(C, B_m))))) / -B_m;
	} else {
		tmp = -(sqrt(F) * sqrt(2.0)) / sqrt(B_m);
	}
	return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 5.5e+17) {
		tmp = Math.sqrt((2.0 * (F * (C + Math.hypot(C, B_m))))) / -B_m;
	} else {
		tmp = -(Math.sqrt(F) * Math.sqrt(2.0)) / Math.sqrt(B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	tmp = 0
	if F <= 5.5e+17:
		tmp = math.sqrt((2.0 * (F * (C + math.hypot(C, B_m))))) / -B_m
	else:
		tmp = -(math.sqrt(F) * math.sqrt(2.0)) / math.sqrt(B_m)
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= 5.5e+17)
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C + hypot(C, B_m))))) / Float64(-B_m));
	else
		tmp = Float64(Float64(-Float64(sqrt(F) * sqrt(2.0))) / sqrt(B_m));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (F <= 5.5e+17)
		tmp = sqrt((2.0 * (F * (C + hypot(C, B_m))))) / -B_m;
	else
		tmp = -(sqrt(F) * sqrt(2.0)) / sqrt(B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 5.5e+17], N[(N[Sqrt[N[(2.0 * N[(F * N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], N[((-N[(N[Sqrt[F], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]) / N[Sqrt[B$95$m], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 5.5 \cdot 10^{+17}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\

\mathbf{else}:\\
\;\;\;\;\frac{-\sqrt{F} \cdot \sqrt{2}}{\sqrt{B\_m}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 5.5e17

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(-\frac{{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{B}\right)}^{1}} \]
    9. Step-by-step derivation
      1. unpow114.6%

        \[\leadsto \color{blue}{-\frac{{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{B}} \]
      2. distribute-neg-frac214.6%

        \[\leadsto \color{blue}{\frac{{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{-B}} \]
      3. unpow1/214.5%

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

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

    if 5.5e17 < F

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

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. distribute-rgt-neg-in16.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 5.5 \cdot 10^{+17}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)}}{-B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{F} \cdot \sqrt{2}}{\sqrt{B}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 38.7% accurate, 2.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;F \leq 2500000000000:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\ \mathbf{else}:\\ \;\;\;\;-{\left(2 \cdot \frac{F}{B\_m}\right)}^{0.5}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F 2500000000000.0)
   (/ (sqrt (* 2.0 (* F (+ C (hypot C B_m))))) (- B_m))
   (- (pow (* 2.0 (/ F B_m)) 0.5))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 2500000000000.0) {
		tmp = sqrt((2.0 * (F * (C + hypot(C, B_m))))) / -B_m;
	} else {
		tmp = -pow((2.0 * (F / B_m)), 0.5);
	}
	return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 2500000000000.0) {
		tmp = Math.sqrt((2.0 * (F * (C + Math.hypot(C, B_m))))) / -B_m;
	} else {
		tmp = -Math.pow((2.0 * (F / B_m)), 0.5);
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	tmp = 0
	if F <= 2500000000000.0:
		tmp = math.sqrt((2.0 * (F * (C + math.hypot(C, B_m))))) / -B_m
	else:
		tmp = -math.pow((2.0 * (F / B_m)), 0.5)
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= 2500000000000.0)
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C + hypot(C, B_m))))) / Float64(-B_m));
	else
		tmp = Float64(-(Float64(2.0 * Float64(F / B_m)) ^ 0.5));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (F <= 2500000000000.0)
		tmp = sqrt((2.0 * (F * (C + hypot(C, B_m))))) / -B_m;
	else
		tmp = -((2.0 * (F / B_m)) ^ 0.5);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 2500000000000.0], N[(N[Sqrt[N[(2.0 * N[(F * N[(C + N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B$95$m)), $MachinePrecision], (-N[Power[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision])]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2500000000000:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\_m\right)\right)\right)}}{-B\_m}\\

\mathbf{else}:\\
\;\;\;\;-{\left(2 \cdot \frac{F}{B\_m}\right)}^{0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 2.5e12

    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.8%

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{F \cdot \left(C + \color{blue}{\mathsf{hypot}\left(C, B\right)}\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
    6. Simplified14.5%

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

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

      \[\leadsto \color{blue}{{\left(-\frac{{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{B}\right)}^{1}} \]
    9. Step-by-step derivation
      1. unpow114.7%

        \[\leadsto \color{blue}{-\frac{{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{B}} \]
      2. distribute-neg-frac214.7%

        \[\leadsto \color{blue}{\frac{{\left(2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)\right)}^{0.5}}{-B}} \]
      3. unpow1/214.6%

        \[\leadsto \frac{\color{blue}{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)}}}{-B} \]
    10. Simplified14.6%

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

    if 2.5e12 < F

    1. Initial program 18.8%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified18.9%

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. distribute-rgt-neg-in16.3%

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

      \[\leadsto \color{blue}{\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt-neg-out16.3%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. pow1/216.6%

        \[\leadsto -\color{blue}{{\left(\frac{F}{B}\right)}^{0.5}} \cdot \sqrt{2} \]
      3. pow1/216.6%

        \[\leadsto -{\left(\frac{F}{B}\right)}^{0.5} \cdot \color{blue}{{2}^{0.5}} \]
      4. pow-prod-down16.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 2500000000000:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)\right)}}{-B}\\ \mathbf{else}:\\ \;\;\;\;-{\left(2 \cdot \frac{F}{B}\right)}^{0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 34.9% accurate, 2.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;F \leq 60000000000:\\ \;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(-\sqrt{F \cdot \left(B\_m + C\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-{\left(2 \cdot \frac{F}{B\_m}\right)}^{0.5}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F 60000000000.0)
   (* (/ (sqrt 2.0) B_m) (- (sqrt (* F (+ B_m C)))))
   (- (pow (* 2.0 (/ F B_m)) 0.5))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 60000000000.0) {
		tmp = (sqrt(2.0) / B_m) * -sqrt((F * (B_m + C)));
	} else {
		tmp = -pow((2.0 * (F / B_m)), 0.5);
	}
	return tmp;
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (f <= 60000000000.0d0) then
        tmp = (sqrt(2.0d0) / b_m) * -sqrt((f * (b_m + c)))
    else
        tmp = -((2.0d0 * (f / b_m)) ** 0.5d0)
    end if
    code = tmp
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= 60000000000.0) {
		tmp = (Math.sqrt(2.0) / B_m) * -Math.sqrt((F * (B_m + C)));
	} else {
		tmp = -Math.pow((2.0 * (F / B_m)), 0.5);
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	tmp = 0
	if F <= 60000000000.0:
		tmp = (math.sqrt(2.0) / B_m) * -math.sqrt((F * (B_m + C)))
	else:
		tmp = -math.pow((2.0 * (F / B_m)), 0.5)
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= 60000000000.0)
		tmp = Float64(Float64(sqrt(2.0) / B_m) * Float64(-sqrt(Float64(F * Float64(B_m + C)))));
	else
		tmp = Float64(-(Float64(2.0 * Float64(F / B_m)) ^ 0.5));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (F <= 60000000000.0)
		tmp = (sqrt(2.0) / B_m) * -sqrt((F * (B_m + C)));
	else
		tmp = -((2.0 * (F / B_m)) ^ 0.5);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, 60000000000.0], N[(N[(N[Sqrt[2.0], $MachinePrecision] / B$95$m), $MachinePrecision] * (-N[Sqrt[N[(F * N[(B$95$m + C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])), $MachinePrecision], (-N[Power[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision])]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 60000000000:\\
\;\;\;\;\frac{\sqrt{2}}{B\_m} \cdot \left(-\sqrt{F \cdot \left(B\_m + C\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;-{\left(2 \cdot \frac{F}{B\_m}\right)}^{0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 6e10

    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.8%

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{F \cdot \left(C + \color{blue}{\mathsf{hypot}\left(C, B\right)}\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
    6. Simplified14.5%

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

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

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

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

    if 6e10 < F

    1. Initial program 18.8%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Simplified18.9%

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. distribute-rgt-neg-in16.3%

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

      \[\leadsto \color{blue}{\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt-neg-out16.3%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. pow1/216.6%

        \[\leadsto -\color{blue}{{\left(\frac{F}{B}\right)}^{0.5}} \cdot \sqrt{2} \]
      3. pow1/216.6%

        \[\leadsto -{\left(\frac{F}{B}\right)}^{0.5} \cdot \color{blue}{{2}^{0.5}} \]
      4. pow-prod-down16.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 60000000000:\\ \;\;\;\;\frac{\sqrt{2}}{B} \cdot \left(-\sqrt{F \cdot \left(B + C\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;-{\left(2 \cdot \frac{F}{B}\right)}^{0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 34.6% accurate, 3.0× speedup?

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

\mathbf{else}:\\
\;\;\;\;-{\left(2 \cdot \frac{F}{B\_m}\right)}^{0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 2.29999999999999986e-28

    1. Initial program 19.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.29999999999999986e-28 < F

    1. Initial program 18.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. Simplified18.7%

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. distribute-rgt-neg-in15.9%

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

      \[\leadsto \color{blue}{\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt-neg-out15.9%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. pow1/216.2%

        \[\leadsto -\color{blue}{{\left(\frac{F}{B}\right)}^{0.5}} \cdot \sqrt{2} \]
      3. pow1/216.2%

        \[\leadsto -{\left(\frac{F}{B}\right)}^{0.5} \cdot \color{blue}{{2}^{0.5}} \]
      4. pow-prod-down16.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 2.3 \cdot 10^{-28}:\\ \;\;\;\;-\frac{\sqrt{2}}{B} \cdot \sqrt{B \cdot F}\\ \mathbf{else}:\\ \;\;\;\;-{\left(2 \cdot \frac{F}{B}\right)}^{0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 28.1% accurate, 5.7× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{-2 \cdot \sqrt{C \cdot F}}{B\_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < 3.99999999999999963e215

    1. Initial program 21.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. Simplified21.2%

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

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

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. distribute-rgt-neg-in11.6%

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

      \[\leadsto \color{blue}{\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)} \]
    7. Step-by-step derivation
      1. distribute-rgt-neg-out11.6%

        \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      2. pow1/211.7%

        \[\leadsto -\color{blue}{{\left(\frac{F}{B}\right)}^{0.5}} \cdot \sqrt{2} \]
      3. pow1/211.7%

        \[\leadsto -{\left(\frac{F}{B}\right)}^{0.5} \cdot \color{blue}{{2}^{0.5}} \]
      4. pow-prod-down11.7%

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

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

    if 3.99999999999999963e215 < C

    1. Initial program 1.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{F \cdot \left(C + \color{blue}{\mathsf{hypot}\left(C, B\right)}\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
    6. Simplified9.7%

      \[\leadsto \color{blue}{\sqrt{F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)} \cdot \left(-\frac{\sqrt{2}}{B}\right)} \]
    7. Step-by-step derivation
      1. div-inv9.7%

        \[\leadsto \sqrt{F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)} \cdot \left(-\color{blue}{\sqrt{2} \cdot \frac{1}{B}}\right) \]
    8. Applied egg-rr9.7%

      \[\leadsto \sqrt{F \cdot \left(C + \mathsf{hypot}\left(C, B\right)\right)} \cdot \left(-\color{blue}{\sqrt{2} \cdot \frac{1}{B}}\right) \]
    9. Taylor expanded in C around inf 9.6%

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{{\left(\sqrt{2}\right)}^{2}}{B} \cdot \sqrt{C \cdot F}\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg9.6%

        \[\leadsto \color{blue}{-\frac{{\left(\sqrt{2}\right)}^{2}}{B} \cdot \sqrt{C \cdot F}} \]
      2. associate-*l/9.6%

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

        \[\leadsto -\frac{\color{blue}{\sqrt{C \cdot F} \cdot {\left(\sqrt{2}\right)}^{2}}}{B} \]
      4. distribute-neg-frac9.6%

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

        \[\leadsto \frac{-\color{blue}{{\left(\sqrt{2}\right)}^{2} \cdot \sqrt{C \cdot F}}}{B} \]
      6. unpow29.6%

        \[\leadsto \frac{-\color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)} \cdot \sqrt{C \cdot F}}{B} \]
      7. rem-square-sqrt9.7%

        \[\leadsto \frac{-\color{blue}{2} \cdot \sqrt{C \cdot F}}{B} \]
      8. distribute-lft-neg-in9.7%

        \[\leadsto \frac{\color{blue}{\left(-2\right) \cdot \sqrt{C \cdot F}}}{B} \]
      9. metadata-eval9.7%

        \[\leadsto \frac{\color{blue}{-2} \cdot \sqrt{C \cdot F}}{B} \]
      10. *-commutative9.7%

        \[\leadsto \frac{-2 \cdot \sqrt{\color{blue}{F \cdot C}}}{B} \]
    11. Simplified9.7%

      \[\leadsto \color{blue}{\frac{-2 \cdot \sqrt{F \cdot C}}{B}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification11.5%

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

Alternative 13: 27.0% accurate, 5.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ -{\left(2 \cdot \frac{F}{B\_m}\right)}^{0.5} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F) :precision binary64 (- (pow (* 2.0 (/ F B_m)) 0.5)))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	return -pow((2.0 * (F / B_m)), 0.5);
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = -((2.0d0 * (f / b_m)) ** 0.5d0)
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	return -Math.pow((2.0 * (F / B_m)), 0.5);
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	return -math.pow((2.0 * (F / B_m)), 0.5)
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	return Float64(-(Float64(2.0 * Float64(F / B_m)) ^ 0.5))
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp = code(A, B_m, C, F)
	tmp = -((2.0 * (F / B_m)) ^ 0.5);
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := (-N[Power[N[(2.0 * N[(F / B$95$m), $MachinePrecision]), $MachinePrecision], 0.5], $MachinePrecision])
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
-{\left(2 \cdot \frac{F}{B\_m}\right)}^{0.5}
\end{array}
Derivation
  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.4%

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

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

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    2. distribute-rgt-neg-in10.8%

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

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

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    2. pow1/210.9%

      \[\leadsto -\color{blue}{{\left(\frac{F}{B}\right)}^{0.5}} \cdot \sqrt{2} \]
    3. pow1/210.9%

      \[\leadsto -{\left(\frac{F}{B}\right)}^{0.5} \cdot \color{blue}{{2}^{0.5}} \]
    4. pow-prod-down10.9%

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

    \[\leadsto \color{blue}{-{\left(\frac{F}{B} \cdot 2\right)}^{0.5}} \]
  9. Final simplification10.9%

    \[\leadsto -{\left(2 \cdot \frac{F}{B}\right)}^{0.5} \]
  10. Add Preprocessing

Alternative 14: 27.0% accurate, 6.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ -\sqrt{\frac{2 \cdot F}{B\_m}} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F) :precision binary64 (- (sqrt (/ (* 2.0 F) B_m))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	return -sqrt(((2.0 * F) / B_m));
}
B_m = abs(b)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    code = -sqrt(((2.0d0 * f) / b_m))
end function
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	return -Math.sqrt(((2.0 * F) / B_m));
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	return -math.sqrt(((2.0 * F) / B_m))
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	return Float64(-sqrt(Float64(Float64(2.0 * F) / B_m)))
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp = code(A, B_m, C, F)
	tmp = -sqrt(((2.0 * F) / B_m));
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := (-N[Sqrt[N[(N[(2.0 * F), $MachinePrecision] / B$95$m), $MachinePrecision]], $MachinePrecision])
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
-\sqrt{\frac{2 \cdot F}{B\_m}}
\end{array}
Derivation
  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.4%

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

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

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    2. distribute-rgt-neg-in10.8%

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

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

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{F}{B}} \cdot \left(-\sqrt{2}\right)\right)}^{1}} \]
    2. distribute-rgt-neg-out10.8%

      \[\leadsto {\color{blue}{\left(-\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)}}^{1} \]
    3. pow1/210.9%

      \[\leadsto {\left(-\color{blue}{{\left(\frac{F}{B}\right)}^{0.5}} \cdot \sqrt{2}\right)}^{1} \]
    4. pow1/210.9%

      \[\leadsto {\left(-{\left(\frac{F}{B}\right)}^{0.5} \cdot \color{blue}{{2}^{0.5}}\right)}^{1} \]
    5. pow-prod-down10.9%

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

    \[\leadsto \color{blue}{{\left(-{\left(\frac{F}{B} \cdot 2\right)}^{0.5}\right)}^{1}} \]
  9. Step-by-step derivation
    1. unpow110.9%

      \[\leadsto \color{blue}{-{\left(\frac{F}{B} \cdot 2\right)}^{0.5}} \]
    2. unpow1/210.8%

      \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
    3. associate-*l/10.8%

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

    \[\leadsto \color{blue}{-\sqrt{\frac{F \cdot 2}{B}}} \]
  11. Final simplification10.8%

    \[\leadsto -\sqrt{\frac{2 \cdot F}{B}} \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2024085 
(FPCore (A B C F)
  :name "ABCF->ab-angle a"
  :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))))