ABCF->ab-angle b

Percentage Accurate: 19.0% → 57.4%
Time: 18.2s
Alternatives: 9
Speedup: 2.1×

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: 19.0% 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: 57.4% accurate, 0.3× 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 := \left(4 \cdot A\right) \cdot C\\ t_1 := 2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\\ t_2 := t\_0 - {B\_m}^{2}\\ t_3 := \frac{\sqrt{t\_1 \cdot \left(\left(A + C\right) - \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_2}\\ \mathbf{if}\;t\_3 \leq -\infty:\\ \;\;\;\;\sqrt{F \cdot \frac{A + \left(C - \mathsf{hypot}\left(A - C, B\_m\right)\right)}{{B\_m}^{2} + -4 \cdot \left(A \cdot C\right)}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{elif}\;t\_3 \leq -1 \cdot 10^{-168}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_3 \leq \infty:\\ \;\;\;\;\frac{\sqrt{t\_1 \cdot \left(A + \left(A + \frac{{B\_m}^{2} \cdot -0.5}{C}\right)\right)}}{t\_2}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-{\left({B\_m}^{-0.16666666666666666} \cdot {\left(\frac{-1}{F}\right)}^{-0.16666666666666666}\right)}^{3}\right)\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (let* ((t_0 (* (* 4.0 A) C))
        (t_1 (* 2.0 (* (- (pow B_m 2.0) t_0) F)))
        (t_2 (- t_0 (pow B_m 2.0)))
        (t_3
         (/
          (sqrt (* t_1 (- (+ A C) (sqrt (+ (pow B_m 2.0) (pow (- A C) 2.0))))))
          t_2)))
   (if (<= t_3 (- INFINITY))
     (*
      (sqrt
       (*
        F
        (/
         (+ A (- C (hypot (- A C) B_m)))
         (+ (pow B_m 2.0) (* -4.0 (* A C))))))
      (- (sqrt 2.0)))
     (if (<= t_3 -1e-168)
       t_3
       (if (<= t_3 INFINITY)
         (/ (sqrt (* t_1 (+ A (+ A (/ (* (pow B_m 2.0) -0.5) C))))) t_2)
         (*
          (sqrt 2.0)
          (-
           (pow
            (*
             (pow B_m -0.16666666666666666)
             (pow (/ -1.0 F) -0.16666666666666666))
            3.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) {
	double t_0 = (4.0 * A) * C;
	double t_1 = 2.0 * ((pow(B_m, 2.0) - t_0) * F);
	double t_2 = t_0 - pow(B_m, 2.0);
	double t_3 = sqrt((t_1 * ((A + C) - sqrt((pow(B_m, 2.0) + pow((A - C), 2.0)))))) / t_2;
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = sqrt((F * ((A + (C - hypot((A - C), B_m))) / (pow(B_m, 2.0) + (-4.0 * (A * C)))))) * -sqrt(2.0);
	} else if (t_3 <= -1e-168) {
		tmp = t_3;
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = sqrt((t_1 * (A + (A + ((pow(B_m, 2.0) * -0.5) / C))))) / t_2;
	} else {
		tmp = sqrt(2.0) * -pow((pow(B_m, -0.16666666666666666) * pow((-1.0 / F), -0.16666666666666666)), 3.0);
	}
	return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double t_0 = (4.0 * A) * C;
	double t_1 = 2.0 * ((Math.pow(B_m, 2.0) - t_0) * F);
	double t_2 = t_0 - Math.pow(B_m, 2.0);
	double t_3 = Math.sqrt((t_1 * ((A + C) - Math.sqrt((Math.pow(B_m, 2.0) + Math.pow((A - C), 2.0)))))) / t_2;
	double tmp;
	if (t_3 <= -Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt((F * ((A + (C - Math.hypot((A - C), B_m))) / (Math.pow(B_m, 2.0) + (-4.0 * (A * C)))))) * -Math.sqrt(2.0);
	} else if (t_3 <= -1e-168) {
		tmp = t_3;
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt((t_1 * (A + (A + ((Math.pow(B_m, 2.0) * -0.5) / C))))) / t_2;
	} else {
		tmp = Math.sqrt(2.0) * -Math.pow((Math.pow(B_m, -0.16666666666666666) * Math.pow((-1.0 / F), -0.16666666666666666)), 3.0);
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	t_0 = (4.0 * A) * C
	t_1 = 2.0 * ((math.pow(B_m, 2.0) - t_0) * F)
	t_2 = t_0 - math.pow(B_m, 2.0)
	t_3 = math.sqrt((t_1 * ((A + C) - math.sqrt((math.pow(B_m, 2.0) + math.pow((A - C), 2.0)))))) / t_2
	tmp = 0
	if t_3 <= -math.inf:
		tmp = math.sqrt((F * ((A + (C - math.hypot((A - C), B_m))) / (math.pow(B_m, 2.0) + (-4.0 * (A * C)))))) * -math.sqrt(2.0)
	elif t_3 <= -1e-168:
		tmp = t_3
	elif t_3 <= math.inf:
		tmp = math.sqrt((t_1 * (A + (A + ((math.pow(B_m, 2.0) * -0.5) / C))))) / t_2
	else:
		tmp = math.sqrt(2.0) * -math.pow((math.pow(B_m, -0.16666666666666666) * math.pow((-1.0 / F), -0.16666666666666666)), 3.0)
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = Float64(Float64(4.0 * A) * C)
	t_1 = Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F))
	t_2 = Float64(t_0 - (B_m ^ 2.0))
	t_3 = Float64(sqrt(Float64(t_1 * Float64(Float64(A + C) - sqrt(Float64((B_m ^ 2.0) + (Float64(A - C) ^ 2.0)))))) / t_2)
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = Float64(sqrt(Float64(F * Float64(Float64(A + Float64(C - hypot(Float64(A - C), B_m))) / Float64((B_m ^ 2.0) + Float64(-4.0 * Float64(A * C)))))) * Float64(-sqrt(2.0)));
	elseif (t_3 <= -1e-168)
		tmp = t_3;
	elseif (t_3 <= Inf)
		tmp = Float64(sqrt(Float64(t_1 * Float64(A + Float64(A + Float64(Float64((B_m ^ 2.0) * -0.5) / C))))) / t_2);
	else
		tmp = Float64(sqrt(2.0) * Float64(-(Float64((B_m ^ -0.16666666666666666) * (Float64(-1.0 / F) ^ -0.16666666666666666)) ^ 3.0)));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	t_0 = (4.0 * A) * C;
	t_1 = 2.0 * (((B_m ^ 2.0) - t_0) * F);
	t_2 = t_0 - (B_m ^ 2.0);
	t_3 = sqrt((t_1 * ((A + C) - sqrt(((B_m ^ 2.0) + ((A - C) ^ 2.0)))))) / t_2;
	tmp = 0.0;
	if (t_3 <= -Inf)
		tmp = sqrt((F * ((A + (C - hypot((A - C), B_m))) / ((B_m ^ 2.0) + (-4.0 * (A * C)))))) * -sqrt(2.0);
	elseif (t_3 <= -1e-168)
		tmp = t_3;
	elseif (t_3 <= Inf)
		tmp = sqrt((t_1 * (A + (A + (((B_m ^ 2.0) * -0.5) / C))))) / t_2;
	else
		tmp = sqrt(2.0) * -(((B_m ^ -0.16666666666666666) * ((-1.0 / F) ^ -0.16666666666666666)) ^ 3.0);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(t$95$1 * N[(N[(A + C), $MachinePrecision] - N[Sqrt[N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[Power[N[(A - C), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[Sqrt[N[(F * N[(N[(A + N[(C - N[Sqrt[N[(A - C), $MachinePrecision] ^ 2 + B$95$m ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Power[B$95$m, 2.0], $MachinePrecision] + N[(-4.0 * N[(A * C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-N[Sqrt[2.0], $MachinePrecision])), $MachinePrecision], If[LessEqual[t$95$3, -1e-168], t$95$3, If[LessEqual[t$95$3, Infinity], N[(N[Sqrt[N[(t$95$1 * N[(A + N[(A + N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] * -0.5), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$2), $MachinePrecision], N[(N[Sqrt[2.0], $MachinePrecision] * (-N[Power[N[(N[Power[B$95$m, -0.16666666666666666], $MachinePrecision] * N[Power[N[(-1.0 / F), $MachinePrecision], -0.16666666666666666], $MachinePrecision]), $MachinePrecision], 3.0], $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 := \left(4 \cdot A\right) \cdot C\\
t_1 := 2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\\
t_2 := t\_0 - {B\_m}^{2}\\
t_3 := \frac{\sqrt{t\_1 \cdot \left(\left(A + C\right) - \sqrt{{B\_m}^{2} + {\left(A - C\right)}^{2}}\right)}}{t\_2}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\sqrt{F \cdot \frac{A + \left(C - \mathsf{hypot}\left(A - C, B\_m\right)\right)}{{B\_m}^{2} + -4 \cdot \left(A \cdot C\right)}} \cdot \left(-\sqrt{2}\right)\\

\mathbf{elif}\;t\_3 \leq -1 \cdot 10^{-168}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\frac{\sqrt{t\_1 \cdot \left(A + \left(A + \frac{{B\_m}^{2} \cdot -0.5}{C}\right)\right)}}{t\_2}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-{\left({B\_m}^{-0.16666666666666666} \cdot {\left(\frac{-1}{F}\right)}^{-0.16666666666666666}\right)}^{3}\right)\\


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

    1. Initial program 3.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. Step-by-step derivation
      1. add-cbrt-cube3.4%

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

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

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

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

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

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

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

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

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

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

    1. Initial program 97.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

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

    1. Initial program 13.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 C around inf 18.9%

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

        \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \color{blue}{\left(A + \left(-0.5 \cdot \frac{{B}^{2}}{C} - -1 \cdot A\right)\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
      2. associate-*r/18.9%

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(\left(\sqrt[3]{-1} \cdot e^{0.16666666666666666 \cdot \left(\log \left(-1 \cdot F\right) + \log \left(\frac{1}{B}\right)\right)}\right) \cdot \sqrt[3]{\sqrt{2}}\right)}}^{3} \]
    7. Taylor expanded in F around -inf 22.0%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{-1}\right)}^{3} \cdot \left({\left(e^{0.16666666666666666 \cdot \left(\log \left(\frac{1}{B}\right) + -1 \cdot \log \left(\frac{-1}{F}\right)\right)}\right)}^{3} \cdot \sqrt{2}\right)} \]
    8. Step-by-step derivation
      1. rem-cube-cbrt22.0%

        \[\leadsto \color{blue}{-1} \cdot \left({\left(e^{0.16666666666666666 \cdot \left(\log \left(\frac{1}{B}\right) + -1 \cdot \log \left(\frac{-1}{F}\right)\right)}\right)}^{3} \cdot \sqrt{2}\right) \]
      2. mul-1-neg22.0%

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

        \[\leadsto \color{blue}{{\left(e^{0.16666666666666666 \cdot \left(\log \left(\frac{1}{B}\right) + -1 \cdot \log \left(\frac{-1}{F}\right)\right)}\right)}^{3} \cdot \left(-\sqrt{2}\right)} \]
    9. Simplified22.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}} \leq -\infty:\\ \;\;\;\;\sqrt{F \cdot \frac{A + \left(C - \mathsf{hypot}\left(A - C, B\right)\right)}{{B}^{2} + -4 \cdot \left(A \cdot C\right)}} \cdot \left(-\sqrt{2}\right)\\ \mathbf{elif}\;\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{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}} \leq -1 \cdot 10^{-168}:\\ \;\;\;\;\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{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{elif}\;\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{{B}^{2} + {\left(A - C\right)}^{2}}\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}} \leq \infty:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \left(A + \left(A + \frac{{B}^{2} \cdot -0.5}{C}\right)\right)}}{\left(4 \cdot A\right) \cdot C - {B}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{2} \cdot \left(-{\left({B}^{-0.16666666666666666} \cdot {\left(\frac{-1}{F}\right)}^{-0.16666666666666666}\right)}^{3}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 54.1% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-{\left({B\_m}^{-0.16666666666666666} \cdot {\left(\frac{-1}{F}\right)}^{-0.16666666666666666}\right)}^{3}\right)\\


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

    1. Initial program 19.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 inf 17.4%

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

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

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

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

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

    if 4.0000000000000003e-18 < (pow.f64 B #s(literal 2 binary64)) < 2.0000000000000002e287

    1. Initial program 30.1%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 1.6%

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(\left(\sqrt[3]{-1} \cdot e^{0.16666666666666666 \cdot \left(\log \left(-1 \cdot F\right) + \log \left(\frac{1}{B}\right)\right)}\right) \cdot \sqrt[3]{\sqrt{2}}\right)}}^{3} \]
    7. Taylor expanded in F around -inf 35.3%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{-1}\right)}^{3} \cdot \left({\left(e^{0.16666666666666666 \cdot \left(\log \left(\frac{1}{B}\right) + -1 \cdot \log \left(\frac{-1}{F}\right)\right)}\right)}^{3} \cdot \sqrt{2}\right)} \]
    8. Step-by-step derivation
      1. rem-cube-cbrt35.3%

        \[\leadsto \color{blue}{-1} \cdot \left({\left(e^{0.16666666666666666 \cdot \left(\log \left(\frac{1}{B}\right) + -1 \cdot \log \left(\frac{-1}{F}\right)\right)}\right)}^{3} \cdot \sqrt{2}\right) \]
      2. mul-1-neg35.3%

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

        \[\leadsto \color{blue}{{\left(e^{0.16666666666666666 \cdot \left(\log \left(\frac{1}{B}\right) + -1 \cdot \log \left(\frac{-1}{F}\right)\right)}\right)}^{3} \cdot \left(-\sqrt{2}\right)} \]
    9. Simplified35.7%

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

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

Alternative 3: 51.5% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-{\left({B\_m}^{-0.16666666666666666} \cdot {\left(\frac{-1}{F}\right)}^{-0.16666666666666666}\right)}^{3}\right)\\


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

    1. Initial program 23.2%

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

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

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

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

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

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

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

    1. Initial program 26.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 3.0%

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(\left(\sqrt[3]{-1} \cdot e^{0.16666666666666666 \cdot \left(\log \left(-1 \cdot F\right) + \log \left(\frac{1}{B}\right)\right)}\right) \cdot \sqrt[3]{\sqrt{2}}\right)}}^{3} \]
    7. Taylor expanded in F around -inf 34.8%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{-1}\right)}^{3} \cdot \left({\left(e^{0.16666666666666666 \cdot \left(\log \left(\frac{1}{B}\right) + -1 \cdot \log \left(\frac{-1}{F}\right)\right)}\right)}^{3} \cdot \sqrt{2}\right)} \]
    8. Step-by-step derivation
      1. rem-cube-cbrt34.8%

        \[\leadsto \color{blue}{-1} \cdot \left({\left(e^{0.16666666666666666 \cdot \left(\log \left(\frac{1}{B}\right) + -1 \cdot \log \left(\frac{-1}{F}\right)\right)}\right)}^{3} \cdot \sqrt{2}\right) \]
      2. mul-1-neg34.8%

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

        \[\leadsto \color{blue}{{\left(e^{0.16666666666666666 \cdot \left(\log \left(\frac{1}{B}\right) + -1 \cdot \log \left(\frac{-1}{F}\right)\right)}\right)}^{3} \cdot \left(-\sqrt{2}\right)} \]
    9. Simplified35.2%

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

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

Alternative 4: 51.5% accurate, 1.0× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\sqrt{2} \cdot \left(-{\left({B\_m}^{-0.16666666666666666} \cdot {\left(\frac{-1}{F}\right)}^{-0.16666666666666666}\right)}^{3}\right)\\


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

    1. Initial program 23.2%

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

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

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

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

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

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

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

    1. Initial program 26.4%

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

      \[\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. associate-*r*10.6%

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

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

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

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

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

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

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

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

    1. Initial program 3.0%

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(\left(\sqrt[3]{-1} \cdot e^{0.16666666666666666 \cdot \left(\log \left(-1 \cdot F\right) + \log \left(\frac{1}{B}\right)\right)}\right) \cdot \sqrt[3]{\sqrt{2}}\right)}}^{3} \]
    7. Taylor expanded in F around -inf 34.8%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{-1}\right)}^{3} \cdot \left({\left(e^{0.16666666666666666 \cdot \left(\log \left(\frac{1}{B}\right) + -1 \cdot \log \left(\frac{-1}{F}\right)\right)}\right)}^{3} \cdot \sqrt{2}\right)} \]
    8. Step-by-step derivation
      1. rem-cube-cbrt34.8%

        \[\leadsto \color{blue}{-1} \cdot \left({\left(e^{0.16666666666666666 \cdot \left(\log \left(\frac{1}{B}\right) + -1 \cdot \log \left(\frac{-1}{F}\right)\right)}\right)}^{3} \cdot \sqrt{2}\right) \]
      2. mul-1-neg34.8%

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

        \[\leadsto \color{blue}{{\left(e^{0.16666666666666666 \cdot \left(\log \left(\frac{1}{B}\right) + -1 \cdot \log \left(\frac{-1}{F}\right)\right)}\right)}^{3} \cdot \left(-\sqrt{2}\right)} \]
    9. Simplified35.2%

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

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

Alternative 5: 46.6% accurate, 1.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 := \left(4 \cdot A\right) \cdot C\\ \mathbf{if}\;B\_m \leq 1050000000:\\ \;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(A + A\right)}}{t\_0 - {B\_m}^{2}}\\ \mathbf{elif}\;B\_m \leq 2.3 \cdot 10^{+254}:\\ \;\;\;\;\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)} \cdot \frac{\sqrt{2}}{-B\_m}\\ \mathbf{else}:\\ \;\;\;\;\left(-\sqrt{2}\right) \cdot {\left({\left(\frac{F}{-B\_m}\right)}^{0.16666666666666666}\right)}^{3}\\ \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 (* (* 4.0 A) C)))
   (if (<= B_m 1050000000.0)
     (/
      (sqrt (* (* 2.0 (* (- (pow B_m 2.0) t_0) F)) (+ A A)))
      (- t_0 (pow B_m 2.0)))
     (if (<= B_m 2.3e+254)
       (* (sqrt (* F (- A (hypot B_m A)))) (/ (sqrt 2.0) (- B_m)))
       (* (- (sqrt 2.0)) (pow (pow (/ F (- B_m)) 0.16666666666666666) 3.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) {
	double t_0 = (4.0 * A) * C;
	double tmp;
	if (B_m <= 1050000000.0) {
		tmp = sqrt(((2.0 * ((pow(B_m, 2.0) - t_0) * F)) * (A + A))) / (t_0 - pow(B_m, 2.0));
	} else if (B_m <= 2.3e+254) {
		tmp = sqrt((F * (A - hypot(B_m, A)))) * (sqrt(2.0) / -B_m);
	} else {
		tmp = -sqrt(2.0) * pow(pow((F / -B_m), 0.16666666666666666), 3.0);
	}
	return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double t_0 = (4.0 * A) * C;
	double tmp;
	if (B_m <= 1050000000.0) {
		tmp = Math.sqrt(((2.0 * ((Math.pow(B_m, 2.0) - t_0) * F)) * (A + A))) / (t_0 - Math.pow(B_m, 2.0));
	} else if (B_m <= 2.3e+254) {
		tmp = Math.sqrt((F * (A - Math.hypot(B_m, A)))) * (Math.sqrt(2.0) / -B_m);
	} else {
		tmp = -Math.sqrt(2.0) * Math.pow(Math.pow((F / -B_m), 0.16666666666666666), 3.0);
	}
	return tmp;
}
B_m = math.fabs(B)
[A, B_m, C, F] = sort([A, B_m, C, F])
def code(A, B_m, C, F):
	t_0 = (4.0 * A) * C
	tmp = 0
	if B_m <= 1050000000.0:
		tmp = math.sqrt(((2.0 * ((math.pow(B_m, 2.0) - t_0) * F)) * (A + A))) / (t_0 - math.pow(B_m, 2.0))
	elif B_m <= 2.3e+254:
		tmp = math.sqrt((F * (A - math.hypot(B_m, A)))) * (math.sqrt(2.0) / -B_m)
	else:
		tmp = -math.sqrt(2.0) * math.pow(math.pow((F / -B_m), 0.16666666666666666), 3.0)
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	t_0 = Float64(Float64(4.0 * A) * C)
	tmp = 0.0
	if (B_m <= 1050000000.0)
		tmp = Float64(sqrt(Float64(Float64(2.0 * Float64(Float64((B_m ^ 2.0) - t_0) * F)) * Float64(A + A))) / Float64(t_0 - (B_m ^ 2.0)));
	elseif (B_m <= 2.3e+254)
		tmp = Float64(sqrt(Float64(F * Float64(A - hypot(B_m, A)))) * Float64(sqrt(2.0) / Float64(-B_m)));
	else
		tmp = Float64(Float64(-sqrt(2.0)) * ((Float64(F / Float64(-B_m)) ^ 0.16666666666666666) ^ 3.0));
	end
	return tmp
end
B_m = abs(B);
A, B_m, C, F = num2cell(sort([A, B_m, C, F])){:}
function tmp_2 = code(A, B_m, C, F)
	t_0 = (4.0 * A) * C;
	tmp = 0.0;
	if (B_m <= 1050000000.0)
		tmp = sqrt(((2.0 * (((B_m ^ 2.0) - t_0) * F)) * (A + A))) / (t_0 - (B_m ^ 2.0));
	elseif (B_m <= 2.3e+254)
		tmp = sqrt((F * (A - hypot(B_m, A)))) * (sqrt(2.0) / -B_m);
	else
		tmp = -sqrt(2.0) * (((F / -B_m) ^ 0.16666666666666666) ^ 3.0);
	end
	tmp_2 = tmp;
end
B_m = N[Abs[B], $MachinePrecision]
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
code[A_, B$95$m_, C_, F_] := Block[{t$95$0 = N[(N[(4.0 * A), $MachinePrecision] * C), $MachinePrecision]}, If[LessEqual[B$95$m, 1050000000.0], N[(N[Sqrt[N[(N[(2.0 * N[(N[(N[Power[B$95$m, 2.0], $MachinePrecision] - t$95$0), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * N[(A + A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(t$95$0 - N[Power[B$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[B$95$m, 2.3e+254], N[(N[Sqrt[N[(F * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision], N[((-N[Sqrt[2.0], $MachinePrecision]) * N[Power[N[Power[N[(F / (-B$95$m)), $MachinePrecision], 0.16666666666666666], $MachinePrecision], 3.0], $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 := \left(4 \cdot A\right) \cdot C\\
\mathbf{if}\;B\_m \leq 1050000000:\\
\;\;\;\;\frac{\sqrt{\left(2 \cdot \left(\left({B\_m}^{2} - t\_0\right) \cdot F\right)\right) \cdot \left(A + A\right)}}{t\_0 - {B\_m}^{2}}\\

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

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


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

    1. Initial program 19.9%

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

      \[\leadsto \frac{-\sqrt{\left(2 \cdot \left(\left({B}^{2} - \left(4 \cdot A\right) \cdot C\right) \cdot F\right)\right) \cdot \color{blue}{\left(A - -1 \cdot A\right)}}}{{B}^{2} - \left(4 \cdot A\right) \cdot C} \]
    4. Step-by-step derivation
      1. sub-neg13.8%

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

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

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

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

    if 1.05e9 < B < 2.29999999999999998e254

    1. Initial program 15.1%

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

      \[\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. associate-*r*13.2%

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

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

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

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

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

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

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

    if 2.29999999999999998e254 < B

    1. Initial program 0.0%

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

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

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

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

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

      \[\leadsto {\color{blue}{\left(\left(\sqrt[3]{-1} \cdot e^{0.16666666666666666 \cdot \left(\log \left(-1 \cdot F\right) + \log \left(\frac{1}{B}\right)\right)}\right) \cdot \sqrt[3]{\sqrt{2}}\right)}}^{3} \]
    7. Taylor expanded in F around 0 0.0%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{-1}\right)}^{3} \cdot \left({\left(e^{0.16666666666666666 \cdot \left(\log -1 + \left(\log F + \log \left(\frac{1}{B}\right)\right)\right)}\right)}^{3} \cdot \sqrt{2}\right)} \]
    8. Simplified57.0%

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

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

Alternative 6: 37.5% accurate, 2.0× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ \begin{array}{l} \mathbf{if}\;F \leq -2.7 \cdot 10^{+57}:\\ \;\;\;\;\left(-\sqrt{2}\right) \cdot {\left({\left(F \cdot \frac{-1}{B\_m}\right)}^{0.16666666666666666}\right)}^{3}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{F \cdot \left(A - \mathsf{hypot}\left(B\_m, A\right)\right)} \cdot \frac{\sqrt{2}}{-B\_m}\\ \end{array} \end{array} \]
B_m = (fabs.f64 B)
NOTE: A, B_m, C, and F should be sorted in increasing order before calling this function.
(FPCore (A B_m C F)
 :precision binary64
 (if (<= F -2.7e+57)
   (* (- (sqrt 2.0)) (pow (pow (* F (/ -1.0 B_m)) 0.16666666666666666) 3.0))
   (* (sqrt (* F (- A (hypot B_m A)))) (/ (sqrt 2.0) (- B_m)))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -2.7e+57) {
		tmp = -sqrt(2.0) * pow(pow((F * (-1.0 / B_m)), 0.16666666666666666), 3.0);
	} else {
		tmp = sqrt((F * (A - hypot(B_m, A)))) * (sqrt(2.0) / -B_m);
	}
	return tmp;
}
B_m = Math.abs(B);
assert A < B_m && B_m < C && C < F;
public static double code(double A, double B_m, double C, double F) {
	double tmp;
	if (F <= -2.7e+57) {
		tmp = -Math.sqrt(2.0) * Math.pow(Math.pow((F * (-1.0 / B_m)), 0.16666666666666666), 3.0);
	} else {
		tmp = Math.sqrt((F * (A - Math.hypot(B_m, A)))) * (Math.sqrt(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 <= -2.7e+57:
		tmp = -math.sqrt(2.0) * math.pow(math.pow((F * (-1.0 / B_m)), 0.16666666666666666), 3.0)
	else:
		tmp = math.sqrt((F * (A - math.hypot(B_m, A)))) * (math.sqrt(2.0) / -B_m)
	return tmp
B_m = abs(B)
A, B_m, C, F = sort([A, B_m, C, F])
function code(A, B_m, C, F)
	tmp = 0.0
	if (F <= -2.7e+57)
		tmp = Float64(Float64(-sqrt(2.0)) * ((Float64(F * Float64(-1.0 / B_m)) ^ 0.16666666666666666) ^ 3.0));
	else
		tmp = Float64(sqrt(Float64(F * Float64(A - hypot(B_m, A)))) * Float64(sqrt(2.0) / Float64(-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 <= -2.7e+57)
		tmp = -sqrt(2.0) * (((F * (-1.0 / B_m)) ^ 0.16666666666666666) ^ 3.0);
	else
		tmp = sqrt((F * (A - hypot(B_m, A)))) * (sqrt(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, -2.7e+57], N[((-N[Sqrt[2.0], $MachinePrecision]) * N[Power[N[Power[N[(F * N[(-1.0 / B$95$m), $MachinePrecision]), $MachinePrecision], 0.16666666666666666], $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(F * N[(A - N[Sqrt[B$95$m ^ 2 + A ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] / (-B$95$m)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.7 \cdot 10^{+57}:\\
\;\;\;\;\left(-\sqrt{2}\right) \cdot {\left({\left(F \cdot \frac{-1}{B\_m}\right)}^{0.16666666666666666}\right)}^{3}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -2.6999999999999998e57

    1. Initial program 11.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. Simplified13.6%

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

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

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

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

      \[\leadsto {\color{blue}{\left(\left(\sqrt[3]{-1} \cdot e^{0.16666666666666666 \cdot \left(\log \left(-1 \cdot F\right) + \log \left(\frac{1}{B}\right)\right)}\right) \cdot \sqrt[3]{\sqrt{2}}\right)}}^{3} \]
    7. Taylor expanded in B around -inf 0.0%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{-1}\right)}^{3} \cdot \left({\left(e^{0.16666666666666666 \cdot \left(\log -1 + \left(\log \left(-1 \cdot F\right) + \log \left(\frac{-1}{B}\right)\right)\right)}\right)}^{3} \cdot \sqrt{2}\right)} \]
    8. Step-by-step derivation
      1. rem-cube-cbrt0.0%

        \[\leadsto \color{blue}{-1} \cdot \left({\left(e^{0.16666666666666666 \cdot \left(\log -1 + \left(\log \left(-1 \cdot F\right) + \log \left(\frac{-1}{B}\right)\right)\right)}\right)}^{3} \cdot \sqrt{2}\right) \]
      2. mul-1-neg0.0%

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

        \[\leadsto \color{blue}{{\left(e^{0.16666666666666666 \cdot \left(\log -1 + \left(\log \left(-1 \cdot F\right) + \log \left(\frac{-1}{B}\right)\right)\right)}\right)}^{3} \cdot \left(-\sqrt{2}\right)} \]
    9. Simplified17.8%

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

    if -2.6999999999999998e57 < F

    1. Initial program 21.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 9.1%

      \[\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. associate-*r*9.1%

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

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

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

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

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

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

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

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

Alternative 7: 37.5% accurate, 2.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < -2.55000000000000011e57

    1. Initial program 11.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. Simplified13.6%

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

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

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

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

      \[\leadsto {\color{blue}{\left(\left(\sqrt[3]{-1} \cdot e^{0.16666666666666666 \cdot \left(\log \left(-1 \cdot F\right) + \log \left(\frac{1}{B}\right)\right)}\right) \cdot \sqrt[3]{\sqrt{2}}\right)}}^{3} \]
    7. Taylor expanded in F around 0 0.0%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{-1}\right)}^{3} \cdot \left({\left(e^{0.16666666666666666 \cdot \left(\log -1 + \left(\log F + \log \left(\frac{1}{B}\right)\right)\right)}\right)}^{3} \cdot \sqrt{2}\right)} \]
    8. Simplified17.7%

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

    if -2.55000000000000011e57 < F

    1. Initial program 21.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 9.1%

      \[\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. associate-*r*9.1%

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

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

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

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

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

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

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

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

Alternative 8: 25.8% accurate, 2.1× speedup?

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

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

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

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

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

    \[\leadsto {\color{blue}{\left(\left(\sqrt[3]{-1} \cdot e^{0.16666666666666666 \cdot \left(\log \left(-1 \cdot F\right) + \log \left(\frac{1}{B}\right)\right)}\right) \cdot \sqrt[3]{\sqrt{2}}\right)}}^{3} \]
  7. Taylor expanded in F around 0 0.0%

    \[\leadsto \color{blue}{{\left(\sqrt[3]{-1}\right)}^{3} \cdot \left({\left(e^{0.16666666666666666 \cdot \left(\log -1 + \left(\log F + \log \left(\frac{1}{B}\right)\right)\right)}\right)}^{3} \cdot \sqrt{2}\right)} \]
  8. Simplified14.2%

    \[\leadsto \color{blue}{{\left({\left(\frac{-F}{B}\right)}^{0.16666666666666666}\right)}^{3} \cdot \left(-\sqrt{2}\right)} \]
  9. Final simplification14.2%

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

Alternative 9: 1.7% accurate, 5.7× speedup?

\[\begin{array}{l} B_m = \left|B\right| \\ [A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\ \\ -0.25 \cdot \left(\sqrt{\frac{F}{A}} \cdot \frac{B\_m \cdot -2}{C}\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.25 (* (sqrt (/ F A)) (/ (* B_m -2.0) C))))
B_m = fabs(B);
assert(A < B_m && B_m < C && C < F);
double code(double A, double B_m, double C, double F) {
	return -0.25 * (sqrt((F / A)) * ((B_m * -2.0) / C));
}
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.25d0) * (sqrt((f / a)) * ((b_m * (-2.0d0)) / c))
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.25 * (Math.sqrt((F / A)) * ((B_m * -2.0) / C));
}
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.25 * (math.sqrt((F / A)) * ((B_m * -2.0) / C))
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.25 * Float64(sqrt(Float64(F / A)) * Float64(Float64(B_m * -2.0) / C)))
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.25 * (sqrt((F / A)) * ((B_m * -2.0) / C));
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.25 * N[(N[Sqrt[N[(F / A), $MachinePrecision]], $MachinePrecision] * N[(N[(B$95$m * -2.0), $MachinePrecision] / C), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
B_m = \left|B\right|
\\
[A, B_m, C, F] = \mathsf{sort}([A, B_m, C, F])\\
\\
-0.25 \cdot \left(\sqrt{\frac{F}{A}} \cdot \frac{B\_m \cdot -2}{C}\right)
\end{array}
Derivation
  1. Initial program 17.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{-0.25 \cdot \left(\sqrt{\frac{F}{A}} \cdot \frac{B \cdot \left({\left(\sqrt{-1}\right)}^{2} \cdot {\left(\sqrt{2}\right)}^{2}\right)}{C}\right)} \]
  7. Step-by-step derivation
    1. unpow20.0%

      \[\leadsto -0.25 \cdot \left(\sqrt{\frac{F}{A}} \cdot \frac{B \cdot \left(\color{blue}{\left(\sqrt{-1} \cdot \sqrt{-1}\right)} \cdot {\left(\sqrt{2}\right)}^{2}\right)}{C}\right) \]
    2. rem-square-sqrt1.8%

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

      \[\leadsto -0.25 \cdot \left(\sqrt{\frac{F}{A}} \cdot \frac{B \cdot \left(-1 \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{2}\right)}\right)}{C}\right) \]
    4. rem-square-sqrt1.8%

      \[\leadsto -0.25 \cdot \left(\sqrt{\frac{F}{A}} \cdot \frac{B \cdot \left(-1 \cdot \color{blue}{2}\right)}{C}\right) \]
    5. metadata-eval1.8%

      \[\leadsto -0.25 \cdot \left(\sqrt{\frac{F}{A}} \cdot \frac{B \cdot \color{blue}{-2}}{C}\right) \]
  8. Simplified1.8%

    \[\leadsto \color{blue}{-0.25 \cdot \left(\sqrt{\frac{F}{A}} \cdot \frac{B \cdot -2}{C}\right)} \]
  9. Add Preprocessing

Reproduce

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