Henrywood and Agarwal, Equation (3)

Percentage Accurate: 73.7% → 96.7%
Time: 9.4s
Alternatives: 14
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 73.7% 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: 96.7% accurate, 0.3× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ c0 \cdot {\left(\frac{\sqrt[3]{A} \cdot \sqrt[3]{\frac{1}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (* c0 (pow (/ (* (cbrt A) (cbrt (/ 1.0 V))) (cbrt l)) 1.5)))
assert(V < l);
double code(double c0, double A, double V, double l) {
	return c0 * pow(((cbrt(A) * cbrt((1.0 / V))) / cbrt(l)), 1.5);
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
	return c0 * Math.pow(((Math.cbrt(A) * Math.cbrt((1.0 / V))) / Math.cbrt(l)), 1.5);
}
V, l = sort([V, l])
function code(c0, A, V, l)
	return Float64(c0 * (Float64(Float64(cbrt(A) * cbrt(Float64(1.0 / V))) / cbrt(l)) ^ 1.5))
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := N[(c0 * N[Power[N[(N[(N[Power[A, 1/3], $MachinePrecision] * N[Power[N[(1.0 / V), $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
c0 \cdot {\left(\frac{\sqrt[3]{A} \cdot \sqrt[3]{\frac{1}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}
\end{array}
Derivation
  1. Initial program 71.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto c0 \cdot {\left(\frac{\color{blue}{\sqrt[3]{\frac{A}{V}}}}{\sqrt[3]{\ell}}\right)}^{1.5} \]
  7. Simplified82.6%

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

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

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

    \[\leadsto c0 \cdot {\left(\frac{\color{blue}{\sqrt[3]{A} \cdot \sqrt[3]{\frac{1}{V}}}}{\sqrt[3]{\ell}}\right)}^{1.5} \]
  10. Final simplification97.1%

    \[\leadsto c0 \cdot {\left(\frac{\sqrt[3]{A} \cdot \sqrt[3]{\frac{1}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5} \]

Alternative 2: 96.7% accurate, 0.3× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ c0 \cdot {\left(\frac{\frac{\sqrt[3]{A}}{\sqrt[3]{V}}}{\sqrt[3]{\ell}}\right)}^{1.5} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (* c0 (pow (/ (/ (cbrt A) (cbrt V)) (cbrt l)) 1.5)))
assert(V < l);
double code(double c0, double A, double V, double l) {
	return c0 * pow(((cbrt(A) / cbrt(V)) / cbrt(l)), 1.5);
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
	return c0 * Math.pow(((Math.cbrt(A) / Math.cbrt(V)) / Math.cbrt(l)), 1.5);
}
V, l = sort([V, l])
function code(c0, A, V, l)
	return Float64(c0 * (Float64(Float64(cbrt(A) / cbrt(V)) / cbrt(l)) ^ 1.5))
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := N[(c0 * N[Power[N[(N[(N[Power[A, 1/3], $MachinePrecision] / N[Power[V, 1/3], $MachinePrecision]), $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
c0 \cdot {\left(\frac{\frac{\sqrt[3]{A}}{\sqrt[3]{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}
\end{array}
Derivation
  1. Initial program 71.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto c0 \cdot {\left(\frac{\color{blue}{\sqrt[3]{\frac{A}{V}}}}{\sqrt[3]{\ell}}\right)}^{1.5} \]
  7. Simplified82.6%

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

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

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

    \[\leadsto c0 \cdot {\left(\frac{\frac{\sqrt[3]{A}}{\sqrt[3]{V}}}{\sqrt[3]{\ell}}\right)}^{1.5} \]

Alternative 3: 94.8% accurate, 0.3× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+269}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}{c0}}\\ \mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-306}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-316} \lor \neg \left(V \cdot \ell \leq 4 \cdot 10^{+278}\right):\\ \;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot {\left(\frac{1}{A}\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) -1e+269)
   (/ 1.0 (/ (* (sqrt (/ V A)) (sqrt l)) c0))
   (if (<= (* V l) -4e-306)
     (* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
     (if (or (<= (* V l) 2e-316) (not (<= (* V l) 4e+278)))
       (* c0 (pow (/ (cbrt (/ A V)) (cbrt l)) 1.5))
       (* c0 (* (pow (* V l) -0.5) (pow (/ 1.0 A) -0.5)))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e+269) {
		tmp = 1.0 / ((sqrt((V / A)) * sqrt(l)) / c0);
	} else if ((V * l) <= -4e-306) {
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	} else if (((V * l) <= 2e-316) || !((V * l) <= 4e+278)) {
		tmp = c0 * pow((cbrt((A / V)) / cbrt(l)), 1.5);
	} else {
		tmp = c0 * (pow((V * l), -0.5) * pow((1.0 / A), -0.5));
	}
	return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e+269) {
		tmp = 1.0 / ((Math.sqrt((V / A)) * Math.sqrt(l)) / c0);
	} else if ((V * l) <= -4e-306) {
		tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if (((V * l) <= 2e-316) || !((V * l) <= 4e+278)) {
		tmp = c0 * Math.pow((Math.cbrt((A / V)) / Math.cbrt(l)), 1.5);
	} else {
		tmp = c0 * (Math.pow((V * l), -0.5) * Math.pow((1.0 / A), -0.5));
	}
	return tmp;
}
V, l = sort([V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= -1e+269)
		tmp = Float64(1.0 / Float64(Float64(sqrt(Float64(V / A)) * sqrt(l)) / c0));
	elseif (Float64(V * l) <= -4e-306)
		tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif ((Float64(V * l) <= 2e-316) || !(Float64(V * l) <= 4e+278))
		tmp = Float64(c0 * (Float64(cbrt(Float64(A / V)) / cbrt(l)) ^ 1.5));
	else
		tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * (Float64(1.0 / A) ^ -0.5)));
	end
	return tmp
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+269], N[(1.0 / N[(N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-306], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 2e-316], N[Not[LessEqual[N[(V * l), $MachinePrecision], 4e+278]], $MachinePrecision]], N[(c0 * N[Power[N[(N[Power[N[(A / V), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Power[N[(1.0 / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+269}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}{c0}}\\

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

\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-316} \lor \neg \left(V \cdot \ell \leq 4 \cdot 10^{+278}\right):\\
\;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}\\

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


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

    1. Initial program 59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e269 < (*.f64 V l) < -4.00000000000000011e-306

    1. Initial program 82.7%

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

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

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

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

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

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

    if -4.00000000000000011e-306 < (*.f64 V l) < 2.000000017e-316 or 3.99999999999999985e278 < (*.f64 V l)

    1. Initial program 32.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.000000017e-316 < (*.f64 V l) < 3.99999999999999985e278

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+269}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}{c0}}\\ \mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-306}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-316} \lor \neg \left(V \cdot \ell \leq 4 \cdot 10^{+278}\right):\\ \;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot {\left(\frac{1}{A}\right)}^{-0.5}\right)\\ \end{array} \]

Alternative 4: 94.8% accurate, 0.3× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+269}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}{c0}}\\ \mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-306}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-316}:\\ \;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}\\ \mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+278}:\\ \;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot {\left(\frac{1}{A}\right)}^{-0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{\ell}}}{\sqrt[3]{V}}\right)}^{1.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
 (if (<= (* V l) -1e+269)
   (/ 1.0 (/ (* (sqrt (/ V A)) (sqrt l)) c0))
   (if (<= (* V l) -4e-306)
     (* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
     (if (<= (* V l) 2e-316)
       (* c0 (pow (/ (cbrt (/ A V)) (cbrt l)) 1.5))
       (if (<= (* V l) 4e+278)
         (* c0 (* (pow (* V l) -0.5) (pow (/ 1.0 A) -0.5)))
         (* c0 (pow (/ (cbrt (/ A l)) (cbrt V)) 1.5)))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e+269) {
		tmp = 1.0 / ((sqrt((V / A)) * sqrt(l)) / c0);
	} else if ((V * l) <= -4e-306) {
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	} else if ((V * l) <= 2e-316) {
		tmp = c0 * pow((cbrt((A / V)) / cbrt(l)), 1.5);
	} else if ((V * l) <= 4e+278) {
		tmp = c0 * (pow((V * l), -0.5) * pow((1.0 / A), -0.5));
	} else {
		tmp = c0 * pow((cbrt((A / l)) / cbrt(V)), 1.5);
	}
	return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e+269) {
		tmp = 1.0 / ((Math.sqrt((V / A)) * Math.sqrt(l)) / c0);
	} else if ((V * l) <= -4e-306) {
		tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if ((V * l) <= 2e-316) {
		tmp = c0 * Math.pow((Math.cbrt((A / V)) / Math.cbrt(l)), 1.5);
	} else if ((V * l) <= 4e+278) {
		tmp = c0 * (Math.pow((V * l), -0.5) * Math.pow((1.0 / A), -0.5));
	} else {
		tmp = c0 * Math.pow((Math.cbrt((A / l)) / Math.cbrt(V)), 1.5);
	}
	return tmp;
}
V, l = sort([V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= -1e+269)
		tmp = Float64(1.0 / Float64(Float64(sqrt(Float64(V / A)) * sqrt(l)) / c0));
	elseif (Float64(V * l) <= -4e-306)
		tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif (Float64(V * l) <= 2e-316)
		tmp = Float64(c0 * (Float64(cbrt(Float64(A / V)) / cbrt(l)) ^ 1.5));
	elseif (Float64(V * l) <= 4e+278)
		tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * (Float64(1.0 / A) ^ -0.5)));
	else
		tmp = Float64(c0 * (Float64(cbrt(Float64(A / l)) / cbrt(V)) ^ 1.5));
	end
	return tmp
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+269], N[(1.0 / N[(N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-306], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-316], N[(c0 * N[Power[N[(N[Power[N[(A / V), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+278], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Power[N[(1.0 / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(N[Power[N[(A / l), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[V, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+269}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}{c0}}\\

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

\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-316}:\\
\;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}\\

\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+278}:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot {\left(\frac{1}{A}\right)}^{-0.5}\right)\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{\ell}}}{\sqrt[3]{V}}\right)}^{1.5}\\


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

    1. Initial program 59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e269 < (*.f64 V l) < -4.00000000000000011e-306

    1. Initial program 82.7%

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

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

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

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

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

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

    if -4.00000000000000011e-306 < (*.f64 V l) < 2.000000017e-316

    1. Initial program 38.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.000000017e-316 < (*.f64 V l) < 3.99999999999999985e278

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999985e278 < (*.f64 V l)

    1. Initial program 24.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+269}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}{c0}}\\ \mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-306}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-316}:\\ \;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}\\ \mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+278}:\\ \;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot {\left(\frac{1}{A}\right)}^{-0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{\ell}}}{\sqrt[3]{V}}\right)}^{1.5}\\ \end{array} \]

Alternative 5: 90.9% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+278}:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot {\left(\frac{1}{A}\right)}^{-0.5}\right)\\

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


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

    1. Initial program 59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e269 < (*.f64 V l) < -4.00000000000000011e-306

    1. Initial program 82.7%

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

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

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

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

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

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

    if -4.00000000000000011e-306 < (*.f64 V l) < 2.000000017e-316

    1. Initial program 38.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.000000017e-316 < (*.f64 V l) < 3.99999999999999985e278

    1. Initial program 85.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999985e278 < (*.f64 V l)

    1. Initial program 24.8%

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

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

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

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

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

Alternative 6: 85.8% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 V l) < -2.0000000000000002e252 or -1.9999999999999999e-143 < (*.f64 V l) < -0.0

    1. Initial program 47.4%

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

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

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

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

    if -2.0000000000000002e252 < (*.f64 V l) < -1.9999999999999999e-143

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 V l) < 3.99999999999999985e278

    1. Initial program 85.4%

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

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

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

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

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

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

    if 3.99999999999999985e278 < (*.f64 V l)

    1. Initial program 24.8%

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

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

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

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

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

Alternative 7: 87.2% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 V l) < -2.0000000000000002e252 or -1.9999999999999999e-143 < (*.f64 V l) < -0.0

    1. Initial program 47.4%

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

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

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

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

    if -2.0000000000000002e252 < (*.f64 V l) < -1.9999999999999999e-143

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 V l) < 3.99999999999999985e278

    1. Initial program 85.4%

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

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

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

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

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

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

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

    if 3.99999999999999985e278 < (*.f64 V l)

    1. Initial program 24.8%

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

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

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

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

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

Alternative 8: 87.1% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 V l) < -2.0000000000000002e252 or -9.99999999999999921e-227 < (*.f64 V l) < -0.0

    1. Initial program 40.3%

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000002e252 < (*.f64 V l) < -9.99999999999999921e-227

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 V l) < 3.99999999999999985e278

    1. Initial program 85.4%

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

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

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

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

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

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

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

    if 3.99999999999999985e278 < (*.f64 V l)

    1. Initial program 24.8%

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 51.8%

      \[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. *-commutative79.2%

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

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

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

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

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

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

    if -5.0000000000000001e296 < (*.f64 V l) < -4.00000000000000011e-306

    1. Initial program 82.9%

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

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

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

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

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

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

    if -4.00000000000000011e-306 < (*.f64 V l) < 2.000000017e-316

    1. Initial program 38.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.000000017e-316 < (*.f64 V l) < 3.99999999999999985e278

    1. Initial program 85.9%

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

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

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

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

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

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

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

    if 3.99999999999999985e278 < (*.f64 V l)

    1. Initial program 24.8%

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

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

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

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

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

Alternative 10: 90.9% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 59.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e269 < (*.f64 V l) < -4.00000000000000011e-306

    1. Initial program 82.7%

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

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

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

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

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

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

    if -4.00000000000000011e-306 < (*.f64 V l) < 2.000000017e-316

    1. Initial program 38.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.000000017e-316 < (*.f64 V l) < 3.99999999999999985e278

    1. Initial program 85.9%

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

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

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

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

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

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

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

    if 3.99999999999999985e278 < (*.f64 V l)

    1. Initial program 24.8%

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

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

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

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

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

Alternative 11: 81.3% accurate, 0.5× speedup?

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

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


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

    1. Initial program 71.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < l

    1. Initial program 71.1%

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

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

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

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

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

Alternative 12: 79.9% accurate, 0.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 A (*.f64 V l)) < 4.9999937e-319 or 4.9999999999999997e303 < (/.f64 A (*.f64 V l))

    1. Initial program 33.4%

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

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

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

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

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

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

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

    if 4.9999937e-319 < (/.f64 A (*.f64 V l)) < 4.9999999999999997e303

    1. Initial program 99.1%

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

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

Alternative 13: 80.3% accurate, 0.9× speedup?

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

\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;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)) < 4.9999937e-319

    1. Initial program 39.8%

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

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

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

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

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

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

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

    if 4.9999937e-319 < (/.f64 A (*.f64 V l)) < 1.9999999999999999e304

    1. Initial program 99.1%

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

    if 1.9999999999999999e304 < (/.f64 A (*.f64 V l))

    1. Initial program 25.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 73.7% 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 71.1%

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

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

Reproduce

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