ABCF->ab-angle a

Percentage Accurate: 19.7% → 61.6%
Time: 40.8s
Alternatives: 18
Speedup: 6.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 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: 61.6% accurate, 0.2× speedup?

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

\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-173}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(2 \cdot t\_4\right)} \cdot \sqrt{t\_3}}{-t\_4}\\

\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(2, C, -0.5 \cdot \frac{{B\_m}^{2}}{A}\right)} \cdot \sqrt{2 \cdot \left(F \cdot \left({B\_m}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)}}{t\_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 2 (*.f64 (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C)) F)) (+.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (-.f64 (pow.f64 B 2) (*.f64 (*.f64 4 A) C))) < -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 26.1%

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

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

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

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

    1. Initial program 95.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. Simplified95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 12.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 -inf 33.9%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 49.2% accurate, 1.2× speedup?

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

\mathbf{elif}\;{B\_m}^{2} \leq 4 \cdot 10^{-110}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot C\right) \cdot \left(2 \cdot \left(-4 \cdot \left(A \cdot \left(C \cdot F\right)\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - {B\_m}^{2}}\\

\mathbf{elif}\;{B\_m}^{2} \leq 4 \cdot 10^{+46}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (pow.f64 B 2) < 5.00000000000000008e-295 or 4.0000000000000002e-110 < (pow.f64 B 2) < 4e46

    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. Simplified28.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{-\sqrt{\color{blue}{-2 \cdot \frac{A}{F}}} \cdot \frac{1}{\sqrt{2}}} \]

    if 5.00000000000000008e-295 < (pow.f64 B 2) < 4.0000000000000002e-110

    1. Initial program 28.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 -inf 34.6%

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

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

    if 4e46 < (pow.f64 B 2)

    1. Initial program 11.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 B around inf 21.8%

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

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

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    6. Step-by-step derivation
      1. sqrt-div25.9%

        \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
    7. Applied egg-rr25.9%

      \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
    8. Step-by-step derivation
      1. associate-*l/25.9%

        \[\leadsto -\color{blue}{\frac{\sqrt{F} \cdot \sqrt{2}}{\sqrt{B}}} \]
      2. sqrt-unprod26.0%

        \[\leadsto -\frac{\color{blue}{\sqrt{F \cdot 2}}}{\sqrt{B}} \]
    9. Applied egg-rr26.0%

      \[\leadsto -\color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    10. Step-by-step derivation
      1. div-inv26.0%

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

        \[\leadsto -\sqrt{F \cdot 2} \cdot \frac{1}{\color{blue}{{B}^{0.5}}} \]
      3. pow-flip26.0%

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

        \[\leadsto -\sqrt{F \cdot 2} \cdot {B}^{\color{blue}{-0.5}} \]
    11. Applied egg-rr26.0%

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

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

Alternative 3: 56.7% accurate, 1.4× speedup?

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

\mathbf{elif}\;B\_m \leq 4.2 \cdot 10^{-142}:\\
\;\;\;\;\frac{1}{\sqrt{-2 \cdot \frac{A}{F}} \cdot \frac{-1}{\sqrt{2}}}\\

\mathbf{elif}\;B\_m \leq 1.6 \cdot 10^{+23}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(-0.5 \cdot \frac{{B\_m}^{2}}{A} + 2 \cdot C\right)}}{t\_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if B < 3.5999999999999999e-227

    1. Initial program 17.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 -inf 16.9%

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

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

    if 3.5999999999999999e-227 < B < 4.1999999999999999e-142

    1. Initial program 12.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. Simplified12.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{-\sqrt{\color{blue}{-2 \cdot \frac{A}{F}}} \cdot \frac{1}{\sqrt{2}}} \]

    if 4.1999999999999999e-142 < B < 1.6e23

    1. Initial program 32.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 -inf 31.1%

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

    if 1.6e23 < B

    1. Initial program 10.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. Simplified11.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 56.8% accurate, 1.4× speedup?

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

\mathbf{elif}\;B\_m \leq 6 \cdot 10^{-140}:\\
\;\;\;\;\frac{1}{\sqrt{-2 \cdot \frac{A}{F}} \cdot \frac{-1}{\sqrt{2}}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if B < 3.5999999999999999e-227

    1. Initial program 17.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 -inf 16.9%

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

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

    if 3.5999999999999999e-227 < B < 6.00000000000000037e-140

    1. Initial program 12.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. Simplified12.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{-\sqrt{\color{blue}{-2 \cdot \frac{A}{F}}} \cdot \frac{1}{\sqrt{2}}} \]

    if 6.00000000000000037e-140 < B < 8.1999999999999997e34

    1. Initial program 34.3%

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

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

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

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

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

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

    if 8.1999999999999997e34 < B

    1. Initial program 8.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 57.1% accurate, 1.5× speedup?

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

\mathbf{elif}\;B\_m \leq 6.4 \cdot 10^{-142}:\\
\;\;\;\;\frac{1}{\sqrt{-2 \cdot \frac{A}{F}} \cdot \frac{-1}{\sqrt{2}}}\\

\mathbf{elif}\;B\_m \leq 2.6 \cdot 10^{-51}:\\
\;\;\;\;\frac{-1}{\frac{t\_0}{\sqrt{t\_0 \cdot \left(4 \cdot \left(C \cdot F\right)\right)}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if B < 1.9499999999999999e-226

    1. Initial program 17.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 -inf 16.9%

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

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

    if 1.9499999999999999e-226 < B < 6.3999999999999997e-142

    1. Initial program 12.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. Simplified12.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{-\sqrt{\color{blue}{-2 \cdot \frac{A}{F}}} \cdot \frac{1}{\sqrt{2}}} \]

    if 6.3999999999999997e-142 < B < 2.6e-51

    1. Initial program 26.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. Simplified40.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.6e-51 < B

    1. Initial program 15.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 57.1% accurate, 1.5× speedup?

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

\mathbf{elif}\;B\_m \leq 1.3 \cdot 10^{-143}:\\
\;\;\;\;\frac{1}{\sqrt{-2 \cdot \frac{A}{F}} \cdot t\_0}\\

\mathbf{elif}\;B\_m \leq 2.1 \cdot 10^{-54}:\\
\;\;\;\;\frac{-1}{\frac{t\_1}{\sqrt{t\_1 \cdot \left(4 \cdot \left(C \cdot F\right)\right)}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if B < 4.49999999999999993e-227

    1. Initial program 17.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 -inf 16.9%

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

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

    if 4.49999999999999993e-227 < B < 1.29999999999999994e-143

    1. Initial program 12.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. Simplified12.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{-\sqrt{\color{blue}{-2 \cdot \frac{A}{F}}} \cdot \frac{1}{\sqrt{2}}} \]

    if 1.29999999999999994e-143 < B < 2.1e-54

    1. Initial program 26.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. Simplified40.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.1e-54 < B

    1. Initial program 15.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 51.2% accurate, 1.9× speedup?

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

\mathbf{elif}\;B\_m \leq 8.5 \cdot 10^{-147}:\\
\;\;\;\;\frac{1}{\sqrt{-2 \cdot \frac{A}{F}} \cdot \frac{-1}{\sqrt{2}}}\\

\mathbf{elif}\;B\_m \leq 3.5 \cdot 10^{-27}:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{t\_1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if B < 1.15e-226

    1. Initial program 17.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 -inf 16.9%

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

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

    if 1.15e-226 < B < 8.5000000000000002e-147

    1. Initial program 12.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. Simplified12.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{-\sqrt{\color{blue}{-2 \cdot \frac{A}{F}}} \cdot \frac{1}{\sqrt{2}}} \]

    if 8.5000000000000002e-147 < B < 3.5000000000000001e-27

    1. Initial program 28.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 -inf 32.1%

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

    if 3.5000000000000001e-27 < B

    1. Initial program 13.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 B around inf 46.9%

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

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

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    6. Step-by-step derivation
      1. sqrt-div56.7%

        \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
    7. Applied egg-rr56.7%

      \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
    8. Step-by-step derivation
      1. associate-*l/56.6%

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

        \[\leadsto -\frac{\color{blue}{\sqrt{F \cdot 2}}}{\sqrt{B}} \]
    9. Applied egg-rr56.8%

      \[\leadsto -\color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    10. Step-by-step derivation
      1. div-inv56.8%

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

        \[\leadsto -\sqrt{F \cdot 2} \cdot \frac{1}{\color{blue}{{B}^{0.5}}} \]
      3. pow-flip56.8%

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

        \[\leadsto -\sqrt{F \cdot 2} \cdot {B}^{\color{blue}{-0.5}} \]
    11. Applied egg-rr56.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 1.15 \cdot 10^{-226}:\\ \;\;\;\;\frac{2 \cdot \sqrt{C \cdot \left(F \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{elif}\;B \leq 8.5 \cdot 10^{-147}:\\ \;\;\;\;\frac{1}{\sqrt{-2 \cdot \frac{A}{F}} \cdot \frac{-1}{\sqrt{2}}}\\ \mathbf{elif}\;B \leq 3.5 \cdot 10^{-27}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(2 \cdot C\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot F} \cdot \left(-{B}^{-0.5}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 51.1% accurate, 1.9× speedup?

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

\mathbf{elif}\;B\_m \leq 4 \cdot 10^{-140}:\\
\;\;\;\;\frac{1}{\sqrt{-2 \cdot \frac{A}{F}} \cdot \frac{-1}{\sqrt{2}}}\\

\mathbf{elif}\;B\_m \leq 5.2 \cdot 10^{-26}:\\
\;\;\;\;\frac{-1}{\frac{t\_0}{\sqrt{t\_0 \cdot \left(4 \cdot \left(C \cdot F\right)\right)}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if B < 7.99999999999999956e-227

    1. Initial program 17.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 -inf 16.9%

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

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

    if 7.99999999999999956e-227 < B < 3.9999999999999999e-140

    1. Initial program 12.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. Simplified12.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{-\sqrt{\color{blue}{-2 \cdot \frac{A}{F}}} \cdot \frac{1}{\sqrt{2}}} \]

    if 3.9999999999999999e-140 < B < 5.2000000000000002e-26

    1. Initial program 28.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. Simplified38.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.2000000000000002e-26 < B

    1. Initial program 13.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 B around inf 46.9%

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

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

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    6. Step-by-step derivation
      1. sqrt-div56.7%

        \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
    7. Applied egg-rr56.7%

      \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
    8. Step-by-step derivation
      1. associate-*l/56.6%

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

        \[\leadsto -\frac{\color{blue}{\sqrt{F \cdot 2}}}{\sqrt{B}} \]
    9. Applied egg-rr56.8%

      \[\leadsto -\color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    10. Step-by-step derivation
      1. div-inv56.8%

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

        \[\leadsto -\sqrt{F \cdot 2} \cdot \frac{1}{\color{blue}{{B}^{0.5}}} \]
      3. pow-flip56.8%

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

        \[\leadsto -\sqrt{F \cdot 2} \cdot {B}^{\color{blue}{-0.5}} \]
    11. Applied egg-rr56.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;B \leq 8 \cdot 10^{-227}:\\ \;\;\;\;\frac{2 \cdot \sqrt{C \cdot \left(F \cdot \left({B}^{2} - 4 \cdot \left(A \cdot C\right)\right)\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{elif}\;B \leq 4 \cdot 10^{-140}:\\ \;\;\;\;\frac{1}{\sqrt{-2 \cdot \frac{A}{F}} \cdot \frac{-1}{\sqrt{2}}}\\ \mathbf{elif}\;B \leq 5.2 \cdot 10^{-26}:\\ \;\;\;\;\frac{-1}{\frac{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}{\sqrt{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(4 \cdot \left(C \cdot F\right)\right)}}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2 \cdot F} \cdot \left(-{B}^{-0.5}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 52.1% accurate, 1.9× speedup?

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

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


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

    1. Initial program 18.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.9499999999999999e-27 < B

    1. Initial program 13.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 B around inf 46.9%

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

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

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    6. Step-by-step derivation
      1. sqrt-div56.7%

        \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
    7. Applied egg-rr56.7%

      \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
    8. Step-by-step derivation
      1. associate-*l/56.6%

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

        \[\leadsto -\frac{\color{blue}{\sqrt{F \cdot 2}}}{\sqrt{B}} \]
    9. Applied egg-rr56.8%

      \[\leadsto -\color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    10. Step-by-step derivation
      1. div-inv56.8%

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

        \[\leadsto -\sqrt{F \cdot 2} \cdot \frac{1}{\color{blue}{{B}^{0.5}}} \]
      3. pow-flip56.8%

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

        \[\leadsto -\sqrt{F \cdot 2} \cdot {B}^{\color{blue}{-0.5}} \]
    11. Applied egg-rr56.8%

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

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

Alternative 10: 48.9% accurate, 2.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 B 2) < 4e46

    1. Initial program 22.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{1}{-\sqrt{\color{blue}{-2 \cdot \frac{A}{F}}} \cdot \frac{1}{\sqrt{2}}} \]

    if 4e46 < (pow.f64 B 2)

    1. Initial program 11.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 B around inf 21.8%

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

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

      \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
    6. Step-by-step derivation
      1. sqrt-div25.9%

        \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
    7. Applied egg-rr25.9%

      \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
    8. Step-by-step derivation
      1. associate-*l/25.9%

        \[\leadsto -\color{blue}{\frac{\sqrt{F} \cdot \sqrt{2}}{\sqrt{B}}} \]
      2. sqrt-unprod26.0%

        \[\leadsto -\frac{\color{blue}{\sqrt{F \cdot 2}}}{\sqrt{B}} \]
    9. Applied egg-rr26.0%

      \[\leadsto -\color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
    10. Step-by-step derivation
      1. div-inv26.0%

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

        \[\leadsto -\sqrt{F \cdot 2} \cdot \frac{1}{\color{blue}{{B}^{0.5}}} \]
      3. pow-flip26.0%

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

        \[\leadsto -\sqrt{F \cdot 2} \cdot {B}^{\color{blue}{-0.5}} \]
    11. Applied egg-rr26.0%

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

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

Alternative 11: 35.8% accurate, 3.1× speedup?

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

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

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

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

    \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
  6. Step-by-step derivation
    1. sqrt-div15.0%

      \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
  7. Applied egg-rr15.0%

    \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
  8. Step-by-step derivation
    1. associate-*l/15.0%

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

      \[\leadsto -\frac{\color{blue}{\sqrt{F \cdot 2}}}{\sqrt{B}} \]
  9. Applied egg-rr15.1%

    \[\leadsto -\color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
  10. Step-by-step derivation
    1. div-inv15.1%

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

      \[\leadsto -\sqrt{F \cdot 2} \cdot \frac{1}{\color{blue}{{B}^{0.5}}} \]
    3. pow-flip15.1%

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

      \[\leadsto -\sqrt{F \cdot 2} \cdot {B}^{\color{blue}{-0.5}} \]
  11. Applied egg-rr15.1%

    \[\leadsto -\color{blue}{\sqrt{F \cdot 2} \cdot {B}^{-0.5}} \]
  12. Final simplification15.1%

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

Alternative 12: 27.7% accurate, 3.1× speedup?

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

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

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

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

    \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
  6. Step-by-step derivation
    1. pow112.5%

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

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

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

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

    \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
  10. Step-by-step derivation
    1. add-sqr-sqrt12.5%

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

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

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

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

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

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

    \[\leadsto -\sqrt{\color{blue}{{\left({\left(2 \cdot \frac{F}{B}\right)}^{2}\right)}^{0.5}}} \]
  12. Step-by-step derivation
    1. unpow1/216.3%

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

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

      \[\leadsto -\sqrt{\color{blue}{\left|2 \cdot \frac{F}{B}\right|}} \]
    4. associate-*r/29.4%

      \[\leadsto -\sqrt{\left|\color{blue}{\frac{2 \cdot F}{B}}\right|} \]
    5. *-commutative29.4%

      \[\leadsto -\sqrt{\left|\frac{\color{blue}{F \cdot 2}}{B}\right|} \]
    6. associate-/l*29.4%

      \[\leadsto -\sqrt{\left|\color{blue}{F \cdot \frac{2}{B}}\right|} \]
  13. Simplified29.4%

    \[\leadsto -\sqrt{\color{blue}{\left|F \cdot \frac{2}{B}\right|}} \]
  14. Final simplification29.4%

    \[\leadsto -\sqrt{\left|F \cdot \frac{2}{B}\right|} \]
  15. Add Preprocessing

Alternative 13: 35.8% accurate, 3.1× speedup?

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

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

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

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

    \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
  6. Step-by-step derivation
    1. sqrt-div15.0%

      \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
  7. Applied egg-rr15.0%

    \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
  8. Step-by-step derivation
    1. associate-*l/15.0%

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

      \[\leadsto -\frac{\color{blue}{\sqrt{F \cdot 2}}}{\sqrt{B}} \]
  9. Applied egg-rr15.1%

    \[\leadsto -\color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
  10. Step-by-step derivation
    1. sqrt-undiv12.6%

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

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

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

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

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

      \[\leadsto -\color{blue}{\sqrt{\frac{2}{B}}} \cdot {F}^{0.5} \]
    7. pow1/215.1%

      \[\leadsto -\sqrt{\frac{2}{B}} \cdot \color{blue}{\sqrt{F}} \]
  11. Applied egg-rr15.1%

    \[\leadsto -\color{blue}{\sqrt{\frac{2}{B}} \cdot \sqrt{F}} \]
  12. Final simplification15.1%

    \[\leadsto \sqrt{\frac{2}{B}} \cdot \left(-\sqrt{F}\right) \]
  13. Add Preprocessing

Alternative 14: 35.8% accurate, 3.1× speedup?

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

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

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

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

    \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
  6. Step-by-step derivation
    1. sqrt-div15.0%

      \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
  7. Applied egg-rr15.0%

    \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
  8. Step-by-step derivation
    1. associate-*l/15.0%

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

      \[\leadsto -\frac{\color{blue}{\sqrt{F \cdot 2}}}{\sqrt{B}} \]
  9. Applied egg-rr15.1%

    \[\leadsto -\color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
  10. Final simplification15.1%

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

Alternative 15: 27.5% accurate, 5.9× speedup?

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

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

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

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

    \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
  6. Step-by-step derivation
    1. sqrt-unprod12.5%

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

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

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

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

Alternative 16: 27.5% accurate, 5.9× speedup?

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

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

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

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

    \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
  6. Step-by-step derivation
    1. sqrt-div15.0%

      \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
  7. Applied egg-rr15.0%

    \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2} \]
  8. Step-by-step derivation
    1. associate-*l/15.0%

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

      \[\leadsto -\frac{\color{blue}{\sqrt{F \cdot 2}}}{\sqrt{B}} \]
  9. Applied egg-rr15.1%

    \[\leadsto -\color{blue}{\frac{\sqrt{F \cdot 2}}{\sqrt{B}}} \]
  10. Step-by-step derivation
    1. sqrt-undiv12.6%

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

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

      \[\leadsto -\color{blue}{{\left(F \cdot \frac{2}{B}\right)}^{0.5}} \]
    4. associate-*r/12.8%

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

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

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

Alternative 17: 27.5% accurate, 6.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
  6. Step-by-step derivation
    1. pow112.5%

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

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

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

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

    \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
  10. Taylor expanded in F around 0 12.5%

    \[\leadsto -\sqrt{\color{blue}{2 \cdot \frac{F}{B}}} \]
  11. Step-by-step derivation
    1. associate-*r/12.6%

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

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

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

    \[\leadsto -\sqrt{\color{blue}{F \cdot \frac{2}{B}}} \]
  13. Final simplification12.5%

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

Alternative 18: 27.5% accurate, 6.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{-\sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
  6. Step-by-step derivation
    1. pow112.5%

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

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

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

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

    \[\leadsto -\color{blue}{\sqrt{\frac{F}{B} \cdot 2}} \]
  10. Final simplification12.5%

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

Reproduce

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