Henrywood and Agarwal, Equation (3)

Percentage Accurate: 73.9% → 88.9%
Time: 10.4s
Alternatives: 14
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 14 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.9% 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: 88.9% accurate, 0.5× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-307}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-320}:\\ \;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \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) (- INFINITY))
   (* c0 (/ (sqrt (/ A V)) (sqrt l)))
   (if (<= (* V l) -1e-307)
     (* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
     (if (<= (* V l) 5e-320)
       (* c0 (pow (* V (/ l A)) -0.5))
       (/ (* c0 (sqrt A)) (sqrt (* V l)))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = c0 * (sqrt((A / V)) / sqrt(l));
	} else if ((V * l) <= -1e-307) {
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	} else if ((V * l) <= 5e-320) {
		tmp = c0 * pow((V * (l / A)), -0.5);
	} else {
		tmp = (c0 * sqrt(A)) / sqrt((V * l));
	}
	return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -Double.POSITIVE_INFINITY) {
		tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
	} else if ((V * l) <= -1e-307) {
		tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if ((V * l) <= 5e-320) {
		tmp = c0 * Math.pow((V * (l / A)), -0.5);
	} else {
		tmp = (c0 * Math.sqrt(A)) / Math.sqrt((V * l));
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	tmp = 0
	if (V * l) <= -math.inf:
		tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l))
	elif (V * l) <= -1e-307:
		tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l)))
	elif (V * l) <= 5e-320:
		tmp = c0 * math.pow((V * (l / A)), -0.5)
	else:
		tmp = (c0 * math.sqrt(A)) / math.sqrt((V * l))
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= Float64(-Inf))
		tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l)));
	elseif (Float64(V * l) <= -1e-307)
		tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif (Float64(V * l) <= 5e-320)
		tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5));
	else
		tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(V * 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) <= -Inf)
		tmp = c0 * (sqrt((A / V)) / sqrt(l));
	elseif ((V * l) <= -1e-307)
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	elseif ((V * l) <= 5e-320)
		tmp = c0 * ((V * (l / A)) ^ -0.5);
	else
		tmp = (c0 * sqrt(A)) / sqrt((V * 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], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-307], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-320], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\

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

\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-320}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\

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


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

    1. Initial program 24.1%

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

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

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

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

    if -inf.0 < (*.f64 V l) < -9.99999999999999909e-308

    1. Initial program 86.4%

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

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

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

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

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

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

    if -9.99999999999999909e-308 < (*.f64 V l) < 4.99994e-320

    1. Initial program 41.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.99994e-320 < (*.f64 V l)

    1. Initial program 71.7%

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

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

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

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

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

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

Alternative 2: 80.4% accurate, 0.2× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{if}\;t_0 \leq -5 \cdot 10^{-322} \lor \neg \left(t_0 \leq 0\right) \land t_0 \leq 10^{+304}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\ \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 l))))))
   (if (or (<= t_0 -5e-322) (and (not (<= t_0 0.0)) (<= t_0 1e+304)))
     t_0
     (sqrt (* A (* (/ c0 l) (/ c0 V)))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = c0 * sqrt((A / (V * l)));
	double tmp;
	if ((t_0 <= -5e-322) || (!(t_0 <= 0.0) && (t_0 <= 1e+304))) {
		tmp = t_0;
	} else {
		tmp = sqrt((A * ((c0 / l) * (c0 / V))));
	}
	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 * l)))
    if ((t_0 <= (-5d-322)) .or. (.not. (t_0 <= 0.0d0)) .and. (t_0 <= 1d+304)) then
        tmp = t_0
    else
        tmp = sqrt((a * ((c0 / l) * (c0 / v))))
    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 * l)));
	double tmp;
	if ((t_0 <= -5e-322) || (!(t_0 <= 0.0) && (t_0 <= 1e+304))) {
		tmp = t_0;
	} else {
		tmp = Math.sqrt((A * ((c0 / l) * (c0 / V))));
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	t_0 = c0 * math.sqrt((A / (V * l)))
	tmp = 0
	if (t_0 <= -5e-322) or (not (t_0 <= 0.0) and (t_0 <= 1e+304)):
		tmp = t_0
	else:
		tmp = math.sqrt((A * ((c0 / l) * (c0 / V))))
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if ((t_0 <= -5e-322) || (!(t_0 <= 0.0) && (t_0 <= 1e+304)))
		tmp = t_0;
	else
		tmp = sqrt(Float64(A * Float64(Float64(c0 / l) * Float64(c0 / V))));
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = c0 * sqrt((A / (V * l)));
	tmp = 0.0;
	if ((t_0 <= -5e-322) || (~((t_0 <= 0.0)) && (t_0 <= 1e+304)))
		tmp = t_0;
	else
		tmp = sqrt((A * ((c0 / l) * (c0 / V))));
	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[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -5e-322], And[N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision], LessEqual[t$95$0, 1e+304]]], t$95$0, N[Sqrt[N[(A * N[(N[(c0 / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq -5 \cdot 10^{-322} \lor \neg \left(t_0 \leq 0\right) \land t_0 \leq 10^{+304}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < -4.99006e-322 or 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999994e303

    1. Initial program 90.6%

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

    if -4.99006e-322 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 9.9999999999999994e303 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 40.5%

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left({\left(\frac{A}{V \cdot \ell}\right)}^{0.25}\right)}^{2}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt40.5%

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

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

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

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

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

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

        \[\leadsto \sqrt{\left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{0.5}} \cdot {\left({\left(\frac{A}{V \cdot \ell}\right)}^{0.25}\right)}^{2}\right) \cdot \left(c0 \cdot c0\right)} \]
      8. metadata-eval40.0%

        \[\leadsto \sqrt{\left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot {\left({\left(\frac{A}{V \cdot \ell}\right)}^{0.25}\right)}^{2}\right) \cdot \left(c0 \cdot c0\right)} \]
      9. pow-pow40.0%

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

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

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

        \[\leadsto \sqrt{\color{blue}{{\left(\frac{A}{V \cdot \ell}\right)}^{1}} \cdot \left(c0 \cdot c0\right)} \]
      13. pow140.0%

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{A \cdot \left(\frac{c0}{V} \cdot \frac{c0}{\ell}\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification81.3%

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

Alternative 3: 80.0% accurate, 0.2× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{if}\;t_0 \leq -5 \cdot 10^{-322}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;t_0 \leq 0:\\ \;\;\;\;\sqrt{\frac{c0}{V} \cdot \frac{c0 \cdot A}{\ell}}\\ \mathbf{elif}\;t_0 \leq 10^{+304}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\ \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 l))))))
   (if (<= t_0 -5e-322)
     t_0
     (if (<= t_0 0.0)
       (sqrt (* (/ c0 V) (/ (* c0 A) l)))
       (if (<= t_0 1e+304) t_0 (sqrt (* A (* (/ c0 l) (/ c0 V)))))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = c0 * sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= -5e-322) {
		tmp = t_0;
	} else if (t_0 <= 0.0) {
		tmp = sqrt(((c0 / V) * ((c0 * A) / l)));
	} else if (t_0 <= 1e+304) {
		tmp = t_0;
	} else {
		tmp = sqrt((A * ((c0 / l) * (c0 / V))));
	}
	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 * l)))
    if (t_0 <= (-5d-322)) then
        tmp = t_0
    else if (t_0 <= 0.0d0) then
        tmp = sqrt(((c0 / v) * ((c0 * a) / l)))
    else if (t_0 <= 1d+304) then
        tmp = t_0
    else
        tmp = sqrt((a * ((c0 / l) * (c0 / v))))
    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 * l)));
	double tmp;
	if (t_0 <= -5e-322) {
		tmp = t_0;
	} else if (t_0 <= 0.0) {
		tmp = Math.sqrt(((c0 / V) * ((c0 * A) / l)));
	} else if (t_0 <= 1e+304) {
		tmp = t_0;
	} else {
		tmp = Math.sqrt((A * ((c0 / l) * (c0 / V))));
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	t_0 = c0 * math.sqrt((A / (V * l)))
	tmp = 0
	if t_0 <= -5e-322:
		tmp = t_0
	elif t_0 <= 0.0:
		tmp = math.sqrt(((c0 / V) * ((c0 * A) / l)))
	elif t_0 <= 1e+304:
		tmp = t_0
	else:
		tmp = math.sqrt((A * ((c0 / l) * (c0 / V))))
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if (t_0 <= -5e-322)
		tmp = t_0;
	elseif (t_0 <= 0.0)
		tmp = sqrt(Float64(Float64(c0 / V) * Float64(Float64(c0 * A) / l)));
	elseif (t_0 <= 1e+304)
		tmp = t_0;
	else
		tmp = sqrt(Float64(A * Float64(Float64(c0 / l) * Float64(c0 / V))));
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = c0 * sqrt((A / (V * l)));
	tmp = 0.0;
	if (t_0 <= -5e-322)
		tmp = t_0;
	elseif (t_0 <= 0.0)
		tmp = sqrt(((c0 / V) * ((c0 * A) / l)));
	elseif (t_0 <= 1e+304)
		tmp = t_0;
	else
		tmp = sqrt((A * ((c0 / l) * (c0 / V))));
	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[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-322], t$95$0, If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(N[(c0 / V), $MachinePrecision] * N[(N[(c0 * A), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 1e+304], t$95$0, N[Sqrt[N[(A * N[(N[(c0 / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq -5 \cdot 10^{-322}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;t_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{c0}{V} \cdot \frac{c0 \cdot A}{\ell}}\\

\mathbf{elif}\;t_0 \leq 10^{+304}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < -4.99006e-322 or 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999994e303

    1. Initial program 90.6%

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

    if -4.99006e-322 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0

    1. Initial program 39.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{A \cdot \color{blue}{\left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}} \]
    10. Taylor expanded in A around 0 50.3%

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999994e303 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 42.2%

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left({\left(\frac{A}{V \cdot \ell}\right)}^{0.25}\right)}^{2}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt42.2%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot {\left({\left(\frac{A}{V \cdot \ell}\right)}^{0.25}\right)}^{2}\right) \cdot \left(c0 \cdot c0\right)} \]
      9. pow-pow41.6%

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

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

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

        \[\leadsto \sqrt{\color{blue}{{\left(\frac{A}{V \cdot \ell}\right)}^{1}} \cdot \left(c0 \cdot c0\right)} \]
      13. pow141.6%

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

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

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

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

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

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

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

Alternative 4: 79.5% accurate, 0.2× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{if}\;t_0 \leq -5 \cdot 10^{-322}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;t_0 \leq 0:\\ \;\;\;\;\sqrt{\frac{A \cdot \left(c0 \cdot \frac{c0}{\ell}\right)}{V}}\\ \mathbf{elif}\;t_0 \leq 10^{+304}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\ \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 l))))))
   (if (<= t_0 -5e-322)
     t_0
     (if (<= t_0 0.0)
       (sqrt (/ (* A (* c0 (/ c0 l))) V))
       (if (<= t_0 1e+304) t_0 (sqrt (* A (* (/ c0 l) (/ c0 V)))))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = c0 * sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= -5e-322) {
		tmp = t_0;
	} else if (t_0 <= 0.0) {
		tmp = sqrt(((A * (c0 * (c0 / l))) / V));
	} else if (t_0 <= 1e+304) {
		tmp = t_0;
	} else {
		tmp = sqrt((A * ((c0 / l) * (c0 / V))));
	}
	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 * l)))
    if (t_0 <= (-5d-322)) then
        tmp = t_0
    else if (t_0 <= 0.0d0) then
        tmp = sqrt(((a * (c0 * (c0 / l))) / v))
    else if (t_0 <= 1d+304) then
        tmp = t_0
    else
        tmp = sqrt((a * ((c0 / l) * (c0 / v))))
    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 * l)));
	double tmp;
	if (t_0 <= -5e-322) {
		tmp = t_0;
	} else if (t_0 <= 0.0) {
		tmp = Math.sqrt(((A * (c0 * (c0 / l))) / V));
	} else if (t_0 <= 1e+304) {
		tmp = t_0;
	} else {
		tmp = Math.sqrt((A * ((c0 / l) * (c0 / V))));
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	t_0 = c0 * math.sqrt((A / (V * l)))
	tmp = 0
	if t_0 <= -5e-322:
		tmp = t_0
	elif t_0 <= 0.0:
		tmp = math.sqrt(((A * (c0 * (c0 / l))) / V))
	elif t_0 <= 1e+304:
		tmp = t_0
	else:
		tmp = math.sqrt((A * ((c0 / l) * (c0 / V))))
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if (t_0 <= -5e-322)
		tmp = t_0;
	elseif (t_0 <= 0.0)
		tmp = sqrt(Float64(Float64(A * Float64(c0 * Float64(c0 / l))) / V));
	elseif (t_0 <= 1e+304)
		tmp = t_0;
	else
		tmp = sqrt(Float64(A * Float64(Float64(c0 / l) * Float64(c0 / V))));
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = c0 * sqrt((A / (V * l)));
	tmp = 0.0;
	if (t_0 <= -5e-322)
		tmp = t_0;
	elseif (t_0 <= 0.0)
		tmp = sqrt(((A * (c0 * (c0 / l))) / V));
	elseif (t_0 <= 1e+304)
		tmp = t_0;
	else
		tmp = sqrt((A * ((c0 / l) * (c0 / V))));
	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[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-322], t$95$0, If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(N[(A * N[(c0 * N[(c0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 1e+304], t$95$0, N[Sqrt[N[(A * N[(N[(c0 / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq -5 \cdot 10^{-322}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;t_0 \leq 10^{+304}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < -4.99006e-322 or 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999994e303

    1. Initial program 90.6%

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

    if -4.99006e-322 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0

    1. Initial program 39.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999994e303 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 42.2%

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left({\left(\frac{A}{V \cdot \ell}\right)}^{0.25}\right)}^{2}} \]
    4. Step-by-step derivation
      1. add-sqr-sqrt42.2%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\left(\frac{1}{2}\right)}} \cdot {\left({\left(\frac{A}{V \cdot \ell}\right)}^{0.25}\right)}^{2}\right) \cdot \left(c0 \cdot c0\right)} \]
      9. pow-pow41.6%

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

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

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

        \[\leadsto \sqrt{\color{blue}{{\left(\frac{A}{V \cdot \ell}\right)}^{1}} \cdot \left(c0 \cdot c0\right)} \]
      13. pow141.6%

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

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

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

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

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

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

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

Alternative 5: 84.6% 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 -2 \cdot 10^{+176}:\\ \;\;\;\;c0 \cdot \frac{t_0}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-38}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-320}:\\ \;\;\;\;c0 \cdot \left(t_0 \cdot {\ell}^{-0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \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) -2e+176)
     (* c0 (/ t_0 (sqrt l)))
     (if (<= (* V l) -2e-38)
       (* c0 (sqrt (/ A (* V l))))
       (if (<= (* V l) 5e-320)
         (* c0 (* t_0 (pow l -0.5)))
         (/ (* c0 (sqrt A)) (sqrt (* V 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) <= -2e+176) {
		tmp = c0 * (t_0 / sqrt(l));
	} else if ((V * l) <= -2e-38) {
		tmp = c0 * sqrt((A / (V * l)));
	} else if ((V * l) <= 5e-320) {
		tmp = c0 * (t_0 * pow(l, -0.5));
	} else {
		tmp = (c0 * sqrt(A)) / sqrt((V * 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) <= (-2d+176)) then
        tmp = c0 * (t_0 / sqrt(l))
    else if ((v * l) <= (-2d-38)) then
        tmp = c0 * sqrt((a / (v * l)))
    else if ((v * l) <= 5d-320) then
        tmp = c0 * (t_0 * (l ** (-0.5d0)))
    else
        tmp = (c0 * sqrt(a)) / sqrt((v * 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) <= -2e+176) {
		tmp = c0 * (t_0 / Math.sqrt(l));
	} else if ((V * l) <= -2e-38) {
		tmp = c0 * Math.sqrt((A / (V * l)));
	} else if ((V * l) <= 5e-320) {
		tmp = c0 * (t_0 * Math.pow(l, -0.5));
	} else {
		tmp = (c0 * Math.sqrt(A)) / Math.sqrt((V * 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) <= -2e+176:
		tmp = c0 * (t_0 / math.sqrt(l))
	elif (V * l) <= -2e-38:
		tmp = c0 * math.sqrt((A / (V * l)))
	elif (V * l) <= 5e-320:
		tmp = c0 * (t_0 * math.pow(l, -0.5))
	else:
		tmp = (c0 * math.sqrt(A)) / math.sqrt((V * 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) <= -2e+176)
		tmp = Float64(c0 * Float64(t_0 / sqrt(l)));
	elseif (Float64(V * l) <= -2e-38)
		tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l))));
	elseif (Float64(V * l) <= 5e-320)
		tmp = Float64(c0 * Float64(t_0 * (l ^ -0.5)));
	else
		tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(V * 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) <= -2e+176)
		tmp = c0 * (t_0 / sqrt(l));
	elseif ((V * l) <= -2e-38)
		tmp = c0 * sqrt((A / (V * l)));
	elseif ((V * l) <= 5e-320)
		tmp = c0 * (t_0 * (l ^ -0.5));
	else
		tmp = (c0 * sqrt(A)) / sqrt((V * 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], -2e+176], N[(c0 * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-38], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-320], N[(c0 * N[(t$95$0 * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V * 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 -2 \cdot 10^{+176}:\\
\;\;\;\;c0 \cdot \frac{t_0}{\sqrt{\ell}}\\

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

\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-320}:\\
\;\;\;\;c0 \cdot \left(t_0 \cdot {\ell}^{-0.5}\right)\\

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


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

    1. Initial program 48.8%

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

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

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

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

    if -2e176 < (*.f64 V l) < -1.9999999999999999e-38

    1. Initial program 96.4%

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

    if -1.9999999999999999e-38 < (*.f64 V l) < 4.99994e-320

    1. Initial program 63.5%

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left({\left(\frac{A}{V \cdot \ell}\right)}^{0.25}\right)}^{2}} \]
    4. Step-by-step derivation
      1. pow-pow63.5%

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

        \[\leadsto c0 \cdot {\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{0.5}} \]
      3. pow1/263.5%

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

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

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

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

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

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

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

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

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

    if 4.99994e-320 < (*.f64 V l)

    1. Initial program 71.7%

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

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

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

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

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

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

Alternative 6: 84.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^{+176}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-38}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-320}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \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 (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
   (if (<= (* V l) -2e+176)
     t_0
     (if (<= (* V l) -2e-38)
       (* c0 (sqrt (/ A (* V l))))
       (if (<= (* V l) 5e-320) t_0 (/ (* c0 (sqrt A)) (sqrt (* V l))))))))
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+176) {
		tmp = t_0;
	} else if ((V * l) <= -2e-38) {
		tmp = c0 * sqrt((A / (V * l)));
	} else if ((V * l) <= 5e-320) {
		tmp = t_0;
	} else {
		tmp = (c0 * sqrt(A)) / sqrt((V * 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 = c0 * (sqrt((a / v)) / sqrt(l))
    if ((v * l) <= (-2d+176)) then
        tmp = t_0
    else if ((v * l) <= (-2d-38)) then
        tmp = c0 * sqrt((a / (v * l)))
    else if ((v * l) <= 5d-320) then
        tmp = t_0
    else
        tmp = (c0 * sqrt(a)) / sqrt((v * 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 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
	double tmp;
	if ((V * l) <= -2e+176) {
		tmp = t_0;
	} else if ((V * l) <= -2e-38) {
		tmp = c0 * Math.sqrt((A / (V * l)));
	} else if ((V * l) <= 5e-320) {
		tmp = t_0;
	} else {
		tmp = (c0 * Math.sqrt(A)) / Math.sqrt((V * l));
	}
	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+176:
		tmp = t_0
	elif (V * l) <= -2e-38:
		tmp = c0 * math.sqrt((A / (V * l)))
	elif (V * l) <= 5e-320:
		tmp = t_0
	else:
		tmp = (c0 * math.sqrt(A)) / math.sqrt((V * l))
	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+176)
		tmp = t_0;
	elseif (Float64(V * l) <= -2e-38)
		tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l))));
	elseif (Float64(V * l) <= 5e-320)
		tmp = t_0;
	else
		tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(V * l)));
	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+176)
		tmp = t_0;
	elseif ((V * l) <= -2e-38)
		tmp = c0 * sqrt((A / (V * l)));
	elseif ((V * l) <= 5e-320)
		tmp = t_0;
	else
		tmp = (c0 * sqrt(A)) / sqrt((V * 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[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+176], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-38], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-320], t$95$0, N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\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^{+176}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-320}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 V l) < -2e176 or -1.9999999999999999e-38 < (*.f64 V l) < 4.99994e-320

    1. Initial program 58.9%

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

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

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

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

    if -2e176 < (*.f64 V l) < -1.9999999999999999e-38

    1. Initial program 96.4%

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

    if 4.99994e-320 < (*.f64 V l)

    1. Initial program 71.7%

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

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

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

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

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

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

Alternative 7: 81.1% accurate, 0.5× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq 6.2 \cdot 10^{-287}:\\ \;\;\;\;c0 \cdot {\left(\frac{1}{\frac{A}{V \cdot \ell}}\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{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 (<= l 6.2e-287)
   (* c0 (pow (/ 1.0 (/ A (* V l))) -0.5))
   (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if (l <= 6.2e-287) {
		tmp = c0 * pow((1.0 / (A / (V * l))), -0.5);
	} else {
		tmp = c0 * (sqrt((A / 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 (l <= 6.2d-287) then
        tmp = c0 * ((1.0d0 / (a / (v * l))) ** (-0.5d0))
    else
        tmp = c0 * (sqrt((a / 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 (l <= 6.2e-287) {
		tmp = c0 * Math.pow((1.0 / (A / (V * l))), -0.5);
	} else {
		tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	tmp = 0
	if l <= 6.2e-287:
		tmp = c0 * math.pow((1.0 / (A / (V * l))), -0.5)
	else:
		tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l))
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (l <= 6.2e-287)
		tmp = Float64(c0 * (Float64(1.0 / Float64(A / Float64(V * l))) ^ -0.5));
	else
		tmp = Float64(c0 * Float64(sqrt(Float64(A / 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 (l <= 6.2e-287)
		tmp = c0 * ((1.0 / (A / (V * l))) ^ -0.5);
	else
		tmp = c0 * (sqrt((A / 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[l, 6.2e-287], N[(c0 * N[Power[N[(1.0 / N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 6.2 \cdot 10^{-287}:\\
\;\;\;\;c0 \cdot {\left(\frac{1}{\frac{A}{V \cdot \ell}}\right)}^{-0.5}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 6.2000000000000001e-287

    1. Initial program 77.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.2000000000000001e-287 < l

    1. Initial program 67.5%

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

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

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

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

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

Alternative 8: 83.2% accurate, 0.5× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{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 (<= l -5e-310)
   (* (sqrt A) (/ c0 (sqrt (* V l))))
   (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if (l <= -5e-310) {
		tmp = sqrt(A) * (c0 / sqrt((V * l)));
	} else {
		tmp = c0 * (sqrt((A / 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 (l <= (-5d-310)) then
        tmp = sqrt(a) * (c0 / sqrt((v * l)))
    else
        tmp = c0 * (sqrt((a / 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 (l <= -5e-310) {
		tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
	} else {
		tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	tmp = 0
	if l <= -5e-310:
		tmp = math.sqrt(A) * (c0 / math.sqrt((V * l)))
	else:
		tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l))
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (l <= -5e-310)
		tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0 * Float64(sqrt(Float64(A / 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 (l <= -5e-310)
		tmp = sqrt(A) * (c0 / sqrt((V * l)));
	else
		tmp = c0 * (sqrt((A / 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[l, -5e-310], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\

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


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

    1. Initial program 77.7%

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

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

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

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

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

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

    if -4.999999999999985e-310 < l

    1. Initial program 67.0%

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

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

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

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

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

Alternative 9: 80.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:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t_0 \leq 2 \cdot 10^{+301}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\ \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) l)))
     (if (<= t_0 2e+301) (* c0 (sqrt t_0)) (* c0 (pow (* V (/ l A)) -0.5))))))
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) / l));
	} else if (t_0 <= 2e+301) {
		tmp = c0 * sqrt(t_0);
	} else {
		tmp = c0 * pow((V * (l / A)), -0.5);
	}
	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) / l))
    else if (t_0 <= 2d+301) then
        tmp = c0 * sqrt(t_0)
    else
        tmp = c0 * ((v * (l / a)) ** (-0.5d0))
    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) / l));
	} else if (t_0 <= 2e+301) {
		tmp = c0 * Math.sqrt(t_0);
	} else {
		tmp = c0 * Math.pow((V * (l / A)), -0.5);
	}
	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) / l))
	elif t_0 <= 2e+301:
		tmp = c0 * math.sqrt(t_0)
	else:
		tmp = c0 * math.pow((V * (l / A)), -0.5)
	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 / V) / l)));
	elseif (t_0 <= 2e+301)
		tmp = Float64(c0 * sqrt(t_0));
	else
		tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5));
	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) / l));
	elseif (t_0 <= 2e+301)
		tmp = c0 * sqrt(t_0);
	else
		tmp = c0 * ((V * (l / A)) ^ -0.5);
	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 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+301], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $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}{V}}{\ell}}\\

\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+301}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\


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

    1. Initial program 32.9%

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left({\left(\frac{A}{V \cdot \ell}\right)}^{0.25}\right)}^{2}} \]
    4. Taylor expanded in c0 around 0 32.9%

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 2.00000000000000011e301

    1. Initial program 98.2%

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

    if 2.00000000000000011e301 < (/.f64 A (*.f64 V l))

    1. Initial program 31.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 80.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:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t_0 \leq 2 \cdot 10^{+299}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\ \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) l)))
     (if (<= t_0 2e+299) (* c0 (sqrt t_0)) (* c0 (pow (* l (/ V A)) -0.5))))))
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) / l));
	} else if (t_0 <= 2e+299) {
		tmp = c0 * sqrt(t_0);
	} else {
		tmp = c0 * pow((l * (V / A)), -0.5);
	}
	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) / l))
    else if (t_0 <= 2d+299) then
        tmp = c0 * sqrt(t_0)
    else
        tmp = c0 * ((l * (v / a)) ** (-0.5d0))
    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) / l));
	} else if (t_0 <= 2e+299) {
		tmp = c0 * Math.sqrt(t_0);
	} else {
		tmp = c0 * Math.pow((l * (V / A)), -0.5);
	}
	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) / l))
	elif t_0 <= 2e+299:
		tmp = c0 * math.sqrt(t_0)
	else:
		tmp = c0 * math.pow((l * (V / A)), -0.5)
	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 / V) / l)));
	elseif (t_0 <= 2e+299)
		tmp = Float64(c0 * sqrt(t_0));
	else
		tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5));
	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) / l));
	elseif (t_0 <= 2e+299)
		tmp = c0 * sqrt(t_0);
	else
		tmp = c0 * ((l * (V / A)) ^ -0.5);
	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 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+299], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $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}{V}}{\ell}}\\

\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\


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

    1. Initial program 32.9%

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left({\left(\frac{A}{V \cdot \ell}\right)}^{0.25}\right)}^{2}} \]
    4. Taylor expanded in c0 around 0 32.9%

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e299

    1. Initial program 98.2%

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

    if 2.0000000000000001e299 < (/.f64 A (*.f64 V l))

    1. Initial program 32.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{e^{-0.5 \cdot \left(\log V + \log \left(\frac{\ell}{A}\right)\right)}} \]
    7. Step-by-step derivation
      1. exp-prod36.6%

        \[\leadsto c0 \cdot \color{blue}{{\left(e^{-0.5}\right)}^{\left(\log V + \log \left(\frac{\ell}{A}\right)\right)}} \]
      2. log-prod45.9%

        \[\leadsto c0 \cdot {\left(e^{-0.5}\right)}^{\color{blue}{\log \left(V \cdot \frac{\ell}{A}\right)}} \]
      3. *-commutative45.9%

        \[\leadsto c0 \cdot {\left(e^{-0.5}\right)}^{\log \color{blue}{\left(\frac{\ell}{A} \cdot V\right)}} \]
      4. associate-*l/33.8%

        \[\leadsto c0 \cdot {\left(e^{-0.5}\right)}^{\log \color{blue}{\left(\frac{\ell \cdot V}{A}\right)}} \]
      5. associate-*r/46.6%

        \[\leadsto c0 \cdot {\left(e^{-0.5}\right)}^{\log \color{blue}{\left(\ell \cdot \frac{V}{A}\right)}} \]
      6. exp-prod46.6%

        \[\leadsto c0 \cdot \color{blue}{e^{-0.5 \cdot \log \left(\ell \cdot \frac{V}{A}\right)}} \]
      7. *-commutative46.6%

        \[\leadsto c0 \cdot e^{\color{blue}{\log \left(\ell \cdot \frac{V}{A}\right) \cdot -0.5}} \]
      8. exp-to-pow48.1%

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

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

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

Alternative 11: 80.3% 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 2 \cdot 10^{+301}\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 2e+301)))
     (* 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 <= 2e+301)) {
		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 <= 2d+301))) 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 <= 2e+301)) {
		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 <= 2e+301):
		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 <= 2e+301))
		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 <= 2e+301)))
		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, 2e+301]], $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 2 \cdot 10^{+301}\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 2.00000000000000011e301 < (/.f64 A (*.f64 V l))

    1. Initial program 32.2%

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 2.00000000000000011e301

    1. Initial program 98.2%

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

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

Alternative 12: 80.3% 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 2 \cdot 10^{+299}\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 2e+299)))
     (* 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 <= 2e+299)) {
		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 <= 2d+299))) 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 <= 2e+299)) {
		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 <= 2e+299):
		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 <= 2e+299))
		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 <= 2e+299)))
		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, 2e+299]], $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 2 \cdot 10^{+299}\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 2.0000000000000001e299 < (/.f64 A (*.f64 V l))

    1. Initial program 32.8%

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left({\left(\frac{A}{V \cdot \ell}\right)}^{0.25}\right)}^{2}} \]
    4. Taylor expanded in c0 around 0 32.8%

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e299

    1. Initial program 98.2%

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

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

Alternative 13: 80.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:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t_0 \leq 2 \cdot 10^{+299}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{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 V) l)))
     (if (<= t_0 2e+299) (* c0 (sqrt t_0)) (/ c0 (sqrt (* l (/ V 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 / V) / l));
	} else if (t_0 <= 2e+299) {
		tmp = c0 * sqrt(t_0);
	} else {
		tmp = c0 / sqrt((l * (V / 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 / v) / l))
    else if (t_0 <= 2d+299) then
        tmp = c0 * sqrt(t_0)
    else
        tmp = c0 / sqrt((l * (v / 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 / V) / l));
	} else if (t_0 <= 2e+299) {
		tmp = c0 * Math.sqrt(t_0);
	} else {
		tmp = c0 / Math.sqrt((l * (V / 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 / V) / l))
	elif t_0 <= 2e+299:
		tmp = c0 * math.sqrt(t_0)
	else:
		tmp = c0 / math.sqrt((l * (V / 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 / V) / l)));
	elseif (t_0 <= 2e+299)
		tmp = Float64(c0 * sqrt(t_0));
	else
		tmp = Float64(c0 / sqrt(Float64(l * Float64(V / 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 / V) / l));
	elseif (t_0 <= 2e+299)
		tmp = c0 * sqrt(t_0);
	else
		tmp = c0 / sqrt((l * (V / 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 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+299], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / 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}{V}}{\ell}}\\

\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\

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


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

    1. Initial program 32.9%

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left({\left(\frac{A}{V \cdot \ell}\right)}^{0.25}\right)}^{2}} \]
    4. Taylor expanded in c0 around 0 32.9%

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e299

    1. Initial program 98.2%

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

    if 2.0000000000000001e299 < (/.f64 A (*.f64 V l))

    1. Initial program 32.8%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{c0}{\sqrt{V \cdot \ell}} \cdot \sqrt{A}\right)} - 1} \]
      3. associate-*l/24.4%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}}\right)} - 1 \]
      4. associate-/l*24.4%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}}\right)} - 1 \]
      5. sqrt-div13.7%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{c0}{\color{blue}{\sqrt{\frac{V \cdot \ell}{A}}}}\right)} - 1 \]
      6. associate-*r/19.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{c0}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}}\right)} - 1 \]
      7. associate-*r/13.7%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{c0}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}}\right)} - 1 \]
      8. associate-*l/19.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{c0}{\sqrt{\color{blue}{\frac{V}{A} \cdot \ell}}}\right)} - 1 \]
      9. *-commutative19.2%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{c0}{\sqrt{\color{blue}{\ell \cdot \frac{V}{A}}}}\right)} - 1 \]
    7. Applied egg-rr19.2%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def23.3%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\right)\right)} \]
      2. expm1-log1p48.0%

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

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

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

Alternative 14: 73.9% 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 72.4%

    \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
  2. Final simplification72.4%

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

Reproduce

?
herbie shell --seed 2023256 
(FPCore (c0 A V l)
  :name "Henrywood and Agarwal, Equation (3)"
  :precision binary64
  (* c0 (sqrt (/ A (* V l)))))