Henrywood and Agarwal, Equation (3)

Percentage Accurate: 73.0% → 89.9%
Time: 8.8s
Alternatives: 9
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 9 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 73.0% accurate, 1.0× speedup?

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

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

Alternative 1: 89.9% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;t_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 V l) < -1e269 or -9.99999999999999931e-304 < (*.f64 V l) < -0.0

    1. Initial program 49.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e269 < (*.f64 V l) < -9.99999999999999931e-304

    1. Initial program 86.3%

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

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

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

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

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

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

    if -0.0 < (*.f64 V l) < 5.0000000000000004e283

    1. Initial program 86.5%

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

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

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

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

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

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

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

    if 5.0000000000000004e283 < (*.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-pow31.3%

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    4. Step-by-step derivation
      1. metadata-eval52.7%

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

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

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

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      5. div-inv52.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}} \]
      12. *-un-lft-identity52.8%

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

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

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

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

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

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

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

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

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

Alternative 2: 89.8% accurate, 0.3× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if A < -9.999999999999969e-311

    1. Initial program 79.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.999999999999969e-311 < A

    1. Initial program 74.4%

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

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

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

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

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

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

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

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

Alternative 3: 85.3% 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}\;\ell \cdot V \leq -2 \cdot 10^{+147}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;\ell \cdot V \leq -5 \cdot 10^{-198}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{\ell \cdot V}{A}}}\\ \mathbf{elif}\;\ell \cdot V \leq 0 \lor \neg \left(\ell \cdot V \leq 5 \cdot 10^{+283}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{\ell \cdot V}}\\ \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 (<= (* l V) -2e+147)
     t_0
     (if (<= (* l V) -5e-198)
       (/ c0 (sqrt (/ (* l V) A)))
       (if (or (<= (* l V) 0.0) (not (<= (* l V) 5e+283)))
         t_0
         (* (sqrt A) (/ c0 (sqrt (* l V)))))))))
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 ((l * V) <= -2e+147) {
		tmp = t_0;
	} else if ((l * V) <= -5e-198) {
		tmp = c0 / sqrt(((l * V) / A));
	} else if (((l * V) <= 0.0) || !((l * V) <= 5e+283)) {
		tmp = t_0;
	} else {
		tmp = sqrt(A) * (c0 / sqrt((l * 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)) / sqrt(l))
    if ((l * v) <= (-2d+147)) then
        tmp = t_0
    else if ((l * v) <= (-5d-198)) then
        tmp = c0 / sqrt(((l * v) / a))
    else if (((l * v) <= 0.0d0) .or. (.not. ((l * v) <= 5d+283))) then
        tmp = t_0
    else
        tmp = sqrt(a) * (c0 / sqrt((l * 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)) / Math.sqrt(l));
	double tmp;
	if ((l * V) <= -2e+147) {
		tmp = t_0;
	} else if ((l * V) <= -5e-198) {
		tmp = c0 / Math.sqrt(((l * V) / A));
	} else if (((l * V) <= 0.0) || !((l * V) <= 5e+283)) {
		tmp = t_0;
	} else {
		tmp = Math.sqrt(A) * (c0 / Math.sqrt((l * V)));
	}
	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 (l * V) <= -2e+147:
		tmp = t_0
	elif (l * V) <= -5e-198:
		tmp = c0 / math.sqrt(((l * V) / A))
	elif ((l * V) <= 0.0) or not ((l * V) <= 5e+283):
		tmp = t_0
	else:
		tmp = math.sqrt(A) * (c0 / math.sqrt((l * V)))
	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(l * V) <= -2e+147)
		tmp = t_0;
	elseif (Float64(l * V) <= -5e-198)
		tmp = Float64(c0 / sqrt(Float64(Float64(l * V) / A)));
	elseif ((Float64(l * V) <= 0.0) || !(Float64(l * V) <= 5e+283))
		tmp = t_0;
	else
		tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(l * 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)) / sqrt(l));
	tmp = 0.0;
	if ((l * V) <= -2e+147)
		tmp = t_0;
	elseif ((l * V) <= -5e-198)
		tmp = c0 / sqrt(((l * V) / A));
	elseif (((l * V) <= 0.0) || ~(((l * V) <= 5e+283)))
		tmp = t_0;
	else
		tmp = sqrt(A) * (c0 / sqrt((l * 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[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(l * V), $MachinePrecision], -2e+147], t$95$0, If[LessEqual[N[(l * V), $MachinePrecision], -5e-198], N[(c0 / N[Sqrt[N[(N[(l * V), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(l * V), $MachinePrecision], 0.0], N[Not[LessEqual[N[(l * V), $MachinePrecision], 5e+283]], $MachinePrecision]], t$95$0, N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(l * V), $MachinePrecision]], $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}\;\ell \cdot V \leq -2 \cdot 10^{+147}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;\ell \cdot V \leq 0 \lor \neg \left(\ell \cdot V \leq 5 \cdot 10^{+283}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 V l) < -2e147 or -4.9999999999999999e-198 < (*.f64 V l) < -0.0 or 5.0000000000000004e283 < (*.f64 V l)

    1. Initial program 54.4%

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

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

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

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

    if -2e147 < (*.f64 V l) < -4.9999999999999999e-198

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      5. div-inv84.5%

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 V l) < 5.0000000000000004e283

    1. Initial program 86.5%

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

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

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

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

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

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

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

Alternative 4: 86.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}\;\ell \cdot V \leq -2 \cdot 10^{+147}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;\ell \cdot V \leq -5 \cdot 10^{-198}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{\ell \cdot V}{A}}}\\ \mathbf{elif}\;\ell \cdot V \leq 0 \lor \neg \left(\ell \cdot V \leq 5 \cdot 10^{+283}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\ \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 (<= (* l V) -2e+147)
     t_0
     (if (<= (* l V) -5e-198)
       (/ c0 (sqrt (/ (* l V) A)))
       (if (or (<= (* l V) 0.0) (not (<= (* l V) 5e+283)))
         t_0
         (* c0 (/ (sqrt A) (sqrt (* l V)))))))))
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 ((l * V) <= -2e+147) {
		tmp = t_0;
	} else if ((l * V) <= -5e-198) {
		tmp = c0 / sqrt(((l * V) / A));
	} else if (((l * V) <= 0.0) || !((l * V) <= 5e+283)) {
		tmp = t_0;
	} else {
		tmp = c0 * (sqrt(A) / sqrt((l * 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)) / sqrt(l))
    if ((l * v) <= (-2d+147)) then
        tmp = t_0
    else if ((l * v) <= (-5d-198)) then
        tmp = c0 / sqrt(((l * v) / a))
    else if (((l * v) <= 0.0d0) .or. (.not. ((l * v) <= 5d+283))) then
        tmp = t_0
    else
        tmp = c0 * (sqrt(a) / sqrt((l * 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)) / Math.sqrt(l));
	double tmp;
	if ((l * V) <= -2e+147) {
		tmp = t_0;
	} else if ((l * V) <= -5e-198) {
		tmp = c0 / Math.sqrt(((l * V) / A));
	} else if (((l * V) <= 0.0) || !((l * V) <= 5e+283)) {
		tmp = t_0;
	} else {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
	}
	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 (l * V) <= -2e+147:
		tmp = t_0
	elif (l * V) <= -5e-198:
		tmp = c0 / math.sqrt(((l * V) / A))
	elif ((l * V) <= 0.0) or not ((l * V) <= 5e+283):
		tmp = t_0
	else:
		tmp = c0 * (math.sqrt(A) / math.sqrt((l * V)))
	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(l * V) <= -2e+147)
		tmp = t_0;
	elseif (Float64(l * V) <= -5e-198)
		tmp = Float64(c0 / sqrt(Float64(Float64(l * V) / A)));
	elseif ((Float64(l * V) <= 0.0) || !(Float64(l * V) <= 5e+283))
		tmp = t_0;
	else
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * 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)) / sqrt(l));
	tmp = 0.0;
	if ((l * V) <= -2e+147)
		tmp = t_0;
	elseif ((l * V) <= -5e-198)
		tmp = c0 / sqrt(((l * V) / A));
	elseif (((l * V) <= 0.0) || ~(((l * V) <= 5e+283)))
		tmp = t_0;
	else
		tmp = c0 * (sqrt(A) / sqrt((l * 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[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(l * V), $MachinePrecision], -2e+147], t$95$0, If[LessEqual[N[(l * V), $MachinePrecision], -5e-198], N[(c0 / N[Sqrt[N[(N[(l * V), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(l * V), $MachinePrecision], 0.0], N[Not[LessEqual[N[(l * V), $MachinePrecision], 5e+283]], $MachinePrecision]], t$95$0, N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $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}\;\ell \cdot V \leq -2 \cdot 10^{+147}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;\ell \cdot V \leq 0 \lor \neg \left(\ell \cdot V \leq 5 \cdot 10^{+283}\right):\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 V l) < -2e147 or -4.9999999999999999e-198 < (*.f64 V l) < -0.0 or 5.0000000000000004e283 < (*.f64 V l)

    1. Initial program 54.4%

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

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

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

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

    if -2e147 < (*.f64 V l) < -4.9999999999999999e-198

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      5. div-inv84.5%

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 V l) < 5.0000000000000004e283

    1. Initial program 86.5%

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

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

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

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

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

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

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

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

Alternative 5: 86.5% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 V l) < -2e147 or -4.9999999999999999e-198 < (*.f64 V l) < -0.0

    1. Initial program 59.9%

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

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

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

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

    if -2e147 < (*.f64 V l) < -4.9999999999999999e-198

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      5. div-inv84.5%

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 V l) < 5.0000000000000004e283

    1. Initial program 86.5%

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

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

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

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

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

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

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

    if 5.0000000000000004e283 < (*.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-pow31.3%

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    4. Step-by-step derivation
      1. metadata-eval52.7%

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

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

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

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      5. div-inv52.9%

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

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

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

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

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

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

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

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

      \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{\ell \cdot V}{A}}}} \]
    10. Step-by-step derivation
      1. /-rgt-identity31.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;t_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 V l) < -2e147 or -4.9999999999999999e-198 < (*.f64 V l) < -0.0

    1. Initial program 59.9%

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

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

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

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

    if -2e147 < (*.f64 V l) < -4.9999999999999999e-198

    1. Initial program 94.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      5. div-inv84.5%

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 V l) < 5.0000000000000004e283

    1. Initial program 86.5%

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

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

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

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

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

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

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

    if 5.0000000000000004e283 < (*.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-pow31.3%

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    4. Step-by-step derivation
      1. metadata-eval52.7%

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

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

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

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      5. div-inv52.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}} \]
      12. *-un-lft-identity52.8%

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

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

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

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

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

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

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

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

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

Alternative 7: 82.4% accurate, 0.5× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 A (*.f64 V l)) < 5.00000000002e-313 or 2e297 < (/.f64 A (*.f64 V l))

    1. Initial program 37.5%

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

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

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

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

    if 5.00000000002e-313 < (/.f64 A (*.f64 V l)) < 2e297

    1. Initial program 99.5%

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

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    4. Step-by-step derivation
      1. metadata-eval91.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 79.7% accurate, 0.9× speedup?

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

\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 2e297 < (/.f64 A (*.f64 V l))

    1. Initial program 36.7%

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

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    4. Step-by-step derivation
      1. metadata-eval48.3%

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 2e297

    1. Initial program 98.8%

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

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

Alternative 9: 73.0% accurate, 1.0× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ c0 \cdot \sqrt{\frac{A}{\ell \cdot V}} \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 (* l V)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	return c0 * sqrt((A / (l * V)));
}
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 / (l * v)))
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
	return c0 * Math.sqrt((A / (l * V)));
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	return c0 * math.sqrt((A / (l * V)))
V, l = sort([V, l])
function code(c0, A, V, l)
	return Float64(c0 * sqrt(Float64(A / Float64(l * V))))
end
V, l = num2cell(sort([V, l])){:}
function tmp = code(c0, A, V, l)
	tmp = c0 * sqrt((A / (l * V)));
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[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}
\end{array}
Derivation
  1. Initial program 76.7%

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

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

Reproduce

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