Henrywood and Agarwal, Equation (3)

Percentage Accurate: 73.9% → 86.7%
Time: 9.1s
Alternatives: 12
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 12 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.9% 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: 86.7% accurate, 0.3× speedup?

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

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


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

    1. Initial program 66.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < V

    1. Initial program 71.8%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Applied egg-rr40.4%

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

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

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

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

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

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

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

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

Alternative 2: 85.6% accurate, 0.3× speedup?

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

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


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

    1. Initial program 66.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < V

    1. Initial program 71.8%

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

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

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

        \[\leadsto \frac{c0 \cdot \sqrt{A}}{\sqrt{V} \cdot \color{blue}{\sqrt{\ell}}} \]
      4. times-fracN/A

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

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

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

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

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

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

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

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

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

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

Alternative 3: 89.0% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 30.9%

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

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

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

    if -inf.0 < (*.f64 V l) < -9.9999999999999998e-267

    1. Initial program 79.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{\mathsf{neg}\left(A\right)}\right), \left(\sqrt{\color{blue}{\left(\mathsf{neg}\left(V\right)\right) \cdot \ell}}\right)\right)\right) \]
      16. 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) \]
      17. 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) \]
      18. --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) \]
      19. 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) \]
      20. 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) \]
      21. *-commutativeN/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(\ell \cdot V\right)\right)\right)\right)\right) \]
      22. 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 - \ell \cdot V\right)\right)\right)\right) \]
      23. --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(\ell \cdot V\right)\right)\right)\right)\right) \]
      24. *-commutativeN/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) \]
      25. *-lowering-*.f6499.4%

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

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

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

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

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

    if -9.9999999999999998e-267 < (*.f64 V l) < 2e-273

    1. Initial program 43.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot {\left(\frac{V}{A} \cdot \ell\right)}^{\frac{-1}{2}} \]
      2. unpow-prod-downN/A

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

        \[\leadsto c0 \cdot \left({\left(\frac{V}{A}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot {\ell}^{\frac{-1}{2}}\right) \]
      4. pow-flipN/A

        \[\leadsto c0 \cdot \left(\frac{1}{{\left(\frac{V}{A}\right)}^{\frac{1}{2}}} \cdot {\color{blue}{\ell}}^{\frac{-1}{2}}\right) \]
      5. pow1/2N/A

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

        \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot {\ell}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right) \]
      7. pow-flipN/A

        \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot \frac{1}{\color{blue}{{\ell}^{\frac{1}{2}}}}\right) \]
      8. pow1/2N/A

        \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot \frac{1}{\sqrt{\ell}}\right) \]
      9. metadata-evalN/A

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

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

        \[\leadsto c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right) \]
      12. pow1/2N/A

        \[\leadsto c0 \cdot \left({\left(\frac{A}{V}\right)}^{\frac{1}{2}} \cdot \frac{\color{blue}{1}}{\sqrt{\ell}}\right) \]
      13. div-invN/A

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

        \[\leadsto \frac{c0 \cdot {\left(\frac{A}{V}\right)}^{\frac{1}{2}}}{\color{blue}{\sqrt{\ell}}} \]
      15. pow1/2N/A

        \[\leadsto \frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}} \]
      16. clear-numN/A

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

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

        \[\leadsto \frac{c0 \cdot \frac{1}{\sqrt{\frac{V}{A}}}}{\sqrt{\ell}} \]
      19. div-invN/A

        \[\leadsto \frac{\frac{c0}{\sqrt{\frac{V}{A}}}}{\sqrt{\color{blue}{\ell}}} \]
      20. associate-/r*N/A

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

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

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

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

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

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

    if 2e-273 < (*.f64 V l)

    1. Initial program 77.2%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot {\left(\frac{V}{A} \cdot \ell\right)}^{\frac{-1}{2}} \]
      2. unpow-prod-downN/A

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

        \[\leadsto c0 \cdot \left({\left(\frac{V}{A}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot {\ell}^{\frac{-1}{2}}\right) \]
      4. pow-flipN/A

        \[\leadsto c0 \cdot \left(\frac{1}{{\left(\frac{V}{A}\right)}^{\frac{1}{2}}} \cdot {\color{blue}{\ell}}^{\frac{-1}{2}}\right) \]
      5. pow1/2N/A

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

        \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot {\ell}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right) \]
      7. pow-flipN/A

        \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot \frac{1}{\color{blue}{{\ell}^{\frac{1}{2}}}}\right) \]
      8. pow1/2N/A

        \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot \frac{1}{\sqrt{\ell}}\right) \]
      9. metadata-evalN/A

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

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

        \[\leadsto c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right) \]
      12. pow1/2N/A

        \[\leadsto c0 \cdot \left({\left(\frac{A}{V}\right)}^{\frac{1}{2}} \cdot \frac{\color{blue}{1}}{\sqrt{\ell}}\right) \]
      13. div-invN/A

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

        \[\leadsto \frac{c0 \cdot {\left(\frac{A}{V}\right)}^{\frac{1}{2}}}{\color{blue}{\sqrt{\ell}}} \]
      15. pow1/2N/A

        \[\leadsto \frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}} \]
      16. clear-numN/A

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

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

        \[\leadsto \frac{c0 \cdot \frac{1}{\sqrt{\frac{V}{A}}}}{\sqrt{\ell}} \]
      19. div-invN/A

        \[\leadsto \frac{\frac{c0}{\sqrt{\frac{V}{A}}}}{\sqrt{\color{blue}{\ell}}} \]
      20. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\frac{{\left(\left(0 - V \cdot \ell\right) \cdot \left(0 - V \cdot \ell\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\sqrt{A}}\right)\right) \]
      10. pow-prod-downN/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{0 - V \cdot \ell}\right), \color{blue}{\left(\sqrt{A}\right)}\right)\right) \]
    8. Applied egg-rr91.0%

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

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

Alternative 4: 83.4% accurate, 0.5× speedup?

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

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


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

    1. Initial program 66.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.999999999999994e-310 < V

    1. Initial program 71.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 79.7% accurate, 0.5× speedup?

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

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


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

    1. Initial program 62.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot {\left(\frac{V}{A} \cdot \ell\right)}^{\frac{-1}{2}} \]
      2. unpow-prod-downN/A

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

        \[\leadsto c0 \cdot \left({\left(\frac{V}{A}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot {\ell}^{\frac{-1}{2}}\right) \]
      4. pow-flipN/A

        \[\leadsto c0 \cdot \left(\frac{1}{{\left(\frac{V}{A}\right)}^{\frac{1}{2}}} \cdot {\color{blue}{\ell}}^{\frac{-1}{2}}\right) \]
      5. pow1/2N/A

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

        \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot {\ell}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right) \]
      7. pow-flipN/A

        \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot \frac{1}{\color{blue}{{\ell}^{\frac{1}{2}}}}\right) \]
      8. pow1/2N/A

        \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot \frac{1}{\sqrt{\ell}}\right) \]
      9. metadata-evalN/A

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

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

        \[\leadsto c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right) \]
      12. pow1/2N/A

        \[\leadsto c0 \cdot \left({\left(\frac{A}{V}\right)}^{\frac{1}{2}} \cdot \frac{\color{blue}{1}}{\sqrt{\ell}}\right) \]
      13. div-invN/A

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

        \[\leadsto \frac{c0 \cdot {\left(\frac{A}{V}\right)}^{\frac{1}{2}}}{\color{blue}{\sqrt{\ell}}} \]
      15. pow1/2N/A

        \[\leadsto \frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}} \]
      16. clear-numN/A

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

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

        \[\leadsto \frac{c0 \cdot \frac{1}{\sqrt{\frac{V}{A}}}}{\sqrt{\ell}} \]
      19. div-invN/A

        \[\leadsto \frac{\frac{c0}{\sqrt{\frac{V}{A}}}}{\sqrt{\color{blue}{\ell}}} \]
      20. associate-/r*N/A

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

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

    if 9.88131e-323 < (*.f64 V l)

    1. Initial program 78.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 84.5% accurate, 0.5× speedup?

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

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


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

    1. Initial program 66.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot {\left(\frac{V}{A} \cdot \ell\right)}^{\frac{-1}{2}} \]
      2. unpow-prod-downN/A

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

        \[\leadsto c0 \cdot \left({\left(\frac{V}{A}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot {\ell}^{\frac{-1}{2}}\right) \]
      4. pow-flipN/A

        \[\leadsto c0 \cdot \left(\frac{1}{{\left(\frac{V}{A}\right)}^{\frac{1}{2}}} \cdot {\color{blue}{\ell}}^{\frac{-1}{2}}\right) \]
      5. pow1/2N/A

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

        \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot {\ell}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right) \]
      7. pow-flipN/A

        \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot \frac{1}{\color{blue}{{\ell}^{\frac{1}{2}}}}\right) \]
      8. pow1/2N/A

        \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot \frac{1}{\sqrt{\ell}}\right) \]
      9. metadata-evalN/A

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

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

        \[\leadsto c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right) \]
      12. pow1/2N/A

        \[\leadsto c0 \cdot \left({\left(\frac{A}{V}\right)}^{\frac{1}{2}} \cdot \frac{\color{blue}{1}}{\sqrt{\ell}}\right) \]
      13. div-invN/A

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

        \[\leadsto \frac{c0 \cdot {\left(\frac{A}{V}\right)}^{\frac{1}{2}}}{\color{blue}{\sqrt{\ell}}} \]
      15. pow1/2N/A

        \[\leadsto \frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}} \]
      16. clear-numN/A

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

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

        \[\leadsto \frac{c0 \cdot \frac{1}{\sqrt{\frac{V}{A}}}}{\sqrt{\ell}} \]
      19. div-invN/A

        \[\leadsto \frac{\frac{c0}{\sqrt{\frac{V}{A}}}}{\sqrt{\color{blue}{\ell}}} \]
      20. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

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

    if -1.000000000000002e-309 < A

    1. Initial program 72.3%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot {\left(\frac{V}{A} \cdot \ell\right)}^{\frac{-1}{2}} \]
      2. unpow-prod-downN/A

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

        \[\leadsto c0 \cdot \left({\left(\frac{V}{A}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot {\ell}^{\frac{-1}{2}}\right) \]
      4. pow-flipN/A

        \[\leadsto c0 \cdot \left(\frac{1}{{\left(\frac{V}{A}\right)}^{\frac{1}{2}}} \cdot {\color{blue}{\ell}}^{\frac{-1}{2}}\right) \]
      5. pow1/2N/A

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

        \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot {\ell}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right) \]
      7. pow-flipN/A

        \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot \frac{1}{\color{blue}{{\ell}^{\frac{1}{2}}}}\right) \]
      8. pow1/2N/A

        \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot \frac{1}{\sqrt{\ell}}\right) \]
      9. metadata-evalN/A

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

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

        \[\leadsto c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right) \]
      12. pow1/2N/A

        \[\leadsto c0 \cdot \left({\left(\frac{A}{V}\right)}^{\frac{1}{2}} \cdot \frac{\color{blue}{1}}{\sqrt{\ell}}\right) \]
      13. div-invN/A

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

        \[\leadsto \frac{c0 \cdot {\left(\frac{A}{V}\right)}^{\frac{1}{2}}}{\color{blue}{\sqrt{\ell}}} \]
      15. pow1/2N/A

        \[\leadsto \frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}} \]
      16. clear-numN/A

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

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

        \[\leadsto \frac{c0 \cdot \frac{1}{\sqrt{\frac{V}{A}}}}{\sqrt{\ell}} \]
      19. div-invN/A

        \[\leadsto \frac{\frac{c0}{\sqrt{\frac{V}{A}}}}{\sqrt{\color{blue}{\ell}}} \]
      20. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\frac{{\left(\left(0 - V \cdot \ell\right) \cdot \left(0 - V \cdot \ell\right)\right)}^{\left(\frac{\frac{1}{2}}{2}\right)}}{\sqrt{A}}\right)\right) \]
      10. pow-prod-downN/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{0 - V \cdot \ell}\right), \color{blue}{\left(\sqrt{A}\right)}\right)\right) \]
    8. Applied egg-rr83.4%

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

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

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


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

    1. Initial program 66.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot {\left(\frac{V}{A} \cdot \ell\right)}^{\frac{-1}{2}} \]
      2. unpow-prod-downN/A

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

        \[\leadsto c0 \cdot \left({\left(\frac{V}{A}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot {\ell}^{\frac{-1}{2}}\right) \]
      4. pow-flipN/A

        \[\leadsto c0 \cdot \left(\frac{1}{{\left(\frac{V}{A}\right)}^{\frac{1}{2}}} \cdot {\color{blue}{\ell}}^{\frac{-1}{2}}\right) \]
      5. pow1/2N/A

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

        \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot {\ell}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right) \]
      7. pow-flipN/A

        \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot \frac{1}{\color{blue}{{\ell}^{\frac{1}{2}}}}\right) \]
      8. pow1/2N/A

        \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot \frac{1}{\sqrt{\ell}}\right) \]
      9. metadata-evalN/A

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

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

        \[\leadsto c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right) \]
      12. pow1/2N/A

        \[\leadsto c0 \cdot \left({\left(\frac{A}{V}\right)}^{\frac{1}{2}} \cdot \frac{\color{blue}{1}}{\sqrt{\ell}}\right) \]
      13. div-invN/A

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

        \[\leadsto \frac{c0 \cdot {\left(\frac{A}{V}\right)}^{\frac{1}{2}}}{\color{blue}{\sqrt{\ell}}} \]
      15. pow1/2N/A

        \[\leadsto \frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}} \]
      16. clear-numN/A

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

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

        \[\leadsto \frac{c0 \cdot \frac{1}{\sqrt{\frac{V}{A}}}}{\sqrt{\ell}} \]
      19. div-invN/A

        \[\leadsto \frac{\frac{c0}{\sqrt{\frac{V}{A}}}}{\sqrt{\color{blue}{\ell}}} \]
      20. associate-/r*N/A

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

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

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

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

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

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

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

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

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

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

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

    if -1.000000000000002e-309 < A

    1. Initial program 72.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 84.5% accurate, 0.5× speedup?

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

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


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

    1. Initial program 66.1%

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

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

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

    if -1.000000000000002e-309 < A

    1. Initial program 72.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 80.2% accurate, 0.9× speedup?

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

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


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

    1. Initial program 36.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-/.f6453.0%

        \[\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-rr53.0%

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

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

    1. Initial program 99.1%

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

Alternative 10: 73.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto c0 \cdot {\left(\frac{V}{A} \cdot \ell\right)}^{\frac{-1}{2}} \]
    2. unpow-prod-downN/A

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

      \[\leadsto c0 \cdot \left({\left(\frac{V}{A}\right)}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)} \cdot {\ell}^{\frac{-1}{2}}\right) \]
    4. pow-flipN/A

      \[\leadsto c0 \cdot \left(\frac{1}{{\left(\frac{V}{A}\right)}^{\frac{1}{2}}} \cdot {\color{blue}{\ell}}^{\frac{-1}{2}}\right) \]
    5. pow1/2N/A

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

      \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot {\ell}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right) \]
    7. pow-flipN/A

      \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot \frac{1}{\color{blue}{{\ell}^{\frac{1}{2}}}}\right) \]
    8. pow1/2N/A

      \[\leadsto c0 \cdot \left(\frac{1}{\sqrt{\frac{V}{A}}} \cdot \frac{1}{\sqrt{\ell}}\right) \]
    9. metadata-evalN/A

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

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

      \[\leadsto c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\sqrt{\ell}}\right) \]
    12. pow1/2N/A

      \[\leadsto c0 \cdot \left({\left(\frac{A}{V}\right)}^{\frac{1}{2}} \cdot \frac{\color{blue}{1}}{\sqrt{\ell}}\right) \]
    13. div-invN/A

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

      \[\leadsto \frac{c0 \cdot {\left(\frac{A}{V}\right)}^{\frac{1}{2}}}{\color{blue}{\sqrt{\ell}}} \]
    15. pow1/2N/A

      \[\leadsto \frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}} \]
    16. clear-numN/A

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

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

      \[\leadsto \frac{c0 \cdot \frac{1}{\sqrt{\frac{V}{A}}}}{\sqrt{\ell}} \]
    19. div-invN/A

      \[\leadsto \frac{\frac{c0}{\sqrt{\frac{V}{A}}}}{\sqrt{\color{blue}{\ell}}} \]
    20. associate-/r*N/A

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

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

Alternative 11: 73.5% accurate, 1.0× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{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(Float64(A / 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[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}
\end{array}
Derivation
  1. Initial program 69.5%

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

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

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

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

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

Alternative 12: 73.9% accurate, 1.0× speedup?

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

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

Reproduce

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