ABCF->ab-angle a

Percentage Accurate: 18.9% → 51.4%
Time: 21.3s
Alternatives: 9
Speedup: 16.4×

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 9 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: 51.4% accurate, 2.2× speedup?

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

\mathbf{else}:\\
\;\;\;\;0 - \frac{\sqrt{F}}{\sqrt{B\_m \cdot 0.5}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (pow.f64 B #s(literal 2 binary64)) < 2e8

    1. Initial program 15.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. Step-by-step derivation
      1. frac-2negN/A

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

        \[\leadsto \frac{\color{blue}{\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)} \]
      3. pow1/2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 14.6%

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

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

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

        \[\leadsto \color{blue}{0 - \sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      3. --lowering--.f64N/A

        \[\leadsto \color{blue}{0 - \sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      4. *-commutativeN/A

        \[\leadsto 0 - \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto 0 - \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto 0 - \color{blue}{\sqrt{2}} \cdot \sqrt{\frac{F}{B}} \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto 0 - \sqrt{2} \cdot \color{blue}{\sqrt{\frac{F}{B}}} \]
      8. /-lowering-/.f6424.2

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

      \[\leadsto \color{blue}{0 - \sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
    6. Step-by-step derivation
      1. sub0-negN/A

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\sqrt{2 \cdot \frac{F}{B}}}\right) \]
      4. rem-square-sqrtN/A

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\sqrt{2 \cdot \frac{F}{B}} \cdot \color{blue}{\sqrt{2 \cdot \frac{F}{B}}}}\right) \]
      10. rem-square-sqrtN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{2 \cdot \frac{F}{B}}}\right) \]
      11. associate-*r/N/A

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\frac{2 \cdot F}{B}}}\right) \]
      13. *-lowering-*.f6424.3

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

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\frac{\color{blue}{F \cdot 2}}{B}}\right) \]
      2. associate-/l*N/A

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{F \cdot \frac{2}{B}}}\right) \]
      4. /-lowering-/.f6424.3

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

      \[\leadsto -\sqrt{\color{blue}{F \cdot \frac{2}{B}}} \]
    10. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \color{blue}{\frac{1}{\frac{B}{2}}}}\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\frac{F}{\frac{B}{2}}}}\right) \]
      3. sqrt-divN/A

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

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

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{F}}{\color{blue}{\sqrt{\frac{B}{2}}}}\right) \]
      7. div-invN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{F}}{\sqrt{\color{blue}{B \cdot \frac{1}{2}}}}\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{F}}{\sqrt{B \cdot \color{blue}{\frac{1}{2}}}}\right) \]
      9. *-lowering-*.f6429.1

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

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

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

Alternative 2: 51.3% accurate, 4.9× speedup?

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

\mathbf{else}:\\
\;\;\;\;0 - \frac{\sqrt{F}}{\sqrt{B\_m \cdot 0.5}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 13000

    1. Initial program 15.7%

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

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

        \[\leadsto \frac{\color{blue}{\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)} \]
      3. pow1/2N/A

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

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

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

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

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

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

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

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

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

    if 13000 < B

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

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

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

        \[\leadsto \color{blue}{0 - \sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      3. --lowering--.f64N/A

        \[\leadsto \color{blue}{0 - \sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      4. *-commutativeN/A

        \[\leadsto 0 - \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto 0 - \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto 0 - \color{blue}{\sqrt{2}} \cdot \sqrt{\frac{F}{B}} \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto 0 - \sqrt{2} \cdot \color{blue}{\sqrt{\frac{F}{B}}} \]
      8. /-lowering-/.f6445.7

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

      \[\leadsto \color{blue}{0 - \sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
    6. Step-by-step derivation
      1. sub0-negN/A

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\sqrt{2 \cdot \frac{F}{B}}}\right) \]
      4. rem-square-sqrtN/A

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\sqrt{2 \cdot \frac{F}{B}} \cdot \color{blue}{\sqrt{2 \cdot \frac{F}{B}}}}\right) \]
      10. rem-square-sqrtN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{2 \cdot \frac{F}{B}}}\right) \]
      11. associate-*r/N/A

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\frac{2 \cdot F}{B}}}\right) \]
      13. *-lowering-*.f6446.0

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

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\frac{\color{blue}{F \cdot 2}}{B}}\right) \]
      2. associate-/l*N/A

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{F \cdot \frac{2}{B}}}\right) \]
      4. /-lowering-/.f6446.0

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

      \[\leadsto -\sqrt{\color{blue}{F \cdot \frac{2}{B}}} \]
    10. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \color{blue}{\frac{1}{\frac{B}{2}}}}\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\frac{F}{\frac{B}{2}}}}\right) \]
      3. sqrt-divN/A

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

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

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{F}}{\color{blue}{\sqrt{\frac{B}{2}}}}\right) \]
      7. div-invN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{F}}{\sqrt{\color{blue}{B \cdot \frac{1}{2}}}}\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{F}}{\sqrt{B \cdot \color{blue}{\frac{1}{2}}}}\right) \]
      9. *-lowering-*.f6456.4

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

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

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

Alternative 3: 38.2% accurate, 4.9× speedup?

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

\mathbf{elif}\;B\_m \leq 18000:\\
\;\;\;\;\frac{\sqrt{2 \cdot \left(F \cdot \left(-0.5 \cdot \frac{B\_m \cdot B\_m}{A}\right)\right)}}{0 - B\_m}\\

\mathbf{else}:\\
\;\;\;\;0 - \frac{\sqrt{F}}{\sqrt{B\_m \cdot 0.5}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if B < 7.1999999999999996e-136

    1. Initial program 14.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 F around 0

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

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

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

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

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

    if 7.1999999999999996e-136 < B < 18000

    1. Initial program 22.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 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. associate-*l/N/A

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(A + \sqrt{\mathsf{fma}\left(B, B, A \cdot A\right)}\right)}}{0 - B}} \]
    6. Step-by-step derivation
      1. sub0-negN/A

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(A + \sqrt{B \cdot B + A \cdot A}\right)}}{B}}\right) \]
    7. Applied egg-rr14.5%

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2 \cdot \left(F \cdot \left(\frac{-1}{2} \cdot \frac{\color{blue}{B \cdot B}}{A}\right)\right)}}{B}\right) \]
      4. *-lowering-*.f6416.6

        \[\leadsto -\frac{\sqrt{2 \cdot \left(F \cdot \left(-0.5 \cdot \frac{\color{blue}{B \cdot B}}{A}\right)\right)}}{B} \]
    10. Simplified16.6%

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

    if 18000 < B

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

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

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

        \[\leadsto \color{blue}{0 - \sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      3. --lowering--.f64N/A

        \[\leadsto \color{blue}{0 - \sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      4. *-commutativeN/A

        \[\leadsto 0 - \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto 0 - \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto 0 - \color{blue}{\sqrt{2}} \cdot \sqrt{\frac{F}{B}} \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto 0 - \sqrt{2} \cdot \color{blue}{\sqrt{\frac{F}{B}}} \]
      8. /-lowering-/.f6445.7

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

      \[\leadsto \color{blue}{0 - \sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
    6. Step-by-step derivation
      1. sub0-negN/A

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\sqrt{2 \cdot \frac{F}{B}}}\right) \]
      4. rem-square-sqrtN/A

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\sqrt{2 \cdot \frac{F}{B}} \cdot \color{blue}{\sqrt{2 \cdot \frac{F}{B}}}}\right) \]
      10. rem-square-sqrtN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{2 \cdot \frac{F}{B}}}\right) \]
      11. associate-*r/N/A

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\frac{2 \cdot F}{B}}}\right) \]
      13. *-lowering-*.f6446.0

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

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\frac{\color{blue}{F \cdot 2}}{B}}\right) \]
      2. associate-/l*N/A

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{F \cdot \frac{2}{B}}}\right) \]
      4. /-lowering-/.f6446.0

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

      \[\leadsto -\sqrt{\color{blue}{F \cdot \frac{2}{B}}} \]
    10. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \color{blue}{\frac{1}{\frac{B}{2}}}}\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\frac{F}{\frac{B}{2}}}}\right) \]
      3. sqrt-divN/A

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

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

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{F}}{\color{blue}{\sqrt{\frac{B}{2}}}}\right) \]
      7. div-invN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{F}}{\sqrt{\color{blue}{B \cdot \frac{1}{2}}}}\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{F}}{\sqrt{B \cdot \color{blue}{\frac{1}{2}}}}\right) \]
      9. *-lowering-*.f6456.4

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

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

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

Alternative 4: 36.8% accurate, 7.9× speedup?

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

\mathbf{else}:\\
\;\;\;\;0 - \frac{\sqrt{F}}{\sqrt{B\_m \cdot 0.5}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if B < 11000

    1. Initial program 15.7%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. Add Preprocessing
    3. Taylor expanded in 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. associate-*l/N/A

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(A + \sqrt{\mathsf{fma}\left(B, B, A \cdot A\right)}\right)}}{0 - B}} \]
    6. Step-by-step derivation
      1. sub0-negN/A

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(A + \sqrt{B \cdot B + A \cdot A}\right)}}{B}}\right) \]
    7. Applied egg-rr3.7%

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2 \cdot \left(F \cdot \left(\frac{-1}{2} \cdot \frac{\color{blue}{B \cdot B}}{A}\right)\right)}}{B}\right) \]
      4. *-lowering-*.f646.4

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

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

    if 11000 < B

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

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

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

        \[\leadsto \color{blue}{0 - \sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      3. --lowering--.f64N/A

        \[\leadsto \color{blue}{0 - \sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      4. *-commutativeN/A

        \[\leadsto 0 - \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto 0 - \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto 0 - \color{blue}{\sqrt{2}} \cdot \sqrt{\frac{F}{B}} \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto 0 - \sqrt{2} \cdot \color{blue}{\sqrt{\frac{F}{B}}} \]
      8. /-lowering-/.f6445.7

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

      \[\leadsto \color{blue}{0 - \sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
    6. Step-by-step derivation
      1. sub0-negN/A

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\sqrt{2 \cdot \frac{F}{B}}}\right) \]
      4. rem-square-sqrtN/A

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\sqrt{2 \cdot \frac{F}{B}} \cdot \color{blue}{\sqrt{2 \cdot \frac{F}{B}}}}\right) \]
      10. rem-square-sqrtN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{2 \cdot \frac{F}{B}}}\right) \]
      11. associate-*r/N/A

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\frac{2 \cdot F}{B}}}\right) \]
      13. *-lowering-*.f6446.0

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

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\frac{\color{blue}{F \cdot 2}}{B}}\right) \]
      2. associate-/l*N/A

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{F \cdot \frac{2}{B}}}\right) \]
      4. /-lowering-/.f6446.0

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

      \[\leadsto -\sqrt{\color{blue}{F \cdot \frac{2}{B}}} \]
    10. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \color{blue}{\frac{1}{\frac{B}{2}}}}\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\frac{F}{\frac{B}{2}}}}\right) \]
      3. sqrt-divN/A

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

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

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{F}}{\color{blue}{\sqrt{\frac{B}{2}}}}\right) \]
      7. div-invN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{F}}{\sqrt{\color{blue}{B \cdot \frac{1}{2}}}}\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{F}}{\sqrt{B \cdot \color{blue}{\frac{1}{2}}}}\right) \]
      9. *-lowering-*.f6456.4

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

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

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

Alternative 5: 33.7% accurate, 12.0× speedup?

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

\mathbf{else}:\\
\;\;\;\;0 - \sqrt{F \cdot \frac{2}{B\_m}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 4e5

    1. Initial program 18.4%

      \[\frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(\left(A + C\right) + \sqrt{{\left(A - C\right)}^{2} + {B}^{2}}\right)}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    2. 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. associate-*l/N/A

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

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

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

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

      \[\leadsto \color{blue}{\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(A + \sqrt{\mathsf{fma}\left(B, B, A \cdot A\right)}\right)}}{0 - B}} \]
    6. Step-by-step derivation
      1. sub0-negN/A

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

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{\sqrt{2} \cdot \sqrt{F \cdot \left(A + \sqrt{B \cdot B + A \cdot A}\right)}}{B}}\right) \]
    7. Applied egg-rr10.0%

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

      \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2 \cdot \left(F \cdot \color{blue}{B}\right)}}{B}\right) \]
    9. Step-by-step derivation
      1. Simplified15.7%

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

      if 4e5 < F

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

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

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

          \[\leadsto \color{blue}{0 - \sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
        3. --lowering--.f64N/A

          \[\leadsto \color{blue}{0 - \sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
        4. *-commutativeN/A

          \[\leadsto 0 - \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
        5. *-lowering-*.f64N/A

          \[\leadsto 0 - \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
        6. sqrt-lowering-sqrt.f64N/A

          \[\leadsto 0 - \color{blue}{\sqrt{2}} \cdot \sqrt{\frac{F}{B}} \]
        7. sqrt-lowering-sqrt.f64N/A

          \[\leadsto 0 - \sqrt{2} \cdot \color{blue}{\sqrt{\frac{F}{B}}} \]
        8. /-lowering-/.f6418.2

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

        \[\leadsto \color{blue}{0 - \sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      6. Step-by-step derivation
        1. sub0-negN/A

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

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

          \[\leadsto \mathsf{neg}\left(\color{blue}{\sqrt{2 \cdot \frac{F}{B}}}\right) \]
        4. rem-square-sqrtN/A

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

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

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

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

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

          \[\leadsto \mathsf{neg}\left(\sqrt{\sqrt{2 \cdot \frac{F}{B}} \cdot \color{blue}{\sqrt{2 \cdot \frac{F}{B}}}}\right) \]
        10. rem-square-sqrtN/A

          \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{2 \cdot \frac{F}{B}}}\right) \]
        11. associate-*r/N/A

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

          \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\frac{2 \cdot F}{B}}}\right) \]
        13. *-lowering-*.f6418.3

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

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

          \[\leadsto \mathsf{neg}\left(\sqrt{\frac{\color{blue}{F \cdot 2}}{B}}\right) \]
        2. associate-/l*N/A

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

          \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{F \cdot \frac{2}{B}}}\right) \]
        4. /-lowering-/.f6418.3

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

        \[\leadsto -\sqrt{\color{blue}{F \cdot \frac{2}{B}}} \]
    10. Recombined 2 regimes into one program.
    11. Final simplification16.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 400000:\\ \;\;\;\;\frac{\sqrt{2 \cdot \left(B \cdot F\right)}}{0 - B}\\ \mathbf{else}:\\ \;\;\;\;0 - \sqrt{F \cdot \frac{2}{B}}\\ \end{array} \]
    12. Add Preprocessing

    Alternative 6: 34.5% accurate, 12.3× speedup?

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

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

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

        \[\leadsto \color{blue}{0 - \sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      3. --lowering--.f64N/A

        \[\leadsto \color{blue}{0 - \sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      4. *-commutativeN/A

        \[\leadsto 0 - \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto 0 - \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto 0 - \color{blue}{\sqrt{2}} \cdot \sqrt{\frac{F}{B}} \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto 0 - \sqrt{2} \cdot \color{blue}{\sqrt{\frac{F}{B}}} \]
      8. /-lowering-/.f6413.8

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

      \[\leadsto \color{blue}{0 - \sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
    6. Step-by-step derivation
      1. sub0-negN/A

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\sqrt{2 \cdot \frac{F}{B}}}\right) \]
      4. rem-square-sqrtN/A

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\sqrt{2 \cdot \frac{F}{B}} \cdot \color{blue}{\sqrt{2 \cdot \frac{F}{B}}}}\right) \]
      10. rem-square-sqrtN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{2 \cdot \frac{F}{B}}}\right) \]
      11. associate-*r/N/A

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\frac{2 \cdot F}{B}}}\right) \]
      13. *-lowering-*.f6413.9

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

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\frac{\color{blue}{F \cdot 2}}{B}}\right) \]
      2. associate-/l*N/A

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{F \cdot \frac{2}{B}}}\right) \]
      4. /-lowering-/.f6413.9

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

      \[\leadsto -\sqrt{\color{blue}{F \cdot \frac{2}{B}}} \]
    10. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{F \cdot \color{blue}{\frac{1}{\frac{B}{2}}}}\right) \]
      2. un-div-invN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\frac{F}{\frac{B}{2}}}}\right) \]
      3. sqrt-divN/A

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

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

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

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{F}}{\color{blue}{\sqrt{\frac{B}{2}}}}\right) \]
      7. div-invN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{F}}{\sqrt{\color{blue}{B \cdot \frac{1}{2}}}}\right) \]
      8. metadata-evalN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{F}}{\sqrt{B \cdot \color{blue}{\frac{1}{2}}}}\right) \]
      9. *-lowering-*.f6416.3

        \[\leadsto -\frac{\sqrt{F}}{\sqrt{\color{blue}{B \cdot 0.5}}} \]
    11. Applied egg-rr16.3%

      \[\leadsto -\color{blue}{\frac{\sqrt{F}}{\sqrt{B \cdot 0.5}}} \]
    12. Final simplification16.3%

      \[\leadsto 0 - \frac{\sqrt{F}}{\sqrt{B \cdot 0.5}} \]
    13. Add Preprocessing

    Alternative 7: 34.5% accurate, 12.3× speedup?

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

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

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

        \[\leadsto \color{blue}{0 - \sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      3. --lowering--.f64N/A

        \[\leadsto \color{blue}{0 - \sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      4. *-commutativeN/A

        \[\leadsto 0 - \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto 0 - \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto 0 - \color{blue}{\sqrt{2}} \cdot \sqrt{\frac{F}{B}} \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto 0 - \sqrt{2} \cdot \color{blue}{\sqrt{\frac{F}{B}}} \]
      8. /-lowering-/.f6413.8

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

      \[\leadsto \color{blue}{0 - \sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
    6. Step-by-step derivation
      1. sub0-negN/A

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\sqrt{2 \cdot \frac{F}{B}}}\right) \]
      4. rem-square-sqrtN/A

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\sqrt{2 \cdot \frac{F}{B}} \cdot \color{blue}{\sqrt{2 \cdot \frac{F}{B}}}}\right) \]
      10. rem-square-sqrtN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{2 \cdot \frac{F}{B}}}\right) \]
      11. associate-*r/N/A

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\frac{2 \cdot F}{B}}}\right) \]
      13. *-lowering-*.f6413.9

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

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

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

        \[\leadsto \mathsf{neg}\left(\sqrt{2 \cdot \color{blue}{\frac{1}{\frac{B}{F}}}}\right) \]
      3. un-div-invN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\frac{2}{\frac{B}{F}}}}\right) \]
      4. sqrt-undivN/A

        \[\leadsto \mathsf{neg}\left(\color{blue}{\frac{\sqrt{2}}{\sqrt{\frac{B}{F}}}}\right) \]
      5. sqrt-undivN/A

        \[\leadsto \mathsf{neg}\left(\frac{\sqrt{2}}{\color{blue}{\frac{\sqrt{B}}{\sqrt{F}}}}\right) \]
      6. associate-/r/N/A

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\frac{2}{B}}} \cdot \sqrt{F}\right) \]
      11. sqrt-lowering-sqrt.f6416.2

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

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

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

    Alternative 8: 26.6% accurate, 14.9× speedup?

    \[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ 0 - \sqrt{\left|\mathsf{fma}\left(F, \frac{2}{B\_m}, 0\right)\right|} \end{array} \]
    B_m = (fabs.f64 B)
    NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
    (FPCore (A B_m C F)
     :precision binary64
     (- 0.0 (sqrt (fabs (fma F (/ 2.0 B_m) 0.0)))))
    B_m = fabs(B);
    assert(A < B_m && B_m < C && C < F);
    double code(double A, double B_m, double C, double F) {
    	return 0.0 - sqrt(fabs(fma(F, (2.0 / B_m), 0.0)));
    }
    
    B_m = abs(B)
    A, B_m, C, F = sort([A, B_m, C, F])
    function code(A, B_m, C, F)
    	return Float64(0.0 - sqrt(abs(fma(F, Float64(2.0 / B_m), 0.0))))
    end
    
    B_m = N[Abs[B], $MachinePrecision]
    NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
    code[A_, B$95$m_, C_, F_] := N[(0.0 - N[Sqrt[N[Abs[N[(F * N[(2.0 / B$95$m), $MachinePrecision] + 0.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    B_m = \left|B\right|
    \\
    [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
    \\
    0 - \sqrt{\left|\mathsf{fma}\left(F, \frac{2}{B\_m}, 0\right)\right|}
    \end{array}
    
    Derivation
    1. Initial program 15.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 B around inf

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

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

        \[\leadsto \color{blue}{0 - \sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      3. --lowering--.f64N/A

        \[\leadsto \color{blue}{0 - \sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      4. *-commutativeN/A

        \[\leadsto 0 - \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto 0 - \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto 0 - \color{blue}{\sqrt{2}} \cdot \sqrt{\frac{F}{B}} \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto 0 - \sqrt{2} \cdot \color{blue}{\sqrt{\frac{F}{B}}} \]
      8. /-lowering-/.f6413.8

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

      \[\leadsto \color{blue}{0 - \sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
    6. Step-by-step derivation
      1. sub0-negN/A

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\sqrt{2 \cdot \frac{F}{B}}}\right) \]
      4. rem-square-sqrtN/A

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\sqrt{2 \cdot \frac{F}{B}} \cdot \color{blue}{\sqrt{2 \cdot \frac{F}{B}}}}\right) \]
      10. rem-square-sqrtN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{2 \cdot \frac{F}{B}}}\right) \]
      11. associate-*r/N/A

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\frac{2 \cdot F}{B}}}\right) \]
      13. *-lowering-*.f6413.9

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

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

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\frac{F}{B} \cdot 2}}\right) \]
      3. rem-square-sqrtN/A

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\sqrt{\left(\frac{F}{B} \cdot 2\right) \cdot \left(\frac{F}{B} \cdot 2\right)}}}\right) \]
      5. rem-sqrt-squareN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\left|\frac{F}{B} \cdot 2\right|}}\right) \]
      6. fabs-lowering-fabs.f64N/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\left|\frac{F}{B} \cdot 2\right|}}\right) \]
      7. rem-square-sqrtN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\left|\color{blue}{\sqrt{\frac{F}{B} \cdot 2} \cdot \sqrt{\frac{F}{B} \cdot 2}}\right|}\right) \]
      8. sqrt-unprodN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\left|\color{blue}{\left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)} \cdot \sqrt{\frac{F}{B} \cdot 2}\right|}\right) \]
      9. sqrt-unprodN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\left|\left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right) \cdot \color{blue}{\left(\sqrt{\frac{F}{B}} \cdot \sqrt{2}\right)}\right|}\right) \]
      10. pow2N/A

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\left|{\left(\color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2}\right)}^{2}\right|}\right) \]
      12. clear-numN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\left|{\left(\color{blue}{\frac{1}{\frac{\sqrt{B}}{\sqrt{F}}}} \cdot \sqrt{2}\right)}^{2}\right|}\right) \]
      13. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\left|{\color{blue}{\left(\sqrt{2} \cdot \frac{1}{\frac{\sqrt{B}}{\sqrt{F}}}\right)}}^{2}\right|}\right) \]
      14. pow2N/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\left|\color{blue}{\left(\sqrt{2} \cdot \frac{1}{\frac{\sqrt{B}}{\sqrt{F}}}\right) \cdot \left(\sqrt{2} \cdot \frac{1}{\frac{\sqrt{B}}{\sqrt{F}}}\right)}\right|}\right) \]
      15. +-lft-identityN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\left|\left(\sqrt{2} \cdot \frac{1}{\frac{\sqrt{B}}{\sqrt{F}}}\right) \cdot \color{blue}{\left(0 + \sqrt{2} \cdot \frac{1}{\frac{\sqrt{B}}{\sqrt{F}}}\right)}\right|}\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\left|\left(\sqrt{2} \cdot \frac{1}{\frac{\sqrt{B}}{\sqrt{F}}}\right) \cdot \left(0 + \color{blue}{\frac{1}{\frac{\sqrt{B}}{\sqrt{F}}} \cdot \sqrt{2}}\right)\right|}\right) \]
      17. clear-numN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\left|\left(\sqrt{2} \cdot \frac{1}{\frac{\sqrt{B}}{\sqrt{F}}}\right) \cdot \left(0 + \color{blue}{\frac{\sqrt{F}}{\sqrt{B}}} \cdot \sqrt{2}\right)\right|}\right) \]
      18. sqrt-divN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\left|\left(\sqrt{2} \cdot \frac{1}{\frac{\sqrt{B}}{\sqrt{F}}}\right) \cdot \left(0 + \color{blue}{\sqrt{\frac{F}{B}}} \cdot \sqrt{2}\right)\right|}\right) \]
      19. +-commutativeN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\left|\left(\sqrt{2} \cdot \frac{1}{\frac{\sqrt{B}}{\sqrt{F}}}\right) \cdot \color{blue}{\left(\sqrt{\frac{F}{B}} \cdot \sqrt{2} + 0\right)}\right|}\right) \]
    9. Applied egg-rr27.8%

      \[\leadsto -\sqrt{\color{blue}{\left|\mathsf{fma}\left(F, \frac{2}{B}, 0\right)\right|}} \]
    10. Final simplification27.8%

      \[\leadsto 0 - \sqrt{\left|\mathsf{fma}\left(F, \frac{2}{B}, 0\right)\right|} \]
    11. Add Preprocessing

    Alternative 9: 26.4% accurate, 16.4× speedup?

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

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

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

        \[\leadsto \color{blue}{0 - \sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      3. --lowering--.f64N/A

        \[\leadsto \color{blue}{0 - \sqrt{\frac{F}{B}} \cdot \sqrt{2}} \]
      4. *-commutativeN/A

        \[\leadsto 0 - \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      5. *-lowering-*.f64N/A

        \[\leadsto 0 - \color{blue}{\sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
      6. sqrt-lowering-sqrt.f64N/A

        \[\leadsto 0 - \color{blue}{\sqrt{2}} \cdot \sqrt{\frac{F}{B}} \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto 0 - \sqrt{2} \cdot \color{blue}{\sqrt{\frac{F}{B}}} \]
      8. /-lowering-/.f6413.8

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

      \[\leadsto \color{blue}{0 - \sqrt{2} \cdot \sqrt{\frac{F}{B}}} \]
    6. Step-by-step derivation
      1. sub0-negN/A

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

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

        \[\leadsto \mathsf{neg}\left(\color{blue}{\sqrt{2 \cdot \frac{F}{B}}}\right) \]
      4. rem-square-sqrtN/A

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

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

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

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

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\sqrt{2 \cdot \frac{F}{B}} \cdot \color{blue}{\sqrt{2 \cdot \frac{F}{B}}}}\right) \]
      10. rem-square-sqrtN/A

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{2 \cdot \frac{F}{B}}}\right) \]
      11. associate-*r/N/A

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{\frac{2 \cdot F}{B}}}\right) \]
      13. *-lowering-*.f6413.9

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

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\frac{\color{blue}{F \cdot 2}}{B}}\right) \]
      2. associate-/l*N/A

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

        \[\leadsto \mathsf{neg}\left(\sqrt{\color{blue}{F \cdot \frac{2}{B}}}\right) \]
      4. /-lowering-/.f6413.9

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

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

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

    Reproduce

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