Henrywood and Agarwal, Equation (3)

Percentage Accurate: 73.5% → 91.8%
Time: 12.9s
Alternatives: 15
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \end{array} \]
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
	return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
	return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l):
	return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l)
	return Float64(c0 * sqrt(Float64(A / Float64(V * l))))
end
function tmp = code(c0, A, V, l)
	tmp = c0 * sqrt((A / (V * l)));
end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\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 15 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: 73.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \end{array} \]
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
	return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
	return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l):
	return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l)
	return Float64(c0 * sqrt(Float64(A / Float64(V * l))))
end
function tmp = code(c0, A, V, l)
	tmp = c0 * sqrt((A / (V * l)));
end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}

Alternative 1: 91.8% accurate, 0.3× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := c0\_m \cdot \sqrt{A}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-295}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+293}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{t\_0}{\ell} \cdot \frac{t\_0}{V}}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (* c0_m (sqrt A))))
   (*
    c0_s
    (if (<= (* V l) (- INFINITY))
      (* (/ c0_m (sqrt l)) (sqrt (/ A V)))
      (if (<= (* V l) -1e-295)
        (* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
        (if (<= (* V l) 5e-319)
          (* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
          (if (<= (* V l) 5e+293)
            (* c0_m (/ (sqrt A) (sqrt (* V l))))
            (sqrt (* (/ t_0 l) (/ t_0 V))))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = c0_m * sqrt(A);
	double tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = (c0_m / sqrt(l)) * sqrt((A / V));
	} else if ((V * l) <= -1e-295) {
		tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
	} else if ((V * l) <= 5e-319) {
		tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
	} else if ((V * l) <= 5e+293) {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = sqrt(((t_0 / l) * (t_0 / V)));
	}
	return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = c0_m * Math.sqrt(A);
	double tmp;
	if ((V * l) <= -Double.POSITIVE_INFINITY) {
		tmp = (c0_m / Math.sqrt(l)) * Math.sqrt((A / V));
	} else if ((V * l) <= -1e-295) {
		tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if ((V * l) <= 5e-319) {
		tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
	} else if ((V * l) <= 5e+293) {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = Math.sqrt(((t_0 / l) * (t_0 / V)));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = c0_m * math.sqrt(A)
	tmp = 0
	if (V * l) <= -math.inf:
		tmp = (c0_m / math.sqrt(l)) * math.sqrt((A / V))
	elif (V * l) <= -1e-295:
		tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l)))
	elif (V * l) <= 5e-319:
		tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V))
	elif (V * l) <= 5e+293:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = math.sqrt(((t_0 / l) * (t_0 / V)))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(c0_m * sqrt(A))
	tmp = 0.0
	if (Float64(V * l) <= Float64(-Inf))
		tmp = Float64(Float64(c0_m / sqrt(l)) * sqrt(Float64(A / V)));
	elseif (Float64(V * l) <= -1e-295)
		tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif (Float64(V * l) <= 5e-319)
		tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V))));
	elseif (Float64(V * l) <= 5e+293)
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = sqrt(Float64(Float64(t_0 / l) * Float64(t_0 / V)));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = c0_m * sqrt(A);
	tmp = 0.0;
	if ((V * l) <= -Inf)
		tmp = (c0_m / sqrt(l)) * sqrt((A / V));
	elseif ((V * l) <= -1e-295)
		tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
	elseif ((V * l) <= 5e-319)
		tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
	elseif ((V * l) <= 5e+293)
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	else
		tmp = sqrt(((t_0 / l) * (t_0 / V)));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-295], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-319], N[(c0$95$m * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+293], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(t$95$0 / l), $MachinePrecision] * N[(t$95$0 / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{A}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\

\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-295}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\

\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\

\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+293}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{t\_0}{\ell} \cdot \frac{t\_0}{V}}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 V l) < -inf.0

    1. Initial program 25.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt25.7%

        \[\leadsto \color{blue}{\sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}} \cdot \sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}}} \]
      2. sqrt-unprod25.7%

        \[\leadsto \color{blue}{\sqrt{\left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)}} \]
      3. *-commutative25.7%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)} \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)} \]
      4. *-commutative25.7%

        \[\leadsto \sqrt{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right) \cdot \color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)}} \]
      5. swap-sqr24.8%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot c0\right)}} \]
      6. add-sqr-sqrt24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{A}{V \cdot \ell}} \cdot \left(c0 \cdot c0\right)} \]
      7. pow224.8%

        \[\leadsto \sqrt{\frac{A}{V \cdot \ell} \cdot \color{blue}{{c0}^{2}}} \]
    4. Applied egg-rr24.8%

      \[\leadsto \color{blue}{\sqrt{\frac{A}{V \cdot \ell} \cdot {c0}^{2}}} \]
    5. Step-by-step derivation
      1. associate-/r*24.7%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}} \cdot {c0}^{2}} \]
    6. Simplified24.7%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell} \cdot {c0}^{2}}} \]
    7. Step-by-step derivation
      1. sqrt-prod31.4%

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell}} \cdot \sqrt{{c0}^{2}}} \]
      2. sqrt-undiv7.3%

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \cdot \sqrt{{c0}^{2}} \]
      3. sqrt-undiv31.4%

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell}}} \cdot \sqrt{{c0}^{2}} \]
      4. associate-/l/24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{A}{\ell \cdot V}}} \cdot \sqrt{{c0}^{2}} \]
      5. frac-2neg24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{-A}{-\ell \cdot V}}} \cdot \sqrt{{c0}^{2}} \]
      6. distribute-rgt-neg-out24.8%

        \[\leadsto \sqrt{\frac{-A}{\color{blue}{\ell \cdot \left(-V\right)}}} \cdot \sqrt{{c0}^{2}} \]
      7. sqrt-undiv24.8%

        \[\leadsto \color{blue}{\frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}} \cdot \sqrt{{c0}^{2}} \]
      8. sqrt-pow125.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot \color{blue}{{c0}^{\left(\frac{2}{2}\right)}} \]
      9. metadata-eval25.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot {c0}^{\color{blue}{1}} \]
      10. pow125.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot \color{blue}{c0} \]
      11. associate-*l/25.7%

        \[\leadsto \color{blue}{\frac{\sqrt{-A} \cdot c0}{\sqrt{\ell \cdot \left(-V\right)}}} \]
      12. *-commutative25.7%

        \[\leadsto \frac{\color{blue}{c0 \cdot \sqrt{-A}}}{\sqrt{\ell \cdot \left(-V\right)}} \]
      13. sqrt-prod21.2%

        \[\leadsto \frac{c0 \cdot \sqrt{-A}}{\color{blue}{\sqrt{\ell} \cdot \sqrt{-V}}} \]
      14. times-frac21.3%

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \frac{\sqrt{-A}}{\sqrt{-V}}} \]
      15. sqrt-div14.8%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\sqrt{\frac{-A}{-V}}} \]
      16. frac-2neg14.8%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\color{blue}{\frac{A}{V}}} \]
    8. Applied egg-rr14.8%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}} \]

    if -inf.0 < (*.f64 V l) < -1.00000000000000006e-295

    1. Initial program 89.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. frac-2neg89.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{-A}{-V \cdot \ell}}} \]
      2. sqrt-div99.4%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-A}}{\sqrt{-V \cdot \ell}}} \]
      3. distribute-rgt-neg-in99.4%

        \[\leadsto c0 \cdot \frac{\sqrt{-A}}{\sqrt{\color{blue}{V \cdot \left(-\ell\right)}}} \]
    4. Applied egg-rr99.4%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}} \]
    5. Step-by-step derivation
      1. distribute-rgt-neg-out99.4%

        \[\leadsto c0 \cdot \frac{\sqrt{-A}}{\sqrt{\color{blue}{-V \cdot \ell}}} \]
      2. *-commutative99.4%

        \[\leadsto c0 \cdot \frac{\sqrt{-A}}{\sqrt{-\color{blue}{\ell \cdot V}}} \]
      3. distribute-rgt-neg-in99.4%

        \[\leadsto c0 \cdot \frac{\sqrt{-A}}{\sqrt{\color{blue}{\ell \cdot \left(-V\right)}}} \]
    6. Simplified99.4%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}} \]

    if -1.00000000000000006e-295 < (*.f64 V l) < 4.9999937e-319

    1. Initial program 32.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num32.7%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}} \]
      2. associate-/r/30.9%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
      3. associate-/r*30.9%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell}} \cdot A} \]
    4. Applied egg-rr30.9%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell} \cdot A}} \]
    5. Step-by-step derivation
      1. associate-*l/59.5%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V} \cdot A}{\ell}}} \]
      2. associate-*r/59.4%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V} \cdot \frac{A}{\ell}}} \]
      3. associate-*l/59.5%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1 \cdot \frac{A}{\ell}}{V}}} \]
      4. *-un-lft-identity59.5%

        \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{A}{\ell}}}{V}} \]
    6. Applied egg-rr59.5%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{\ell}}{V}}} \]
    7. Step-by-step derivation
      1. frac-2neg59.5%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{-\frac{A}{\ell}}{-V}}} \]
      2. sqrt-div42.5%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-\frac{A}{\ell}}}{\sqrt{-V}}} \]
      3. distribute-neg-frac242.5%

        \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A}{-\ell}}}}{\sqrt{-V}} \]
    8. Applied egg-rr42.5%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}} \]

    if 4.9999937e-319 < (*.f64 V l) < 5.00000000000000033e293

    1. Initial program 87.5%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-div99.4%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
      2. div-inv99.4%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    4. Applied egg-rr99.4%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/99.4%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A} \cdot 1}{\sqrt{V \cdot \ell}}} \]
      2. *-rgt-identity99.4%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{A}}}{\sqrt{V \cdot \ell}} \]
    6. Simplified99.4%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]

    if 5.00000000000000033e293 < (*.f64 V l)

    1. Initial program 20.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt20.2%

        \[\leadsto \color{blue}{\sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}} \cdot \sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}}} \]
      2. sqrt-unprod20.2%

        \[\leadsto \color{blue}{\sqrt{\left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)}} \]
      3. *-commutative20.2%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)} \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)} \]
      4. *-commutative20.2%

        \[\leadsto \sqrt{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right) \cdot \color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)}} \]
      5. swap-sqr19.2%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot c0\right)}} \]
      6. add-sqr-sqrt19.2%

        \[\leadsto \sqrt{\color{blue}{\frac{A}{V \cdot \ell}} \cdot \left(c0 \cdot c0\right)} \]
      7. pow219.2%

        \[\leadsto \sqrt{\frac{A}{V \cdot \ell} \cdot \color{blue}{{c0}^{2}}} \]
    4. Applied egg-rr19.2%

      \[\leadsto \color{blue}{\sqrt{\frac{A}{V \cdot \ell} \cdot {c0}^{2}}} \]
    5. Step-by-step derivation
      1. associate-/r*19.1%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}} \cdot {c0}^{2}} \]
    6. Simplified19.1%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell} \cdot {c0}^{2}}} \]
    7. Step-by-step derivation
      1. *-commutative19.1%

        \[\leadsto \sqrt{\color{blue}{{c0}^{2} \cdot \frac{\frac{A}{V}}{\ell}}} \]
      2. associate-/l/19.2%

        \[\leadsto \sqrt{{c0}^{2} \cdot \color{blue}{\frac{A}{\ell \cdot V}}} \]
      3. associate-*r/18.9%

        \[\leadsto \sqrt{\color{blue}{\frac{{c0}^{2} \cdot A}{\ell \cdot V}}} \]
      4. *-commutative18.9%

        \[\leadsto \sqrt{\frac{{c0}^{2} \cdot A}{\color{blue}{V \cdot \ell}}} \]
    8. Applied egg-rr18.9%

      \[\leadsto \sqrt{\color{blue}{\frac{{c0}^{2} \cdot A}{V \cdot \ell}}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt18.9%

        \[\leadsto \sqrt{\frac{\color{blue}{\sqrt{{c0}^{2} \cdot A} \cdot \sqrt{{c0}^{2} \cdot A}}}{V \cdot \ell}} \]
      2. *-commutative18.9%

        \[\leadsto \sqrt{\frac{\sqrt{{c0}^{2} \cdot A} \cdot \sqrt{{c0}^{2} \cdot A}}{\color{blue}{\ell \cdot V}}} \]
      3. times-frac25.9%

        \[\leadsto \sqrt{\color{blue}{\frac{\sqrt{{c0}^{2} \cdot A}}{\ell} \cdot \frac{\sqrt{{c0}^{2} \cdot A}}{V}}} \]
      4. sqrt-prod25.9%

        \[\leadsto \sqrt{\frac{\color{blue}{\sqrt{{c0}^{2}} \cdot \sqrt{A}}}{\ell} \cdot \frac{\sqrt{{c0}^{2} \cdot A}}{V}} \]
      5. sqrt-pow125.5%

        \[\leadsto \sqrt{\frac{\color{blue}{{c0}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{A}}{\ell} \cdot \frac{\sqrt{{c0}^{2} \cdot A}}{V}} \]
      6. metadata-eval25.5%

        \[\leadsto \sqrt{\frac{{c0}^{\color{blue}{1}} \cdot \sqrt{A}}{\ell} \cdot \frac{\sqrt{{c0}^{2} \cdot A}}{V}} \]
      7. pow125.5%

        \[\leadsto \sqrt{\frac{\color{blue}{c0} \cdot \sqrt{A}}{\ell} \cdot \frac{\sqrt{{c0}^{2} \cdot A}}{V}} \]
      8. sqrt-prod31.7%

        \[\leadsto \sqrt{\frac{c0 \cdot \sqrt{A}}{\ell} \cdot \frac{\color{blue}{\sqrt{{c0}^{2}} \cdot \sqrt{A}}}{V}} \]
      9. sqrt-pow145.3%

        \[\leadsto \sqrt{\frac{c0 \cdot \sqrt{A}}{\ell} \cdot \frac{\color{blue}{{c0}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{A}}{V}} \]
      10. metadata-eval45.3%

        \[\leadsto \sqrt{\frac{c0 \cdot \sqrt{A}}{\ell} \cdot \frac{{c0}^{\color{blue}{1}} \cdot \sqrt{A}}{V}} \]
      11. pow145.3%

        \[\leadsto \sqrt{\frac{c0 \cdot \sqrt{A}}{\ell} \cdot \frac{\color{blue}{c0} \cdot \sqrt{A}}{V}} \]
    10. Applied egg-rr45.3%

      \[\leadsto \sqrt{\color{blue}{\frac{c0 \cdot \sqrt{A}}{\ell} \cdot \frac{c0 \cdot \sqrt{A}}{V}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification84.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-295}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+293}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{c0 \cdot \sqrt{A}}{\ell} \cdot \frac{c0 \cdot \sqrt{A}}{V}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 88.8% accurate, 0.3× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-295}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\ \mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+234}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{\ell} \cdot \sqrt{V}}\\ \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (*
  c0_s
  (if (<= (* V l) (- INFINITY))
    (* (/ c0_m (sqrt l)) (sqrt (/ A V)))
    (if (<= (* V l) -1e-295)
      (* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
      (if (<= (* V l) 5e-319)
        (* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
        (if (<= (* V l) 2e+234)
          (* c0_m (/ (sqrt A) (sqrt (* V l))))
          (* c0_m (/ (sqrt A) (* (sqrt l) (sqrt V))))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = (c0_m / sqrt(l)) * sqrt((A / V));
	} else if ((V * l) <= -1e-295) {
		tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
	} else if ((V * l) <= 5e-319) {
		tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
	} else if ((V * l) <= 2e+234) {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = c0_m * (sqrt(A) / (sqrt(l) * sqrt(V)));
	}
	return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -Double.POSITIVE_INFINITY) {
		tmp = (c0_m / Math.sqrt(l)) * Math.sqrt((A / V));
	} else if ((V * l) <= -1e-295) {
		tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if ((V * l) <= 5e-319) {
		tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
	} else if ((V * l) <= 2e+234) {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = c0_m * (Math.sqrt(A) / (Math.sqrt(l) * Math.sqrt(V)));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	tmp = 0
	if (V * l) <= -math.inf:
		tmp = (c0_m / math.sqrt(l)) * math.sqrt((A / V))
	elif (V * l) <= -1e-295:
		tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l)))
	elif (V * l) <= 5e-319:
		tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V))
	elif (V * l) <= 2e+234:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = c0_m * (math.sqrt(A) / (math.sqrt(l) * math.sqrt(V)))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= Float64(-Inf))
		tmp = Float64(Float64(c0_m / sqrt(l)) * sqrt(Float64(A / V)));
	elseif (Float64(V * l) <= -1e-295)
		tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif (Float64(V * l) <= 5e-319)
		tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V))));
	elseif (Float64(V * l) <= 2e+234)
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0_m * Float64(sqrt(A) / Float64(sqrt(l) * sqrt(V))));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -Inf)
		tmp = (c0_m / sqrt(l)) * sqrt((A / V));
	elseif ((V * l) <= -1e-295)
		tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
	elseif ((V * l) <= 5e-319)
		tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
	elseif ((V * l) <= 2e+234)
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	else
		tmp = c0_m * (sqrt(A) / (sqrt(l) * sqrt(V)));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-295], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-319], N[(c0$95$m * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+234], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[V], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\

\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-295}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\

\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\

\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+234}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{\ell} \cdot \sqrt{V}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 V l) < -inf.0

    1. Initial program 25.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt25.7%

        \[\leadsto \color{blue}{\sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}} \cdot \sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}}} \]
      2. sqrt-unprod25.7%

        \[\leadsto \color{blue}{\sqrt{\left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)}} \]
      3. *-commutative25.7%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)} \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)} \]
      4. *-commutative25.7%

        \[\leadsto \sqrt{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right) \cdot \color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)}} \]
      5. swap-sqr24.8%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot c0\right)}} \]
      6. add-sqr-sqrt24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{A}{V \cdot \ell}} \cdot \left(c0 \cdot c0\right)} \]
      7. pow224.8%

        \[\leadsto \sqrt{\frac{A}{V \cdot \ell} \cdot \color{blue}{{c0}^{2}}} \]
    4. Applied egg-rr24.8%

      \[\leadsto \color{blue}{\sqrt{\frac{A}{V \cdot \ell} \cdot {c0}^{2}}} \]
    5. Step-by-step derivation
      1. associate-/r*24.7%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}} \cdot {c0}^{2}} \]
    6. Simplified24.7%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell} \cdot {c0}^{2}}} \]
    7. Step-by-step derivation
      1. sqrt-prod31.4%

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell}} \cdot \sqrt{{c0}^{2}}} \]
      2. sqrt-undiv7.3%

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \cdot \sqrt{{c0}^{2}} \]
      3. sqrt-undiv31.4%

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell}}} \cdot \sqrt{{c0}^{2}} \]
      4. associate-/l/24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{A}{\ell \cdot V}}} \cdot \sqrt{{c0}^{2}} \]
      5. frac-2neg24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{-A}{-\ell \cdot V}}} \cdot \sqrt{{c0}^{2}} \]
      6. distribute-rgt-neg-out24.8%

        \[\leadsto \sqrt{\frac{-A}{\color{blue}{\ell \cdot \left(-V\right)}}} \cdot \sqrt{{c0}^{2}} \]
      7. sqrt-undiv24.8%

        \[\leadsto \color{blue}{\frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}} \cdot \sqrt{{c0}^{2}} \]
      8. sqrt-pow125.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot \color{blue}{{c0}^{\left(\frac{2}{2}\right)}} \]
      9. metadata-eval25.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot {c0}^{\color{blue}{1}} \]
      10. pow125.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot \color{blue}{c0} \]
      11. associate-*l/25.7%

        \[\leadsto \color{blue}{\frac{\sqrt{-A} \cdot c0}{\sqrt{\ell \cdot \left(-V\right)}}} \]
      12. *-commutative25.7%

        \[\leadsto \frac{\color{blue}{c0 \cdot \sqrt{-A}}}{\sqrt{\ell \cdot \left(-V\right)}} \]
      13. sqrt-prod21.2%

        \[\leadsto \frac{c0 \cdot \sqrt{-A}}{\color{blue}{\sqrt{\ell} \cdot \sqrt{-V}}} \]
      14. times-frac21.3%

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \frac{\sqrt{-A}}{\sqrt{-V}}} \]
      15. sqrt-div14.8%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\sqrt{\frac{-A}{-V}}} \]
      16. frac-2neg14.8%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\color{blue}{\frac{A}{V}}} \]
    8. Applied egg-rr14.8%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}} \]

    if -inf.0 < (*.f64 V l) < -1.00000000000000006e-295

    1. Initial program 89.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. frac-2neg89.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{-A}{-V \cdot \ell}}} \]
      2. sqrt-div99.4%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-A}}{\sqrt{-V \cdot \ell}}} \]
      3. distribute-rgt-neg-in99.4%

        \[\leadsto c0 \cdot \frac{\sqrt{-A}}{\sqrt{\color{blue}{V \cdot \left(-\ell\right)}}} \]
    4. Applied egg-rr99.4%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}} \]
    5. Step-by-step derivation
      1. distribute-rgt-neg-out99.4%

        \[\leadsto c0 \cdot \frac{\sqrt{-A}}{\sqrt{\color{blue}{-V \cdot \ell}}} \]
      2. *-commutative99.4%

        \[\leadsto c0 \cdot \frac{\sqrt{-A}}{\sqrt{-\color{blue}{\ell \cdot V}}} \]
      3. distribute-rgt-neg-in99.4%

        \[\leadsto c0 \cdot \frac{\sqrt{-A}}{\sqrt{\color{blue}{\ell \cdot \left(-V\right)}}} \]
    6. Simplified99.4%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}} \]

    if -1.00000000000000006e-295 < (*.f64 V l) < 4.9999937e-319

    1. Initial program 32.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num32.7%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}} \]
      2. associate-/r/30.9%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
      3. associate-/r*30.9%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell}} \cdot A} \]
    4. Applied egg-rr30.9%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell} \cdot A}} \]
    5. Step-by-step derivation
      1. associate-*l/59.5%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V} \cdot A}{\ell}}} \]
      2. associate-*r/59.4%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V} \cdot \frac{A}{\ell}}} \]
      3. associate-*l/59.5%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1 \cdot \frac{A}{\ell}}{V}}} \]
      4. *-un-lft-identity59.5%

        \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{A}{\ell}}}{V}} \]
    6. Applied egg-rr59.5%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{\ell}}{V}}} \]
    7. Step-by-step derivation
      1. frac-2neg59.5%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{-\frac{A}{\ell}}{-V}}} \]
      2. sqrt-div42.5%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-\frac{A}{\ell}}}{\sqrt{-V}}} \]
      3. distribute-neg-frac242.5%

        \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A}{-\ell}}}}{\sqrt{-V}} \]
    8. Applied egg-rr42.5%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}} \]

    if 4.9999937e-319 < (*.f64 V l) < 2.00000000000000004e234

    1. Initial program 88.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-div99.4%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
      2. div-inv99.4%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    4. Applied egg-rr99.4%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/99.4%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A} \cdot 1}{\sqrt{V \cdot \ell}}} \]
      2. *-rgt-identity99.4%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{A}}}{\sqrt{V \cdot \ell}} \]
    6. Simplified99.4%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]

    if 2.00000000000000004e234 < (*.f64 V l)

    1. Initial program 23.8%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num23.8%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}} \]
      2. associate-/r/23.8%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
      3. associate-/r*27.1%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell}} \cdot A} \]
    4. Applied egg-rr27.1%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell} \cdot A}} \]
    5. Step-by-step derivation
      1. *-commutative27.1%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{A \cdot \frac{\frac{1}{V}}{\ell}}} \]
      2. associate-/l/23.8%

        \[\leadsto c0 \cdot \sqrt{A \cdot \color{blue}{\frac{1}{\ell \cdot V}}} \]
      3. div-inv23.8%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{\ell \cdot V}}} \]
      4. frac-2neg23.8%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{-A}{-\ell \cdot V}}} \]
      5. distribute-rgt-neg-out23.8%

        \[\leadsto c0 \cdot \sqrt{\frac{-A}{\color{blue}{\ell \cdot \left(-V\right)}}} \]
      6. sqrt-undiv0.0%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}} \]
      7. associate-*r/0.0%

        \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}} \]
      8. sqrt-prod0.0%

        \[\leadsto \frac{c0 \cdot \sqrt{-A}}{\color{blue}{\sqrt{\ell} \cdot \sqrt{-V}}} \]
      9. associate-/r*0.0%

        \[\leadsto \color{blue}{\frac{\frac{c0 \cdot \sqrt{-A}}{\sqrt{\ell}}}{\sqrt{-V}}} \]
      10. add-sqr-sqrt0.0%

        \[\leadsto \frac{\frac{c0 \cdot \sqrt{\color{blue}{\sqrt{-A} \cdot \sqrt{-A}}}}{\sqrt{\ell}}}{\sqrt{-V}} \]
      11. sqrt-unprod0.0%

        \[\leadsto \frac{\frac{c0 \cdot \sqrt{\color{blue}{\sqrt{\left(-A\right) \cdot \left(-A\right)}}}}{\sqrt{\ell}}}{\sqrt{-V}} \]
      12. sqr-neg0.0%

        \[\leadsto \frac{\frac{c0 \cdot \sqrt{\sqrt{\color{blue}{A \cdot A}}}}{\sqrt{\ell}}}{\sqrt{-V}} \]
      13. sqrt-unprod0.0%

        \[\leadsto \frac{\frac{c0 \cdot \sqrt{\color{blue}{\sqrt{A} \cdot \sqrt{A}}}}{\sqrt{\ell}}}{\sqrt{-V}} \]
      14. add-sqr-sqrt0.0%

        \[\leadsto \frac{\frac{c0 \cdot \sqrt{\color{blue}{A}}}{\sqrt{\ell}}}{\sqrt{-V}} \]
      15. add-sqr-sqrt0.0%

        \[\leadsto \frac{\frac{c0 \cdot \sqrt{A}}{\sqrt{\ell}}}{\sqrt{\color{blue}{\sqrt{-V} \cdot \sqrt{-V}}}} \]
      16. sqrt-unprod19.8%

        \[\leadsto \frac{\frac{c0 \cdot \sqrt{A}}{\sqrt{\ell}}}{\sqrt{\color{blue}{\sqrt{\left(-V\right) \cdot \left(-V\right)}}}} \]
      17. sqr-neg19.8%

        \[\leadsto \frac{\frac{c0 \cdot \sqrt{A}}{\sqrt{\ell}}}{\sqrt{\sqrt{\color{blue}{V \cdot V}}}} \]
      18. sqrt-unprod58.3%

        \[\leadsto \frac{\frac{c0 \cdot \sqrt{A}}{\sqrt{\ell}}}{\sqrt{\color{blue}{\sqrt{V} \cdot \sqrt{V}}}} \]
      19. add-sqr-sqrt58.3%

        \[\leadsto \frac{\frac{c0 \cdot \sqrt{A}}{\sqrt{\ell}}}{\sqrt{\color{blue}{V}}} \]
    6. Applied egg-rr58.3%

      \[\leadsto \color{blue}{\frac{\frac{c0 \cdot \sqrt{A}}{\sqrt{\ell}}}{\sqrt{V}}} \]
    7. Step-by-step derivation
      1. associate-/l/58.5%

        \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{A}}{\sqrt{V} \cdot \sqrt{\ell}}} \]
      2. associate-/l*58.6%

        \[\leadsto \color{blue}{c0 \cdot \frac{\sqrt{A}}{\sqrt{V} \cdot \sqrt{\ell}}} \]
      3. *-commutative58.6%

        \[\leadsto c0 \cdot \frac{\sqrt{A}}{\color{blue}{\sqrt{\ell} \cdot \sqrt{V}}} \]
    8. Simplified58.6%

      \[\leadsto \color{blue}{c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell} \cdot \sqrt{V}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification84.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-295}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\ \mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+234}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell} \cdot \sqrt{V}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 92.4% accurate, 0.3× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := \sqrt{-V}\\ t_1 := c0\_m \cdot \sqrt{A}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{-295}:\\ \;\;\;\;c0\_m \cdot \frac{\frac{1}{\frac{t\_0}{\sqrt{-A}}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{t\_0}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+293}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{t\_1}{\ell} \cdot \frac{t\_1}{V}}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (sqrt (- V))) (t_1 (* c0_m (sqrt A))))
   (*
    c0_s
    (if (<= (* V l) -1e-295)
      (* c0_m (/ (/ 1.0 (/ t_0 (sqrt (- A)))) (sqrt l)))
      (if (<= (* V l) 5e-319)
        (* c0_m (/ (sqrt (/ A (- l))) t_0))
        (if (<= (* V l) 5e+293)
          (* c0_m (/ (sqrt A) (sqrt (* V l))))
          (sqrt (* (/ t_1 l) (/ t_1 V)))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = sqrt(-V);
	double t_1 = c0_m * sqrt(A);
	double tmp;
	if ((V * l) <= -1e-295) {
		tmp = c0_m * ((1.0 / (t_0 / sqrt(-A))) / sqrt(l));
	} else if ((V * l) <= 5e-319) {
		tmp = c0_m * (sqrt((A / -l)) / t_0);
	} else if ((V * l) <= 5e+293) {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = sqrt(((t_1 / l) * (t_1 / V)));
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = sqrt(-v)
    t_1 = c0_m * sqrt(a)
    if ((v * l) <= (-1d-295)) then
        tmp = c0_m * ((1.0d0 / (t_0 / sqrt(-a))) / sqrt(l))
    else if ((v * l) <= 5d-319) then
        tmp = c0_m * (sqrt((a / -l)) / t_0)
    else if ((v * l) <= 5d+293) then
        tmp = c0_m * (sqrt(a) / sqrt((v * l)))
    else
        tmp = sqrt(((t_1 / l) * (t_1 / v)))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = Math.sqrt(-V);
	double t_1 = c0_m * Math.sqrt(A);
	double tmp;
	if ((V * l) <= -1e-295) {
		tmp = c0_m * ((1.0 / (t_0 / Math.sqrt(-A))) / Math.sqrt(l));
	} else if ((V * l) <= 5e-319) {
		tmp = c0_m * (Math.sqrt((A / -l)) / t_0);
	} else if ((V * l) <= 5e+293) {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = Math.sqrt(((t_1 / l) * (t_1 / V)));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = math.sqrt(-V)
	t_1 = c0_m * math.sqrt(A)
	tmp = 0
	if (V * l) <= -1e-295:
		tmp = c0_m * ((1.0 / (t_0 / math.sqrt(-A))) / math.sqrt(l))
	elif (V * l) <= 5e-319:
		tmp = c0_m * (math.sqrt((A / -l)) / t_0)
	elif (V * l) <= 5e+293:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = math.sqrt(((t_1 / l) * (t_1 / V)))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = sqrt(Float64(-V))
	t_1 = Float64(c0_m * sqrt(A))
	tmp = 0.0
	if (Float64(V * l) <= -1e-295)
		tmp = Float64(c0_m * Float64(Float64(1.0 / Float64(t_0 / sqrt(Float64(-A)))) / sqrt(l)));
	elseif (Float64(V * l) <= 5e-319)
		tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / t_0));
	elseif (Float64(V * l) <= 5e+293)
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = sqrt(Float64(Float64(t_1 / l) * Float64(t_1 / V)));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = sqrt(-V);
	t_1 = c0_m * sqrt(A);
	tmp = 0.0;
	if ((V * l) <= -1e-295)
		tmp = c0_m * ((1.0 / (t_0 / sqrt(-A))) / sqrt(l));
	elseif ((V * l) <= 5e-319)
		tmp = c0_m * (sqrt((A / -l)) / t_0);
	elseif ((V * l) <= 5e+293)
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	else
		tmp = sqrt(((t_1 / l) * (t_1 / V)));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[(-V)], $MachinePrecision]}, Block[{t$95$1 = N[(c0$95$m * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -1e-295], N[(c0$95$m * N[(N[(1.0 / N[(t$95$0 / N[Sqrt[(-A)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-319], N[(c0$95$m * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+293], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(t$95$1 / l), $MachinePrecision] * N[(t$95$1 / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]), $MachinePrecision]]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{-V}\\
t_1 := c0\_m \cdot \sqrt{A}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{-295}:\\
\;\;\;\;c0\_m \cdot \frac{\frac{1}{\frac{t\_0}{\sqrt{-A}}}}{\sqrt{\ell}}\\

\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{t\_0}\\

\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+293}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{t\_1}{\ell} \cdot \frac{t\_1}{V}}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 V l) < -1.00000000000000006e-295

    1. Initial program 81.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r*74.9%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
      2. sqrt-div35.1%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \]
      3. div-inv35.1%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right)} \]
    4. Applied egg-rr35.1%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/35.1%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}} \cdot 1}{\sqrt{\ell}}} \]
      2. *-rgt-identity35.1%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{\frac{A}{V}}}}{\sqrt{\ell}} \]
    6. Simplified35.1%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \]
    7. Step-by-step derivation
      1. clear-num35.2%

        \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{1}{\frac{V}{A}}}}}{\sqrt{\ell}} \]
      2. sqrt-div35.2%

        \[\leadsto c0 \cdot \frac{\color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{V}{A}}}}}{\sqrt{\ell}} \]
      3. metadata-eval35.2%

        \[\leadsto c0 \cdot \frac{\frac{\color{blue}{1}}{\sqrt{\frac{V}{A}}}}{\sqrt{\ell}} \]
    8. Applied egg-rr35.2%

      \[\leadsto c0 \cdot \frac{\color{blue}{\frac{1}{\sqrt{\frac{V}{A}}}}}{\sqrt{\ell}} \]
    9. Step-by-step derivation
      1. frac-2neg35.2%

        \[\leadsto c0 \cdot \frac{\frac{1}{\sqrt{\color{blue}{\frac{-V}{-A}}}}}{\sqrt{\ell}} \]
      2. sqrt-div41.2%

        \[\leadsto c0 \cdot \frac{\frac{1}{\color{blue}{\frac{\sqrt{-V}}{\sqrt{-A}}}}}{\sqrt{\ell}} \]
    10. Applied egg-rr41.2%

      \[\leadsto c0 \cdot \frac{\frac{1}{\color{blue}{\frac{\sqrt{-V}}{\sqrt{-A}}}}}{\sqrt{\ell}} \]

    if -1.00000000000000006e-295 < (*.f64 V l) < 4.9999937e-319

    1. Initial program 32.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num32.7%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}} \]
      2. associate-/r/30.9%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
      3. associate-/r*30.9%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell}} \cdot A} \]
    4. Applied egg-rr30.9%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell} \cdot A}} \]
    5. Step-by-step derivation
      1. associate-*l/59.5%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V} \cdot A}{\ell}}} \]
      2. associate-*r/59.4%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V} \cdot \frac{A}{\ell}}} \]
      3. associate-*l/59.5%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1 \cdot \frac{A}{\ell}}{V}}} \]
      4. *-un-lft-identity59.5%

        \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{A}{\ell}}}{V}} \]
    6. Applied egg-rr59.5%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{\ell}}{V}}} \]
    7. Step-by-step derivation
      1. frac-2neg59.5%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{-\frac{A}{\ell}}{-V}}} \]
      2. sqrt-div42.5%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-\frac{A}{\ell}}}{\sqrt{-V}}} \]
      3. distribute-neg-frac242.5%

        \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A}{-\ell}}}}{\sqrt{-V}} \]
    8. Applied egg-rr42.5%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}} \]

    if 4.9999937e-319 < (*.f64 V l) < 5.00000000000000033e293

    1. Initial program 87.5%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-div99.4%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
      2. div-inv99.4%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    4. Applied egg-rr99.4%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/99.4%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A} \cdot 1}{\sqrt{V \cdot \ell}}} \]
      2. *-rgt-identity99.4%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{A}}}{\sqrt{V \cdot \ell}} \]
    6. Simplified99.4%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]

    if 5.00000000000000033e293 < (*.f64 V l)

    1. Initial program 20.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt20.2%

        \[\leadsto \color{blue}{\sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}} \cdot \sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}}} \]
      2. sqrt-unprod20.2%

        \[\leadsto \color{blue}{\sqrt{\left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)}} \]
      3. *-commutative20.2%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)} \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)} \]
      4. *-commutative20.2%

        \[\leadsto \sqrt{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right) \cdot \color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)}} \]
      5. swap-sqr19.2%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot c0\right)}} \]
      6. add-sqr-sqrt19.2%

        \[\leadsto \sqrt{\color{blue}{\frac{A}{V \cdot \ell}} \cdot \left(c0 \cdot c0\right)} \]
      7. pow219.2%

        \[\leadsto \sqrt{\frac{A}{V \cdot \ell} \cdot \color{blue}{{c0}^{2}}} \]
    4. Applied egg-rr19.2%

      \[\leadsto \color{blue}{\sqrt{\frac{A}{V \cdot \ell} \cdot {c0}^{2}}} \]
    5. Step-by-step derivation
      1. associate-/r*19.1%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}} \cdot {c0}^{2}} \]
    6. Simplified19.1%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell} \cdot {c0}^{2}}} \]
    7. Step-by-step derivation
      1. *-commutative19.1%

        \[\leadsto \sqrt{\color{blue}{{c0}^{2} \cdot \frac{\frac{A}{V}}{\ell}}} \]
      2. associate-/l/19.2%

        \[\leadsto \sqrt{{c0}^{2} \cdot \color{blue}{\frac{A}{\ell \cdot V}}} \]
      3. associate-*r/18.9%

        \[\leadsto \sqrt{\color{blue}{\frac{{c0}^{2} \cdot A}{\ell \cdot V}}} \]
      4. *-commutative18.9%

        \[\leadsto \sqrt{\frac{{c0}^{2} \cdot A}{\color{blue}{V \cdot \ell}}} \]
    8. Applied egg-rr18.9%

      \[\leadsto \sqrt{\color{blue}{\frac{{c0}^{2} \cdot A}{V \cdot \ell}}} \]
    9. Step-by-step derivation
      1. add-sqr-sqrt18.9%

        \[\leadsto \sqrt{\frac{\color{blue}{\sqrt{{c0}^{2} \cdot A} \cdot \sqrt{{c0}^{2} \cdot A}}}{V \cdot \ell}} \]
      2. *-commutative18.9%

        \[\leadsto \sqrt{\frac{\sqrt{{c0}^{2} \cdot A} \cdot \sqrt{{c0}^{2} \cdot A}}{\color{blue}{\ell \cdot V}}} \]
      3. times-frac25.9%

        \[\leadsto \sqrt{\color{blue}{\frac{\sqrt{{c0}^{2} \cdot A}}{\ell} \cdot \frac{\sqrt{{c0}^{2} \cdot A}}{V}}} \]
      4. sqrt-prod25.9%

        \[\leadsto \sqrt{\frac{\color{blue}{\sqrt{{c0}^{2}} \cdot \sqrt{A}}}{\ell} \cdot \frac{\sqrt{{c0}^{2} \cdot A}}{V}} \]
      5. sqrt-pow125.5%

        \[\leadsto \sqrt{\frac{\color{blue}{{c0}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{A}}{\ell} \cdot \frac{\sqrt{{c0}^{2} \cdot A}}{V}} \]
      6. metadata-eval25.5%

        \[\leadsto \sqrt{\frac{{c0}^{\color{blue}{1}} \cdot \sqrt{A}}{\ell} \cdot \frac{\sqrt{{c0}^{2} \cdot A}}{V}} \]
      7. pow125.5%

        \[\leadsto \sqrt{\frac{\color{blue}{c0} \cdot \sqrt{A}}{\ell} \cdot \frac{\sqrt{{c0}^{2} \cdot A}}{V}} \]
      8. sqrt-prod31.7%

        \[\leadsto \sqrt{\frac{c0 \cdot \sqrt{A}}{\ell} \cdot \frac{\color{blue}{\sqrt{{c0}^{2}} \cdot \sqrt{A}}}{V}} \]
      9. sqrt-pow145.3%

        \[\leadsto \sqrt{\frac{c0 \cdot \sqrt{A}}{\ell} \cdot \frac{\color{blue}{{c0}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{A}}{V}} \]
      10. metadata-eval45.3%

        \[\leadsto \sqrt{\frac{c0 \cdot \sqrt{A}}{\ell} \cdot \frac{{c0}^{\color{blue}{1}} \cdot \sqrt{A}}{V}} \]
      11. pow145.3%

        \[\leadsto \sqrt{\frac{c0 \cdot \sqrt{A}}{\ell} \cdot \frac{\color{blue}{c0} \cdot \sqrt{A}}{V}} \]
    10. Applied egg-rr45.3%

      \[\leadsto \sqrt{\color{blue}{\frac{c0 \cdot \sqrt{A}}{\ell} \cdot \frac{c0 \cdot \sqrt{A}}{V}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification63.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{-295}:\\ \;\;\;\;c0 \cdot \frac{\frac{1}{\frac{\sqrt{-V}}{\sqrt{-A}}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+293}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{c0 \cdot \sqrt{A}}{\ell} \cdot \frac{c0 \cdot \sqrt{A}}{V}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 80.7% accurate, 0.3× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+274}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
   (*
    c0_s
    (if (<= t_0 0.0)
      (* c0_m (sqrt (/ (/ A V) l)))
      (if (<= t_0 5e+274) t_0 (/ c0_m (sqrt (* V (/ l A)))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = c0_m * sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0_m * sqrt(((A / V) / l));
	} else if (t_0 <= 5e+274) {
		tmp = t_0;
	} else {
		tmp = c0_m / sqrt((V * (l / A)));
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = c0_m * sqrt((a / (v * l)))
    if (t_0 <= 0.0d0) then
        tmp = c0_m * sqrt(((a / v) / l))
    else if (t_0 <= 5d+274) then
        tmp = t_0
    else
        tmp = c0_m / sqrt((v * (l / a)))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = c0_m * Math.sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0_m * Math.sqrt(((A / V) / l));
	} else if (t_0 <= 5e+274) {
		tmp = t_0;
	} else {
		tmp = c0_m / Math.sqrt((V * (l / A)));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = c0_m * math.sqrt((A / (V * l)))
	tmp = 0
	if t_0 <= 0.0:
		tmp = c0_m * math.sqrt(((A / V) / l))
	elif t_0 <= 5e+274:
		tmp = t_0
	else:
		tmp = c0_m / math.sqrt((V * (l / A)))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l)));
	elseif (t_0 <= 5e+274)
		tmp = t_0;
	else
		tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A))));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = c0_m * sqrt((A / (V * l)));
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = c0_m * sqrt(((A / V) / l));
	elseif (t_0 <= 5e+274)
		tmp = t_0;
	else
		tmp = c0_m / sqrt((V * (l / A)));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+274], t$95$0, N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+274}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0

    1. Initial program 70.8%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. associate-/r*72.4%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
    3. Simplified72.4%

      \[\leadsto \color{blue}{c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}} \]
    4. Add Preprocessing

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999998e274

    1. Initial program 99.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing

    if 4.9999999999999998e274 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 45.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num45.2%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}} \]
      2. associate-/r/45.2%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
      3. associate-/r*45.2%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell}} \cdot A} \]
    4. Applied egg-rr45.2%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell} \cdot A}} \]
    5. Step-by-step derivation
      1. associate-*l/50.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V} \cdot A}{\ell}}} \]
      2. sqrt-div37.8%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{1}{V} \cdot A}}{\sqrt{\ell}}} \]
      3. associate-*l/37.7%

        \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{1 \cdot A}{V}}}}{\sqrt{\ell}} \]
      4. *-un-lft-identity37.7%

        \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A}}{V}}}{\sqrt{\ell}} \]
      5. clear-num37.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{1}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      6. un-div-inv37.7%

        \[\leadsto \color{blue}{\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      7. sqrt-undiv51.2%

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{\ell}{\frac{A}{V}}}}} \]
      8. div-inv51.1%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\ell \cdot \frac{1}{\frac{A}{V}}}}} \]
      9. clear-num51.1%

        \[\leadsto \frac{c0}{\sqrt{\ell \cdot \color{blue}{\frac{V}{A}}}} \]
    6. Applied egg-rr51.1%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}} \]
    7. Step-by-step derivation
      1. *-commutative51.1%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V}{A} \cdot \ell}}} \]
      2. associate-*l/45.2%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}} \]
      3. associate-*r/51.1%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
    8. Simplified51.1%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification75.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 0:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 5 \cdot 10^{+274}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 80.7% accurate, 0.3× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 5 \cdot 10^{-305}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+274}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (* c0_m (sqrt (/ A (* V l))))))
   (*
    c0_s
    (if (<= t_0 5e-305)
      (* c0_m (sqrt (* (/ A V) (/ 1.0 l))))
      (if (<= t_0 5e+274) t_0 (/ c0_m (sqrt (* V (/ l A)))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = c0_m * sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 5e-305) {
		tmp = c0_m * sqrt(((A / V) * (1.0 / l)));
	} else if (t_0 <= 5e+274) {
		tmp = t_0;
	} else {
		tmp = c0_m / sqrt((V * (l / A)));
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = c0_m * sqrt((a / (v * l)))
    if (t_0 <= 5d-305) then
        tmp = c0_m * sqrt(((a / v) * (1.0d0 / l)))
    else if (t_0 <= 5d+274) then
        tmp = t_0
    else
        tmp = c0_m / sqrt((v * (l / a)))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = c0_m * Math.sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 5e-305) {
		tmp = c0_m * Math.sqrt(((A / V) * (1.0 / l)));
	} else if (t_0 <= 5e+274) {
		tmp = t_0;
	} else {
		tmp = c0_m / Math.sqrt((V * (l / A)));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = c0_m * math.sqrt((A / (V * l)))
	tmp = 0
	if t_0 <= 5e-305:
		tmp = c0_m * math.sqrt(((A / V) * (1.0 / l)))
	elif t_0 <= 5e+274:
		tmp = t_0
	else:
		tmp = c0_m / math.sqrt((V * (l / A)))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(c0_m * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if (t_0 <= 5e-305)
		tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) * Float64(1.0 / l))));
	elseif (t_0 <= 5e+274)
		tmp = t_0;
	else
		tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A))));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = c0_m * sqrt((A / (V * l)));
	tmp = 0.0;
	if (t_0 <= 5e-305)
		tmp = c0_m * sqrt(((A / V) * (1.0 / l)));
	elseif (t_0 <= 5e+274)
		tmp = t_0;
	else
		tmp = c0_m / sqrt((V * (l / A)));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 5e-305], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+274], t$95$0, N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-305}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+274}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.99999999999999985e-305

    1. Initial program 70.8%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r*72.4%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
      2. div-inv72.3%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V} \cdot \frac{1}{\ell}}} \]
    4. Applied egg-rr72.3%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A}{V} \cdot \frac{1}{\ell}}} \]

    if 4.99999999999999985e-305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999998e274

    1. Initial program 99.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing

    if 4.9999999999999998e274 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 45.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num45.2%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}} \]
      2. associate-/r/45.2%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
      3. associate-/r*45.2%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell}} \cdot A} \]
    4. Applied egg-rr45.2%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell} \cdot A}} \]
    5. Step-by-step derivation
      1. associate-*l/50.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V} \cdot A}{\ell}}} \]
      2. sqrt-div37.8%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{1}{V} \cdot A}}{\sqrt{\ell}}} \]
      3. associate-*l/37.7%

        \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{1 \cdot A}{V}}}}{\sqrt{\ell}} \]
      4. *-un-lft-identity37.7%

        \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A}}{V}}}{\sqrt{\ell}} \]
      5. clear-num37.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{1}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      6. un-div-inv37.7%

        \[\leadsto \color{blue}{\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      7. sqrt-undiv51.2%

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{\ell}{\frac{A}{V}}}}} \]
      8. div-inv51.1%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\ell \cdot \frac{1}{\frac{A}{V}}}}} \]
      9. clear-num51.1%

        \[\leadsto \frac{c0}{\sqrt{\ell \cdot \color{blue}{\frac{V}{A}}}} \]
    6. Applied egg-rr51.1%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}} \]
    7. Step-by-step derivation
      1. *-commutative51.1%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V}{A} \cdot \ell}}} \]
      2. associate-*l/45.2%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}} \]
      3. associate-*r/51.1%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
    8. Simplified51.1%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification75.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 5 \cdot 10^{-305}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\ \mathbf{elif}\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 5 \cdot 10^{+274}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 85.2% accurate, 0.5× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+202}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 10^{+255}\right):\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (* c0_m (/ (sqrt (/ A V)) (sqrt l)))))
   (*
    c0_s
    (if (<= (* V l) -1e+202)
      t_0
      (if (<= (* V l) -1e-108)
        (* c0_m (sqrt (/ A (* V l))))
        (if (or (<= (* V l) 0.0) (not (<= (* V l) 1e+255)))
          t_0
          (* c0_m (/ (sqrt A) (sqrt (* V l))))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = c0_m * (sqrt((A / V)) / sqrt(l));
	double tmp;
	if ((V * l) <= -1e+202) {
		tmp = t_0;
	} else if ((V * l) <= -1e-108) {
		tmp = c0_m * sqrt((A / (V * l)));
	} else if (((V * l) <= 0.0) || !((V * l) <= 1e+255)) {
		tmp = t_0;
	} else {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = c0_m * (sqrt((a / v)) / sqrt(l))
    if ((v * l) <= (-1d+202)) then
        tmp = t_0
    else if ((v * l) <= (-1d-108)) then
        tmp = c0_m * sqrt((a / (v * l)))
    else if (((v * l) <= 0.0d0) .or. (.not. ((v * l) <= 1d+255))) then
        tmp = t_0
    else
        tmp = c0_m * (sqrt(a) / sqrt((v * l)))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
	double tmp;
	if ((V * l) <= -1e+202) {
		tmp = t_0;
	} else if ((V * l) <= -1e-108) {
		tmp = c0_m * Math.sqrt((A / (V * l)));
	} else if (((V * l) <= 0.0) || !((V * l) <= 1e+255)) {
		tmp = t_0;
	} else {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = c0_m * (math.sqrt((A / V)) / math.sqrt(l))
	tmp = 0
	if (V * l) <= -1e+202:
		tmp = t_0
	elif (V * l) <= -1e-108:
		tmp = c0_m * math.sqrt((A / (V * l)))
	elif ((V * l) <= 0.0) or not ((V * l) <= 1e+255):
		tmp = t_0
	else:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l)))
	tmp = 0.0
	if (Float64(V * l) <= -1e+202)
		tmp = t_0;
	elseif (Float64(V * l) <= -1e-108)
		tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l))));
	elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 1e+255))
		tmp = t_0;
	else
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = c0_m * (sqrt((A / V)) / sqrt(l));
	tmp = 0.0;
	if ((V * l) <= -1e+202)
		tmp = t_0;
	elseif ((V * l) <= -1e-108)
		tmp = c0_m * sqrt((A / (V * l)));
	elseif (((V * l) <= 0.0) || ~(((V * l) <= 1e+255)))
		tmp = t_0;
	else
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -1e+202], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-108], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 1e+255]], $MachinePrecision]], t$95$0, N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+202}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\

\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 10^{+255}\right):\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 V l) < -9.999999999999999e201 or -1.00000000000000004e-108 < (*.f64 V l) < -0.0 or 9.99999999999999988e254 < (*.f64 V l)

    1. Initial program 49.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r*63.2%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
      2. sqrt-div35.7%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \]
      3. div-inv35.6%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right)} \]
    4. Applied egg-rr35.6%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/35.7%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}} \cdot 1}{\sqrt{\ell}}} \]
      2. *-rgt-identity35.7%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{\frac{A}{V}}}}{\sqrt{\ell}} \]
    6. Simplified35.7%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \]

    if -9.999999999999999e201 < (*.f64 V l) < -1.00000000000000004e-108

    1. Initial program 96.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing

    if -0.0 < (*.f64 V l) < 9.99999999999999988e254

    1. Initial program 87.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-div98.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
      2. div-inv98.8%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    4. Applied egg-rr98.8%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/98.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A} \cdot 1}{\sqrt{V \cdot \ell}}} \]
      2. *-rgt-identity98.9%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{A}}}{\sqrt{V \cdot \ell}} \]
    6. Simplified98.9%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification72.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+202}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 10^{+255}\right):\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 84.7% accurate, 0.5× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{A}{V}}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot t\_0\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 10^{+255}\right):\\ \;\;\;\;c0\_m \cdot \frac{t\_0}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (sqrt (/ A V))))
   (*
    c0_s
    (if (<= (* V l) (- INFINITY))
      (* (/ c0_m (sqrt l)) t_0)
      (if (<= (* V l) -1e-108)
        (* c0_m (sqrt (/ A (* V l))))
        (if (or (<= (* V l) 0.0) (not (<= (* V l) 1e+255)))
          (* c0_m (/ t_0 (sqrt l)))
          (* c0_m (/ (sqrt A) (sqrt (* V l))))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = sqrt((A / V));
	double tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = (c0_m / sqrt(l)) * t_0;
	} else if ((V * l) <= -1e-108) {
		tmp = c0_m * sqrt((A / (V * l)));
	} else if (((V * l) <= 0.0) || !((V * l) <= 1e+255)) {
		tmp = c0_m * (t_0 / sqrt(l));
	} else {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	}
	return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = Math.sqrt((A / V));
	double tmp;
	if ((V * l) <= -Double.POSITIVE_INFINITY) {
		tmp = (c0_m / Math.sqrt(l)) * t_0;
	} else if ((V * l) <= -1e-108) {
		tmp = c0_m * Math.sqrt((A / (V * l)));
	} else if (((V * l) <= 0.0) || !((V * l) <= 1e+255)) {
		tmp = c0_m * (t_0 / Math.sqrt(l));
	} else {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = math.sqrt((A / V))
	tmp = 0
	if (V * l) <= -math.inf:
		tmp = (c0_m / math.sqrt(l)) * t_0
	elif (V * l) <= -1e-108:
		tmp = c0_m * math.sqrt((A / (V * l)))
	elif ((V * l) <= 0.0) or not ((V * l) <= 1e+255):
		tmp = c0_m * (t_0 / math.sqrt(l))
	else:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = sqrt(Float64(A / V))
	tmp = 0.0
	if (Float64(V * l) <= Float64(-Inf))
		tmp = Float64(Float64(c0_m / sqrt(l)) * t_0);
	elseif (Float64(V * l) <= -1e-108)
		tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l))));
	elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 1e+255))
		tmp = Float64(c0_m * Float64(t_0 / sqrt(l)));
	else
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = sqrt((A / V));
	tmp = 0.0;
	if ((V * l) <= -Inf)
		tmp = (c0_m / sqrt(l)) * t_0;
	elseif ((V * l) <= -1e-108)
		tmp = c0_m * sqrt((A / (V * l)));
	elseif (((V * l) <= 0.0) || ~(((V * l) <= 1e+255)))
		tmp = c0_m * (t_0 / sqrt(l));
	else
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-108], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 1e+255]], $MachinePrecision]], N[(c0$95$m * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot t\_0\\

\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\

\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 10^{+255}\right):\\
\;\;\;\;c0\_m \cdot \frac{t\_0}{\sqrt{\ell}}\\

\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 V l) < -inf.0

    1. Initial program 25.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt25.7%

        \[\leadsto \color{blue}{\sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}} \cdot \sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}}} \]
      2. sqrt-unprod25.7%

        \[\leadsto \color{blue}{\sqrt{\left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)}} \]
      3. *-commutative25.7%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)} \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)} \]
      4. *-commutative25.7%

        \[\leadsto \sqrt{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right) \cdot \color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)}} \]
      5. swap-sqr24.8%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot c0\right)}} \]
      6. add-sqr-sqrt24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{A}{V \cdot \ell}} \cdot \left(c0 \cdot c0\right)} \]
      7. pow224.8%

        \[\leadsto \sqrt{\frac{A}{V \cdot \ell} \cdot \color{blue}{{c0}^{2}}} \]
    4. Applied egg-rr24.8%

      \[\leadsto \color{blue}{\sqrt{\frac{A}{V \cdot \ell} \cdot {c0}^{2}}} \]
    5. Step-by-step derivation
      1. associate-/r*24.7%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}} \cdot {c0}^{2}} \]
    6. Simplified24.7%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell} \cdot {c0}^{2}}} \]
    7. Step-by-step derivation
      1. sqrt-prod31.4%

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell}} \cdot \sqrt{{c0}^{2}}} \]
      2. sqrt-undiv7.3%

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \cdot \sqrt{{c0}^{2}} \]
      3. sqrt-undiv31.4%

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell}}} \cdot \sqrt{{c0}^{2}} \]
      4. associate-/l/24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{A}{\ell \cdot V}}} \cdot \sqrt{{c0}^{2}} \]
      5. frac-2neg24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{-A}{-\ell \cdot V}}} \cdot \sqrt{{c0}^{2}} \]
      6. distribute-rgt-neg-out24.8%

        \[\leadsto \sqrt{\frac{-A}{\color{blue}{\ell \cdot \left(-V\right)}}} \cdot \sqrt{{c0}^{2}} \]
      7. sqrt-undiv24.8%

        \[\leadsto \color{blue}{\frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}} \cdot \sqrt{{c0}^{2}} \]
      8. sqrt-pow125.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot \color{blue}{{c0}^{\left(\frac{2}{2}\right)}} \]
      9. metadata-eval25.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot {c0}^{\color{blue}{1}} \]
      10. pow125.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot \color{blue}{c0} \]
      11. associate-*l/25.7%

        \[\leadsto \color{blue}{\frac{\sqrt{-A} \cdot c0}{\sqrt{\ell \cdot \left(-V\right)}}} \]
      12. *-commutative25.7%

        \[\leadsto \frac{\color{blue}{c0 \cdot \sqrt{-A}}}{\sqrt{\ell \cdot \left(-V\right)}} \]
      13. sqrt-prod21.2%

        \[\leadsto \frac{c0 \cdot \sqrt{-A}}{\color{blue}{\sqrt{\ell} \cdot \sqrt{-V}}} \]
      14. times-frac21.3%

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \frac{\sqrt{-A}}{\sqrt{-V}}} \]
      15. sqrt-div14.8%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\sqrt{\frac{-A}{-V}}} \]
      16. frac-2neg14.8%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\color{blue}{\frac{A}{V}}} \]
    8. Applied egg-rr14.8%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}} \]

    if -inf.0 < (*.f64 V l) < -1.00000000000000004e-108

    1. Initial program 95.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing

    if -1.00000000000000004e-108 < (*.f64 V l) < -0.0 or 9.99999999999999988e254 < (*.f64 V l)

    1. Initial program 49.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r*63.8%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
      2. sqrt-div35.4%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \]
      3. div-inv35.4%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right)} \]
    4. Applied egg-rr35.4%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/35.4%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}} \cdot 1}{\sqrt{\ell}}} \]
      2. *-rgt-identity35.4%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{\frac{A}{V}}}}{\sqrt{\ell}} \]
    6. Simplified35.4%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \]

    if -0.0 < (*.f64 V l) < 9.99999999999999988e254

    1. Initial program 87.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-div98.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
      2. div-inv98.8%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    4. Applied egg-rr98.8%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/98.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A} \cdot 1}{\sqrt{V \cdot \ell}}} \]
      2. *-rgt-identity98.9%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{A}}}{\sqrt{V \cdot \ell}} \]
    6. Simplified98.9%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification73.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 10^{+255}\right):\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 84.2% accurate, 0.5× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{A}{V}}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot t\_0\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;c0\_m \cdot \frac{t\_0}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c0\_m}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (sqrt (/ A V))))
   (*
    c0_s
    (if (<= (* V l) (- INFINITY))
      (* (/ c0_m (sqrt l)) t_0)
      (if (<= (* V l) -1e-108)
        (* c0_m (sqrt (/ A (* V l))))
        (if (<= (* V l) 0.0)
          (* c0_m (/ t_0 (sqrt l)))
          (if (<= (* V l) 1e+255)
            (* c0_m (/ (sqrt A) (sqrt (* V l))))
            (/ (/ c0_m (sqrt V)) (sqrt (/ l A))))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = sqrt((A / V));
	double tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = (c0_m / sqrt(l)) * t_0;
	} else if ((V * l) <= -1e-108) {
		tmp = c0_m * sqrt((A / (V * l)));
	} else if ((V * l) <= 0.0) {
		tmp = c0_m * (t_0 / sqrt(l));
	} else if ((V * l) <= 1e+255) {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = (c0_m / sqrt(V)) / sqrt((l / A));
	}
	return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = Math.sqrt((A / V));
	double tmp;
	if ((V * l) <= -Double.POSITIVE_INFINITY) {
		tmp = (c0_m / Math.sqrt(l)) * t_0;
	} else if ((V * l) <= -1e-108) {
		tmp = c0_m * Math.sqrt((A / (V * l)));
	} else if ((V * l) <= 0.0) {
		tmp = c0_m * (t_0 / Math.sqrt(l));
	} else if ((V * l) <= 1e+255) {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = (c0_m / Math.sqrt(V)) / Math.sqrt((l / A));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = math.sqrt((A / V))
	tmp = 0
	if (V * l) <= -math.inf:
		tmp = (c0_m / math.sqrt(l)) * t_0
	elif (V * l) <= -1e-108:
		tmp = c0_m * math.sqrt((A / (V * l)))
	elif (V * l) <= 0.0:
		tmp = c0_m * (t_0 / math.sqrt(l))
	elif (V * l) <= 1e+255:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = (c0_m / math.sqrt(V)) / math.sqrt((l / A))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = sqrt(Float64(A / V))
	tmp = 0.0
	if (Float64(V * l) <= Float64(-Inf))
		tmp = Float64(Float64(c0_m / sqrt(l)) * t_0);
	elseif (Float64(V * l) <= -1e-108)
		tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l))));
	elseif (Float64(V * l) <= 0.0)
		tmp = Float64(c0_m * Float64(t_0 / sqrt(l)));
	elseif (Float64(V * l) <= 1e+255)
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(Float64(c0_m / sqrt(V)) / sqrt(Float64(l / A)));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = sqrt((A / V));
	tmp = 0.0;
	if ((V * l) <= -Inf)
		tmp = (c0_m / sqrt(l)) * t_0;
	elseif ((V * l) <= -1e-108)
		tmp = c0_m * sqrt((A / (V * l)));
	elseif ((V * l) <= 0.0)
		tmp = c0_m * (t_0 / sqrt(l));
	elseif ((V * l) <= 1e+255)
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	else
		tmp = (c0_m / sqrt(V)) / sqrt((l / A));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-108], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0$95$m * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+255], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0$95$m / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot t\_0\\

\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\

\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0\_m \cdot \frac{t\_0}{\sqrt{\ell}}\\

\mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{c0\_m}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 V l) < -inf.0

    1. Initial program 25.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt25.7%

        \[\leadsto \color{blue}{\sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}} \cdot \sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}}} \]
      2. sqrt-unprod25.7%

        \[\leadsto \color{blue}{\sqrt{\left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)}} \]
      3. *-commutative25.7%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)} \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)} \]
      4. *-commutative25.7%

        \[\leadsto \sqrt{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right) \cdot \color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)}} \]
      5. swap-sqr24.8%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot c0\right)}} \]
      6. add-sqr-sqrt24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{A}{V \cdot \ell}} \cdot \left(c0 \cdot c0\right)} \]
      7. pow224.8%

        \[\leadsto \sqrt{\frac{A}{V \cdot \ell} \cdot \color{blue}{{c0}^{2}}} \]
    4. Applied egg-rr24.8%

      \[\leadsto \color{blue}{\sqrt{\frac{A}{V \cdot \ell} \cdot {c0}^{2}}} \]
    5. Step-by-step derivation
      1. associate-/r*24.7%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}} \cdot {c0}^{2}} \]
    6. Simplified24.7%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell} \cdot {c0}^{2}}} \]
    7. Step-by-step derivation
      1. sqrt-prod31.4%

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell}} \cdot \sqrt{{c0}^{2}}} \]
      2. sqrt-undiv7.3%

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \cdot \sqrt{{c0}^{2}} \]
      3. sqrt-undiv31.4%

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell}}} \cdot \sqrt{{c0}^{2}} \]
      4. associate-/l/24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{A}{\ell \cdot V}}} \cdot \sqrt{{c0}^{2}} \]
      5. frac-2neg24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{-A}{-\ell \cdot V}}} \cdot \sqrt{{c0}^{2}} \]
      6. distribute-rgt-neg-out24.8%

        \[\leadsto \sqrt{\frac{-A}{\color{blue}{\ell \cdot \left(-V\right)}}} \cdot \sqrt{{c0}^{2}} \]
      7. sqrt-undiv24.8%

        \[\leadsto \color{blue}{\frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}} \cdot \sqrt{{c0}^{2}} \]
      8. sqrt-pow125.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot \color{blue}{{c0}^{\left(\frac{2}{2}\right)}} \]
      9. metadata-eval25.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot {c0}^{\color{blue}{1}} \]
      10. pow125.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot \color{blue}{c0} \]
      11. associate-*l/25.7%

        \[\leadsto \color{blue}{\frac{\sqrt{-A} \cdot c0}{\sqrt{\ell \cdot \left(-V\right)}}} \]
      12. *-commutative25.7%

        \[\leadsto \frac{\color{blue}{c0 \cdot \sqrt{-A}}}{\sqrt{\ell \cdot \left(-V\right)}} \]
      13. sqrt-prod21.2%

        \[\leadsto \frac{c0 \cdot \sqrt{-A}}{\color{blue}{\sqrt{\ell} \cdot \sqrt{-V}}} \]
      14. times-frac21.3%

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \frac{\sqrt{-A}}{\sqrt{-V}}} \]
      15. sqrt-div14.8%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\sqrt{\frac{-A}{-V}}} \]
      16. frac-2neg14.8%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\color{blue}{\frac{A}{V}}} \]
    8. Applied egg-rr14.8%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}} \]

    if -inf.0 < (*.f64 V l) < -1.00000000000000004e-108

    1. Initial program 95.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing

    if -1.00000000000000004e-108 < (*.f64 V l) < -0.0

    1. Initial program 55.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r*68.3%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
      2. sqrt-div31.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \]
      3. div-inv31.9%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right)} \]
    4. Applied egg-rr31.9%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/31.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}} \cdot 1}{\sqrt{\ell}}} \]
      2. *-rgt-identity31.9%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{\frac{A}{V}}}}{\sqrt{\ell}} \]
    6. Simplified31.9%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \]

    if -0.0 < (*.f64 V l) < 9.99999999999999988e254

    1. Initial program 87.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-div98.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
      2. div-inv98.8%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    4. Applied egg-rr98.8%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/98.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A} \cdot 1}{\sqrt{V \cdot \ell}}} \]
      2. *-rgt-identity98.9%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{A}}}{\sqrt{V \cdot \ell}} \]
    6. Simplified98.9%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]

    if 9.99999999999999988e254 < (*.f64 V l)

    1. Initial program 25.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num25.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}} \]
      2. associate-/r/25.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
      3. associate-/r*28.6%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell}} \cdot A} \]
    4. Applied egg-rr28.6%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell} \cdot A}} \]
    5. Step-by-step derivation
      1. associate-*l/45.1%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V} \cdot A}{\ell}}} \]
      2. sqrt-div50.1%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{1}{V} \cdot A}}{\sqrt{\ell}}} \]
      3. associate-*l/50.0%

        \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{1 \cdot A}{V}}}}{\sqrt{\ell}} \]
      4. *-un-lft-identity50.0%

        \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A}}{V}}}{\sqrt{\ell}} \]
      5. clear-num50.1%

        \[\leadsto c0 \cdot \color{blue}{\frac{1}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      6. un-div-inv50.0%

        \[\leadsto \color{blue}{\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      7. sqrt-undiv40.3%

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{\ell}{\frac{A}{V}}}}} \]
      8. div-inv40.3%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\ell \cdot \frac{1}{\frac{A}{V}}}}} \]
      9. clear-num40.3%

        \[\leadsto \frac{c0}{\sqrt{\ell \cdot \color{blue}{\frac{V}{A}}}} \]
    6. Applied egg-rr40.3%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}} \]
    7. Step-by-step derivation
      1. *-commutative40.3%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V}{A} \cdot \ell}}} \]
      2. associate-*l/25.0%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}} \]
      3. associate-*r/40.3%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
    8. Simplified40.3%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity40.3%

        \[\leadsto \frac{\color{blue}{1 \cdot c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      2. sqrt-prod50.2%

        \[\leadsto \frac{1 \cdot c0}{\color{blue}{\sqrt{V} \cdot \sqrt{\frac{\ell}{A}}}} \]
      3. times-frac50.0%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{V}} \cdot \frac{c0}{\sqrt{\frac{\ell}{A}}}} \]
    10. Applied egg-rr50.0%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{V}} \cdot \frac{c0}{\sqrt{\frac{\ell}{A}}}} \]
    11. Step-by-step derivation
      1. associate-*r/50.2%

        \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{V}} \cdot c0}{\sqrt{\frac{\ell}{A}}}} \]
      2. associate-*l/50.1%

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot c0}{\sqrt{V}}}}{\sqrt{\frac{\ell}{A}}} \]
      3. *-lft-identity50.1%

        \[\leadsto \frac{\frac{\color{blue}{c0}}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}} \]
    12. Simplified50.1%

      \[\leadsto \color{blue}{\frac{\frac{c0}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification73.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c0}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 84.3% accurate, 0.5× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;c0\_m \cdot \frac{{\left(\frac{V}{A}\right)}^{-0.5}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c0\_m}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\ \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (*
  c0_s
  (if (<= (* V l) (- INFINITY))
    (* (/ c0_m (sqrt l)) (sqrt (/ A V)))
    (if (<= (* V l) -1e-108)
      (* c0_m (sqrt (/ A (* V l))))
      (if (<= (* V l) 0.0)
        (* c0_m (/ (pow (/ V A) -0.5) (sqrt l)))
        (if (<= (* V l) 1e+255)
          (* c0_m (/ (sqrt A) (sqrt (* V l))))
          (/ (/ c0_m (sqrt V)) (sqrt (/ l A)))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = (c0_m / sqrt(l)) * sqrt((A / V));
	} else if ((V * l) <= -1e-108) {
		tmp = c0_m * sqrt((A / (V * l)));
	} else if ((V * l) <= 0.0) {
		tmp = c0_m * (pow((V / A), -0.5) / sqrt(l));
	} else if ((V * l) <= 1e+255) {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = (c0_m / sqrt(V)) / sqrt((l / A));
	}
	return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -Double.POSITIVE_INFINITY) {
		tmp = (c0_m / Math.sqrt(l)) * Math.sqrt((A / V));
	} else if ((V * l) <= -1e-108) {
		tmp = c0_m * Math.sqrt((A / (V * l)));
	} else if ((V * l) <= 0.0) {
		tmp = c0_m * (Math.pow((V / A), -0.5) / Math.sqrt(l));
	} else if ((V * l) <= 1e+255) {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = (c0_m / Math.sqrt(V)) / Math.sqrt((l / A));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	tmp = 0
	if (V * l) <= -math.inf:
		tmp = (c0_m / math.sqrt(l)) * math.sqrt((A / V))
	elif (V * l) <= -1e-108:
		tmp = c0_m * math.sqrt((A / (V * l)))
	elif (V * l) <= 0.0:
		tmp = c0_m * (math.pow((V / A), -0.5) / math.sqrt(l))
	elif (V * l) <= 1e+255:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = (c0_m / math.sqrt(V)) / math.sqrt((l / A))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= Float64(-Inf))
		tmp = Float64(Float64(c0_m / sqrt(l)) * sqrt(Float64(A / V)));
	elseif (Float64(V * l) <= -1e-108)
		tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l))));
	elseif (Float64(V * l) <= 0.0)
		tmp = Float64(c0_m * Float64((Float64(V / A) ^ -0.5) / sqrt(l)));
	elseif (Float64(V * l) <= 1e+255)
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(Float64(c0_m / sqrt(V)) / sqrt(Float64(l / A)));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -Inf)
		tmp = (c0_m / sqrt(l)) * sqrt((A / V));
	elseif ((V * l) <= -1e-108)
		tmp = c0_m * sqrt((A / (V * l)));
	elseif ((V * l) <= 0.0)
		tmp = c0_m * (((V / A) ^ -0.5) / sqrt(l));
	elseif ((V * l) <= 1e+255)
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	else
		tmp = (c0_m / sqrt(V)) / sqrt((l / A));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-108], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0$95$m * N[(N[Power[N[(V / A), $MachinePrecision], -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+255], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0$95$m / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\

\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\

\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0\_m \cdot \frac{{\left(\frac{V}{A}\right)}^{-0.5}}{\sqrt{\ell}}\\

\mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{c0\_m}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 V l) < -inf.0

    1. Initial program 25.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt25.7%

        \[\leadsto \color{blue}{\sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}} \cdot \sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}}} \]
      2. sqrt-unprod25.7%

        \[\leadsto \color{blue}{\sqrt{\left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)}} \]
      3. *-commutative25.7%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)} \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)} \]
      4. *-commutative25.7%

        \[\leadsto \sqrt{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right) \cdot \color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)}} \]
      5. swap-sqr24.8%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot c0\right)}} \]
      6. add-sqr-sqrt24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{A}{V \cdot \ell}} \cdot \left(c0 \cdot c0\right)} \]
      7. pow224.8%

        \[\leadsto \sqrt{\frac{A}{V \cdot \ell} \cdot \color{blue}{{c0}^{2}}} \]
    4. Applied egg-rr24.8%

      \[\leadsto \color{blue}{\sqrt{\frac{A}{V \cdot \ell} \cdot {c0}^{2}}} \]
    5. Step-by-step derivation
      1. associate-/r*24.7%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}} \cdot {c0}^{2}} \]
    6. Simplified24.7%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell} \cdot {c0}^{2}}} \]
    7. Step-by-step derivation
      1. sqrt-prod31.4%

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell}} \cdot \sqrt{{c0}^{2}}} \]
      2. sqrt-undiv7.3%

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \cdot \sqrt{{c0}^{2}} \]
      3. sqrt-undiv31.4%

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell}}} \cdot \sqrt{{c0}^{2}} \]
      4. associate-/l/24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{A}{\ell \cdot V}}} \cdot \sqrt{{c0}^{2}} \]
      5. frac-2neg24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{-A}{-\ell \cdot V}}} \cdot \sqrt{{c0}^{2}} \]
      6. distribute-rgt-neg-out24.8%

        \[\leadsto \sqrt{\frac{-A}{\color{blue}{\ell \cdot \left(-V\right)}}} \cdot \sqrt{{c0}^{2}} \]
      7. sqrt-undiv24.8%

        \[\leadsto \color{blue}{\frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}} \cdot \sqrt{{c0}^{2}} \]
      8. sqrt-pow125.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot \color{blue}{{c0}^{\left(\frac{2}{2}\right)}} \]
      9. metadata-eval25.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot {c0}^{\color{blue}{1}} \]
      10. pow125.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot \color{blue}{c0} \]
      11. associate-*l/25.7%

        \[\leadsto \color{blue}{\frac{\sqrt{-A} \cdot c0}{\sqrt{\ell \cdot \left(-V\right)}}} \]
      12. *-commutative25.7%

        \[\leadsto \frac{\color{blue}{c0 \cdot \sqrt{-A}}}{\sqrt{\ell \cdot \left(-V\right)}} \]
      13. sqrt-prod21.2%

        \[\leadsto \frac{c0 \cdot \sqrt{-A}}{\color{blue}{\sqrt{\ell} \cdot \sqrt{-V}}} \]
      14. times-frac21.3%

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \frac{\sqrt{-A}}{\sqrt{-V}}} \]
      15. sqrt-div14.8%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\sqrt{\frac{-A}{-V}}} \]
      16. frac-2neg14.8%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\color{blue}{\frac{A}{V}}} \]
    8. Applied egg-rr14.8%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}} \]

    if -inf.0 < (*.f64 V l) < -1.00000000000000004e-108

    1. Initial program 95.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing

    if -1.00000000000000004e-108 < (*.f64 V l) < -0.0

    1. Initial program 55.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r*68.3%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
      2. sqrt-div31.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \]
      3. div-inv31.9%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right)} \]
    4. Applied egg-rr31.9%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/31.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}} \cdot 1}{\sqrt{\ell}}} \]
      2. *-rgt-identity31.9%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{\frac{A}{V}}}}{\sqrt{\ell}} \]
    6. Simplified31.9%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \]
    7. Step-by-step derivation
      1. clear-num31.9%

        \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{1}{\frac{V}{A}}}}}{\sqrt{\ell}} \]
      2. sqrt-div32.3%

        \[\leadsto c0 \cdot \frac{\color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{V}{A}}}}}{\sqrt{\ell}} \]
      3. metadata-eval32.3%

        \[\leadsto c0 \cdot \frac{\frac{\color{blue}{1}}{\sqrt{\frac{V}{A}}}}{\sqrt{\ell}} \]
    8. Applied egg-rr32.3%

      \[\leadsto c0 \cdot \frac{\color{blue}{\frac{1}{\sqrt{\frac{V}{A}}}}}{\sqrt{\ell}} \]
    9. Step-by-step derivation
      1. inv-pow32.3%

        \[\leadsto c0 \cdot \frac{\color{blue}{{\left(\sqrt{\frac{V}{A}}\right)}^{-1}}}{\sqrt{\ell}} \]
      2. sqrt-pow232.4%

        \[\leadsto c0 \cdot \frac{\color{blue}{{\left(\frac{V}{A}\right)}^{\left(\frac{-1}{2}\right)}}}{\sqrt{\ell}} \]
      3. metadata-eval32.4%

        \[\leadsto c0 \cdot \frac{{\left(\frac{V}{A}\right)}^{\color{blue}{-0.5}}}{\sqrt{\ell}} \]
    10. Applied egg-rr32.4%

      \[\leadsto c0 \cdot \frac{\color{blue}{{\left(\frac{V}{A}\right)}^{-0.5}}}{\sqrt{\ell}} \]

    if -0.0 < (*.f64 V l) < 9.99999999999999988e254

    1. Initial program 87.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-div98.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
      2. div-inv98.8%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    4. Applied egg-rr98.8%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/98.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A} \cdot 1}{\sqrt{V \cdot \ell}}} \]
      2. *-rgt-identity98.9%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{A}}}{\sqrt{V \cdot \ell}} \]
    6. Simplified98.9%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]

    if 9.99999999999999988e254 < (*.f64 V l)

    1. Initial program 25.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num25.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}} \]
      2. associate-/r/25.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
      3. associate-/r*28.6%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell}} \cdot A} \]
    4. Applied egg-rr28.6%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell} \cdot A}} \]
    5. Step-by-step derivation
      1. associate-*l/45.1%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V} \cdot A}{\ell}}} \]
      2. sqrt-div50.1%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{1}{V} \cdot A}}{\sqrt{\ell}}} \]
      3. associate-*l/50.0%

        \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{1 \cdot A}{V}}}}{\sqrt{\ell}} \]
      4. *-un-lft-identity50.0%

        \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A}}{V}}}{\sqrt{\ell}} \]
      5. clear-num50.1%

        \[\leadsto c0 \cdot \color{blue}{\frac{1}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      6. un-div-inv50.0%

        \[\leadsto \color{blue}{\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      7. sqrt-undiv40.3%

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{\ell}{\frac{A}{V}}}}} \]
      8. div-inv40.3%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\ell \cdot \frac{1}{\frac{A}{V}}}}} \]
      9. clear-num40.3%

        \[\leadsto \frac{c0}{\sqrt{\ell \cdot \color{blue}{\frac{V}{A}}}} \]
    6. Applied egg-rr40.3%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}} \]
    7. Step-by-step derivation
      1. *-commutative40.3%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V}{A} \cdot \ell}}} \]
      2. associate-*l/25.0%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}} \]
      3. associate-*r/40.3%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
    8. Simplified40.3%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity40.3%

        \[\leadsto \frac{\color{blue}{1 \cdot c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      2. sqrt-prod50.2%

        \[\leadsto \frac{1 \cdot c0}{\color{blue}{\sqrt{V} \cdot \sqrt{\frac{\ell}{A}}}} \]
      3. times-frac50.0%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{V}} \cdot \frac{c0}{\sqrt{\frac{\ell}{A}}}} \]
    10. Applied egg-rr50.0%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{V}} \cdot \frac{c0}{\sqrt{\frac{\ell}{A}}}} \]
    11. Step-by-step derivation
      1. associate-*r/50.2%

        \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{V}} \cdot c0}{\sqrt{\frac{\ell}{A}}}} \]
      2. associate-*l/50.1%

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot c0}{\sqrt{V}}}}{\sqrt{\frac{\ell}{A}}} \]
      3. *-lft-identity50.1%

        \[\leadsto \frac{\frac{\color{blue}{c0}}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}} \]
    12. Simplified50.1%

      \[\leadsto \color{blue}{\frac{\frac{c0}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification73.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;c0 \cdot \frac{{\left(\frac{V}{A}\right)}^{-0.5}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c0}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 84.7% accurate, 0.5× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+202}:\\ \;\;\;\;\left(c0\_m \cdot \sqrt{\frac{A}{V}}\right) \cdot {\ell}^{-0.5}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;c0\_m \cdot \frac{{\left(\frac{V}{A}\right)}^{-0.5}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c0\_m}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\ \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (*
  c0_s
  (if (<= (* V l) -1e+202)
    (* (* c0_m (sqrt (/ A V))) (pow l -0.5))
    (if (<= (* V l) -1e-108)
      (* c0_m (sqrt (/ A (* V l))))
      (if (<= (* V l) 0.0)
        (* c0_m (/ (pow (/ V A) -0.5) (sqrt l)))
        (if (<= (* V l) 1e+255)
          (* c0_m (/ (sqrt A) (sqrt (* V l))))
          (/ (/ c0_m (sqrt V)) (sqrt (/ l A)))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e+202) {
		tmp = (c0_m * sqrt((A / V))) * pow(l, -0.5);
	} else if ((V * l) <= -1e-108) {
		tmp = c0_m * sqrt((A / (V * l)));
	} else if ((V * l) <= 0.0) {
		tmp = c0_m * (pow((V / A), -0.5) / sqrt(l));
	} else if ((V * l) <= 1e+255) {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = (c0_m / sqrt(V)) / sqrt((l / A));
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: tmp
    if ((v * l) <= (-1d+202)) then
        tmp = (c0_m * sqrt((a / v))) * (l ** (-0.5d0))
    else if ((v * l) <= (-1d-108)) then
        tmp = c0_m * sqrt((a / (v * l)))
    else if ((v * l) <= 0.0d0) then
        tmp = c0_m * (((v / a) ** (-0.5d0)) / sqrt(l))
    else if ((v * l) <= 1d+255) then
        tmp = c0_m * (sqrt(a) / sqrt((v * l)))
    else
        tmp = (c0_m / sqrt(v)) / sqrt((l / a))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e+202) {
		tmp = (c0_m * Math.sqrt((A / V))) * Math.pow(l, -0.5);
	} else if ((V * l) <= -1e-108) {
		tmp = c0_m * Math.sqrt((A / (V * l)));
	} else if ((V * l) <= 0.0) {
		tmp = c0_m * (Math.pow((V / A), -0.5) / Math.sqrt(l));
	} else if ((V * l) <= 1e+255) {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = (c0_m / Math.sqrt(V)) / Math.sqrt((l / A));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	tmp = 0
	if (V * l) <= -1e+202:
		tmp = (c0_m * math.sqrt((A / V))) * math.pow(l, -0.5)
	elif (V * l) <= -1e-108:
		tmp = c0_m * math.sqrt((A / (V * l)))
	elif (V * l) <= 0.0:
		tmp = c0_m * (math.pow((V / A), -0.5) / math.sqrt(l))
	elif (V * l) <= 1e+255:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = (c0_m / math.sqrt(V)) / math.sqrt((l / A))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= -1e+202)
		tmp = Float64(Float64(c0_m * sqrt(Float64(A / V))) * (l ^ -0.5));
	elseif (Float64(V * l) <= -1e-108)
		tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l))));
	elseif (Float64(V * l) <= 0.0)
		tmp = Float64(c0_m * Float64((Float64(V / A) ^ -0.5) / sqrt(l)));
	elseif (Float64(V * l) <= 1e+255)
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(Float64(c0_m / sqrt(V)) / sqrt(Float64(l / A)));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -1e+202)
		tmp = (c0_m * sqrt((A / V))) * (l ^ -0.5);
	elseif ((V * l) <= -1e-108)
		tmp = c0_m * sqrt((A / (V * l)));
	elseif ((V * l) <= 0.0)
		tmp = c0_m * (((V / A) ^ -0.5) / sqrt(l));
	elseif ((V * l) <= 1e+255)
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	else
		tmp = (c0_m / sqrt(V)) / sqrt((l / A));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -1e+202], N[(N[(c0$95$m * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-108], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0$95$m * N[(N[Power[N[(V / A), $MachinePrecision], -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+255], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0$95$m / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+202}:\\
\;\;\;\;\left(c0\_m \cdot \sqrt{\frac{A}{V}}\right) \cdot {\ell}^{-0.5}\\

\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\

\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0\_m \cdot \frac{{\left(\frac{V}{A}\right)}^{-0.5}}{\sqrt{\ell}}\\

\mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{c0\_m}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 V l) < -9.999999999999999e201

    1. Initial program 48.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt34.6%

        \[\leadsto \color{blue}{\sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}} \cdot \sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}}} \]
      2. sqrt-unprod26.4%

        \[\leadsto \color{blue}{\sqrt{\left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)}} \]
      3. *-commutative26.4%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)} \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)} \]
      4. *-commutative26.4%

        \[\leadsto \sqrt{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right) \cdot \color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)}} \]
      5. swap-sqr25.8%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot c0\right)}} \]
      6. add-sqr-sqrt25.8%

        \[\leadsto \sqrt{\color{blue}{\frac{A}{V \cdot \ell}} \cdot \left(c0 \cdot c0\right)} \]
      7. pow225.8%

        \[\leadsto \sqrt{\frac{A}{V \cdot \ell} \cdot \color{blue}{{c0}^{2}}} \]
    4. Applied egg-rr25.8%

      \[\leadsto \color{blue}{\sqrt{\frac{A}{V \cdot \ell} \cdot {c0}^{2}}} \]
    5. Step-by-step derivation
      1. associate-/r*25.7%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}} \cdot {c0}^{2}} \]
    6. Simplified25.7%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell} \cdot {c0}^{2}}} \]
    7. Step-by-step derivation
      1. *-commutative25.7%

        \[\leadsto \sqrt{\color{blue}{{c0}^{2} \cdot \frac{\frac{A}{V}}{\ell}}} \]
      2. sqrt-prod29.8%

        \[\leadsto \color{blue}{\sqrt{{c0}^{2}} \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}} \]
      3. sqrt-pow161.2%

        \[\leadsto \color{blue}{{c0}^{\left(\frac{2}{2}\right)}} \cdot \sqrt{\frac{\frac{A}{V}}{\ell}} \]
      4. metadata-eval61.2%

        \[\leadsto {c0}^{\color{blue}{1}} \cdot \sqrt{\frac{\frac{A}{V}}{\ell}} \]
      5. pow161.2%

        \[\leadsto \color{blue}{c0} \cdot \sqrt{\frac{\frac{A}{V}}{\ell}} \]
      6. sqrt-undiv36.7%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \]
      7. associate-*r/36.7%

        \[\leadsto \color{blue}{\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \]
      8. div-inv36.7%

        \[\leadsto \color{blue}{\left(c0 \cdot \sqrt{\frac{A}{V}}\right) \cdot \frac{1}{\sqrt{\ell}}} \]
      9. pow1/236.7%

        \[\leadsto \left(c0 \cdot \sqrt{\frac{A}{V}}\right) \cdot \frac{1}{\color{blue}{{\ell}^{0.5}}} \]
      10. pow-flip36.7%

        \[\leadsto \left(c0 \cdot \sqrt{\frac{A}{V}}\right) \cdot \color{blue}{{\ell}^{\left(-0.5\right)}} \]
      11. metadata-eval36.7%

        \[\leadsto \left(c0 \cdot \sqrt{\frac{A}{V}}\right) \cdot {\ell}^{\color{blue}{-0.5}} \]
    8. Applied egg-rr36.7%

      \[\leadsto \color{blue}{\left(c0 \cdot \sqrt{\frac{A}{V}}\right) \cdot {\ell}^{-0.5}} \]

    if -9.999999999999999e201 < (*.f64 V l) < -1.00000000000000004e-108

    1. Initial program 96.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing

    if -1.00000000000000004e-108 < (*.f64 V l) < -0.0

    1. Initial program 55.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-/r*68.3%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
      2. sqrt-div31.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \]
      3. div-inv31.9%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right)} \]
    4. Applied egg-rr31.9%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/31.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}} \cdot 1}{\sqrt{\ell}}} \]
      2. *-rgt-identity31.9%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{\frac{A}{V}}}}{\sqrt{\ell}} \]
    6. Simplified31.9%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \]
    7. Step-by-step derivation
      1. clear-num31.9%

        \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{1}{\frac{V}{A}}}}}{\sqrt{\ell}} \]
      2. sqrt-div32.3%

        \[\leadsto c0 \cdot \frac{\color{blue}{\frac{\sqrt{1}}{\sqrt{\frac{V}{A}}}}}{\sqrt{\ell}} \]
      3. metadata-eval32.3%

        \[\leadsto c0 \cdot \frac{\frac{\color{blue}{1}}{\sqrt{\frac{V}{A}}}}{\sqrt{\ell}} \]
    8. Applied egg-rr32.3%

      \[\leadsto c0 \cdot \frac{\color{blue}{\frac{1}{\sqrt{\frac{V}{A}}}}}{\sqrt{\ell}} \]
    9. Step-by-step derivation
      1. inv-pow32.3%

        \[\leadsto c0 \cdot \frac{\color{blue}{{\left(\sqrt{\frac{V}{A}}\right)}^{-1}}}{\sqrt{\ell}} \]
      2. sqrt-pow232.4%

        \[\leadsto c0 \cdot \frac{\color{blue}{{\left(\frac{V}{A}\right)}^{\left(\frac{-1}{2}\right)}}}{\sqrt{\ell}} \]
      3. metadata-eval32.4%

        \[\leadsto c0 \cdot \frac{{\left(\frac{V}{A}\right)}^{\color{blue}{-0.5}}}{\sqrt{\ell}} \]
    10. Applied egg-rr32.4%

      \[\leadsto c0 \cdot \frac{\color{blue}{{\left(\frac{V}{A}\right)}^{-0.5}}}{\sqrt{\ell}} \]

    if -0.0 < (*.f64 V l) < 9.99999999999999988e254

    1. Initial program 87.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-div98.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
      2. div-inv98.8%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    4. Applied egg-rr98.8%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/98.9%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A} \cdot 1}{\sqrt{V \cdot \ell}}} \]
      2. *-rgt-identity98.9%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{A}}}{\sqrt{V \cdot \ell}} \]
    6. Simplified98.9%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]

    if 9.99999999999999988e254 < (*.f64 V l)

    1. Initial program 25.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num25.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}} \]
      2. associate-/r/25.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
      3. associate-/r*28.6%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell}} \cdot A} \]
    4. Applied egg-rr28.6%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell} \cdot A}} \]
    5. Step-by-step derivation
      1. associate-*l/45.1%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V} \cdot A}{\ell}}} \]
      2. sqrt-div50.1%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{1}{V} \cdot A}}{\sqrt{\ell}}} \]
      3. associate-*l/50.0%

        \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{1 \cdot A}{V}}}}{\sqrt{\ell}} \]
      4. *-un-lft-identity50.0%

        \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A}}{V}}}{\sqrt{\ell}} \]
      5. clear-num50.1%

        \[\leadsto c0 \cdot \color{blue}{\frac{1}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      6. un-div-inv50.0%

        \[\leadsto \color{blue}{\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      7. sqrt-undiv40.3%

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{\ell}{\frac{A}{V}}}}} \]
      8. div-inv40.3%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\ell \cdot \frac{1}{\frac{A}{V}}}}} \]
      9. clear-num40.3%

        \[\leadsto \frac{c0}{\sqrt{\ell \cdot \color{blue}{\frac{V}{A}}}} \]
    6. Applied egg-rr40.3%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}} \]
    7. Step-by-step derivation
      1. *-commutative40.3%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V}{A} \cdot \ell}}} \]
      2. associate-*l/25.0%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}} \]
      3. associate-*r/40.3%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
    8. Simplified40.3%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity40.3%

        \[\leadsto \frac{\color{blue}{1 \cdot c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      2. sqrt-prod50.2%

        \[\leadsto \frac{1 \cdot c0}{\color{blue}{\sqrt{V} \cdot \sqrt{\frac{\ell}{A}}}} \]
      3. times-frac50.0%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{V}} \cdot \frac{c0}{\sqrt{\frac{\ell}{A}}}} \]
    10. Applied egg-rr50.0%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{V}} \cdot \frac{c0}{\sqrt{\frac{\ell}{A}}}} \]
    11. Step-by-step derivation
      1. associate-*r/50.2%

        \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{V}} \cdot c0}{\sqrt{\frac{\ell}{A}}}} \]
      2. associate-*l/50.1%

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot c0}{\sqrt{V}}}}{\sqrt{\frac{\ell}{A}}} \]
      3. *-lft-identity50.1%

        \[\leadsto \frac{\frac{\color{blue}{c0}}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}} \]
    12. Simplified50.1%

      \[\leadsto \color{blue}{\frac{\frac{c0}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification72.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+202}:\\ \;\;\;\;\left(c0 \cdot \sqrt{\frac{A}{V}}\right) \cdot {\ell}^{-0.5}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-108}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;c0 \cdot \frac{{\left(\frac{V}{A}\right)}^{-0.5}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c0}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 88.2% accurate, 0.5× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-250}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\ \;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c0\_m}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\ \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (*
  c0_s
  (if (<= (* V l) (- INFINITY))
    (* (/ c0_m (sqrt l)) (sqrt (/ A V)))
    (if (<= (* V l) -4e-250)
      (* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
      (if (<= (* V l) 5e-319)
        (/ c0_m (sqrt (* V (/ l A))))
        (if (<= (* V l) 1e+255)
          (* c0_m (/ (sqrt A) (sqrt (* V l))))
          (/ (/ c0_m (sqrt V)) (sqrt (/ l A)))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = (c0_m / sqrt(l)) * sqrt((A / V));
	} else if ((V * l) <= -4e-250) {
		tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
	} else if ((V * l) <= 5e-319) {
		tmp = c0_m / sqrt((V * (l / A)));
	} else if ((V * l) <= 1e+255) {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = (c0_m / sqrt(V)) / sqrt((l / A));
	}
	return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -Double.POSITIVE_INFINITY) {
		tmp = (c0_m / Math.sqrt(l)) * Math.sqrt((A / V));
	} else if ((V * l) <= -4e-250) {
		tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if ((V * l) <= 5e-319) {
		tmp = c0_m / Math.sqrt((V * (l / A)));
	} else if ((V * l) <= 1e+255) {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = (c0_m / Math.sqrt(V)) / Math.sqrt((l / A));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	tmp = 0
	if (V * l) <= -math.inf:
		tmp = (c0_m / math.sqrt(l)) * math.sqrt((A / V))
	elif (V * l) <= -4e-250:
		tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l)))
	elif (V * l) <= 5e-319:
		tmp = c0_m / math.sqrt((V * (l / A)))
	elif (V * l) <= 1e+255:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = (c0_m / math.sqrt(V)) / math.sqrt((l / A))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= Float64(-Inf))
		tmp = Float64(Float64(c0_m / sqrt(l)) * sqrt(Float64(A / V)));
	elseif (Float64(V * l) <= -4e-250)
		tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif (Float64(V * l) <= 5e-319)
		tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A))));
	elseif (Float64(V * l) <= 1e+255)
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(Float64(c0_m / sqrt(V)) / sqrt(Float64(l / A)));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -Inf)
		tmp = (c0_m / sqrt(l)) * sqrt((A / V));
	elseif ((V * l) <= -4e-250)
		tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
	elseif ((V * l) <= 5e-319)
		tmp = c0_m / sqrt((V * (l / A)));
	elseif ((V * l) <= 1e+255)
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	else
		tmp = (c0_m / sqrt(V)) / sqrt((l / A));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-250], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-319], N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+255], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0$95$m / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\

\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-250}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\

\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\

\mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{c0\_m}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 V l) < -inf.0

    1. Initial program 25.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt25.7%

        \[\leadsto \color{blue}{\sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}} \cdot \sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}}} \]
      2. sqrt-unprod25.7%

        \[\leadsto \color{blue}{\sqrt{\left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)}} \]
      3. *-commutative25.7%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)} \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)} \]
      4. *-commutative25.7%

        \[\leadsto \sqrt{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right) \cdot \color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)}} \]
      5. swap-sqr24.8%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot c0\right)}} \]
      6. add-sqr-sqrt24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{A}{V \cdot \ell}} \cdot \left(c0 \cdot c0\right)} \]
      7. pow224.8%

        \[\leadsto \sqrt{\frac{A}{V \cdot \ell} \cdot \color{blue}{{c0}^{2}}} \]
    4. Applied egg-rr24.8%

      \[\leadsto \color{blue}{\sqrt{\frac{A}{V \cdot \ell} \cdot {c0}^{2}}} \]
    5. Step-by-step derivation
      1. associate-/r*24.7%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}} \cdot {c0}^{2}} \]
    6. Simplified24.7%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell} \cdot {c0}^{2}}} \]
    7. Step-by-step derivation
      1. sqrt-prod31.4%

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell}} \cdot \sqrt{{c0}^{2}}} \]
      2. sqrt-undiv7.3%

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \cdot \sqrt{{c0}^{2}} \]
      3. sqrt-undiv31.4%

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell}}} \cdot \sqrt{{c0}^{2}} \]
      4. associate-/l/24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{A}{\ell \cdot V}}} \cdot \sqrt{{c0}^{2}} \]
      5. frac-2neg24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{-A}{-\ell \cdot V}}} \cdot \sqrt{{c0}^{2}} \]
      6. distribute-rgt-neg-out24.8%

        \[\leadsto \sqrt{\frac{-A}{\color{blue}{\ell \cdot \left(-V\right)}}} \cdot \sqrt{{c0}^{2}} \]
      7. sqrt-undiv24.8%

        \[\leadsto \color{blue}{\frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}} \cdot \sqrt{{c0}^{2}} \]
      8. sqrt-pow125.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot \color{blue}{{c0}^{\left(\frac{2}{2}\right)}} \]
      9. metadata-eval25.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot {c0}^{\color{blue}{1}} \]
      10. pow125.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot \color{blue}{c0} \]
      11. associate-*l/25.7%

        \[\leadsto \color{blue}{\frac{\sqrt{-A} \cdot c0}{\sqrt{\ell \cdot \left(-V\right)}}} \]
      12. *-commutative25.7%

        \[\leadsto \frac{\color{blue}{c0 \cdot \sqrt{-A}}}{\sqrt{\ell \cdot \left(-V\right)}} \]
      13. sqrt-prod21.2%

        \[\leadsto \frac{c0 \cdot \sqrt{-A}}{\color{blue}{\sqrt{\ell} \cdot \sqrt{-V}}} \]
      14. times-frac21.3%

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \frac{\sqrt{-A}}{\sqrt{-V}}} \]
      15. sqrt-div14.8%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\sqrt{\frac{-A}{-V}}} \]
      16. frac-2neg14.8%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\color{blue}{\frac{A}{V}}} \]
    8. Applied egg-rr14.8%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}} \]

    if -inf.0 < (*.f64 V l) < -4.0000000000000002e-250

    1. Initial program 88.6%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. frac-2neg88.6%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{-A}{-V \cdot \ell}}} \]
      2. sqrt-div99.5%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-A}}{\sqrt{-V \cdot \ell}}} \]
      3. distribute-rgt-neg-in99.5%

        \[\leadsto c0 \cdot \frac{\sqrt{-A}}{\sqrt{\color{blue}{V \cdot \left(-\ell\right)}}} \]
    4. Applied egg-rr99.5%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}} \]
    5. Step-by-step derivation
      1. distribute-rgt-neg-out99.5%

        \[\leadsto c0 \cdot \frac{\sqrt{-A}}{\sqrt{\color{blue}{-V \cdot \ell}}} \]
      2. *-commutative99.5%

        \[\leadsto c0 \cdot \frac{\sqrt{-A}}{\sqrt{-\color{blue}{\ell \cdot V}}} \]
      3. distribute-rgt-neg-in99.5%

        \[\leadsto c0 \cdot \frac{\sqrt{-A}}{\sqrt{\color{blue}{\ell \cdot \left(-V\right)}}} \]
    6. Simplified99.5%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}} \]

    if -4.0000000000000002e-250 < (*.f64 V l) < 4.9999937e-319

    1. Initial program 40.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num40.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}} \]
      2. associate-/r/38.3%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
      3. associate-/r*38.3%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell}} \cdot A} \]
    4. Applied egg-rr38.3%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell} \cdot A}} \]
    5. Step-by-step derivation
      1. associate-*l/63.8%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V} \cdot A}{\ell}}} \]
      2. sqrt-div27.2%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{1}{V} \cdot A}}{\sqrt{\ell}}} \]
      3. associate-*l/27.2%

        \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{1 \cdot A}{V}}}}{\sqrt{\ell}} \]
      4. *-un-lft-identity27.2%

        \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A}}{V}}}{\sqrt{\ell}} \]
      5. clear-num27.2%

        \[\leadsto c0 \cdot \color{blue}{\frac{1}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      6. un-div-inv27.1%

        \[\leadsto \color{blue}{\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      7. sqrt-undiv65.1%

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{\ell}{\frac{A}{V}}}}} \]
      8. div-inv65.1%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\ell \cdot \frac{1}{\frac{A}{V}}}}} \]
      9. clear-num65.1%

        \[\leadsto \frac{c0}{\sqrt{\ell \cdot \color{blue}{\frac{V}{A}}}} \]
    6. Applied egg-rr65.1%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}} \]
    7. Step-by-step derivation
      1. *-commutative65.1%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V}{A} \cdot \ell}}} \]
      2. associate-*l/40.0%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}} \]
      3. associate-*r/65.2%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
    8. Simplified65.2%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}} \]

    if 4.9999937e-319 < (*.f64 V l) < 9.99999999999999988e254

    1. Initial program 87.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-div99.4%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
      2. div-inv99.4%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    4. Applied egg-rr99.4%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/99.4%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A} \cdot 1}{\sqrt{V \cdot \ell}}} \]
      2. *-rgt-identity99.4%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{A}}}{\sqrt{V \cdot \ell}} \]
    6. Simplified99.4%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]

    if 9.99999999999999988e254 < (*.f64 V l)

    1. Initial program 25.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num25.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}} \]
      2. associate-/r/25.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
      3. associate-/r*28.6%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell}} \cdot A} \]
    4. Applied egg-rr28.6%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell} \cdot A}} \]
    5. Step-by-step derivation
      1. associate-*l/45.1%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V} \cdot A}{\ell}}} \]
      2. sqrt-div50.1%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{1}{V} \cdot A}}{\sqrt{\ell}}} \]
      3. associate-*l/50.0%

        \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{1 \cdot A}{V}}}}{\sqrt{\ell}} \]
      4. *-un-lft-identity50.0%

        \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A}}{V}}}{\sqrt{\ell}} \]
      5. clear-num50.1%

        \[\leadsto c0 \cdot \color{blue}{\frac{1}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      6. un-div-inv50.0%

        \[\leadsto \color{blue}{\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      7. sqrt-undiv40.3%

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{\ell}{\frac{A}{V}}}}} \]
      8. div-inv40.3%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\ell \cdot \frac{1}{\frac{A}{V}}}}} \]
      9. clear-num40.3%

        \[\leadsto \frac{c0}{\sqrt{\ell \cdot \color{blue}{\frac{V}{A}}}} \]
    6. Applied egg-rr40.3%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}} \]
    7. Step-by-step derivation
      1. *-commutative40.3%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V}{A} \cdot \ell}}} \]
      2. associate-*l/25.0%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}} \]
      3. associate-*r/40.3%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
    8. Simplified40.3%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity40.3%

        \[\leadsto \frac{\color{blue}{1 \cdot c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      2. sqrt-prod50.2%

        \[\leadsto \frac{1 \cdot c0}{\color{blue}{\sqrt{V} \cdot \sqrt{\frac{\ell}{A}}}} \]
      3. times-frac50.0%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{V}} \cdot \frac{c0}{\sqrt{\frac{\ell}{A}}}} \]
    10. Applied egg-rr50.0%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{V}} \cdot \frac{c0}{\sqrt{\frac{\ell}{A}}}} \]
    11. Step-by-step derivation
      1. associate-*r/50.2%

        \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{V}} \cdot c0}{\sqrt{\frac{\ell}{A}}}} \]
      2. associate-*l/50.1%

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot c0}{\sqrt{V}}}}{\sqrt{\frac{\ell}{A}}} \]
      3. *-lft-identity50.1%

        \[\leadsto \frac{\frac{\color{blue}{c0}}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}} \]
    12. Simplified50.1%

      \[\leadsto \color{blue}{\frac{\frac{c0}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification86.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-250}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c0}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 88.6% accurate, 0.5× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-295}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c0\_m}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\ \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (*
  c0_s
  (if (<= (* V l) (- INFINITY))
    (* (/ c0_m (sqrt l)) (sqrt (/ A V)))
    (if (<= (* V l) -1e-295)
      (* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
      (if (<= (* V l) 5e-319)
        (* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
        (if (<= (* V l) 1e+255)
          (* c0_m (/ (sqrt A) (sqrt (* V l))))
          (/ (/ c0_m (sqrt V)) (sqrt (/ l A)))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = (c0_m / sqrt(l)) * sqrt((A / V));
	} else if ((V * l) <= -1e-295) {
		tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
	} else if ((V * l) <= 5e-319) {
		tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
	} else if ((V * l) <= 1e+255) {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = (c0_m / sqrt(V)) / sqrt((l / A));
	}
	return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -Double.POSITIVE_INFINITY) {
		tmp = (c0_m / Math.sqrt(l)) * Math.sqrt((A / V));
	} else if ((V * l) <= -1e-295) {
		tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if ((V * l) <= 5e-319) {
		tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
	} else if ((V * l) <= 1e+255) {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = (c0_m / Math.sqrt(V)) / Math.sqrt((l / A));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	tmp = 0
	if (V * l) <= -math.inf:
		tmp = (c0_m / math.sqrt(l)) * math.sqrt((A / V))
	elif (V * l) <= -1e-295:
		tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l)))
	elif (V * l) <= 5e-319:
		tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V))
	elif (V * l) <= 1e+255:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = (c0_m / math.sqrt(V)) / math.sqrt((l / A))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= Float64(-Inf))
		tmp = Float64(Float64(c0_m / sqrt(l)) * sqrt(Float64(A / V)));
	elseif (Float64(V * l) <= -1e-295)
		tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif (Float64(V * l) <= 5e-319)
		tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V))));
	elseif (Float64(V * l) <= 1e+255)
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(Float64(c0_m / sqrt(V)) / sqrt(Float64(l / A)));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -Inf)
		tmp = (c0_m / sqrt(l)) * sqrt((A / V));
	elseif ((V * l) <= -1e-295)
		tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
	elseif ((V * l) <= 5e-319)
		tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
	elseif ((V * l) <= 1e+255)
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	else
		tmp = (c0_m / sqrt(V)) / sqrt((l / A));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0$95$m / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-295], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-319], N[(c0$95$m * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+255], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0$95$m / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0\_m}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\

\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-295}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\

\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\

\mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{c0\_m}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 V l) < -inf.0

    1. Initial program 25.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt25.7%

        \[\leadsto \color{blue}{\sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}} \cdot \sqrt{c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}}} \]
      2. sqrt-unprod25.7%

        \[\leadsto \color{blue}{\sqrt{\left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)}} \]
      3. *-commutative25.7%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)} \cdot \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)} \]
      4. *-commutative25.7%

        \[\leadsto \sqrt{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right) \cdot \color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot c0\right)}} \]
      5. swap-sqr24.8%

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot c0\right)}} \]
      6. add-sqr-sqrt24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{A}{V \cdot \ell}} \cdot \left(c0 \cdot c0\right)} \]
      7. pow224.8%

        \[\leadsto \sqrt{\frac{A}{V \cdot \ell} \cdot \color{blue}{{c0}^{2}}} \]
    4. Applied egg-rr24.8%

      \[\leadsto \color{blue}{\sqrt{\frac{A}{V \cdot \ell} \cdot {c0}^{2}}} \]
    5. Step-by-step derivation
      1. associate-/r*24.7%

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}} \cdot {c0}^{2}} \]
    6. Simplified24.7%

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell} \cdot {c0}^{2}}} \]
    7. Step-by-step derivation
      1. sqrt-prod31.4%

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell}} \cdot \sqrt{{c0}^{2}}} \]
      2. sqrt-undiv7.3%

        \[\leadsto \color{blue}{\frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}} \cdot \sqrt{{c0}^{2}} \]
      3. sqrt-undiv31.4%

        \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell}}} \cdot \sqrt{{c0}^{2}} \]
      4. associate-/l/24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{A}{\ell \cdot V}}} \cdot \sqrt{{c0}^{2}} \]
      5. frac-2neg24.8%

        \[\leadsto \sqrt{\color{blue}{\frac{-A}{-\ell \cdot V}}} \cdot \sqrt{{c0}^{2}} \]
      6. distribute-rgt-neg-out24.8%

        \[\leadsto \sqrt{\frac{-A}{\color{blue}{\ell \cdot \left(-V\right)}}} \cdot \sqrt{{c0}^{2}} \]
      7. sqrt-undiv24.8%

        \[\leadsto \color{blue}{\frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}} \cdot \sqrt{{c0}^{2}} \]
      8. sqrt-pow125.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot \color{blue}{{c0}^{\left(\frac{2}{2}\right)}} \]
      9. metadata-eval25.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot {c0}^{\color{blue}{1}} \]
      10. pow125.7%

        \[\leadsto \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}} \cdot \color{blue}{c0} \]
      11. associate-*l/25.7%

        \[\leadsto \color{blue}{\frac{\sqrt{-A} \cdot c0}{\sqrt{\ell \cdot \left(-V\right)}}} \]
      12. *-commutative25.7%

        \[\leadsto \frac{\color{blue}{c0 \cdot \sqrt{-A}}}{\sqrt{\ell \cdot \left(-V\right)}} \]
      13. sqrt-prod21.2%

        \[\leadsto \frac{c0 \cdot \sqrt{-A}}{\color{blue}{\sqrt{\ell} \cdot \sqrt{-V}}} \]
      14. times-frac21.3%

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \frac{\sqrt{-A}}{\sqrt{-V}}} \]
      15. sqrt-div14.8%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \color{blue}{\sqrt{\frac{-A}{-V}}} \]
      16. frac-2neg14.8%

        \[\leadsto \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\color{blue}{\frac{A}{V}}} \]
    8. Applied egg-rr14.8%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}} \]

    if -inf.0 < (*.f64 V l) < -1.00000000000000006e-295

    1. Initial program 89.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. frac-2neg89.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{-A}{-V \cdot \ell}}} \]
      2. sqrt-div99.4%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-A}}{\sqrt{-V \cdot \ell}}} \]
      3. distribute-rgt-neg-in99.4%

        \[\leadsto c0 \cdot \frac{\sqrt{-A}}{\sqrt{\color{blue}{V \cdot \left(-\ell\right)}}} \]
    4. Applied egg-rr99.4%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}} \]
    5. Step-by-step derivation
      1. distribute-rgt-neg-out99.4%

        \[\leadsto c0 \cdot \frac{\sqrt{-A}}{\sqrt{\color{blue}{-V \cdot \ell}}} \]
      2. *-commutative99.4%

        \[\leadsto c0 \cdot \frac{\sqrt{-A}}{\sqrt{-\color{blue}{\ell \cdot V}}} \]
      3. distribute-rgt-neg-in99.4%

        \[\leadsto c0 \cdot \frac{\sqrt{-A}}{\sqrt{\color{blue}{\ell \cdot \left(-V\right)}}} \]
    6. Simplified99.4%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}} \]

    if -1.00000000000000006e-295 < (*.f64 V l) < 4.9999937e-319

    1. Initial program 32.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num32.7%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}} \]
      2. associate-/r/30.9%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
      3. associate-/r*30.9%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell}} \cdot A} \]
    4. Applied egg-rr30.9%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell} \cdot A}} \]
    5. Step-by-step derivation
      1. associate-*l/59.5%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V} \cdot A}{\ell}}} \]
      2. associate-*r/59.4%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V} \cdot \frac{A}{\ell}}} \]
      3. associate-*l/59.5%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1 \cdot \frac{A}{\ell}}{V}}} \]
      4. *-un-lft-identity59.5%

        \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{A}{\ell}}}{V}} \]
    6. Applied egg-rr59.5%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{\ell}}{V}}} \]
    7. Step-by-step derivation
      1. frac-2neg59.5%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{-\frac{A}{\ell}}{-V}}} \]
      2. sqrt-div42.5%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-\frac{A}{\ell}}}{\sqrt{-V}}} \]
      3. distribute-neg-frac242.5%

        \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{A}{-\ell}}}}{\sqrt{-V}} \]
    8. Applied egg-rr42.5%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}} \]

    if 4.9999937e-319 < (*.f64 V l) < 9.99999999999999988e254

    1. Initial program 87.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-div99.4%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
      2. div-inv99.4%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    4. Applied egg-rr99.4%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/99.4%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A} \cdot 1}{\sqrt{V \cdot \ell}}} \]
      2. *-rgt-identity99.4%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{A}}}{\sqrt{V \cdot \ell}} \]
    6. Simplified99.4%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]

    if 9.99999999999999988e254 < (*.f64 V l)

    1. Initial program 25.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num25.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}} \]
      2. associate-/r/25.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
      3. associate-/r*28.6%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell}} \cdot A} \]
    4. Applied egg-rr28.6%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell} \cdot A}} \]
    5. Step-by-step derivation
      1. associate-*l/45.1%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V} \cdot A}{\ell}}} \]
      2. sqrt-div50.1%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{1}{V} \cdot A}}{\sqrt{\ell}}} \]
      3. associate-*l/50.0%

        \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{1 \cdot A}{V}}}}{\sqrt{\ell}} \]
      4. *-un-lft-identity50.0%

        \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A}}{V}}}{\sqrt{\ell}} \]
      5. clear-num50.1%

        \[\leadsto c0 \cdot \color{blue}{\frac{1}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      6. un-div-inv50.0%

        \[\leadsto \color{blue}{\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      7. sqrt-undiv40.3%

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{\ell}{\frac{A}{V}}}}} \]
      8. div-inv40.3%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\ell \cdot \frac{1}{\frac{A}{V}}}}} \]
      9. clear-num40.3%

        \[\leadsto \frac{c0}{\sqrt{\ell \cdot \color{blue}{\frac{V}{A}}}} \]
    6. Applied egg-rr40.3%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}} \]
    7. Step-by-step derivation
      1. *-commutative40.3%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V}{A} \cdot \ell}}} \]
      2. associate-*l/25.0%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}} \]
      3. associate-*r/40.3%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
    8. Simplified40.3%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    9. Step-by-step derivation
      1. *-un-lft-identity40.3%

        \[\leadsto \frac{\color{blue}{1 \cdot c0}}{\sqrt{V \cdot \frac{\ell}{A}}} \]
      2. sqrt-prod50.2%

        \[\leadsto \frac{1 \cdot c0}{\color{blue}{\sqrt{V} \cdot \sqrt{\frac{\ell}{A}}}} \]
      3. times-frac50.0%

        \[\leadsto \color{blue}{\frac{1}{\sqrt{V}} \cdot \frac{c0}{\sqrt{\frac{\ell}{A}}}} \]
    10. Applied egg-rr50.0%

      \[\leadsto \color{blue}{\frac{1}{\sqrt{V}} \cdot \frac{c0}{\sqrt{\frac{\ell}{A}}}} \]
    11. Step-by-step derivation
      1. associate-*r/50.2%

        \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{V}} \cdot c0}{\sqrt{\frac{\ell}{A}}}} \]
      2. associate-*l/50.1%

        \[\leadsto \frac{\color{blue}{\frac{1 \cdot c0}{\sqrt{V}}}}{\sqrt{\frac{\ell}{A}}} \]
      3. *-lft-identity50.1%

        \[\leadsto \frac{\frac{\color{blue}{c0}}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}} \]
    12. Simplified50.1%

      \[\leadsto \color{blue}{\frac{\frac{c0}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification84.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-295}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{c0}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 81.5% accurate, 0.5× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{-179}:\\ \;\;\;\;c0\_m \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\ \;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (*
  c0_s
  (if (<= (* V l) -2e-179)
    (* c0_m (sqrt (* A (/ (/ 1.0 V) l))))
    (if (<= (* V l) 5e-319)
      (/ c0_m (sqrt (* V (/ l A))))
      (* c0_m (/ (sqrt A) (sqrt (* V l))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -2e-179) {
		tmp = c0_m * sqrt((A * ((1.0 / V) / l)));
	} else if ((V * l) <= 5e-319) {
		tmp = c0_m / sqrt((V * (l / A)));
	} else {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: tmp
    if ((v * l) <= (-2d-179)) then
        tmp = c0_m * sqrt((a * ((1.0d0 / v) / l)))
    else if ((v * l) <= 5d-319) then
        tmp = c0_m / sqrt((v * (l / a)))
    else
        tmp = c0_m * (sqrt(a) / sqrt((v * l)))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -2e-179) {
		tmp = c0_m * Math.sqrt((A * ((1.0 / V) / l)));
	} else if ((V * l) <= 5e-319) {
		tmp = c0_m / Math.sqrt((V * (l / A)));
	} else {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	tmp = 0
	if (V * l) <= -2e-179:
		tmp = c0_m * math.sqrt((A * ((1.0 / V) / l)))
	elif (V * l) <= 5e-319:
		tmp = c0_m / math.sqrt((V * (l / A)))
	else:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= -2e-179)
		tmp = Float64(c0_m * sqrt(Float64(A * Float64(Float64(1.0 / V) / l))));
	elseif (Float64(V * l) <= 5e-319)
		tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / A))));
	else
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -2e-179)
		tmp = c0_m * sqrt((A * ((1.0 / V) / l)));
	elseif ((V * l) <= 5e-319)
		tmp = c0_m / sqrt((V * (l / A)));
	else
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], -2e-179], N[(c0$95$m * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-319], N[(c0$95$m / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{-179}:\\
\;\;\;\;c0\_m \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\

\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{A}}}\\

\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 V l) < -2e-179

    1. Initial program 83.5%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num83.4%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}} \]
      2. associate-/r/83.4%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
      3. associate-/r*85.0%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell}} \cdot A} \]
    4. Applied egg-rr85.0%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell} \cdot A}} \]

    if -2e-179 < (*.f64 V l) < 4.9999937e-319

    1. Initial program 45.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-num45.3%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{\frac{V \cdot \ell}{A}}}} \]
      2. associate-/r/44.1%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{1}{V \cdot \ell} \cdot A}} \]
      3. associate-/r*44.1%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell}} \cdot A} \]
    4. Applied egg-rr44.1%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\ell} \cdot A}} \]
    5. Step-by-step derivation
      1. associate-*l/62.6%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V} \cdot A}{\ell}}} \]
      2. sqrt-div27.6%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{\frac{1}{V} \cdot A}}{\sqrt{\ell}}} \]
      3. associate-*l/27.6%

        \[\leadsto c0 \cdot \frac{\sqrt{\color{blue}{\frac{1 \cdot A}{V}}}}{\sqrt{\ell}} \]
      4. *-un-lft-identity27.6%

        \[\leadsto c0 \cdot \frac{\sqrt{\frac{\color{blue}{A}}{V}}}{\sqrt{\ell}} \]
      5. clear-num27.6%

        \[\leadsto c0 \cdot \color{blue}{\frac{1}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      6. un-div-inv27.6%

        \[\leadsto \color{blue}{\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      7. sqrt-undiv63.6%

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{\ell}{\frac{A}{V}}}}} \]
      8. div-inv63.6%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\ell \cdot \frac{1}{\frac{A}{V}}}}} \]
      9. clear-num63.6%

        \[\leadsto \frac{c0}{\sqrt{\ell \cdot \color{blue}{\frac{V}{A}}}} \]
    6. Applied egg-rr63.6%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}} \]
    7. Step-by-step derivation
      1. *-commutative63.6%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V}{A} \cdot \ell}}} \]
      2. associate-*l/45.4%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}} \]
      3. associate-*r/61.8%

        \[\leadsto \frac{c0}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}} \]
    8. Simplified61.8%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}} \]

    if 4.9999937e-319 < (*.f64 V l)

    1. Initial program 78.5%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-div88.8%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
      2. div-inv88.7%

        \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    4. Applied egg-rr88.7%

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot \frac{1}{\sqrt{V \cdot \ell}}\right)} \]
    5. Step-by-step derivation
      1. associate-*r/88.8%

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A} \cdot 1}{\sqrt{V \cdot \ell}}} \]
      2. *-rgt-identity88.8%

        \[\leadsto c0 \cdot \frac{\color{blue}{\sqrt{A}}}{\sqrt{V \cdot \ell}} \]
    6. Simplified88.8%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{-179}:\\ \;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-319}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 80.5% accurate, 0.9× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+306}\right):\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0\_m \cdot \sqrt{t\_0}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (*
    c0_s
    (if (or (<= t_0 0.0) (not (<= t_0 5e+306)))
      (* c0_m (sqrt (/ (/ A V) l)))
      (* c0_m (sqrt t_0))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 5e+306)) {
		tmp = c0_m * sqrt(((A / V) / l));
	} else {
		tmp = c0_m * sqrt(t_0);
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+306))) then
        tmp = c0_m * sqrt(((a / v) / l))
    else
        tmp = c0_m * sqrt(t_0)
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 5e+306)) {
		tmp = c0_m * Math.sqrt(((A / V) / l));
	} else {
		tmp = c0_m * Math.sqrt(t_0);
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if (t_0 <= 0.0) or not (t_0 <= 5e+306):
		tmp = c0_m * math.sqrt(((A / V) / l))
	else:
		tmp = c0_m * math.sqrt(t_0)
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if ((t_0 <= 0.0) || !(t_0 <= 5e+306))
		tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l)));
	else
		tmp = Float64(c0_m * sqrt(t_0));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if ((t_0 <= 0.0) || ~((t_0 <= 5e+306)))
		tmp = c0_m * sqrt(((A / V) / l));
	else
		tmp = c0_m * sqrt(t_0);
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+306]], $MachinePrecision]], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+306}\right):\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;c0\_m \cdot \sqrt{t\_0}\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 A (*.f64 V l)) < 0.0 or 4.99999999999999993e306 < (/.f64 A (*.f64 V l))

    1. Initial program 29.8%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. associate-/r*44.5%

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
    3. Simplified44.5%

      \[\leadsto \color{blue}{c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}} \]
    4. Add Preprocessing

    if 0.0 < (/.f64 A (*.f64 V l)) < 4.99999999999999993e306

    1. Initial program 98.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification79.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{A}{V \cdot \ell} \leq 0 \lor \neg \left(\frac{A}{V \cdot \ell} \leq 5 \cdot 10^{+306}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 73.5% accurate, 1.0× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ c0\_s \cdot \left(c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (* c0_s (* c0_m (sqrt (/ A (* V l))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	return c0_s * (c0_m * sqrt((A / (V * l))));
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    code = c0_s * (c0_m * sqrt((a / (v * l))))
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	return c0_s * (c0_m * Math.sqrt((A / (V * l))));
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	return c0_s * (c0_m * math.sqrt((A / (V * l))))
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	return Float64(c0_s * Float64(c0_m * sqrt(Float64(A / Float64(V * l)))))
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp = code(c0_s, c0_m, A, V, l)
	tmp = c0_s * (c0_m * sqrt((A / (V * l))));
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \left(c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)
\end{array}
Derivation
  1. Initial program 73.7%

    \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
  2. Add Preprocessing
  3. Final simplification73.7%

    \[\leadsto c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
  4. Add Preprocessing

Reproduce

?
herbie shell --seed 2024072 
(FPCore (c0 A V l)
  :name "Henrywood and Agarwal, Equation (3)"
  :precision binary64
  (* c0 (sqrt (/ A (* V l)))))