Henrywood and Agarwal, Equation (3)

Percentage Accurate: 72.6% → 96.6%
Time: 10.5s
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: 72.6% 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.6% 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 72.5%

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{A}{V \cdot \ell}\right)}^{0.5}} \]
    2. add-cube-cbrt72.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. pow372.1%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 94.0% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 31.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000003e306 < (*.f64 V l) < -1.97626e-322

    1. Initial program 83.9%

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

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

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

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

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

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

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

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

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

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

    if -1.97626e-322 < (*.f64 V l) < 5.00000000000000033e-302 or 5.00000000000000023e222 < (*.f64 V l)

    1. Initial program 43.8%

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

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{A}{V \cdot \ell}\right)}^{0.5}} \]
      2. add-cube-cbrt43.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. pow343.8%

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

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

        \[\leadsto c0 \cdot {\left(\sqrt[3]{\frac{A}{V \cdot \ell}}\right)}^{\color{blue}{1.5}} \]
    3. Applied egg-rr43.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*72.5%

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

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

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

    if 5.00000000000000033e-302 < (*.f64 V l) < 5.00000000000000023e222

    1. Initial program 87.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+306}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-322}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \left(-\ell\right)}}{\sqrt{-A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-302} \lor \neg \left(V \cdot \ell \leq 5 \cdot 10^{+222}\right):\\ \;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \end{array} \]

Alternative 3: 94.2% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 31.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000003e306 < (*.f64 V l) < -1.97626e-322

    1. Initial program 83.9%

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

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

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

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

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

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

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

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

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

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

    if -1.97626e-322 < (*.f64 V l) < -0.0 or 2.0000000000000001e243 < (*.f64 V l)

    1. Initial program 41.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 V l) < 2.0000000000000001e243

    1. Initial program 87.3%

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

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

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

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

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

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

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

Alternative 4: 95.1% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 73.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \frac{\sqrt{-A}}{\color{blue}{\sqrt{-V}} \cdot {\ell}^{0.5}} \]
      5. pow1/254.1%

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

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

    if -1.97626e-322 < (*.f64 V l) < -0.0 or 2.0000000000000001e243 < (*.f64 V l)

    1. Initial program 41.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 V l) < 2.0000000000000001e243

    1. Initial program 87.3%

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

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

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

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

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

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

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

Alternative 5: 90.3% accurate, 0.5× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-322}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+222}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \end{array} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (if (<= (* V l) (- INFINITY))
   (* (/ c0 (sqrt l)) (sqrt (/ A V)))
   (if (<= (* V l) -2e-322)
     (* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
     (if (<= (* V l) 0.0)
       (/ c0 (sqrt (* l (/ V A))))
       (if (<= (* V l) 5e+222)
         (/ c0 (/ (sqrt (* V l)) (sqrt A)))
         (* c0 (sqrt (/ (/ A l) V))))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = (c0 / sqrt(l)) * sqrt((A / V));
	} else if ((V * l) <= -2e-322) {
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	} else if ((V * l) <= 0.0) {
		tmp = c0 / sqrt((l * (V / A)));
	} else if ((V * l) <= 5e+222) {
		tmp = c0 / (sqrt((V * l)) / sqrt(A));
	} else {
		tmp = c0 * sqrt(((A / l) / V));
	}
	return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -Double.POSITIVE_INFINITY) {
		tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
	} else if ((V * l) <= -2e-322) {
		tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if ((V * l) <= 0.0) {
		tmp = c0 / Math.sqrt((l * (V / A)));
	} else if ((V * l) <= 5e+222) {
		tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
	} else {
		tmp = c0 * Math.sqrt(((A / l) / V));
	}
	return tmp;
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	tmp = 0
	if (V * l) <= -math.inf:
		tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V))
	elif (V * l) <= -2e-322:
		tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l)))
	elif (V * l) <= 0.0:
		tmp = c0 / math.sqrt((l * (V / A)))
	elif (V * l) <= 5e+222:
		tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A))
	else:
		tmp = c0 * math.sqrt(((A / l) / V))
	return tmp
V, l = sort([V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= Float64(-Inf))
		tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V)));
	elseif (Float64(V * l) <= -2e-322)
		tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif (Float64(V * l) <= 0.0)
		tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A))));
	elseif (Float64(V * l) <= 5e+222)
		tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A)));
	else
		tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V)));
	end
	return tmp
end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -Inf)
		tmp = (c0 / sqrt(l)) * sqrt((A / V));
	elseif ((V * l) <= -2e-322)
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	elseif ((V * l) <= 0.0)
		tmp = c0 / sqrt((l * (V / A)));
	elseif ((V * l) <= 5e+222)
		tmp = c0 / (sqrt((V * l)) / sqrt(A));
	else
		tmp = c0 * sqrt(((A / l) / V));
	end
	tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-322], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+222], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\

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

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

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

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


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

    1. Initial program 31.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\frac{A}{\color{blue}{V \cdot \ell}}} \]
      5. *-un-lft-identity31.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 V l) < -1.97626e-322

    1. Initial program 83.4%

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

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

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

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

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

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

    if -1.97626e-322 < (*.f64 V l) < -0.0

    1. Initial program 41.3%

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\left(\sqrt[3]{A} \cdot \sqrt[3]{A}\right)} \cdot \sqrt[3]{A}}{\ell \cdot V}} \]
      3. add-cube-cbrt41.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 V l) < 5.00000000000000023e222

    1. Initial program 87.2%

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

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

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

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

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

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

    if 5.00000000000000023e222 < (*.f64 V l)

    1. Initial program 44.1%

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\sqrt[3]{\frac{A}{V \cdot \ell}}\right)}^{1.5}} \]
    4. Step-by-step derivation
      1. add-cube-cbrt43.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 90.3% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 31.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.00000000000000003e306 < (*.f64 V l) < -1.97626e-322

    1. Initial program 83.9%

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

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

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

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

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

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

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

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

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

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

    if -1.97626e-322 < (*.f64 V l) < -0.0

    1. Initial program 41.3%

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\left(\sqrt[3]{A} \cdot \sqrt[3]{A}\right)} \cdot \sqrt[3]{A}}{\ell \cdot V}} \]
      3. add-cube-cbrt41.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 V l) < 5.00000000000000023e222

    1. Initial program 87.2%

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

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

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

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

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

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

    if 5.00000000000000023e222 < (*.f64 V l)

    1. Initial program 44.1%

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\sqrt[3]{\frac{A}{V \cdot \ell}}\right)}^{1.5}} \]
    4. Step-by-step derivation
      1. add-cube-cbrt43.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 81.1% accurate, 0.5× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \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 (/ (/ A l) V)))
   (* 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(((A / l) / V));
	} 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(((a / l) / v))
    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(((A / l) / V));
	} 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(((A / l) / V))
	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(Float64(A / l) / V)));
	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(((A / l) / V));
	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[(N[(A / l), $MachinePrecision] / V), $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}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\

\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 72.9%

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

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

        \[\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. pow372.6%

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\sqrt[3]{\frac{A}{V \cdot \ell}}\right)}^{1.5}} \]
    4. Step-by-step derivation
      1. add-cube-cbrt72.4%

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < l

    1. Initial program 72.2%

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

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

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

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

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

Alternative 8: 83.7% 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}{\frac{\sqrt{V \cdot \ell}}{\sqrt{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 (* V l)) (sqrt 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((V * l)) / sqrt(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((v * l)) / sqrt(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((V * l)) / Math.sqrt(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((V * l)) / math.sqrt(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 / Float64(sqrt(Float64(V * l)) / sqrt(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((V * l)) / sqrt(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[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $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}{\frac{\sqrt{V \cdot \ell}}{\sqrt{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 72.9%

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

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

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

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

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

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

    if -4.999999999999985e-310 < l

    1. Initial program 72.2%

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

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

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

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

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

Alternative 9: 78.7% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 31.4%

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

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

        \[\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. pow331.4%

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\sqrt[3]{\frac{A}{V \cdot \ell}}\right)}^{1.5}} \]
    4. Step-by-step derivation
      1. add-cube-cbrt31.4%

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 1.9999999999999998e250

    1. Initial program 98.4%

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

    if 1.9999999999999998e250 < (/.f64 A (*.f64 V l))

    1. Initial program 47.7%

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V}{1} \cdot \frac{\ell}{A}}}} \]
      4. /-rgt-identity62.0%

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

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

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

Alternative 10: 79.0% accurate, 0.9× speedup?

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

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


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

    1. Initial program 35.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 5.0000000000000003e288

    1. Initial program 98.5%

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

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

Alternative 11: 78.2% accurate, 0.9× speedup?

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

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


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

    1. Initial program 40.8%

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

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{A}{V \cdot \ell}\right)}^{0.5}} \]
      2. add-cube-cbrt40.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. pow340.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 1.9999999999999998e250

    1. Initial program 98.4%

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

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

Alternative 12: 79.0% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 31.4%

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

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

        \[\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. pow331.4%

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\sqrt[3]{\frac{A}{V \cdot \ell}}\right)}^{1.5}} \]
    4. Step-by-step derivation
      1. add-cube-cbrt31.4%

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 1.99999999999999992e275

    1. Initial program 98.5%

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

    if 1.99999999999999992e275 < (/.f64 A (*.f64 V l))

    1. Initial program 40.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 79.4% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 31.4%

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

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

        \[\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. pow331.4%

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\sqrt[3]{\frac{A}{V \cdot \ell}}\right)}^{1.5}} \]
    4. Step-by-step derivation
      1. add-cube-cbrt31.4%

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 5.0000000000000003e288

    1. Initial program 98.5%

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

    if 5.0000000000000003e288 < (/.f64 A (*.f64 V l))

    1. Initial program 38.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 72.6% accurate, 1.0× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \end{array} \]
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
	return c0 * sqrt((A / (V * l)));
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    code = c0 * sqrt((a / (v * l)))
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
	return c0 * Math.sqrt((A / (V * l)));
}
[V, l] = sort([V, l])
def code(c0, A, V, l):
	return c0 * math.sqrt((A / (V * l)))
V, l = sort([V, l])
function code(c0, A, V, l)
	return Float64(c0 * sqrt(Float64(A / Float64(V * l))))
end
V, l = num2cell(sort([V, l])){:}
function tmp = code(c0, A, V, l)
	tmp = c0 * sqrt((A / (V * l)));
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Derivation
  1. Initial program 72.5%

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

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

Reproduce

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