ABCF->ab-angle b

Percentage Accurate: 18.3% → 35.3%
Time: 9.5s
Alternatives: 12
Speedup: 7.2×

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;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, c, f)
use fmin_fmax_functions
    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}

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

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

Initial Program: 18.3% 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;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(a, b, c, f)
use fmin_fmax_functions
    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: 35.3% accurate, 2.4× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{\left(A - \mathsf{fma}\left(-1, A, 0.5 \cdot \frac{{B}^{2}}{C}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if C < 5.3999999999999999e-49

    1. Initial program 28.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. Applied rewrites36.7%

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      3. lift-+.f64N/A

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

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

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      6. lift--.f64N/A

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      7. lift--.f64N/A

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      8. sub-negate2N/A

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

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

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

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

    if 5.3999999999999999e-49 < C

    1. Initial program 8.2%

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      3. lift-+.f64N/A

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

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

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      6. lift--.f64N/A

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      7. lift--.f64N/A

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      8. sub-negate2N/A

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

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

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

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

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

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

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

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

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

Alternative 2: 33.5% accurate, 0.4× speedup?

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

\mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-191}:\\
\;\;\;\;\frac{-\sqrt{\left(A \cdot \left(1 + \frac{C}{A}\right) - \sqrt{\mathsf{fma}\left(C - A, C - A, B \cdot B\right)}\right) \cdot \left(\left(2 \cdot t\_3\right) \cdot F\right)}}{t\_3}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{t\_0}\\


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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      3. lift-+.f64N/A

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

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

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      6. lift--.f64N/A

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      7. lift--.f64N/A

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      8. sub-negate2N/A

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

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

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

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

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

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

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

    1. Initial program 97.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. Step-by-step derivation
      1. lift-pow.f64N/A

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

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

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

        \[\leadsto \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(\left({A}^{2} - 2 \cdot \left(A \cdot C\right)\right) + \color{blue}{C \cdot C}\right) + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      5. flip-+N/A

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

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

      \[\leadsto \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{\color{blue}{\frac{\mathsf{fma}\left(A, A, -2 \cdot \left(C \cdot A\right)\right) \cdot \mathsf{fma}\left(A, A, -2 \cdot \left(C \cdot A\right)\right) - \left(C \cdot C\right) \cdot \left(C \cdot C\right)}{\mathsf{fma}\left(A, A, -2 \cdot \left(C \cdot A\right)\right) - C \cdot C}} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    4. Applied rewrites67.3%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 6.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. Applied rewrites9.9%

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      3. lift-+.f64N/A

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

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

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      6. lift--.f64N/A

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      7. lift--.f64N/A

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      8. sub-negate2N/A

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 33.7% accurate, 0.4× speedup?

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

\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-191}:\\
\;\;\;\;\frac{-\sqrt{\left(\left(C + A\right) - \sqrt{\mathsf{fma}\left(C - A, C - A, B \cdot B\right)}\right) \cdot \left(\left(2 \cdot t\_1\right) \cdot F\right)}}{t\_1}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{t\_0}\\


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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      3. lift-+.f64N/A

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

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

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      6. lift--.f64N/A

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      7. lift--.f64N/A

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      8. sub-negate2N/A

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

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

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

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

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

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

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

    1. Initial program 97.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. Step-by-step derivation
      1. lift-pow.f64N/A

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

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

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

        \[\leadsto \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(\left({A}^{2} - 2 \cdot \left(A \cdot C\right)\right) + \color{blue}{C \cdot C}\right) + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      5. flip-+N/A

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

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

      \[\leadsto \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{\color{blue}{\frac{\mathsf{fma}\left(A, A, -2 \cdot \left(C \cdot A\right)\right) \cdot \mathsf{fma}\left(A, A, -2 \cdot \left(C \cdot A\right)\right) - \left(C \cdot C\right) \cdot \left(C \cdot C\right)}{\mathsf{fma}\left(A, A, -2 \cdot \left(C \cdot A\right)\right) - C \cdot C}} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    4. Applied rewrites67.3%

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

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

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

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

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

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

    1. Initial program 6.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. Applied rewrites9.9%

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      3. lift-+.f64N/A

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

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

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      6. lift--.f64N/A

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      7. lift--.f64N/A

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      8. sub-negate2N/A

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 33.3% accurate, 0.4× speedup?

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

\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-191}:\\
\;\;\;\;\frac{-\sqrt{\left(A - \sqrt{\mathsf{fma}\left(C - A, C - A, B \cdot B\right)}\right) \cdot \left(\left(2 \cdot t\_1\right) \cdot F\right)}}{t\_1}\\

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{t\_0}\\


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

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

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

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

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

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

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

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

        \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      3. lift-+.f64N/A

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

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

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      6. lift--.f64N/A

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      7. lift--.f64N/A

        \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
      8. sub-negate2N/A

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

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

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

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

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

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

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

    1. Initial program 97.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. Step-by-step derivation
      1. lift-pow.f64N/A

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

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

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

        \[\leadsto \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(\left({A}^{2} - 2 \cdot \left(A \cdot C\right)\right) + \color{blue}{C \cdot C}\right) + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      5. flip-+N/A

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

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

      \[\leadsto \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{\color{blue}{\frac{\mathsf{fma}\left(A, A, -2 \cdot \left(C \cdot A\right)\right) \cdot \mathsf{fma}\left(A, A, -2 \cdot \left(C \cdot A\right)\right) - \left(C \cdot C\right) \cdot \left(C \cdot C\right)}{\mathsf{fma}\left(A, A, -2 \cdot \left(C \cdot A\right)\right) - C \cdot C}} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    4. Applied rewrites67.3%

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

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

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

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

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

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

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

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

      1. Initial program 6.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. Applied rewrites9.9%

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

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

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

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

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

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

          \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
        3. lift-+.f64N/A

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

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

          \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
        6. lift--.f64N/A

          \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
        7. lift--.f64N/A

          \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
        8. sub-negate2N/A

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

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 26.1% accurate, 0.5× speedup?

    \[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ \begin{array}{l} t_0 := \left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\\ t_1 := \mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)\\ t_2 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ t_3 := \frac{-\sqrt{\left(2 \cdot \left(t\_2 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t\_2}\\ \mathbf{if}\;t\_3 \leq -1 \cdot 10^{+158}:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot A\right) \cdot t\_0}}{t\_1}\\ \mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-191}:\\ \;\;\;\;\frac{\sqrt{\left(A - B\right) \cdot t\_0}}{t\_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{t\_1}\\ \end{array} \end{array} \]
    NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
    (FPCore (A B C F)
     :precision binary64
     (let* ((t_0 (* (+ F F) (fma -4.0 (* C A) (* B B))))
            (t_1 (fma (* C 4.0) A (* (- B) B)))
            (t_2 (- (pow B 2.0) (* (* 4.0 A) C)))
            (t_3
             (/
              (-
               (sqrt
                (*
                 (* 2.0 (* t_2 F))
                 (- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
              t_2)))
       (if (<= t_3 -1e+158)
         (/ (sqrt (* (* 2.0 A) t_0)) t_1)
         (if (<= t_3 -5e-191)
           (/ (sqrt (* (- A B) t_0)) t_1)
           (/ (sqrt (* -8.0 (* A (* C (* F (- A (* -1.0 A))))))) t_1)))))
    assert(A < B && B < C && C < F);
    double code(double A, double B, double C, double F) {
    	double t_0 = (F + F) * fma(-4.0, (C * A), (B * B));
    	double t_1 = fma((C * 4.0), A, (-B * B));
    	double t_2 = pow(B, 2.0) - ((4.0 * A) * C);
    	double t_3 = -sqrt(((2.0 * (t_2 * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_2;
    	double tmp;
    	if (t_3 <= -1e+158) {
    		tmp = sqrt(((2.0 * A) * t_0)) / t_1;
    	} else if (t_3 <= -5e-191) {
    		tmp = sqrt(((A - B) * t_0)) / t_1;
    	} else {
    		tmp = sqrt((-8.0 * (A * (C * (F * (A - (-1.0 * A))))))) / t_1;
    	}
    	return tmp;
    }
    
    A, B, C, F = sort([A, B, C, F])
    function code(A, B, C, F)
    	t_0 = Float64(Float64(F + F) * fma(-4.0, Float64(C * A), Float64(B * B)))
    	t_1 = fma(Float64(C * 4.0), A, Float64(Float64(-B) * B))
    	t_2 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
    	t_3 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_2 * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_2)
    	tmp = 0.0
    	if (t_3 <= -1e+158)
    		tmp = Float64(sqrt(Float64(Float64(2.0 * A) * t_0)) / t_1);
    	elseif (t_3 <= -5e-191)
    		tmp = Float64(sqrt(Float64(Float64(A - B) * t_0)) / t_1);
    	else
    		tmp = Float64(sqrt(Float64(-8.0 * Float64(A * Float64(C * Float64(F * Float64(A - Float64(-1.0 * A))))))) / t_1);
    	end
    	return tmp
    end
    
    NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
    code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(F + F), $MachinePrecision] * N[(-4.0 * N[(C * A), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(C * 4.0), $MachinePrecision] * A + N[((-B) * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$2 * 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$2), $MachinePrecision]}, If[LessEqual[t$95$3, -1e+158], N[(N[Sqrt[N[(N[(2.0 * A), $MachinePrecision] * t$95$0), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$3, -5e-191], N[(N[Sqrt[N[(N[(A - B), $MachinePrecision] * t$95$0), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[Sqrt[N[(-8.0 * N[(A * N[(C * N[(F * N[(A - N[(-1.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]]]]]]]
    
    \begin{array}{l}
    [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
    \\
    \begin{array}{l}
    t_0 := \left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\\
    t_1 := \mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)\\
    t_2 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
    t_3 := \frac{-\sqrt{\left(2 \cdot \left(t\_2 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t\_2}\\
    \mathbf{if}\;t\_3 \leq -1 \cdot 10^{+158}:\\
    \;\;\;\;\frac{\sqrt{\left(2 \cdot A\right) \cdot t\_0}}{t\_1}\\
    
    \mathbf{elif}\;t\_3 \leq -5 \cdot 10^{-191}:\\
    \;\;\;\;\frac{\sqrt{\left(A - B\right) \cdot t\_0}}{t\_1}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{t\_1}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -9.99999999999999953e157

      1. Initial program 8.6%

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

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

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

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

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

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

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

          \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
        3. lift-+.f64N/A

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

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

          \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
        6. lift--.f64N/A

          \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
        7. lift--.f64N/A

          \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
        8. sub-negate2N/A

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

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

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

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

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

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

      if -9.99999999999999953e157 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -5.0000000000000001e-191

      1. Initial program 97.4%

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

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

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

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

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

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

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

          \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
        3. lift-+.f64N/A

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

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

          \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
        6. lift--.f64N/A

          \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
        7. lift--.f64N/A

          \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
        8. sub-negate2N/A

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

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

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

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

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

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

        1. Initial program 6.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. Applied rewrites9.9%

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

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

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

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

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

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

            \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
          3. lift-+.f64N/A

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

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

            \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
          6. lift--.f64N/A

            \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
          7. lift--.f64N/A

            \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
          8. sub-negate2N/A

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

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

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

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

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

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

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

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

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

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

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

      Alternative 6: 24.6% accurate, 0.5× speedup?

      \[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)\\ t_1 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\ t_2 := \frac{-\sqrt{\left(2 \cdot \left(t\_1 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t\_1}\\ t_3 := \frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{t\_0}\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+199}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-191}:\\ \;\;\;\;\frac{\sqrt{\left(A - B\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
      NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
      (FPCore (A B C F)
       :precision binary64
       (let* ((t_0 (fma (* C 4.0) A (* (- B) B)))
              (t_1 (- (pow B 2.0) (* (* 4.0 A) C)))
              (t_2
               (/
                (-
                 (sqrt
                  (*
                   (* 2.0 (* t_1 F))
                   (- (+ A C) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
                t_1))
              (t_3 (/ (sqrt (* -8.0 (* A (* C (* F (- A (* -1.0 A))))))) t_0)))
         (if (<= t_2 -1e+199)
           t_3
           (if (<= t_2 -5e-191)
             (/ (sqrt (* (- A B) (* (+ F F) (fma -4.0 (* C A) (* B B))))) t_0)
             t_3))))
      assert(A < B && B < C && C < F);
      double code(double A, double B, double C, double F) {
      	double t_0 = fma((C * 4.0), A, (-B * B));
      	double t_1 = pow(B, 2.0) - ((4.0 * A) * C);
      	double t_2 = -sqrt(((2.0 * (t_1 * F)) * ((A + C) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / t_1;
      	double t_3 = sqrt((-8.0 * (A * (C * (F * (A - (-1.0 * A))))))) / t_0;
      	double tmp;
      	if (t_2 <= -1e+199) {
      		tmp = t_3;
      	} else if (t_2 <= -5e-191) {
      		tmp = sqrt(((A - B) * ((F + F) * fma(-4.0, (C * A), (B * B))))) / t_0;
      	} else {
      		tmp = t_3;
      	}
      	return tmp;
      }
      
      A, B, C, F = sort([A, B, C, F])
      function code(A, B, C, F)
      	t_0 = fma(Float64(C * 4.0), A, Float64(Float64(-B) * B))
      	t_1 = Float64((B ^ 2.0) - Float64(Float64(4.0 * A) * C))
      	t_2 = Float64(Float64(-sqrt(Float64(Float64(2.0 * Float64(t_1 * F)) * Float64(Float64(A + C) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))))))) / t_1)
      	t_3 = Float64(sqrt(Float64(-8.0 * Float64(A * Float64(C * Float64(F * Float64(A - Float64(-1.0 * A))))))) / t_0)
      	tmp = 0.0
      	if (t_2 <= -1e+199)
      		tmp = t_3;
      	elseif (t_2 <= -5e-191)
      		tmp = Float64(sqrt(Float64(Float64(A - B) * Float64(Float64(F + F) * fma(-4.0, Float64(C * A), Float64(B * B))))) / t_0);
      	else
      		tmp = t_3;
      	end
      	return tmp
      end
      
      NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
      code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(C * 4.0), $MachinePrecision] * A + N[((-B) * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[B, 2.0], $MachinePrecision] - N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-N[Sqrt[N[(N[(2.0 * N[(t$95$1 * 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$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(-8.0 * N[(A * N[(C * N[(F * N[(A - N[(-1.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+199], t$95$3, If[LessEqual[t$95$2, -5e-191], N[(N[Sqrt[N[(N[(A - B), $MachinePrecision] * N[(N[(F + F), $MachinePrecision] * N[(-4.0 * N[(C * A), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], t$95$3]]]]]]
      
      \begin{array}{l}
      [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
      \\
      \begin{array}{l}
      t_0 := \mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)\\
      t_1 := {B}^{2} - \left(4 \cdot A\right) \cdot C\\
      t_2 := \frac{-\sqrt{\left(2 \cdot \left(t\_1 \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{t\_1}\\
      t_3 := \frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{t\_0}\\
      \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+199}:\\
      \;\;\;\;t\_3\\
      
      \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-191}:\\
      \;\;\;\;\frac{\sqrt{\left(A - B\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{t\_0}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_3\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -1.0000000000000001e199 or -5.0000000000000001e-191 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)))

        1. Initial program 6.5%

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

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

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

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

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

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

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

            \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
          3. lift-+.f64N/A

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

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

            \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
          6. lift--.f64N/A

            \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
          7. lift--.f64N/A

            \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
          8. sub-negate2N/A

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

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

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

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

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

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

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

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

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

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

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

        if -1.0000000000000001e199 < (/.f64 (neg.f64 (sqrt.f64 (*.f64 (*.f64 #s(literal 2 binary64) (*.f64 (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C)) F)) (-.f64 (+.f64 A C) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) #s(literal 2 binary64)) (pow.f64 B #s(literal 2 binary64)))))))) (-.f64 (pow.f64 B #s(literal 2 binary64)) (*.f64 (*.f64 #s(literal 4 binary64) A) C))) < -5.0000000000000001e-191

        1. Initial program 97.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. Applied rewrites97.2%

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

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

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

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

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

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

            \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
          3. lift-+.f64N/A

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

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

            \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
          6. lift--.f64N/A

            \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
          7. lift--.f64N/A

            \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
          8. sub-negate2N/A

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

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

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

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

            \[\leadsto \frac{\sqrt{\left(A - \color{blue}{B}\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
        9. Recombined 2 regimes into one program.
        10. Add Preprocessing

        Alternative 7: 31.4% accurate, 2.6× speedup?

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

          1. Initial program 28.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. Applied rewrites36.7%

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

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

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

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

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

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

              \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            3. lift-+.f64N/A

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

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

              \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            6. lift--.f64N/A

              \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            7. lift--.f64N/A

              \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            8. sub-negate2N/A

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

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

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

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

          if 3.6000000000000002e-48 < C

          1. Initial program 8.2%

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

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

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

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

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

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

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

              \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            3. lift-+.f64N/A

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

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

              \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            6. lift--.f64N/A

              \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            7. lift--.f64N/A

              \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            8. sub-negate2N/A

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

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

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

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

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

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

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

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

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

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

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

        Alternative 8: 31.3% accurate, 2.6× speedup?

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

          1. Initial program 28.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. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \frac{-\sqrt{\color{blue}{\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. *-commutativeN/A

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

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

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

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

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

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

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

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

          if 2.4e-48 < C

          1. Initial program 8.2%

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

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

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

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

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

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

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

              \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            3. lift-+.f64N/A

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

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

              \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            6. lift--.f64N/A

              \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            7. lift--.f64N/A

              \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            8. sub-negate2N/A

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

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

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

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

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

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

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

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

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

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

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

        Alternative 9: 31.4% accurate, 2.7× speedup?

        \[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)\\ \mathbf{if}\;C \leq 3.6 \cdot 10^{-48}:\\ \;\;\;\;\frac{\sqrt{\left(A - \left(\mathsf{hypot}\left(A - C, B\right) - C\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{t\_0}\\ \end{array} \end{array} \]
        NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
        (FPCore (A B C F)
         :precision binary64
         (let* ((t_0 (fma (* C 4.0) A (* (- B) B))))
           (if (<= C 3.6e-48)
             (/
              (sqrt
               (*
                (- A (- (hypot (- A C) B) C))
                (* (+ F F) (fma -4.0 (* C A) (* B B)))))
              t_0)
             (/ (sqrt (* -8.0 (* A (* C (* F (- A (* -1.0 A))))))) t_0))))
        assert(A < B && B < C && C < F);
        double code(double A, double B, double C, double F) {
        	double t_0 = fma((C * 4.0), A, (-B * B));
        	double tmp;
        	if (C <= 3.6e-48) {
        		tmp = sqrt(((A - (hypot((A - C), B) - C)) * ((F + F) * fma(-4.0, (C * A), (B * B))))) / t_0;
        	} else {
        		tmp = sqrt((-8.0 * (A * (C * (F * (A - (-1.0 * A))))))) / t_0;
        	}
        	return tmp;
        }
        
        A, B, C, F = sort([A, B, C, F])
        function code(A, B, C, F)
        	t_0 = fma(Float64(C * 4.0), A, Float64(Float64(-B) * B))
        	tmp = 0.0
        	if (C <= 3.6e-48)
        		tmp = Float64(sqrt(Float64(Float64(A - Float64(hypot(Float64(A - C), B) - C)) * Float64(Float64(F + F) * fma(-4.0, Float64(C * A), Float64(B * B))))) / t_0);
        	else
        		tmp = Float64(sqrt(Float64(-8.0 * Float64(A * Float64(C * Float64(F * Float64(A - Float64(-1.0 * A))))))) / t_0);
        	end
        	return tmp
        end
        
        NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
        code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(C * 4.0), $MachinePrecision] * A + N[((-B) * B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, 3.6e-48], N[(N[Sqrt[N[(N[(A - N[(N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision] - C), $MachinePrecision]), $MachinePrecision] * N[(N[(F + F), $MachinePrecision] * N[(-4.0 * N[(C * A), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(-8.0 * N[(A * N[(C * N[(F * N[(A - N[(-1.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]]]
        
        \begin{array}{l}
        [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
        \\
        \begin{array}{l}
        t_0 := \mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)\\
        \mathbf{if}\;C \leq 3.6 \cdot 10^{-48}:\\
        \;\;\;\;\frac{\sqrt{\left(A - \left(\mathsf{hypot}\left(A - C, B\right) - C\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{t\_0}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{t\_0}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if C < 3.6000000000000002e-48

          1. Initial program 28.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. Applied rewrites36.7%

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

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

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

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

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

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

              \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            3. lift-+.f64N/A

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

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

              \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            6. lift--.f64N/A

              \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            7. lift--.f64N/A

              \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            8. sub-negate2N/A

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

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

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

          if 3.6000000000000002e-48 < C

          1. Initial program 8.2%

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

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

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

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

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

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

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

              \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            3. lift-+.f64N/A

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

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

              \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            6. lift--.f64N/A

              \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            7. lift--.f64N/A

              \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            8. sub-negate2N/A

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

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

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

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

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

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

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

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

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

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

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

        Alternative 10: 31.3% accurate, 2.7× speedup?

        \[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)\\ \mathbf{if}\;C \leq 3.6 \cdot 10^{-48}:\\ \;\;\;\;\frac{\sqrt{\left(\left(A - \mathsf{hypot}\left(A - C, B\right)\right) + C\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{t\_0}\\ \end{array} \end{array} \]
        NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
        (FPCore (A B C F)
         :precision binary64
         (let* ((t_0 (fma (* C 4.0) A (* (- B) B))))
           (if (<= C 3.6e-48)
             (/
              (sqrt
               (*
                (+ (- A (hypot (- A C) B)) C)
                (* (+ F F) (fma -4.0 (* C A) (* B B)))))
              t_0)
             (/ (sqrt (* -8.0 (* A (* C (* F (- A (* -1.0 A))))))) t_0))))
        assert(A < B && B < C && C < F);
        double code(double A, double B, double C, double F) {
        	double t_0 = fma((C * 4.0), A, (-B * B));
        	double tmp;
        	if (C <= 3.6e-48) {
        		tmp = sqrt((((A - hypot((A - C), B)) + C) * ((F + F) * fma(-4.0, (C * A), (B * B))))) / t_0;
        	} else {
        		tmp = sqrt((-8.0 * (A * (C * (F * (A - (-1.0 * A))))))) / t_0;
        	}
        	return tmp;
        }
        
        A, B, C, F = sort([A, B, C, F])
        function code(A, B, C, F)
        	t_0 = fma(Float64(C * 4.0), A, Float64(Float64(-B) * B))
        	tmp = 0.0
        	if (C <= 3.6e-48)
        		tmp = Float64(sqrt(Float64(Float64(Float64(A - hypot(Float64(A - C), B)) + C) * Float64(Float64(F + F) * fma(-4.0, Float64(C * A), Float64(B * B))))) / t_0);
        	else
        		tmp = Float64(sqrt(Float64(-8.0 * Float64(A * Float64(C * Float64(F * Float64(A - Float64(-1.0 * A))))))) / t_0);
        	end
        	return tmp
        end
        
        NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
        code[A_, B_, C_, F_] := Block[{t$95$0 = N[(N[(C * 4.0), $MachinePrecision] * A + N[((-B) * B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[C, 3.6e-48], N[(N[Sqrt[N[(N[(N[(A - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] + C), $MachinePrecision] * N[(N[(F + F), $MachinePrecision] * N[(-4.0 * N[(C * A), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[Sqrt[N[(-8.0 * N[(A * N[(C * N[(F * N[(A - N[(-1.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]]]
        
        \begin{array}{l}
        [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
        \\
        \begin{array}{l}
        t_0 := \mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)\\
        \mathbf{if}\;C \leq 3.6 \cdot 10^{-48}:\\
        \;\;\;\;\frac{\sqrt{\left(\left(A - \mathsf{hypot}\left(A - C, B\right)\right) + C\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{t\_0}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{t\_0}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if C < 3.6000000000000002e-48

          1. Initial program 28.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. Applied rewrites36.7%

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

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

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

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

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

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

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

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

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

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

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

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

          if 3.6000000000000002e-48 < C

          1. Initial program 8.2%

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

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

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

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

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

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

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

              \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            3. lift-+.f64N/A

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

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

              \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            6. lift--.f64N/A

              \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            7. lift--.f64N/A

              \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
            8. sub-negate2N/A

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

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

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

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

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

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

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

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

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

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

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

        Alternative 11: 22.7% accurate, 7.2× speedup?

        \[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ \frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \end{array} \]
        NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
        (FPCore (A B C F)
         :precision binary64
         (/
          (sqrt (* -8.0 (* A (* C (* F (- A (* -1.0 A)))))))
          (fma (* C 4.0) A (* (- B) B))))
        assert(A < B && B < C && C < F);
        double code(double A, double B, double C, double F) {
        	return sqrt((-8.0 * (A * (C * (F * (A - (-1.0 * A))))))) / fma((C * 4.0), A, (-B * B));
        }
        
        A, B, C, F = sort([A, B, C, F])
        function code(A, B, C, F)
        	return Float64(sqrt(Float64(-8.0 * Float64(A * Float64(C * Float64(F * Float64(A - Float64(-1.0 * A))))))) / fma(Float64(C * 4.0), A, Float64(Float64(-B) * B)))
        end
        
        NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
        code[A_, B_, C_, F_] := N[(N[Sqrt[N[(-8.0 * N[(A * N[(C * N[(F * N[(A - N[(-1.0 * A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(N[(C * 4.0), $MachinePrecision] * A + N[((-B) * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
        \\
        \frac{\sqrt{-8 \cdot \left(A \cdot \left(C \cdot \left(F \cdot \left(A - -1 \cdot A\right)\right)\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)}
        \end{array}
        
        Derivation
        1. Initial program 18.3%

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

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

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

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

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

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

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

            \[\leadsto \frac{\sqrt{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{hypot}\left(A - C, B\right) - \left(C + A\right)\right)\right)\right)} \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
          3. lift-+.f64N/A

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

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

            \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\left(\color{blue}{\left(\mathsf{hypot}\left(A - C, B\right) - C\right)} - A\right)\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
          6. lift--.f64N/A

            \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
          7. lift--.f64N/A

            \[\leadsto \frac{\sqrt{\left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{hypot}\left(A - C, B\right) - C\right) - A\right)}\right)\right) \cdot \left(\left(F + F\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\right)}}{\mathsf{fma}\left(C \cdot 4, A, \left(-B\right) \cdot B\right)} \]
          8. sub-negate2N/A

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

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

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

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

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

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

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

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

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

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

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

        Alternative 12: 0.0% accurate, 11.7× speedup?

        \[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ -1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{-2}\right) \end{array} \]
        NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
        (FPCore (A B C F) :precision binary64 (* -1.0 (* (sqrt (/ F B)) (sqrt -2.0))))
        assert(A < B && B < C && C < F);
        double code(double A, double B, double C, double F) {
        	return -1.0 * (sqrt((F / B)) * sqrt(-2.0));
        }
        
        NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
        module fmin_fmax_functions
            implicit none
            private
            public fmax
            public fmin
        
            interface fmax
                module procedure fmax88
                module procedure fmax44
                module procedure fmax84
                module procedure fmax48
            end interface
            interface fmin
                module procedure fmin88
                module procedure fmin44
                module procedure fmin84
                module procedure fmin48
            end interface
        contains
            real(8) function fmax88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(4) function fmax44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, max(x, y), y /= y), x /= x)
            end function
            real(8) function fmax84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmax48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
            end function
            real(8) function fmin88(x, y) result (res)
                real(8), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(4) function fmin44(x, y) result (res)
                real(4), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(y, merge(x, min(x, y), y /= y), x /= x)
            end function
            real(8) function fmin84(x, y) result(res)
                real(8), intent (in) :: x
                real(4), intent (in) :: y
                res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
            end function
            real(8) function fmin48(x, y) result(res)
                real(4), intent (in) :: x
                real(8), intent (in) :: y
                res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
            end function
        end module
        
        real(8) function code(a, b, c, f)
        use fmin_fmax_functions
            real(8), intent (in) :: a
            real(8), intent (in) :: b
            real(8), intent (in) :: c
            real(8), intent (in) :: f
            code = (-1.0d0) * (sqrt((f / b)) * sqrt((-2.0d0)))
        end function
        
        assert A < B && B < C && C < F;
        public static double code(double A, double B, double C, double F) {
        	return -1.0 * (Math.sqrt((F / B)) * Math.sqrt(-2.0));
        }
        
        [A, B, C, F] = sort([A, B, C, F])
        def code(A, B, C, F):
        	return -1.0 * (math.sqrt((F / B)) * math.sqrt(-2.0))
        
        A, B, C, F = sort([A, B, C, F])
        function code(A, B, C, F)
        	return Float64(-1.0 * Float64(sqrt(Float64(F / B)) * sqrt(-2.0)))
        end
        
        A, B, C, F = num2cell(sort([A, B, C, F])){:}
        function tmp = code(A, B, C, F)
        	tmp = -1.0 * (sqrt((F / B)) * sqrt(-2.0));
        end
        
        NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
        code[A_, B_, C_, F_] := N[(-1.0 * N[(N[Sqrt[N[(F / B), $MachinePrecision]], $MachinePrecision] * N[Sqrt[-2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
        \\
        -1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{-2}\right)
        \end{array}
        
        Derivation
        1. Initial program 18.3%

          \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) - \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
        2. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \frac{-\sqrt{\color{blue}{\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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{-\sqrt{-\left(\left(\left(\color{blue}{\mathsf{hypot}\left(B, A - C\right)} - C\right) - A\right) \cdot \left(2 \cdot F\right)\right) \cdot \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
          13. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto -1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{-2}\right) \]
          5. lower-sqrt.f640.0

            \[\leadsto -1 \cdot \left(\sqrt{\frac{F}{B}} \cdot \sqrt{-2}\right) \]
        9. Applied rewrites0.0%

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

        Reproduce

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