Henrywood and Agarwal, Equation (3)

Percentage Accurate: 73.3% → 91.7%
Time: 10.9s
Alternatives: 10
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 10 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.3% 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: 91.7% accurate, 0.2× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} \mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\ \;\;\;\;c0 \cdot \left(\frac{\sqrt{-A}}{\sqrt{-V}} \cdot \frac{1}{\sqrt{\ell}}\right)\\ \mathbf{elif}\;A \leq 4.5 \cdot 10^{-146}:\\ \;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\ \mathbf{elif}\;A \leq 3.1 \cdot 10^{+187}:\\ \;\;\;\;c0 \cdot \left(\sqrt{\frac{\frac{A}{V}}{\sqrt[3]{\ell}}} \cdot \sqrt{{\left(\sqrt[3]{\ell}\right)}^{-2}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \end{array} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (if (<= A -5e-310)
   (* c0 (* (/ (sqrt (- A)) (sqrt (- V))) (/ 1.0 (sqrt l))))
   (if (<= A 4.5e-146)
     (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))
     (if (<= A 3.1e+187)
       (* c0 (* (sqrt (/ (/ A V) (cbrt l))) (sqrt (pow (cbrt l) -2.0))))
       (/ c0 (/ (sqrt (* V l)) (sqrt A)))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if (A <= -5e-310) {
		tmp = c0 * ((sqrt(-A) / sqrt(-V)) * (1.0 / sqrt(l)));
	} else if (A <= 4.5e-146) {
		tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
	} else if (A <= 3.1e+187) {
		tmp = c0 * (sqrt(((A / V) / cbrt(l))) * sqrt(pow(cbrt(l), -2.0)));
	} else {
		tmp = c0 / (sqrt((V * l)) / sqrt(A));
	}
	return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if (A <= -5e-310) {
		tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) * (1.0 / Math.sqrt(l)));
	} else if (A <= 4.5e-146) {
		tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
	} else if (A <= 3.1e+187) {
		tmp = c0 * (Math.sqrt(((A / V) / Math.cbrt(l))) * Math.sqrt(Math.pow(Math.cbrt(l), -2.0)));
	} else {
		tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
	}
	return tmp;
}
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (A <= -5e-310)
		tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * Float64(1.0 / sqrt(l))));
	elseif (A <= 4.5e-146)
		tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l))));
	elseif (A <= 3.1e+187)
		tmp = Float64(c0 * Float64(sqrt(Float64(Float64(A / V) / cbrt(l))) * sqrt((cbrt(l) ^ -2.0))));
	else
		tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A)));
	end
	return tmp
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := If[LessEqual[A, -5e-310], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 4.5e-146], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 3.1e+187], N[(c0 * N[(N[Sqrt[N[(N[(A / V), $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Power[N[Power[l, 1/3], $MachinePrecision], -2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \left(\frac{\sqrt{-A}}{\sqrt{-V}} \cdot \frac{1}{\sqrt{\ell}}\right)\\

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

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

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


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

    1. Initial program 69.5%

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < A < 4.5000000000000001e-146

    1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

    if 4.5000000000000001e-146 < A < 3.10000000000000012e187

    1. Initial program 80.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.10000000000000012e187 < A

    1. Initial program 73.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 90.8% accurate, 0.3× speedup?

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

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

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

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


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

    1. Initial program 78.5%

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

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

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

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

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

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

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

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

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

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

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

    if -9.99999999999999989e-160 < (*.f64 V l) < 9.999999985e-316

    1. Initial program 52.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.999999985e-316 < (*.f64 V l) < 9.9999999999999996e297

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999996e297 < (*.f64 V l)

    1. Initial program 33.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-un-lft-identity33.3%

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

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

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

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

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

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

Alternative 3: 90.2% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;V \cdot \ell \leq 10^{-315}:\\
\;\;\;\;t\_0\\

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

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


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

    1. Initial program 47.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      8. sqrt-undiv65.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 V l) < -9.99999999999999989e-160

    1. Initial program 89.8%

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}} \]
    5. Step-by-step derivation
      1. distribute-rgt-neg-out99.5%

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

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

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

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

    if 9.999999985e-316 < (*.f64 V l) < 9.9999999999999996e297

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999996e297 < (*.f64 V l)

    1. Initial program 33.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-un-lft-identity33.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-159}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{-315}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+298}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 87.3% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;V \cdot \ell \leq 10^{-315}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot t\_0\\

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

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


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

    1. Initial program 42.9%

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

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

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

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

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

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

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

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

    if -4.99999999999999972e193 < (*.f64 V l) < -5.0000000000000002e-154

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
      8. sqrt-undiv83.0%

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

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

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

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

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

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

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

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

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

    if -5.0000000000000002e-154 < (*.f64 V l) < 9.999999985e-316

    1. Initial program 53.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.999999985e-316 < (*.f64 V l) < 9.9999999999999996e297

    1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999996e297 < (*.f64 V l)

    1. Initial program 33.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-un-lft-identity33.3%

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

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

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

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

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

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

Alternative 5: 78.9% accurate, 0.5× speedup?

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

\mathbf{elif}\;t\_0 \leq 10^{+253}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\

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


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

    1. Initial program 32.6%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-un-lft-identity32.6%

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

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

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

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

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

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

    if 3.9999999999999977e-309 < (/.f64 A (*.f64 V l)) < 9.9999999999999994e252

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999994e252 < (/.f64 A (*.f64 V l))

    1. Initial program 44.7%

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

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

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

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

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

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

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

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

Alternative 6: 79.0% accurate, 0.9× speedup?

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

\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\


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

    1. Initial program 36.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-un-lft-identity36.3%

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 5.9999999999999996e260

    1. Initial program 99.6%

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

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

Alternative 7: 79.0% accurate, 0.9× speedup?

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

    1. Initial program 37.9%

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

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

      \[\leadsto \color{blue}{c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}} \]
    4. Add Preprocessing

    if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999994e252

    1. Initial program 99.6%

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

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

Alternative 8: 79.2% accurate, 0.9× speedup?

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

\mathbf{elif}\;t\_0 \leq 6 \cdot 10^{+260}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\

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


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

    1. Initial program 32.6%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-un-lft-identity32.6%

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

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

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

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

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

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

    if 3.9999999999999977e-309 < (/.f64 A (*.f64 V l)) < 5.9999999999999996e260

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.9999999999999996e260 < (/.f64 A (*.f64 V l))

    1. Initial program 41.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 79.3% accurate, 0.9× speedup?

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

\mathbf{elif}\;t\_0 \leq 10^{+261}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\

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


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

    1. Initial program 31.5%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-un-lft-identity31.5%

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999993e260

    1. Initial program 99.6%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing

    if 9.9999999999999993e260 < (/.f64 A (*.f64 V l))

    1. Initial program 40.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 73.3% accurate, 1.0× speedup?

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

    \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
  2. Add Preprocessing
  3. Add Preprocessing

Reproduce

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