ABCF->ab-angle b

Percentage Accurate: 19.7% → 47.8%
Time: 30.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.7% accurate, 1.0× speedup?

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

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

Alternative 1: 47.8% accurate, 1.0× speedup?

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

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


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

    1. Initial program 19.9%

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

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

      \[\leadsto -\frac{\sqrt{2 \cdot \left(\left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot F\right) \cdot \color{blue}{\left(A - -1 \cdot A\right)}\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
    4. Step-by-step derivation
      1. cancel-sign-sub-inv22.9%

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

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

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

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

    if 2e-30 < (pow.f64 B 2)

    1. Initial program 20.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 46.9% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-30}:\\
\;\;\;\;t_1 \cdot \frac{-1}{t_0}\\

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


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

    1. Initial program 16.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 36.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. Simplified43.9%

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

    if 1e-59 < (pow.f64 B 2) < 2e-30

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e-30 < (pow.f64 B 2)

    1. Initial program 20.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 46.0% accurate, 1.0× speedup?

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

\mathbf{elif}\;{B}^{2} \leq 4 \cdot 10^{-96}:\\
\;\;\;\;\frac{-1}{\frac{B}{t_0}}\\

\mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-30}:\\
\;\;\;\;{\left(\frac{t_1}{t_2}\right)}^{-1}\\

\mathbf{else}:\\
\;\;\;\;\frac{t_0}{-B}\\


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

    1. Initial program 16.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 37.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. Simplified38.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999996e-96 < (pow.f64 B 2) < 2e-30

    1. Initial program 26.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e-30 < (pow.f64 B 2)

    1. Initial program 20.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 46.0% accurate, 1.0× speedup?

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

\mathbf{elif}\;{B}^{2} \leq 4 \cdot 10^{-96}:\\
\;\;\;\;\frac{-1}{\frac{\frac{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)}{B}}{t_0}}\\

\mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-30}:\\
\;\;\;\;{\left(\frac{t_1}{t_2}\right)}^{-1}\\

\mathbf{else}:\\
\;\;\;\;\frac{t_0}{-B}\\


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

    1. Initial program 16.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 37.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. Simplified38.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999996e-96 < (pow.f64 B 2) < 2e-30

    1. Initial program 26.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e-30 < (pow.f64 B 2)

    1. Initial program 20.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 46.0% accurate, 1.2× speedup?

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

\mathbf{elif}\;{B}^{2} \leq 4 \cdot 10^{-96}:\\
\;\;\;\;\frac{-1}{\frac{B}{t_0}}\\

\mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-30}:\\
\;\;\;\;t_2 \cdot \frac{-1}{t_1}\\

\mathbf{else}:\\
\;\;\;\;\frac{t_0}{-B}\\


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

    1. Initial program 16.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 37.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. Simplified38.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.9999999999999996e-96 < (pow.f64 B 2) < 2e-30

    1. Initial program 26.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e-30 < (pow.f64 B 2)

    1. Initial program 20.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 46.0% accurate, 1.2× speedup?

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

\mathbf{elif}\;{B}^{2} \leq 4 \cdot 10^{-96}:\\
\;\;\;\;\frac{-1}{\frac{B}{t_0}}\\

\mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{-30}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;\frac{t_0}{-B}\\


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 37.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. Simplified38.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e-30 < (pow.f64 B 2)

    1. Initial program 20.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 26.6% accurate, 3.0× speedup?

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

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


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

    1. Initial program 18.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\frac{e^{\log \left(2 \cdot \left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \left(F \cdot \color{blue}{\left(2 \cdot A\right)}\right)\right)\right) \cdot 0.5}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
    7. Applied egg-rr35.0%

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

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

        \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{A \cdot F} \cdot 1}{B}} \]
      2. *-rgt-identity15.8%

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

      \[\leadsto -\color{blue}{2 \cdot \frac{\sqrt{A \cdot F}}{B}} \]
    11. Step-by-step derivation
      1. add-sqr-sqrt15.6%

        \[\leadsto -2 \cdot \frac{\color{blue}{\sqrt{\sqrt{A \cdot F}} \cdot \sqrt{\sqrt{A \cdot F}}}}{B} \]
      2. *-un-lft-identity15.6%

        \[\leadsto -2 \cdot \frac{\sqrt{\sqrt{A \cdot F}} \cdot \sqrt{\sqrt{A \cdot F}}}{\color{blue}{1 \cdot B}} \]
      3. times-frac15.7%

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

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

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

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

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

        \[\leadsto -2 \cdot \left(\frac{{\left(F \cdot A\right)}^{0.25}}{1} \cdot \frac{\sqrt{\color{blue}{{\left(A \cdot F\right)}^{0.5}}}}{B}\right) \]
      9. sqrt-pow116.0%

        \[\leadsto -2 \cdot \left(\frac{{\left(F \cdot A\right)}^{0.25}}{1} \cdot \frac{\color{blue}{{\left(A \cdot F\right)}^{\left(\frac{0.5}{2}\right)}}}{B}\right) \]
      10. *-commutative16.0%

        \[\leadsto -2 \cdot \left(\frac{{\left(F \cdot A\right)}^{0.25}}{1} \cdot \frac{{\color{blue}{\left(F \cdot A\right)}}^{\left(\frac{0.5}{2}\right)}}{B}\right) \]
      11. metadata-eval16.0%

        \[\leadsto -2 \cdot \left(\frac{{\left(F \cdot A\right)}^{0.25}}{1} \cdot \frac{{\left(F \cdot A\right)}^{\color{blue}{0.25}}}{B}\right) \]
    12. Applied egg-rr16.0%

      \[\leadsto -2 \cdot \color{blue}{\left(\frac{{\left(F \cdot A\right)}^{0.25}}{1} \cdot \frac{{\left(F \cdot A\right)}^{0.25}}{B}\right)} \]
    13. Step-by-step derivation
      1. /-rgt-identity16.0%

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

        \[\leadsto -2 \cdot \color{blue}{\frac{{\left(F \cdot A\right)}^{0.25} \cdot {\left(F \cdot A\right)}^{0.25}}{B}} \]
      3. pow-sqr16.0%

        \[\leadsto -2 \cdot \frac{\color{blue}{{\left(F \cdot A\right)}^{\left(2 \cdot 0.25\right)}}}{B} \]
      4. metadata-eval16.0%

        \[\leadsto -2 \cdot \frac{{\left(F \cdot A\right)}^{\color{blue}{0.5}}}{B} \]
    14. Simplified16.0%

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

    if -4.60000000000000034e60 < A

    1. Initial program 20.3%

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

      \[\leadsto \color{blue}{\frac{-\sqrt{2 \cdot \left(\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right) \cdot \left(F \cdot \left(\left(A + C\right) - \mathsf{hypot}\left(B, A - C\right)\right)\right)\right)}}{\mathsf{fma}\left(B, B, A \cdot \left(C \cdot -4\right)\right)}} \]
    3. 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)} \]
    4. 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. distribute-rgt-neg-in7.8%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;A \leq -4.6 \cdot 10^{+60}:\\ \;\;\;\;\frac{{\left(A \cdot F\right)}^{0.5}}{B} \cdot \left(-2\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(-B\right)} \cdot \frac{-\sqrt{2}}{B}\\ \end{array} \]

Alternative 8: 31.8% accurate, 3.0× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \frac{\sqrt{\left(A - \mathsf{hypot}\left(B, A\right)\right) \cdot \left(2 \cdot F\right)}}{-B} \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F)
 :precision binary64
 (/ (sqrt (* (- A (hypot B A)) (* 2.0 F))) (- B)))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	return sqrt(((A - hypot(B, A)) * (2.0 * F))) / -B;
}
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	return Math.sqrt(((A - Math.hypot(B, A)) * (2.0 * F))) / -B;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	return math.sqrt(((A - math.hypot(B, A)) * (2.0 * F))) / -B
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	return Float64(sqrt(Float64(Float64(A - hypot(B, A)) * Float64(2.0 * F))) / Float64(-B))
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
	tmp = sqrt(((A - hypot(B, A)) * (2.0 * F))) / -B;
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := N[(N[Sqrt[N[(N[(A - N[Sqrt[B ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision] * N[(2.0 * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-B)), $MachinePrecision]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\frac{\sqrt{\left(A - \mathsf{hypot}\left(B, A\right)\right) \cdot \left(2 \cdot F\right)}}{-B}
\end{array}
Derivation
  1. Initial program 20.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. Simplified26.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 9.1% accurate, 5.8× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \frac{{\left(A \cdot F\right)}^{0.5}}{B} \cdot \left(-2\right) \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F) :precision binary64 (* (/ (pow (* A F) 0.5) B) (- 2.0)))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	return (pow((A * F), 0.5) / B) * -2.0;
}
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
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
    code = (((a * f) ** 0.5d0) / b) * -2.0d0
end function
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	return (Math.pow((A * F), 0.5) / B) * -2.0;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	return (math.pow((A * F), 0.5) / B) * -2.0
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	return Float64(Float64((Float64(A * F) ^ 0.5) / B) * Float64(-2.0))
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
	tmp = (((A * F) ^ 0.5) / B) * -2.0;
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := N[(N[(N[Power[N[(A * F), $MachinePrecision], 0.5], $MachinePrecision] / B), $MachinePrecision] * (-2.0)), $MachinePrecision]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\frac{{\left(A \cdot F\right)}^{0.5}}{B} \cdot \left(-2\right)
\end{array}
Derivation
  1. Initial program 20.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. Simplified27.6%

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

    \[\leadsto -\frac{\sqrt{2 \cdot \left(\left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot F\right) \cdot \color{blue}{\left(A - -1 \cdot A\right)}\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
  4. Step-by-step derivation
    1. cancel-sign-sub-inv14.5%

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

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

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

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

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

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

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

      \[\leadsto -\frac{e^{\log \left(2 \cdot \left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \left(F \cdot \color{blue}{\left(2 \cdot A\right)}\right)\right)\right) \cdot 0.5}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
  7. Applied egg-rr13.9%

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

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

      \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{A \cdot F} \cdot 1}{B}} \]
    2. *-rgt-identity4.4%

      \[\leadsto -2 \cdot \frac{\color{blue}{\sqrt{A \cdot F}}}{B} \]
  10. Simplified4.4%

    \[\leadsto -\color{blue}{2 \cdot \frac{\sqrt{A \cdot F}}{B}} \]
  11. Step-by-step derivation
    1. add-sqr-sqrt4.4%

      \[\leadsto -2 \cdot \frac{\color{blue}{\sqrt{\sqrt{A \cdot F}} \cdot \sqrt{\sqrt{A \cdot F}}}}{B} \]
    2. *-un-lft-identity4.4%

      \[\leadsto -2 \cdot \frac{\sqrt{\sqrt{A \cdot F}} \cdot \sqrt{\sqrt{A \cdot F}}}{\color{blue}{1 \cdot B}} \]
    3. times-frac4.4%

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

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

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

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

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

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

      \[\leadsto -2 \cdot \left(\frac{{\left(F \cdot A\right)}^{0.25}}{1} \cdot \frac{\color{blue}{{\left(A \cdot F\right)}^{\left(\frac{0.5}{2}\right)}}}{B}\right) \]
    10. *-commutative4.6%

      \[\leadsto -2 \cdot \left(\frac{{\left(F \cdot A\right)}^{0.25}}{1} \cdot \frac{{\color{blue}{\left(F \cdot A\right)}}^{\left(\frac{0.5}{2}\right)}}{B}\right) \]
    11. metadata-eval4.6%

      \[\leadsto -2 \cdot \left(\frac{{\left(F \cdot A\right)}^{0.25}}{1} \cdot \frac{{\left(F \cdot A\right)}^{\color{blue}{0.25}}}{B}\right) \]
  12. Applied egg-rr4.6%

    \[\leadsto -2 \cdot \color{blue}{\left(\frac{{\left(F \cdot A\right)}^{0.25}}{1} \cdot \frac{{\left(F \cdot A\right)}^{0.25}}{B}\right)} \]
  13. Step-by-step derivation
    1. /-rgt-identity4.6%

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

      \[\leadsto -2 \cdot \color{blue}{\frac{{\left(F \cdot A\right)}^{0.25} \cdot {\left(F \cdot A\right)}^{0.25}}{B}} \]
    3. pow-sqr4.6%

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

      \[\leadsto -2 \cdot \frac{{\left(F \cdot A\right)}^{\color{blue}{0.5}}}{B} \]
  14. Simplified4.6%

    \[\leadsto -2 \cdot \color{blue}{\frac{{\left(F \cdot A\right)}^{0.5}}{B}} \]
  15. Final simplification4.6%

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

Alternative 10: 9.1% accurate, 5.9× speedup?

\[\begin{array}{l} B = |B|\\ [A, C] = \mathsf{sort}([A, C])\\ \\ \frac{\sqrt{A \cdot F}}{B} \cdot \left(-2\right) \end{array} \]
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
(FPCore (A B C F) :precision binary64 (* (/ (sqrt (* A F)) B) (- 2.0)))
B = abs(B);
assert(A < C);
double code(double A, double B, double C, double F) {
	return (sqrt((A * F)) / B) * -2.0;
}
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
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
    code = (sqrt((a * f)) / b) * -2.0d0
end function
B = Math.abs(B);
assert A < C;
public static double code(double A, double B, double C, double F) {
	return (Math.sqrt((A * F)) / B) * -2.0;
}
B = abs(B)
[A, C] = sort([A, C])
def code(A, B, C, F):
	return (math.sqrt((A * F)) / B) * -2.0
B = abs(B)
A, C = sort([A, C])
function code(A, B, C, F)
	return Float64(Float64(sqrt(Float64(A * F)) / B) * Float64(-2.0))
end
B = abs(B)
A, C = num2cell(sort([A, C])){:}
function tmp = code(A, B, C, F)
	tmp = (sqrt((A * F)) / B) * -2.0;
end
NOTE: B should be positive before calling this function
NOTE: A and C should be sorted in increasing order before calling this function.
code[A_, B_, C_, F_] := N[(N[(N[Sqrt[N[(A * F), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision] * (-2.0)), $MachinePrecision]
\begin{array}{l}
B = |B|\\
[A, C] = \mathsf{sort}([A, C])\\
\\
\frac{\sqrt{A \cdot F}}{B} \cdot \left(-2\right)
\end{array}
Derivation
  1. Initial program 20.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. Simplified27.6%

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

    \[\leadsto -\frac{\sqrt{2 \cdot \left(\left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot F\right) \cdot \color{blue}{\left(A - -1 \cdot A\right)}\right)}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
  4. Step-by-step derivation
    1. cancel-sign-sub-inv14.5%

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

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

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

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

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

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

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

      \[\leadsto -\frac{e^{\log \left(2 \cdot \left(\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right) \cdot \left(F \cdot \color{blue}{\left(2 \cdot A\right)}\right)\right)\right) \cdot 0.5}}{\mathsf{fma}\left(A, C \cdot -4, {B}^{2}\right)} \]
  7. Applied egg-rr13.9%

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

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

      \[\leadsto -2 \cdot \color{blue}{\frac{\sqrt{A \cdot F} \cdot 1}{B}} \]
    2. *-rgt-identity4.4%

      \[\leadsto -2 \cdot \frac{\color{blue}{\sqrt{A \cdot F}}}{B} \]
  10. Simplified4.4%

    \[\leadsto -\color{blue}{2 \cdot \frac{\sqrt{A \cdot F}}{B}} \]
  11. Final simplification4.4%

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

Reproduce

?
herbie shell --seed 2023310 
(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))))