Henrywood and Agarwal, Equation (3)

Percentage Accurate: 73.1% → 89.7%
Time: 11.0s
Alternatives: 17
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 17 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.1% 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: 89.7% accurate, 0.3× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{-230}:\\ \;\;\;\;c0 \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\ \;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{A} \cdot \frac{\frac{c0}{\sqrt{V}}}{\sqrt{\ell}}\\ \end{array} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (if (<= (* V l) -1e-230)
   (* c0 (/ (/ (sqrt (- A)) (sqrt (- V))) (sqrt l)))
   (if (<= (* V l) 5e-323)
     (/ c0 (sqrt (/ V (/ A l))))
     (if (<= (* V l) 1e+290)
       (* c0 (* (sqrt A) (pow (* V l) -0.5)))
       (* (sqrt A) (/ (/ c0 (sqrt V)) (sqrt l)))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e-230) {
		tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
	} else if ((V * l) <= 5e-323) {
		tmp = c0 / sqrt((V / (A / l)));
	} else if ((V * l) <= 1e+290) {
		tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
	} else {
		tmp = sqrt(A) * ((c0 / sqrt(V)) / sqrt(l));
	}
	return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
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
    real(8) :: tmp
    if ((v * l) <= (-1d-230)) then
        tmp = c0 * ((sqrt(-a) / sqrt(-v)) / sqrt(l))
    else if ((v * l) <= 5d-323) then
        tmp = c0 / sqrt((v / (a / l)))
    else if ((v * l) <= 1d+290) then
        tmp = c0 * (sqrt(a) * ((v * l) ** (-0.5d0)))
    else
        tmp = sqrt(a) * ((c0 / sqrt(v)) / sqrt(l))
    end if
    code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e-230) {
		tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) / Math.sqrt(l));
	} else if ((V * l) <= 5e-323) {
		tmp = c0 / Math.sqrt((V / (A / l)));
	} else if ((V * l) <= 1e+290) {
		tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
	} else {
		tmp = Math.sqrt(A) * ((c0 / Math.sqrt(V)) / Math.sqrt(l));
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	tmp = 0
	if (V * l) <= -1e-230:
		tmp = c0 * ((math.sqrt(-A) / math.sqrt(-V)) / math.sqrt(l))
	elif (V * l) <= 5e-323:
		tmp = c0 / math.sqrt((V / (A / l)))
	elif (V * l) <= 1e+290:
		tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5))
	else:
		tmp = math.sqrt(A) * ((c0 / math.sqrt(V)) / math.sqrt(l))
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= -1e-230)
		tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / sqrt(l)));
	elseif (Float64(V * l) <= 5e-323)
		tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l))));
	elseif (Float64(V * l) <= 1e+290)
		tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5)));
	else
		tmp = Float64(sqrt(A) * Float64(Float64(c0 / sqrt(V)) / sqrt(l)));
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -1e-230)
		tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
	elseif ((V * l) <= 5e-323)
		tmp = c0 / sqrt((V / (A / l)));
	elseif ((V * l) <= 1e+290)
		tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
	else
		tmp = sqrt(A) * ((c0 / sqrt(V)) / sqrt(l));
	end
	tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e-230], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-323], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+290], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[A], $MachinePrecision] * N[(N[(c0 / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{-230}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\

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

\mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\

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


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

    1. Initial program 82.8%

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

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

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

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

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

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

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

    if -1.00000000000000005e-230 < (*.f64 V l) < 4.94066e-323

    1. Initial program 44.6%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity44.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.94066e-323 < (*.f64 V l) < 1.00000000000000006e290

    1. Initial program 88.6%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. div-inv88.6%

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

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

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

        \[\leadsto c0 \cdot \left(\sqrt{A} \cdot {\color{blue}{\left({\left(V \cdot \ell\right)}^{-1}\right)}}^{0.5}\right) \]
      5. pow-pow98.3%

        \[\leadsto c0 \cdot \left(\sqrt{A} \cdot \color{blue}{{\left(V \cdot \ell\right)}^{\left(-1 \cdot 0.5\right)}}\right) \]
      6. metadata-eval98.3%

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

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

    if 1.00000000000000006e290 < (*.f64 V l)

    1. Initial program 5.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. sqrt-div11.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{-230}:\\ \;\;\;\;c0 \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\ \;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{A} \cdot \frac{\frac{c0}{\sqrt{V}}}{\sqrt{\ell}}\\ \end{array} \]

Alternative 2: 86.9% accurate, 0.3× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} \mathbf{if}\;V \leq -5 \cdot 10^{-310}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\frac{\sqrt{A}}{\sqrt{V}}}{\sqrt{\ell}}\\ \end{array} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (if (<= V -5e-310)
   (* c0 (/ (sqrt (/ (- A) l)) (sqrt (- V))))
   (* c0 (/ (/ (sqrt A) (sqrt V)) (sqrt l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if (V <= -5e-310) {
		tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
	} else {
		tmp = c0 * ((sqrt(A) / sqrt(V)) / sqrt(l));
	}
	return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
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
    real(8) :: tmp
    if (v <= (-5d-310)) then
        tmp = c0 * (sqrt((-a / l)) / sqrt(-v))
    else
        tmp = c0 * ((sqrt(a) / sqrt(v)) / sqrt(l))
    end if
    code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if (V <= -5e-310) {
		tmp = c0 * (Math.sqrt((-A / l)) / Math.sqrt(-V));
	} else {
		tmp = c0 * ((Math.sqrt(A) / Math.sqrt(V)) / Math.sqrt(l));
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	tmp = 0
	if V <= -5e-310:
		tmp = c0 * (math.sqrt((-A / l)) / math.sqrt(-V))
	else:
		tmp = c0 * ((math.sqrt(A) / math.sqrt(V)) / math.sqrt(l))
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (V <= -5e-310)
		tmp = Float64(c0 * Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V))));
	else
		tmp = Float64(c0 * Float64(Float64(sqrt(A) / sqrt(V)) / sqrt(l)));
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	tmp = 0.0;
	if (V <= -5e-310)
		tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
	else
		tmp = c0 * ((sqrt(A) / sqrt(V)) / sqrt(l));
	end
	tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := If[LessEqual[V, -5e-310], N[(c0 * N[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if V < -4.999999999999985e-310

    1. Initial program 75.8%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. pow1/275.8%

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{A}{V \cdot \ell}\right)}^{0.5}} \]
      2. clear-num75.2%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}}^{0.5} \]
      3. inv-pow75.2%

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

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{\left(-1 \cdot 0.5\right)}} \]
      5. associate-/l*78.2%

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

        \[\leadsto c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{\color{blue}{-0.5}} \]
    3. Applied egg-rr78.2%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    4. Step-by-step derivation
      1. associate-/l*75.2%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V \cdot \ell}{A}\right)}}^{-0.5} \]
      2. *-lft-identity75.2%

        \[\leadsto c0 \cdot {\left(\frac{V \cdot \ell}{\color{blue}{1 \cdot A}}\right)}^{-0.5} \]
      3. times-frac79.1%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V}{1} \cdot \frac{\ell}{A}\right)}}^{-0.5} \]
      4. /-rgt-identity79.1%

        \[\leadsto c0 \cdot {\left(\color{blue}{V} \cdot \frac{\ell}{A}\right)}^{-0.5} \]
    5. Simplified79.1%

      \[\leadsto c0 \cdot \color{blue}{{\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}} \]
    6. Taylor expanded in c0 around 0 75.8%

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < V

    1. Initial program 73.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \leq -5 \cdot 10^{-310}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\frac{\sqrt{A}}{\sqrt{V}}}{\sqrt{\ell}}\\ \end{array} \]

Alternative 3: 85.2% accurate, 0.5× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := \frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+139}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-223}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\ \;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ (* c0 (sqrt (/ A V))) (sqrt l))))
   (if (<= (* V l) -4e+139)
     t_0
     (if (<= (* V l) -5e-223)
       (/ c0 (sqrt (/ (* V l) A)))
       (if (<= (* V l) 5e-323)
         (/ c0 (sqrt (/ V (/ A l))))
         (if (<= (* V l) 1e+290)
           (* c0 (* (sqrt A) (pow (* V l) -0.5)))
           t_0))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = (c0 * sqrt((A / V))) / sqrt(l);
	double tmp;
	if ((V * l) <= -4e+139) {
		tmp = t_0;
	} else if ((V * l) <= -5e-223) {
		tmp = c0 / sqrt(((V * l) / A));
	} else if ((V * l) <= 5e-323) {
		tmp = c0 / sqrt((V / (A / l)));
	} else if ((V * l) <= 1e+290) {
		tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
	} else {
		tmp = t_0;
	}
	return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
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
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (c0 * sqrt((a / v))) / sqrt(l)
    if ((v * l) <= (-4d+139)) then
        tmp = t_0
    else if ((v * l) <= (-5d-223)) then
        tmp = c0 / sqrt(((v * l) / a))
    else if ((v * l) <= 5d-323) then
        tmp = c0 / sqrt((v / (a / l)))
    else if ((v * l) <= 1d+290) then
        tmp = c0 * (sqrt(a) * ((v * l) ** (-0.5d0)))
    else
        tmp = t_0
    end if
    code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = (c0 * Math.sqrt((A / V))) / Math.sqrt(l);
	double tmp;
	if ((V * l) <= -4e+139) {
		tmp = t_0;
	} else if ((V * l) <= -5e-223) {
		tmp = c0 / Math.sqrt(((V * l) / A));
	} else if ((V * l) <= 5e-323) {
		tmp = c0 / Math.sqrt((V / (A / l)));
	} else if ((V * l) <= 1e+290) {
		tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
	} else {
		tmp = t_0;
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	t_0 = (c0 * math.sqrt((A / V))) / math.sqrt(l)
	tmp = 0
	if (V * l) <= -4e+139:
		tmp = t_0
	elif (V * l) <= -5e-223:
		tmp = c0 / math.sqrt(((V * l) / A))
	elif (V * l) <= 5e-323:
		tmp = c0 / math.sqrt((V / (A / l)))
	elif (V * l) <= 1e+290:
		tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5))
	else:
		tmp = t_0
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	t_0 = Float64(Float64(c0 * sqrt(Float64(A / V))) / sqrt(l))
	tmp = 0.0
	if (Float64(V * l) <= -4e+139)
		tmp = t_0;
	elseif (Float64(V * l) <= -5e-223)
		tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A)));
	elseif (Float64(V * l) <= 5e-323)
		tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l))));
	elseif (Float64(V * l) <= 1e+290)
		tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5)));
	else
		tmp = t_0;
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = (c0 * sqrt((A / V))) / sqrt(l);
	tmp = 0.0;
	if ((V * l) <= -4e+139)
		tmp = t_0;
	elseif ((V * l) <= -5e-223)
		tmp = c0 / sqrt(((V * l) / A));
	elseif ((V * l) <= 5e-323)
		tmp = c0 / sqrt((V / (A / l)));
	elseif ((V * l) <= 1e+290)
		tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -4e+139], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-223], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-323], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+290], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+139}:\\
\;\;\;\;t_0\\

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

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

\mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\

\mathbf{else}:\\
\;\;\;\;t_0\\


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

    1. Initial program 41.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity41.2%

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

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

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

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

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

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

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

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

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

    if -4.00000000000000013e139 < (*.f64 V l) < -5.00000000000000024e-223

    1. Initial program 96.5%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    6. Taylor expanded in V around 0 96.6%

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

    if -5.00000000000000024e-223 < (*.f64 V l) < 4.94066e-323

    1. Initial program 45.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity45.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.94066e-323 < (*.f64 V l) < 1.00000000000000006e290

    1. Initial program 88.6%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. div-inv88.6%

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

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

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

        \[\leadsto c0 \cdot \left(\sqrt{A} \cdot {\color{blue}{\left({\left(V \cdot \ell\right)}^{-1}\right)}}^{0.5}\right) \]
      5. pow-pow98.3%

        \[\leadsto c0 \cdot \left(\sqrt{A} \cdot \color{blue}{{\left(V \cdot \ell\right)}^{\left(-1 \cdot 0.5\right)}}\right) \]
      6. metadata-eval98.3%

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

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification84.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+139}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-223}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\ \;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \end{array} \]

Alternative 4: 88.5% accurate, 0.5× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := \frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+262}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-230}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\ \;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ (* c0 (sqrt (/ A V))) (sqrt l))))
   (if (<= (* V l) -2e+262)
     t_0
     (if (<= (* V l) -1e-230)
       (* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
       (if (<= (* V l) 5e-323)
         (/ c0 (sqrt (/ V (/ A l))))
         (if (<= (* V l) 1e+290)
           (* c0 (* (sqrt A) (pow (* V l) -0.5)))
           t_0))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = (c0 * sqrt((A / V))) / sqrt(l);
	double tmp;
	if ((V * l) <= -2e+262) {
		tmp = t_0;
	} else if ((V * l) <= -1e-230) {
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	} else if ((V * l) <= 5e-323) {
		tmp = c0 / sqrt((V / (A / l)));
	} else if ((V * l) <= 1e+290) {
		tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
	} else {
		tmp = t_0;
	}
	return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
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
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (c0 * sqrt((a / v))) / sqrt(l)
    if ((v * l) <= (-2d+262)) then
        tmp = t_0
    else if ((v * l) <= (-1d-230)) then
        tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
    else if ((v * l) <= 5d-323) then
        tmp = c0 / sqrt((v / (a / l)))
    else if ((v * l) <= 1d+290) then
        tmp = c0 * (sqrt(a) * ((v * l) ** (-0.5d0)))
    else
        tmp = t_0
    end if
    code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = (c0 * Math.sqrt((A / V))) / Math.sqrt(l);
	double tmp;
	if ((V * l) <= -2e+262) {
		tmp = t_0;
	} else if ((V * l) <= -1e-230) {
		tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if ((V * l) <= 5e-323) {
		tmp = c0 / Math.sqrt((V / (A / l)));
	} else if ((V * l) <= 1e+290) {
		tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
	} else {
		tmp = t_0;
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	t_0 = (c0 * math.sqrt((A / V))) / math.sqrt(l)
	tmp = 0
	if (V * l) <= -2e+262:
		tmp = t_0
	elif (V * l) <= -1e-230:
		tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l)))
	elif (V * l) <= 5e-323:
		tmp = c0 / math.sqrt((V / (A / l)))
	elif (V * l) <= 1e+290:
		tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5))
	else:
		tmp = t_0
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	t_0 = Float64(Float64(c0 * sqrt(Float64(A / V))) / sqrt(l))
	tmp = 0.0
	if (Float64(V * l) <= -2e+262)
		tmp = t_0;
	elseif (Float64(V * l) <= -1e-230)
		tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif (Float64(V * l) <= 5e-323)
		tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l))));
	elseif (Float64(V * l) <= 1e+290)
		tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5)));
	else
		tmp = t_0;
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = (c0 * sqrt((A / V))) / sqrt(l);
	tmp = 0.0;
	if ((V * l) <= -2e+262)
		tmp = t_0;
	elseif ((V * l) <= -1e-230)
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	elseif ((V * l) <= 5e-323)
		tmp = c0 / sqrt((V / (A / l)));
	elseif ((V * l) <= 1e+290)
		tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+262], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-230], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-323], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+290], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+262}:\\
\;\;\;\;t_0\\

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

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

\mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\

\mathbf{else}:\\
\;\;\;\;t_0\\


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

    1. Initial program 27.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity27.0%

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

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

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

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

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

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

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

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

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

    if -2e262 < (*.f64 V l) < -1.00000000000000005e-230

    1. Initial program 89.1%

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

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

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

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

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

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

    if -1.00000000000000005e-230 < (*.f64 V l) < 4.94066e-323

    1. Initial program 44.6%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity44.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.94066e-323 < (*.f64 V l) < 1.00000000000000006e290

    1. Initial program 88.6%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. div-inv88.6%

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

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

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

        \[\leadsto c0 \cdot \left(\sqrt{A} \cdot {\color{blue}{\left({\left(V \cdot \ell\right)}^{-1}\right)}}^{0.5}\right) \]
      5. pow-pow98.3%

        \[\leadsto c0 \cdot \left(\sqrt{A} \cdot \color{blue}{{\left(V \cdot \ell\right)}^{\left(-1 \cdot 0.5\right)}}\right) \]
      6. metadata-eval98.3%

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

      \[\leadsto c0 \cdot \color{blue}{\left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification89.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+262}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-230}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\ \;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \end{array} \]

Alternative 5: 85.6% accurate, 0.5× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+163}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-223}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
   (if (<= (* V l) -2e+163)
     t_0
     (if (<= (* V l) -5e-223)
       (/ c0 (sqrt (/ (* V l) A)))
       (if (<= (* V l) 5e-323)
         (/ c0 (sqrt (/ V (/ A l))))
         (if (<= (* V l) 1e+290) (/ c0 (/ (sqrt (* V l)) (sqrt A))) t_0))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = c0 * (sqrt((A / V)) / sqrt(l));
	double tmp;
	if ((V * l) <= -2e+163) {
		tmp = t_0;
	} else if ((V * l) <= -5e-223) {
		tmp = c0 / sqrt(((V * l) / A));
	} else if ((V * l) <= 5e-323) {
		tmp = c0 / sqrt((V / (A / l)));
	} else if ((V * l) <= 1e+290) {
		tmp = c0 / (sqrt((V * l)) / sqrt(A));
	} else {
		tmp = t_0;
	}
	return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
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
    real(8) :: t_0
    real(8) :: tmp
    t_0 = c0 * (sqrt((a / v)) / sqrt(l))
    if ((v * l) <= (-2d+163)) then
        tmp = t_0
    else if ((v * l) <= (-5d-223)) then
        tmp = c0 / sqrt(((v * l) / a))
    else if ((v * l) <= 5d-323) then
        tmp = c0 / sqrt((v / (a / l)))
    else if ((v * l) <= 1d+290) then
        tmp = c0 / (sqrt((v * l)) / sqrt(a))
    else
        tmp = t_0
    end if
    code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
	double tmp;
	if ((V * l) <= -2e+163) {
		tmp = t_0;
	} else if ((V * l) <= -5e-223) {
		tmp = c0 / Math.sqrt(((V * l) / A));
	} else if ((V * l) <= 5e-323) {
		tmp = c0 / Math.sqrt((V / (A / l)));
	} else if ((V * l) <= 1e+290) {
		tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
	} else {
		tmp = t_0;
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l))
	tmp = 0
	if (V * l) <= -2e+163:
		tmp = t_0
	elif (V * l) <= -5e-223:
		tmp = c0 / math.sqrt(((V * l) / A))
	elif (V * l) <= 5e-323:
		tmp = c0 / math.sqrt((V / (A / l)))
	elif (V * l) <= 1e+290:
		tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A))
	else:
		tmp = t_0
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	t_0 = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l)))
	tmp = 0.0
	if (Float64(V * l) <= -2e+163)
		tmp = t_0;
	elseif (Float64(V * l) <= -5e-223)
		tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A)));
	elseif (Float64(V * l) <= 5e-323)
		tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l))));
	elseif (Float64(V * l) <= 1e+290)
		tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A)));
	else
		tmp = t_0;
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = c0 * (sqrt((A / V)) / sqrt(l));
	tmp = 0.0;
	if ((V * l) <= -2e+163)
		tmp = t_0;
	elseif ((V * l) <= -5e-223)
		tmp = c0 / sqrt(((V * l) / A));
	elseif ((V * l) <= 5e-323)
		tmp = c0 / sqrt((V / (A / l)));
	elseif ((V * l) <= 1e+290)
		tmp = c0 / (sqrt((V * l)) / sqrt(A));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+163], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-223], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-323], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+290], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+163}:\\
\;\;\;\;t_0\\

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

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

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

\mathbf{else}:\\
\;\;\;\;t_0\\


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

    1. Initial program 35.8%

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

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

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

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

    if -1.9999999999999999e163 < (*.f64 V l) < -5.00000000000000024e-223

    1. Initial program 96.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity96.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    6. Taylor expanded in V around 0 96.8%

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

    if -5.00000000000000024e-223 < (*.f64 V l) < 4.94066e-323

    1. Initial program 45.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity45.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.94066e-323 < (*.f64 V l) < 1.00000000000000006e290

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+163}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-223}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \end{array} \]

Alternative 6: 85.4% accurate, 0.5× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := \sqrt{\frac{A}{V}}\\ \mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+139}:\\ \;\;\;\;\frac{t_0}{\frac{\sqrt{\ell}}{c0}}\\ \mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-223}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{t_0}{\sqrt{\ell}}\\ \end{array} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (sqrt (/ A V))))
   (if (<= (* V l) -4e+139)
     (/ t_0 (/ (sqrt l) c0))
     (if (<= (* V l) -5e-223)
       (/ c0 (sqrt (/ (* V l) A)))
       (if (<= (* V l) 5e-323)
         (/ c0 (sqrt (/ V (/ A l))))
         (if (<= (* V l) 1e+290)
           (/ c0 (/ (sqrt (* V l)) (sqrt A)))
           (* c0 (/ t_0 (sqrt l)))))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = sqrt((A / V));
	double tmp;
	if ((V * l) <= -4e+139) {
		tmp = t_0 / (sqrt(l) / c0);
	} else if ((V * l) <= -5e-223) {
		tmp = c0 / sqrt(((V * l) / A));
	} else if ((V * l) <= 5e-323) {
		tmp = c0 / sqrt((V / (A / l)));
	} else if ((V * l) <= 1e+290) {
		tmp = c0 / (sqrt((V * l)) / sqrt(A));
	} else {
		tmp = c0 * (t_0 / sqrt(l));
	}
	return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
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
    real(8) :: t_0
    real(8) :: tmp
    t_0 = sqrt((a / v))
    if ((v * l) <= (-4d+139)) then
        tmp = t_0 / (sqrt(l) / c0)
    else if ((v * l) <= (-5d-223)) then
        tmp = c0 / sqrt(((v * l) / a))
    else if ((v * l) <= 5d-323) then
        tmp = c0 / sqrt((v / (a / l)))
    else if ((v * l) <= 1d+290) then
        tmp = c0 / (sqrt((v * l)) / sqrt(a))
    else
        tmp = c0 * (t_0 / sqrt(l))
    end if
    code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = Math.sqrt((A / V));
	double tmp;
	if ((V * l) <= -4e+139) {
		tmp = t_0 / (Math.sqrt(l) / c0);
	} else if ((V * l) <= -5e-223) {
		tmp = c0 / Math.sqrt(((V * l) / A));
	} else if ((V * l) <= 5e-323) {
		tmp = c0 / Math.sqrt((V / (A / l)));
	} else if ((V * l) <= 1e+290) {
		tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
	} else {
		tmp = c0 * (t_0 / Math.sqrt(l));
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	t_0 = math.sqrt((A / V))
	tmp = 0
	if (V * l) <= -4e+139:
		tmp = t_0 / (math.sqrt(l) / c0)
	elif (V * l) <= -5e-223:
		tmp = c0 / math.sqrt(((V * l) / A))
	elif (V * l) <= 5e-323:
		tmp = c0 / math.sqrt((V / (A / l)))
	elif (V * l) <= 1e+290:
		tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A))
	else:
		tmp = c0 * (t_0 / math.sqrt(l))
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	t_0 = sqrt(Float64(A / V))
	tmp = 0.0
	if (Float64(V * l) <= -4e+139)
		tmp = Float64(t_0 / Float64(sqrt(l) / c0));
	elseif (Float64(V * l) <= -5e-223)
		tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A)));
	elseif (Float64(V * l) <= 5e-323)
		tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l))));
	elseif (Float64(V * l) <= 1e+290)
		tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A)));
	else
		tmp = Float64(c0 * Float64(t_0 / sqrt(l)));
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = sqrt((A / V));
	tmp = 0.0;
	if ((V * l) <= -4e+139)
		tmp = t_0 / (sqrt(l) / c0);
	elseif ((V * l) <= -5e-223)
		tmp = c0 / sqrt(((V * l) / A));
	elseif ((V * l) <= 5e-323)
		tmp = c0 / sqrt((V / (A / l)));
	elseif ((V * l) <= 1e+290)
		tmp = c0 / (sqrt((V * l)) / sqrt(A));
	else
		tmp = c0 * (t_0 / sqrt(l));
	end
	tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -4e+139], N[(t$95$0 / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-223], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-323], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+290], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+139}:\\
\;\;\;\;\frac{t_0}{\frac{\sqrt{\ell}}{c0}}\\

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

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

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

\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{t_0}{\sqrt{\ell}}\\


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

    1. Initial program 58.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \ell}} \cdot \sqrt{A}} \]
    5. Simplified0.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{c0 \cdot \sqrt{\frac{A}{V}}}{\color{blue}{\sqrt{\ell}}} \]
      10. clear-num43.6%

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

        \[\leadsto \frac{1}{\color{blue}{\frac{\frac{\sqrt{\ell}}{c0}}{\sqrt{\frac{A}{V}}}}} \]
    7. Applied egg-rr43.5%

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

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

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

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

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

    if -4.00000000000000013e139 < (*.f64 V l) < -5.00000000000000024e-223

    1. Initial program 96.5%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    6. Taylor expanded in V around 0 96.6%

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

    if -5.00000000000000024e-223 < (*.f64 V l) < 4.94066e-323

    1. Initial program 45.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity45.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.94066e-323 < (*.f64 V l) < 1.00000000000000006e290

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000006e290 < (*.f64 V l)

    1. Initial program 5.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+139}:\\ \;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\ \mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-223}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \end{array} \]

Alternative 7: 85.2% accurate, 0.5× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := \frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+139}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-223}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ (* c0 (sqrt (/ A V))) (sqrt l))))
   (if (<= (* V l) -4e+139)
     t_0
     (if (<= (* V l) -5e-223)
       (/ c0 (sqrt (/ (* V l) A)))
       (if (<= (* V l) 5e-323)
         (/ c0 (sqrt (/ V (/ A l))))
         (if (<= (* V l) 1e+290) (/ c0 (/ (sqrt (* V l)) (sqrt A))) t_0))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = (c0 * sqrt((A / V))) / sqrt(l);
	double tmp;
	if ((V * l) <= -4e+139) {
		tmp = t_0;
	} else if ((V * l) <= -5e-223) {
		tmp = c0 / sqrt(((V * l) / A));
	} else if ((V * l) <= 5e-323) {
		tmp = c0 / sqrt((V / (A / l)));
	} else if ((V * l) <= 1e+290) {
		tmp = c0 / (sqrt((V * l)) / sqrt(A));
	} else {
		tmp = t_0;
	}
	return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
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
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (c0 * sqrt((a / v))) / sqrt(l)
    if ((v * l) <= (-4d+139)) then
        tmp = t_0
    else if ((v * l) <= (-5d-223)) then
        tmp = c0 / sqrt(((v * l) / a))
    else if ((v * l) <= 5d-323) then
        tmp = c0 / sqrt((v / (a / l)))
    else if ((v * l) <= 1d+290) then
        tmp = c0 / (sqrt((v * l)) / sqrt(a))
    else
        tmp = t_0
    end if
    code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = (c0 * Math.sqrt((A / V))) / Math.sqrt(l);
	double tmp;
	if ((V * l) <= -4e+139) {
		tmp = t_0;
	} else if ((V * l) <= -5e-223) {
		tmp = c0 / Math.sqrt(((V * l) / A));
	} else if ((V * l) <= 5e-323) {
		tmp = c0 / Math.sqrt((V / (A / l)));
	} else if ((V * l) <= 1e+290) {
		tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
	} else {
		tmp = t_0;
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	t_0 = (c0 * math.sqrt((A / V))) / math.sqrt(l)
	tmp = 0
	if (V * l) <= -4e+139:
		tmp = t_0
	elif (V * l) <= -5e-223:
		tmp = c0 / math.sqrt(((V * l) / A))
	elif (V * l) <= 5e-323:
		tmp = c0 / math.sqrt((V / (A / l)))
	elif (V * l) <= 1e+290:
		tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A))
	else:
		tmp = t_0
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	t_0 = Float64(Float64(c0 * sqrt(Float64(A / V))) / sqrt(l))
	tmp = 0.0
	if (Float64(V * l) <= -4e+139)
		tmp = t_0;
	elseif (Float64(V * l) <= -5e-223)
		tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A)));
	elseif (Float64(V * l) <= 5e-323)
		tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l))));
	elseif (Float64(V * l) <= 1e+290)
		tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A)));
	else
		tmp = t_0;
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = (c0 * sqrt((A / V))) / sqrt(l);
	tmp = 0.0;
	if ((V * l) <= -4e+139)
		tmp = t_0;
	elseif ((V * l) <= -5e-223)
		tmp = c0 / sqrt(((V * l) / A));
	elseif ((V * l) <= 5e-323)
		tmp = c0 / sqrt((V / (A / l)));
	elseif ((V * l) <= 1e+290)
		tmp = c0 / (sqrt((V * l)) / sqrt(A));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -4e+139], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-223], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-323], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+290], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+139}:\\
\;\;\;\;t_0\\

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

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

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

\mathbf{else}:\\
\;\;\;\;t_0\\


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

    1. Initial program 41.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity41.2%

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

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

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

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

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

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

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

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

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

    if -4.00000000000000013e139 < (*.f64 V l) < -5.00000000000000024e-223

    1. Initial program 96.5%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    6. Taylor expanded in V around 0 96.6%

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

    if -5.00000000000000024e-223 < (*.f64 V l) < 4.94066e-323

    1. Initial program 45.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity45.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.94066e-323 < (*.f64 V l) < 1.00000000000000006e290

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+139}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-223}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \end{array} \]

Alternative 8: 81.4% accurate, 0.5× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+276}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{\frac{\ell}{\frac{1}{V}}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \end{array} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (<= t_0 0.0)
     (* c0 (/ (sqrt (/ A V)) (sqrt l)))
     (if (<= t_0 5e+276)
       (* c0 (sqrt (/ A (/ l (/ 1.0 V)))))
       (/ c0 (sqrt (/ V (/ A l))))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * (sqrt((A / V)) / sqrt(l));
	} else if (t_0 <= 5e+276) {
		tmp = c0 * sqrt((A / (l / (1.0 / V))));
	} else {
		tmp = c0 / sqrt((V / (A / l)));
	}
	return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
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
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 0.0d0) then
        tmp = c0 * (sqrt((a / v)) / sqrt(l))
    else if (t_0 <= 5d+276) then
        tmp = c0 * sqrt((a / (l / (1.0d0 / v))))
    else
        tmp = c0 / sqrt((v / (a / l)))
    end if
    code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
	} else if (t_0 <= 5e+276) {
		tmp = c0 * Math.sqrt((A / (l / (1.0 / V))));
	} else {
		tmp = c0 / Math.sqrt((V / (A / l)));
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 0.0:
		tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l))
	elif t_0 <= 5e+276:
		tmp = c0 * math.sqrt((A / (l / (1.0 / V))))
	else:
		tmp = c0 / math.sqrt((V / (A / l)))
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l)));
	elseif (t_0 <= 5e+276)
		tmp = Float64(c0 * sqrt(Float64(A / Float64(l / Float64(1.0 / V)))));
	else
		tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l))));
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = c0 * (sqrt((A / V)) / sqrt(l));
	elseif (t_0 <= 5e+276)
		tmp = c0 * sqrt((A / (l / (1.0 / V))));
	else
		tmp = c0 / sqrt((V / (A / l)));
	end
	tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+276], N[(c0 * N[Sqrt[N[(A / N[(l / N[(1.0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\

\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+276}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{\frac{\ell}{\frac{1}{V}}}}\\

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


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

    1. Initial program 24.2%

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000001e276

    1. Initial program 98.8%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity98.8%

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

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

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

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

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

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

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

    if 5.00000000000000001e276 < (/.f64 A (*.f64 V l))

    1. Initial program 46.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity46.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 78.7% accurate, 0.9× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;\sqrt{\frac{c0}{V} \cdot \frac{c0}{\frac{\ell}{A}}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+276}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{\frac{\ell}{\frac{1}{V}}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \end{array} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (<= t_0 0.0)
     (sqrt (* (/ c0 V) (/ c0 (/ l A))))
     (if (<= t_0 5e+276)
       (* c0 (sqrt (/ A (/ l (/ 1.0 V)))))
       (/ c0 (sqrt (/ V (/ A l))))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = sqrt(((c0 / V) * (c0 / (l / A))));
	} else if (t_0 <= 5e+276) {
		tmp = c0 * sqrt((A / (l / (1.0 / V))));
	} else {
		tmp = c0 / sqrt((V / (A / l)));
	}
	return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
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
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 0.0d0) then
        tmp = sqrt(((c0 / v) * (c0 / (l / a))))
    else if (t_0 <= 5d+276) then
        tmp = c0 * sqrt((a / (l / (1.0d0 / v))))
    else
        tmp = c0 / sqrt((v / (a / l)))
    end if
    code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = Math.sqrt(((c0 / V) * (c0 / (l / A))));
	} else if (t_0 <= 5e+276) {
		tmp = c0 * Math.sqrt((A / (l / (1.0 / V))));
	} else {
		tmp = c0 / Math.sqrt((V / (A / l)));
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 0.0:
		tmp = math.sqrt(((c0 / V) * (c0 / (l / A))))
	elif t_0 <= 5e+276:
		tmp = c0 * math.sqrt((A / (l / (1.0 / V))))
	else:
		tmp = c0 / math.sqrt((V / (A / l)))
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = sqrt(Float64(Float64(c0 / V) * Float64(c0 / Float64(l / A))));
	elseif (t_0 <= 5e+276)
		tmp = Float64(c0 * sqrt(Float64(A / Float64(l / Float64(1.0 / V)))));
	else
		tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l))));
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = sqrt(((c0 / V) * (c0 / (l / A))));
	elseif (t_0 <= 5e+276)
		tmp = c0 * sqrt((A / (l / (1.0 / V))));
	else
		tmp = c0 / sqrt((V / (A / l)));
	end
	tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(N[(c0 / V), $MachinePrecision] * N[(c0 / N[(l / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 5e+276], N[(c0 * N[Sqrt[N[(A / N[(l / N[(1.0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{c0}{V} \cdot \frac{c0}{\frac{\ell}{A}}}\\

\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+276}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{\frac{\ell}{\frac{1}{V}}}}\\

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


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

    1. Initial program 24.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity24.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000001e276

    1. Initial program 98.8%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity98.8%

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

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

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

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

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

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

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

    if 5.00000000000000001e276 < (/.f64 A (*.f64 V l))

    1. Initial program 46.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity46.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 78.7% accurate, 0.9× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;\frac{1}{\sqrt{\frac{V}{c0} \cdot \frac{\frac{\ell}{A}}{c0}}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+276}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{\frac{\ell}{\frac{1}{V}}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \end{array} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (<= t_0 0.0)
     (/ 1.0 (sqrt (* (/ V c0) (/ (/ l A) c0))))
     (if (<= t_0 5e+276)
       (* c0 (sqrt (/ A (/ l (/ 1.0 V)))))
       (/ c0 (sqrt (/ V (/ A l))))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = 1.0 / sqrt(((V / c0) * ((l / A) / c0)));
	} else if (t_0 <= 5e+276) {
		tmp = c0 * sqrt((A / (l / (1.0 / V))));
	} else {
		tmp = c0 / sqrt((V / (A / l)));
	}
	return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
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
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 0.0d0) then
        tmp = 1.0d0 / sqrt(((v / c0) * ((l / a) / c0)))
    else if (t_0 <= 5d+276) then
        tmp = c0 * sqrt((a / (l / (1.0d0 / v))))
    else
        tmp = c0 / sqrt((v / (a / l)))
    end if
    code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = 1.0 / Math.sqrt(((V / c0) * ((l / A) / c0)));
	} else if (t_0 <= 5e+276) {
		tmp = c0 * Math.sqrt((A / (l / (1.0 / V))));
	} else {
		tmp = c0 / Math.sqrt((V / (A / l)));
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 0.0:
		tmp = 1.0 / math.sqrt(((V / c0) * ((l / A) / c0)))
	elif t_0 <= 5e+276:
		tmp = c0 * math.sqrt((A / (l / (1.0 / V))))
	else:
		tmp = c0 / math.sqrt((V / (A / l)))
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(1.0 / sqrt(Float64(Float64(V / c0) * Float64(Float64(l / A) / c0))));
	elseif (t_0 <= 5e+276)
		tmp = Float64(c0 * sqrt(Float64(A / Float64(l / Float64(1.0 / V)))));
	else
		tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l))));
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = 1.0 / sqrt(((V / c0) * ((l / A) / c0)));
	elseif (t_0 <= 5e+276)
		tmp = c0 * sqrt((A / (l / (1.0 / V))));
	else
		tmp = c0 / sqrt((V / (A / l)));
	end
	tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(1.0 / N[Sqrt[N[(N[(V / c0), $MachinePrecision] * N[(N[(l / A), $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+276], N[(c0 * N[Sqrt[N[(A / N[(l / N[(1.0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\frac{1}{\sqrt{\frac{V}{c0} \cdot \frac{\frac{\ell}{A}}{c0}}}\\

\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+276}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{\frac{\ell}{\frac{1}{V}}}}\\

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


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

    1. Initial program 24.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity24.2%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt{\ell}}{c0 \cdot \sqrt{\frac{A}{V}}}}} \]
    6. Taylor expanded in c0 around 0 24.2%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\sqrt{\color{blue}{\frac{V}{c0} \cdot \frac{\frac{\ell}{A}}{c0}}}} \]
    10. Simplified36.9%

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000001e276

    1. Initial program 98.8%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity98.8%

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

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

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

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

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

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

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

    if 5.00000000000000001e276 < (/.f64 A (*.f64 V l))

    1. Initial program 46.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity46.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 79.8% accurate, 0.9× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 4 \cdot 10^{+306}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \end{array} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (or (<= t_0 0.0) (not (<= t_0 4e+306)))
     (* c0 (sqrt (/ (/ A V) l)))
     (* c0 (sqrt t_0)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 4e+306)) {
		tmp = c0 * sqrt(((A / V) / l));
	} else {
		tmp = c0 * sqrt(t_0);
	}
	return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
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
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+306))) then
        tmp = c0 * sqrt(((a / v) / l))
    else
        tmp = c0 * sqrt(t_0)
    end if
    code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 4e+306)) {
		tmp = c0 * Math.sqrt(((A / V) / l));
	} else {
		tmp = c0 * Math.sqrt(t_0);
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if (t_0 <= 0.0) or not (t_0 <= 4e+306):
		tmp = c0 * math.sqrt(((A / V) / l))
	else:
		tmp = c0 * math.sqrt(t_0)
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if ((t_0 <= 0.0) || !(t_0 <= 4e+306))
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	else
		tmp = Float64(c0 * sqrt(t_0));
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if ((t_0 <= 0.0) || ~((t_0 <= 4e+306)))
		tmp = c0 * sqrt(((A / V) / l));
	else
		tmp = c0 * sqrt(t_0);
	end
	tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+306]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 4 \cdot 10^{+306}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\


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

    1. Initial program 35.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. pow1/235.1%

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

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}}^{0.5} \]
      3. inv-pow35.1%

        \[\leadsto c0 \cdot {\color{blue}{\left({\left(\frac{V \cdot \ell}{A}\right)}^{-1}\right)}}^{0.5} \]
      4. pow-pow35.8%

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{\left(-1 \cdot 0.5\right)}} \]
      5. associate-/l*54.5%

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

        \[\leadsto c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{\color{blue}{-0.5}} \]
    3. Applied egg-rr54.5%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    4. Step-by-step derivation
      1. associate-/l*35.8%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V \cdot \ell}{A}\right)}}^{-0.5} \]
      2. *-lft-identity35.8%

        \[\leadsto c0 \cdot {\left(\frac{V \cdot \ell}{\color{blue}{1 \cdot A}}\right)}^{-0.5} \]
      3. times-frac54.5%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V}{1} \cdot \frac{\ell}{A}\right)}}^{-0.5} \]
      4. /-rgt-identity54.5%

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

      \[\leadsto c0 \cdot \color{blue}{{\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}} \]
    6. Taylor expanded in c0 around 0 35.1%

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 4.00000000000000007e306

    1. Initial program 98.8%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification82.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{A}{V \cdot \ell} \leq 0 \lor \neg \left(\frac{A}{V \cdot \ell} \leq 4 \cdot 10^{+306}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \end{array} \]

Alternative 12: 79.4% accurate, 0.9× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 5 \cdot 10^{+276}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \end{array} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (or (<= t_0 0.0) (not (<= t_0 5e+276)))
     (* c0 (sqrt (/ (/ A l) V)))
     (* c0 (sqrt t_0)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 5e+276)) {
		tmp = c0 * sqrt(((A / l) / V));
	} else {
		tmp = c0 * sqrt(t_0);
	}
	return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
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
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+276))) then
        tmp = c0 * sqrt(((a / l) / v))
    else
        tmp = c0 * sqrt(t_0)
    end if
    code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 5e+276)) {
		tmp = c0 * Math.sqrt(((A / l) / V));
	} else {
		tmp = c0 * Math.sqrt(t_0);
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if (t_0 <= 0.0) or not (t_0 <= 5e+276):
		tmp = c0 * math.sqrt(((A / l) / V))
	else:
		tmp = c0 * math.sqrt(t_0)
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if ((t_0 <= 0.0) || !(t_0 <= 5e+276))
		tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V)));
	else
		tmp = Float64(c0 * sqrt(t_0));
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if ((t_0 <= 0.0) || ~((t_0 <= 5e+276)))
		tmp = c0 * sqrt(((A / l) / V));
	else
		tmp = c0 * sqrt(t_0);
	end
	tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+276]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 5 \cdot 10^{+276}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\


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

    1. Initial program 36.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. pow1/236.4%

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

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}}^{0.5} \]
      3. inv-pow36.4%

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

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{\left(-1 \cdot 0.5\right)}} \]
      5. associate-/l*55.4%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V}{\frac{A}{\ell}}\right)}}^{\left(-1 \cdot 0.5\right)} \]
      6. metadata-eval55.4%

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    4. Step-by-step derivation
      1. associate-/l*37.1%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V \cdot \ell}{A}\right)}}^{-0.5} \]
      2. *-lft-identity37.1%

        \[\leadsto c0 \cdot {\left(\frac{V \cdot \ell}{\color{blue}{1 \cdot A}}\right)}^{-0.5} \]
      3. times-frac55.4%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V}{1} \cdot \frac{\ell}{A}\right)}}^{-0.5} \]
      4. /-rgt-identity55.4%

        \[\leadsto c0 \cdot {\left(\color{blue}{V} \cdot \frac{\ell}{A}\right)}^{-0.5} \]
    5. Simplified55.4%

      \[\leadsto c0 \cdot \color{blue}{{\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}} \]
    6. Taylor expanded in c0 around 0 36.4%

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000001e276

    1. Initial program 98.8%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification82.1%

    \[\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^{+276}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \end{array} \]

Alternative 13: 79.9% accurate, 0.9× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+276}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \end{array} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (<= t_0 0.0)
     (* c0 (sqrt (/ (/ A l) V)))
     (if (<= t_0 5e+276) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A))))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * sqrt(((A / l) / V));
	} else if (t_0 <= 5e+276) {
		tmp = c0 * sqrt(t_0);
	} else {
		tmp = c0 / sqrt((V * (l / A)));
	}
	return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
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
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 0.0d0) then
        tmp = c0 * sqrt(((a / l) / v))
    else if (t_0 <= 5d+276) then
        tmp = c0 * sqrt(t_0)
    else
        tmp = c0 / sqrt((v * (l / a)))
    end if
    code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * Math.sqrt(((A / l) / V));
	} else if (t_0 <= 5e+276) {
		tmp = c0 * Math.sqrt(t_0);
	} else {
		tmp = c0 / Math.sqrt((V * (l / A)));
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 0.0:
		tmp = c0 * math.sqrt(((A / l) / V))
	elif t_0 <= 5e+276:
		tmp = c0 * math.sqrt(t_0)
	else:
		tmp = c0 / math.sqrt((V * (l / A)))
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V)));
	elseif (t_0 <= 5e+276)
		tmp = Float64(c0 * sqrt(t_0));
	else
		tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A))));
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = c0 * sqrt(((A / l) / V));
	elseif (t_0 <= 5e+276)
		tmp = c0 * sqrt(t_0);
	else
		tmp = c0 / sqrt((V * (l / A)));
	end
	tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+276], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\

\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+276}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\

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


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

    1. Initial program 24.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. pow1/224.2%

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{A}{V \cdot \ell}\right)}^{0.5}} \]
      2. clear-num24.2%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}}^{0.5} \]
      3. inv-pow24.2%

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

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{\left(-1 \cdot 0.5\right)}} \]
      5. associate-/l*35.0%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V}{\frac{A}{\ell}}\right)}}^{\left(-1 \cdot 0.5\right)} \]
      6. metadata-eval35.0%

        \[\leadsto c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{\color{blue}{-0.5}} \]
    3. Applied egg-rr35.0%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    4. Step-by-step derivation
      1. associate-/l*24.2%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V \cdot \ell}{A}\right)}}^{-0.5} \]
      2. *-lft-identity24.2%

        \[\leadsto c0 \cdot {\left(\frac{V \cdot \ell}{\color{blue}{1 \cdot A}}\right)}^{-0.5} \]
      3. times-frac35.0%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V}{1} \cdot \frac{\ell}{A}\right)}}^{-0.5} \]
      4. /-rgt-identity35.0%

        \[\leadsto c0 \cdot {\left(\color{blue}{V} \cdot \frac{\ell}{A}\right)}^{-0.5} \]
    5. Simplified35.0%

      \[\leadsto c0 \cdot \color{blue}{{\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}} \]
    6. Taylor expanded in c0 around 0 24.2%

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000001e276

    1. Initial program 98.8%

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

    if 5.00000000000000001e276 < (/.f64 A (*.f64 V l))

    1. Initial program 46.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity46.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 79.9% accurate, 0.9× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+276}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \end{array} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (<= t_0 0.0)
     (* c0 (sqrt (/ (/ A l) V)))
     (if (<= t_0 5e+276) (* c0 (sqrt t_0)) (/ c0 (sqrt (/ V (/ A l))))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * sqrt(((A / l) / V));
	} else if (t_0 <= 5e+276) {
		tmp = c0 * sqrt(t_0);
	} else {
		tmp = c0 / sqrt((V / (A / l)));
	}
	return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
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
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 0.0d0) then
        tmp = c0 * sqrt(((a / l) / v))
    else if (t_0 <= 5d+276) then
        tmp = c0 * sqrt(t_0)
    else
        tmp = c0 / sqrt((v / (a / l)))
    end if
    code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * Math.sqrt(((A / l) / V));
	} else if (t_0 <= 5e+276) {
		tmp = c0 * Math.sqrt(t_0);
	} else {
		tmp = c0 / Math.sqrt((V / (A / l)));
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 0.0:
		tmp = c0 * math.sqrt(((A / l) / V))
	elif t_0 <= 5e+276:
		tmp = c0 * math.sqrt(t_0)
	else:
		tmp = c0 / math.sqrt((V / (A / l)))
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V)));
	elseif (t_0 <= 5e+276)
		tmp = Float64(c0 * sqrt(t_0));
	else
		tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l))));
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = c0 * sqrt(((A / l) / V));
	elseif (t_0 <= 5e+276)
		tmp = c0 * sqrt(t_0);
	else
		tmp = c0 / sqrt((V / (A / l)));
	end
	tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+276], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\

\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+276}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\

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


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

    1. Initial program 24.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. pow1/224.2%

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{A}{V \cdot \ell}\right)}^{0.5}} \]
      2. clear-num24.2%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}}^{0.5} \]
      3. inv-pow24.2%

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

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{\left(-1 \cdot 0.5\right)}} \]
      5. associate-/l*35.0%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V}{\frac{A}{\ell}}\right)}}^{\left(-1 \cdot 0.5\right)} \]
      6. metadata-eval35.0%

        \[\leadsto c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{\color{blue}{-0.5}} \]
    3. Applied egg-rr35.0%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    4. Step-by-step derivation
      1. associate-/l*24.2%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V \cdot \ell}{A}\right)}}^{-0.5} \]
      2. *-lft-identity24.2%

        \[\leadsto c0 \cdot {\left(\frac{V \cdot \ell}{\color{blue}{1 \cdot A}}\right)}^{-0.5} \]
      3. times-frac35.0%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V}{1} \cdot \frac{\ell}{A}\right)}}^{-0.5} \]
      4. /-rgt-identity35.0%

        \[\leadsto c0 \cdot {\left(\color{blue}{V} \cdot \frac{\ell}{A}\right)}^{-0.5} \]
    5. Simplified35.0%

      \[\leadsto c0 \cdot \color{blue}{{\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}} \]
    6. Taylor expanded in c0 around 0 24.2%

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000001e276

    1. Initial program 98.8%

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

    if 5.00000000000000001e276 < (/.f64 A (*.f64 V l))

    1. Initial program 46.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity46.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 79.6% accurate, 0.9× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 5 \cdot 10^{-310}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+276}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \end{array} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (<= t_0 5e-310)
     (* c0 (sqrt (/ (/ A l) V)))
     (if (<= t_0 5e+276)
       (/ c0 (sqrt (/ (* V l) A)))
       (/ c0 (sqrt (/ V (/ A l))))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 5e-310) {
		tmp = c0 * sqrt(((A / l) / V));
	} else if (t_0 <= 5e+276) {
		tmp = c0 / sqrt(((V * l) / A));
	} else {
		tmp = c0 / sqrt((V / (A / l)));
	}
	return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
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
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 5d-310) then
        tmp = c0 * sqrt(((a / l) / v))
    else if (t_0 <= 5d+276) then
        tmp = c0 / sqrt(((v * l) / a))
    else
        tmp = c0 / sqrt((v / (a / l)))
    end if
    code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 5e-310) {
		tmp = c0 * Math.sqrt(((A / l) / V));
	} else if (t_0 <= 5e+276) {
		tmp = c0 / Math.sqrt(((V * l) / A));
	} else {
		tmp = c0 / Math.sqrt((V / (A / l)));
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 5e-310:
		tmp = c0 * math.sqrt(((A / l) / V))
	elif t_0 <= 5e+276:
		tmp = c0 / math.sqrt(((V * l) / A))
	else:
		tmp = c0 / math.sqrt((V / (A / l)))
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 5e-310)
		tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V)));
	elseif (t_0 <= 5e+276)
		tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A)));
	else
		tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l))));
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 5e-310)
		tmp = c0 * sqrt(((A / l) / V));
	elseif (t_0 <= 5e+276)
		tmp = c0 / sqrt(((V * l) / A));
	else
		tmp = c0 / sqrt((V / (A / l)));
	end
	tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-310], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+276], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\

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

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


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

    1. Initial program 27.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. pow1/227.4%

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{A}{V \cdot \ell}\right)}^{0.5}} \]
      2. clear-num25.2%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}}^{0.5} \]
      3. inv-pow25.2%

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

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{\left(-1 \cdot 0.5\right)}} \]
      5. associate-/l*35.6%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V}{\frac{A}{\ell}}\right)}}^{\left(-1 \cdot 0.5\right)} \]
      6. metadata-eval35.6%

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    4. Step-by-step derivation
      1. associate-/l*25.2%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V \cdot \ell}{A}\right)}}^{-0.5} \]
      2. *-lft-identity25.2%

        \[\leadsto c0 \cdot {\left(\frac{V \cdot \ell}{\color{blue}{1 \cdot A}}\right)}^{-0.5} \]
      3. times-frac35.5%

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V}{1} \cdot \frac{\ell}{A}\right)}}^{-0.5} \]
      4. /-rgt-identity35.5%

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

      \[\leadsto c0 \cdot \color{blue}{{\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}} \]
    6. Taylor expanded in c0 around 0 27.4%

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

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

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

    if 4.999999999999985e-310 < (/.f64 A (*.f64 V l)) < 5.00000000000000001e276

    1. Initial program 98.9%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity98.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}} \]
    6. Taylor expanded in V around 0 98.9%

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

    if 5.00000000000000001e276 < (/.f64 A (*.f64 V l))

    1. Initial program 46.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity46.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{A}{V \cdot \ell} \leq 5 \cdot 10^{-310}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{elif}\;\frac{A}{V \cdot \ell} \leq 5 \cdot 10^{+276}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \end{array} \]

Alternative 16: 78.7% accurate, 0.9× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;\sqrt{\frac{c0}{V} \cdot \frac{c0}{\frac{\ell}{A}}}\\ \mathbf{elif}\;t_0 \leq 5 \cdot 10^{+276}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\ \end{array} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (<= t_0 0.0)
     (sqrt (* (/ c0 V) (/ c0 (/ l A))))
     (if (<= t_0 5e+276) (* c0 (sqrt t_0)) (/ c0 (sqrt (/ V (/ A l))))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = sqrt(((c0 / V) * (c0 / (l / A))));
	} else if (t_0 <= 5e+276) {
		tmp = c0 * sqrt(t_0);
	} else {
		tmp = c0 / sqrt((V / (A / l)));
	}
	return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
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
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 0.0d0) then
        tmp = sqrt(((c0 / v) * (c0 / (l / a))))
    else if (t_0 <= 5d+276) then
        tmp = c0 * sqrt(t_0)
    else
        tmp = c0 / sqrt((v / (a / l)))
    end if
    code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = Math.sqrt(((c0 / V) * (c0 / (l / A))));
	} else if (t_0 <= 5e+276) {
		tmp = c0 * Math.sqrt(t_0);
	} else {
		tmp = c0 / Math.sqrt((V / (A / l)));
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 0.0:
		tmp = math.sqrt(((c0 / V) * (c0 / (l / A))))
	elif t_0 <= 5e+276:
		tmp = c0 * math.sqrt(t_0)
	else:
		tmp = c0 / math.sqrt((V / (A / l)))
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = sqrt(Float64(Float64(c0 / V) * Float64(c0 / Float64(l / A))));
	elseif (t_0 <= 5e+276)
		tmp = Float64(c0 * sqrt(t_0));
	else
		tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l))));
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = sqrt(((c0 / V) * (c0 / (l / A))));
	elseif (t_0 <= 5e+276)
		tmp = c0 * sqrt(t_0);
	else
		tmp = c0 / sqrt((V / (A / l)));
	end
	tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(N[(c0 / V), $MachinePrecision] * N[(c0 / N[(l / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 5e+276], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{c0}{V} \cdot \frac{c0}{\frac{\ell}{A}}}\\

\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+276}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\

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


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

    1. Initial program 24.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity24.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000001e276

    1. Initial program 98.8%

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

    if 5.00000000000000001e276 < (/.f64 A (*.f64 V l))

    1. Initial program 46.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. *-un-lft-identity46.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 73.1% accurate, 1.0× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	return c0 * sqrt((A / (V * l)));
}
NOTE: V and l should be sorted in increasing order before calling this function.
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
assert V < l;
public static double code(double c0, double A, double V, double l) {
	return c0 * Math.sqrt((A / (V * l)));
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	return c0 * math.sqrt((A / (V * l)))
V, l = sort([V, l])
function code(c0, A, V, l)
	return Float64(c0 * sqrt(Float64(A / Float64(V * l))))
end
V, l = num2cell(sort([V, l])){:}
function tmp = code(c0, A, V, l)
	tmp = c0 * sqrt((A / (V * l)));
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Derivation
  1. Initial program 74.7%

    \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
  2. Final simplification74.7%

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

Reproduce

?
herbie shell --seed 2023214 
(FPCore (c0 A V l)
  :name "Henrywood and Agarwal, Equation (3)"
  :precision binary64
  (* c0 (sqrt (/ A (* V l)))))