ABCF->ab-angle b

Percentage Accurate: 19.2% → 49.0%
Time: 28.6s
Alternatives: 10
Speedup: 3.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 10 alternatives:

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

Initial Program: 19.2% accurate, 1.0× speedup?

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

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

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

\mathbf{elif}\;{B_m}^{2} \leq 4 \cdot 10^{+191}:\\
\;\;\;\;\frac{\sqrt{\left|F\right|} \cdot \left(-\sqrt{2 \cdot \left|t_0 \cdot \left(A + \left(C - \mathsf{hypot}\left(B_m, A - C\right)\right)\right)\right|}\right)}{t_0}\\

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


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

    1. Initial program 15.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. Simplified17.3%

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

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

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

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

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

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

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

    if 2e-185 < (pow.f64 B 2) < 4.00000000000000029e191

    1. Initial program 44.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. Simplified46.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.00000000000000029e191 < (pow.f64 B 2)

    1. Initial program 7.8%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 46.8% accurate, 0.7× speedup?

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

\mathbf{elif}\;{B_m}^{2} \leq 2 \cdot 10^{+87}:\\
\;\;\;\;\frac{-\sqrt{\left|F \cdot \left(t_0 \cdot \left(2 \cdot \left(A + \left(C - \mathsf{hypot}\left(B_m, A - C\right)\right)\right)\right)\right)\right|}}{t_0}\\

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


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

    1. Initial program 15.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. Simplified17.3%

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

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

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

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

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

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

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

    if 2e-185 < (pow.f64 B 2) < 1.9999999999999999e87

    1. Initial program 45.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e87 < (pow.f64 B 2)

    1. Initial program 12.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. Simplified7.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 46.9% accurate, 0.7× speedup?

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

\mathbf{elif}\;{B_m}^{2} \leq 5 \cdot 10^{+158}:\\
\;\;\;\;\frac{\sqrt{F \cdot \left(A + \left(C - \mathsf{hypot}\left(B_m, A - C\right)\right)\right)} \cdot \left(-\sqrt{2 \cdot t_0}\right)}{t_0}\\

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


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

    1. Initial program 15.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. Simplified17.3%

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

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

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

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

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

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

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

    if 2e-185 < (pow.f64 B 2) < 4.9999999999999996e158

    1. Initial program 46.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. Simplified48.3%

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999996e158 < (pow.f64 B 2)

    1. Initial program 8.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. Simplified3.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 47.3% accurate, 1.0× speedup?

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

\mathbf{elif}\;{B_m}^{2} \leq 2 \cdot 10^{+87}:\\
\;\;\;\;\frac{-\sqrt{\left(2 \cdot \left(A + \left(C - \mathsf{hypot}\left(B_m, A - C\right)\right)\right)\right) \cdot \left(F \cdot t_0\right)}}{t_0}\\

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


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

    1. Initial program 15.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. Simplified17.3%

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

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

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

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

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

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

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

    if 2e-185 < (pow.f64 B 2) < 1.9999999999999999e87

    1. Initial program 45.8%

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

      \[\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

    if 1.9999999999999999e87 < (pow.f64 B 2)

    1. Initial program 12.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. Simplified7.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 45.3% 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} \mathbf{if}\;{B_m}^{2} \leq 5 \cdot 10^{-149}:\\ \;\;\;\;-\frac{\sqrt{-8 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B_m}^{2}\right)}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B_m, A\right)\right)} \cdot \frac{-\sqrt{2}}{B_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (if (<= (pow B_m 2.0) 5e-149)
   (-
    (/
     (sqrt (* -8.0 (* (* A C) (* F (+ A A)))))
     (fma A (* C -4.0) (pow B_m 2.0))))
   (* (sqrt (* F (- A (hypot B_m A)))) (/ (- (sqrt 2.0)) B_m))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (pow(B_m, 2.0) <= 5e-149) {
		tmp = -(sqrt((-8.0 * ((A * C) * (F * (A + A))))) / fma(A, (C * -4.0), pow(B_m, 2.0)));
	} else {
		tmp = sqrt((F * (A - hypot(B_m, A)))) * (-sqrt(2.0) / B_m);
	}
	return tmp;
}
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	tmp = 0.0
	if ((B_m ^ 2.0) <= 5e-149)
		tmp = Float64(-Float64(sqrt(Float64(-8.0 * Float64(Float64(A * C) * Float64(F * Float64(A + A))))) / fma(A, Float64(C * -4.0), (B_m ^ 2.0))));
	else
		tmp = Float64(sqrt(Float64(F * Float64(A - hypot(B_m, A)))) * Float64(Float64(-sqrt(2.0)) / B_m));
	end
	return tmp
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := If[LessEqual[N[Power[B$95$m, 2.0], $MachinePrecision], 5e-149], (-N[(N[Sqrt[N[(-8.0 * N[(N[(A * C), $MachinePrecision] * N[(F * N[(A + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(A * N[(C * -4.0), $MachinePrecision] + N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), N[(N[Sqrt[N[(F * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;{B_m}^{2} \leq 5 \cdot 10^{-149}:\\
\;\;\;\;-\frac{\sqrt{-8 \cdot \left(\left(A \cdot C\right) \cdot \left(F \cdot \left(A + A\right)\right)\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B_m}^{2}\right)}\\

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


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

    1. Initial program 17.0%

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

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

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

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

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

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

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

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

    if 4.99999999999999968e-149 < (pow.f64 B 2)

    1. Initial program 23.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 34.2% accurate, 2.0× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{2}}{B_m} \cdot \left(-\sqrt{-0.5 \cdot \frac{{B_m}^{2}}{\frac{C}{F}}}\right)\\


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

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

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

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

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

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

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

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

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

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

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

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

    if 5.90000000000000029e63 < C

    1. Initial program 2.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. Simplified2.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_0 \cdot \sqrt{F \cdot \left(-0.5 \cdot \frac{{B_m}^{2}}{C}\right)}\\


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

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

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

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

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

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

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

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

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

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

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

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

    if 3.20000000000000019e64 < C

    1. Initial program 2.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. Simplified2.6%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 31.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])\\ \\ \sqrt{F \cdot \left(A - \mathsf{hypot}\left(B_m, A\right)\right)} \cdot \frac{-\sqrt{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 (- A (hypot B_m A)))) (/ (- (sqrt 2.0)) B_m)))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	return sqrt((F * (A - hypot(B_m, A)))) * (-sqrt(2.0) / B_m);
}
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 * (A - Math.hypot(B_m, A)))) * (-Math.sqrt(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 * (A - math.hypot(B_m, A)))) * (-math.sqrt(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(A - hypot(B_m, A)))) * Float64(Float64(-sqrt(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 * (A - hypot(B_m, A)))) * (-sqrt(2.0) / B_m);
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := N[(N[Sqrt[N[(F * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[((-N[Sqrt[2.0], $MachinePrecision]) / B$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B_m, A\right)\right)} \cdot \frac{-\sqrt{2}}{B_m}
\end{array}
Derivation
  1. Initial program 20.5%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \sqrt{F \cdot \left(A - \mathsf{hypot}\left(B, A\right)\right)} \cdot \frac{-\sqrt{2}}{B} \]
  8. Add Preprocessing

Alternative 9: 26.6% accurate, 3.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \sqrt{\color{blue}{\left(-B\right) \cdot F}} \cdot \left(-\frac{\sqrt{2}}{B}\right) \]
  10. Final simplification14.0%

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

Alternative 10: 0.6% accurate, 3.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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