Henrywood and Agarwal, Equation (3)

Percentage Accurate: 73.2% → 88.1%
Time: 15.1s
Alternatives: 17
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 73.2% 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.1% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 58.0%

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

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

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

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

    if -5.0000000000000005e251 < (*.f64 V l) < -5.00000000000000018e-98

    1. Initial program 96.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000018e-98 < (*.f64 V l) < -0.0

    1. Initial program 60.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 V l)

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

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

\mathbf{elif}\;t_0 \leq 4 \cdot 10^{+283}:\\
\;\;\;\;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)))) < -0.0

    1. Initial program 76.1%

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

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

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

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

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

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

    if -0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999982e283

    1. Initial program 99.3%

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

    if 3.99999999999999982e283 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 41.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 0:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 4 \cdot 10^{+283}:\\ \;\;\;\;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: 89.9% accurate, 0.3× speedup?

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

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


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

    1. Initial program 76.4%

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

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

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

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

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

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

        \[\leadsto {\color{blue}{\left(\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot c0\right)\right)}}^{0.5} \]
      7. add-sqr-sqrt26.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < A

    1. Initial program 79.4%

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

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

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

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

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

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

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

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

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

Alternative 4: 86.7% accurate, 0.3× speedup?

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

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


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

    1. Initial program 76.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < V

    1. Initial program 79.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 90.2% accurate, 0.3× speedup?

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

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


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

    1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < A

    1. Initial program 79.4%

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

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

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

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

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

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

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

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

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

Alternative 6: 88.2% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 58.0%

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

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

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

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

    if -5.0000000000000005e251 < (*.f64 V l) < -5.00000000000000018e-98

    1. Initial program 96.6%

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

        \[\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 -5.00000000000000018e-98 < (*.f64 V l) < -0.0

    1. Initial program 60.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 V l)

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 58.0%

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

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

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

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

    if -5.0000000000000005e251 < (*.f64 V l) < -5.0000000000000003e-293

    1. Initial program 89.7%

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

        \[\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 -5.0000000000000003e-293 < (*.f64 V l) < -0.0

    1. Initial program 47.0%

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 V l)

    1. Initial program 84.0%

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

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

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

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

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

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

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

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

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

Alternative 8: 81.4% accurate, 0.5× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 5 \cdot 10^{-291} \lor \neg \left(t_0 \leq 10^{+294}\right):\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\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 5e-291) (not (<= t_0 1e+294)))
     (* c0 (/ (sqrt (/ A V)) (sqrt 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 <= 5e-291) || !(t_0 <= 1e+294)) {
		tmp = c0 * (sqrt((A / V)) / sqrt(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 <= 5d-291) .or. (.not. (t_0 <= 1d+294))) then
        tmp = c0 * (sqrt((a / v)) / sqrt(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 <= 5e-291) || !(t_0 <= 1e+294)) {
		tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(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 <= 5e-291) or not (t_0 <= 1e+294):
		tmp = c0 * (math.sqrt((A / V)) / math.sqrt(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 <= 5e-291) || !(t_0 <= 1e+294))
		tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(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 <= 5e-291) || ~((t_0 <= 1e+294)))
		tmp = c0 * (sqrt((A / V)) / sqrt(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, 5e-291], N[Not[LessEqual[t$95$0, 1e+294]], $MachinePrecision]], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[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 5 \cdot 10^{-291} \lor \neg \left(t_0 \leq 10^{+294}\right):\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\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)) < 5.0000000000000003e-291 or 1.00000000000000007e294 < (/.f64 A (*.f64 V l))

    1. Initial program 41.0%

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

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

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

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

    if 5.0000000000000003e-291 < (/.f64 A (*.f64 V l)) < 1.00000000000000007e294

    1. Initial program 99.6%

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

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

Alternative 9: 84.5% accurate, 0.5× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -4 \cdot 10^{-310}:\\ \;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\ \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 -4e-310)
   (* c0 (* (sqrt A) (pow (* 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 <= -4e-310) {
		tmp = c0 * (sqrt(A) * pow((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 <= (-4d-310)) then
        tmp = c0 * (sqrt(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 <= -4e-310) {
		tmp = c0 * (Math.sqrt(A) * Math.pow((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 <= -4e-310:
		tmp = c0 * (math.sqrt(A) * math.pow((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 <= -4e-310)
		tmp = Float64(c0 * Float64(sqrt(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 <= -4e-310)
		tmp = c0 * (sqrt(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, -4e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $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 -4 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\

\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 < -3.999999999999988e-310

    1. Initial program 82.8%

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < l

    1. Initial program 73.5%

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

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

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

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

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

Alternative 10: 83.9% accurate, 0.5× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -4 \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 -4e-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 <= -4e-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 <= (-4d-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 <= -4e-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 <= -4e-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 <= -4e-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 <= -4e-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, -4e-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 -4 \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 < -3.999999999999988e-310

    1. Initial program 82.8%

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

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

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

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

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

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

    if -3.999999999999988e-310 < l

    1. Initial program 73.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -4 \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 11: 84.4% accurate, 0.5× speedup?

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

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


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

    1. Initial program 76.4%

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

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

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

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

    if -4.999999999999985e-310 < A

    1. Initial program 79.4%

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

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

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

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

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

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

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

Alternative 12: 79.6% accurate, 0.9× speedup?

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

\mathbf{elif}\;t_0 \leq 10^{+294}:\\
\;\;\;\;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)) < 5.0000000000000003e-291

    1. Initial program 37.0%

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

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

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

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

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

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

    if 5.0000000000000003e-291 < (/.f64 A (*.f64 V l)) < 1.00000000000000007e294

    1. Initial program 99.6%

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

    if 1.00000000000000007e294 < (/.f64 A (*.f64 V l))

    1. Initial program 43.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{{\left(V \cdot \frac{\ell}{A}\right)}^{\color{blue}{\left(-0.5 + -0.5\right)}}} \]
      7. pow-prod-up54.8%

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

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

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

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

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

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

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

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

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

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

Alternative 13: 79.8% accurate, 0.9× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\ \mathbf{elif}\;t_0 \leq 10^{+294}:\\ \;\;\;\;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 (pow (/ V (/ A l)) -0.5))
     (if (<= t_0 1e+294) (* 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 * pow((V / (A / l)), -0.5);
	} else if (t_0 <= 1e+294) {
		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 * ((v / (a / l)) ** (-0.5d0))
    else if (t_0 <= 1d+294) 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.pow((V / (A / l)), -0.5);
	} else if (t_0 <= 1e+294) {
		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.pow((V / (A / l)), -0.5)
	elif t_0 <= 1e+294:
		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 * (Float64(V / Float64(A / l)) ^ -0.5));
	elseif (t_0 <= 1e+294)
		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 * ((V / (A / l)) ^ -0.5);
	elseif (t_0 <= 1e+294)
		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[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+294], 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 {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\

\mathbf{elif}\;t_0 \leq 10^{+294}:\\
\;\;\;\;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 33.4%

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 1.00000000000000007e294

    1. Initial program 99.2%

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

    if 1.00000000000000007e294 < (/.f64 A (*.f64 V l))

    1. Initial program 43.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{{\left(V \cdot \frac{\ell}{A}\right)}^{\color{blue}{\left(-0.5 + -0.5\right)}}} \]
      7. pow-prod-up54.8%

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

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

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

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

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

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

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

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

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

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

Alternative 14: 79.2% accurate, 0.9× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 5 \cdot 10^{-291} \lor \neg \left(t_0 \leq 10^{+294}\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 5e-291) (not (<= t_0 1e+294)))
     (* 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 <= 5e-291) || !(t_0 <= 1e+294)) {
		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 <= 5d-291) .or. (.not. (t_0 <= 1d+294))) 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 <= 5e-291) || !(t_0 <= 1e+294)) {
		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 <= 5e-291) or not (t_0 <= 1e+294):
		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 <= 5e-291) || !(t_0 <= 1e+294))
		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 <= 5e-291) || ~((t_0 <= 1e+294)))
		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, 5e-291], N[Not[LessEqual[t$95$0, 1e+294]], $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 5 \cdot 10^{-291} \lor \neg \left(t_0 \leq 10^{+294}\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)) < 5.0000000000000003e-291 or 1.00000000000000007e294 < (/.f64 A (*.f64 V l))

    1. Initial program 41.0%

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

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

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

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

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

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

    if 5.0000000000000003e-291 < (/.f64 A (*.f64 V l)) < 1.00000000000000007e294

    1. Initial program 99.6%

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

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

Alternative 15: 78.6% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 37.0%

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

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

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

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

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

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

    if 5.0000000000000003e-291 < (/.f64 A (*.f64 V l)) < 2.00000000000000009e248

    1. Initial program 99.6%

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

    if 2.00000000000000009e248 < (/.f64 A (*.f64 V l))

    1. Initial program 44.3%

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

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

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

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

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

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

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

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

Alternative 16: 79.6% accurate, 0.9× speedup?

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

\mathbf{elif}\;t_0 \leq 10^{+294}:\\
\;\;\;\;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)) < 5.0000000000000003e-291

    1. Initial program 37.0%

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

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

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

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

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

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

    if 5.0000000000000003e-291 < (/.f64 A (*.f64 V l)) < 1.00000000000000007e294

    1. Initial program 99.6%

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

    if 1.00000000000000007e294 < (/.f64 A (*.f64 V l))

    1. Initial program 43.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 73.2% 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 77.8%

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

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

Reproduce

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