Henrywood and Agarwal, Equation (3)

Percentage Accurate: 73.7% → 96.9%
Time: 10.3s
Alternatives: 16
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 16 alternatives:

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

Initial Program: 73.7% accurate, 1.0× speedup?

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

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

Alternative 1: 96.9% accurate, 0.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.0% accurate, 0.3× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ c0 \cdot {\left(\frac{\frac{\sqrt[3]{A}}{\sqrt[3]{\ell}}}{\sqrt[3]{V}}\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 l)) (cbrt V)) 1.5)))
assert(V < l);
double code(double c0, double A, double V, double l) {
	return c0 * pow(((cbrt(A) / cbrt(l)) / cbrt(V)), 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(l)) / Math.cbrt(V)), 1.5);
}
V, l = sort([V, l])
function code(c0, A, V, l)
	return Float64(c0 * (Float64(Float64(cbrt(A) / cbrt(l)) / cbrt(V)) ^ 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[l, 1/3], $MachinePrecision]), $MachinePrecision] / N[Power[V, 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]{\ell}}}{\sqrt[3]{V}}\right)}^{1.5}
\end{array}
Derivation
  1. Initial program 72.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 95.4% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 41.1%

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

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

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

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

    if -inf.0 < (*.f64 V l) < -1.9999999999999988e-309

    1. Initial program 88.5%

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

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

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

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

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

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

    if -1.9999999999999988e-309 < (*.f64 V l) < -0.0 or 2.00000000000000012e290 < (*.f64 V l)

    1. Initial program 36.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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.00000000000000012e290

    1. Initial program 83.1%

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

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

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

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

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

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

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

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

Alternative 4: 85.5% accurate, 0.5× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.2 \cdot 10^{-90}:\\ \;\;\;\;c0 \cdot \left({\left(-\frac{\ell}{A}\right)}^{-0.5} \cdot {\left(\frac{-1}{V}\right)}^{0.5}\right)\\ \mathbf{elif}\;\ell \leq -2 \cdot 10^{-310}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot 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 -1.2e-90)
   (* c0 (* (pow (- (/ l A)) -0.5) (pow (/ -1.0 V) 0.5)))
   (if (<= l -2e-310)
     (* c0 (/ (sqrt A) (sqrt (* 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 <= -1.2e-90) {
		tmp = c0 * (pow(-(l / A), -0.5) * pow((-1.0 / V), 0.5));
	} else if (l <= -2e-310) {
		tmp = c0 * (sqrt(A) / sqrt((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 <= (-1.2d-90)) then
        tmp = c0 * ((-(l / a) ** (-0.5d0)) * (((-1.0d0) / v) ** 0.5d0))
    else if (l <= (-2d-310)) then
        tmp = c0 * (sqrt(a) / sqrt((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 <= -1.2e-90) {
		tmp = c0 * (Math.pow(-(l / A), -0.5) * Math.pow((-1.0 / V), 0.5));
	} else if (l <= -2e-310) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((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 <= -1.2e-90:
		tmp = c0 * (math.pow(-(l / A), -0.5) * math.pow((-1.0 / V), 0.5))
	elif l <= -2e-310:
		tmp = c0 * (math.sqrt(A) / math.sqrt((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 <= -1.2e-90)
		tmp = Float64(c0 * Float64((Float64(-Float64(l / A)) ^ -0.5) * (Float64(-1.0 / V) ^ 0.5)));
	elseif (l <= -2e-310)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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 <= -1.2e-90)
		tmp = c0 * ((-(l / A) ^ -0.5) * ((-1.0 / V) ^ 0.5));
	elseif (l <= -2e-310)
		tmp = c0 * (sqrt(A) / sqrt((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, -1.2e-90], N[(c0 * N[(N[Power[(-N[(l / A), $MachinePrecision]), -0.5], $MachinePrecision] * N[Power[N[(-1.0 / V), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.2 \cdot 10^{-90}:\\
\;\;\;\;c0 \cdot \left({\left(-\frac{\ell}{A}\right)}^{-0.5} \cdot {\left(\frac{-1}{V}\right)}^{0.5}\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -1.2000000000000001e-90

    1. Initial program 75.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2000000000000001e-90 < l < -1.999999999999994e-310

    1. Initial program 74.6%

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < l

    1. Initial program 69.0%

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

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

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

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

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

Alternative 5: 85.3% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -2.99999999999999991e95

    1. Initial program 80.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-\frac{A}{V}}}{\sqrt{-\ell}}} \]
      14. distribute-neg-frac82.1%

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

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

    if -2.99999999999999991e95 < l < -1.999999999999994e-310

    1. Initial program 72.5%

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < l

    1. Initial program 69.0%

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

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

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

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

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

Alternative 6: 81.5% accurate, 0.5× speedup?

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

    1. Initial program 75.1%

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

    if -1.999999999999994e-310 < l

    1. Initial program 69.0%

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

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

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

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

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

Alternative 7: 83.6% accurate, 0.5× speedup?

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

    1. Initial program 75.1%

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

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

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

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

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

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

    if -1.999999999999994e-310 < l

    1. Initial program 69.0%

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

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

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

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

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

Alternative 8: 84.2% accurate, 0.5× speedup?

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

    1. Initial program 75.1%

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < l

    1. Initial program 69.0%

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

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

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

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

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

Alternative 9: 79.9% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 38.7%

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

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

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

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

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

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

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

    1. Initial program 98.7%

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

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

    1. Initial program 45.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 80.1% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 38.7%

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000033e293

    1. Initial program 98.7%

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

    if 5.00000000000000033e293 < (/.f64 A (*.f64 V l))

    1. Initial program 41.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 79.2% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 46.9%

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

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

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

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

    if 1.0000000000000001e-253 < (/.f64 A (*.f64 V l)) < 5.00000000000000033e293

    1. Initial program 98.8%

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

    if 5.00000000000000033e293 < (/.f64 A (*.f64 V l))

    1. Initial program 41.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 80.0% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 38.7%

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000033e293

    1. Initial program 98.7%

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

    if 5.00000000000000033e293 < (/.f64 A (*.f64 V l))

    1. Initial program 41.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 79.9% accurate, 0.9× speedup?

\[\begin{array}{l} [V, l] = \mathsf{sort}([V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{\ell \cdot V}\\ \mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 5 \cdot 10^{+306}\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 (* l V))))
   (if (or (<= t_0 0.0) (not (<= t_0 5e+306)))
     (* 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 / (l * V);
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 5e+306)) {
		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 / (l * v)
    if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+306))) 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 / (l * V);
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 5e+306)) {
		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 / (l * V)
	tmp = 0
	if (t_0 <= 0.0) or not (t_0 <= 5e+306):
		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(l * V))
	tmp = 0.0
	if ((t_0 <= 0.0) || !(t_0 <= 5e+306))
		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 / (l * V);
	tmp = 0.0;
	if ((t_0 <= 0.0) || ~((t_0 <= 5e+306)))
		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[(l * V), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+306]], $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}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 5 \cdot 10^{+306}\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 4.99999999999999993e306 < (/.f64 A (*.f64 V l))

    1. Initial program 38.1%

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 4.99999999999999993e306

    1. Initial program 98.7%

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

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

Alternative 14: 79.4% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 38.7%

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

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

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

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

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

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

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

    1. Initial program 98.7%

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

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

    1. Initial program 45.8%

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

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

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

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

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

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

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

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

Alternative 15: 80.1% accurate, 0.9× speedup?

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

\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+293}:\\
\;\;\;\;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 38.7%

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000033e293

    1. Initial program 98.7%

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

    if 5.00000000000000033e293 < (/.f64 A (*.f64 V l))

    1. Initial program 41.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 73.7% accurate, 1.0× speedup?

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

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

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

Reproduce

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