ABCF->ab-angle b

Percentage Accurate: 18.7% → 55.3%
Time: 21.5s
Alternatives: 18
Speedup: 4.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 18 alternatives:

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

Initial Program: 18.7% 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: 55.3% accurate, 0.4× 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 := \left(4 \cdot A\right) \cdot C\\ t_1 := 2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\\ t_2 := t\_0 - {B\_m}^{2}\\ t_3 := \frac{\sqrt{t\_1 \cdot \left(\left(A + C\right) - \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_2}\\ \mathbf{if}\;t\_3 \leq -5 \cdot 10^{-203}:\\ \;\;\;\;\frac{\sqrt{B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)} \cdot \sqrt{2 \cdot \left(F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)}}{t\_2}\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;\frac{\sqrt{t\_1 \cdot \left(A + \left(A + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{C}\right)\right)}}{t\_2}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{B\_m} \cdot \sqrt{0 - F}\right) \cdot \frac{{\left({2}^{0.25}\right)}^{2}}{0 - 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 (* 2.0 (* (- (pow B_m 2.0) t_0) F)))
        (t_2 (- t_0 (pow B_m 2.0)))
        (t_3
         (/
          (sqrt (* t_1 (- (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))))))
          t_2)))
   (if (<= t_3 -5e-203)
     (/
      (*
       (sqrt (+ (* B_m B_m) (* A (* C -4.0))))
       (sqrt (* 2.0 (* F (- (+ A C) (hypot B_m (- A C)))))))
      t_2)
     (if (<= t_3 INFINITY)
       (/ (sqrt (* t_1 (+ A (+ A (/ (* (* B_m B_m) -0.5) C))))) t_2)
       (*
        (* (sqrt B_m) (sqrt (- 0.0 F)))
        (/ (pow (pow 2.0 0.25) 2.0) (- 0.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 = 2.0 * ((pow(B_m, 2.0) - t_0) * F);
	double t_2 = t_0 - pow(B_m, 2.0);
	double t_3 = sqrt((t_1 * ((A + C) - sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / t_2;
	double tmp;
	if (t_3 <= -5e-203) {
		tmp = (sqrt(((B_m * B_m) + (A * (C * -4.0)))) * sqrt((2.0 * (F * ((A + C) - hypot(B_m, (A - C))))))) / t_2;
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = sqrt((t_1 * (A + (A + (((B_m * B_m) * -0.5) / C))))) / t_2;
	} else {
		tmp = (sqrt(B_m) * sqrt((0.0 - F))) * (pow(pow(2.0, 0.25), 2.0) / (0.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 t_1 = 2.0 * ((Math.pow(B_m, 2.0) - t_0) * F);
	double t_2 = t_0 - Math.pow(B_m, 2.0);
	double t_3 = Math.sqrt((t_1 * ((A + C) - Math.sqrt((Math.pow(B_m, 2.0) + Math.pow((A - C), 2.0)))))) / t_2;
	double tmp;
	if (t_3 <= -5e-203) {
		tmp = (Math.sqrt(((B_m * B_m) + (A * (C * -4.0)))) * Math.sqrt((2.0 * (F * ((A + C) - Math.hypot(B_m, (A - C))))))) / t_2;
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt((t_1 * (A + (A + (((B_m * B_m) * -0.5) / C))))) / t_2;
	} else {
		tmp = (Math.sqrt(B_m) * Math.sqrt((0.0 - F))) * (Math.pow(Math.pow(2.0, 0.25), 2.0) / (0.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
	t_1 = 2.0 * ((math.pow(B_m, 2.0) - t_0) * F)
	t_2 = t_0 - math.pow(B_m, 2.0)
	t_3 = math.sqrt((t_1 * ((A + C) - math.sqrt((math.pow(B_m, 2.0) + math.pow((A - C), 2.0)))))) / t_2
	tmp = 0
	if t_3 <= -5e-203:
		tmp = (math.sqrt(((B_m * B_m) + (A * (C * -4.0)))) * math.sqrt((2.0 * (F * ((A + C) - math.hypot(B_m, (A - C))))))) / t_2
	elif t_3 <= math.inf:
		tmp = math.sqrt((t_1 * (A + (A + (((B_m * B_m) * -0.5) / C))))) / t_2
	else:
		tmp = (math.sqrt(B_m) * math.sqrt((0.0 - F))) * (math.pow(math.pow(2.0, 0.25), 2.0) / (0.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(Float64(4.0 * A) * C)
	t_1 = Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F))
	t_2 = Float64(t_0 - (B_m ^ 2.0))
	t_3 = Float64(sqrt(Float64(t_1 * Float64(Float64(A + C) - sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / t_2)
	tmp = 0.0
	if (t_3 <= -5e-203)
		tmp = Float64(Float64(sqrt(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0)))) * sqrt(Float64(2.0 * Float64(F * Float64(Float64(A + C) - hypot(B_m, Float64(A - C))))))) / t_2);
	elseif (t_3 <= Inf)
		tmp = Float64(sqrt(Float64(t_1 * Float64(A + Float64(A + Float64(Float64(Float64(B_m * B_m) * -0.5) / C))))) / t_2);
	else
		tmp = Float64(Float64(sqrt(B_m) * sqrt(Float64(0.0 - F))) * Float64(((2.0 ^ 0.25) ^ 2.0) / Float64(0.0 - 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;
	t_1 = 2.0 * (((B_m ^ 2.0) - t_0) * F);
	t_2 = t_0 - (B_m ^ 2.0);
	t_3 = sqrt((t_1 * ((A + C) - sqrt(((B_m ^ 2.0) + ((A - C) ^ 2.0)))))) / t_2;
	tmp = 0.0;
	if (t_3 <= -5e-203)
		tmp = (sqrt(((B_m * B_m) + (A * (C * -4.0)))) * sqrt((2.0 * (F * ((A + C) - hypot(B_m, (A - C))))))) / t_2;
	elseif (t_3 <= Inf)
		tmp = sqrt((t_1 * (A + (A + (((B_m * B_m) * -0.5) / C))))) / t_2;
	else
		tmp = (sqrt(B_m) * sqrt((0.0 - F))) * (((2.0 ^ 0.25) ^ 2.0) / (0.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[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(t$95$1 * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-203], N[(N[(N[Sqrt[N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(2.0 * N[(F * N[(N[(A + C), $MachinePrecision] - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[Sqrt[N[(t$95$1 * N[(A + N[(A + N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision], N[(N[(N[Sqrt[B$95$m], $MachinePrecision] * N[Sqrt[N[(0.0 - F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Power[2.0, 0.25], $MachinePrecision], 2.0], $MachinePrecision] / N[(0.0 - 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 := \left(4 \cdot A\right) \cdot C\\
t_1 := 2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\\
t_2 := t\_0 - {B\_m}^{2}\\
t_3 := \frac{\sqrt{t\_1 \cdot \left(\left(A + C\right) - \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_2}\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{-203}:\\
\;\;\;\;\frac{\sqrt{B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)} \cdot \sqrt{2 \cdot \left(F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)}}{t\_2}\\

\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\frac{\sqrt{t\_1 \cdot \left(A + \left(A + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{C}\right)\right)}}{t\_2}\\

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


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

    1. Initial program 49.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. Add Preprocessing
    3. Taylor expanded in F around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\color{blue}{\left(\sqrt{F \cdot \left(\left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)} \cdot \sqrt{2}\right)}\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{2} \cdot \sqrt{F \cdot \left(\left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\color{blue}{B}, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{2}\right), \left(\sqrt{F \cdot \left(\left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\color{blue}{B}, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\sqrt{F \cdot \left(\left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(\left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(\left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right) \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{*.f64}\left(\left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right), \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    5. Simplified44.3%

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

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

    if -5.0000000000000002e-203 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < +inf.0

    1. Initial program 14.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. Add Preprocessing
    3. Taylor expanded in C around inf

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \color{blue}{\left(\left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right) - -1 \cdot A\right)}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + \left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + 1 \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      8. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \left(\frac{\frac{-1}{2} \cdot {B}^{2}}{C}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot {B}^{2}\right), C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left({B}^{2}\right)\right), C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(B \cdot B\right)\right), C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      12. *-lowering-*.f6429.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(B, B\right)\right), C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    5. Simplified29.9%

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

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

    1. Initial program 0.0%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
      4. mul-1-negN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \left(-1 \cdot \color{blue}{\frac{\sqrt{2}}{B}}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(\color{blue}{-1} \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{B}^{2} + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      12. accelerator-lowering-hypot.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\frac{\sqrt{2}}{B}\right)}\right)\right) \]
    5. Simplified11.5%

      \[\leadsto \color{blue}{\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)} \cdot \left(-1 \cdot \frac{\sqrt{2}}{B}\right)} \]
    6. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left({2}^{\frac{1}{2}}\right), B\right)\right)\right) \]
      2. sqr-powN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left({2}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot {2}^{\left(\frac{\frac{1}{2}}{2}\right)}\right), B\right)\right)\right) \]
      3. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left({\left({2}^{\left(\frac{\frac{1}{2}}{2}\right)}\right)}^{2}\right), B\right)\right)\right) \]
      4. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left({2}^{\left(\frac{\frac{1}{2}}{2}\right)}\right), 2\right), B\right)\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \left(\frac{\frac{1}{2}}{2}\right)\right), 2\right), B\right)\right)\right) \]
      6. metadata-eval11.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
    7. Applied egg-rr11.5%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-1 \cdot \left(B \cdot F\right)\right)}\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-1, \left(B \cdot F\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      2. *-lowering-*.f649.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{*.f64}\left(B, F\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
    10. Simplified9.7%

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \left(B \cdot F\right)}} \cdot \left(-1 \cdot \frac{{\left({2}^{0.25}\right)}^{2}}{B}\right) \]
    11. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\left(B \cdot F\right) \cdot -1}\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{B \cdot \left(F \cdot -1\right)}\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      3. sqrt-prodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{B} \cdot \sqrt{F \cdot -1}\right), \mathsf{*.f64}\left(\color{blue}{-1}, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      4. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left({B}^{\frac{1}{2}} \cdot \sqrt{F \cdot -1}\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({B}^{\left(\frac{1}{4} \cdot 2\right)} \cdot \sqrt{F \cdot -1}\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({B}^{\left(\frac{1}{4} \cdot 2\right)}\right), \left(\sqrt{F \cdot -1}\right)\right), \mathsf{*.f64}\left(\color{blue}{-1}, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({B}^{\frac{1}{2}}\right), \left(\sqrt{F \cdot -1}\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      8. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{B}\right), \left(\sqrt{F \cdot -1}\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \left(\sqrt{F \cdot -1}\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{sqrt.f64}\left(\left(F \cdot -1\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      11. *-lowering-*.f6418.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, -1\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
    12. Applied egg-rr18.3%

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

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

Alternative 2: 52.5% accurate, 1.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} t_0 := \left(4 \cdot A\right) \cdot C\\ t_1 := t\_0 - {B\_m}^{2}\\ \mathbf{if}\;{B\_m}^{2} \leq 10^{-181}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(A + \left(A + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{C}\right)\right)}}{t\_1}\\ \mathbf{elif}\;{B\_m}^{2} \leq 10^{+227}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\right)} \cdot \sqrt{F \cdot \left(C + \left(A - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)}}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{B\_m} \cdot \sqrt{0 - F}\right) \cdot \frac{{\left({2}^{0.25}\right)}^{2}}{0 - 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 (- t_0 (pow B_m 2.0))))
   (if (<= (pow B_m 2.0) 1e-181)
     (/
      (sqrt
       (*
        (* 2.0 (* (- (pow B_m 2.0) t_0) F))
        (+ A (+ A (/ (* (* B_m B_m) -0.5) C)))))
      t_1)
     (if (<= (pow B_m 2.0) 1e+227)
       (/
        (*
         (sqrt (* 2.0 (+ (* B_m B_m) (* C (* A -4.0)))))
         (sqrt (* F (+ C (- A (hypot B_m (- A C)))))))
        t_1)
       (*
        (* (sqrt B_m) (sqrt (- 0.0 F)))
        (/ (pow (pow 2.0 0.25) 2.0) (- 0.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 = t_0 - pow(B_m, 2.0);
	double tmp;
	if (pow(B_m, 2.0) <= 1e-181) {
		tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / t_1;
	} else if (pow(B_m, 2.0) <= 1e+227) {
		tmp = (sqrt((2.0 * ((B_m * B_m) + (C * (A * -4.0))))) * sqrt((F * (C + (A - hypot(B_m, (A - C))))))) / t_1;
	} else {
		tmp = (sqrt(B_m) * sqrt((0.0 - F))) * (pow(pow(2.0, 0.25), 2.0) / (0.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 t_1 = t_0 - Math.pow(B_m, 2.0);
	double tmp;
	if (Math.pow(B_m, 2.0) <= 1e-181) {
		tmp = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / t_1;
	} else if (Math.pow(B_m, 2.0) <= 1e+227) {
		tmp = (Math.sqrt((2.0 * ((B_m * B_m) + (C * (A * -4.0))))) * Math.sqrt((F * (C + (A - Math.hypot(B_m, (A - C))))))) / t_1;
	} else {
		tmp = (Math.sqrt(B_m) * Math.sqrt((0.0 - F))) * (Math.pow(Math.pow(2.0, 0.25), 2.0) / (0.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
	t_1 = t_0 - math.pow(B_m, 2.0)
	tmp = 0
	if math.pow(B_m, 2.0) <= 1e-181:
		tmp = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / t_1
	elif math.pow(B_m, 2.0) <= 1e+227:
		tmp = (math.sqrt((2.0 * ((B_m * B_m) + (C * (A * -4.0))))) * math.sqrt((F * (C + (A - math.hypot(B_m, (A - C))))))) / t_1
	else:
		tmp = (math.sqrt(B_m) * math.sqrt((0.0 - F))) * (math.pow(math.pow(2.0, 0.25), 2.0) / (0.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(Float64(4.0 * A) * C)
	t_1 = Float64(t_0 - (B_m ^ 2.0))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 1e-181)
		tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(A + Float64(A + Float64(Float64(Float64(B_m * B_m) * -0.5) / C))))) / t_1);
	elseif ((B_m ^ 2.0) <= 1e+227)
		tmp = Float64(Float64(sqrt(Float64(2.0 * Float64(Float64(B_m * B_m) + Float64(C * Float64(A * -4.0))))) * sqrt(Float64(F * Float64(C + Float64(A - hypot(B_m, Float64(A - C))))))) / t_1);
	else
		tmp = Float64(Float64(sqrt(B_m) * sqrt(Float64(0.0 - F))) * Float64(((2.0 ^ 0.25) ^ 2.0) / Float64(0.0 - 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;
	t_1 = t_0 - (B_m ^ 2.0);
	tmp = 0.0;
	if ((B_m ^ 2.0) <= 1e-181)
		tmp = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / t_1;
	elseif ((B_m ^ 2.0) <= 1e+227)
		tmp = (sqrt((2.0 * ((B_m * B_m) + (C * (A * -4.0))))) * sqrt((F * (C + (A - hypot(B_m, (A - C))))))) / t_1;
	else
		tmp = (sqrt(B_m) * sqrt((0.0 - F))) * (((2.0 ^ 0.25) ^ 2.0) / (0.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[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-181], 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[(A + N[(A + N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e+227], N[(N[(N[Sqrt[N[(2.0 * N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(F * N[(C + N[(A - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(N[Sqrt[B$95$m], $MachinePrecision] * N[Sqrt[N[(0.0 - F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Power[2.0, 0.25], $MachinePrecision], 2.0], $MachinePrecision] / N[(0.0 - 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 := \left(4 \cdot A\right) \cdot C\\
t_1 := t\_0 - {B\_m}^{2}\\
\mathbf{if}\;{B\_m}^{2} \leq 10^{-181}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(A + \left(A + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{C}\right)\right)}}{t\_1}\\

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

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


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

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in C around inf

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \color{blue}{\left(\left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right) - -1 \cdot A\right)}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + \left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + 1 \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      8. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \left(\frac{\frac{-1}{2} \cdot {B}^{2}}{C}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot {B}^{2}\right), C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left({B}^{2}\right)\right), C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(B \cdot B\right)\right), C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      12. *-lowering-*.f6427.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(B, B\right)\right), C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    5. Simplified27.7%

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

    if 1.00000000000000005e-181 < (pow.f64 B #s(literal 2 binary64)) < 1.0000000000000001e227

    1. Initial program 38.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. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(\left(2 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right) \cdot F\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{\left(2 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right) \cdot \left(F \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      3. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{2 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)} \cdot \sqrt{F \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\color{blue}{B}, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left({\left(2 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}^{\frac{1}{2}} \cdot \sqrt{F \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\left({\left(2 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}^{\frac{1}{2}}\right), \left(\sqrt{F \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(\color{blue}{B}, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    4. Applied egg-rr54.3%

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

    if 1.0000000000000001e227 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 4.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. Add Preprocessing
    3. Taylor expanded in C around 0

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
      4. mul-1-negN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \left(-1 \cdot \color{blue}{\frac{\sqrt{2}}{B}}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(\color{blue}{-1} \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{B}^{2} + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      12. accelerator-lowering-hypot.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\frac{\sqrt{2}}{B}\right)}\right)\right) \]
    5. Simplified15.5%

      \[\leadsto \color{blue}{\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)} \cdot \left(-1 \cdot \frac{\sqrt{2}}{B}\right)} \]
    6. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left({2}^{\frac{1}{2}}\right), B\right)\right)\right) \]
      2. sqr-powN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left({2}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot {2}^{\left(\frac{\frac{1}{2}}{2}\right)}\right), B\right)\right)\right) \]
      3. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left({\left({2}^{\left(\frac{\frac{1}{2}}{2}\right)}\right)}^{2}\right), B\right)\right)\right) \]
      4. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left({2}^{\left(\frac{\frac{1}{2}}{2}\right)}\right), 2\right), B\right)\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \left(\frac{\frac{1}{2}}{2}\right)\right), 2\right), B\right)\right)\right) \]
      6. metadata-eval15.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
    7. Applied egg-rr15.5%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-1 \cdot \left(B \cdot F\right)\right)}\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-1, \left(B \cdot F\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      2. *-lowering-*.f6413.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{*.f64}\left(B, F\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
    10. Simplified13.3%

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \left(B \cdot F\right)}} \cdot \left(-1 \cdot \frac{{\left({2}^{0.25}\right)}^{2}}{B}\right) \]
    11. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\left(B \cdot F\right) \cdot -1}\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{B \cdot \left(F \cdot -1\right)}\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      3. sqrt-prodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{B} \cdot \sqrt{F \cdot -1}\right), \mathsf{*.f64}\left(\color{blue}{-1}, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      4. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left({B}^{\frac{1}{2}} \cdot \sqrt{F \cdot -1}\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({B}^{\left(\frac{1}{4} \cdot 2\right)} \cdot \sqrt{F \cdot -1}\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({B}^{\left(\frac{1}{4} \cdot 2\right)}\right), \left(\sqrt{F \cdot -1}\right)\right), \mathsf{*.f64}\left(\color{blue}{-1}, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({B}^{\frac{1}{2}}\right), \left(\sqrt{F \cdot -1}\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      8. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{B}\right), \left(\sqrt{F \cdot -1}\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \left(\sqrt{F \cdot -1}\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{sqrt.f64}\left(\left(F \cdot -1\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      11. *-lowering-*.f6427.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, -1\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
    12. Applied egg-rr27.0%

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

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

Alternative 3: 52.1% accurate, 1.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} t_0 := \left(4 \cdot A\right) \cdot C\\ \mathbf{if}\;{B\_m}^{2} \leq 10^{-181}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(A + \left(A + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{C}\right)\right)}}{t\_0 - {B\_m}^{2}}\\ \mathbf{elif}\;{B\_m}^{2} \leq 10^{+195}:\\ \;\;\;\;0 - \sqrt{\frac{F \cdot \left(A - \left(\mathsf{hypot}\left(B\_m, A - C\right) - C\right)\right)}{B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)}} \cdot \sqrt{2}\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{B\_m} \cdot \sqrt{0 - F}\right) \cdot \frac{{\left({2}^{0.25}\right)}^{2}}{0 - 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) 1e-181)
     (/
      (sqrt
       (*
        (* 2.0 (* (- (pow B_m 2.0) t_0) F))
        (+ A (+ A (/ (* (* B_m B_m) -0.5) C)))))
      (- t_0 (pow B_m 2.0)))
     (if (<= (pow B_m 2.0) 1e+195)
       (-
        0.0
        (*
         (sqrt
          (/
           (* F (- A (- (hypot B_m (- A C)) C)))
           (+ (* B_m B_m) (* -4.0 (* A C)))))
         (sqrt 2.0)))
       (*
        (* (sqrt B_m) (sqrt (- 0.0 F)))
        (/ (pow (pow 2.0 0.25) 2.0) (- 0.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 (pow(B_m, 2.0) <= 1e-181) {
		tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / (t_0 - pow(B_m, 2.0));
	} else if (pow(B_m, 2.0) <= 1e+195) {
		tmp = 0.0 - (sqrt(((F * (A - (hypot(B_m, (A - C)) - C))) / ((B_m * B_m) + (-4.0 * (A * C))))) * sqrt(2.0));
	} else {
		tmp = (sqrt(B_m) * sqrt((0.0 - F))) * (pow(pow(2.0, 0.25), 2.0) / (0.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 (Math.pow(B_m, 2.0) <= 1e-181) {
		tmp = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / (t_0 - Math.pow(B_m, 2.0));
	} else if (Math.pow(B_m, 2.0) <= 1e+195) {
		tmp = 0.0 - (Math.sqrt(((F * (A - (Math.hypot(B_m, (A - C)) - C))) / ((B_m * B_m) + (-4.0 * (A * C))))) * Math.sqrt(2.0));
	} else {
		tmp = (Math.sqrt(B_m) * Math.sqrt((0.0 - F))) * (Math.pow(Math.pow(2.0, 0.25), 2.0) / (0.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 math.pow(B_m, 2.0) <= 1e-181:
		tmp = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / (t_0 - math.pow(B_m, 2.0))
	elif math.pow(B_m, 2.0) <= 1e+195:
		tmp = 0.0 - (math.sqrt(((F * (A - (math.hypot(B_m, (A - C)) - C))) / ((B_m * B_m) + (-4.0 * (A * C))))) * math.sqrt(2.0))
	else:
		tmp = (math.sqrt(B_m) * math.sqrt((0.0 - F))) * (math.pow(math.pow(2.0, 0.25), 2.0) / (0.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(Float64(4.0 * A) * C)
	tmp = 0.0
	if ((B_m ^ 2.0) <= 1e-181)
		tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(A + Float64(A + Float64(Float64(Float64(B_m * B_m) * -0.5) / C))))) / Float64(t_0 - (B_m ^ 2.0)));
	elseif ((B_m ^ 2.0) <= 1e+195)
		tmp = Float64(0.0 - Float64(sqrt(Float64(Float64(F * Float64(A - Float64(hypot(B_m, Float64(A - C)) - C))) / Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C))))) * sqrt(2.0)));
	else
		tmp = Float64(Float64(sqrt(B_m) * sqrt(Float64(0.0 - F))) * Float64(((2.0 ^ 0.25) ^ 2.0) / Float64(0.0 - 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) <= 1e-181)
		tmp = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / (t_0 - (B_m ^ 2.0));
	elseif ((B_m ^ 2.0) <= 1e+195)
		tmp = 0.0 - (sqrt(((F * (A - (hypot(B_m, (A - C)) - C))) / ((B_m * B_m) + (-4.0 * (A * C))))) * sqrt(2.0));
	else
		tmp = (sqrt(B_m) * sqrt((0.0 - F))) * (((2.0 ^ 0.25) ^ 2.0) / (0.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[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 1e-181], 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[(A + N[(A + N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $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], 1e+195], N[(0.0 - N[(N[Sqrt[N[(N[(F * N[(A - N[(N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision] - C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[B$95$m], $MachinePrecision] * N[Sqrt[N[(0.0 - F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Power[2.0, 0.25], $MachinePrecision], 2.0], $MachinePrecision] / N[(0.0 - 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 := \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;{B\_m}^{2} \leq 10^{-181}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(A + \left(A + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{C}\right)\right)}}{t\_0 - {B\_m}^{2}}\\

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

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


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

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in C around inf

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \color{blue}{\left(\left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right) - -1 \cdot A\right)}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + \left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + 1 \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      8. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \left(\frac{\frac{-1}{2} \cdot {B}^{2}}{C}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot {B}^{2}\right), C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left({B}^{2}\right)\right), C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(B \cdot B\right)\right), C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      12. *-lowering-*.f6427.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(B, B\right)\right), C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    5. Simplified27.7%

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

    if 1.00000000000000005e-181 < (pow.f64 B #s(literal 2 binary64)) < 9.99999999999999977e194

    1. Initial program 37.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. Add Preprocessing
    3. Taylor expanded in F around 0

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\frac{F \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}} \cdot \sqrt{2}\right) \]
      2. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{\frac{F \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}{{B}^{2} - 4 \cdot \left(A \cdot C\right)}} \cdot \color{blue}{\left(\mathsf{neg}\left(\sqrt{2}\right)\right)} \]
      3. *-lowering-*.f64N/A

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

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

    if 9.99999999999999977e194 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 8.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. Add Preprocessing
    3. Taylor expanded in C around 0

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
      4. mul-1-negN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \left(-1 \cdot \color{blue}{\frac{\sqrt{2}}{B}}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(\color{blue}{-1} \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{B}^{2} + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      12. accelerator-lowering-hypot.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      13. *-lowering-*.f64N/A

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

      \[\leadsto \color{blue}{\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)} \cdot \left(-1 \cdot \frac{\sqrt{2}}{B}\right)} \]
    6. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left({2}^{\frac{1}{2}}\right), B\right)\right)\right) \]
      2. sqr-powN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left({2}^{\left(\frac{\frac{1}{2}}{2}\right)} \cdot {2}^{\left(\frac{\frac{1}{2}}{2}\right)}\right), B\right)\right)\right) \]
      3. pow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left({\left({2}^{\left(\frac{\frac{1}{2}}{2}\right)}\right)}^{2}\right), B\right)\right)\right) \]
      4. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left({2}^{\left(\frac{\frac{1}{2}}{2}\right)}\right), 2\right), B\right)\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \left(\frac{\frac{1}{2}}{2}\right)\right), 2\right), B\right)\right)\right) \]
      6. metadata-eval17.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
    7. Applied egg-rr17.3%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-1 \cdot \left(B \cdot F\right)\right)}\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-1, \left(B \cdot F\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      2. *-lowering-*.f6415.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{*.f64}\left(B, F\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
    10. Simplified15.2%

      \[\leadsto \sqrt{\color{blue}{-1 \cdot \left(B \cdot F\right)}} \cdot \left(-1 \cdot \frac{{\left({2}^{0.25}\right)}^{2}}{B}\right) \]
    11. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\left(B \cdot F\right) \cdot -1}\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      2. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{B \cdot \left(F \cdot -1\right)}\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      3. sqrt-prodN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{B} \cdot \sqrt{F \cdot -1}\right), \mathsf{*.f64}\left(\color{blue}{-1}, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      4. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left({B}^{\frac{1}{2}} \cdot \sqrt{F \cdot -1}\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({B}^{\left(\frac{1}{4} \cdot 2\right)} \cdot \sqrt{F \cdot -1}\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({B}^{\left(\frac{1}{4} \cdot 2\right)}\right), \left(\sqrt{F \cdot -1}\right)\right), \mathsf{*.f64}\left(\color{blue}{-1}, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({B}^{\frac{1}{2}}\right), \left(\sqrt{F \cdot -1}\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      8. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{B}\right), \left(\sqrt{F \cdot -1}\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \left(\sqrt{F \cdot -1}\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{sqrt.f64}\left(\left(F \cdot -1\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
      11. *-lowering-*.f6427.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(B\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, -1\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{pow.f64}\left(2, \frac{1}{4}\right), 2\right), B\right)\right)\right) \]
    12. Applied egg-rr27.7%

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

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

Alternative 4: 46.6% accurate, 1.4× 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 := \left(4 \cdot A\right) \cdot C\\ t_1 := A \cdot \left(C \cdot -4\right)\\ \mathbf{if}\;{B\_m}^{2} \leq 4 \cdot 10^{-191}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(A + \left(A + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{C}\right)\right)}}{t\_0 - {B\_m}^{2}}\\ \mathbf{elif}\;{B\_m}^{2} \leq 10^{+78}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + t\_1\right) \cdot \left(F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{B\_m \cdot \left(0 - B\_m\right) - t\_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(A, B\_m\right)\right)\right)}}{0 - 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 (* A (* C -4.0))))
   (if (<= (pow B_m 2.0) 4e-191)
     (/
      (sqrt
       (*
        (* 2.0 (* (- (pow B_m 2.0) t_0) F))
        (+ A (+ A (/ (* (* B_m B_m) -0.5) C)))))
      (- t_0 (pow B_m 2.0)))
     (if (<= (pow B_m 2.0) 1e+78)
       (/
        (sqrt
         (* 2.0 (* (+ (* B_m B_m) t_1) (* F (- (+ A C) (hypot B_m (- A C)))))))
        (- (* B_m (- 0.0 B_m)) t_1))
       (/ (sqrt (* 2.0 (* F (- A (hypot A B_m))))) (- 0.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 = A * (C * -4.0);
	double tmp;
	if (pow(B_m, 2.0) <= 4e-191) {
		tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / (t_0 - pow(B_m, 2.0));
	} else if (pow(B_m, 2.0) <= 1e+78) {
		tmp = sqrt((2.0 * (((B_m * B_m) + t_1) * (F * ((A + C) - hypot(B_m, (A - C))))))) / ((B_m * (0.0 - B_m)) - t_1);
	} else {
		tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) / (0.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 t_1 = A * (C * -4.0);
	double tmp;
	if (Math.pow(B_m, 2.0) <= 4e-191) {
		tmp = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / (t_0 - Math.pow(B_m, 2.0));
	} else if (Math.pow(B_m, 2.0) <= 1e+78) {
		tmp = Math.sqrt((2.0 * (((B_m * B_m) + t_1) * (F * ((A + C) - Math.hypot(B_m, (A - C))))))) / ((B_m * (0.0 - B_m)) - t_1);
	} else {
		tmp = Math.sqrt((2.0 * (F * (A - Math.hypot(A, B_m))))) / (0.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
	t_1 = A * (C * -4.0)
	tmp = 0
	if math.pow(B_m, 2.0) <= 4e-191:
		tmp = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / (t_0 - math.pow(B_m, 2.0))
	elif math.pow(B_m, 2.0) <= 1e+78:
		tmp = math.sqrt((2.0 * (((B_m * B_m) + t_1) * (F * ((A + C) - math.hypot(B_m, (A - C))))))) / ((B_m * (0.0 - B_m)) - t_1)
	else:
		tmp = math.sqrt((2.0 * (F * (A - math.hypot(A, B_m))))) / (0.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(Float64(4.0 * A) * C)
	t_1 = Float64(A * Float64(C * -4.0))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 4e-191)
		tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(A + Float64(A + Float64(Float64(Float64(B_m * B_m) * -0.5) / C))))) / Float64(t_0 - (B_m ^ 2.0)));
	elseif ((B_m ^ 2.0) <= 1e+78)
		tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + t_1) * Float64(F * Float64(Float64(A + C) - hypot(B_m, Float64(A - C))))))) / Float64(Float64(B_m * Float64(0.0 - B_m)) - t_1));
	else
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(A, B_m))))) / Float64(0.0 - 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;
	t_1 = A * (C * -4.0);
	tmp = 0.0;
	if ((B_m ^ 2.0) <= 4e-191)
		tmp = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (A + (A + (((B_m * B_m) * -0.5) / C))))) / (t_0 - (B_m ^ 2.0));
	elseif ((B_m ^ 2.0) <= 1e+78)
		tmp = sqrt((2.0 * (((B_m * B_m) + t_1) * (F * ((A + C) - hypot(B_m, (A - C))))))) / ((B_m * (0.0 - B_m)) - t_1);
	else
		tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) / (0.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[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e-191], 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[(A + N[(A + N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] * -0.5), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $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], 1e+78], N[(N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + t$95$1), $MachinePrecision] * N[(F * N[(N[(A + C), $MachinePrecision] - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(B$95$m * N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[A ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - 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 := \left(4 \cdot A\right) \cdot C\\
t_1 := A \cdot \left(C \cdot -4\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 4 \cdot 10^{-191}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(A + \left(A + \frac{\left(B\_m \cdot B\_m\right) \cdot -0.5}{C}\right)\right)}}{t\_0 - {B\_m}^{2}}\\

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

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


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

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in C around inf

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \color{blue}{\left(\left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right) - -1 \cdot A\right)}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} - -1 \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + \left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + 1 \cdot A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + A\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      5. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      8. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \left(\frac{\frac{-1}{2} \cdot {B}^{2}}{C}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot {B}^{2}\right), C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left({B}^{2}\right)\right), C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(B \cdot B\right)\right), C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      12. *-lowering-*.f6427.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, \mathsf{+.f64}\left(A, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(B, B\right)\right), C\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    5. Simplified27.1%

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

    if 4.0000000000000001e-191 < (pow.f64 B #s(literal 2 binary64)) < 1.00000000000000001e78

    1. Initial program 38.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. Add Preprocessing
    3. Step-by-step derivation
      1. neg-sub0N/A

        \[\leadsto \frac{0 - \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)}}{\color{blue}{{B}^{2}} - \left(4 \cdot A\right) \cdot C} \]
      2. div-subN/A

        \[\leadsto \frac{0}{{B}^{2} - \left(4 \cdot A\right) \cdot C} - \color{blue}{\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}} \]
      3. frac-subN/A

        \[\leadsto \frac{0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}}{\color{blue}{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}\right), \color{blue}{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}\right) \]
    4. Applied egg-rr42.6%

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

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

    if 1.00000000000000001e78 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 12.9%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
      4. mul-1-negN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \left(-1 \cdot \color{blue}{\frac{\sqrt{2}}{B}}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(\color{blue}{-1} \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{B}^{2} + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      12. accelerator-lowering-hypot.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      13. *-lowering-*.f64N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{-1 \cdot \sqrt{2}}{\color{blue}{B}}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{\sqrt{2} \cdot -1}{B}\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \color{blue}{\frac{-1}{B}}\right)\right) \]
      4. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{\mathsf{neg}\left(-1\right)}{\color{blue}{\mathsf{neg}\left(B\right)}}\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{1}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\sqrt{2}\right), \color{blue}{\left(\frac{1}{\mathsf{neg}\left(B\right)}\right)}\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\color{blue}{1}}{\mathsf{neg}\left(B\right)}\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right)\right) \]
      9. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{-1}{\color{blue}{B}}\right)\right)\right) \]
      10. /-lowering-/.f6420.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \mathsf{/.f64}\left(-1, \color{blue}{B}\right)\right)\right) \]
    7. Applied egg-rr20.8%

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

        \[\leadsto \left(\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)} \cdot \sqrt{2}\right) \cdot \color{blue}{\frac{-1}{B}} \]
      2. associate-*r/N/A

        \[\leadsto \frac{\left(\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)} \cdot \sqrt{2}\right) \cdot -1}{\color{blue}{B}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)} \cdot \sqrt{2}\right) \cdot -1\right), \color{blue}{B}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)} \cdot \sqrt{2}\right), -1\right), B\right) \]
      5. sqrt-unprodN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\left(F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right) \cdot 2}\right), -1\right), B\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right) \cdot 2\right)\right), -1\right), B\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right), 2\right)\right), -1\right), B\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right), 2\right)\right), -1\right), B\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right), 2\right)\right), -1\right), B\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{A \cdot A + B \cdot B}\right)\right)\right), 2\right)\right), -1\right), B\right) \]
      11. accelerator-lowering-hypot.f6420.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(A, B\right)\right)\right), 2\right)\right), -1\right), B\right) \]
    9. Applied egg-rr20.8%

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

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

Alternative 5: 46.8% accurate, 1.4× 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 := \left(4 \cdot A\right) \cdot C\\ t_1 := A \cdot \left(C \cdot -4\right)\\ \mathbf{if}\;{B\_m}^{2} \leq 4 \cdot 10^{-191}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(A + A\right)}}{t\_0 - {B\_m}^{2}}\\ \mathbf{elif}\;{B\_m}^{2} \leq 10^{+78}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(B\_m \cdot B\_m + t\_1\right) \cdot \left(F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{B\_m \cdot \left(0 - B\_m\right) - t\_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(A, B\_m\right)\right)\right)}}{0 - 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 (* A (* C -4.0))))
   (if (<= (pow B_m 2.0) 4e-191)
     (/
      (sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_0) F)) (+ A A)))
      (- t_0 (pow B_m 2.0)))
     (if (<= (pow B_m 2.0) 1e+78)
       (/
        (sqrt
         (* 2.0 (* (+ (* B_m B_m) t_1) (* F (- (+ A C) (hypot B_m (- A C)))))))
        (- (* B_m (- 0.0 B_m)) t_1))
       (/ (sqrt (* 2.0 (* F (- A (hypot A B_m))))) (- 0.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 = A * (C * -4.0);
	double tmp;
	if (pow(B_m, 2.0) <= 4e-191) {
		tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (A + A))) / (t_0 - pow(B_m, 2.0));
	} else if (pow(B_m, 2.0) <= 1e+78) {
		tmp = sqrt((2.0 * (((B_m * B_m) + t_1) * (F * ((A + C) - hypot(B_m, (A - C))))))) / ((B_m * (0.0 - B_m)) - t_1);
	} else {
		tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) / (0.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 t_1 = A * (C * -4.0);
	double tmp;
	if (Math.pow(B_m, 2.0) <= 4e-191) {
		tmp = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (A + A))) / (t_0 - Math.pow(B_m, 2.0));
	} else if (Math.pow(B_m, 2.0) <= 1e+78) {
		tmp = Math.sqrt((2.0 * (((B_m * B_m) + t_1) * (F * ((A + C) - Math.hypot(B_m, (A - C))))))) / ((B_m * (0.0 - B_m)) - t_1);
	} else {
		tmp = Math.sqrt((2.0 * (F * (A - Math.hypot(A, B_m))))) / (0.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
	t_1 = A * (C * -4.0)
	tmp = 0
	if math.pow(B_m, 2.0) <= 4e-191:
		tmp = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (A + A))) / (t_0 - math.pow(B_m, 2.0))
	elif math.pow(B_m, 2.0) <= 1e+78:
		tmp = math.sqrt((2.0 * (((B_m * B_m) + t_1) * (F * ((A + C) - math.hypot(B_m, (A - C))))))) / ((B_m * (0.0 - B_m)) - t_1)
	else:
		tmp = math.sqrt((2.0 * (F * (A - math.hypot(A, B_m))))) / (0.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(Float64(4.0 * A) * C)
	t_1 = Float64(A * Float64(C * -4.0))
	tmp = 0.0
	if ((B_m ^ 2.0) <= 4e-191)
		tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(A + A))) / Float64(t_0 - (B_m ^ 2.0)));
	elseif ((B_m ^ 2.0) <= 1e+78)
		tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(Float64(B_m * B_m) + t_1) * Float64(F * Float64(Float64(A + C) - hypot(B_m, Float64(A - C))))))) / Float64(Float64(B_m * Float64(0.0 - B_m)) - t_1));
	else
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(A, B_m))))) / Float64(0.0 - 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;
	t_1 = A * (C * -4.0);
	tmp = 0.0;
	if ((B_m ^ 2.0) <= 4e-191)
		tmp = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (A + A))) / (t_0 - (B_m ^ 2.0));
	elseif ((B_m ^ 2.0) <= 1e+78)
		tmp = sqrt((2.0 * (((B_m * B_m) + t_1) * (F * ((A + C) - hypot(B_m, (A - C))))))) / ((B_m * (0.0 - B_m)) - t_1);
	else
		tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) / (0.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[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 4e-191], 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[(A + A), $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], 1e+78], N[(N[Sqrt[N[(2.0 * N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + t$95$1), $MachinePrecision] * N[(F * N[(N[(A + C), $MachinePrecision] - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(B$95$m * N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[A ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - 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 := \left(4 \cdot A\right) \cdot C\\
t_1 := A \cdot \left(C \cdot -4\right)\\
\mathbf{if}\;{B\_m}^{2} \leq 4 \cdot 10^{-191}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(A + A\right)}}{t\_0 - {B\_m}^{2}}\\

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

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


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

    1. Initial program 20.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. Add Preprocessing
    3. Taylor expanded in C around inf

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \color{blue}{\left(A - -1 \cdot A\right)}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    4. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + \left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + 1 \cdot A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      3. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \left(A + A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
      4. +-lowering-+.f6426.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right), F\right)\right), \mathsf{+.f64}\left(A, A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{pow.f64}\left(B, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)\right)\right) \]
    5. Simplified26.9%

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

    if 4.0000000000000001e-191 < (pow.f64 B #s(literal 2 binary64)) < 1.00000000000000001e78

    1. Initial program 38.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. Add Preprocessing
    3. Step-by-step derivation
      1. neg-sub0N/A

        \[\leadsto \frac{0 - \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)}}{\color{blue}{{B}^{2}} - \left(4 \cdot A\right) \cdot C} \]
      2. div-subN/A

        \[\leadsto \frac{0}{{B}^{2} - \left(4 \cdot A\right) \cdot C} - \color{blue}{\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}} \]
      3. frac-subN/A

        \[\leadsto \frac{0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}}{\color{blue}{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}\right), \color{blue}{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}\right) \]
    4. Applied egg-rr42.6%

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

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

    if 1.00000000000000001e78 < (pow.f64 B #s(literal 2 binary64))

    1. Initial program 12.9%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
      4. mul-1-negN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \left(-1 \cdot \color{blue}{\frac{\sqrt{2}}{B}}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(\color{blue}{-1} \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{B}^{2} + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      12. accelerator-lowering-hypot.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      13. *-lowering-*.f64N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{-1 \cdot \sqrt{2}}{\color{blue}{B}}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{\sqrt{2} \cdot -1}{B}\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \color{blue}{\frac{-1}{B}}\right)\right) \]
      4. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{\mathsf{neg}\left(-1\right)}{\color{blue}{\mathsf{neg}\left(B\right)}}\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{1}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\sqrt{2}\right), \color{blue}{\left(\frac{1}{\mathsf{neg}\left(B\right)}\right)}\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\color{blue}{1}}{\mathsf{neg}\left(B\right)}\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right)\right) \]
      9. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{-1}{\color{blue}{B}}\right)\right)\right) \]
      10. /-lowering-/.f6420.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \mathsf{/.f64}\left(-1, \color{blue}{B}\right)\right)\right) \]
    7. Applied egg-rr20.8%

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

        \[\leadsto \left(\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)} \cdot \sqrt{2}\right) \cdot \color{blue}{\frac{-1}{B}} \]
      2. associate-*r/N/A

        \[\leadsto \frac{\left(\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)} \cdot \sqrt{2}\right) \cdot -1}{\color{blue}{B}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)} \cdot \sqrt{2}\right) \cdot -1\right), \color{blue}{B}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)} \cdot \sqrt{2}\right), -1\right), B\right) \]
      5. sqrt-unprodN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\left(F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right) \cdot 2}\right), -1\right), B\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right) \cdot 2\right)\right), -1\right), B\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right), 2\right)\right), -1\right), B\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right), 2\right)\right), -1\right), B\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right), 2\right)\right), -1\right), B\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{A \cdot A + B \cdot B}\right)\right)\right), 2\right)\right), -1\right), B\right) \]
      11. accelerator-lowering-hypot.f6420.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(A, B\right)\right)\right), 2\right)\right), -1\right), B\right) \]
    9. Applied egg-rr20.8%

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

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

Alternative 6: 40.5% accurate, 2.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} t_0 := C \cdot \left(A \cdot -4\right)\\ \mathbf{if}\;B\_m \leq 8.5 \cdot 10^{+41}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(\left(C + \left(A - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right) \cdot \left(F \cdot \left(B\_m \cdot B\_m + t\_0\right)\right)\right)}}{B\_m \cdot \left(0 - B\_m\right) - t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(A, B\_m\right)\right)\right)}}{0 - 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 (* C (* A -4.0))))
   (if (<= B_m 8.5e+41)
     (/
      (sqrt
       (* 2.0 (* (+ C (- A (hypot B_m (- A C)))) (* F (+ (* B_m B_m) t_0)))))
      (- (* B_m (- 0.0 B_m)) t_0))
     (/ (sqrt (* 2.0 (* F (- A (hypot A B_m))))) (- 0.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 = C * (A * -4.0);
	double tmp;
	if (B_m <= 8.5e+41) {
		tmp = sqrt((2.0 * ((C + (A - hypot(B_m, (A - C)))) * (F * ((B_m * B_m) + t_0))))) / ((B_m * (0.0 - B_m)) - t_0);
	} else {
		tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) / (0.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 = C * (A * -4.0);
	double tmp;
	if (B_m <= 8.5e+41) {
		tmp = Math.sqrt((2.0 * ((C + (A - Math.hypot(B_m, (A - C)))) * (F * ((B_m * B_m) + t_0))))) / ((B_m * (0.0 - B_m)) - t_0);
	} else {
		tmp = Math.sqrt((2.0 * (F * (A - Math.hypot(A, B_m))))) / (0.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 = C * (A * -4.0)
	tmp = 0
	if B_m <= 8.5e+41:
		tmp = math.sqrt((2.0 * ((C + (A - math.hypot(B_m, (A - C)))) * (F * ((B_m * B_m) + t_0))))) / ((B_m * (0.0 - B_m)) - t_0)
	else:
		tmp = math.sqrt((2.0 * (F * (A - math.hypot(A, B_m))))) / (0.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(C * Float64(A * -4.0))
	tmp = 0.0
	if (B_m <= 8.5e+41)
		tmp = Float64(sqrt(Float64(2.0 * Float64(Float64(C + Float64(A - hypot(B_m, Float64(A - C)))) * Float64(F * Float64(Float64(B_m * B_m) + t_0))))) / Float64(Float64(B_m * Float64(0.0 - B_m)) - t_0));
	else
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(A, B_m))))) / Float64(0.0 - 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 = C * (A * -4.0);
	tmp = 0.0;
	if (B_m <= 8.5e+41)
		tmp = sqrt((2.0 * ((C + (A - hypot(B_m, (A - C)))) * (F * ((B_m * B_m) + t_0))))) / ((B_m * (0.0 - B_m)) - t_0);
	else
		tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) / (0.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[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 8.5e+41], N[(N[Sqrt[N[(2.0 * N[(N[(C + N[(A - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(F * N[(N[(B$95$m * B$95$m), $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(B$95$m * N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[A ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - 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 := C \cdot \left(A \cdot -4\right)\\
\mathbf{if}\;B\_m \leq 8.5 \cdot 10^{+41}:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(\left(C + \left(A - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right) \cdot \left(F \cdot \left(B\_m \cdot B\_m + t\_0\right)\right)\right)}}{B\_m \cdot \left(0 - B\_m\right) - t\_0}\\

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


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

    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. Add Preprocessing
    3. Step-by-step derivation
      1. distribute-frac-negN/A

        \[\leadsto \mathsf{neg}\left(\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}\right) \]
      2. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\left(\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}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(\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)}\right), \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)\right) \]
    4. Applied egg-rr27.6%

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

    if 8.49999999999999938e41 < B

    1. Initial program 13.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. Add Preprocessing
    3. Taylor expanded in C around 0

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
      4. mul-1-negN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \left(-1 \cdot \color{blue}{\frac{\sqrt{2}}{B}}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(\color{blue}{-1} \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{B}^{2} + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      12. accelerator-lowering-hypot.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      13. *-lowering-*.f64N/A

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{-1 \cdot \sqrt{2}}{\color{blue}{B}}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{\sqrt{2} \cdot -1}{B}\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \color{blue}{\frac{-1}{B}}\right)\right) \]
      4. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{\mathsf{neg}\left(-1\right)}{\color{blue}{\mathsf{neg}\left(B\right)}}\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{1}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\sqrt{2}\right), \color{blue}{\left(\frac{1}{\mathsf{neg}\left(B\right)}\right)}\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\color{blue}{1}}{\mathsf{neg}\left(B\right)}\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right)\right) \]
      9. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{-1}{\color{blue}{B}}\right)\right)\right) \]
      10. /-lowering-/.f6443.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \mathsf{/.f64}\left(-1, \color{blue}{B}\right)\right)\right) \]
    7. Applied egg-rr43.2%

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

        \[\leadsto \left(\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)} \cdot \sqrt{2}\right) \cdot \color{blue}{\frac{-1}{B}} \]
      2. associate-*r/N/A

        \[\leadsto \frac{\left(\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)} \cdot \sqrt{2}\right) \cdot -1}{\color{blue}{B}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)} \cdot \sqrt{2}\right) \cdot -1\right), \color{blue}{B}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)} \cdot \sqrt{2}\right), -1\right), B\right) \]
      5. sqrt-unprodN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\left(F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right) \cdot 2}\right), -1\right), B\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right) \cdot 2\right)\right), -1\right), B\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right), 2\right)\right), -1\right), B\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right), 2\right)\right), -1\right), B\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right), 2\right)\right), -1\right), B\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{A \cdot A + B \cdot B}\right)\right)\right), 2\right)\right), -1\right), B\right) \]
      11. accelerator-lowering-hypot.f6443.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(A, B\right)\right)\right), 2\right)\right), -1\right), B\right) \]
    9. Applied egg-rr43.4%

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

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

Alternative 7: 37.1% 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} t_0 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\ \mathbf{if}\;B\_m \leq 1.3 \cdot 10^{-102}:\\ \;\;\;\;\frac{t\_0 \cdot 0 - t\_0 \cdot \sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}}{t\_0 \cdot t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(A, B\_m\right)\right)\right)}}{0 - 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 (+ (* B_m B_m) (* C (* A -4.0)))))
   (if (<= B_m 1.3e-102)
     (/
      (- (* t_0 0.0) (* t_0 (sqrt (* -16.0 (* F (* C (* A A)))))))
      (* t_0 t_0))
     (/ (sqrt (* 2.0 (* F (- A (hypot A B_m))))) (- 0.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 = (B_m * B_m) + (C * (A * -4.0));
	double tmp;
	if (B_m <= 1.3e-102) {
		tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
	} else {
		tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) / (0.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 = (B_m * B_m) + (C * (A * -4.0));
	double tmp;
	if (B_m <= 1.3e-102) {
		tmp = ((t_0 * 0.0) - (t_0 * Math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
	} else {
		tmp = Math.sqrt((2.0 * (F * (A - Math.hypot(A, B_m))))) / (0.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 = (B_m * B_m) + (C * (A * -4.0))
	tmp = 0
	if B_m <= 1.3e-102:
		tmp = ((t_0 * 0.0) - (t_0 * math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0)
	else:
		tmp = math.sqrt((2.0 * (F * (A - math.hypot(A, B_m))))) / (0.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(Float64(B_m * B_m) + Float64(C * Float64(A * -4.0)))
	tmp = 0.0
	if (B_m <= 1.3e-102)
		tmp = Float64(Float64(Float64(t_0 * 0.0) - Float64(t_0 * sqrt(Float64(-16.0 * Float64(F * Float64(C * Float64(A * A))))))) / Float64(t_0 * t_0));
	else
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(A, B_m))))) / Float64(0.0 - 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 = (B_m * B_m) + (C * (A * -4.0));
	tmp = 0.0;
	if (B_m <= 1.3e-102)
		tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
	else
		tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) / (0.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[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.3e-102], N[(N[(N[(t$95$0 * 0.0), $MachinePrecision] - N[(t$95$0 * N[Sqrt[N[(-16.0 * N[(F * N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[A ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - 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 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\
\mathbf{if}\;B\_m \leq 1.3 \cdot 10^{-102}:\\
\;\;\;\;\frac{t\_0 \cdot 0 - t\_0 \cdot \sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}}{t\_0 \cdot t\_0}\\

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


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

    1. Initial program 21.3%

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

        \[\leadsto \frac{0 - \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)}}{\color{blue}{{B}^{2}} - \left(4 \cdot A\right) \cdot C} \]
      2. div-subN/A

        \[\leadsto \frac{0}{{B}^{2} - \left(4 \cdot A\right) \cdot C} - \color{blue}{\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}} \]
      3. frac-subN/A

        \[\leadsto \frac{0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}}{\color{blue}{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}\right), \color{blue}{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}\right) \]
    4. Applied egg-rr16.4%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\color{blue}{A}, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left({A}^{2} \cdot C\right) \cdot F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\left({A}^{2} \cdot C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({A}^{2}\right), C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(A \cdot A\right), C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f648.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    7. Simplified8.0%

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

    if 1.29999999999999993e-102 < B

    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. Add Preprocessing
    3. Taylor expanded in C around 0

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
      4. mul-1-negN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \left(-1 \cdot \color{blue}{\frac{\sqrt{2}}{B}}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(\color{blue}{-1} \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{B}^{2} + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      12. accelerator-lowering-hypot.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\frac{\sqrt{2}}{B}\right)}\right)\right) \]
    5. Simplified38.2%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{-1 \cdot \sqrt{2}}{\color{blue}{B}}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{\sqrt{2} \cdot -1}{B}\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \color{blue}{\frac{-1}{B}}\right)\right) \]
      4. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{\mathsf{neg}\left(-1\right)}{\color{blue}{\mathsf{neg}\left(B\right)}}\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{1}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\sqrt{2}\right), \color{blue}{\left(\frac{1}{\mathsf{neg}\left(B\right)}\right)}\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\color{blue}{1}}{\mathsf{neg}\left(B\right)}\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right)\right) \]
      9. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{-1}{\color{blue}{B}}\right)\right)\right) \]
      10. /-lowering-/.f6438.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \mathsf{/.f64}\left(-1, \color{blue}{B}\right)\right)\right) \]
    7. Applied egg-rr38.2%

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

        \[\leadsto \left(\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)} \cdot \sqrt{2}\right) \cdot \color{blue}{\frac{-1}{B}} \]
      2. associate-*r/N/A

        \[\leadsto \frac{\left(\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)} \cdot \sqrt{2}\right) \cdot -1}{\color{blue}{B}} \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)} \cdot \sqrt{2}\right) \cdot -1\right), \color{blue}{B}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)} \cdot \sqrt{2}\right), -1\right), B\right) \]
      5. sqrt-unprodN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{\left(F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right) \cdot 2}\right), -1\right), B\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right) \cdot 2\right)\right), -1\right), B\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right), 2\right)\right), -1\right), B\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right), 2\right)\right), -1\right), B\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right), 2\right)\right), -1\right), B\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{A \cdot A + B \cdot B}\right)\right)\right), 2\right)\right), -1\right), B\right) \]
      11. accelerator-lowering-hypot.f6438.3%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(A, B\right)\right)\right), 2\right)\right), -1\right), B\right) \]
    9. Applied egg-rr38.3%

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

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

Alternative 8: 37.1% 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} t_0 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\ \mathbf{if}\;B\_m \leq 4.3 \cdot 10^{-103}:\\ \;\;\;\;\frac{t\_0 \cdot 0 - t\_0 \cdot \sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}}{t\_0 \cdot t\_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(F \cdot \left(A - \mathsf{hypot}\left(A, B\_m\right)\right)\right)} \cdot \frac{-1}{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 (+ (* B_m B_m) (* C (* A -4.0)))))
   (if (<= B_m 4.3e-103)
     (/
      (- (* t_0 0.0) (* t_0 (sqrt (* -16.0 (* F (* C (* A A)))))))
      (* t_0 t_0))
     (* (sqrt (* 2.0 (* F (- A (hypot A B_m))))) (/ -1.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 = (B_m * B_m) + (C * (A * -4.0));
	double tmp;
	if (B_m <= 4.3e-103) {
		tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
	} else {
		tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) * (-1.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 = (B_m * B_m) + (C * (A * -4.0));
	double tmp;
	if (B_m <= 4.3e-103) {
		tmp = ((t_0 * 0.0) - (t_0 * Math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
	} else {
		tmp = Math.sqrt((2.0 * (F * (A - Math.hypot(A, B_m))))) * (-1.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 = (B_m * B_m) + (C * (A * -4.0))
	tmp = 0
	if B_m <= 4.3e-103:
		tmp = ((t_0 * 0.0) - (t_0 * math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0)
	else:
		tmp = math.sqrt((2.0 * (F * (A - math.hypot(A, B_m))))) * (-1.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(Float64(B_m * B_m) + Float64(C * Float64(A * -4.0)))
	tmp = 0.0
	if (B_m <= 4.3e-103)
		tmp = Float64(Float64(Float64(t_0 * 0.0) - Float64(t_0 * sqrt(Float64(-16.0 * Float64(F * Float64(C * Float64(A * A))))))) / Float64(t_0 * t_0));
	else
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(A - hypot(A, B_m))))) * Float64(-1.0 / 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 = (B_m * B_m) + (C * (A * -4.0));
	tmp = 0.0;
	if (B_m <= 4.3e-103)
		tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
	else
		tmp = sqrt((2.0 * (F * (A - hypot(A, B_m))))) * (-1.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[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 4.3e-103], N[(N[(N[(t$95$0 * 0.0), $MachinePrecision] - N[(t$95$0 * N[Sqrt[N[(-16.0 * N[(F * N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(A - N[Sqrt[A ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / 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 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\
\mathbf{if}\;B\_m \leq 4.3 \cdot 10^{-103}:\\
\;\;\;\;\frac{t\_0 \cdot 0 - t\_0 \cdot \sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}}{t\_0 \cdot t\_0}\\

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


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

    1. Initial program 21.3%

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

        \[\leadsto \frac{0 - \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)}}{\color{blue}{{B}^{2}} - \left(4 \cdot A\right) \cdot C} \]
      2. div-subN/A

        \[\leadsto \frac{0}{{B}^{2} - \left(4 \cdot A\right) \cdot C} - \color{blue}{\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}} \]
      3. frac-subN/A

        \[\leadsto \frac{0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}}{\color{blue}{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}\right), \color{blue}{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}\right) \]
    4. Applied egg-rr16.4%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\color{blue}{A}, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left({A}^{2} \cdot C\right) \cdot F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\left({A}^{2} \cdot C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({A}^{2}\right), C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(A \cdot A\right), C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f648.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    7. Simplified8.0%

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

    if 4.30000000000000023e-103 < B

    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. Add Preprocessing
    3. Taylor expanded in C around 0

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
      4. mul-1-negN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \left(-1 \cdot \color{blue}{\frac{\sqrt{2}}{B}}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(\color{blue}{-1} \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{B}^{2} + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      12. accelerator-lowering-hypot.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\frac{\sqrt{2}}{B}\right)}\right)\right) \]
    5. Simplified38.2%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{-1 \cdot \sqrt{2}}{\color{blue}{B}}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{\sqrt{2} \cdot -1}{B}\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \color{blue}{\frac{-1}{B}}\right)\right) \]
      4. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{\mathsf{neg}\left(-1\right)}{\color{blue}{\mathsf{neg}\left(B\right)}}\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{1}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\sqrt{2}\right), \color{blue}{\left(\frac{1}{\mathsf{neg}\left(B\right)}\right)}\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\color{blue}{1}}{\mathsf{neg}\left(B\right)}\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right)\right) \]
      9. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{-1}{\color{blue}{B}}\right)\right)\right) \]
      10. /-lowering-/.f6438.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \mathsf{/.f64}\left(-1, \color{blue}{B}\right)\right)\right) \]
    7. Applied egg-rr38.2%

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

        \[\leadsto \left(\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)} \cdot \sqrt{2}\right) \cdot \color{blue}{\frac{-1}{B}} \]
      2. *-commutativeN/A

        \[\leadsto \frac{-1}{B} \cdot \color{blue}{\left(\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)} \cdot \sqrt{2}\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{-1}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)} \cdot \sqrt{2}\right)}\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, B\right), \left(\color{blue}{\sqrt{F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)}} \cdot \sqrt{2}\right)\right) \]
      5. sqrt-unprodN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, B\right), \left(\sqrt{\left(F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right) \cdot 2}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, B\right), \mathsf{sqrt.f64}\left(\left(\left(F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right) \cdot 2\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, B\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(F \cdot \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right), 2\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, B\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{B \cdot B + A \cdot A}\right)\right), 2\right)\right)\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, B\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right), 2\right)\right)\right) \]
      10. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, B\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{A \cdot A + B \cdot B}\right)\right)\right), 2\right)\right)\right) \]
      11. accelerator-lowering-hypot.f6438.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-1, B\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(A, B\right)\right)\right), 2\right)\right)\right) \]
    9. Applied egg-rr38.3%

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

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

Alternative 9: 32.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} t_0 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\ \mathbf{if}\;B\_m \leq 1.46 \cdot 10^{-102}:\\ \;\;\;\;\frac{t\_0 \cdot 0 - t\_0 \cdot \sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}}{t\_0 \cdot t\_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A - B\_m\right)} \cdot \left(\sqrt{2} \cdot \frac{-1}{B\_m}\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
 (let* ((t_0 (+ (* B_m B_m) (* C (* A -4.0)))))
   (if (<= B_m 1.46e-102)
     (/
      (- (* t_0 0.0) (* t_0 (sqrt (* -16.0 (* F (* C (* A A)))))))
      (* t_0 t_0))
     (* (sqrt (* F (- A B_m))) (* (sqrt 2.0) (/ -1.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 = (B_m * B_m) + (C * (A * -4.0));
	double tmp;
	if (B_m <= 1.46e-102) {
		tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
	} else {
		tmp = sqrt((F * (A - B_m))) * (sqrt(2.0) * (-1.0 / 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) :: t_0
    real(8) :: tmp
    t_0 = (b_m * b_m) + (c * (a * (-4.0d0)))
    if (b_m <= 1.46d-102) then
        tmp = ((t_0 * 0.0d0) - (t_0 * sqrt(((-16.0d0) * (f * (c * (a * a))))))) / (t_0 * t_0)
    else
        tmp = sqrt((f * (a - b_m))) * (sqrt(2.0d0) * ((-1.0d0) / 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 t_0 = (B_m * B_m) + (C * (A * -4.0));
	double tmp;
	if (B_m <= 1.46e-102) {
		tmp = ((t_0 * 0.0) - (t_0 * Math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
	} else {
		tmp = Math.sqrt((F * (A - B_m))) * (Math.sqrt(2.0) * (-1.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 = (B_m * B_m) + (C * (A * -4.0))
	tmp = 0
	if B_m <= 1.46e-102:
		tmp = ((t_0 * 0.0) - (t_0 * math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0)
	else:
		tmp = math.sqrt((F * (A - B_m))) * (math.sqrt(2.0) * (-1.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(Float64(B_m * B_m) + Float64(C * Float64(A * -4.0)))
	tmp = 0.0
	if (B_m <= 1.46e-102)
		tmp = Float64(Float64(Float64(t_0 * 0.0) - Float64(t_0 * sqrt(Float64(-16.0 * Float64(F * Float64(C * Float64(A * A))))))) / Float64(t_0 * t_0));
	else
		tmp = Float64(sqrt(Float64(F * Float64(A - B_m))) * Float64(sqrt(2.0) * Float64(-1.0 / 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 = (B_m * B_m) + (C * (A * -4.0));
	tmp = 0.0;
	if (B_m <= 1.46e-102)
		tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
	else
		tmp = sqrt((F * (A - B_m))) * (sqrt(2.0) * (-1.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[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.46e-102], N[(N[(N[(t$95$0 * 0.0), $MachinePrecision] - N[(t$95$0 * N[Sqrt[N[(-16.0 * N[(F * N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F * N[(A - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * N[(-1.0 / 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 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\
\mathbf{if}\;B\_m \leq 1.46 \cdot 10^{-102}:\\
\;\;\;\;\frac{t\_0 \cdot 0 - t\_0 \cdot \sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}}{t\_0 \cdot t\_0}\\

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


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

    1. Initial program 21.3%

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

        \[\leadsto \frac{0 - \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)}}{\color{blue}{{B}^{2}} - \left(4 \cdot A\right) \cdot C} \]
      2. div-subN/A

        \[\leadsto \frac{0}{{B}^{2} - \left(4 \cdot A\right) \cdot C} - \color{blue}{\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}} \]
      3. frac-subN/A

        \[\leadsto \frac{0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}}{\color{blue}{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}\right), \color{blue}{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}\right) \]
    4. Applied egg-rr16.4%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\color{blue}{A}, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left({A}^{2} \cdot C\right) \cdot F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\left({A}^{2} \cdot C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({A}^{2}\right), C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(A \cdot A\right), C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f648.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    7. Simplified8.0%

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

    if 1.4599999999999999e-102 < B

    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. Add Preprocessing
    3. Taylor expanded in C around 0

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
      4. mul-1-negN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \left(-1 \cdot \color{blue}{\frac{\sqrt{2}}{B}}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(\color{blue}{-1} \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{B}^{2} + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      12. accelerator-lowering-hypot.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\frac{\sqrt{2}}{B}\right)}\right)\right) \]
    5. Simplified38.2%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{-1 \cdot \sqrt{2}}{\color{blue}{B}}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{\sqrt{2} \cdot -1}{B}\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \color{blue}{\frac{-1}{B}}\right)\right) \]
      4. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{\mathsf{neg}\left(-1\right)}{\color{blue}{\mathsf{neg}\left(B\right)}}\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{1}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\sqrt{2}\right), \color{blue}{\left(\frac{1}{\mathsf{neg}\left(B\right)}\right)}\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\color{blue}{1}}{\mathsf{neg}\left(B\right)}\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right)\right) \]
      9. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{-1}{\color{blue}{B}}\right)\right)\right) \]
      10. /-lowering-/.f6438.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \mathsf{/.f64}\left(-1, \color{blue}{B}\right)\right)\right) \]
    7. Applied egg-rr38.2%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-1 \cdot \left(B \cdot F\right) + A \cdot F\right)}\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \mathsf{/.f64}\left(-1, B\right)\right)\right) \]
    9. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(A \cdot F + -1 \cdot \left(B \cdot F\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{2}\right), \mathsf{/.f64}\left(-1, B\right)\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(A \cdot F + \left(-1 \cdot B\right) \cdot F\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \mathsf{/.f64}\left(-1, B\right)\right)\right) \]
      3. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(A \cdot F + \left(\mathsf{neg}\left(B\right)\right) \cdot F\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \mathsf{/.f64}\left(-1, B\right)\right)\right) \]
      4. distribute-rgt-outN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot \left(A + \left(\mathsf{neg}\left(B\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{2}\right), \mathsf{/.f64}\left(-1, B\right)\right)\right) \]
      5. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot \left(A - B\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \mathsf{/.f64}\left(-1, B\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(A - B\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{2}\right), \mathsf{/.f64}\left(-1, B\right)\right)\right) \]
      7. --lowering--.f6433.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, B\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \mathsf{/.f64}\left(-1, B\right)\right)\right) \]
    10. Simplified33.8%

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

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

Alternative 10: 32.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} t_0 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\ \mathbf{if}\;B\_m \leq 1.95 \cdot 10^{-102}:\\ \;\;\;\;\frac{t\_0 \cdot 0 - t\_0 \cdot \sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}}{t\_0 \cdot t\_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A - B\_m\right)} \cdot \frac{0 - \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 (+ (* B_m B_m) (* C (* A -4.0)))))
   (if (<= B_m 1.95e-102)
     (/
      (- (* t_0 0.0) (* t_0 (sqrt (* -16.0 (* F (* C (* A A)))))))
      (* t_0 t_0))
     (* (sqrt (* F (- A B_m))) (/ (- 0.0 (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 = (B_m * B_m) + (C * (A * -4.0));
	double tmp;
	if (B_m <= 1.95e-102) {
		tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
	} else {
		tmp = sqrt((F * (A - B_m))) * ((0.0 - sqrt(2.0)) / 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) :: t_0
    real(8) :: tmp
    t_0 = (b_m * b_m) + (c * (a * (-4.0d0)))
    if (b_m <= 1.95d-102) then
        tmp = ((t_0 * 0.0d0) - (t_0 * sqrt(((-16.0d0) * (f * (c * (a * a))))))) / (t_0 * t_0)
    else
        tmp = sqrt((f * (a - b_m))) * ((0.0d0 - sqrt(2.0d0)) / 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 t_0 = (B_m * B_m) + (C * (A * -4.0));
	double tmp;
	if (B_m <= 1.95e-102) {
		tmp = ((t_0 * 0.0) - (t_0 * Math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
	} else {
		tmp = Math.sqrt((F * (A - B_m))) * ((0.0 - 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 = (B_m * B_m) + (C * (A * -4.0))
	tmp = 0
	if B_m <= 1.95e-102:
		tmp = ((t_0 * 0.0) - (t_0 * math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0)
	else:
		tmp = math.sqrt((F * (A - B_m))) * ((0.0 - 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(Float64(B_m * B_m) + Float64(C * Float64(A * -4.0)))
	tmp = 0.0
	if (B_m <= 1.95e-102)
		tmp = Float64(Float64(Float64(t_0 * 0.0) - Float64(t_0 * sqrt(Float64(-16.0 * Float64(F * Float64(C * Float64(A * A))))))) / Float64(t_0 * t_0));
	else
		tmp = Float64(sqrt(Float64(F * Float64(A - B_m))) * Float64(Float64(0.0 - sqrt(2.0)) / 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 = (B_m * B_m) + (C * (A * -4.0));
	tmp = 0.0;
	if (B_m <= 1.95e-102)
		tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
	else
		tmp = sqrt((F * (A - B_m))) * ((0.0 - 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[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 1.95e-102], N[(N[(N[(t$95$0 * 0.0), $MachinePrecision] - N[(t$95$0 * N[Sqrt[N[(-16.0 * N[(F * N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F * N[(A - B$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $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 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\
\mathbf{if}\;B\_m \leq 1.95 \cdot 10^{-102}:\\
\;\;\;\;\frac{t\_0 \cdot 0 - t\_0 \cdot \sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}}{t\_0 \cdot t\_0}\\

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


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

    1. Initial program 21.3%

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

        \[\leadsto \frac{0 - \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)}}{\color{blue}{{B}^{2}} - \left(4 \cdot A\right) \cdot C} \]
      2. div-subN/A

        \[\leadsto \frac{0}{{B}^{2} - \left(4 \cdot A\right) \cdot C} - \color{blue}{\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}} \]
      3. frac-subN/A

        \[\leadsto \frac{0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}}{\color{blue}{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}\right), \color{blue}{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}\right) \]
    4. Applied egg-rr16.4%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\color{blue}{A}, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left({A}^{2} \cdot C\right) \cdot F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\left({A}^{2} \cdot C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({A}^{2}\right), C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(A \cdot A\right), C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f648.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    7. Simplified8.0%

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

    if 1.95e-102 < B

    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. Add Preprocessing
    3. Taylor expanded in C around 0

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
      4. mul-1-negN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \left(-1 \cdot \color{blue}{\frac{\sqrt{2}}{B}}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(\color{blue}{-1} \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{B}^{2} + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      12. accelerator-lowering-hypot.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\frac{\sqrt{2}}{B}\right)}\right)\right) \]
    5. Simplified38.2%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\left(A - B\right)}\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right)\right) \]
    7. Step-by-step derivation
      1. --lowering--.f6433.8%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, B\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right)\right) \]
    8. Simplified33.8%

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

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

Alternative 11: 32.1% 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} t_0 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\ \mathbf{if}\;B\_m \leq 4 \cdot 10^{-102}:\\ \;\;\;\;\frac{t\_0 \cdot 0 - t\_0 \cdot \sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}}{t\_0 \cdot t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{0 - \sqrt{2}}{B\_m} \cdot \sqrt{B\_m \cdot \left(0 - F\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
 (let* ((t_0 (+ (* B_m B_m) (* C (* A -4.0)))))
   (if (<= B_m 4e-102)
     (/
      (- (* t_0 0.0) (* t_0 (sqrt (* -16.0 (* F (* C (* A A)))))))
      (* t_0 t_0))
     (* (/ (- 0.0 (sqrt 2.0)) B_m) (sqrt (* B_m (- 0.0 F)))))))
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 = (B_m * B_m) + (C * (A * -4.0));
	double tmp;
	if (B_m <= 4e-102) {
		tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
	} else {
		tmp = ((0.0 - sqrt(2.0)) / B_m) * sqrt((B_m * (0.0 - F)));
	}
	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) :: t_0
    real(8) :: tmp
    t_0 = (b_m * b_m) + (c * (a * (-4.0d0)))
    if (b_m <= 4d-102) then
        tmp = ((t_0 * 0.0d0) - (t_0 * sqrt(((-16.0d0) * (f * (c * (a * a))))))) / (t_0 * t_0)
    else
        tmp = ((0.0d0 - sqrt(2.0d0)) / b_m) * sqrt((b_m * (0.0d0 - f)))
    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 t_0 = (B_m * B_m) + (C * (A * -4.0));
	double tmp;
	if (B_m <= 4e-102) {
		tmp = ((t_0 * 0.0) - (t_0 * Math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
	} else {
		tmp = ((0.0 - Math.sqrt(2.0)) / B_m) * Math.sqrt((B_m * (0.0 - F)));
	}
	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 = (B_m * B_m) + (C * (A * -4.0))
	tmp = 0
	if B_m <= 4e-102:
		tmp = ((t_0 * 0.0) - (t_0 * math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0)
	else:
		tmp = ((0.0 - math.sqrt(2.0)) / B_m) * math.sqrt((B_m * (0.0 - F)))
	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(Float64(B_m * B_m) + Float64(C * Float64(A * -4.0)))
	tmp = 0.0
	if (B_m <= 4e-102)
		tmp = Float64(Float64(Float64(t_0 * 0.0) - Float64(t_0 * sqrt(Float64(-16.0 * Float64(F * Float64(C * Float64(A * A))))))) / Float64(t_0 * t_0));
	else
		tmp = Float64(Float64(Float64(0.0 - sqrt(2.0)) / B_m) * sqrt(Float64(B_m * Float64(0.0 - F))));
	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 = (B_m * B_m) + (C * (A * -4.0));
	tmp = 0.0;
	if (B_m <= 4e-102)
		tmp = ((t_0 * 0.0) - (t_0 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_0 * t_0);
	else
		tmp = ((0.0 - sqrt(2.0)) / B_m) * sqrt((B_m * (0.0 - F)));
	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[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 4e-102], N[(N[(N[(t$95$0 * 0.0), $MachinePrecision] - N[(t$95$0 * N[Sqrt[N[(-16.0 * N[(F * N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / B$95$m), $MachinePrecision] * N[Sqrt[N[(B$95$m * N[(0.0 - F), $MachinePrecision]), $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 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\
\mathbf{if}\;B\_m \leq 4 \cdot 10^{-102}:\\
\;\;\;\;\frac{t\_0 \cdot 0 - t\_0 \cdot \sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}}{t\_0 \cdot t\_0}\\

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


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

    1. Initial program 21.3%

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

        \[\leadsto \frac{0 - \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)}}{\color{blue}{{B}^{2}} - \left(4 \cdot A\right) \cdot C} \]
      2. div-subN/A

        \[\leadsto \frac{0}{{B}^{2} - \left(4 \cdot A\right) \cdot C} - \color{blue}{\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}} \]
      3. frac-subN/A

        \[\leadsto \frac{0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}}{\color{blue}{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}\right), \color{blue}{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}\right) \]
    4. Applied egg-rr16.4%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\color{blue}{A}, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left({A}^{2} \cdot C\right) \cdot F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\left({A}^{2} \cdot C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({A}^{2}\right), C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(A \cdot A\right), C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f648.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    7. Simplified8.0%

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

    if 3.99999999999999973e-102 < B

    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. Add Preprocessing
    3. Taylor expanded in C around 0

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
      4. mul-1-negN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \left(-1 \cdot \color{blue}{\frac{\sqrt{2}}{B}}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(\color{blue}{-1} \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{B}^{2} + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      12. accelerator-lowering-hypot.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\frac{\sqrt{2}}{B}\right)}\right)\right) \]
    5. Simplified38.2%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \color{blue}{\left(-1 \cdot B\right)}\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right)\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(\mathsf{neg}\left(B\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right)\right) \]
      2. neg-lowering-neg.f6434.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{neg.f64}\left(B\right)\right)\right), \mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right)\right) \]
    8. Simplified34.6%

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

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

Alternative 12: 19.5% accurate, 4.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} t_0 := -4 \cdot \left(A \cdot C\right)\\ t_1 := B\_m \cdot B\_m + t\_0\\ t_2 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\ \mathbf{if}\;B\_m \leq 4.2 \cdot 10^{-91}:\\ \;\;\;\;\frac{t\_2 \cdot 0 - t\_2 \cdot \sqrt{\left(A \cdot -8\right) \cdot \left(\left(A + A\right) \cdot \left(C \cdot F\right)\right)}}{t\_2 \cdot t\_2}\\ \mathbf{elif}\;B\_m \leq 2.9 \cdot 10^{+102}:\\ \;\;\;\;\frac{t\_1}{t\_1} \cdot \frac{\sqrt{F \cdot \left(-2 \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{B\_m \cdot \left(0 - B\_m\right) - t\_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{A \cdot F} \cdot \frac{-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 (+ (* B_m B_m) t_0))
        (t_2 (+ (* B_m B_m) (* C (* A -4.0)))))
   (if (<= B_m 4.2e-91)
     (/
      (- (* t_2 0.0) (* t_2 (sqrt (* (* A -8.0) (* (+ A A) (* C F))))))
      (* t_2 t_2))
     (if (<= B_m 2.9e+102)
       (*
        (/ t_1 t_1)
        (/
         (sqrt (* F (* -2.0 (* B_m (* B_m B_m)))))
         (- (* B_m (- 0.0 B_m)) t_0)))
       (* (sqrt (* A F)) (/ -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 = (B_m * B_m) + t_0;
	double t_2 = (B_m * B_m) + (C * (A * -4.0));
	double tmp;
	if (B_m <= 4.2e-91) {
		tmp = ((t_2 * 0.0) - (t_2 * sqrt(((A * -8.0) * ((A + A) * (C * F)))))) / (t_2 * t_2);
	} else if (B_m <= 2.9e+102) {
		tmp = (t_1 / t_1) * (sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0));
	} else {
		tmp = sqrt((A * F)) * (-2.0 / 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) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = (-4.0d0) * (a * c)
    t_1 = (b_m * b_m) + t_0
    t_2 = (b_m * b_m) + (c * (a * (-4.0d0)))
    if (b_m <= 4.2d-91) then
        tmp = ((t_2 * 0.0d0) - (t_2 * sqrt(((a * (-8.0d0)) * ((a + a) * (c * f)))))) / (t_2 * t_2)
    else if (b_m <= 2.9d+102) then
        tmp = (t_1 / t_1) * (sqrt((f * ((-2.0d0) * (b_m * (b_m * b_m))))) / ((b_m * (0.0d0 - b_m)) - t_0))
    else
        tmp = sqrt((a * f)) * ((-2.0d0) / 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 t_0 = -4.0 * (A * C);
	double t_1 = (B_m * B_m) + t_0;
	double t_2 = (B_m * B_m) + (C * (A * -4.0));
	double tmp;
	if (B_m <= 4.2e-91) {
		tmp = ((t_2 * 0.0) - (t_2 * Math.sqrt(((A * -8.0) * ((A + A) * (C * F)))))) / (t_2 * t_2);
	} else if (B_m <= 2.9e+102) {
		tmp = (t_1 / t_1) * (Math.sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0));
	} else {
		tmp = Math.sqrt((A * F)) * (-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)
	t_1 = (B_m * B_m) + t_0
	t_2 = (B_m * B_m) + (C * (A * -4.0))
	tmp = 0
	if B_m <= 4.2e-91:
		tmp = ((t_2 * 0.0) - (t_2 * math.sqrt(((A * -8.0) * ((A + A) * (C * F)))))) / (t_2 * t_2)
	elif B_m <= 2.9e+102:
		tmp = (t_1 / t_1) * (math.sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0))
	else:
		tmp = math.sqrt((A * F)) * (-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 = Float64(Float64(B_m * B_m) + t_0)
	t_2 = Float64(Float64(B_m * B_m) + Float64(C * Float64(A * -4.0)))
	tmp = 0.0
	if (B_m <= 4.2e-91)
		tmp = Float64(Float64(Float64(t_2 * 0.0) - Float64(t_2 * sqrt(Float64(Float64(A * -8.0) * Float64(Float64(A + A) * Float64(C * F)))))) / Float64(t_2 * t_2));
	elseif (B_m <= 2.9e+102)
		tmp = Float64(Float64(t_1 / t_1) * Float64(sqrt(Float64(F * Float64(-2.0 * Float64(B_m * Float64(B_m * B_m))))) / Float64(Float64(B_m * Float64(0.0 - B_m)) - t_0)));
	else
		tmp = Float64(sqrt(Float64(A * F)) * Float64(-2.0 / 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);
	t_1 = (B_m * B_m) + t_0;
	t_2 = (B_m * B_m) + (C * (A * -4.0));
	tmp = 0.0;
	if (B_m <= 4.2e-91)
		tmp = ((t_2 * 0.0) - (t_2 * sqrt(((A * -8.0) * ((A + A) * (C * F)))))) / (t_2 * t_2);
	elseif (B_m <= 2.9e+102)
		tmp = (t_1 / t_1) * (sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0));
	else
		tmp = sqrt((A * F)) * (-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]}, Block[{t$95$1 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 4.2e-91], N[(N[(N[(t$95$2 * 0.0), $MachinePrecision] - N[(t$95$2 * N[Sqrt[N[(N[(A * -8.0), $MachinePrecision] * N[(N[(A + A), $MachinePrecision] * N[(C * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$2 * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 2.9e+102], N[(N[(t$95$1 / t$95$1), $MachinePrecision] * N[(N[Sqrt[N[(F * N[(-2.0 * N[(B$95$m * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(B$95$m * N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * N[(-2.0 / 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 := B\_m \cdot B\_m + t\_0\\
t_2 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\
\mathbf{if}\;B\_m \leq 4.2 \cdot 10^{-91}:\\
\;\;\;\;\frac{t\_2 \cdot 0 - t\_2 \cdot \sqrt{\left(A \cdot -8\right) \cdot \left(\left(A + A\right) \cdot \left(C \cdot F\right)\right)}}{t\_2 \cdot t\_2}\\

\mathbf{elif}\;B\_m \leq 2.9 \cdot 10^{+102}:\\
\;\;\;\;\frac{t\_1}{t\_1} \cdot \frac{\sqrt{F \cdot \left(-2 \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{B\_m \cdot \left(0 - B\_m\right) - t\_0}\\

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


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

    1. Initial program 21.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. Add Preprocessing
    3. Step-by-step derivation
      1. neg-sub0N/A

        \[\leadsto \frac{0 - \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)}}{\color{blue}{{B}^{2}} - \left(4 \cdot A\right) \cdot C} \]
      2. div-subN/A

        \[\leadsto \frac{0}{{B}^{2} - \left(4 \cdot A\right) \cdot C} - \color{blue}{\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}} \]
      3. frac-subN/A

        \[\leadsto \frac{0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}}{\color{blue}{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}\right), \color{blue}{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}\right) \]
    4. Applied egg-rr16.5%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\left(-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right)}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\left(\left(-8 \cdot A\right) \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\color{blue}{A}, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(-8 \cdot A\right), \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\color{blue}{A}, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \left(\left(C \cdot F\right) \cdot \left(A - -1 \cdot A\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(\left(C \cdot F\right), \left(A - -1 \cdot A\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), \left(A - -1 \cdot A\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      7. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), \left(A + \left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      8. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), \mathsf{+.f64}\left(A, \left(\left(\mathsf{neg}\left(-1\right)\right) \cdot A\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), \mathsf{+.f64}\left(A, \left(1 \cdot A\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      10. *-lowering-*.f649.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(C, F\right), \mathsf{+.f64}\left(A, \mathsf{*.f64}\left(1, A\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    7. Simplified9.6%

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

    if 4.1999999999999998e-91 < B < 2.9000000000000002e102

    1. Initial program 31.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. Add Preprocessing
    3. Step-by-step derivation
      1. neg-sub0N/A

        \[\leadsto \frac{0 - \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)}}{\color{blue}{{B}^{2}} - \left(4 \cdot A\right) \cdot C} \]
      2. div-subN/A

        \[\leadsto \frac{0}{{B}^{2} - \left(4 \cdot A\right) \cdot C} - \color{blue}{\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}} \]
      3. frac-subN/A

        \[\leadsto \frac{0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}}{\color{blue}{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}\right), \color{blue}{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}\right) \]
    4. Applied egg-rr28.7%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\left(-2 \cdot \left({B}^{3} \cdot F\right)\right)}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \left({B}^{3} \cdot F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\color{blue}{A}, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left({B}^{3}\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      3. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left(B \cdot \left(B \cdot B\right)\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left(B \cdot {B}^{2}\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \left({B}^{2}\right)\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \left(B \cdot B\right)\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f6418.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, B\right)\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    7. Simplified18.0%

      \[\leadsto \frac{0 \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) - \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) \cdot \sqrt{\color{blue}{-2 \cdot \left(\left(B \cdot \left(B \cdot B\right)\right) \cdot F\right)}}}{\left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)} \]
    8. Step-by-step derivation
      1. mul0-lftN/A

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

        \[\leadsto \frac{\mathsf{neg}\left(\left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) \cdot \sqrt{-2 \cdot \left(\left(B \cdot \left(B \cdot B\right)\right) \cdot F\right)}\right)}{\color{blue}{\left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)} \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)} \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \frac{\left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) \cdot \left(\mathsf{neg}\left(\sqrt{-2 \cdot \left(\left(B \cdot \left(B \cdot B\right)\right) \cdot F\right)}\right)\right)}{\color{blue}{\left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)} \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)} \]
      4. times-fracN/A

        \[\leadsto \frac{B \cdot B + C \cdot \left(A \cdot -4\right)}{B \cdot B + C \cdot \left(A \cdot -4\right)} \cdot \color{blue}{\frac{\mathsf{neg}\left(\sqrt{-2 \cdot \left(\left(B \cdot \left(B \cdot B\right)\right) \cdot F\right)}\right)}{B \cdot B + C \cdot \left(A \cdot -4\right)}} \]
      5. *-lowering-*.f64N/A

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

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

    if 2.9000000000000002e102 < B

    1. Initial program 5.4%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
      4. mul-1-negN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \left(-1 \cdot \color{blue}{\frac{\sqrt{2}}{B}}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(\color{blue}{-1} \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{B}^{2} + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      12. accelerator-lowering-hypot.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\frac{\sqrt{2}}{B}\right)}\right)\right) \]
    5. Simplified37.2%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{-1 \cdot \sqrt{2}}{\color{blue}{B}}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{\sqrt{2} \cdot -1}{B}\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \color{blue}{\frac{-1}{B}}\right)\right) \]
      4. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{\mathsf{neg}\left(-1\right)}{\color{blue}{\mathsf{neg}\left(B\right)}}\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{1}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\sqrt{2}\right), \color{blue}{\left(\frac{1}{\mathsf{neg}\left(B\right)}\right)}\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\color{blue}{1}}{\mathsf{neg}\left(B\right)}\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right)\right) \]
      9. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{-1}{\color{blue}{B}}\right)\right)\right) \]
      10. /-lowering-/.f6437.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \mathsf{/.f64}\left(-1, \color{blue}{B}\right)\right)\right) \]
    7. Applied egg-rr37.2%

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

      \[\leadsto \color{blue}{\sqrt{A \cdot F} \cdot \frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B}} \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{A \cdot F}\right), \color{blue}{\left(\frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(A \cdot F\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}}{B}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot A\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot \left(\sqrt{2} \cdot \sqrt{2}\right)}{B}\right)\right) \]
      7. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-1 \cdot \left(\sqrt{2} \cdot \sqrt{2}\right)}{B}\right)\right) \]
      8. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-1 \cdot 2}{B}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-2}{B}\right)\right) \]
      10. /-lowering-/.f642.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \mathsf{/.f64}\left(-2, \color{blue}{B}\right)\right) \]
    10. Simplified2.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 4.2 \cdot 10^{-91}:\\ \;\;\;\;\frac{\left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) \cdot 0 - \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) \cdot \sqrt{\left(A \cdot -8\right) \cdot \left(\left(A + A\right) \cdot \left(C \cdot F\right)\right)}}{\left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)}\\ \mathbf{elif}\;B \leq 2.9 \cdot 10^{+102}:\\ \;\;\;\;\frac{B \cdot B + -4 \cdot \left(A \cdot C\right)}{B \cdot B + -4 \cdot \left(A \cdot C\right)} \cdot \frac{\sqrt{F \cdot \left(-2 \cdot \left(B \cdot \left(B \cdot B\right)\right)\right)}}{B \cdot \left(0 - B\right) - -4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{A \cdot F} \cdot \frac{-2}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 18.1% accurate, 4.1× 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 := B\_m \cdot B\_m + t\_0\\ t_2 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\ \mathbf{if}\;B\_m \leq 4.2 \cdot 10^{-103}:\\ \;\;\;\;\frac{t\_2 \cdot 0 - t\_2 \cdot \sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}}{t\_2 \cdot t\_2}\\ \mathbf{elif}\;B\_m \leq 4.2 \cdot 10^{+102}:\\ \;\;\;\;\frac{t\_1}{t\_1} \cdot \frac{\sqrt{F \cdot \left(-2 \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{B\_m \cdot \left(0 - B\_m\right) - t\_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{A \cdot F} \cdot \frac{-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 (+ (* B_m B_m) t_0))
        (t_2 (+ (* B_m B_m) (* C (* A -4.0)))))
   (if (<= B_m 4.2e-103)
     (/
      (- (* t_2 0.0) (* t_2 (sqrt (* -16.0 (* F (* C (* A A)))))))
      (* t_2 t_2))
     (if (<= B_m 4.2e+102)
       (*
        (/ t_1 t_1)
        (/
         (sqrt (* F (* -2.0 (* B_m (* B_m B_m)))))
         (- (* B_m (- 0.0 B_m)) t_0)))
       (* (sqrt (* A F)) (/ -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 = (B_m * B_m) + t_0;
	double t_2 = (B_m * B_m) + (C * (A * -4.0));
	double tmp;
	if (B_m <= 4.2e-103) {
		tmp = ((t_2 * 0.0) - (t_2 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_2 * t_2);
	} else if (B_m <= 4.2e+102) {
		tmp = (t_1 / t_1) * (sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0));
	} else {
		tmp = sqrt((A * F)) * (-2.0 / 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) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = (-4.0d0) * (a * c)
    t_1 = (b_m * b_m) + t_0
    t_2 = (b_m * b_m) + (c * (a * (-4.0d0)))
    if (b_m <= 4.2d-103) then
        tmp = ((t_2 * 0.0d0) - (t_2 * sqrt(((-16.0d0) * (f * (c * (a * a))))))) / (t_2 * t_2)
    else if (b_m <= 4.2d+102) then
        tmp = (t_1 / t_1) * (sqrt((f * ((-2.0d0) * (b_m * (b_m * b_m))))) / ((b_m * (0.0d0 - b_m)) - t_0))
    else
        tmp = sqrt((a * f)) * ((-2.0d0) / 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 t_0 = -4.0 * (A * C);
	double t_1 = (B_m * B_m) + t_0;
	double t_2 = (B_m * B_m) + (C * (A * -4.0));
	double tmp;
	if (B_m <= 4.2e-103) {
		tmp = ((t_2 * 0.0) - (t_2 * Math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_2 * t_2);
	} else if (B_m <= 4.2e+102) {
		tmp = (t_1 / t_1) * (Math.sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0));
	} else {
		tmp = Math.sqrt((A * F)) * (-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)
	t_1 = (B_m * B_m) + t_0
	t_2 = (B_m * B_m) + (C * (A * -4.0))
	tmp = 0
	if B_m <= 4.2e-103:
		tmp = ((t_2 * 0.0) - (t_2 * math.sqrt((-16.0 * (F * (C * (A * A))))))) / (t_2 * t_2)
	elif B_m <= 4.2e+102:
		tmp = (t_1 / t_1) * (math.sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0))
	else:
		tmp = math.sqrt((A * F)) * (-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 = Float64(Float64(B_m * B_m) + t_0)
	t_2 = Float64(Float64(B_m * B_m) + Float64(C * Float64(A * -4.0)))
	tmp = 0.0
	if (B_m <= 4.2e-103)
		tmp = Float64(Float64(Float64(t_2 * 0.0) - Float64(t_2 * sqrt(Float64(-16.0 * Float64(F * Float64(C * Float64(A * A))))))) / Float64(t_2 * t_2));
	elseif (B_m <= 4.2e+102)
		tmp = Float64(Float64(t_1 / t_1) * Float64(sqrt(Float64(F * Float64(-2.0 * Float64(B_m * Float64(B_m * B_m))))) / Float64(Float64(B_m * Float64(0.0 - B_m)) - t_0)));
	else
		tmp = Float64(sqrt(Float64(A * F)) * Float64(-2.0 / 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);
	t_1 = (B_m * B_m) + t_0;
	t_2 = (B_m * B_m) + (C * (A * -4.0));
	tmp = 0.0;
	if (B_m <= 4.2e-103)
		tmp = ((t_2 * 0.0) - (t_2 * sqrt((-16.0 * (F * (C * (A * A))))))) / (t_2 * t_2);
	elseif (B_m <= 4.2e+102)
		tmp = (t_1 / t_1) * (sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0));
	else
		tmp = sqrt((A * F)) * (-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]}, Block[{t$95$1 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(C * N[(A * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 4.2e-103], N[(N[(N[(t$95$2 * 0.0), $MachinePrecision] - N[(t$95$2 * N[Sqrt[N[(-16.0 * N[(F * N[(C * N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$2 * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 4.2e+102], N[(N[(t$95$1 / t$95$1), $MachinePrecision] * N[(N[Sqrt[N[(F * N[(-2.0 * N[(B$95$m * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(B$95$m * N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * N[(-2.0 / 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 := B\_m \cdot B\_m + t\_0\\
t_2 := B\_m \cdot B\_m + C \cdot \left(A \cdot -4\right)\\
\mathbf{if}\;B\_m \leq 4.2 \cdot 10^{-103}:\\
\;\;\;\;\frac{t\_2 \cdot 0 - t\_2 \cdot \sqrt{-16 \cdot \left(F \cdot \left(C \cdot \left(A \cdot A\right)\right)\right)}}{t\_2 \cdot t\_2}\\

\mathbf{elif}\;B\_m \leq 4.2 \cdot 10^{+102}:\\
\;\;\;\;\frac{t\_1}{t\_1} \cdot \frac{\sqrt{F \cdot \left(-2 \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{B\_m \cdot \left(0 - B\_m\right) - t\_0}\\

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


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

    1. Initial program 21.3%

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

        \[\leadsto \frac{0 - \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)}}{\color{blue}{{B}^{2}} - \left(4 \cdot A\right) \cdot C} \]
      2. div-subN/A

        \[\leadsto \frac{0}{{B}^{2} - \left(4 \cdot A\right) \cdot C} - \color{blue}{\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}} \]
      3. frac-subN/A

        \[\leadsto \frac{0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}}{\color{blue}{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}\right), \color{blue}{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}\right) \]
    4. Applied egg-rr16.4%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\left(-16 \cdot \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left({A}^{2} \cdot \left(C \cdot F\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\color{blue}{A}, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \left(\left({A}^{2} \cdot C\right) \cdot F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\left({A}^{2} \cdot C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left({A}^{2}\right), C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(A \cdot A\right), C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      6. *-lowering-*.f648.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), C\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    7. Simplified8.0%

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

    if 4.20000000000000009e-103 < B < 4.20000000000000003e102

    1. Initial program 30.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. Add Preprocessing
    3. Step-by-step derivation
      1. neg-sub0N/A

        \[\leadsto \frac{0 - \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)}}{\color{blue}{{B}^{2}} - \left(4 \cdot A\right) \cdot C} \]
      2. div-subN/A

        \[\leadsto \frac{0}{{B}^{2} - \left(4 \cdot A\right) \cdot C} - \color{blue}{\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}} \]
      3. frac-subN/A

        \[\leadsto \frac{0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}}{\color{blue}{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}\right), \color{blue}{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}\right) \]
    4. Applied egg-rr27.8%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\left(-2 \cdot \left({B}^{3} \cdot F\right)\right)}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \left({B}^{3} \cdot F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\color{blue}{A}, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left({B}^{3}\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      3. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left(B \cdot \left(B \cdot B\right)\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left(B \cdot {B}^{2}\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \left({B}^{2}\right)\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \left(B \cdot B\right)\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f6416.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, B\right)\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    7. Simplified16.1%

      \[\leadsto \frac{0 \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) - \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) \cdot \sqrt{\color{blue}{-2 \cdot \left(\left(B \cdot \left(B \cdot B\right)\right) \cdot F\right)}}}{\left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)} \]
    8. Step-by-step derivation
      1. mul0-lftN/A

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

        \[\leadsto \frac{\mathsf{neg}\left(\left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) \cdot \sqrt{-2 \cdot \left(\left(B \cdot \left(B \cdot B\right)\right) \cdot F\right)}\right)}{\color{blue}{\left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)} \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)} \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \frac{\left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) \cdot \left(\mathsf{neg}\left(\sqrt{-2 \cdot \left(\left(B \cdot \left(B \cdot B\right)\right) \cdot F\right)}\right)\right)}{\color{blue}{\left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)} \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)} \]
      4. times-fracN/A

        \[\leadsto \frac{B \cdot B + C \cdot \left(A \cdot -4\right)}{B \cdot B + C \cdot \left(A \cdot -4\right)} \cdot \color{blue}{\frac{\mathsf{neg}\left(\sqrt{-2 \cdot \left(\left(B \cdot \left(B \cdot B\right)\right) \cdot F\right)}\right)}{B \cdot B + C \cdot \left(A \cdot -4\right)}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{B \cdot B + C \cdot \left(A \cdot -4\right)}{B \cdot B + C \cdot \left(A \cdot -4\right)}\right), \color{blue}{\left(\frac{\mathsf{neg}\left(\sqrt{-2 \cdot \left(\left(B \cdot \left(B \cdot B\right)\right) \cdot F\right)}\right)}{B \cdot B + C \cdot \left(A \cdot -4\right)}\right)}\right) \]
    9. Applied egg-rr25.1%

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

    if 4.20000000000000003e102 < B

    1. Initial program 5.4%

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

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
      4. mul-1-negN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \left(-1 \cdot \color{blue}{\frac{\sqrt{2}}{B}}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(\color{blue}{-1} \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{B}^{2} + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      12. accelerator-lowering-hypot.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\frac{\sqrt{2}}{B}\right)}\right)\right) \]
    5. Simplified37.2%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{-1 \cdot \sqrt{2}}{\color{blue}{B}}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{\sqrt{2} \cdot -1}{B}\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \color{blue}{\frac{-1}{B}}\right)\right) \]
      4. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{\mathsf{neg}\left(-1\right)}{\color{blue}{\mathsf{neg}\left(B\right)}}\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{1}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\sqrt{2}\right), \color{blue}{\left(\frac{1}{\mathsf{neg}\left(B\right)}\right)}\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\color{blue}{1}}{\mathsf{neg}\left(B\right)}\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right)\right) \]
      9. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{-1}{\color{blue}{B}}\right)\right)\right) \]
      10. /-lowering-/.f6437.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \mathsf{/.f64}\left(-1, \color{blue}{B}\right)\right)\right) \]
    7. Applied egg-rr37.2%

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

      \[\leadsto \color{blue}{\sqrt{A \cdot F} \cdot \frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B}} \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{A \cdot F}\right), \color{blue}{\left(\frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(A \cdot F\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}}{B}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot A\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot \left(\sqrt{2} \cdot \sqrt{2}\right)}{B}\right)\right) \]
      7. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-1 \cdot \left(\sqrt{2} \cdot \sqrt{2}\right)}{B}\right)\right) \]
      8. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-1 \cdot 2}{B}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-2}{B}\right)\right) \]
      10. /-lowering-/.f642.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \mathsf{/.f64}\left(-2, \color{blue}{B}\right)\right) \]
    10. Simplified2.1%

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

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

Alternative 14: 13.7% accurate, 4.3× 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 := B\_m \cdot B\_m + t\_0\\ \mathbf{if}\;A \leq -3.9 \cdot 10^{+33}:\\ \;\;\;\;\sqrt{A \cdot F} \cdot \frac{-2}{B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_1}{t\_1} \cdot \frac{\sqrt{F \cdot \left(-2 \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{B\_m \cdot \left(0 - B\_m\right) - t\_0}\\ \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 (+ (* B_m B_m) t_0)))
   (if (<= A -3.9e+33)
     (* (sqrt (* A F)) (/ -2.0 B_m))
     (*
      (/ t_1 t_1)
      (/
       (sqrt (* F (* -2.0 (* B_m (* B_m B_m)))))
       (- (* B_m (- 0.0 B_m)) t_0))))))
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 = (B_m * B_m) + t_0;
	double tmp;
	if (A <= -3.9e+33) {
		tmp = sqrt((A * F)) * (-2.0 / B_m);
	} else {
		tmp = (t_1 / t_1) * (sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0));
	}
	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) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (-4.0d0) * (a * c)
    t_1 = (b_m * b_m) + t_0
    if (a <= (-3.9d+33)) then
        tmp = sqrt((a * f)) * ((-2.0d0) / b_m)
    else
        tmp = (t_1 / t_1) * (sqrt((f * ((-2.0d0) * (b_m * (b_m * b_m))))) / ((b_m * (0.0d0 - b_m)) - t_0))
    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 t_0 = -4.0 * (A * C);
	double t_1 = (B_m * B_m) + t_0;
	double tmp;
	if (A <= -3.9e+33) {
		tmp = Math.sqrt((A * F)) * (-2.0 / B_m);
	} else {
		tmp = (t_1 / t_1) * (Math.sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0));
	}
	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)
	t_1 = (B_m * B_m) + t_0
	tmp = 0
	if A <= -3.9e+33:
		tmp = math.sqrt((A * F)) * (-2.0 / B_m)
	else:
		tmp = (t_1 / t_1) * (math.sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0))
	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 = Float64(Float64(B_m * B_m) + t_0)
	tmp = 0.0
	if (A <= -3.9e+33)
		tmp = Float64(sqrt(Float64(A * F)) * Float64(-2.0 / B_m));
	else
		tmp = Float64(Float64(t_1 / t_1) * Float64(sqrt(Float64(F * Float64(-2.0 * Float64(B_m * Float64(B_m * B_m))))) / Float64(Float64(B_m * Float64(0.0 - B_m)) - t_0)));
	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);
	t_1 = (B_m * B_m) + t_0;
	tmp = 0.0;
	if (A <= -3.9e+33)
		tmp = sqrt((A * F)) * (-2.0 / B_m);
	else
		tmp = (t_1 / t_1) * (sqrt((F * (-2.0 * (B_m * (B_m * B_m))))) / ((B_m * (0.0 - B_m)) - t_0));
	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]}, Block[{t$95$1 = N[(N[(B$95$m * B$95$m), $MachinePrecision] + t$95$0), $MachinePrecision]}, If[LessEqual[A, -3.9e+33], N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * N[(-2.0 / B$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 / t$95$1), $MachinePrecision] * N[(N[Sqrt[N[(F * N[(-2.0 * N[(B$95$m * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(B$95$m * N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision] - t$95$0), $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)\\
t_1 := B\_m \cdot B\_m + t\_0\\
\mathbf{if}\;A \leq -3.9 \cdot 10^{+33}:\\
\;\;\;\;\sqrt{A \cdot F} \cdot \frac{-2}{B\_m}\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{t\_1} \cdot \frac{\sqrt{F \cdot \left(-2 \cdot \left(B\_m \cdot \left(B\_m \cdot B\_m\right)\right)\right)}}{B\_m \cdot \left(0 - B\_m\right) - t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -3.9000000000000002e33

    1. Initial program 17.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. Add Preprocessing
    3. Taylor expanded in C around 0

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
      4. mul-1-negN/A

        \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \left(-1 \cdot \color{blue}{\frac{\sqrt{2}}{B}}\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right)}\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(\color{blue}{-1} \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{B}^{2} + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      11. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      12. accelerator-lowering-hypot.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\frac{\sqrt{2}}{B}\right)}\right)\right) \]
    5. Simplified8.2%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{-1 \cdot \sqrt{2}}{\color{blue}{B}}\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{\sqrt{2} \cdot -1}{B}\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \color{blue}{\frac{-1}{B}}\right)\right) \]
      4. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{\mathsf{neg}\left(-1\right)}{\color{blue}{\mathsf{neg}\left(B\right)}}\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{1}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\sqrt{2}\right), \color{blue}{\left(\frac{1}{\mathsf{neg}\left(B\right)}\right)}\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\color{blue}{1}}{\mathsf{neg}\left(B\right)}\right)\right)\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right)\right) \]
      9. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{-1}{\color{blue}{B}}\right)\right)\right) \]
      10. /-lowering-/.f648.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \mathsf{/.f64}\left(-1, \color{blue}{B}\right)\right)\right) \]
    7. Applied egg-rr8.2%

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

      \[\leadsto \color{blue}{\sqrt{A \cdot F} \cdot \frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B}} \]
    9. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{A \cdot F}\right), \color{blue}{\left(\frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)}\right) \]
      2. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(A \cdot F\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}}{B}\right)\right) \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot A\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      5. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot \left(\sqrt{2} \cdot \sqrt{2}\right)}{B}\right)\right) \]
      7. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-1 \cdot \left(\sqrt{2} \cdot \sqrt{2}\right)}{B}\right)\right) \]
      8. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-1 \cdot 2}{B}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-2}{B}\right)\right) \]
      10. /-lowering-/.f648.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \mathsf{/.f64}\left(-2, \color{blue}{B}\right)\right) \]
    10. Simplified8.4%

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

    if -3.9000000000000002e33 < A

    1. Initial program 21.2%

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

        \[\leadsto \frac{0 - \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)}}{\color{blue}{{B}^{2}} - \left(4 \cdot A\right) \cdot C} \]
      2. div-subN/A

        \[\leadsto \frac{0}{{B}^{2} - \left(4 \cdot A\right) \cdot C} - \color{blue}{\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}} \]
      3. frac-subN/A

        \[\leadsto \frac{0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}}{\color{blue}{\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(0 \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) - \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \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)}\right), \color{blue}{\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot \left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}\right) \]
    4. Applied egg-rr14.5%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\color{blue}{\left(-2 \cdot \left({B}^{3} \cdot F\right)\right)}\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \left({B}^{3} \cdot F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(\color{blue}{A}, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left({B}^{3}\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      3. cube-multN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left(B \cdot \left(B \cdot B\right)\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left(B \cdot {B}^{2}\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \left({B}^{2}\right)\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \left(B \cdot B\right)\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
      7. *-lowering-*.f644.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(0, \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, \mathsf{*.f64}\left(B, B\right)\right), F\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(A, -4\right)\right)\right)\right)\right) \]
    7. Simplified4.5%

      \[\leadsto \frac{0 \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) - \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) \cdot \sqrt{\color{blue}{-2 \cdot \left(\left(B \cdot \left(B \cdot B\right)\right) \cdot F\right)}}}{\left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)} \]
    8. Step-by-step derivation
      1. mul0-lftN/A

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

        \[\leadsto \frac{\mathsf{neg}\left(\left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) \cdot \sqrt{-2 \cdot \left(\left(B \cdot \left(B \cdot B\right)\right) \cdot F\right)}\right)}{\color{blue}{\left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)} \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)} \]
      3. distribute-rgt-neg-inN/A

        \[\leadsto \frac{\left(B \cdot B + C \cdot \left(A \cdot -4\right)\right) \cdot \left(\mathsf{neg}\left(\sqrt{-2 \cdot \left(\left(B \cdot \left(B \cdot B\right)\right) \cdot F\right)}\right)\right)}{\color{blue}{\left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)} \cdot \left(B \cdot B + C \cdot \left(A \cdot -4\right)\right)} \]
      4. times-fracN/A

        \[\leadsto \frac{B \cdot B + C \cdot \left(A \cdot -4\right)}{B \cdot B + C \cdot \left(A \cdot -4\right)} \cdot \color{blue}{\frac{\mathsf{neg}\left(\sqrt{-2 \cdot \left(\left(B \cdot \left(B \cdot B\right)\right) \cdot F\right)}\right)}{B \cdot B + C \cdot \left(A \cdot -4\right)}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{B \cdot B + C \cdot \left(A \cdot -4\right)}{B \cdot B + C \cdot \left(A \cdot -4\right)}\right), \color{blue}{\left(\frac{\mathsf{neg}\left(\sqrt{-2 \cdot \left(\left(B \cdot \left(B \cdot B\right)\right) \cdot F\right)}\right)}{B \cdot B + C \cdot \left(A \cdot -4\right)}\right)}\right) \]
    9. Applied egg-rr6.8%

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

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

Alternative 15: 9.2% accurate, 5.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \sqrt{A \cdot F} \cdot \frac{-2}{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 (* A F)) (/ -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) {
	return sqrt((A * F)) * (-2.0 / 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((a * f)) * ((-2.0d0) / 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((A * F)) * (-2.0 / 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((A * F)) * (-2.0 / 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(A * F)) * Float64(-2.0 / 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((A * F)) * (-2.0 / 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[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] * N[(-2.0 / 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{A \cdot F} \cdot \frac{-2}{B\_m}
\end{array}
Derivation
  1. Initial program 20.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. Add Preprocessing
  3. Taylor expanded in C around 0

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

      \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right) \]
    2. *-commutativeN/A

      \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \frac{\sqrt{2}}{B}\right) \]
    3. distribute-rgt-neg-inN/A

      \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right)} \]
    4. mul-1-negN/A

      \[\leadsto \sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)} \cdot \left(-1 \cdot \color{blue}{\frac{\sqrt{2}}{B}}\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)}\right), \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right)}\right) \]
    6. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(\color{blue}{-1} \cdot \frac{\sqrt{2}}{B}\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(A - \sqrt{{A}^{2} + {B}^{2}}\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
    8. --lowering--.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{A}^{2} + {B}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
    9. +-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{{B}^{2} + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
    10. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + {A}^{2}}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
    11. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\sqrt{B \cdot B + A \cdot A}\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
    12. accelerator-lowering-hypot.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(-1 \cdot \frac{\sqrt{2}}{B}\right)\right) \]
    13. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\frac{\sqrt{2}}{B}\right)}\right)\right) \]
  5. Simplified15.2%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{-1 \cdot \sqrt{2}}{\color{blue}{B}}\right)\right) \]
    2. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\frac{\sqrt{2} \cdot -1}{B}\right)\right) \]
    3. associate-/l*N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \color{blue}{\frac{-1}{B}}\right)\right) \]
    4. frac-2negN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{\mathsf{neg}\left(-1\right)}{\color{blue}{\mathsf{neg}\left(B\right)}}\right)\right) \]
    5. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \left(\sqrt{2} \cdot \frac{1}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right) \]
    6. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\sqrt{2}\right), \color{blue}{\left(\frac{1}{\mathsf{neg}\left(B\right)}\right)}\right)\right) \]
    7. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\color{blue}{1}}{\mathsf{neg}\left(B\right)}\right)\right)\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{\mathsf{neg}\left(-1\right)}{\mathsf{neg}\left(\color{blue}{B}\right)}\right)\right)\right) \]
    9. frac-2negN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \left(\frac{-1}{\color{blue}{B}}\right)\right)\right) \]
    10. /-lowering-/.f6415.2%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{hypot.f64}\left(B, A\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(2\right), \mathsf{/.f64}\left(-1, \color{blue}{B}\right)\right)\right) \]
  7. Applied egg-rr15.2%

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

    \[\leadsto \color{blue}{\sqrt{A \cdot F} \cdot \frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B}} \]
  9. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{A \cdot F}\right), \color{blue}{\left(\frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)}\right) \]
    2. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(A \cdot F\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}}{B}\right)\right) \]
    3. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot A\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
    5. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
    6. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot \left(\sqrt{2} \cdot \sqrt{2}\right)}{B}\right)\right) \]
    7. rem-square-sqrtN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-1 \cdot \left(\sqrt{2} \cdot \sqrt{2}\right)}{B}\right)\right) \]
    8. rem-square-sqrtN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-1 \cdot 2}{B}\right)\right) \]
    9. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \left(\frac{-2}{B}\right)\right) \]
    10. /-lowering-/.f642.8%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right), \mathsf{/.f64}\left(-2, \color{blue}{B}\right)\right) \]
  10. Simplified2.8%

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

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

Alternative 16: 1.8% accurate, 6.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ {\left(\frac{2}{\frac{B\_m}{F}}\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 (/ B_m F)) 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 / (B_m / F)), 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 / (b_m / f)) ** 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 / (B_m / F)), 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 / (B_m / F)), 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(2.0 / Float64(B_m / F)) ^ 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 / (B_m / F)) ^ 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[(B$95$m / F), $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(\frac{2}{\frac{B\_m}{F}}\right)}^{0.5}
\end{array}
Derivation
  1. Initial program 20.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. Add Preprocessing
  3. Taylor expanded in B around -inf

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

      \[\leadsto \mathsf{neg}\left(\sqrt{\frac{F}{B}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)\right) \]
    2. neg-sub0N/A

      \[\leadsto 0 - \color{blue}{\sqrt{\frac{F}{B}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)} \]
    3. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\sqrt{\frac{F}{B}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)\right)}\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(\sqrt{\frac{F}{B}}\right), \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)}\right)\right) \]
    5. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{F}{B}\right)\right), \left(\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot \sqrt{2}\right)\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \left({\color{blue}{\left(\sqrt{-1}\right)}}^{2} \cdot \sqrt{2}\right)\right)\right) \]
    7. unpow2N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot \sqrt{\color{blue}{2}}\right)\right)\right) \]
    8. rem-square-sqrtN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \left(-1 \cdot \sqrt{\color{blue}{2}}\right)\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\sqrt{2}\right)}\right)\right)\right) \]
    10. sqrt-lowering-sqrt.f641.9%

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \mathsf{*.f64}\left(-1, \mathsf{sqrt.f64}\left(2\right)\right)\right)\right) \]
  5. Simplified1.9%

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

      \[\leadsto 0 - \left(-1 \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{\frac{F}{B}}} \]
    2. mul-1-negN/A

      \[\leadsto 0 - \left(\mathsf{neg}\left(\sqrt{2}\right)\right) \cdot \sqrt{\color{blue}{\frac{F}{B}}} \]
    3. cancel-sign-subN/A

      \[\leadsto 0 + \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
    4. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(0, \color{blue}{\left(\sqrt{2} \cdot \sqrt{\frac{F}{B}}\right)}\right) \]
    5. sqrt-unprodN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{2 \cdot \frac{F}{B}}\right)\right) \]
    6. rem-square-sqrtN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \frac{F}{B}}\right)\right) \]
    7. sqr-negN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(\mathsf{neg}\left(\sqrt{2}\right)\right) \cdot \left(\mathsf{neg}\left(\sqrt{2}\right)\right)\right) \cdot \frac{F}{B}}\right)\right) \]
    8. mul-1-negN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \left(\mathsf{neg}\left(\sqrt{2}\right)\right)\right) \cdot \frac{F}{B}}\right)\right) \]
    9. mul-1-negN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \frac{F}{B}}\right)\right) \]
    10. rem-square-sqrtN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{\frac{F}{B}}\right)}\right)\right) \]
    11. swap-sqrN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \sqrt{\frac{F}{B}}\right) \cdot \left(\left(-1 \cdot \sqrt{2}\right) \cdot \sqrt{\frac{F}{B}}\right)}\right)\right) \]
    12. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \sqrt{\frac{F}{B}}\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right)}\right)\right) \]
    13. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right)}\right)\right) \]
    14. +-lft-identityN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(0 + \sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right)}\right)\right) \]
    15. +-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right) + 0\right)}\right)\right) \]
    16. distribute-rgt-outN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) + 0 \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right)}\right)\right) \]
  7. Applied egg-rr1.9%

    \[\leadsto \color{blue}{0 + \sqrt{2 \cdot \frac{F}{B}}} \]
  8. Step-by-step derivation
    1. +-lft-identityN/A

      \[\leadsto \sqrt{2 \cdot \frac{F}{B}} \]
    2. pow1/2N/A

      \[\leadsto {\left(2 \cdot \frac{F}{B}\right)}^{\color{blue}{\frac{1}{2}}} \]
    3. metadata-evalN/A

      \[\leadsto {\left(2 \cdot \frac{F}{B}\right)}^{\left(\frac{1}{4} \cdot \color{blue}{2}\right)} \]
    4. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{pow.f64}\left(\left(2 \cdot \frac{F}{B}\right), \color{blue}{\left(\frac{1}{4} \cdot 2\right)}\right) \]
    5. clear-numN/A

      \[\leadsto \mathsf{pow.f64}\left(\left(2 \cdot \frac{1}{\frac{B}{F}}\right), \left(\frac{1}{4} \cdot 2\right)\right) \]
    6. un-div-invN/A

      \[\leadsto \mathsf{pow.f64}\left(\left(\frac{2}{\frac{B}{F}}\right), \left(\color{blue}{\frac{1}{4}} \cdot 2\right)\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(2, \left(\frac{B}{F}\right)\right), \left(\color{blue}{\frac{1}{4}} \cdot 2\right)\right) \]
    8. /-lowering-/.f64N/A

      \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(2, \mathsf{/.f64}\left(B, F\right)\right), \left(\frac{1}{4} \cdot 2\right)\right) \]
    9. metadata-eval2.0%

      \[\leadsto \mathsf{pow.f64}\left(\mathsf{/.f64}\left(2, \mathsf{/.f64}\left(B, F\right)\right), \frac{1}{2}\right) \]
  9. Applied egg-rr2.0%

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

Alternative 17: 1.6% 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}{\frac{B\_m}{F}}} \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 (/ B_m F))))
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 / (B_m / F)));
}
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 / (b_m / f)))
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 / (B_m / F)));
}
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 / (B_m / F)))
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	return sqrt(Float64(2.0 / Float64(B_m / F)))
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 / (B_m / F)));
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[(2.0 / N[(B$95$m / F), $MachinePrecision]), $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}{\frac{B\_m}{F}}}
\end{array}
Derivation
  1. Initial program 20.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. Add Preprocessing
  3. Taylor expanded in B around -inf

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

      \[\leadsto \mathsf{neg}\left(\sqrt{\frac{F}{B}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)\right) \]
    2. neg-sub0N/A

      \[\leadsto 0 - \color{blue}{\sqrt{\frac{F}{B}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)} \]
    3. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\sqrt{\frac{F}{B}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)\right)}\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(\sqrt{\frac{F}{B}}\right), \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)}\right)\right) \]
    5. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{F}{B}\right)\right), \left(\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot \sqrt{2}\right)\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \left({\color{blue}{\left(\sqrt{-1}\right)}}^{2} \cdot \sqrt{2}\right)\right)\right) \]
    7. unpow2N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot \sqrt{\color{blue}{2}}\right)\right)\right) \]
    8. rem-square-sqrtN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \left(-1 \cdot \sqrt{\color{blue}{2}}\right)\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\sqrt{2}\right)}\right)\right)\right) \]
    10. sqrt-lowering-sqrt.f641.9%

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \mathsf{*.f64}\left(-1, \mathsf{sqrt.f64}\left(2\right)\right)\right)\right) \]
  5. Simplified1.9%

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

      \[\leadsto 0 - \left(-1 \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{\frac{F}{B}}} \]
    2. mul-1-negN/A

      \[\leadsto 0 - \left(\mathsf{neg}\left(\sqrt{2}\right)\right) \cdot \sqrt{\color{blue}{\frac{F}{B}}} \]
    3. cancel-sign-subN/A

      \[\leadsto 0 + \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
    4. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(0, \color{blue}{\left(\sqrt{2} \cdot \sqrt{\frac{F}{B}}\right)}\right) \]
    5. sqrt-unprodN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{2 \cdot \frac{F}{B}}\right)\right) \]
    6. rem-square-sqrtN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \frac{F}{B}}\right)\right) \]
    7. sqr-negN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(\mathsf{neg}\left(\sqrt{2}\right)\right) \cdot \left(\mathsf{neg}\left(\sqrt{2}\right)\right)\right) \cdot \frac{F}{B}}\right)\right) \]
    8. mul-1-negN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \left(\mathsf{neg}\left(\sqrt{2}\right)\right)\right) \cdot \frac{F}{B}}\right)\right) \]
    9. mul-1-negN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \frac{F}{B}}\right)\right) \]
    10. rem-square-sqrtN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{\frac{F}{B}}\right)}\right)\right) \]
    11. swap-sqrN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \sqrt{\frac{F}{B}}\right) \cdot \left(\left(-1 \cdot \sqrt{2}\right) \cdot \sqrt{\frac{F}{B}}\right)}\right)\right) \]
    12. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \sqrt{\frac{F}{B}}\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right)}\right)\right) \]
    13. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right)}\right)\right) \]
    14. +-lft-identityN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(0 + \sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right)}\right)\right) \]
    15. +-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right) + 0\right)}\right)\right) \]
    16. distribute-rgt-outN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) + 0 \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right)}\right)\right) \]
  7. Applied egg-rr1.9%

    \[\leadsto \color{blue}{0 + \sqrt{2 \cdot \frac{F}{B}}} \]
  8. Step-by-step derivation
    1. +-lft-identityN/A

      \[\leadsto \sqrt{2 \cdot \frac{F}{B}} \]
    2. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{sqrt.f64}\left(\left(2 \cdot \frac{F}{B}\right)\right) \]
    3. clear-numN/A

      \[\leadsto \mathsf{sqrt.f64}\left(\left(2 \cdot \frac{1}{\frac{B}{F}}\right)\right) \]
    4. un-div-invN/A

      \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{2}{\frac{B}{F}}\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(2, \left(\frac{B}{F}\right)\right)\right) \]
    6. /-lowering-/.f641.9%

      \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(2, \mathsf{/.f64}\left(B, F\right)\right)\right) \]
  9. Applied egg-rr1.9%

    \[\leadsto \color{blue}{\sqrt{\frac{2}{\frac{B}{F}}}} \]
  10. Add Preprocessing

Alternative 18: 1.6% 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{F \cdot \frac{2}{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 (* F (/ 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) {
	return sqrt((F * (2.0 / 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((f * (2.0d0 / 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((F * (2.0 / 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((F * (2.0 / 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 sqrt(Float64(F * Float64(2.0 / 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((F * (2.0 / 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[(F * N[(2.0 / 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])\\
\\
\sqrt{F \cdot \frac{2}{B\_m}}
\end{array}
Derivation
  1. Initial program 20.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. Add Preprocessing
  3. Taylor expanded in B around -inf

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

      \[\leadsto \mathsf{neg}\left(\sqrt{\frac{F}{B}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)\right) \]
    2. neg-sub0N/A

      \[\leadsto 0 - \color{blue}{\sqrt{\frac{F}{B}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)} \]
    3. --lowering--.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(\sqrt{\frac{F}{B}} \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)\right)}\right) \]
    4. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\left(\sqrt{\frac{F}{B}}\right), \color{blue}{\left({\left(\sqrt{-1}\right)}^{2} \cdot \sqrt{2}\right)}\right)\right) \]
    5. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{F}{B}\right)\right), \left(\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot \sqrt{2}\right)\right)\right) \]
    6. /-lowering-/.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \left({\color{blue}{\left(\sqrt{-1}\right)}}^{2} \cdot \sqrt{2}\right)\right)\right) \]
    7. unpow2N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \left(\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot \sqrt{\color{blue}{2}}\right)\right)\right) \]
    8. rem-square-sqrtN/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \left(-1 \cdot \sqrt{\color{blue}{2}}\right)\right)\right) \]
    9. *-lowering-*.f64N/A

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \mathsf{*.f64}\left(-1, \color{blue}{\left(\sqrt{2}\right)}\right)\right)\right) \]
    10. sqrt-lowering-sqrt.f641.9%

      \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(F, B\right)\right), \mathsf{*.f64}\left(-1, \mathsf{sqrt.f64}\left(2\right)\right)\right)\right) \]
  5. Simplified1.9%

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

      \[\leadsto 0 - \left(-1 \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{\frac{F}{B}}} \]
    2. mul-1-negN/A

      \[\leadsto 0 - \left(\mathsf{neg}\left(\sqrt{2}\right)\right) \cdot \sqrt{\color{blue}{\frac{F}{B}}} \]
    3. cancel-sign-subN/A

      \[\leadsto 0 + \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
    4. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(0, \color{blue}{\left(\sqrt{2} \cdot \sqrt{\frac{F}{B}}\right)}\right) \]
    5. sqrt-unprodN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{2 \cdot \frac{F}{B}}\right)\right) \]
    6. rem-square-sqrtN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{2} \cdot \sqrt{2}\right) \cdot \frac{F}{B}}\right)\right) \]
    7. sqr-negN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(\mathsf{neg}\left(\sqrt{2}\right)\right) \cdot \left(\mathsf{neg}\left(\sqrt{2}\right)\right)\right) \cdot \frac{F}{B}}\right)\right) \]
    8. mul-1-negN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \left(\mathsf{neg}\left(\sqrt{2}\right)\right)\right) \cdot \frac{F}{B}}\right)\right) \]
    9. mul-1-negN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \frac{F}{B}}\right)\right) \]
    10. rem-square-sqrtN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{\frac{F}{B}}\right)}\right)\right) \]
    11. swap-sqrN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \sqrt{\frac{F}{B}}\right) \cdot \left(\left(-1 \cdot \sqrt{2}\right) \cdot \sqrt{\frac{F}{B}}\right)}\right)\right) \]
    12. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\left(-1 \cdot \sqrt{2}\right) \cdot \sqrt{\frac{F}{B}}\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right)}\right)\right) \]
    13. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right)}\right)\right) \]
    14. +-lft-identityN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(0 + \sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right)}\right)\right) \]
    15. +-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right) + 0\right)}\right)\right) \]
    16. distribute-rgt-outN/A

      \[\leadsto \mathsf{+.f64}\left(0, \left(\sqrt{\left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right) + 0 \cdot \left(\sqrt{\frac{F}{B}} \cdot \left(-1 \cdot \sqrt{2}\right)\right)}\right)\right) \]
  7. Applied egg-rr1.9%

    \[\leadsto \color{blue}{0 + \sqrt{2 \cdot \frac{F}{B}}} \]
  8. Step-by-step derivation
    1. +-lft-identityN/A

      \[\leadsto \sqrt{2 \cdot \frac{F}{B}} \]
    2. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{sqrt.f64}\left(\left(2 \cdot \frac{F}{B}\right)\right) \]
    3. clear-numN/A

      \[\leadsto \mathsf{sqrt.f64}\left(\left(2 \cdot \frac{1}{\frac{B}{F}}\right)\right) \]
    4. un-div-invN/A

      \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{2}{\frac{B}{F}}\right)\right) \]
    5. /-lowering-/.f64N/A

      \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(2, \left(\frac{B}{F}\right)\right)\right) \]
    6. /-lowering-/.f641.9%

      \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(2, \mathsf{/.f64}\left(B, F\right)\right)\right) \]
  9. Applied egg-rr1.9%

    \[\leadsto \color{blue}{\sqrt{\frac{2}{\frac{B}{F}}}} \]
  10. Step-by-step derivation
    1. associate-/r/N/A

      \[\leadsto \mathsf{sqrt.f64}\left(\left(\frac{2}{B} \cdot F\right)\right) \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\frac{2}{B}\right), F\right)\right) \]
    3. /-lowering-/.f641.9%

      \[\leadsto \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(2, B\right), F\right)\right) \]
  11. Applied egg-rr1.9%

    \[\leadsto \sqrt{\color{blue}{\frac{2}{B} \cdot F}} \]
  12. Final simplification1.9%

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

Reproduce

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