ABCF->ab-angle b

Percentage Accurate: 18.9% → 49.5%
Time: 14.3s
Alternatives: 11
Speedup: 18.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 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.9% accurate, 1.0× speedup?

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

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

Alternative 1: 49.5% accurate, 0.3× speedup?

\[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ \begin{array}{l} t_0 := \sqrt{-F}\\ t_1 := \mathsf{fma}\left(-4 \cdot C, A, B \cdot B\right)\\ t_2 := \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\\ t_3 := C \cdot \left(A \cdot 4\right) - {B}^{2}\\ t_4 := \frac{\sqrt{\left(\left(t\_3 \cdot F\right) \cdot 2\right) \cdot \left(\sqrt{{\left(A - C\right)}^{2} + {B}^{2}} - \left(C + A\right)\right)}}{t\_3}\\ \mathbf{if}\;t\_4 \leq -\infty:\\ \;\;\;\;\left(-{C}^{-0.5}\right) \cdot t\_0\\ \mathbf{elif}\;t\_4 \leq -5 \cdot 10^{-187}:\\ \;\;\;\;\frac{\sqrt{\left(t\_2 \cdot \left(F \cdot 2\right)\right) \cdot \left(\left(C + A\right) - \mathsf{hypot}\left(A - C, B\right)\right)}}{-t\_2}\\ \mathbf{elif}\;t\_4 \leq \infty:\\ \;\;\;\;\frac{-1}{t\_1} \cdot \sqrt{\left(\left(\mathsf{fma}\left(\frac{B \cdot B}{C}, -0.5, A\right) + A\right) \cdot \left(F \cdot 2\right)\right) \cdot t\_1}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{\sqrt{C}}{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 (sqrt (- F)))
        (t_1 (fma (* -4.0 C) A (* B B)))
        (t_2 (fma -4.0 (* C A) (* B B)))
        (t_3 (- (* C (* A 4.0)) (pow B 2.0)))
        (t_4
         (/
          (sqrt
           (*
            (* (* t_3 F) 2.0)
            (- (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))) (+ C A))))
          t_3)))
   (if (<= t_4 (- INFINITY))
     (* (- (pow C -0.5)) t_0)
     (if (<= t_4 -5e-187)
       (/ (sqrt (* (* t_2 (* F 2.0)) (- (+ C A) (hypot (- A C) B)))) (- t_2))
       (if (<= t_4 INFINITY)
         (*
          (/ -1.0 t_1)
          (sqrt (* (* (+ (fma (/ (* B B) C) -0.5 A) A) (* F 2.0)) t_1)))
         (/ -1.0 (/ (sqrt C) t_0)))))))
assert(A < B && B < C && C < F);
double code(double A, double B, double C, double F) {
	double t_0 = sqrt(-F);
	double t_1 = fma((-4.0 * C), A, (B * B));
	double t_2 = fma(-4.0, (C * A), (B * B));
	double t_3 = (C * (A * 4.0)) - pow(B, 2.0);
	double t_4 = sqrt((((t_3 * F) * 2.0) * (sqrt((pow((A - C), 2.0) + pow(B, 2.0))) - (C + A)))) / t_3;
	double tmp;
	if (t_4 <= -((double) INFINITY)) {
		tmp = -pow(C, -0.5) * t_0;
	} else if (t_4 <= -5e-187) {
		tmp = sqrt(((t_2 * (F * 2.0)) * ((C + A) - hypot((A - C), B)))) / -t_2;
	} else if (t_4 <= ((double) INFINITY)) {
		tmp = (-1.0 / t_1) * sqrt((((fma(((B * B) / C), -0.5, A) + A) * (F * 2.0)) * t_1));
	} else {
		tmp = -1.0 / (sqrt(C) / t_0);
	}
	return tmp;
}
A, B, C, F = sort([A, B, C, F])
function code(A, B, C, F)
	t_0 = sqrt(Float64(-F))
	t_1 = fma(Float64(-4.0 * C), A, Float64(B * B))
	t_2 = fma(-4.0, Float64(C * A), Float64(B * B))
	t_3 = Float64(Float64(C * Float64(A * 4.0)) - (B ^ 2.0))
	t_4 = Float64(sqrt(Float64(Float64(Float64(t_3 * F) * 2.0) * Float64(sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0))) - Float64(C + A)))) / t_3)
	tmp = 0.0
	if (t_4 <= Float64(-Inf))
		tmp = Float64(Float64(-(C ^ -0.5)) * t_0);
	elseif (t_4 <= -5e-187)
		tmp = Float64(sqrt(Float64(Float64(t_2 * Float64(F * 2.0)) * Float64(Float64(C + A) - hypot(Float64(A - C), B)))) / Float64(-t_2));
	elseif (t_4 <= Inf)
		tmp = Float64(Float64(-1.0 / t_1) * sqrt(Float64(Float64(Float64(fma(Float64(Float64(B * B) / C), -0.5, A) + A) * Float64(F * 2.0)) * t_1)));
	else
		tmp = Float64(-1.0 / Float64(sqrt(C) / 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[Sqrt[(-F)], $MachinePrecision]}, Block[{t$95$1 = N[(N[(-4.0 * C), $MachinePrecision] * A + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(C * A), $MachinePrecision] + N[(B * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision] - N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Sqrt[N[(N[(N[(t$95$3 * F), $MachinePrecision] * 2.0), $MachinePrecision] * N[(N[Sqrt[N[(N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[(C + A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$3), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], N[((-N[Power[C, -0.5], $MachinePrecision]) * t$95$0), $MachinePrecision], If[LessEqual[t$95$4, -5e-187], N[(N[Sqrt[N[(N[(t$95$2 * N[(F * 2.0), $MachinePrecision]), $MachinePrecision] * N[(N[(C + A), $MachinePrecision] - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / (-t$95$2)), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(N[(-1.0 / t$95$1), $MachinePrecision] * N[Sqrt[N[(N[(N[(N[(N[(N[(B * B), $MachinePrecision] / C), $MachinePrecision] * -0.5 + A), $MachinePrecision] + A), $MachinePrecision] * N[(F * 2.0), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[Sqrt[C], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
\\
\begin{array}{l}
t_0 := \sqrt{-F}\\
t_1 := \mathsf{fma}\left(-4 \cdot C, A, B \cdot B\right)\\
t_2 := \mathsf{fma}\left(-4, C \cdot A, B \cdot B\right)\\
t_3 := C \cdot \left(A \cdot 4\right) - {B}^{2}\\
t_4 := \frac{\sqrt{\left(\left(t\_3 \cdot F\right) \cdot 2\right) \cdot \left(\sqrt{{\left(A - C\right)}^{2} + {B}^{2}} - \left(C + A\right)\right)}}{t\_3}\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;\left(-{C}^{-0.5}\right) \cdot t\_0\\

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

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

\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{\sqrt{C}}{t\_0}}\\


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

    1. Initial program 3.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \color{blue}{\sqrt{\frac{-1}{2}}}\right) \cdot \sqrt{2} \]
      9. lower-sqrt.f640.0

        \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \color{blue}{\sqrt{2}} \]
    5. Applied rewrites0.0%

      \[\leadsto \color{blue}{-\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \sqrt{2}} \]
    6. Step-by-step derivation
      1. Applied rewrites32.6%

        \[\leadsto -\frac{\sqrt{F \cdot -1}}{\sqrt{C}} \]
      2. Step-by-step derivation
        1. Applied rewrites32.7%

          \[\leadsto \sqrt{-F} \cdot \color{blue}{\left(-{C}^{-0.5}\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))) < -4.9999999999999996e-187

        1. Initial program 99.5%

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

            \[\leadsto \color{blue}{\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. lift-neg.f64N/A

            \[\leadsto \frac{\color{blue}{\mathsf{neg}\left(\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)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
          3. distribute-frac-negN/A

            \[\leadsto \color{blue}{\mathsf{neg}\left(\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}\right)} \]
          4. distribute-frac-neg2N/A

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

            \[\leadsto \color{blue}{\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)}}{\mathsf{neg}\left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right)\right)}} \]
        4. Applied rewrites99.5%

          \[\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(-4, C \cdot A, B \cdot B\right)}} \]

        if -4.9999999999999996e-187 < (/.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 19.4%

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

          \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \color{blue}{\left(\left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right) - -1 \cdot A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
        4. Step-by-step derivation
          1. 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 \color{blue}{\left(\left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right) - -1 \cdot A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
          2. +-commutativeN/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(\color{blue}{\left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + A\right)} - -1 \cdot A\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
          3. *-commutativeN/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(\color{blue}{\frac{{B}^{2}}{C} \cdot \frac{-1}{2}} + A\right) - -1 \cdot A\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
          4. lower-fma.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(\color{blue}{\mathsf{fma}\left(\frac{{B}^{2}}{C}, \frac{-1}{2}, A\right)} - -1 \cdot A\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
          5. 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(\mathsf{fma}\left(\color{blue}{\frac{{B}^{2}}{C}}, \frac{-1}{2}, A\right) - -1 \cdot A\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
          6. unpow2N/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(\mathsf{fma}\left(\frac{\color{blue}{B \cdot B}}{C}, \frac{-1}{2}, A\right) - -1 \cdot A\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
          7. 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(\mathsf{fma}\left(\frac{\color{blue}{B \cdot B}}{C}, \frac{-1}{2}, A\right) - -1 \cdot A\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
          8. mul-1-negN/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(\mathsf{fma}\left(\frac{B \cdot B}{C}, \frac{-1}{2}, A\right) - \color{blue}{\left(\mathsf{neg}\left(A\right)\right)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
          9. lower-neg.f6433.5

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \sqrt{\color{blue}{\mathsf{fma}\left(-4 \cdot C, A, B \cdot B\right) \cdot \left(\left(2 \cdot F\right) \cdot \left(\mathsf{fma}\left(\frac{B \cdot B}{C}, -0.5, A\right) + A\right)\right)}} \cdot \frac{-1}{\mathsf{fma}\left(-4 \cdot C, A, B \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)))

        1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

            \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \color{blue}{\sqrt{\frac{-1}{2}}}\right) \cdot \sqrt{2} \]
          9. lower-sqrt.f640.0

            \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \color{blue}{\sqrt{2}} \]
        5. Applied rewrites0.0%

          \[\leadsto \color{blue}{-\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \sqrt{2}} \]
        6. Step-by-step derivation
          1. Applied rewrites14.1%

            \[\leadsto -\frac{\sqrt{F \cdot -1}}{\sqrt{C}} \]
          2. Step-by-step derivation
            1. Applied rewrites14.1%

              \[\leadsto \frac{1}{\color{blue}{\frac{\sqrt{C}}{-\sqrt{-F}}}} \]
          3. Recombined 4 regimes into one program.
          4. Final simplification34.8%

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

          Alternative 2: 36.6% accurate, 1.4× speedup?

          \[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ \begin{array}{l} t_0 := \mathsf{fma}\left(-4 \cdot C, A, B \cdot B\right)\\ \mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-290}:\\ \;\;\;\;\sqrt{\left(t\_0 \cdot \left(F \cdot 2\right)\right) \cdot \left(A + A\right)} \cdot \frac{-1}{t\_0}\\ \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{+82}:\\ \;\;\;\;\left(-{C}^{-0.5}\right) \cdot \sqrt{-F}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\sqrt{2}}{B} \cdot \sqrt{\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F}\\ \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 (* -4.0 C) A (* B B))))
             (if (<= (pow B 2.0) 5e-290)
               (* (sqrt (* (* t_0 (* F 2.0)) (+ A A))) (/ -1.0 t_0))
               (if (<= (pow B 2.0) 2e+82)
                 (* (- (pow C -0.5)) (sqrt (- F)))
                 (* (/ (- (sqrt 2.0)) B) (sqrt (* (- A (hypot A B)) F)))))))
          assert(A < B && B < C && C < F);
          double code(double A, double B, double C, double F) {
          	double t_0 = fma((-4.0 * C), A, (B * B));
          	double tmp;
          	if (pow(B, 2.0) <= 5e-290) {
          		tmp = sqrt(((t_0 * (F * 2.0)) * (A + A))) * (-1.0 / t_0);
          	} else if (pow(B, 2.0) <= 2e+82) {
          		tmp = -pow(C, -0.5) * sqrt(-F);
          	} else {
          		tmp = (-sqrt(2.0) / B) * sqrt(((A - hypot(A, B)) * F));
          	}
          	return tmp;
          }
          
          A, B, C, F = sort([A, B, C, F])
          function code(A, B, C, F)
          	t_0 = fma(Float64(-4.0 * C), A, Float64(B * B))
          	tmp = 0.0
          	if ((B ^ 2.0) <= 5e-290)
          		tmp = Float64(sqrt(Float64(Float64(t_0 * Float64(F * 2.0)) * Float64(A + A))) * Float64(-1.0 / t_0));
          	elseif ((B ^ 2.0) <= 2e+82)
          		tmp = Float64(Float64(-(C ^ -0.5)) * sqrt(Float64(-F)));
          	else
          		tmp = Float64(Float64(Float64(-sqrt(2.0)) / B) * sqrt(Float64(Float64(A - hypot(A, B)) * F)));
          	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[(-4.0 * C), $MachinePrecision] * A + N[(B * B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 5e-290], N[(N[Sqrt[N[(N[(t$95$0 * N[(F * 2.0), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 2e+82], N[((-N[Power[C, -0.5], $MachinePrecision]) * N[Sqrt[(-F)], $MachinePrecision]), $MachinePrecision], N[(N[((-N[Sqrt[2.0], $MachinePrecision]) / B), $MachinePrecision] * N[Sqrt[N[(N[(A - N[Sqrt[A ^ 2 + B ^ 2], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
          \\
          \begin{array}{l}
          t_0 := \mathsf{fma}\left(-4 \cdot C, A, B \cdot B\right)\\
          \mathbf{if}\;{B}^{2} \leq 5 \cdot 10^{-290}:\\
          \;\;\;\;\sqrt{\left(t\_0 \cdot \left(F \cdot 2\right)\right) \cdot \left(A + A\right)} \cdot \frac{-1}{t\_0}\\
          
          \mathbf{elif}\;{B}^{2} \leq 2 \cdot 10^{+82}:\\
          \;\;\;\;\left(-{C}^{-0.5}\right) \cdot \sqrt{-F}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{-\sqrt{2}}{B} \cdot \sqrt{\left(A - \mathsf{hypot}\left(A, B\right)\right) \cdot F}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (pow.f64 B #s(literal 2 binary64)) < 5.0000000000000001e-290

            1. Initial program 18.8%

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

              \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \color{blue}{\left(A - -1 \cdot A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
            4. Step-by-step derivation
              1. 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 \color{blue}{\left(A - -1 \cdot A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
              2. mul-1-negN/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(A - \color{blue}{\left(\mathsf{neg}\left(A\right)\right)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
              3. lower-neg.f6426.7

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

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

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

            if 5.0000000000000001e-290 < (pow.f64 B #s(literal 2 binary64)) < 1.9999999999999999e82

            1. Initial program 26.8%

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

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

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

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

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

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

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

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

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

                \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \color{blue}{\sqrt{\frac{-1}{2}}}\right) \cdot \sqrt{2} \]
              9. lower-sqrt.f640.0

                \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \color{blue}{\sqrt{2}} \]
            5. Applied rewrites0.0%

              \[\leadsto \color{blue}{-\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \sqrt{2}} \]
            6. Step-by-step derivation
              1. Applied rewrites27.4%

                \[\leadsto -\frac{\sqrt{F \cdot -1}}{\sqrt{C}} \]
              2. Step-by-step derivation
                1. Applied rewrites27.4%

                  \[\leadsto \sqrt{-F} \cdot \color{blue}{\left(-{C}^{-0.5}\right)} \]

                if 1.9999999999999999e82 < (pow.f64 B #s(literal 2 binary64))

                1. Initial program 12.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 3: 36.6% accurate, 3.1× speedup?

              \[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;{B}^{2} \leq 10^{+108}:\\ \;\;\;\;\left(-\sqrt{\frac{1}{C}}\right) \cdot \sqrt{-F}\\ \mathbf{else}:\\ \;\;\;\;-\sqrt{\frac{\frac{C + A}{B} - 1}{B} \cdot \left(F \cdot 2\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
               (if (<= (pow B 2.0) 1e+108)
                 (* (- (sqrt (/ 1.0 C))) (sqrt (- F)))
                 (- (sqrt (* (/ (- (/ (+ C A) B) 1.0) B) (* F 2.0))))))
              assert(A < B && B < C && C < F);
              double code(double A, double B, double C, double F) {
              	double tmp;
              	if (pow(B, 2.0) <= 1e+108) {
              		tmp = -sqrt((1.0 / C)) * sqrt(-F);
              	} else {
              		tmp = -sqrt((((((C + A) / B) - 1.0) / B) * (F * 2.0)));
              	}
              	return tmp;
              }
              
              NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
              real(8) function code(a, b, c, f)
                  real(8), intent (in) :: a
                  real(8), intent (in) :: b
                  real(8), intent (in) :: c
                  real(8), intent (in) :: f
                  real(8) :: tmp
                  if ((b ** 2.0d0) <= 1d+108) then
                      tmp = -sqrt((1.0d0 / c)) * sqrt(-f)
                  else
                      tmp = -sqrt((((((c + a) / b) - 1.0d0) / b) * (f * 2.0d0)))
                  end if
                  code = tmp
              end function
              
              assert A < B && B < C && C < F;
              public static double code(double A, double B, double C, double F) {
              	double tmp;
              	if (Math.pow(B, 2.0) <= 1e+108) {
              		tmp = -Math.sqrt((1.0 / C)) * Math.sqrt(-F);
              	} else {
              		tmp = -Math.sqrt((((((C + A) / B) - 1.0) / B) * (F * 2.0)));
              	}
              	return tmp;
              }
              
              [A, B, C, F] = sort([A, B, C, F])
              def code(A, B, C, F):
              	tmp = 0
              	if math.pow(B, 2.0) <= 1e+108:
              		tmp = -math.sqrt((1.0 / C)) * math.sqrt(-F)
              	else:
              		tmp = -math.sqrt((((((C + A) / B) - 1.0) / B) * (F * 2.0)))
              	return tmp
              
              A, B, C, F = sort([A, B, C, F])
              function code(A, B, C, F)
              	tmp = 0.0
              	if ((B ^ 2.0) <= 1e+108)
              		tmp = Float64(Float64(-sqrt(Float64(1.0 / C))) * sqrt(Float64(-F)));
              	else
              		tmp = Float64(-sqrt(Float64(Float64(Float64(Float64(Float64(C + A) / B) - 1.0) / B) * Float64(F * 2.0))));
              	end
              	return tmp
              end
              
              A, B, C, F = num2cell(sort([A, B, C, F])){:}
              function tmp_2 = code(A, B, C, F)
              	tmp = 0.0;
              	if ((B ^ 2.0) <= 1e+108)
              		tmp = -sqrt((1.0 / C)) * sqrt(-F);
              	else
              		tmp = -sqrt((((((C + A) / B) - 1.0) / B) * (F * 2.0)));
              	end
              	tmp_2 = tmp;
              end
              
              NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
              code[A_, B_, C_, F_] := If[LessEqual[N[Power[B, 2.0], $MachinePrecision], 1e+108], N[((-N[Sqrt[N[(1.0 / C), $MachinePrecision]], $MachinePrecision]) * N[Sqrt[(-F)], $MachinePrecision]), $MachinePrecision], (-N[Sqrt[N[(N[(N[(N[(N[(C + A), $MachinePrecision] / B), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision] * N[(F * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision])]
              
              \begin{array}{l}
              [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
              \\
              \begin{array}{l}
              \mathbf{if}\;{B}^{2} \leq 10^{+108}:\\
              \;\;\;\;\left(-\sqrt{\frac{1}{C}}\right) \cdot \sqrt{-F}\\
              
              \mathbf{else}:\\
              \;\;\;\;-\sqrt{\frac{\frac{C + A}{B} - 1}{B} \cdot \left(F \cdot 2\right)}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (pow.f64 B #s(literal 2 binary64)) < 1e108

                1. Initial program 23.4%

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

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

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

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

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

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

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

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

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

                    \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \color{blue}{\sqrt{\frac{-1}{2}}}\right) \cdot \sqrt{2} \]
                  9. lower-sqrt.f640.0

                    \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \color{blue}{\sqrt{2}} \]
                5. Applied rewrites0.0%

                  \[\leadsto \color{blue}{-\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \sqrt{2}} \]
                6. Step-by-step derivation
                  1. Applied rewrites23.7%

                    \[\leadsto -\frac{\sqrt{F \cdot -1}}{\sqrt{C}} \]
                  2. Step-by-step derivation
                    1. Applied rewrites23.7%

                      \[\leadsto \sqrt{-F} \cdot \color{blue}{\left(-{C}^{-0.5}\right)} \]
                    2. Taylor expanded in C around 0

                      \[\leadsto \sqrt{-F} \cdot \left(-1 \cdot \color{blue}{\sqrt{\frac{1}{C}}}\right) \]
                    3. Step-by-step derivation
                      1. Applied rewrites23.7%

                        \[\leadsto \sqrt{-F} \cdot \left(-\sqrt{\frac{1}{C}}\right) \]

                      if 1e108 < (pow.f64 B #s(literal 2 binary64))

                      1. Initial program 11.8%

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

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

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

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

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

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

                        \[\leadsto -\sqrt{F \cdot \frac{\left(\frac{A}{B} + \frac{C}{B}\right) - 1}{B}} \cdot \sqrt{2} \]
                      7. Step-by-step derivation
                        1. Applied rewrites26.1%

                          \[\leadsto -\sqrt{F \cdot \frac{\frac{A + C}{B} - 1}{B}} \cdot \sqrt{2} \]
                        2. Step-by-step derivation
                          1. Applied rewrites26.2%

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

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

                        Alternative 4: 41.9% accurate, 3.9× speedup?

                        \[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;C \leq 5.2 \cdot 10^{-247}:\\ \;\;\;\;\frac{\sqrt{\left(\mathsf{fma}\left(-4 \cdot C, A, B \cdot B\right) \cdot \left(F \cdot 2\right)\right) \cdot \left(A + A\right)}}{\mathsf{fma}\left(-B, B, C \cdot \left(A \cdot 4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(-{C}^{-0.5}\right) \cdot \sqrt{-F}\\ \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
                         (if (<= C 5.2e-247)
                           (/
                            (sqrt (* (* (fma (* -4.0 C) A (* B B)) (* F 2.0)) (+ A A)))
                            (fma (- B) B (* C (* A 4.0))))
                           (* (- (pow C -0.5)) (sqrt (- F)))))
                        assert(A < B && B < C && C < F);
                        double code(double A, double B, double C, double F) {
                        	double tmp;
                        	if (C <= 5.2e-247) {
                        		tmp = sqrt(((fma((-4.0 * C), A, (B * B)) * (F * 2.0)) * (A + A))) / fma(-B, B, (C * (A * 4.0)));
                        	} else {
                        		tmp = -pow(C, -0.5) * sqrt(-F);
                        	}
                        	return tmp;
                        }
                        
                        A, B, C, F = sort([A, B, C, F])
                        function code(A, B, C, F)
                        	tmp = 0.0
                        	if (C <= 5.2e-247)
                        		tmp = Float64(sqrt(Float64(Float64(fma(Float64(-4.0 * C), A, Float64(B * B)) * Float64(F * 2.0)) * Float64(A + A))) / fma(Float64(-B), B, Float64(C * Float64(A * 4.0))));
                        	else
                        		tmp = Float64(Float64(-(C ^ -0.5)) * sqrt(Float64(-F)));
                        	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_] := If[LessEqual[C, 5.2e-247], N[(N[Sqrt[N[(N[(N[(N[(-4.0 * C), $MachinePrecision] * A + N[(B * B), $MachinePrecision]), $MachinePrecision] * N[(F * 2.0), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[((-B) * B + N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[Power[C, -0.5], $MachinePrecision]) * N[Sqrt[(-F)], $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;C \leq 5.2 \cdot 10^{-247}:\\
                        \;\;\;\;\frac{\sqrt{\left(\mathsf{fma}\left(-4 \cdot C, A, B \cdot B\right) \cdot \left(F \cdot 2\right)\right) \cdot \left(A + A\right)}}{\mathsf{fma}\left(-B, B, C \cdot \left(A \cdot 4\right)\right)}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\left(-{C}^{-0.5}\right) \cdot \sqrt{-F}\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if C < 5.2e-247

                          1. Initial program 24.3%

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

                            \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \color{blue}{\left(A - -1 \cdot A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                          4. Step-by-step derivation
                            1. 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 \color{blue}{\left(A - -1 \cdot A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                            2. mul-1-negN/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(A - \color{blue}{\left(\mathsf{neg}\left(A\right)\right)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                            3. lower-neg.f649.5

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

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

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

                          if 5.2e-247 < C

                          1. Initial program 11.5%

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

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

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

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

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

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

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

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

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

                              \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \color{blue}{\sqrt{\frac{-1}{2}}}\right) \cdot \sqrt{2} \]
                            9. lower-sqrt.f640.0

                              \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \color{blue}{\sqrt{2}} \]
                          5. Applied rewrites0.0%

                            \[\leadsto \color{blue}{-\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \sqrt{2}} \]
                          6. Step-by-step derivation
                            1. Applied rewrites43.4%

                              \[\leadsto -\frac{\sqrt{F \cdot -1}}{\sqrt{C}} \]
                            2. Step-by-step derivation
                              1. Applied rewrites43.4%

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

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

                            Alternative 5: 41.9% accurate, 6.1× speedup?

                            \[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;C \leq 5.2 \cdot 10^{-247}:\\ \;\;\;\;\frac{\sqrt{\left(\mathsf{fma}\left(-4 \cdot C, A, B \cdot B\right) \cdot \left(F \cdot 2\right)\right) \cdot \left(A + A\right)}}{\mathsf{fma}\left(-B, B, C \cdot \left(A \cdot 4\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(-\sqrt{\frac{1}{C}}\right) \cdot \sqrt{-F}\\ \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
                             (if (<= C 5.2e-247)
                               (/
                                (sqrt (* (* (fma (* -4.0 C) A (* B B)) (* F 2.0)) (+ A A)))
                                (fma (- B) B (* C (* A 4.0))))
                               (* (- (sqrt (/ 1.0 C))) (sqrt (- F)))))
                            assert(A < B && B < C && C < F);
                            double code(double A, double B, double C, double F) {
                            	double tmp;
                            	if (C <= 5.2e-247) {
                            		tmp = sqrt(((fma((-4.0 * C), A, (B * B)) * (F * 2.0)) * (A + A))) / fma(-B, B, (C * (A * 4.0)));
                            	} else {
                            		tmp = -sqrt((1.0 / C)) * sqrt(-F);
                            	}
                            	return tmp;
                            }
                            
                            A, B, C, F = sort([A, B, C, F])
                            function code(A, B, C, F)
                            	tmp = 0.0
                            	if (C <= 5.2e-247)
                            		tmp = Float64(sqrt(Float64(Float64(fma(Float64(-4.0 * C), A, Float64(B * B)) * Float64(F * 2.0)) * Float64(A + A))) / fma(Float64(-B), B, Float64(C * Float64(A * 4.0))));
                            	else
                            		tmp = Float64(Float64(-sqrt(Float64(1.0 / C))) * sqrt(Float64(-F)));
                            	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_] := If[LessEqual[C, 5.2e-247], N[(N[Sqrt[N[(N[(N[(N[(-4.0 * C), $MachinePrecision] * A + N[(B * B), $MachinePrecision]), $MachinePrecision] * N[(F * 2.0), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[((-B) * B + N[(C * N[(A * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[N[(1.0 / C), $MachinePrecision]], $MachinePrecision]) * N[Sqrt[(-F)], $MachinePrecision]), $MachinePrecision]]
                            
                            \begin{array}{l}
                            [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;C \leq 5.2 \cdot 10^{-247}:\\
                            \;\;\;\;\frac{\sqrt{\left(\mathsf{fma}\left(-4 \cdot C, A, B \cdot B\right) \cdot \left(F \cdot 2\right)\right) \cdot \left(A + A\right)}}{\mathsf{fma}\left(-B, B, C \cdot \left(A \cdot 4\right)\right)}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\left(-\sqrt{\frac{1}{C}}\right) \cdot \sqrt{-F}\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if C < 5.2e-247

                              1. Initial program 24.3%

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

                                \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \color{blue}{\left(A - -1 \cdot A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                              4. Step-by-step derivation
                                1. 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 \color{blue}{\left(A - -1 \cdot A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                2. mul-1-negN/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(A - \color{blue}{\left(\mathsf{neg}\left(A\right)\right)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                3. lower-neg.f649.5

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

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

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

                              if 5.2e-247 < C

                              1. Initial program 11.5%

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

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

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

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

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

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

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

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

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

                                  \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \color{blue}{\sqrt{\frac{-1}{2}}}\right) \cdot \sqrt{2} \]
                                9. lower-sqrt.f640.0

                                  \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \color{blue}{\sqrt{2}} \]
                              5. Applied rewrites0.0%

                                \[\leadsto \color{blue}{-\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \sqrt{2}} \]
                              6. Step-by-step derivation
                                1. Applied rewrites43.4%

                                  \[\leadsto -\frac{\sqrt{F \cdot -1}}{\sqrt{C}} \]
                                2. Step-by-step derivation
                                  1. Applied rewrites43.4%

                                    \[\leadsto \sqrt{-F} \cdot \color{blue}{\left(-{C}^{-0.5}\right)} \]
                                  2. Taylor expanded in C around 0

                                    \[\leadsto \sqrt{-F} \cdot \left(-1 \cdot \color{blue}{\sqrt{\frac{1}{C}}}\right) \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites43.4%

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

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

                                  Alternative 6: 39.9% accurate, 6.8× speedup?

                                  \[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;C \leq -1.9 \cdot 10^{-130}:\\ \;\;\;\;\sqrt{\left(\left(\left(\left(A + A\right) \cdot F\right) \cdot C\right) \cdot A\right) \cdot -8} \cdot \frac{-1}{\mathsf{fma}\left(-4 \cdot C, A, B \cdot B\right)}\\ \mathbf{elif}\;C \leq 3.4 \cdot 10^{-200}:\\ \;\;\;\;-\sqrt{\frac{\frac{C + A}{B} - 1}{B} \cdot \left(F \cdot 2\right)}\\ \mathbf{else}:\\ \;\;\;\;\left(-\sqrt{\frac{1}{C}}\right) \cdot \sqrt{-F}\\ \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
                                   (if (<= C -1.9e-130)
                                     (*
                                      (sqrt (* (* (* (* (+ A A) F) C) A) -8.0))
                                      (/ -1.0 (fma (* -4.0 C) A (* B B))))
                                     (if (<= C 3.4e-200)
                                       (- (sqrt (* (/ (- (/ (+ C A) B) 1.0) B) (* F 2.0))))
                                       (* (- (sqrt (/ 1.0 C))) (sqrt (- F))))))
                                  assert(A < B && B < C && C < F);
                                  double code(double A, double B, double C, double F) {
                                  	double tmp;
                                  	if (C <= -1.9e-130) {
                                  		tmp = sqrt((((((A + A) * F) * C) * A) * -8.0)) * (-1.0 / fma((-4.0 * C), A, (B * B)));
                                  	} else if (C <= 3.4e-200) {
                                  		tmp = -sqrt((((((C + A) / B) - 1.0) / B) * (F * 2.0)));
                                  	} else {
                                  		tmp = -sqrt((1.0 / C)) * sqrt(-F);
                                  	}
                                  	return tmp;
                                  }
                                  
                                  A, B, C, F = sort([A, B, C, F])
                                  function code(A, B, C, F)
                                  	tmp = 0.0
                                  	if (C <= -1.9e-130)
                                  		tmp = Float64(sqrt(Float64(Float64(Float64(Float64(Float64(A + A) * F) * C) * A) * -8.0)) * Float64(-1.0 / fma(Float64(-4.0 * C), A, Float64(B * B))));
                                  	elseif (C <= 3.4e-200)
                                  		tmp = Float64(-sqrt(Float64(Float64(Float64(Float64(Float64(C + A) / B) - 1.0) / B) * Float64(F * 2.0))));
                                  	else
                                  		tmp = Float64(Float64(-sqrt(Float64(1.0 / C))) * sqrt(Float64(-F)));
                                  	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_] := If[LessEqual[C, -1.9e-130], N[(N[Sqrt[N[(N[(N[(N[(N[(A + A), $MachinePrecision] * F), $MachinePrecision] * C), $MachinePrecision] * A), $MachinePrecision] * -8.0), $MachinePrecision]], $MachinePrecision] * N[(-1.0 / N[(N[(-4.0 * C), $MachinePrecision] * A + N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[C, 3.4e-200], (-N[Sqrt[N[(N[(N[(N[(N[(C + A), $MachinePrecision] / B), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision] * N[(F * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), N[((-N[Sqrt[N[(1.0 / C), $MachinePrecision]], $MachinePrecision]) * N[Sqrt[(-F)], $MachinePrecision]), $MachinePrecision]]]
                                  
                                  \begin{array}{l}
                                  [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;C \leq -1.9 \cdot 10^{-130}:\\
                                  \;\;\;\;\sqrt{\left(\left(\left(\left(A + A\right) \cdot F\right) \cdot C\right) \cdot A\right) \cdot -8} \cdot \frac{-1}{\mathsf{fma}\left(-4 \cdot C, A, B \cdot B\right)}\\
                                  
                                  \mathbf{elif}\;C \leq 3.4 \cdot 10^{-200}:\\
                                  \;\;\;\;-\sqrt{\frac{\frac{C + A}{B} - 1}{B} \cdot \left(F \cdot 2\right)}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\left(-\sqrt{\frac{1}{C}}\right) \cdot \sqrt{-F}\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 3 regimes
                                  2. if C < -1.8999999999999999e-130

                                    1. Initial program 23.2%

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

                                      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \color{blue}{\left(\left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right) - -1 \cdot A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                    4. Step-by-step derivation
                                      1. 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 \color{blue}{\left(\left(A + \frac{-1}{2} \cdot \frac{{B}^{2}}{C}\right) - -1 \cdot A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                      2. +-commutativeN/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(\color{blue}{\left(\frac{-1}{2} \cdot \frac{{B}^{2}}{C} + A\right)} - -1 \cdot A\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                      3. *-commutativeN/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(\color{blue}{\frac{{B}^{2}}{C} \cdot \frac{-1}{2}} + A\right) - -1 \cdot A\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                      4. lower-fma.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(\color{blue}{\mathsf{fma}\left(\frac{{B}^{2}}{C}, \frac{-1}{2}, A\right)} - -1 \cdot A\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                      5. 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(\mathsf{fma}\left(\color{blue}{\frac{{B}^{2}}{C}}, \frac{-1}{2}, A\right) - -1 \cdot A\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                      6. unpow2N/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(\mathsf{fma}\left(\frac{\color{blue}{B \cdot B}}{C}, \frac{-1}{2}, A\right) - -1 \cdot A\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                      7. 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(\mathsf{fma}\left(\frac{\color{blue}{B \cdot B}}{C}, \frac{-1}{2}, A\right) - -1 \cdot A\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                      8. mul-1-negN/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(\mathsf{fma}\left(\frac{B \cdot B}{C}, \frac{-1}{2}, A\right) - \color{blue}{\left(\mathsf{neg}\left(A\right)\right)}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
                                      9. lower-neg.f647.9

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

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

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

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

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

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

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

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

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

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

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

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

                                    if -1.8999999999999999e-130 < C < 3.4000000000000003e-200

                                    1. Initial program 26.4%

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

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

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

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

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

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

                                      \[\leadsto -\sqrt{F \cdot \frac{\left(\frac{A}{B} + \frac{C}{B}\right) - 1}{B}} \cdot \sqrt{2} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites19.8%

                                        \[\leadsto -\sqrt{F \cdot \frac{\frac{A + C}{B} - 1}{B}} \cdot \sqrt{2} \]
                                      2. Step-by-step derivation
                                        1. Applied rewrites19.9%

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

                                        if 3.4000000000000003e-200 < C

                                        1. Initial program 10.9%

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

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

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

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

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

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

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

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

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

                                            \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \color{blue}{\sqrt{\frac{-1}{2}}}\right) \cdot \sqrt{2} \]
                                          9. lower-sqrt.f640.0

                                            \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \color{blue}{\sqrt{2}} \]
                                        5. Applied rewrites0.0%

                                          \[\leadsto \color{blue}{-\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \sqrt{2}} \]
                                        6. Step-by-step derivation
                                          1. Applied rewrites44.9%

                                            \[\leadsto -\frac{\sqrt{F \cdot -1}}{\sqrt{C}} \]
                                          2. Step-by-step derivation
                                            1. Applied rewrites44.9%

                                              \[\leadsto \sqrt{-F} \cdot \color{blue}{\left(-{C}^{-0.5}\right)} \]
                                            2. Taylor expanded in C around 0

                                              \[\leadsto \sqrt{-F} \cdot \left(-1 \cdot \color{blue}{\sqrt{\frac{1}{C}}}\right) \]
                                            3. Step-by-step derivation
                                              1. Applied rewrites44.9%

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

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

                                            Alternative 7: 39.9% accurate, 9.8× speedup?

                                            \[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;B \leq 2 \cdot 10^{+55}:\\ \;\;\;\;\left(-\sqrt{\frac{1}{C}}\right) \cdot \sqrt{-F}\\ \mathbf{else}:\\ \;\;\;\;\left(-\sqrt{2}\right) \cdot \sqrt{\frac{-1}{B} \cdot F}\\ \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
                                             (if (<= B 2e+55)
                                               (* (- (sqrt (/ 1.0 C))) (sqrt (- F)))
                                               (* (- (sqrt 2.0)) (sqrt (* (/ -1.0 B) F)))))
                                            assert(A < B && B < C && C < F);
                                            double code(double A, double B, double C, double F) {
                                            	double tmp;
                                            	if (B <= 2e+55) {
                                            		tmp = -sqrt((1.0 / C)) * sqrt(-F);
                                            	} else {
                                            		tmp = -sqrt(2.0) * sqrt(((-1.0 / B) * F));
                                            	}
                                            	return tmp;
                                            }
                                            
                                            NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
                                            real(8) function code(a, b, c, f)
                                                real(8), intent (in) :: a
                                                real(8), intent (in) :: b
                                                real(8), intent (in) :: c
                                                real(8), intent (in) :: f
                                                real(8) :: tmp
                                                if (b <= 2d+55) then
                                                    tmp = -sqrt((1.0d0 / c)) * sqrt(-f)
                                                else
                                                    tmp = -sqrt(2.0d0) * sqrt((((-1.0d0) / b) * f))
                                                end if
                                                code = tmp
                                            end function
                                            
                                            assert A < B && B < C && C < F;
                                            public static double code(double A, double B, double C, double F) {
                                            	double tmp;
                                            	if (B <= 2e+55) {
                                            		tmp = -Math.sqrt((1.0 / C)) * Math.sqrt(-F);
                                            	} else {
                                            		tmp = -Math.sqrt(2.0) * Math.sqrt(((-1.0 / B) * F));
                                            	}
                                            	return tmp;
                                            }
                                            
                                            [A, B, C, F] = sort([A, B, C, F])
                                            def code(A, B, C, F):
                                            	tmp = 0
                                            	if B <= 2e+55:
                                            		tmp = -math.sqrt((1.0 / C)) * math.sqrt(-F)
                                            	else:
                                            		tmp = -math.sqrt(2.0) * math.sqrt(((-1.0 / B) * F))
                                            	return tmp
                                            
                                            A, B, C, F = sort([A, B, C, F])
                                            function code(A, B, C, F)
                                            	tmp = 0.0
                                            	if (B <= 2e+55)
                                            		tmp = Float64(Float64(-sqrt(Float64(1.0 / C))) * sqrt(Float64(-F)));
                                            	else
                                            		tmp = Float64(Float64(-sqrt(2.0)) * sqrt(Float64(Float64(-1.0 / B) * F)));
                                            	end
                                            	return tmp
                                            end
                                            
                                            A, B, C, F = num2cell(sort([A, B, C, F])){:}
                                            function tmp_2 = code(A, B, C, F)
                                            	tmp = 0.0;
                                            	if (B <= 2e+55)
                                            		tmp = -sqrt((1.0 / C)) * sqrt(-F);
                                            	else
                                            		tmp = -sqrt(2.0) * sqrt(((-1.0 / B) * F));
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
                                            code[A_, B_, C_, F_] := If[LessEqual[B, 2e+55], N[((-N[Sqrt[N[(1.0 / C), $MachinePrecision]], $MachinePrecision]) * N[Sqrt[(-F)], $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[2.0], $MachinePrecision]) * N[Sqrt[N[(N[(-1.0 / B), $MachinePrecision] * F), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
                                            
                                            \begin{array}{l}
                                            [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
                                            \\
                                            \begin{array}{l}
                                            \mathbf{if}\;B \leq 2 \cdot 10^{+55}:\\
                                            \;\;\;\;\left(-\sqrt{\frac{1}{C}}\right) \cdot \sqrt{-F}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;\left(-\sqrt{2}\right) \cdot \sqrt{\frac{-1}{B} \cdot F}\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if B < 2.00000000000000002e55

                                              1. Initial program 21.4%

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \color{blue}{\sqrt{\frac{-1}{2}}}\right) \cdot \sqrt{2} \]
                                                9. lower-sqrt.f640.0

                                                  \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \color{blue}{\sqrt{2}} \]
                                              5. Applied rewrites0.0%

                                                \[\leadsto \color{blue}{-\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \sqrt{2}} \]
                                              6. Step-by-step derivation
                                                1. Applied rewrites21.8%

                                                  \[\leadsto -\frac{\sqrt{F \cdot -1}}{\sqrt{C}} \]
                                                2. Step-by-step derivation
                                                  1. Applied rewrites21.8%

                                                    \[\leadsto \sqrt{-F} \cdot \color{blue}{\left(-{C}^{-0.5}\right)} \]
                                                  2. Taylor expanded in C around 0

                                                    \[\leadsto \sqrt{-F} \cdot \left(-1 \cdot \color{blue}{\sqrt{\frac{1}{C}}}\right) \]
                                                  3. Step-by-step derivation
                                                    1. Applied rewrites21.8%

                                                      \[\leadsto \sqrt{-F} \cdot \left(-\sqrt{\frac{1}{C}}\right) \]

                                                    if 2.00000000000000002e55 < B

                                                    1. Initial program 7.1%

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

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

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

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

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

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

                                                      \[\leadsto -\sqrt{F \cdot \frac{-1}{B}} \cdot \sqrt{2} \]
                                                    7. Step-by-step derivation
                                                      1. Applied rewrites50.3%

                                                        \[\leadsto -\sqrt{F \cdot \frac{-1}{B}} \cdot \sqrt{2} \]
                                                    8. Recombined 2 regimes into one program.
                                                    9. Final simplification26.8%

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

                                                    Alternative 8: 34.7% accurate, 12.0× speedup?

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

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

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

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

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

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

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

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

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

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

                                                        \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \color{blue}{\sqrt{\frac{-1}{2}}}\right) \cdot \sqrt{2} \]
                                                      9. lower-sqrt.f640.0

                                                        \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \color{blue}{\sqrt{2}} \]
                                                    5. Applied rewrites0.0%

                                                      \[\leadsto \color{blue}{-\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \sqrt{2}} \]
                                                    6. Step-by-step derivation
                                                      1. Applied rewrites18.7%

                                                        \[\leadsto -\frac{\sqrt{F \cdot -1}}{\sqrt{C}} \]
                                                      2. Step-by-step derivation
                                                        1. Applied rewrites18.7%

                                                          \[\leadsto \sqrt{-F} \cdot \color{blue}{\left(-{C}^{-0.5}\right)} \]
                                                        2. Taylor expanded in C around 0

                                                          \[\leadsto \sqrt{-F} \cdot \left(-1 \cdot \color{blue}{\sqrt{\frac{1}{C}}}\right) \]
                                                        3. Step-by-step derivation
                                                          1. Applied rewrites18.7%

                                                            \[\leadsto \sqrt{-F} \cdot \left(-\sqrt{\frac{1}{C}}\right) \]
                                                          2. Final simplification18.7%

                                                            \[\leadsto \left(-\sqrt{\frac{1}{C}}\right) \cdot \sqrt{-F} \]
                                                          3. Add Preprocessing

                                                          Alternative 9: 34.8% accurate, 13.6× speedup?

                                                          \[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ \frac{\sqrt{-F}}{-\sqrt{C}} \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 (- F)) (- (sqrt C))))
                                                          assert(A < B && B < C && C < F);
                                                          double code(double A, double B, double C, double F) {
                                                          	return sqrt(-F) / -sqrt(C);
                                                          }
                                                          
                                                          NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
                                                          real(8) function code(a, b, c, f)
                                                              real(8), intent (in) :: a
                                                              real(8), intent (in) :: b
                                                              real(8), intent (in) :: c
                                                              real(8), intent (in) :: f
                                                              code = sqrt(-f) / -sqrt(c)
                                                          end function
                                                          
                                                          assert A < B && B < C && C < F;
                                                          public static double code(double A, double B, double C, double F) {
                                                          	return Math.sqrt(-F) / -Math.sqrt(C);
                                                          }
                                                          
                                                          [A, B, C, F] = sort([A, B, C, F])
                                                          def code(A, B, C, F):
                                                          	return math.sqrt(-F) / -math.sqrt(C)
                                                          
                                                          A, B, C, F = sort([A, B, C, F])
                                                          function code(A, B, C, F)
                                                          	return Float64(sqrt(Float64(-F)) / Float64(-sqrt(C)))
                                                          end
                                                          
                                                          A, B, C, F = num2cell(sort([A, B, C, F])){:}
                                                          function tmp = code(A, B, C, F)
                                                          	tmp = sqrt(-F) / -sqrt(C);
                                                          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[(-F)], $MachinePrecision] / (-N[Sqrt[C], $MachinePrecision])), $MachinePrecision]
                                                          
                                                          \begin{array}{l}
                                                          [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
                                                          \\
                                                          \frac{\sqrt{-F}}{-\sqrt{C}}
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Initial program 18.9%

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

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

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

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

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

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

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

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

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

                                                              \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \color{blue}{\sqrt{\frac{-1}{2}}}\right) \cdot \sqrt{2} \]
                                                            9. lower-sqrt.f640.0

                                                              \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \color{blue}{\sqrt{2}} \]
                                                          5. Applied rewrites0.0%

                                                            \[\leadsto \color{blue}{-\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \sqrt{2}} \]
                                                          6. Step-by-step derivation
                                                            1. Applied rewrites18.7%

                                                              \[\leadsto -\frac{\sqrt{F \cdot -1}}{\sqrt{C}} \]
                                                            2. Step-by-step derivation
                                                              1. Applied rewrites18.7%

                                                                \[\leadsto \frac{\sqrt{-F}}{\color{blue}{-\sqrt{C}}} \]
                                                              2. Add Preprocessing

                                                              Alternative 10: 27.5% accurate, 14.4× speedup?

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

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

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

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

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

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

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

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

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

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

                                                                  \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \color{blue}{\sqrt{\frac{-1}{2}}}\right) \cdot \sqrt{2} \]
                                                                9. lower-sqrt.f640.0

                                                                  \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \color{blue}{\sqrt{2}} \]
                                                              5. Applied rewrites0.0%

                                                                \[\leadsto \color{blue}{-\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \sqrt{2}} \]
                                                              6. Step-by-step derivation
                                                                1. Applied rewrites14.2%

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

                                                                Alternative 11: 27.5% accurate, 18.9× speedup?

                                                                \[\begin{array}{l} [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\ \\ -\sqrt{\frac{-F}{C}} \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 (/ (- F) C))))
                                                                assert(A < B && B < C && C < F);
                                                                double code(double A, double B, double C, double F) {
                                                                	return -sqrt((-F / C));
                                                                }
                                                                
                                                                NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
                                                                real(8) function code(a, b, c, f)
                                                                    real(8), intent (in) :: a
                                                                    real(8), intent (in) :: b
                                                                    real(8), intent (in) :: c
                                                                    real(8), intent (in) :: f
                                                                    code = -sqrt((-f / c))
                                                                end function
                                                                
                                                                assert A < B && B < C && C < F;
                                                                public static double code(double A, double B, double C, double F) {
                                                                	return -Math.sqrt((-F / C));
                                                                }
                                                                
                                                                [A, B, C, F] = sort([A, B, C, F])
                                                                def code(A, B, C, F):
                                                                	return -math.sqrt((-F / C))
                                                                
                                                                A, B, C, F = sort([A, B, C, F])
                                                                function code(A, B, C, F)
                                                                	return Float64(-sqrt(Float64(Float64(-F) / C)))
                                                                end
                                                                
                                                                A, B, C, F = num2cell(sort([A, B, C, F])){:}
                                                                function tmp = code(A, B, C, F)
                                                                	tmp = -sqrt((-F / C));
                                                                end
                                                                
                                                                NOTE: A, B, C, and F should be sorted in increasing order before calling this function.
                                                                code[A_, B_, C_, F_] := (-N[Sqrt[N[((-F) / C), $MachinePrecision]], $MachinePrecision])
                                                                
                                                                \begin{array}{l}
                                                                [A, B, C, F] = \mathsf{sort}([A, B, C, F])\\
                                                                \\
                                                                -\sqrt{\frac{-F}{C}}
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Initial program 18.9%

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

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

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

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

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

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

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

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

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

                                                                    \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \color{blue}{\sqrt{\frac{-1}{2}}}\right) \cdot \sqrt{2} \]
                                                                  9. lower-sqrt.f640.0

                                                                    \[\leadsto -\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \color{blue}{\sqrt{2}} \]
                                                                5. Applied rewrites0.0%

                                                                  \[\leadsto \color{blue}{-\left(\sqrt{\frac{F}{C}} \cdot \sqrt{-0.5}\right) \cdot \sqrt{2}} \]
                                                                6. Step-by-step derivation
                                                                  1. Applied rewrites18.7%

                                                                    \[\leadsto -\frac{\sqrt{F \cdot -1}}{\sqrt{C}} \]
                                                                  2. Step-by-step derivation
                                                                    1. Applied rewrites14.2%

                                                                      \[\leadsto \color{blue}{-\sqrt{\frac{-F}{C}}} \]
                                                                    2. Add Preprocessing

                                                                    Reproduce

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