Henrywood and Agarwal, Equation (3)

Percentage Accurate: 73.6% → 91.9%
Time: 10.2s
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.6% accurate, 1.0× speedup?

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

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

Alternative 1: 91.9% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;\frac{1}{\frac{t\_0}{c0}}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{c0}{t\_0}\\


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

    1. Initial program 25.0%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{\frac{A}{V}}{\ell}}\right)\right) \]
      2. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{\frac{A}{V}}}{\color{blue}{\sqrt{\ell}}}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{\frac{A}{V}}\right), \color{blue}{\left(\sqrt{\ell}\right)}\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{A}{V}\right)\right), \left(\sqrt{\color{blue}{\ell}}\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, V\right)\right), \left(\sqrt{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f6444.3%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, V\right)\right), \mathsf{sqrt.f64}\left(\ell\right)\right)\right) \]
    4. Applied egg-rr44.3%

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

    if -2.0000000000000002e302 < (*.f64 V l) < -1.99999999998e-313

    1. Initial program 82.9%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{A}{V \cdot \ell}\right)\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{A}{V}\right), \ell\right)\right)\right) \]
      4. /-lowering-/.f6474.2%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right)\right)\right) \]
    4. Applied egg-rr74.2%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\right)\right) \]
      2. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{\mathsf{neg}\left(A\right)}{\mathsf{neg}\left(V\right)} \cdot \frac{1}{\ell}}\right)\right) \]
      3. frac-timesN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{\left(\mathsf{neg}\left(A\right)\right) \cdot 1}{\left(\mathsf{neg}\left(V\right)\right) \cdot \ell}}\right)\right) \]
      4. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{\left(\mathsf{neg}\left(A\right)\right) \cdot 1}}{\color{blue}{\sqrt{\left(\mathsf{neg}\left(V\right)\right) \cdot \ell}}}\right)\right) \]
      5. *-rgt-identityN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{\mathsf{neg}\left(A\right)}}{\sqrt{\color{blue}{\left(\mathsf{neg}\left(V\right)\right)} \cdot \ell}}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{\mathsf{neg}\left(A\right)}\right), \color{blue}{\left(\sqrt{\left(\mathsf{neg}\left(V\right)\right) \cdot \ell}\right)}\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(A\right)\right)\right), \left(\sqrt{\color{blue}{\left(\mathsf{neg}\left(V\right)\right) \cdot \ell}}\right)\right)\right) \]
      8. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(0 - A\right)\right), \left(\sqrt{\color{blue}{\left(\mathsf{neg}\left(V\right)\right)} \cdot \ell}\right)\right)\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \left(\sqrt{\color{blue}{\left(\mathsf{neg}\left(V\right)\right)} \cdot \ell}\right)\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\left(\left(\mathsf{neg}\left(V\right)\right) \cdot \ell\right)\right)\right)\right) \]
      11. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(V \cdot \ell\right)\right)\right)\right)\right) \]
      12. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\left(0 - V \cdot \ell\right)\right)\right)\right) \]
      13. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, \left(V \cdot \ell\right)\right)\right)\right)\right) \]
      14. *-lowering-*.f6499.2%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(V, \ell\right)\right)\right)\right)\right) \]
    6. Applied egg-rr99.2%

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

    if -1.99999999998e-313 < (*.f64 V l) < -0.0

    1. Initial program 38.3%

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

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V \cdot \ell}{A}}} \]
      2. sqrt-divN/A

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

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}} \]
      4. un-div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{V \cdot \ell}{A}}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left(\sqrt{\frac{V \cdot \ell}{A}}\right)}\right) \]
      6. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{\frac{A}{V \cdot \ell}}\right)}^{\frac{1}{2}}\right)\right) \]
      8. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left({\left(\frac{A}{V \cdot \ell}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      9. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      10. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{A}{V \cdot \ell}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      11. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(\frac{A}{V}\right), \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      14. metadata-eval72.8%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr72.8%

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

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

    if -0.0 < (*.f64 V l) < 5.0000000000000002e279

    1. Initial program 80.9%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{A}\right), \color{blue}{\left(\sqrt{V \cdot \ell}\right)}\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      4. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \left({\left(V \cdot \ell\right)}^{\color{blue}{\frac{1}{2}}}\right)\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{pow.f64}\left(\left(V \cdot \ell\right), \color{blue}{\frac{1}{2}}\right)\right)\right) \]
      6. *-lowering-*.f6498.3%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(V, \ell\right), \frac{1}{2}\right)\right)\right) \]
    4. Applied egg-rr98.3%

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

    if 5.0000000000000002e279 < (*.f64 V l)

    1. Initial program 34.6%

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

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V \cdot \ell}{A}}} \]
      2. sqrt-divN/A

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

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}} \]
      4. un-div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{V \cdot \ell}{A}}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left(\sqrt{\frac{V \cdot \ell}{A}}\right)}\right) \]
      6. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{\frac{A}{V \cdot \ell}}\right)}^{\frac{1}{2}}\right)\right) \]
      8. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left({\left(\frac{A}{V \cdot \ell}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      9. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      10. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{A}{V \cdot \ell}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      11. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(\frac{A}{V}\right), \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      14. metadata-eval65.2%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr65.2%

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

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left({\left(\frac{\frac{A}{V}}{\ell}\right)}^{\frac{-1}{2}}\right)}\right) \]
      2. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{A}{\ell \cdot V}\right)}^{\frac{-1}{2}}\right)\right) \]
      3. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{\frac{-1}{2}}\right)\right) \]
      4. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{\frac{V}{\frac{A}{\ell}}}\right)}^{\frac{-1}{2}}\right)\right) \]
      5. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{-1}\right)}^{\frac{-1}{2}}\right)\right) \]
      6. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{\color{blue}{\left(-1 \cdot \frac{-1}{2}\right)}}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{\frac{1}{2}}\right)\right) \]
      8. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{\frac{A}{\ell}}}\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right)\right)\right) \]
      10. div-invN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(V \cdot \frac{1}{\frac{A}{\ell}}\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{A}{\ell}} \cdot V\right)\right)\right) \]
      12. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\ell}{A} \cdot V\right)\right)\right) \]
      13. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\ell}{\frac{A}{V}}\right)\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \left(\frac{A}{V}\right)\right)\right)\right) \]
      15. /-lowering-/.f6465.3%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(A, V\right)\right)\right)\right) \]
    6. Applied egg-rr65.3%

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

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

Alternative 2: 76.5% accurate, 0.3× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


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

    1. Initial program 60.7%

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

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V \cdot \ell}{A}}} \]
      2. sqrt-divN/A

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

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}} \]
      4. un-div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{V \cdot \ell}{A}}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left(\sqrt{\frac{V \cdot \ell}{A}}\right)}\right) \]
      6. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{\frac{A}{V \cdot \ell}}\right)}^{\frac{1}{2}}\right)\right) \]
      8. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left({\left(\frac{A}{V \cdot \ell}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      9. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      10. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{A}{V \cdot \ell}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      11. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(\frac{A}{V}\right), \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      14. metadata-eval69.5%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr69.5%

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

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left({\left(\frac{\frac{A}{V}}{\ell}\right)}^{\frac{-1}{2}}\right)}\right) \]
      2. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{A}{\ell \cdot V}\right)}^{\frac{-1}{2}}\right)\right) \]
      3. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{\frac{-1}{2}}\right)\right) \]
      4. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{\frac{V}{\frac{A}{\ell}}}\right)}^{\frac{-1}{2}}\right)\right) \]
      5. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{-1}\right)}^{\frac{-1}{2}}\right)\right) \]
      6. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{\color{blue}{\left(-1 \cdot \frac{-1}{2}\right)}}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{\frac{1}{2}}\right)\right) \]
      8. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{\frac{A}{\ell}}}\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right)\right)\right) \]
      10. div-invN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(V \cdot \frac{1}{\frac{A}{\ell}}\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{A}{\ell}} \cdot V\right)\right)\right) \]
      12. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\ell}{A} \cdot V\right)\right)\right) \]
      13. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\ell}{\frac{A}{V}}\right)\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \left(\frac{A}{V}\right)\right)\right)\right) \]
      15. /-lowering-/.f6468.9%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(A, V\right)\right)\right)\right) \]
    6. Applied egg-rr68.9%

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999997e157

    1. Initial program 99.5%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\ell \cdot V\right)\right)\right)\right) \]
      2. /-rgt-identityN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\frac{\ell}{1} \cdot V\right)\right)\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \left(\frac{\ell}{\frac{1}{V}}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \left(\frac{1}{V}\right)\right)\right)\right)\right) \]
      5. /-lowering-/.f6499.6%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, \mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(1, V\right)\right)\right)\right)\right) \]
    4. Applied egg-rr99.6%

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

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

Alternative 3: 76.5% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+157}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


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

    1. Initial program 60.7%

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

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V \cdot \ell}{A}}} \]
      2. sqrt-divN/A

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

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}} \]
      4. un-div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{V \cdot \ell}{A}}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left(\sqrt{\frac{V \cdot \ell}{A}}\right)}\right) \]
      6. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{\frac{A}{V \cdot \ell}}\right)}^{\frac{1}{2}}\right)\right) \]
      8. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left({\left(\frac{A}{V \cdot \ell}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      9. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      10. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{A}{V \cdot \ell}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      11. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(\frac{A}{V}\right), \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      14. metadata-eval69.5%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr69.5%

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

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left({\left(\frac{\frac{A}{V}}{\ell}\right)}^{\frac{-1}{2}}\right)}\right) \]
      2. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{A}{\ell \cdot V}\right)}^{\frac{-1}{2}}\right)\right) \]
      3. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{\frac{-1}{2}}\right)\right) \]
      4. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{\frac{V}{\frac{A}{\ell}}}\right)}^{\frac{-1}{2}}\right)\right) \]
      5. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{-1}\right)}^{\frac{-1}{2}}\right)\right) \]
      6. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{\color{blue}{\left(-1 \cdot \frac{-1}{2}\right)}}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{\frac{1}{2}}\right)\right) \]
      8. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{\frac{A}{\ell}}}\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right)\right)\right) \]
      10. div-invN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(V \cdot \frac{1}{\frac{A}{\ell}}\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{A}{\ell}} \cdot V\right)\right)\right) \]
      12. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\ell}{A} \cdot V\right)\right)\right) \]
      13. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\ell}{\frac{A}{V}}\right)\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \left(\frac{A}{V}\right)\right)\right)\right) \]
      15. /-lowering-/.f6468.9%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(A, V\right)\right)\right)\right) \]
    6. Applied egg-rr68.9%

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999997e157

    1. Initial program 99.5%

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

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

Alternative 4: 76.9% accurate, 0.3× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\ t_1 := \frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\ \mathbf{if}\;t\_0 \leq 10^{-298}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+226}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \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 (/ A (* l V))))) (t_1 (/ c0 (sqrt (* l (/ V A))))))
   (if (<= t_0 1e-298) t_1 (if (<= t_0 4e+226) t_0 t_1))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = c0 * sqrt((A / (l * V)));
	double t_1 = c0 / sqrt((l * (V / A)));
	double tmp;
	if (t_0 <= 1e-298) {
		tmp = t_1;
	} else if (t_0 <= 4e+226) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	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) :: t_1
    real(8) :: tmp
    t_0 = c0 * sqrt((a / (l * v)))
    t_1 = c0 / sqrt((l * (v / a)))
    if (t_0 <= 1d-298) then
        tmp = t_1
    else if (t_0 <= 4d+226) then
        tmp = t_0
    else
        tmp = t_1
    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 = c0 * Math.sqrt((A / (l * V)));
	double t_1 = c0 / Math.sqrt((l * (V / A)));
	double tmp;
	if (t_0 <= 1e-298) {
		tmp = t_1;
	} else if (t_0 <= 4e+226) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	t_0 = c0 * math.sqrt((A / (l * V)))
	t_1 = c0 / math.sqrt((l * (V / A)))
	tmp = 0
	if t_0 <= 1e-298:
		tmp = t_1
	elif t_0 <= 4e+226:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	t_0 = Float64(c0 * sqrt(Float64(A / Float64(l * V))))
	t_1 = Float64(c0 / sqrt(Float64(l * Float64(V / A))))
	tmp = 0.0
	if (t_0 <= 1e-298)
		tmp = t_1;
	elseif (t_0 <= 4e+226)
		tmp = t_0;
	else
		tmp = t_1;
	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((A / (l * V)));
	t_1 = c0 / sqrt((l * (V / A)));
	tmp = 0.0;
	if (t_0 <= 1e-298)
		tmp = t_1;
	elseif (t_0 <= 4e+226)
		tmp = t_0;
	else
		tmp = t_1;
	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[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-298], t$95$1, If[LessEqual[t$95$0, 4e+226], t$95$0, t$95$1]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
t_1 := \frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{if}\;t\_0 \leq 10^{-298}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+226}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.99999999999999912e-299 or 3.99999999999999985e226 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 59.3%

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

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V \cdot \ell}{A}}} \]
      2. sqrt-divN/A

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

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}} \]
      4. un-div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{V \cdot \ell}{A}}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left(\sqrt{\frac{V \cdot \ell}{A}}\right)}\right) \]
      6. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{\frac{A}{V \cdot \ell}}\right)}^{\frac{1}{2}}\right)\right) \]
      8. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left({\left(\frac{A}{V \cdot \ell}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      9. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      10. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{A}{V \cdot \ell}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      11. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(\frac{A}{V}\right), \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      14. metadata-eval68.5%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr68.5%

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

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left({\left(\frac{\frac{A}{V}}{\ell}\right)}^{\frac{-1}{2}}\right)}\right) \]
      2. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{A}{\ell \cdot V}\right)}^{\frac{-1}{2}}\right)\right) \]
      3. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{\frac{-1}{2}}\right)\right) \]
      4. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{\frac{V}{\frac{A}{\ell}}}\right)}^{\frac{-1}{2}}\right)\right) \]
      5. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{-1}\right)}^{\frac{-1}{2}}\right)\right) \]
      6. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{\color{blue}{\left(-1 \cdot \frac{-1}{2}\right)}}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{\frac{1}{2}}\right)\right) \]
      8. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{\frac{A}{\ell}}}\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right)\right)\right) \]
      10. div-invN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(V \cdot \frac{1}{\frac{A}{\ell}}\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{A}{\ell}} \cdot V\right)\right)\right) \]
      12. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\ell}{A} \cdot V\right)\right)\right) \]
      13. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\ell}{\frac{A}{V}}\right)\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \left(\frac{A}{V}\right)\right)\right)\right) \]
      15. /-lowering-/.f6467.8%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(A, V\right)\right)\right)\right) \]
    6. Applied egg-rr67.8%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}} \]
    7. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\frac{A}{V}}{\ell}}\right)\right)\right) \]
      2. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{A}{V}} \cdot \ell\right)\right)\right) \]
      3. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{V}{A} \cdot \ell\right)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\frac{V}{A}\right), \ell\right)\right)\right) \]
      5. /-lowering-/.f6467.8%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(V, A\right), \ell\right)\right)\right) \]
    8. Applied egg-rr67.8%

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

    if 9.99999999999999912e-299 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999985e226

    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 simplification75.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \cdot \sqrt{\frac{A}{\ell \cdot V}} \leq 10^{-298}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\ \mathbf{elif}\;c0 \cdot \sqrt{\frac{A}{\ell \cdot V}} \leq 4 \cdot 10^{+226}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 76.5% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+157}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


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

    1. Initial program 60.7%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{A}{V \cdot \ell}\right)\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{A}{V}\right), \ell\right)\right)\right) \]
      4. /-lowering-/.f6469.5%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right)\right)\right) \]
    4. Applied egg-rr69.5%

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999997e157

    1. Initial program 99.5%

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

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

Alternative 6: 91.2% accurate, 0.3× speedup?

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

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


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

    1. Initial program 68.8%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{A}{V \cdot \ell}\right)\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{A}{V}\right), \ell\right)\right)\right) \]
      4. /-lowering-/.f6473.3%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right)\right)\right) \]
    4. Applied egg-rr73.3%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{\frac{A}{V}}}{\color{blue}{\sqrt{\ell}}}\right)\right) \]
      2. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{\frac{\mathsf{neg}\left(A\right)}{\mathsf{neg}\left(V\right)}}}{\sqrt{\ell}}\right)\right) \]
      3. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\frac{\sqrt{\mathsf{neg}\left(A\right)}}{\sqrt{\mathsf{neg}\left(V\right)}}}{\sqrt{\color{blue}{\ell}}}\right)\right) \]
      4. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\frac{\sqrt{\mathsf{neg}\left(A\right)}}{\sqrt{\mathsf{neg}\left(V\right)}}}{{\ell}^{\color{blue}{\frac{1}{2}}}}\right)\right) \]
      5. associate-/l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{\mathsf{neg}\left(A\right)}}{\color{blue}{{\ell}^{\frac{1}{2}} \cdot \sqrt{\mathsf{neg}\left(V\right)}}}\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{\mathsf{neg}\left(A\right)}\right), \color{blue}{\left({\ell}^{\frac{1}{2}} \cdot \sqrt{\mathsf{neg}\left(V\right)}\right)}\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(A\right)\right)\right), \left(\color{blue}{{\ell}^{\frac{1}{2}}} \cdot \sqrt{\mathsf{neg}\left(V\right)}\right)\right)\right) \]
      8. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(0 - A\right)\right), \left({\color{blue}{\ell}}^{\frac{1}{2}} \cdot \sqrt{\mathsf{neg}\left(V\right)}\right)\right)\right) \]
      9. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \left({\color{blue}{\ell}}^{\frac{1}{2}} \cdot \sqrt{\mathsf{neg}\left(V\right)}\right)\right)\right) \]
      10. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{*.f64}\left(\left({\ell}^{\frac{1}{2}}\right), \color{blue}{\left(\sqrt{\mathsf{neg}\left(V\right)}\right)}\right)\right)\right) \]
      11. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{*.f64}\left(\left(\sqrt{\ell}\right), \left(\sqrt{\color{blue}{\mathsf{neg}\left(V\right)}}\right)\right)\right)\right) \]
      12. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\ell\right), \left(\sqrt{\color{blue}{\mathsf{neg}\left(V\right)}}\right)\right)\right)\right) \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\ell\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(V\right)\right)\right)\right)\right)\right) \]
      14. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\ell\right), \mathsf{sqrt.f64}\left(\left(0 - V\right)\right)\right)\right)\right) \]
      15. --lowering--.f6437.7%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\ell\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, V\right)\right)\right)\right)\right) \]
    6. Applied egg-rr37.7%

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

    if -1.999999999999994e-310 < A

    1. Initial program 68.2%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{A}\right), \color{blue}{\left(\sqrt{V \cdot \ell}\right)}\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      4. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \left({\left(V \cdot \ell\right)}^{\color{blue}{\frac{1}{2}}}\right)\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{pow.f64}\left(\left(V \cdot \ell\right), \color{blue}{\frac{1}{2}}\right)\right)\right) \]
      6. *-lowering-*.f6480.0%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \mathsf{pow.f64}\left(\mathsf{*.f64}\left(V, \ell\right), \frac{1}{2}\right)\right)\right) \]
    4. Applied egg-rr80.0%

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

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

Alternative 7: 84.5% accurate, 0.5× speedup?

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

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


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

    1. Initial program 67.8%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{A}{V \cdot \ell}\right)\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{A}{V}\right), \ell\right)\right)\right) \]
      4. /-lowering-/.f6469.9%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right)\right)\right) \]
    4. Applied egg-rr69.9%

      \[\leadsto c0 \cdot \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell}}} \]
    5. Step-by-step derivation
      1. frac-2negN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{\mathsf{neg}\left(\frac{A}{V}\right)}{\mathsf{neg}\left(\ell\right)}}\right)\right) \]
      2. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{\mathsf{neg}\left(\frac{A}{V}\right)}}{\color{blue}{\sqrt{\mathsf{neg}\left(\ell\right)}}}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{\mathsf{neg}\left(\frac{A}{V}\right)}\right), \color{blue}{\left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)}\right)\right) \]
      4. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left({\left(\mathsf{neg}\left(\frac{A}{V}\right)\right)}^{\frac{1}{2}}\right), \left(\sqrt{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{neg}\left(\frac{A}{V}\right)\right), \frac{1}{2}\right), \left(\sqrt{\color{blue}{\mathsf{neg}\left(\ell\right)}}\right)\right)\right) \]
      6. distribute-neg-frac2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(\frac{A}{\mathsf{neg}\left(V\right)}\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(\color{blue}{\ell}\right)}\right)\right)\right) \]
      7. div-invN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(A \cdot \frac{1}{\mathsf{neg}\left(V\right)}\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(\color{blue}{\ell}\right)}\right)\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(A, \left(\frac{1}{\mathsf{neg}\left(V\right)}\right)\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(\color{blue}{\ell}\right)}\right)\right)\right) \]
      9. distribute-frac-neg2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(A, \left(\mathsf{neg}\left(\frac{1}{V}\right)\right)\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right)\right) \]
      10. distribute-neg-fracN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(A, \left(\frac{\mathsf{neg}\left(1\right)}{V}\right)\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(A, \left(\frac{-1}{V}\right)\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(A, \mathsf{/.f64}\left(-1, V\right)\right), \frac{1}{2}\right), \left(\sqrt{\mathsf{neg}\left(\ell\right)}\right)\right)\right) \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(A, \mathsf{/.f64}\left(-1, V\right)\right), \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right) \]
      14. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(A, \mathsf{/.f64}\left(-1, V\right)\right), \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\left(0 - \ell\right)\right)\right)\right) \]
      15. --lowering--.f6483.4%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(A, \mathsf{/.f64}\left(-1, V\right)\right), \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right) \]
    6. Applied egg-rr83.4%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(\frac{-1}{V} \cdot A\right), \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\color{blue}{0}, \ell\right)\right)\right)\right) \]
      2. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(\frac{-1 \cdot A}{V}\right), \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\color{blue}{0}, \ell\right)\right)\right)\right) \]
      3. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(-1 \cdot \frac{A}{V}\right), \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\color{blue}{0}, \ell\right)\right)\right)\right) \]
      4. neg-mul-1N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\left(\mathsf{neg}\left(\frac{A}{V}\right)\right), \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\color{blue}{0}, \ell\right)\right)\right)\right) \]
      5. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{neg.f64}\left(\left(\frac{A}{V}\right)\right), \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\color{blue}{0}, \ell\right)\right)\right)\right) \]
      6. /-lowering-/.f6483.3%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(A, V\right)\right), \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right) \]
    8. Applied egg-rr83.3%

      \[\leadsto c0 \cdot \frac{{\color{blue}{\left(-\frac{A}{V}\right)}}^{0.5}}{\sqrt{0 - \ell}} \]
    9. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(A, V\right)\right), \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right) \]
      2. neg-lowering-neg.f6483.3%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\mathsf{neg.f64}\left(\mathsf{/.f64}\left(A, V\right)\right), \frac{1}{2}\right), \mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\ell\right)\right)\right)\right) \]
    10. Applied egg-rr83.3%

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

    if -4.999999999999985e-310 < l

    1. Initial program 69.6%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{\frac{A}{V}}{\ell}}\right)\right) \]
      2. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{\frac{A}{V}}}{\color{blue}{\sqrt{\ell}}}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{\frac{A}{V}}\right), \color{blue}{\left(\sqrt{\ell}\right)}\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{A}{V}\right)\right), \left(\sqrt{\color{blue}{\ell}}\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, V\right)\right), \left(\sqrt{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f6487.8%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, V\right)\right), \mathsf{sqrt.f64}\left(\ell\right)\right)\right) \]
    4. Applied egg-rr87.8%

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

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

Alternative 8: 84.4% accurate, 0.5× speedup?

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

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


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

    1. Initial program 67.8%

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

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V \cdot \ell}{A}}} \]
      2. sqrt-divN/A

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

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}} \]
      4. un-div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{V \cdot \ell}{A}}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left(\sqrt{\frac{V \cdot \ell}{A}}\right)}\right) \]
      6. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{\frac{A}{V \cdot \ell}}\right)}^{\frac{1}{2}}\right)\right) \]
      8. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left({\left(\frac{A}{V \cdot \ell}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      9. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      10. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{A}{V \cdot \ell}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      11. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(\frac{A}{V}\right), \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      14. metadata-eval69.9%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr69.9%

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

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{A}{\ell \cdot V}\right)}^{\frac{-1}{2}}\right)\right) \]
      2. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{\frac{-1}{2}}\right)\right) \]
      3. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{\frac{V}{\frac{A}{\ell}}}\right)}^{\frac{-1}{2}}\right)\right) \]
      4. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{-1}\right)}^{\frac{-1}{2}}\right)\right) \]
      5. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{\color{blue}{\left(-1 \cdot \frac{-1}{2}\right)}}\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{\frac{1}{2}}\right)\right) \]
      7. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{\frac{A}{\ell}}}\right)\right) \]
      8. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{A} \cdot \ell}\right)\right) \]
      9. associate-*l/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V \cdot \ell}{A}}\right)\right) \]
      10. sqrt-divN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\frac{\sqrt{V \cdot \ell}}{\color{blue}{\sqrt{A}}}\right)\right) \]
      11. unpow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\frac{\sqrt{V \cdot \ell}}{{A}^{\color{blue}{\frac{1}{2}}}}\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{V \cdot \ell}\right), \color{blue}{\left({A}^{\frac{1}{2}}\right)}\right)\right) \]
      13. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(V \cdot \ell\right)\right), \left({\color{blue}{A}}^{\frac{1}{2}}\right)\right)\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \ell\right)\right), \left({A}^{\frac{1}{2}}\right)\right)\right) \]
      15. unpow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \ell\right)\right), \left(\sqrt{A}\right)\right)\right) \]
      16. sqrt-lowering-sqrt.f6430.3%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \ell\right)\right), \mathsf{sqrt.f64}\left(A\right)\right)\right) \]
    6. Applied egg-rr30.3%

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

    if -4.999999999999985e-310 < l

    1. Initial program 69.6%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{\frac{A}{V}}{\ell}}\right)\right) \]
      2. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{\frac{A}{V}}}{\color{blue}{\sqrt{\ell}}}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{\frac{A}{V}}\right), \color{blue}{\left(\sqrt{\ell}\right)}\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{A}{V}\right)\right), \left(\sqrt{\color{blue}{\ell}}\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, V\right)\right), \left(\sqrt{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f6487.8%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, V\right)\right), \mathsf{sqrt.f64}\left(\ell\right)\right)\right) \]
    4. Applied egg-rr87.8%

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

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

Alternative 9: 82.1% accurate, 0.5× speedup?

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

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


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

    1. Initial program 67.8%

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

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V \cdot \ell}{A}}} \]
      2. sqrt-divN/A

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

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}} \]
      4. un-div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{V \cdot \ell}{A}}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left(\sqrt{\frac{V \cdot \ell}{A}}\right)}\right) \]
      6. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      7. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{\frac{A}{V \cdot \ell}}\right)}^{\frac{1}{2}}\right)\right) \]
      8. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left({\left(\frac{A}{V \cdot \ell}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      9. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      10. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{A}{V \cdot \ell}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      11. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(\frac{A}{V}\right), \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      13. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      14. metadata-eval69.9%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr69.9%

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

    if -4.999999999999985e-310 < l

    1. Initial program 69.6%

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{\frac{A}{V}}{\ell}}\right)\right) \]
      2. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{\frac{A}{V}}}{\color{blue}{\sqrt{\ell}}}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{\frac{A}{V}}\right), \color{blue}{\left(\sqrt{\ell}\right)}\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{A}{V}\right)\right), \left(\sqrt{\color{blue}{\ell}}\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, V\right)\right), \left(\sqrt{\ell}\right)\right)\right) \]
      6. sqrt-lowering-sqrt.f6487.8%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, V\right)\right), \mathsf{sqrt.f64}\left(\ell\right)\right)\right) \]
    4. Applied egg-rr87.8%

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

Alternative 10: 73.6% accurate, 1.0× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ c0 \cdot \sqrt{\frac{A}{\ell \cdot V}} \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 (* l V)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	return c0 * sqrt((A / (l * V)));
}
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 / (l * v)))
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 / (l * V)));
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	return c0 * math.sqrt((A / (l * V)))
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	return Float64(c0 * sqrt(Float64(A / Float64(l * V))))
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
	tmp = c0 * sqrt((A / (l * V)));
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[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}
\end{array}
Derivation
  1. Initial program 68.6%

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

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

Reproduce

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