ABCF->ab-angle b

Percentage Accurate: 19.7% → 46.9%
Time: 29.3s
Alternatives: 19
Speedup: 5.8×

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 19 alternatives:

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

Initial Program: 19.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: 46.9% accurate, 0.4× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \left(4 \cdot A\right) \cdot C\\ t_1 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_0 - {B\_m}^{2}}\\ t_2 := \mathsf{hypot}\left(B\_m, A - C\right)\\ t_3 := \left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\sqrt{F \cdot \frac{A + \left(C - t\_2\right)}{B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)}} \cdot \left(0 - \sqrt{2}\right)\\ \mathbf{elif}\;t\_1 \leq \infty:\\ \;\;\;\;\frac{\sqrt{\left(A - t\_2\right) \cdot t\_3 + C \cdot t\_3}}{t\_0 - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B\_m, C\right)\right)\right)} \cdot \frac{-1}{B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* (* 4.0 A) C))
        (t_1
         (/
          (sqrt
           (*
            (* 2.0 (* (- (pow B_m 2.0) t_0) F))
            (- (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))))))
          (- t_0 (pow B_m 2.0))))
        (t_2 (hypot B_m (- A C)))
        (t_3 (* (+ (* B_m B_m) (* A (* C -4.0))) (* 2.0 F))))
   (if (<= t_1 (- INFINITY))
     (*
      (sqrt (* F (/ (+ A (- C t_2)) (+ (* B_m B_m) (* -4.0 (* A C))))))
      (- 0.0 (sqrt 2.0)))
     (if (<= t_1 INFINITY)
       (/ (sqrt (+ (* (- A t_2) t_3) (* C t_3))) (- t_0 (* B_m B_m)))
       (* (sqrt (* 2.0 (* F (- C (hypot B_m C))))) (/ -1.0 B_m))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = (4.0 * A) * C;
	double t_1 = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * ((A + C) - sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / (t_0 - pow(B_m, 2.0));
	double t_2 = hypot(B_m, (A - C));
	double t_3 = ((B_m * B_m) + (A * (C * -4.0))) * (2.0 * F);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = sqrt((F * ((A + (C - t_2)) / ((B_m * B_m) + (-4.0 * (A * C)))))) * (0.0 - sqrt(2.0));
	} else if (t_1 <= ((double) INFINITY)) {
		tmp = sqrt((((A - t_2) * t_3) + (C * t_3))) / (t_0 - (B_m * B_m));
	} else {
		tmp = sqrt((2.0 * (F * (C - hypot(B_m, C))))) * (-1.0 / B_m);
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = (4.0 * A) * C;
	double t_1 = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * ((A + C) - Math.sqrt((Math.pow(B_m, 2.0) + Math.pow((A - C), 2.0)))))) / (t_0 - Math.pow(B_m, 2.0));
	double t_2 = Math.hypot(B_m, (A - C));
	double t_3 = ((B_m * B_m) + (A * (C * -4.0))) * (2.0 * F);
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt((F * ((A + (C - t_2)) / ((B_m * B_m) + (-4.0 * (A * C)))))) * (0.0 - Math.sqrt(2.0));
	} else if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt((((A - t_2) * t_3) + (C * t_3))) / (t_0 - (B_m * B_m));
	} else {
		tmp = Math.sqrt((2.0 * (F * (C - Math.hypot(B_m, C))))) * (-1.0 / B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = (4.0 * A) * C
	t_1 = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * ((A + C) - math.sqrt((math.pow(B_m, 2.0) + math.pow((A - C), 2.0)))))) / (t_0 - math.pow(B_m, 2.0))
	t_2 = math.hypot(B_m, (A - C))
	t_3 = ((B_m * B_m) + (A * (C * -4.0))) * (2.0 * F)
	tmp = 0
	if t_1 <= -math.inf:
		tmp = math.sqrt((F * ((A + (C - t_2)) / ((B_m * B_m) + (-4.0 * (A * C)))))) * (0.0 - math.sqrt(2.0))
	elif t_1 <= math.inf:
		tmp = math.sqrt((((A - t_2) * t_3) + (C * t_3))) / (t_0 - (B_m * B_m))
	else:
		tmp = math.sqrt((2.0 * (F * (C - math.hypot(B_m, C))))) * (-1.0 / B_m)
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(Float64(4.0 * A) * C)
	t_1 = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(Float64(A + C) - sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / Float64(t_0 - (B_m ^ 2.0)))
	t_2 = hypot(B_m, Float64(A - C))
	t_3 = Float64(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) * Float64(2.0 * F))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(sqrt(Float64(F * Float64(Float64(A + Float64(C - t_2)) / Float64(Float64(B_m * B_m) + Float64(-4.0 * Float64(A * C)))))) * Float64(0.0 - sqrt(2.0)));
	elseif (t_1 <= Inf)
		tmp = Float64(sqrt(Float64(Float64(Float64(A - t_2) * t_3) + Float64(C * t_3))) / Float64(t_0 - Float64(B_m * B_m)));
	else
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C - hypot(B_m, C))))) * Float64(-1.0 / B_m));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = (4.0 * A) * C;
	t_1 = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * ((A + C) - sqrt(((B_m ^ 2.0) + ((A - C) ^ 2.0)))))) / (t_0 - (B_m ^ 2.0));
	t_2 = hypot(B_m, (A - C));
	t_3 = ((B_m * B_m) + (A * (C * -4.0))) * (2.0 * F);
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = sqrt((F * ((A + (C - t_2)) / ((B_m * B_m) + (-4.0 * (A * C)))))) * (0.0 - sqrt(2.0));
	elseif (t_1 <= Inf)
		tmp = sqrt((((A - t_2) * t_3) + (C * t_3))) / (t_0 - (B_m * B_m));
	else
		tmp = sqrt((2.0 * (F * (C - hypot(B_m, C))))) * (-1.0 / B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = 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[(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] / N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[Sqrt[N[(F * N[(N[(A + N[(C - t$95$2), $MachinePrecision]), $MachinePrecision] / N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.0 - N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[Sqrt[N[(N[(N[(A - t$95$2), $MachinePrecision] * t$95$3), $MachinePrecision] + N[(C * t$95$3), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(C - N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \left(4 \cdot A\right) \cdot C\\
t_1 := \frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_0 - {B\_m}^{2}}\\
t_2 := \mathsf{hypot}\left(B\_m, A - C\right)\\
t_3 := \left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\sqrt{F \cdot \frac{A + \left(C - t\_2\right)}{B\_m \cdot B\_m + -4 \cdot \left(A \cdot C\right)}} \cdot \left(0 - \sqrt{2}\right)\\

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

\mathbf{else}:\\
\;\;\;\;\sqrt{2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B\_m, C\right)\right)\right)} \cdot \frac{-1}{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))) < -inf.0

    1. Initial program 3.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. neg-sub0N/A

        \[\leadsto 0 - \color{blue}{\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}} \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\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)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{\_.f64}\left(0, \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(\sqrt{2}\right)}\right)\right) \]
    5. Simplified53.8%

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

    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))) < +inf.0

    1. Initial program 56.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. Simplified59.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A - \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\right) + C\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, \color{blue}{A}\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    5. Applied egg-rr61.7%

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

    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 A around 0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6419.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified19.6%

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

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

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

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

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

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

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

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

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

    \[\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 -\infty:\\ \;\;\;\;\sqrt{F \cdot \frac{A + \left(C - \mathsf{hypot}\left(B, A - C\right)\right)}{B \cdot B + -4 \cdot \left(A \cdot C\right)}} \cdot \left(0 - \sqrt{2}\right)\\ \mathbf{elif}\;\frac{\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}} \leq \infty:\\ \;\;\;\;\frac{\sqrt{\left(A - \mathsf{hypot}\left(B, A - C\right)\right) \cdot \left(\left(B \cdot B + A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)\right) + C \cdot \left(\left(B \cdot B + A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\left(4 \cdot A\right) \cdot C - B \cdot B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)\right)} \cdot \frac{-1}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 40.6% accurate, 2.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)\\ \mathbf{if}\;B\_m \leq 9.6 \cdot 10^{+93}:\\ \;\;\;\;\frac{\sqrt{\left(A - \mathsf{hypot}\left(B\_m, A - C\right)\right) \cdot t\_0 + C \cdot t\_0}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \mathsf{fma}\left(F, C, \mathsf{hypot}\left(C, B\_m\right) \cdot \left(0 - F\right)\right)}}{0 - B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* (+ (* B_m B_m) (* A (* C -4.0))) (* 2.0 F))))
   (if (<= B_m 9.6e+93)
     (/
      (sqrt (+ (* (- A (hypot B_m (- A C))) t_0) (* C t_0)))
      (- (* (* 4.0 A) C) (* B_m B_m)))
     (/ (sqrt (* 2.0 (fma F C (* (hypot C B_m) (- 0.0 F))))) (- 0.0 B_m)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = ((B_m * B_m) + (A * (C * -4.0))) * (2.0 * F);
	double tmp;
	if (B_m <= 9.6e+93) {
		tmp = sqrt((((A - hypot(B_m, (A - C))) * t_0) + (C * t_0))) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = sqrt((2.0 * fma(F, C, (hypot(C, B_m) * (0.0 - F))))) / (0.0 - B_m);
	}
	return tmp;
}
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) * Float64(2.0 * F))
	tmp = 0.0
	if (B_m <= 9.6e+93)
		tmp = Float64(sqrt(Float64(Float64(Float64(A - hypot(B_m, Float64(A - C))) * t_0) + Float64(C * t_0))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)));
	else
		tmp = Float64(sqrt(Float64(2.0 * fma(F, C, Float64(hypot(C, B_m) * Float64(0.0 - F))))) / Float64(0.0 - B_m));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 9.6e+93], N[(N[Sqrt[N[(N[(N[(A - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + N[(C * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * C + N[(N[Sqrt[C ^ 2 + B$95$m ^ 2], $MachinePrecision] * N[(0.0 - F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)\\
\mathbf{if}\;B\_m \leq 9.6 \cdot 10^{+93}:\\
\;\;\;\;\frac{\sqrt{\left(A - \mathsf{hypot}\left(B\_m, A - C\right)\right) \cdot t\_0 + C \cdot t\_0}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A - \sqrt{B \cdot B + \left(A - C\right) \cdot \left(A - C\right)}\right) + C\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, \color{blue}{A}\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    5. Applied egg-rr26.9%

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

    if 9.60000000000000042e93 < B

    1. Initial program 9.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 A around 0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6456.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified56.2%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(\sqrt{2}\right)\right) \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right), \color{blue}{B}\right) \]
    7. Applied egg-rr56.4%

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \left(F \cdot \left(C + \left(\mathsf{neg}\left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right)\right)\right), B\right) \]
      2. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \left(F \cdot C + F \cdot \left(\mathsf{neg}\left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right)\right), B\right) \]
      3. fma-defineN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{fma.f64}\left(F, C, \left(\left(\mathsf{neg}\left(\sqrt{B \cdot B + C \cdot C}\right)\right) \cdot F\right)\right)\right)\right)\right), B\right) \]
      6. distribute-lft-neg-outN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{fma.f64}\left(F, C, \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{B \cdot B + C \cdot C}\right), F\right)\right)\right)\right)\right)\right), B\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{fma.f64}\left(F, C, \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\left(\sqrt{C \cdot C + B \cdot B}\right), F\right)\right)\right)\right)\right)\right), B\right) \]
      10. hypot-defineN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{fma.f64}\left(F, C, \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\left(\mathsf{hypot}\left(C, B\right)\right), F\right)\right)\right)\right)\right)\right), B\right) \]
      11. hypot-lowering-hypot.f6456.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(2, \mathsf{fma.f64}\left(F, C, \mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{hypot.f64}\left(C, B\right), F\right)\right)\right)\right)\right)\right), B\right) \]
    9. Applied egg-rr56.4%

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

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

Alternative 3: 40.6% accurate, 2.5× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := \left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)\\ \mathbf{if}\;B\_m \leq 2.8 \cdot 10^{+23}:\\ \;\;\;\;\frac{\sqrt{\left(A - \mathsf{hypot}\left(B\_m, A - C\right)\right) \cdot t\_0 + C \cdot t\_0}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B\_m, C\right)\right)\right)} \cdot \frac{-1}{B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* (+ (* B_m B_m) (* A (* C -4.0))) (* 2.0 F))))
   (if (<= B_m 2.8e+23)
     (/
      (sqrt (+ (* (- A (hypot B_m (- A C))) t_0) (* C t_0)))
      (- (* (* 4.0 A) C) (* B_m B_m)))
     (* (sqrt (* 2.0 (* F (- C (hypot B_m C))))) (/ -1.0 B_m)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = ((B_m * B_m) + (A * (C * -4.0))) * (2.0 * F);
	double tmp;
	if (B_m <= 2.8e+23) {
		tmp = sqrt((((A - hypot(B_m, (A - C))) * t_0) + (C * t_0))) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = sqrt((2.0 * (F * (C - hypot(B_m, C))))) * (-1.0 / B_m);
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = ((B_m * B_m) + (A * (C * -4.0))) * (2.0 * F);
	double tmp;
	if (B_m <= 2.8e+23) {
		tmp = Math.sqrt((((A - Math.hypot(B_m, (A - C))) * t_0) + (C * t_0))) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = Math.sqrt((2.0 * (F * (C - Math.hypot(B_m, C))))) * (-1.0 / B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = ((B_m * B_m) + (A * (C * -4.0))) * (2.0 * F)
	tmp = 0
	if B_m <= 2.8e+23:
		tmp = math.sqrt((((A - math.hypot(B_m, (A - C))) * t_0) + (C * t_0))) / (((4.0 * A) * C) - (B_m * B_m))
	else:
		tmp = math.sqrt((2.0 * (F * (C - math.hypot(B_m, C))))) * (-1.0 / B_m)
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) * Float64(2.0 * F))
	tmp = 0.0
	if (B_m <= 2.8e+23)
		tmp = Float64(sqrt(Float64(Float64(Float64(A - hypot(B_m, Float64(A - C))) * t_0) + Float64(C * t_0))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)));
	else
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C - hypot(B_m, C))))) * Float64(-1.0 / B_m));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = ((B_m * B_m) + (A * (C * -4.0))) * (2.0 * F);
	tmp = 0.0;
	if (B_m <= 2.8e+23)
		tmp = sqrt((((A - hypot(B_m, (A - C))) * t_0) + (C * t_0))) / (((4.0 * A) * C) - (B_m * B_m));
	else
		tmp = sqrt((2.0 * (F * (C - hypot(B_m, C))))) * (-1.0 / B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B$95$m, 2.8e+23], N[(N[Sqrt[N[(N[(N[(A - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + N[(C * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(C - N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := \left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(2 \cdot F\right)\\
\mathbf{if}\;B\_m \leq 2.8 \cdot 10^{+23}:\\
\;\;\;\;\frac{\sqrt{\left(A - \mathsf{hypot}\left(B\_m, A - C\right)\right) \cdot t\_0 + C \cdot t\_0}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.8e23 < B

    1. Initial program 12.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 A around 0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6450.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified50.3%

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

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

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

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

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

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

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

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

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

Alternative 4: 40.8% accurate, 2.7× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;B\_m \leq 4.8 \cdot 10^{+25}:\\ \;\;\;\;\frac{\sqrt{\left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(2 \cdot F\right) \cdot \left(A + \left(C - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B\_m, C\right)\right)\right)} \cdot \frac{-1}{B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= B_m 4.8e+25)
   (/
    (sqrt
     (*
      (+ (* B_m B_m) (* A (* C -4.0)))
      (* (* 2.0 F) (+ A (- C (hypot B_m (- A C)))))))
    (- (* (* 4.0 A) C) (* B_m B_m)))
   (* (sqrt (* 2.0 (* F (- C (hypot B_m C))))) (/ -1.0 B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 4.8e+25) {
		tmp = sqrt((((B_m * B_m) + (A * (C * -4.0))) * ((2.0 * F) * (A + (C - hypot(B_m, (A - C))))))) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = sqrt((2.0 * (F * (C - hypot(B_m, C))))) * (-1.0 / B_m);
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 4.8e+25) {
		tmp = Math.sqrt((((B_m * B_m) + (A * (C * -4.0))) * ((2.0 * F) * (A + (C - Math.hypot(B_m, (A - C))))))) / (((4.0 * A) * C) - (B_m * B_m));
	} else {
		tmp = Math.sqrt((2.0 * (F * (C - Math.hypot(B_m, C))))) * (-1.0 / B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if B_m <= 4.8e+25:
		tmp = math.sqrt((((B_m * B_m) + (A * (C * -4.0))) * ((2.0 * F) * (A + (C - math.hypot(B_m, (A - C))))))) / (((4.0 * A) * C) - (B_m * B_m))
	else:
		tmp = math.sqrt((2.0 * (F * (C - math.hypot(B_m, C))))) * (-1.0 / B_m)
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (B_m <= 4.8e+25)
		tmp = Float64(sqrt(Float64(Float64(Float64(B_m * B_m) + Float64(A * Float64(C * -4.0))) * Float64(Float64(2.0 * F) * Float64(A + Float64(C - hypot(B_m, Float64(A - C))))))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)));
	else
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C - hypot(B_m, C))))) * Float64(-1.0 / B_m));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (B_m <= 4.8e+25)
		tmp = sqrt((((B_m * B_m) + (A * (C * -4.0))) * ((2.0 * F) * (A + (C - hypot(B_m, (A - C))))))) / (((4.0 * A) * C) - (B_m * B_m));
	else
		tmp = sqrt((2.0 * (F * (C - hypot(B_m, C))))) * (-1.0 / B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 4.8e+25], N[(N[Sqrt[N[(N[(N[(B$95$m * B$95$m), $MachinePrecision] + N[(A * N[(C * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 * F), $MachinePrecision] * N[(A + N[(C - N[Sqrt[B$95$m ^ 2 + N[(A - C), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(2.0 * N[(F * N[(C - N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 4.8 \cdot 10^{+25}:\\
\;\;\;\;\frac{\sqrt{\left(B\_m \cdot B\_m + A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(2 \cdot F\right) \cdot \left(A + \left(C - \mathsf{hypot}\left(B\_m, A - C\right)\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\

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


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

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

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

    if 4.79999999999999992e25 < B

    1. Initial program 11.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 A around 0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6451.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified51.0%

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

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

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

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

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

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

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

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

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

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

Alternative 5: 34.0% accurate, 2.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;F \leq -8.5 \cdot 10^{+227}:\\ \;\;\;\;\frac{\sqrt{C \cdot \left(\left(A \cdot -8\right) \cdot \left(F \cdot \left(A + A\right)\right) + \frac{2 \cdot \left(F \cdot \left(2 \cdot \left(A \cdot \left(B\_m \cdot B\_m\right)\right) + \left(B\_m \cdot B\_m\right) \cdot \left(A + A\right)\right)\right)}{C}\right)}}{t\_0}\\ \mathbf{elif}\;F \leq -1.55 \cdot 10^{+178}:\\ \;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(\left(C \cdot F\right) \cdot \left(C + C\right)\right)}}{t\_0}\\ \mathbf{elif}\;F \leq -2 \cdot 10^{-311}:\\ \;\;\;\;\sqrt{2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B\_m, C\right)\right)\right)} \cdot \frac{-1}{B\_m}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \sqrt{\frac{F \cdot -16 + \frac{-4 \cdot \left(F \cdot \left(B\_m \cdot B\_m\right)\right)}{A \cdot A}}{C}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* 4.0 (* A C))))
   (if (<= F -8.5e+227)
     (/
      (sqrt
       (*
        C
        (+
         (* (* A -8.0) (* F (+ A A)))
         (/
          (* 2.0 (* F (+ (* 2.0 (* A (* B_m B_m))) (* (* B_m B_m) (+ A A)))))
          C))))
      t_0)
     (if (<= F -1.55e+178)
       (/ (sqrt (* (* A -8.0) (* (* C F) (+ C C)))) t_0)
       (if (<= F -2e-311)
         (* (sqrt (* 2.0 (* F (- C (hypot B_m C))))) (/ -1.0 B_m))
         (*
          0.25
          (sqrt
           (/ (+ (* F -16.0) (/ (* -4.0 (* F (* B_m B_m))) (* A A))) C))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = 4.0 * (A * C);
	double tmp;
	if (F <= -8.5e+227) {
		tmp = sqrt((C * (((A * -8.0) * (F * (A + A))) + ((2.0 * (F * ((2.0 * (A * (B_m * B_m))) + ((B_m * B_m) * (A + A))))) / C)))) / t_0;
	} else if (F <= -1.55e+178) {
		tmp = sqrt(((A * -8.0) * ((C * F) * (C + C)))) / t_0;
	} else if (F <= -2e-311) {
		tmp = sqrt((2.0 * (F * (C - hypot(B_m, C))))) * (-1.0 / B_m);
	} else {
		tmp = 0.25 * sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = 4.0 * (A * C);
	double tmp;
	if (F <= -8.5e+227) {
		tmp = Math.sqrt((C * (((A * -8.0) * (F * (A + A))) + ((2.0 * (F * ((2.0 * (A * (B_m * B_m))) + ((B_m * B_m) * (A + A))))) / C)))) / t_0;
	} else if (F <= -1.55e+178) {
		tmp = Math.sqrt(((A * -8.0) * ((C * F) * (C + C)))) / t_0;
	} else if (F <= -2e-311) {
		tmp = Math.sqrt((2.0 * (F * (C - Math.hypot(B_m, C))))) * (-1.0 / B_m);
	} else {
		tmp = 0.25 * Math.sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = 4.0 * (A * C)
	tmp = 0
	if F <= -8.5e+227:
		tmp = math.sqrt((C * (((A * -8.0) * (F * (A + A))) + ((2.0 * (F * ((2.0 * (A * (B_m * B_m))) + ((B_m * B_m) * (A + A))))) / C)))) / t_0
	elif F <= -1.55e+178:
		tmp = math.sqrt(((A * -8.0) * ((C * F) * (C + C)))) / t_0
	elif F <= -2e-311:
		tmp = math.sqrt((2.0 * (F * (C - math.hypot(B_m, C))))) * (-1.0 / B_m)
	else:
		tmp = 0.25 * math.sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(4.0 * Float64(A * C))
	tmp = 0.0
	if (F <= -8.5e+227)
		tmp = Float64(sqrt(Float64(C * Float64(Float64(Float64(A * -8.0) * Float64(F * Float64(A + A))) + Float64(Float64(2.0 * Float64(F * Float64(Float64(2.0 * Float64(A * Float64(B_m * B_m))) + Float64(Float64(B_m * B_m) * Float64(A + A))))) / C)))) / t_0);
	elseif (F <= -1.55e+178)
		tmp = Float64(sqrt(Float64(Float64(A * -8.0) * Float64(Float64(C * F) * Float64(C + C)))) / t_0);
	elseif (F <= -2e-311)
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C - hypot(B_m, C))))) * Float64(-1.0 / B_m));
	else
		tmp = Float64(0.25 * sqrt(Float64(Float64(Float64(F * -16.0) + Float64(Float64(-4.0 * Float64(F * Float64(B_m * B_m))) / Float64(A * A))) / C)));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = 4.0 * (A * C);
	tmp = 0.0;
	if (F <= -8.5e+227)
		tmp = sqrt((C * (((A * -8.0) * (F * (A + A))) + ((2.0 * (F * ((2.0 * (A * (B_m * B_m))) + ((B_m * B_m) * (A + A))))) / C)))) / t_0;
	elseif (F <= -1.55e+178)
		tmp = sqrt(((A * -8.0) * ((C * F) * (C + C)))) / t_0;
	elseif (F <= -2e-311)
		tmp = sqrt((2.0 * (F * (C - hypot(B_m, C))))) * (-1.0 / B_m);
	else
		tmp = 0.25 * sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8.5e+227], N[(N[Sqrt[N[(C * N[(N[(N[(A * -8.0), $MachinePrecision] * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(F * N[(N[(2.0 * N[(A * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(B$95$m * B$95$m), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[F, -1.55e+178], N[(N[Sqrt[N[(N[(A * -8.0), $MachinePrecision] * N[(N[(C * F), $MachinePrecision] * N[(C + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[F, -2e-311], N[(N[Sqrt[N[(2.0 * N[(F * N[(C - N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[Sqrt[N[(N[(N[(F * -16.0), $MachinePrecision] + N[(N[(-4.0 * N[(F * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;F \leq -8.5 \cdot 10^{+227}:\\
\;\;\;\;\frac{\sqrt{C \cdot \left(\left(A \cdot -8\right) \cdot \left(F \cdot \left(A + A\right)\right) + \frac{2 \cdot \left(F \cdot \left(2 \cdot \left(A \cdot \left(B\_m \cdot B\_m\right)\right) + \left(B\_m \cdot B\_m\right) \cdot \left(A + A\right)\right)\right)}{C}\right)}}{t\_0}\\

\mathbf{elif}\;F \leq -1.55 \cdot 10^{+178}:\\
\;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(\left(C \cdot F\right) \cdot \left(C + C\right)\right)}}{t\_0}\\

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

\mathbf{else}:\\
\;\;\;\;0.25 \cdot \sqrt{\frac{F \cdot -16 + \frac{-4 \cdot \left(F \cdot \left(B\_m \cdot B\_m\right)\right)}{A \cdot A}}{C}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -8.4999999999999995e227

    1. Initial program 8.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. Simplified6.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \color{blue}{\left(A \cdot C\right)}\right)\right) \]
      2. *-lowering-*.f646.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \color{blue}{C}\right)\right)\right) \]
    6. Simplified6.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.4999999999999995e227 < F < -1.54999999999999996e178

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \color{blue}{\left(A \cdot C\right)}\right)\right) \]
      2. *-lowering-*.f6423.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \color{blue}{C}\right)\right)\right) \]
    6. Simplified23.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\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(C, \left(\left(\mathsf{neg}\left(-1\right)\right) \cdot C\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\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(C, \left(1 \cdot C\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      10. *-lowering-*.f6439.9%

        \[\leadsto \mathsf{/.f64}\left(\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(C, \mathsf{*.f64}\left(1, C\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    9. Simplified39.9%

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

    if -1.54999999999999996e178 < F < -1.9999999999999e-311

    1. Initial program 18.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6424.8%

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999e-311 < F

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, F\right)\right), \mathsf{/.f64}\left(\left(-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{{B}^{2} \cdot \left(C \cdot F\right)}{A}\right), A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Simplified17.8%

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

      \[\leadsto \color{blue}{\frac{1}{4} \cdot \sqrt{\frac{-16 \cdot F - 4 \cdot \frac{{B}^{2} \cdot F}{{A}^{2}}}{C}}} \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(-16, F\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), F\right)\right), \left(A \cdot A\right)\right)\right), C\right)\right)\right) \]
      15. *-lowering-*.f6459.2%

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

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

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

Alternative 6: 34.0% accurate, 2.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;F \leq -8.5 \cdot 10^{+235}:\\ \;\;\;\;\frac{\sqrt{C \cdot \left(\left(A \cdot -8\right) \cdot \left(F \cdot \left(A + A\right)\right) + \frac{2 \cdot \left(F \cdot \left(2 \cdot \left(A \cdot \left(B\_m \cdot B\_m\right)\right) + \left(B\_m \cdot B\_m\right) \cdot \left(A + A\right)\right)\right)}{C}\right)}}{t\_0}\\ \mathbf{elif}\;F \leq -2.9 \cdot 10^{+178}:\\ \;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(\left(C \cdot F\right) \cdot \left(C + C\right)\right)}}{t\_0}\\ \mathbf{elif}\;F \leq -2 \cdot 10^{-311}:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B\_m, C\right)\right)\right)}}{0 - B\_m}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \sqrt{\frac{F \cdot -16 + \frac{-4 \cdot \left(F \cdot \left(B\_m \cdot B\_m\right)\right)}{A \cdot A}}{C}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* 4.0 (* A C))))
   (if (<= F -8.5e+235)
     (/
      (sqrt
       (*
        C
        (+
         (* (* A -8.0) (* F (+ A A)))
         (/
          (* 2.0 (* F (+ (* 2.0 (* A (* B_m B_m))) (* (* B_m B_m) (+ A A)))))
          C))))
      t_0)
     (if (<= F -2.9e+178)
       (/ (sqrt (* (* A -8.0) (* (* C F) (+ C C)))) t_0)
       (if (<= F -2e-311)
         (/ (sqrt (* 2.0 (* F (- C (hypot B_m C))))) (- 0.0 B_m))
         (*
          0.25
          (sqrt
           (/ (+ (* F -16.0) (/ (* -4.0 (* F (* B_m B_m))) (* A A))) C))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = 4.0 * (A * C);
	double tmp;
	if (F <= -8.5e+235) {
		tmp = sqrt((C * (((A * -8.0) * (F * (A + A))) + ((2.0 * (F * ((2.0 * (A * (B_m * B_m))) + ((B_m * B_m) * (A + A))))) / C)))) / t_0;
	} else if (F <= -2.9e+178) {
		tmp = sqrt(((A * -8.0) * ((C * F) * (C + C)))) / t_0;
	} else if (F <= -2e-311) {
		tmp = sqrt((2.0 * (F * (C - hypot(B_m, C))))) / (0.0 - B_m);
	} else {
		tmp = 0.25 * sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = 4.0 * (A * C);
	double tmp;
	if (F <= -8.5e+235) {
		tmp = Math.sqrt((C * (((A * -8.0) * (F * (A + A))) + ((2.0 * (F * ((2.0 * (A * (B_m * B_m))) + ((B_m * B_m) * (A + A))))) / C)))) / t_0;
	} else if (F <= -2.9e+178) {
		tmp = Math.sqrt(((A * -8.0) * ((C * F) * (C + C)))) / t_0;
	} else if (F <= -2e-311) {
		tmp = Math.sqrt((2.0 * (F * (C - Math.hypot(B_m, C))))) / (0.0 - B_m);
	} else {
		tmp = 0.25 * Math.sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = 4.0 * (A * C)
	tmp = 0
	if F <= -8.5e+235:
		tmp = math.sqrt((C * (((A * -8.0) * (F * (A + A))) + ((2.0 * (F * ((2.0 * (A * (B_m * B_m))) + ((B_m * B_m) * (A + A))))) / C)))) / t_0
	elif F <= -2.9e+178:
		tmp = math.sqrt(((A * -8.0) * ((C * F) * (C + C)))) / t_0
	elif F <= -2e-311:
		tmp = math.sqrt((2.0 * (F * (C - math.hypot(B_m, C))))) / (0.0 - B_m)
	else:
		tmp = 0.25 * math.sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(4.0 * Float64(A * C))
	tmp = 0.0
	if (F <= -8.5e+235)
		tmp = Float64(sqrt(Float64(C * Float64(Float64(Float64(A * -8.0) * Float64(F * Float64(A + A))) + Float64(Float64(2.0 * Float64(F * Float64(Float64(2.0 * Float64(A * Float64(B_m * B_m))) + Float64(Float64(B_m * B_m) * Float64(A + A))))) / C)))) / t_0);
	elseif (F <= -2.9e+178)
		tmp = Float64(sqrt(Float64(Float64(A * -8.0) * Float64(Float64(C * F) * Float64(C + C)))) / t_0);
	elseif (F <= -2e-311)
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C - hypot(B_m, C))))) / Float64(0.0 - B_m));
	else
		tmp = Float64(0.25 * sqrt(Float64(Float64(Float64(F * -16.0) + Float64(Float64(-4.0 * Float64(F * Float64(B_m * B_m))) / Float64(A * A))) / C)));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = 4.0 * (A * C);
	tmp = 0.0;
	if (F <= -8.5e+235)
		tmp = sqrt((C * (((A * -8.0) * (F * (A + A))) + ((2.0 * (F * ((2.0 * (A * (B_m * B_m))) + ((B_m * B_m) * (A + A))))) / C)))) / t_0;
	elseif (F <= -2.9e+178)
		tmp = sqrt(((A * -8.0) * ((C * F) * (C + C)))) / t_0;
	elseif (F <= -2e-311)
		tmp = sqrt((2.0 * (F * (C - hypot(B_m, C))))) / (0.0 - B_m);
	else
		tmp = 0.25 * sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8.5e+235], N[(N[Sqrt[N[(C * N[(N[(N[(A * -8.0), $MachinePrecision] * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(F * N[(N[(2.0 * N[(A * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(B$95$m * B$95$m), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[F, -2.9e+178], N[(N[Sqrt[N[(N[(A * -8.0), $MachinePrecision] * N[(N[(C * F), $MachinePrecision] * N[(C + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[F, -2e-311], N[(N[Sqrt[N[(2.0 * N[(F * N[(C - N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[Sqrt[N[(N[(N[(F * -16.0), $MachinePrecision] + N[(N[(-4.0 * N[(F * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;F \leq -8.5 \cdot 10^{+235}:\\
\;\;\;\;\frac{\sqrt{C \cdot \left(\left(A \cdot -8\right) \cdot \left(F \cdot \left(A + A\right)\right) + \frac{2 \cdot \left(F \cdot \left(2 \cdot \left(A \cdot \left(B\_m \cdot B\_m\right)\right) + \left(B\_m \cdot B\_m\right) \cdot \left(A + A\right)\right)\right)}{C}\right)}}{t\_0}\\

\mathbf{elif}\;F \leq -2.9 \cdot 10^{+178}:\\
\;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(\left(C \cdot F\right) \cdot \left(C + C\right)\right)}}{t\_0}\\

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

\mathbf{else}:\\
\;\;\;\;0.25 \cdot \sqrt{\frac{F \cdot -16 + \frac{-4 \cdot \left(F \cdot \left(B\_m \cdot B\_m\right)\right)}{A \cdot A}}{C}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -8.50000000000000017e235

    1. Initial program 8.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. Simplified6.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \color{blue}{\left(A \cdot C\right)}\right)\right) \]
      2. *-lowering-*.f646.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \color{blue}{C}\right)\right)\right) \]
    6. Simplified6.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.50000000000000017e235 < F < -2.9e178

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \color{blue}{\left(A \cdot C\right)}\right)\right) \]
      2. *-lowering-*.f6423.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \color{blue}{C}\right)\right)\right) \]
    6. Simplified23.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\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(C, \left(\left(\mathsf{neg}\left(-1\right)\right) \cdot C\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\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(C, \left(1 \cdot C\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      10. *-lowering-*.f6439.9%

        \[\leadsto \mathsf{/.f64}\left(\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(C, \mathsf{*.f64}\left(1, C\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    9. Simplified39.9%

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

    if -2.9e178 < F < -1.9999999999999e-311

    1. Initial program 18.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6424.8%

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(\sqrt{2}\right)\right) \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right), \color{blue}{B}\right) \]
    7. Applied egg-rr24.9%

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

    if -1.9999999999999e-311 < F

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, F\right)\right), \mathsf{/.f64}\left(\left(-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{{B}^{2} \cdot \left(C \cdot F\right)}{A}\right), A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Simplified17.8%

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

      \[\leadsto \color{blue}{\frac{1}{4} \cdot \sqrt{\frac{-16 \cdot F - 4 \cdot \frac{{B}^{2} \cdot F}{{A}^{2}}}{C}}} \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(-16, F\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), F\right)\right), \left(A \cdot A\right)\right)\right), C\right)\right)\right) \]
      15. *-lowering-*.f6459.2%

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

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

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

Alternative 7: 34.7% accurate, 2.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq -2.6 \cdot 10^{+178}:\\ \;\;\;\;\frac{\sqrt{F \cdot -16} \cdot \sqrt{C \cdot \left(A \cdot C\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\ \mathbf{elif}\;F \leq -2 \cdot 10^{-311}:\\ \;\;\;\;\sqrt{2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B\_m, C\right)\right)\right)} \cdot \frac{-1}{B\_m}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \sqrt{\frac{F \cdot -16 + \frac{-4 \cdot \left(F \cdot \left(B\_m \cdot B\_m\right)\right)}{A \cdot A}}{C}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F -2.6e+178)
   (/
    (* (sqrt (* F -16.0)) (sqrt (* C (* A C))))
    (- (* (* 4.0 A) C) (* B_m B_m)))
   (if (<= F -2e-311)
     (* (sqrt (* 2.0 (* F (- C (hypot B_m C))))) (/ -1.0 B_m))
     (*
      0.25
      (sqrt (/ (+ (* F -16.0) (/ (* -4.0 (* F (* B_m B_m))) (* A A))) C))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -2.6e+178) {
		tmp = (sqrt((F * -16.0)) * sqrt((C * (A * C)))) / (((4.0 * A) * C) - (B_m * B_m));
	} else if (F <= -2e-311) {
		tmp = sqrt((2.0 * (F * (C - hypot(B_m, C))))) * (-1.0 / B_m);
	} else {
		tmp = 0.25 * sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C));
	}
	return tmp;
}
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -2.6e+178) {
		tmp = (Math.sqrt((F * -16.0)) * Math.sqrt((C * (A * C)))) / (((4.0 * A) * C) - (B_m * B_m));
	} else if (F <= -2e-311) {
		tmp = Math.sqrt((2.0 * (F * (C - Math.hypot(B_m, C))))) * (-1.0 / B_m);
	} else {
		tmp = 0.25 * Math.sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if F <= -2.6e+178:
		tmp = (math.sqrt((F * -16.0)) * math.sqrt((C * (A * C)))) / (((4.0 * A) * C) - (B_m * B_m))
	elif F <= -2e-311:
		tmp = math.sqrt((2.0 * (F * (C - math.hypot(B_m, C))))) * (-1.0 / B_m)
	else:
		tmp = 0.25 * math.sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= -2.6e+178)
		tmp = Float64(Float64(sqrt(Float64(F * -16.0)) * sqrt(Float64(C * Float64(A * C)))) / Float64(Float64(Float64(4.0 * A) * C) - Float64(B_m * B_m)));
	elseif (F <= -2e-311)
		tmp = Float64(sqrt(Float64(2.0 * Float64(F * Float64(C - hypot(B_m, C))))) * Float64(-1.0 / B_m));
	else
		tmp = Float64(0.25 * sqrt(Float64(Float64(Float64(F * -16.0) + Float64(Float64(-4.0 * Float64(F * Float64(B_m * B_m))) / Float64(A * A))) / C)));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (F <= -2.6e+178)
		tmp = (sqrt((F * -16.0)) * sqrt((C * (A * C)))) / (((4.0 * A) * C) - (B_m * B_m));
	elseif (F <= -2e-311)
		tmp = sqrt((2.0 * (F * (C - hypot(B_m, C))))) * (-1.0 / B_m);
	else
		tmp = 0.25 * sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -2.6e+178], N[(N[(N[Sqrt[N[(F * -16.0), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(C * N[(A * C), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision] - N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2e-311], N[(N[Sqrt[N[(2.0 * N[(F * N[(C - N[Sqrt[B$95$m ^ 2 + C ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[Sqrt[N[(N[(N[(F * -16.0), $MachinePrecision] + N[(N[(-4.0 * N[(F * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.6 \cdot 10^{+178}:\\
\;\;\;\;\frac{\sqrt{F \cdot -16} \cdot \sqrt{C \cdot \left(A \cdot C\right)}}{\left(4 \cdot A\right) \cdot C - B\_m \cdot B\_m}\\

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

\mathbf{else}:\\
\;\;\;\;0.25 \cdot \sqrt{\frac{F \cdot -16 + \frac{-4 \cdot \left(F \cdot \left(B\_m \cdot B\_m\right)\right)}{A \cdot A}}{C}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -2.6000000000000001e178

    1. Initial program 14.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. Simplified13.3%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, C\right)\right), F\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Simplified14.5%

      \[\leadsto \frac{\sqrt{\color{blue}{-16 \cdot \left(\left(A \cdot \left(C \cdot C\right)\right) \cdot F\right)}}}{\left(4 \cdot A\right) \cdot C - B \cdot B} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{\left(-16 \cdot F\right) \cdot \left(A \cdot \left(C \cdot C\right)\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(4, A\right)}, C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      3. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\sqrt{-16 \cdot F} \cdot \sqrt{A \cdot \left(C \cdot C\right)}\right), \mathsf{\_.f64}\left(\color{blue}{\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right)}, \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      4. *-commutativeN/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, -16\right)\right), \mathsf{sqrt.f64}\left(\left(\left(A \cdot C\right) \cdot C\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      12. *-commutativeN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, -16\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \left(A \cdot C\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      14. *-commutativeN/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, -16\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(C, \mathsf{*.f64}\left(C, A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    8. Applied egg-rr24.4%

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

    if -2.6000000000000001e178 < F < -1.9999999999999e-311

    1. Initial program 18.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6424.8%

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999e-311 < F

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, F\right)\right), \mathsf{/.f64}\left(\left(-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{{B}^{2} \cdot \left(C \cdot F\right)}{A}\right), A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Simplified17.8%

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

      \[\leadsto \color{blue}{\frac{1}{4} \cdot \sqrt{\frac{-16 \cdot F - 4 \cdot \frac{{B}^{2} \cdot F}{{A}^{2}}}{C}}} \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(-16, F\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), F\right)\right), \left(A \cdot A\right)\right)\right), C\right)\right)\right) \]
      15. *-lowering-*.f6459.2%

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

      \[\leadsto \color{blue}{0.25 \cdot \sqrt{\frac{-16 \cdot F + \frac{-4 \cdot \left(\left(B \cdot B\right) \cdot F\right)}{A \cdot A}}{C}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification29.8%

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

Alternative 8: 31.4% accurate, 4.4× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} t_0 := 4 \cdot \left(A \cdot C\right)\\ \mathbf{if}\;F \leq -9.2 \cdot 10^{+234}:\\ \;\;\;\;\frac{\sqrt{C \cdot \left(\left(A \cdot -8\right) \cdot \left(F \cdot \left(A + A\right)\right) + \frac{2 \cdot \left(F \cdot \left(2 \cdot \left(A \cdot \left(B\_m \cdot B\_m\right)\right) + \left(B\_m \cdot B\_m\right) \cdot \left(A + A\right)\right)\right)}{C}\right)}}{t\_0}\\ \mathbf{elif}\;F \leq -1.35 \cdot 10^{+178}:\\ \;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(\left(C \cdot F\right) \cdot \left(C + C\right)\right)}}{t\_0}\\ \mathbf{elif}\;F \leq -2 \cdot 10^{-311}:\\ \;\;\;\;\frac{-1}{B\_m} \cdot \sqrt{-2 \cdot \left(B\_m \cdot F\right)}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \sqrt{\frac{F \cdot -16 + \frac{-4 \cdot \left(F \cdot \left(B\_m \cdot B\_m\right)\right)}{A \cdot A}}{C}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* 4.0 (* A C))))
   (if (<= F -9.2e+234)
     (/
      (sqrt
       (*
        C
        (+
         (* (* A -8.0) (* F (+ A A)))
         (/
          (* 2.0 (* F (+ (* 2.0 (* A (* B_m B_m))) (* (* B_m B_m) (+ A A)))))
          C))))
      t_0)
     (if (<= F -1.35e+178)
       (/ (sqrt (* (* A -8.0) (* (* C F) (+ C C)))) t_0)
       (if (<= F -2e-311)
         (* (/ -1.0 B_m) (sqrt (* -2.0 (* B_m F))))
         (*
          0.25
          (sqrt
           (/ (+ (* F -16.0) (/ (* -4.0 (* F (* B_m B_m))) (* A A))) C))))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double t_0 = 4.0 * (A * C);
	double tmp;
	if (F <= -9.2e+234) {
		tmp = sqrt((C * (((A * -8.0) * (F * (A + A))) + ((2.0 * (F * ((2.0 * (A * (B_m * B_m))) + ((B_m * B_m) * (A + A))))) / C)))) / t_0;
	} else if (F <= -1.35e+178) {
		tmp = sqrt(((A * -8.0) * ((C * F) * (C + C)))) / t_0;
	} else if (F <= -2e-311) {
		tmp = (-1.0 / B_m) * sqrt((-2.0 * (B_m * F)));
	} else {
		tmp = 0.25 * sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C));
	}
	return tmp;
}
B_m = abs(b)
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 = 4.0d0 * (a * c)
    if (f <= (-9.2d+234)) then
        tmp = sqrt((c * (((a * (-8.0d0)) * (f * (a + a))) + ((2.0d0 * (f * ((2.0d0 * (a * (b_m * b_m))) + ((b_m * b_m) * (a + a))))) / c)))) / t_0
    else if (f <= (-1.35d+178)) then
        tmp = sqrt(((a * (-8.0d0)) * ((c * f) * (c + c)))) / t_0
    else if (f <= (-2d-311)) then
        tmp = ((-1.0d0) / b_m) * sqrt(((-2.0d0) * (b_m * f)))
    else
        tmp = 0.25d0 * sqrt((((f * (-16.0d0)) + (((-4.0d0) * (f * (b_m * b_m))) / (a * a))) / c))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double t_0 = 4.0 * (A * C);
	double tmp;
	if (F <= -9.2e+234) {
		tmp = Math.sqrt((C * (((A * -8.0) * (F * (A + A))) + ((2.0 * (F * ((2.0 * (A * (B_m * B_m))) + ((B_m * B_m) * (A + A))))) / C)))) / t_0;
	} else if (F <= -1.35e+178) {
		tmp = Math.sqrt(((A * -8.0) * ((C * F) * (C + C)))) / t_0;
	} else if (F <= -2e-311) {
		tmp = (-1.0 / B_m) * Math.sqrt((-2.0 * (B_m * F)));
	} else {
		tmp = 0.25 * Math.sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	t_0 = 4.0 * (A * C)
	tmp = 0
	if F <= -9.2e+234:
		tmp = math.sqrt((C * (((A * -8.0) * (F * (A + A))) + ((2.0 * (F * ((2.0 * (A * (B_m * B_m))) + ((B_m * B_m) * (A + A))))) / C)))) / t_0
	elif F <= -1.35e+178:
		tmp = math.sqrt(((A * -8.0) * ((C * F) * (C + C)))) / t_0
	elif F <= -2e-311:
		tmp = (-1.0 / B_m) * math.sqrt((-2.0 * (B_m * F)))
	else:
		tmp = 0.25 * math.sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	t_0 = Float64(4.0 * Float64(A * C))
	tmp = 0.0
	if (F <= -9.2e+234)
		tmp = Float64(sqrt(Float64(C * Float64(Float64(Float64(A * -8.0) * Float64(F * Float64(A + A))) + Float64(Float64(2.0 * Float64(F * Float64(Float64(2.0 * Float64(A * Float64(B_m * B_m))) + Float64(Float64(B_m * B_m) * Float64(A + A))))) / C)))) / t_0);
	elseif (F <= -1.35e+178)
		tmp = Float64(sqrt(Float64(Float64(A * -8.0) * Float64(Float64(C * F) * Float64(C + C)))) / t_0);
	elseif (F <= -2e-311)
		tmp = Float64(Float64(-1.0 / B_m) * sqrt(Float64(-2.0 * Float64(B_m * F))));
	else
		tmp = Float64(0.25 * sqrt(Float64(Float64(Float64(F * -16.0) + Float64(Float64(-4.0 * Float64(F * Float64(B_m * B_m))) / Float64(A * A))) / C)));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	t_0 = 4.0 * (A * C);
	tmp = 0.0;
	if (F <= -9.2e+234)
		tmp = sqrt((C * (((A * -8.0) * (F * (A + A))) + ((2.0 * (F * ((2.0 * (A * (B_m * B_m))) + ((B_m * B_m) * (A + A))))) / C)))) / t_0;
	elseif (F <= -1.35e+178)
		tmp = sqrt(((A * -8.0) * ((C * F) * (C + C)))) / t_0;
	elseif (F <= -2e-311)
		tmp = (-1.0 / B_m) * sqrt((-2.0 * (B_m * F)));
	else
		tmp = 0.25 * sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -9.2e+234], N[(N[Sqrt[N[(C * N[(N[(N[(A * -8.0), $MachinePrecision] * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(2.0 * N[(F * N[(N[(2.0 * N[(A * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(B$95$m * B$95$m), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[F, -1.35e+178], N[(N[Sqrt[N[(N[(A * -8.0), $MachinePrecision] * N[(N[(C * F), $MachinePrecision] * N[(C + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[F, -2e-311], N[(N[(-1.0 / B$95$m), $MachinePrecision] * N[Sqrt[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.25 * N[Sqrt[N[(N[(N[(F * -16.0), $MachinePrecision] + N[(N[(-4.0 * N[(F * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
t_0 := 4 \cdot \left(A \cdot C\right)\\
\mathbf{if}\;F \leq -9.2 \cdot 10^{+234}:\\
\;\;\;\;\frac{\sqrt{C \cdot \left(\left(A \cdot -8\right) \cdot \left(F \cdot \left(A + A\right)\right) + \frac{2 \cdot \left(F \cdot \left(2 \cdot \left(A \cdot \left(B\_m \cdot B\_m\right)\right) + \left(B\_m \cdot B\_m\right) \cdot \left(A + A\right)\right)\right)}{C}\right)}}{t\_0}\\

\mathbf{elif}\;F \leq -1.35 \cdot 10^{+178}:\\
\;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(\left(C \cdot F\right) \cdot \left(C + C\right)\right)}}{t\_0}\\

\mathbf{elif}\;F \leq -2 \cdot 10^{-311}:\\
\;\;\;\;\frac{-1}{B\_m} \cdot \sqrt{-2 \cdot \left(B\_m \cdot F\right)}\\

\mathbf{else}:\\
\;\;\;\;0.25 \cdot \sqrt{\frac{F \cdot -16 + \frac{-4 \cdot \left(F \cdot \left(B\_m \cdot B\_m\right)\right)}{A \cdot A}}{C}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if F < -9.2000000000000004e234

    1. Initial program 8.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. Simplified6.6%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \color{blue}{\left(A \cdot C\right)}\right)\right) \]
      2. *-lowering-*.f646.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \color{blue}{C}\right)\right)\right) \]
    6. Simplified6.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.2000000000000004e234 < F < -1.35000000000000009e178

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \color{blue}{\left(A \cdot C\right)}\right)\right) \]
      2. *-lowering-*.f6423.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \color{blue}{C}\right)\right)\right) \]
    6. Simplified23.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\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(C, \left(\left(\mathsf{neg}\left(-1\right)\right) \cdot C\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\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(C, \left(1 \cdot C\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      10. *-lowering-*.f6439.9%

        \[\leadsto \mathsf{/.f64}\left(\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(C, \mathsf{*.f64}\left(1, C\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    9. Simplified39.9%

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

    if -1.35000000000000009e178 < F < -1.9999999999999e-311

    1. Initial program 18.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6424.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999e-311 < F

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, F\right)\right), \mathsf{/.f64}\left(\left(-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{{B}^{2} \cdot \left(C \cdot F\right)}{A}\right), A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Simplified17.8%

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

      \[\leadsto \color{blue}{\frac{1}{4} \cdot \sqrt{\frac{-16 \cdot F - 4 \cdot \frac{{B}^{2} \cdot F}{{A}^{2}}}{C}}} \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(-16, F\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), F\right)\right), \left(A \cdot A\right)\right)\right), C\right)\right)\right) \]
      15. *-lowering-*.f6459.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq -9.2 \cdot 10^{+234}:\\ \;\;\;\;\frac{\sqrt{C \cdot \left(\left(A \cdot -8\right) \cdot \left(F \cdot \left(A + A\right)\right) + \frac{2 \cdot \left(F \cdot \left(2 \cdot \left(A \cdot \left(B \cdot B\right)\right) + \left(B \cdot B\right) \cdot \left(A + A\right)\right)\right)}{C}\right)}}{4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;F \leq -1.35 \cdot 10^{+178}:\\ \;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(\left(C \cdot F\right) \cdot \left(C + C\right)\right)}}{4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;F \leq -2 \cdot 10^{-311}:\\ \;\;\;\;\frac{-1}{B} \cdot \sqrt{-2 \cdot \left(B \cdot F\right)}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \sqrt{\frac{F \cdot -16 + \frac{-4 \cdot \left(F \cdot \left(B \cdot B\right)\right)}{A \cdot A}}{C}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 31.8% accurate, 4.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq -2.05 \cdot 10^{+178}:\\ \;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(\left(C \cdot F\right) \cdot \left(C + C\right)\right)}}{4 \cdot \left(A \cdot C\right)}\\ \mathbf{elif}\;F \leq -2 \cdot 10^{-311}:\\ \;\;\;\;\frac{-1}{B\_m} \cdot \sqrt{-2 \cdot \left(B\_m \cdot F\right)}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \sqrt{\frac{F \cdot -16 + \frac{-4 \cdot \left(F \cdot \left(B\_m \cdot B\_m\right)\right)}{A \cdot A}}{C}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F -2.05e+178)
   (/ (sqrt (* (* A -8.0) (* (* C F) (+ C C)))) (* 4.0 (* A C)))
   (if (<= F -2e-311)
     (* (/ -1.0 B_m) (sqrt (* -2.0 (* B_m F))))
     (*
      0.25
      (sqrt (/ (+ (* F -16.0) (/ (* -4.0 (* F (* B_m B_m))) (* A A))) C))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -2.05e+178) {
		tmp = sqrt(((A * -8.0) * ((C * F) * (C + C)))) / (4.0 * (A * C));
	} else if (F <= -2e-311) {
		tmp = (-1.0 / B_m) * sqrt((-2.0 * (B_m * F)));
	} else {
		tmp = 0.25 * sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C));
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (f <= (-2.05d+178)) then
        tmp = sqrt(((a * (-8.0d0)) * ((c * f) * (c + c)))) / (4.0d0 * (a * c))
    else if (f <= (-2d-311)) then
        tmp = ((-1.0d0) / b_m) * sqrt(((-2.0d0) * (b_m * f)))
    else
        tmp = 0.25d0 * sqrt((((f * (-16.0d0)) + (((-4.0d0) * (f * (b_m * b_m))) / (a * a))) / c))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -2.05e+178) {
		tmp = Math.sqrt(((A * -8.0) * ((C * F) * (C + C)))) / (4.0 * (A * C));
	} else if (F <= -2e-311) {
		tmp = (-1.0 / B_m) * Math.sqrt((-2.0 * (B_m * F)));
	} else {
		tmp = 0.25 * Math.sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if F <= -2.05e+178:
		tmp = math.sqrt(((A * -8.0) * ((C * F) * (C + C)))) / (4.0 * (A * C))
	elif F <= -2e-311:
		tmp = (-1.0 / B_m) * math.sqrt((-2.0 * (B_m * F)))
	else:
		tmp = 0.25 * math.sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= -2.05e+178)
		tmp = Float64(sqrt(Float64(Float64(A * -8.0) * Float64(Float64(C * F) * Float64(C + C)))) / Float64(4.0 * Float64(A * C)));
	elseif (F <= -2e-311)
		tmp = Float64(Float64(-1.0 / B_m) * sqrt(Float64(-2.0 * Float64(B_m * F))));
	else
		tmp = Float64(0.25 * sqrt(Float64(Float64(Float64(F * -16.0) + Float64(Float64(-4.0 * Float64(F * Float64(B_m * B_m))) / Float64(A * A))) / C)));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (F <= -2.05e+178)
		tmp = sqrt(((A * -8.0) * ((C * F) * (C + C)))) / (4.0 * (A * C));
	elseif (F <= -2e-311)
		tmp = (-1.0 / B_m) * sqrt((-2.0 * (B_m * F)));
	else
		tmp = 0.25 * sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -2.05e+178], N[(N[Sqrt[N[(N[(A * -8.0), $MachinePrecision] * N[(N[(C * F), $MachinePrecision] * N[(C + C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2e-311], N[(N[(-1.0 / B$95$m), $MachinePrecision] * N[Sqrt[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.25 * N[Sqrt[N[(N[(N[(F * -16.0), $MachinePrecision] + N[(N[(-4.0 * N[(F * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.05 \cdot 10^{+178}:\\
\;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(\left(C \cdot F\right) \cdot \left(C + C\right)\right)}}{4 \cdot \left(A \cdot C\right)}\\

\mathbf{elif}\;F \leq -2 \cdot 10^{-311}:\\
\;\;\;\;\frac{-1}{B\_m} \cdot \sqrt{-2 \cdot \left(B\_m \cdot F\right)}\\

\mathbf{else}:\\
\;\;\;\;0.25 \cdot \sqrt{\frac{F \cdot -16 + \frac{-4 \cdot \left(F \cdot \left(B\_m \cdot B\_m\right)\right)}{A \cdot A}}{C}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < -2.04999999999999998e178

    1. Initial program 14.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. Simplified13.3%

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, -4\right)\right)\right), \mathsf{*.f64}\left(\mathsf{\_.f64}\left(A, \mathsf{\_.f64}\left(\mathsf{hypot.f64}\left(B, \mathsf{\_.f64}\left(A, C\right)\right), C\right)\right), \mathsf{*.f64}\left(2, F\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, \color{blue}{C}\right)\right)\right) \]
    6. Simplified13.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\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(C, \left(\left(\mathsf{neg}\left(-1\right)\right) \cdot C\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\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(C, \left(1 \cdot C\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      10. *-lowering-*.f6418.9%

        \[\leadsto \mathsf{/.f64}\left(\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(C, \mathsf{*.f64}\left(1, C\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    9. Simplified18.9%

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

    if -2.04999999999999998e178 < F < -1.9999999999999e-311

    1. Initial program 18.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6424.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999e-311 < F

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, F\right)\right), \mathsf{/.f64}\left(\left(-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{{B}^{2} \cdot \left(C \cdot F\right)}{A}\right), A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Simplified17.8%

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

      \[\leadsto \color{blue}{\frac{1}{4} \cdot \sqrt{\frac{-16 \cdot F - 4 \cdot \frac{{B}^{2} \cdot F}{{A}^{2}}}{C}}} \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(-16, F\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), F\right)\right), \left(A \cdot A\right)\right)\right), C\right)\right)\right) \]
      15. *-lowering-*.f6459.2%

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

      \[\leadsto \color{blue}{0.25 \cdot \sqrt{\frac{-16 \cdot F + \frac{-4 \cdot \left(\left(B \cdot B\right) \cdot F\right)}{A \cdot A}}{C}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification26.8%

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

Alternative 10: 32.2% accurate, 5.1× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;F \leq -2 \cdot 10^{-311}:\\ \;\;\;\;\frac{-1}{B\_m} \cdot \sqrt{-2 \cdot \left(B\_m \cdot F\right)}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \sqrt{\frac{F \cdot -16 + \frac{-4 \cdot \left(F \cdot \left(B\_m \cdot B\_m\right)\right)}{A \cdot A}}{C}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F -2e-311)
   (* (/ -1.0 B_m) (sqrt (* -2.0 (* B_m F))))
   (*
    0.25
    (sqrt (/ (+ (* F -16.0) (/ (* -4.0 (* F (* B_m B_m))) (* A A))) C)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -2e-311) {
		tmp = (-1.0 / B_m) * sqrt((-2.0 * (B_m * F)));
	} else {
		tmp = 0.25 * sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C));
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (f <= (-2d-311)) then
        tmp = ((-1.0d0) / b_m) * sqrt(((-2.0d0) * (b_m * f)))
    else
        tmp = 0.25d0 * sqrt((((f * (-16.0d0)) + (((-4.0d0) * (f * (b_m * b_m))) / (a * a))) / c))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -2e-311) {
		tmp = (-1.0 / B_m) * Math.sqrt((-2.0 * (B_m * F)));
	} else {
		tmp = 0.25 * Math.sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if F <= -2e-311:
		tmp = (-1.0 / B_m) * math.sqrt((-2.0 * (B_m * F)))
	else:
		tmp = 0.25 * math.sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= -2e-311)
		tmp = Float64(Float64(-1.0 / B_m) * sqrt(Float64(-2.0 * Float64(B_m * F))));
	else
		tmp = Float64(0.25 * sqrt(Float64(Float64(Float64(F * -16.0) + Float64(Float64(-4.0 * Float64(F * Float64(B_m * B_m))) / Float64(A * A))) / C)));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (F <= -2e-311)
		tmp = (-1.0 / B_m) * sqrt((-2.0 * (B_m * F)));
	else
		tmp = 0.25 * sqrt((((F * -16.0) + ((-4.0 * (F * (B_m * B_m))) / (A * A))) / C));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[F, -2e-311], N[(N[(-1.0 / B$95$m), $MachinePrecision] * N[Sqrt[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(0.25 * N[Sqrt[N[(N[(N[(F * -16.0), $MachinePrecision] + N[(N[(-4.0 * N[(F * N[(B$95$m * B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(A * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / C), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{-311}:\\
\;\;\;\;\frac{-1}{B\_m} \cdot \sqrt{-2 \cdot \left(B\_m \cdot F\right)}\\

\mathbf{else}:\\
\;\;\;\;0.25 \cdot \sqrt{\frac{F \cdot -16 + \frac{-4 \cdot \left(F \cdot \left(B\_m \cdot B\_m\right)\right)}{A \cdot A}}{C}}\\


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

    1. Initial program 17.6%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6420.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified20.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9999999999999e-311 < F

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, F\right)\right), \mathsf{/.f64}\left(\left(-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{{B}^{2} \cdot \left(C \cdot F\right)}{A}\right), A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Simplified17.8%

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

      \[\leadsto \color{blue}{\frac{1}{4} \cdot \sqrt{\frac{-16 \cdot F - 4 \cdot \frac{{B}^{2} \cdot F}{{A}^{2}}}{C}}} \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(-16, F\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(-4, \mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), F\right)\right), \left(A \cdot A\right)\right)\right), C\right)\right)\right) \]
      15. *-lowering-*.f6459.2%

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

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

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

Alternative 11: 32.4% accurate, 5.2× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;B\_m \leq 4.4 \cdot 10^{-60}:\\ \;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(C \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B\_m} \cdot \sqrt{2 \cdot \left(F \cdot \left(C - B\_m\right)\right)}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= B_m 4.4e-60)
   (/ (sqrt (* (* A -8.0) (* C (* F (+ A A))))) (* 4.0 (* A C)))
   (* (/ -1.0 B_m) (sqrt (* 2.0 (* F (- C B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 4.4e-60) {
		tmp = sqrt(((A * -8.0) * (C * (F * (A + A))))) / (4.0 * (A * C));
	} else {
		tmp = (-1.0 / B_m) * sqrt((2.0 * (F * (C - B_m))));
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (b_m <= 4.4d-60) then
        tmp = sqrt(((a * (-8.0d0)) * (c * (f * (a + a))))) / (4.0d0 * (a * c))
    else
        tmp = ((-1.0d0) / b_m) * sqrt((2.0d0 * (f * (c - b_m))))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 4.4e-60) {
		tmp = Math.sqrt(((A * -8.0) * (C * (F * (A + A))))) / (4.0 * (A * C));
	} else {
		tmp = (-1.0 / B_m) * Math.sqrt((2.0 * (F * (C - B_m))));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if B_m <= 4.4e-60:
		tmp = math.sqrt(((A * -8.0) * (C * (F * (A + A))))) / (4.0 * (A * C))
	else:
		tmp = (-1.0 / B_m) * math.sqrt((2.0 * (F * (C - B_m))))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (B_m <= 4.4e-60)
		tmp = Float64(sqrt(Float64(Float64(A * -8.0) * Float64(C * Float64(F * Float64(A + A))))) / Float64(4.0 * Float64(A * C)));
	else
		tmp = Float64(Float64(-1.0 / B_m) * sqrt(Float64(2.0 * Float64(F * Float64(C - B_m)))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (B_m <= 4.4e-60)
		tmp = sqrt(((A * -8.0) * (C * (F * (A + A))))) / (4.0 * (A * C));
	else
		tmp = (-1.0 / B_m) * sqrt((2.0 * (F * (C - B_m))));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 4.4e-60], N[(N[Sqrt[N[(N[(A * -8.0), $MachinePrecision] * N[(C * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / B$95$m), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(F * N[(C - B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 4.4 \cdot 10^{-60}:\\
\;\;\;\;\frac{\sqrt{\left(A \cdot -8\right) \cdot \left(C \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{4 \cdot \left(A \cdot C\right)}\\

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


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

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

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\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), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    8. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(-1 \cdot A\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      7. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \left(\mathsf{neg}\left(A\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      8. neg-lowering-neg.f6414.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(-8, A\right), \mathsf{*.f64}\left(C, \mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(A, \mathsf{neg.f64}\left(A\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    9. Simplified14.4%

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

    if 4.3999999999999998e-60 < B

    1. Initial program 19.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6448.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified48.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 31.0% accurate, 5.3× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;B\_m \leq 6.2 \cdot 10^{-61}:\\ \;\;\;\;\frac{\sqrt{-16 \cdot \left(F \cdot \left(A \cdot \left(C \cdot C\right)\right)\right)}}{4 \cdot \left(A \cdot C\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B\_m} \cdot \sqrt{2 \cdot \left(F \cdot \left(C - B\_m\right)\right)}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= B_m 6.2e-61)
   (/ (sqrt (* -16.0 (* F (* A (* C C))))) (* 4.0 (* A C)))
   (* (/ -1.0 B_m) (sqrt (* 2.0 (* F (- C B_m)))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 6.2e-61) {
		tmp = sqrt((-16.0 * (F * (A * (C * C))))) / (4.0 * (A * C));
	} else {
		tmp = (-1.0 / B_m) * sqrt((2.0 * (F * (C - B_m))));
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (b_m <= 6.2d-61) then
        tmp = sqrt(((-16.0d0) * (f * (a * (c * c))))) / (4.0d0 * (a * c))
    else
        tmp = ((-1.0d0) / b_m) * sqrt((2.0d0 * (f * (c - b_m))))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (B_m <= 6.2e-61) {
		tmp = Math.sqrt((-16.0 * (F * (A * (C * C))))) / (4.0 * (A * C));
	} else {
		tmp = (-1.0 / B_m) * Math.sqrt((2.0 * (F * (C - B_m))));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if B_m <= 6.2e-61:
		tmp = math.sqrt((-16.0 * (F * (A * (C * C))))) / (4.0 * (A * C))
	else:
		tmp = (-1.0 / B_m) * math.sqrt((2.0 * (F * (C - B_m))))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (B_m <= 6.2e-61)
		tmp = Float64(sqrt(Float64(-16.0 * Float64(F * Float64(A * Float64(C * C))))) / Float64(4.0 * Float64(A * C)));
	else
		tmp = Float64(Float64(-1.0 / B_m) * sqrt(Float64(2.0 * Float64(F * Float64(C - B_m)))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (B_m <= 6.2e-61)
		tmp = sqrt((-16.0 * (F * (A * (C * C))))) / (4.0 * (A * C));
	else
		tmp = (-1.0 / B_m) * sqrt((2.0 * (F * (C - B_m))));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[B$95$m, 6.2e-61], N[(N[Sqrt[N[(-16.0 * N[(F * N[(A * N[(C * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / B$95$m), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(F * N[(C - B$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;B\_m \leq 6.2 \cdot 10^{-61}:\\
\;\;\;\;\frac{\sqrt{-16 \cdot \left(F \cdot \left(A \cdot \left(C \cdot C\right)\right)\right)}}{4 \cdot \left(A \cdot C\right)}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, \left(C \cdot C\right)\right), F\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
      6. *-lowering-*.f6412.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(\mathsf{*.f64}\left(A, \mathsf{*.f64}\left(C, C\right)\right), F\right)\right)\right), \mathsf{*.f64}\left(4, \mathsf{*.f64}\left(A, C\right)\right)\right) \]
    9. Simplified12.1%

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

    if 6.1999999999999999e-61 < B

    1. Initial program 19.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6448.3%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified48.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 27.6% accurate, 5.4× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;A \leq -2.45 \cdot 10^{+122}:\\ \;\;\;\;\frac{\sqrt{\left(B\_m \cdot B\_m\right) \cdot \left(0 - \frac{F}{C}\right)}}{0 - B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{B\_m} \cdot \sqrt{-2 \cdot \left(B\_m \cdot F\right)}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= A -2.45e+122)
   (/ (sqrt (* (* B_m B_m) (- 0.0 (/ F C)))) (- 0.0 B_m))
   (* (/ -1.0 B_m) (sqrt (* -2.0 (* B_m F))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (A <= -2.45e+122) {
		tmp = sqrt(((B_m * B_m) * (0.0 - (F / C)))) / (0.0 - B_m);
	} else {
		tmp = (-1.0 / B_m) * sqrt((-2.0 * (B_m * F)));
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (a <= (-2.45d+122)) then
        tmp = sqrt(((b_m * b_m) * (0.0d0 - (f / c)))) / (0.0d0 - b_m)
    else
        tmp = ((-1.0d0) / b_m) * sqrt(((-2.0d0) * (b_m * f)))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (A <= -2.45e+122) {
		tmp = Math.sqrt(((B_m * B_m) * (0.0 - (F / C)))) / (0.0 - B_m);
	} else {
		tmp = (-1.0 / B_m) * Math.sqrt((-2.0 * (B_m * F)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if A <= -2.45e+122:
		tmp = math.sqrt(((B_m * B_m) * (0.0 - (F / C)))) / (0.0 - B_m)
	else:
		tmp = (-1.0 / B_m) * math.sqrt((-2.0 * (B_m * F)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (A <= -2.45e+122)
		tmp = Float64(sqrt(Float64(Float64(B_m * B_m) * Float64(0.0 - Float64(F / C)))) / Float64(0.0 - B_m));
	else
		tmp = Float64(Float64(-1.0 / B_m) * sqrt(Float64(-2.0 * Float64(B_m * F))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (A <= -2.45e+122)
		tmp = sqrt(((B_m * B_m) * (0.0 - (F / C)))) / (0.0 - B_m);
	else
		tmp = (-1.0 / B_m) * sqrt((-2.0 * (B_m * F)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[A, -2.45e+122], N[(N[Sqrt[N[(N[(B$95$m * B$95$m), $MachinePrecision] * N[(0.0 - N[(F / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / B$95$m), $MachinePrecision] * N[Sqrt[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;A \leq -2.45 \cdot 10^{+122}:\\
\;\;\;\;\frac{\sqrt{\left(B\_m \cdot B\_m\right) \cdot \left(0 - \frac{F}{C}\right)}}{0 - B\_m}\\

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


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

    1. Initial program 3.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 A around 0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f644.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified4.5%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(\sqrt{2}\right)\right) \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right), \color{blue}{B}\right) \]
    7. Applied egg-rr4.5%

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\left({B}^{2}\right), \left(\frac{F}{C}\right)\right)\right)\right)\right), B\right) \]
      5. unpow2N/A

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \left(\frac{F}{C}\right)\right)\right)\right)\right), B\right) \]
      7. /-lowering-/.f6421.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(B, B\right), \mathsf{/.f64}\left(F, C\right)\right)\right)\right)\right), B\right) \]
    10. Simplified21.8%

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

    if -2.4499999999999999e122 < A

    1. Initial program 21.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 A around 0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6420.2%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified20.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 7.7% accurate, 5.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;C \leq -6.5 \cdot 10^{-256}:\\
\;\;\;\;\frac{\frac{\sqrt{C \cdot F}}{B\_m}}{-0.5}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < -6.50000000000000052e-256

    1. Initial program 24.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 A around 0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6419.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified19.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right), \left(\frac{B}{\sqrt{2}}\right)\right) \]
      10. hypot-defineN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right), \mathsf{/.f64}\left(B, \color{blue}{\left(\sqrt{2}\right)}\right)\right) \]
      13. sqrt-lowering-sqrt.f6418.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right), \mathsf{/.f64}\left(B, \mathsf{sqrt.f64}\left(2\right)\right)\right) \]
    7. Applied egg-rr18.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), \left(\frac{-2}{B}\right)\right) \]
      11. /-lowering-/.f645.5%

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

      \[\leadsto \color{blue}{\sqrt{F \cdot C} \cdot \frac{-2}{B}} \]
    11. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \sqrt{F \cdot C} \cdot \frac{1}{\color{blue}{\frac{B}{-2}}} \]
      2. un-div-invN/A

        \[\leadsto \frac{\sqrt{F \cdot C}}{\color{blue}{\frac{B}{-2}}} \]
      3. div-invN/A

        \[\leadsto \frac{\sqrt{F \cdot C}}{B \cdot \color{blue}{\frac{1}{-2}}} \]
      4. associate-/r*N/A

        \[\leadsto \frac{\frac{\sqrt{F \cdot C}}{B}}{\color{blue}{\frac{1}{-2}}} \]
      5. *-lft-identityN/A

        \[\leadsto \frac{\frac{1 \cdot \sqrt{F \cdot C}}{B}}{\frac{1}{-2}} \]
      6. associate-*l/N/A

        \[\leadsto \frac{\frac{1}{B} \cdot \sqrt{F \cdot C}}{\frac{\color{blue}{1}}{-2}} \]
      7. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{1 \cdot \sqrt{F \cdot C}}{B}\right), \left(\frac{\color{blue}{1}}{-2}\right)\right) \]
      9. *-lft-identityN/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), B\right), \left(\frac{1}{-2}\right)\right) \]
      13. metadata-eval5.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), B\right), \frac{-1}{2}\right) \]
    12. Applied egg-rr5.5%

      \[\leadsto \color{blue}{\frac{\frac{\sqrt{F \cdot C}}{B}}{-0.5}} \]

    if -6.50000000000000052e-256 < C

    1. Initial program 12.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. Simplified16.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)} \]
    10. Step-by-step derivation
      1. un-div-invN/A

        \[\leadsto -2 \cdot \frac{\sqrt{A \cdot F}}{\color{blue}{B}} \]
      2. clear-numN/A

        \[\leadsto -2 \cdot \frac{1}{\color{blue}{\frac{B}{\sqrt{A \cdot F}}}} \]
      3. un-div-invN/A

        \[\leadsto \frac{-2}{\color{blue}{\frac{B}{\sqrt{A \cdot F}}}} \]
      4. /-lowering-/.f64N/A

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(-2, \mathsf{/.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right)\right)\right) \]
    11. Applied egg-rr3.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -6.5 \cdot 10^{-256}:\\ \;\;\;\;\frac{\frac{\sqrt{C \cdot F}}{B}}{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{\frac{B}{\sqrt{A \cdot F}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 7.7% accurate, 5.7× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;C \leq -5.2 \cdot 10^{-256}:\\ \;\;\;\;\sqrt{C \cdot F} \cdot \frac{-2}{B\_m}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{\frac{B\_m}{\sqrt{A \cdot F}}}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= C -5.2e-256)
   (* (sqrt (* C F)) (/ -2.0 B_m))
   (/ -2.0 (/ B_m (sqrt (* A F))))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= -5.2e-256) {
		tmp = sqrt((C * F)) * (-2.0 / B_m);
	} else {
		tmp = -2.0 / (B_m / sqrt((A * F)));
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (c <= (-5.2d-256)) then
        tmp = sqrt((c * f)) * ((-2.0d0) / b_m)
    else
        tmp = (-2.0d0) / (b_m / sqrt((a * f)))
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= -5.2e-256) {
		tmp = Math.sqrt((C * F)) * (-2.0 / B_m);
	} else {
		tmp = -2.0 / (B_m / Math.sqrt((A * F)));
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if C <= -5.2e-256:
		tmp = math.sqrt((C * F)) * (-2.0 / B_m)
	else:
		tmp = -2.0 / (B_m / math.sqrt((A * F)))
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (C <= -5.2e-256)
		tmp = Float64(sqrt(Float64(C * F)) * Float64(-2.0 / B_m));
	else
		tmp = Float64(-2.0 / Float64(B_m / sqrt(Float64(A * F))));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (C <= -5.2e-256)
		tmp = sqrt((C * F)) * (-2.0 / B_m);
	else
		tmp = -2.0 / (B_m / sqrt((A * F)));
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[C, -5.2e-256], N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] * N[(-2.0 / B$95$m), $MachinePrecision]), $MachinePrecision], N[(-2.0 / N[(B$95$m / N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|

\\
\begin{array}{l}
\mathbf{if}\;C \leq -5.2 \cdot 10^{-256}:\\
\;\;\;\;\sqrt{C \cdot F} \cdot \frac{-2}{B\_m}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < -5.2000000000000002e-256

    1. Initial program 24.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 A around 0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6419.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified19.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right), \left(\frac{B}{\sqrt{2}}\right)\right) \]
      10. hypot-defineN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right), \mathsf{/.f64}\left(B, \color{blue}{\left(\sqrt{2}\right)}\right)\right) \]
      13. sqrt-lowering-sqrt.f6418.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right), \mathsf{/.f64}\left(B, \mathsf{sqrt.f64}\left(2\right)\right)\right) \]
    7. Applied egg-rr18.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), \left(\frac{-2}{B}\right)\right) \]
      11. /-lowering-/.f645.5%

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

      \[\leadsto \color{blue}{\sqrt{F \cdot C} \cdot \frac{-2}{B}} \]

    if -5.2000000000000002e-256 < C

    1. Initial program 12.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. Simplified16.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, F\right)\right), \mathsf{/.f64}\left(\left(-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{{B}^{2} \cdot \left(C \cdot F\right)}{A}\right), A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Simplified7.1%

      \[\leadsto \frac{\sqrt{\color{blue}{\left(A \cdot A\right) \cdot \left(-16 \cdot \left(C \cdot F\right) - \frac{-4 \cdot \left(\left(B \cdot B\right) \cdot F\right) + \frac{4 \cdot \left(\left(\left(B \cdot B\right) \cdot C\right) \cdot F\right)}{A}}{A}\right)}}}{\left(4 \cdot A\right) \cdot C - B \cdot B} \]
    7. Taylor expanded in C around 0

      \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)} \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \color{blue}{\left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left(\sqrt{A \cdot F}\right), \color{blue}{\left(\frac{1}{B}\right)}\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(A \cdot F\right)\right), \left(\frac{\color{blue}{1}}{B}\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(A, F\right)\right), \left(\frac{1}{B}\right)\right)\right) \]
      5. /-lowering-/.f643.6%

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(A, F\right)\right), \mathsf{/.f64}\left(1, \color{blue}{B}\right)\right)\right) \]
    9. Simplified3.6%

      \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)} \]
    10. Step-by-step derivation
      1. un-div-invN/A

        \[\leadsto -2 \cdot \frac{\sqrt{A \cdot F}}{\color{blue}{B}} \]
      2. clear-numN/A

        \[\leadsto -2 \cdot \frac{1}{\color{blue}{\frac{B}{\sqrt{A \cdot F}}}} \]
      3. un-div-invN/A

        \[\leadsto \frac{-2}{\color{blue}{\frac{B}{\sqrt{A \cdot F}}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(-2, \color{blue}{\left(\frac{B}{\sqrt{A \cdot F}}\right)}\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(-2, \mathsf{/.f64}\left(B, \color{blue}{\left(\sqrt{A \cdot F}\right)}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(-2, \mathsf{/.f64}\left(B, \mathsf{sqrt.f64}\left(\left(A \cdot F\right)\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(-2, \mathsf{/.f64}\left(B, \mathsf{sqrt.f64}\left(\left(F \cdot A\right)\right)\right)\right) \]
      8. *-lowering-*.f643.6%

        \[\leadsto \mathsf{/.f64}\left(-2, \mathsf{/.f64}\left(B, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right)\right)\right) \]
    11. Applied egg-rr3.6%

      \[\leadsto \color{blue}{\frac{-2}{\frac{B}{\sqrt{F \cdot A}}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification4.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -5.2 \cdot 10^{-256}:\\ \;\;\;\;\sqrt{C \cdot F} \cdot \frac{-2}{B}\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{\frac{B}{\sqrt{A \cdot F}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 7.7% accurate, 5.7× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \begin{array}{l} \mathbf{if}\;C \leq -4.6 \cdot 10^{-256}:\\ \;\;\;\;\sqrt{C \cdot F} \cdot \frac{-2}{B\_m}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{A \cdot F} \cdot \frac{-2}{B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (if (<= C -4.6e-256)
   (* (sqrt (* C F)) (/ -2.0 B_m))
   (* (sqrt (* A F)) (/ -2.0 B_m))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= -4.6e-256) {
		tmp = sqrt((C * F)) * (-2.0 / B_m);
	} else {
		tmp = sqrt((A * F)) * (-2.0 / B_m);
	}
	return tmp;
}
B_m = abs(b)
real(8) function code(a, b_m, c, f)
    real(8), intent (in) :: a
    real(8), intent (in) :: b_m
    real(8), intent (in) :: c
    real(8), intent (in) :: f
    real(8) :: tmp
    if (c <= (-4.6d-256)) then
        tmp = sqrt((c * f)) * ((-2.0d0) / b_m)
    else
        tmp = sqrt((a * f)) * ((-2.0d0) / b_m)
    end if
    code = tmp
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (C <= -4.6e-256) {
		tmp = Math.sqrt((C * F)) * (-2.0 / B_m);
	} else {
		tmp = Math.sqrt((A * F)) * (-2.0 / B_m);
	}
	return tmp;
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	tmp = 0
	if C <= -4.6e-256:
		tmp = math.sqrt((C * F)) * (-2.0 / B_m)
	else:
		tmp = math.sqrt((A * F)) * (-2.0 / B_m)
	return tmp
B_m = abs(B)
function code(A, B_m, C, F)
	tmp = 0.0
	if (C <= -4.6e-256)
		tmp = Float64(sqrt(Float64(C * F)) * Float64(-2.0 / B_m));
	else
		tmp = Float64(sqrt(Float64(A * F)) * Float64(-2.0 / B_m));
	end
	return tmp
end
B_m = abs(B);
function tmp_2 = code(A, B_m, C, F)
	tmp = 0.0;
	if (C <= -4.6e-256)
		tmp = sqrt((C * F)) * (-2.0 / B_m);
	else
		tmp = sqrt((A * F)) * (-2.0 / B_m);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := If[LessEqual[C, -4.6e-256], N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] * N[(-2.0 / B$95$m), $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|

\\
\begin{array}{l}
\mathbf{if}\;C \leq -4.6 \cdot 10^{-256}:\\
\;\;\;\;\sqrt{C \cdot F} \cdot \frac{-2}{B\_m}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot F} \cdot \frac{-2}{B\_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < -4.6e-256

    1. Initial program 24.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 A around 0

      \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{C} - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
      8. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right) \]
      11. hypot-defineN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
      12. hypot-lowering-hypot.f6419.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
    5. Simplified19.0%

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)}} \]
    6. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \left(-1 \cdot \frac{1}{\frac{B}{\sqrt{2}}}\right) \cdot \sqrt{F \cdot \color{blue}{\left(C - \sqrt{B \cdot B + C \cdot C}\right)}} \]
      2. un-div-invN/A

        \[\leadsto \frac{-1}{\frac{B}{\sqrt{2}}} \cdot \sqrt{\color{blue}{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}} \]
      3. associate-*l/N/A

        \[\leadsto \frac{-1 \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}}{\color{blue}{\frac{B}{\sqrt{2}}}} \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(-1 \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right), \color{blue}{\left(\frac{B}{\sqrt{2}}\right)}\right) \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)\right), \left(\frac{\color{blue}{B}}{\sqrt{2}}\right)\right) \]
      6. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)\right), \left(\frac{\color{blue}{B}}{\sqrt{2}}\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right), \left(\frac{B}{\sqrt{2}}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right), \left(\frac{B}{\sqrt{2}}\right)\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right), \left(\frac{B}{\sqrt{2}}\right)\right) \]
      10. hypot-defineN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right), \left(\frac{B}{\sqrt{2}}\right)\right) \]
      11. hypot-lowering-hypot.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right), \left(\frac{B}{\sqrt{2}}\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right), \mathsf{/.f64}\left(B, \color{blue}{\left(\sqrt{2}\right)}\right)\right) \]
      13. sqrt-lowering-sqrt.f6418.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right), \mathsf{/.f64}\left(B, \mathsf{sqrt.f64}\left(2\right)\right)\right) \]
    7. Applied egg-rr18.9%

      \[\leadsto \color{blue}{\frac{-\sqrt{F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)}}{\frac{B}{\sqrt{2}}}} \]
    8. Taylor expanded in C around -inf

      \[\leadsto \color{blue}{\frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B} \cdot \sqrt{C \cdot F}} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{C \cdot F} \cdot \color{blue}{\frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B}} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{C \cdot F}\right), \color{blue}{\left(\frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)}\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(C \cdot F\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}}{B}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot C\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), \left(\frac{\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      7. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), \left(\frac{-1 \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
      8. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), \left(\frac{-1 \cdot \left(\sqrt{2} \cdot \sqrt{2}\right)}{B}\right)\right) \]
      9. rem-square-sqrtN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), \left(\frac{-1 \cdot 2}{B}\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), \left(\frac{-2}{B}\right)\right) \]
      11. /-lowering-/.f645.5%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), \mathsf{/.f64}\left(-2, \color{blue}{B}\right)\right) \]
    10. Simplified5.5%

      \[\leadsto \color{blue}{\sqrt{F \cdot C} \cdot \frac{-2}{B}} \]

    if -4.6e-256 < C

    1. Initial program 12.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. Simplified16.2%

      \[\leadsto \color{blue}{\frac{\sqrt{\left(B \cdot B + A \cdot \left(C \cdot -4\right)\right) \cdot \left(\left(A - \left(\mathsf{hypot}\left(B, A - C\right) - C\right)\right) \cdot \left(2 \cdot F\right)\right)}}{\left(4 \cdot A\right) \cdot C - B \cdot B}} \]
    3. Add Preprocessing
    4. Taylor expanded in A around -inf

      \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left({A}^{2} \cdot \left(-16 \cdot \left(C \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{{B}^{2} \cdot \left(C \cdot F\right)}{A}}{A}\right)\right)}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    5. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left({A}^{2}\right), \left(-16 \cdot \left(C \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{{B}^{2} \cdot \left(C \cdot F\right)}{A}}{A}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\color{blue}{\mathsf{*.f64}\left(4, A\right)}, C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      2. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(A \cdot A\right), \left(-16 \cdot \left(C \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{{B}^{2} \cdot \left(C \cdot F\right)}{A}}{A}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\color{blue}{4}, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \left(-16 \cdot \left(C \cdot F\right) + -1 \cdot \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{{B}^{2} \cdot \left(C \cdot F\right)}{A}}{A}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\color{blue}{4}, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      4. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \left(-16 \cdot \left(C \cdot F\right) + \left(\mathsf{neg}\left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{{B}^{2} \cdot \left(C \cdot F\right)}{A}}{A}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      5. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \left(-16 \cdot \left(C \cdot F\right) - \frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{{B}^{2} \cdot \left(C \cdot F\right)}{A}}{A}\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, \color{blue}{A}\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      6. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{\_.f64}\left(\left(-16 \cdot \left(C \cdot F\right)\right), \left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{{B}^{2} \cdot \left(C \cdot F\right)}{A}}{A}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, \color{blue}{A}\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \left(C \cdot F\right)\right), \left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{{B}^{2} \cdot \left(C \cdot F\right)}{A}}{A}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, F\right)\right), \left(\frac{-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{{B}^{2} \cdot \left(C \cdot F\right)}{A}}{A}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(A, A\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(-16, \mathsf{*.f64}\left(C, F\right)\right), \mathsf{/.f64}\left(\left(-4 \cdot \left({B}^{2} \cdot F\right) + 4 \cdot \frac{{B}^{2} \cdot \left(C \cdot F\right)}{A}\right), A\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(4, A\right), C\right), \mathsf{*.f64}\left(B, B\right)\right)\right) \]
    6. Simplified7.1%

      \[\leadsto \frac{\sqrt{\color{blue}{\left(A \cdot A\right) \cdot \left(-16 \cdot \left(C \cdot F\right) - \frac{-4 \cdot \left(\left(B \cdot B\right) \cdot F\right) + \frac{4 \cdot \left(\left(\left(B \cdot B\right) \cdot C\right) \cdot F\right)}{A}}{A}\right)}}}{\left(4 \cdot A\right) \cdot C - B \cdot B} \]
    7. Taylor expanded in C around 0

      \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)} \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \color{blue}{\left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)}\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\left(\sqrt{A \cdot F}\right), \color{blue}{\left(\frac{1}{B}\right)}\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(A \cdot F\right)\right), \left(\frac{\color{blue}{1}}{B}\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(A, F\right)\right), \left(\frac{1}{B}\right)\right)\right) \]
      5. /-lowering-/.f643.6%

        \[\leadsto \mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(A, F\right)\right), \mathsf{/.f64}\left(1, \color{blue}{B}\right)\right)\right) \]
    9. Simplified3.6%

      \[\leadsto \color{blue}{-2 \cdot \left(\sqrt{A \cdot F} \cdot \frac{1}{B}\right)} \]
    10. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto -2 \cdot \left(\frac{1}{B} \cdot \color{blue}{\sqrt{A \cdot F}}\right) \]
      2. associate-*r*N/A

        \[\leadsto \left(-2 \cdot \frac{1}{B}\right) \cdot \color{blue}{\sqrt{A \cdot F}} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(-2 \cdot \frac{1}{B}\right), \color{blue}{\left(\sqrt{A \cdot F}\right)}\right) \]
      4. un-div-invN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{-2}{B}\right), \left(\sqrt{\color{blue}{A \cdot F}}\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-2, B\right), \left(\sqrt{\color{blue}{A \cdot F}}\right)\right) \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-2, B\right), \mathsf{sqrt.f64}\left(\left(A \cdot F\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-2, B\right), \mathsf{sqrt.f64}\left(\left(F \cdot A\right)\right)\right) \]
      8. *-lowering-*.f643.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(-2, B\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, A\right)\right)\right) \]
    11. Applied egg-rr3.6%

      \[\leadsto \color{blue}{\frac{-2}{B} \cdot \sqrt{F \cdot A}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification4.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;C \leq -4.6 \cdot 10^{-256}:\\ \;\;\;\;\sqrt{C \cdot F} \cdot \frac{-2}{B}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{A \cdot F} \cdot \frac{-2}{B}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 27.3% accurate, 5.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \frac{-1}{B\_m} \cdot \sqrt{-2 \cdot \left(B\_m \cdot F\right)} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (* (/ -1.0 B_m) (sqrt (* -2.0 (* B_m F)))))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	return (-1.0 / B_m) * sqrt((-2.0 * (B_m * F)));
}
B_m = abs(b)
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 = ((-1.0d0) / b_m) * sqrt(((-2.0d0) * (b_m * f)))
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	return (-1.0 / B_m) * Math.sqrt((-2.0 * (B_m * F)));
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	return (-1.0 / B_m) * math.sqrt((-2.0 * (B_m * F)))
B_m = abs(B)
function code(A, B_m, C, F)
	return Float64(Float64(-1.0 / B_m) * sqrt(Float64(-2.0 * Float64(B_m * F))))
end
B_m = abs(B);
function tmp = code(A, B_m, C, F)
	tmp = (-1.0 / B_m) * sqrt((-2.0 * (B_m * F)));
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := N[(N[(-1.0 / B$95$m), $MachinePrecision] * N[Sqrt[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|

\\
\frac{-1}{B\_m} \cdot \sqrt{-2 \cdot \left(B\_m \cdot F\right)}
\end{array}
Derivation
  1. Initial program 18.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 A around 0

    \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)} \]
  4. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
    5. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{C} - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)\right) \]
    6. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
    8. --lowering--.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right) \]
    9. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right) \]
    10. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right) \]
    11. hypot-defineN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
    12. hypot-lowering-hypot.f6417.4%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
  5. Simplified17.4%

    \[\leadsto \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)}} \]
  6. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)} \cdot \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right)} \]
    2. mul-1-negN/A

      \[\leadsto \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)} \cdot \left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right) \]
    3. distribute-neg-frac2N/A

      \[\leadsto \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)} \cdot \frac{\sqrt{2}}{\color{blue}{\mathsf{neg}\left(B\right)}} \]
    4. div-invN/A

      \[\leadsto \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)} \cdot \left(\sqrt{2} \cdot \color{blue}{\frac{1}{\mathsf{neg}\left(B\right)}}\right) \]
    5. associate-*r*N/A

      \[\leadsto \left(\sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)} \cdot \sqrt{2}\right) \cdot \color{blue}{\frac{1}{\mathsf{neg}\left(B\right)}} \]
    6. *-commutativeN/A

      \[\leadsto \left(\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right) \cdot \frac{\color{blue}{1}}{\mathsf{neg}\left(B\right)} \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{2} \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right), \color{blue}{\left(\frac{1}{\mathsf{neg}\left(B\right)}\right)}\right) \]
  7. Applied egg-rr17.5%

    \[\leadsto \color{blue}{\sqrt{2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)\right)} \cdot \frac{-1}{B}} \]
  8. Taylor expanded in C around 0

    \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-2 \cdot \left(B \cdot F\right)\right)}\right), \mathsf{/.f64}\left(-1, B\right)\right) \]
  9. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \left(B \cdot F\right)\right)\right), \mathsf{/.f64}\left(-1, B\right)\right) \]
    2. *-lowering-*.f6416.0%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(B, F\right)\right)\right), \mathsf{/.f64}\left(-1, B\right)\right) \]
  10. Simplified16.0%

    \[\leadsto \sqrt{\color{blue}{-2 \cdot \left(B \cdot F\right)}} \cdot \frac{-1}{B} \]
  11. Final simplification16.0%

    \[\leadsto \frac{-1}{B} \cdot \sqrt{-2 \cdot \left(B \cdot F\right)} \]
  12. Add Preprocessing

Alternative 18: 27.4% accurate, 5.8× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \frac{\sqrt{-2 \cdot \left(B\_m \cdot F\right)}}{0 - B\_m} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F)
 :precision binary64
 (/ (sqrt (* -2.0 (* B_m F))) (- 0.0 B_m)))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	return sqrt((-2.0 * (B_m * F))) / (0.0 - B_m);
}
B_m = abs(b)
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))) / (0.0d0 - b_m)
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	return Math.sqrt((-2.0 * (B_m * F))) / (0.0 - B_m);
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	return math.sqrt((-2.0 * (B_m * F))) / (0.0 - B_m)
B_m = abs(B)
function code(A, B_m, C, F)
	return Float64(sqrt(Float64(-2.0 * Float64(B_m * F))) / Float64(0.0 - B_m))
end
B_m = abs(B);
function tmp = code(A, B_m, C, F)
	tmp = sqrt((-2.0 * (B_m * F))) / (0.0 - B_m);
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := N[(N[Sqrt[N[(-2.0 * N[(B$95$m * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(0.0 - B$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|

\\
\frac{\sqrt{-2 \cdot \left(B\_m \cdot F\right)}}{0 - B\_m}
\end{array}
Derivation
  1. Initial program 18.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 A around 0

    \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)} \]
  4. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
    5. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{C} - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)\right) \]
    6. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
    8. --lowering--.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right) \]
    9. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right) \]
    10. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right) \]
    11. hypot-defineN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
    12. hypot-lowering-hypot.f6417.4%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
  5. Simplified17.4%

    \[\leadsto \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)}} \]
  6. Step-by-step derivation
    1. mul-1-negN/A

      \[\leadsto \left(\mathsf{neg}\left(\frac{\sqrt{2}}{B}\right)\right) \cdot \sqrt{\color{blue}{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}} \]
    2. distribute-neg-fracN/A

      \[\leadsto \frac{\mathsf{neg}\left(\sqrt{2}\right)}{B} \cdot \sqrt{\color{blue}{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}} \]
    3. associate-*l/N/A

      \[\leadsto \frac{\left(\mathsf{neg}\left(\sqrt{2}\right)\right) \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}}{\color{blue}{B}} \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(\sqrt{2}\right)\right) \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right), \color{blue}{B}\right) \]
  7. Applied egg-rr17.5%

    \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)\right)}}{B}} \]
  8. Taylor expanded in C around 0

    \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\color{blue}{\left(-2 \cdot \left(B \cdot F\right)\right)}\right)\right), B\right) \]
  9. Step-by-step derivation
    1. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \left(B \cdot F\right)\right)\right)\right), B\right) \]
    2. *-lowering-*.f6416.0%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(-2, \mathsf{*.f64}\left(B, F\right)\right)\right)\right), B\right) \]
  10. Simplified16.0%

    \[\leadsto \frac{-\sqrt{\color{blue}{-2 \cdot \left(B \cdot F\right)}}}{B} \]
  11. Final simplification16.0%

    \[\leadsto \frac{\sqrt{-2 \cdot \left(B \cdot F\right)}}{0 - B} \]
  12. Add Preprocessing

Alternative 19: 5.0% accurate, 5.9× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ \sqrt{C \cdot F} \cdot \frac{-2}{B\_m} \end{array} \]
B_m = (fabs.f64 B)
(FPCore (A B_m C F) :precision binary64 (* (sqrt (* C F)) (/ -2.0 B_m)))
B_m = fabs(B);
double code(double A, double B_m, double C, double F) {
	return sqrt((C * F)) * (-2.0 / B_m);
}
B_m = abs(b)
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((c * f)) * ((-2.0d0) / b_m)
end function
B_m = Math.abs(B);
public static double code(double A, double B_m, double C, double F) {
	return Math.sqrt((C * F)) * (-2.0 / B_m);
}
B_m = math.fabs(B)
def code(A, B_m, C, F):
	return math.sqrt((C * F)) * (-2.0 / B_m)
B_m = abs(B)
function code(A, B_m, C, F)
	return Float64(sqrt(Float64(C * F)) * Float64(-2.0 / B_m))
end
B_m = abs(B);
function tmp = code(A, B_m, C, F)
	tmp = sqrt((C * F)) * (-2.0 / B_m);
end
B_m = N[Abs[B], $MachinePrecision]
code[A_, B$95$m_, C_, F_] := N[(N[Sqrt[N[(C * F), $MachinePrecision]], $MachinePrecision] * N[(-2.0 / B$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|

\\
\sqrt{C \cdot F} \cdot \frac{-2}{B\_m}
\end{array}
Derivation
  1. Initial program 18.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 A around 0

    \[\leadsto \color{blue}{-1 \cdot \left(\frac{\sqrt{2}}{B} \cdot \sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)} \]
  4. Step-by-step derivation
    1. associate-*r*N/A

      \[\leadsto \left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \color{blue}{\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}} \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(-1 \cdot \frac{\sqrt{2}}{B}\right), \color{blue}{\left(\sqrt{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)}\right) \]
    3. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{\sqrt{2}}{B}\right)\right), \left(\sqrt{\color{blue}{F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\left(\sqrt{2}\right), B\right)\right), \left(\sqrt{F \cdot \color{blue}{\left(C - \sqrt{{B}^{2} + {C}^{2}}\right)}}\right)\right) \]
    5. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \left(\sqrt{F \cdot \left(\color{blue}{C} - \sqrt{{B}^{2} + {C}^{2}}\right)}\right)\right) \]
    6. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right) \]
    8. --lowering--.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{{B}^{2} + {C}^{2}}\right)\right)\right)\right)\right) \]
    9. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + {C}^{2}}\right)\right)\right)\right)\right) \]
    10. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right) \]
    11. hypot-defineN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right) \]
    12. hypot-lowering-hypot.f6417.4%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(2\right), B\right)\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right) \]
  5. Simplified17.4%

    \[\leadsto \color{blue}{\left(-1 \cdot \frac{\sqrt{2}}{B}\right) \cdot \sqrt{F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)}} \]
  6. Step-by-step derivation
    1. clear-numN/A

      \[\leadsto \left(-1 \cdot \frac{1}{\frac{B}{\sqrt{2}}}\right) \cdot \sqrt{F \cdot \color{blue}{\left(C - \sqrt{B \cdot B + C \cdot C}\right)}} \]
    2. un-div-invN/A

      \[\leadsto \frac{-1}{\frac{B}{\sqrt{2}}} \cdot \sqrt{\color{blue}{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}} \]
    3. associate-*l/N/A

      \[\leadsto \frac{-1 \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}}{\color{blue}{\frac{B}{\sqrt{2}}}} \]
    4. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\left(-1 \cdot \sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right), \color{blue}{\left(\frac{B}{\sqrt{2}}\right)}\right) \]
    5. mul-1-negN/A

      \[\leadsto \mathsf{/.f64}\left(\left(\mathsf{neg}\left(\sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)\right), \left(\frac{\color{blue}{B}}{\sqrt{2}}\right)\right) \]
    6. neg-lowering-neg.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\left(\sqrt{F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)}\right)\right), \left(\frac{\color{blue}{B}}{\sqrt{2}}\right)\right) \]
    7. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot \left(C - \sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right), \left(\frac{B}{\sqrt{2}}\right)\right) \]
    8. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \left(C - \sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right), \left(\frac{B}{\sqrt{2}}\right)\right) \]
    9. --lowering--.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\sqrt{B \cdot B + C \cdot C}\right)\right)\right)\right)\right), \left(\frac{B}{\sqrt{2}}\right)\right) \]
    10. hypot-defineN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \left(\mathsf{hypot}\left(B, C\right)\right)\right)\right)\right)\right), \left(\frac{B}{\sqrt{2}}\right)\right) \]
    11. hypot-lowering-hypot.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right), \left(\frac{B}{\sqrt{2}}\right)\right) \]
    12. /-lowering-/.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right), \mathsf{/.f64}\left(B, \color{blue}{\left(\sqrt{2}\right)}\right)\right) \]
    13. sqrt-lowering-sqrt.f6417.4%

      \[\leadsto \mathsf{/.f64}\left(\mathsf{neg.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, \mathsf{\_.f64}\left(C, \mathsf{hypot.f64}\left(B, C\right)\right)\right)\right)\right), \mathsf{/.f64}\left(B, \mathsf{sqrt.f64}\left(2\right)\right)\right) \]
  7. Applied egg-rr17.4%

    \[\leadsto \color{blue}{\frac{-\sqrt{F \cdot \left(C - \mathsf{hypot}\left(B, C\right)\right)}}{\frac{B}{\sqrt{2}}}} \]
  8. Taylor expanded in C around -inf

    \[\leadsto \color{blue}{\frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B} \cdot \sqrt{C \cdot F}} \]
  9. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \sqrt{C \cdot F} \cdot \color{blue}{\frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B}} \]
    2. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{C \cdot F}\right), \color{blue}{\left(\frac{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)}\right) \]
    3. sqrt-lowering-sqrt.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(C \cdot F\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}}}{B}\right)\right) \]
    4. *-commutativeN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(F \cdot C\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), \left(\frac{\color{blue}{{\left(\sqrt{-1}\right)}^{2}} \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
    6. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), \left(\frac{\left(\sqrt{-1} \cdot \sqrt{-1}\right) \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
    7. rem-square-sqrtN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), \left(\frac{-1 \cdot {\left(\sqrt{2}\right)}^{2}}{B}\right)\right) \]
    8. unpow2N/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), \left(\frac{-1 \cdot \left(\sqrt{2} \cdot \sqrt{2}\right)}{B}\right)\right) \]
    9. rem-square-sqrtN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), \left(\frac{-1 \cdot 2}{B}\right)\right) \]
    10. metadata-evalN/A

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), \left(\frac{-2}{B}\right)\right) \]
    11. /-lowering-/.f643.1%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(F, C\right)\right), \mathsf{/.f64}\left(-2, \color{blue}{B}\right)\right) \]
  10. Simplified3.1%

    \[\leadsto \color{blue}{\sqrt{F \cdot C} \cdot \frac{-2}{B}} \]
  11. Final simplification3.1%

    \[\leadsto \sqrt{C \cdot F} \cdot \frac{-2}{B} \]
  12. Add Preprocessing

Reproduce

?
herbie shell --seed 2024164 
(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))))