Henrywood and Agarwal, Equation (3)

Percentage Accurate: 74.5% → 92.2%
Time: 10.0s
Alternatives: 19
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 19 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: 74.5% 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: 92.2% accurate, 0.3× speedup?

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

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

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

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

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


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

    1. Initial program 45.9%

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

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

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

        \[\leadsto \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}} \cdot c0 \]
      4. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 V l) < -1.0000000000000001e-253

    1. Initial program 84.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\mathsf{neg}\left(\frac{1}{\ell}\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(V\right)\right)\right)}\right)\right), \left(\sqrt{\color{blue}{0} - A}\right)\right)\right) \]
      8. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\mathsf{neg}\left(V\right)}\right), \ell\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\color{blue}{0}, A\right)\right)\right)\right) \]
      6. metadata-evalN/A

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

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

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

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

    if -1.0000000000000001e-253 < (*.f64 V l) < 1.00000000000000002e-294

    1. Initial program 52.8%

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

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

        \[\leadsto \frac{\sqrt{A}}{\sqrt{V \cdot \ell}} \cdot c0 \]
      3. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000002e-294 < (*.f64 V l) < 9.9999999999999998e284

    1. Initial program 81.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999998e284 < (*.f64 V l)

    1. Initial program 38.2%

      \[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, \mathsf{sqrt.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right)\right)\right) \]
      2. /-lowering-/.f64N/A

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

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

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

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

Alternative 2: 76.3% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 69.8%

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

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

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

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

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

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

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

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

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

    if 1e-142 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999984e134

    1. Initial program 99.5%

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

    if 1.99999999999999984e134 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{1}{\frac{\sqrt{\frac{V}{\frac{A}{\ell}}}}{c0}} \]
      3. /-lowering-/.f64N/A

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

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

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

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

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

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

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

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

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

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

Alternative 3: 76.5% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 68.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1e-209 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999984e134

    1. Initial program 99.5%

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

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

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

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

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

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

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

    if 1.99999999999999984e134 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 76.4% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_0 \leq 10^{+145}:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 69.8%

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

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

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

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

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

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

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

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

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

    if 1e-142 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999999e144

    1. Initial program 99.5%

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

    if 9.9999999999999999e144 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 76.8% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_0 \leq 10^{+145}:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 68.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000008e-252 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999999e144

    1. Initial program 99.5%

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

    if 9.9999999999999999e144 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 77.2% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_0 \leq 10^{+145}:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 68.5%

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000008e-252 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999999e144

    1. Initial program 99.5%

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

    if 9.9999999999999999e144 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 66.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 76.4% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_0 \leq 10^{+145}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999997e-155 or 9.9999999999999999e144 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 68.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999997e-155 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999999e144

    1. Initial program 99.5%

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

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

Alternative 8: 77.2% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 68.3%

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

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

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999984e134

    1. Initial program 99.5%

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

    if 1.99999999999999984e134 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 66.4%

      \[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, \mathsf{sqrt.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right)\right)\right) \]
      2. /-lowering-/.f64N/A

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

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

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

Alternative 9: 76.5% accurate, 0.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.00000000000000008e-252 or 1.99999999999999984e134 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 68.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, \mathsf{sqrt.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right)\right)\right) \]
      2. /-lowering-/.f64N/A

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

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

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

    if 5.00000000000000008e-252 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999984e134

    1. Initial program 99.5%

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

Alternative 10: 86.9% accurate, 0.3× speedup?

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

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


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

    1. Initial program 72.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\ell}{\mathsf{neg}\left(A\right)}} \cdot \color{blue}{\sqrt{\mathsf{neg}\left(V\right)}}\right)\right) \]
      4. distribute-frac-neg2N/A

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.999999999999985e-310 < V

    1. Initial program 72.9%

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

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

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

        \[\leadsto \frac{\sqrt{\frac{A}{\ell}}}{\sqrt{V}} \cdot c0 \]
      4. pow1/2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 91.3% 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 \left(\sqrt{\frac{-1}{V}} \cdot \sqrt{0 - \frac{A}{\ell}}\right)\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-253}:\\ \;\;\;\;c0 \cdot \left(\sqrt{0 - A} \cdot \sqrt{\frac{\frac{-1}{V}}{\ell}}\right)\\ \mathbf{elif}\;V \cdot \ell \leq 10^{-294}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{\frac{V}{\frac{A}{\ell}}}}{c0}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+285}:\\ \;\;\;\;\frac{c0}{{A}^{-0.5} \cdot \sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\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) (- INFINITY))
   (* c0 (* (sqrt (/ -1.0 V)) (sqrt (- 0.0 (/ A l)))))
   (if (<= (* V l) -1e-253)
     (* c0 (* (sqrt (- 0.0 A)) (sqrt (/ (/ -1.0 V) l))))
     (if (<= (* V l) 1e-294)
       (/ 1.0 (/ (sqrt (/ V (/ A l))) c0))
       (if (<= (* V l) 1e+285)
         (/ c0 (* (pow A -0.5) (sqrt (* V l))))
         (* c0 (sqrt (/ (/ A V) l))))))))
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((-1.0 / V)) * sqrt((0.0 - (A / l))));
	} else if ((V * l) <= -1e-253) {
		tmp = c0 * (sqrt((0.0 - A)) * sqrt(((-1.0 / V) / l)));
	} else if ((V * l) <= 1e-294) {
		tmp = 1.0 / (sqrt((V / (A / l))) / c0);
	} else if ((V * l) <= 1e+285) {
		tmp = c0 / (pow(A, -0.5) * sqrt((V * l)));
	} else {
		tmp = c0 * sqrt(((A / V) / l));
	}
	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((-1.0 / V)) * Math.sqrt((0.0 - (A / l))));
	} else if ((V * l) <= -1e-253) {
		tmp = c0 * (Math.sqrt((0.0 - A)) * Math.sqrt(((-1.0 / V) / l)));
	} else if ((V * l) <= 1e-294) {
		tmp = 1.0 / (Math.sqrt((V / (A / l))) / c0);
	} else if ((V * l) <= 1e+285) {
		tmp = c0 / (Math.pow(A, -0.5) * Math.sqrt((V * l)));
	} else {
		tmp = c0 * Math.sqrt(((A / V) / l));
	}
	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((-1.0 / V)) * math.sqrt((0.0 - (A / l))))
	elif (V * l) <= -1e-253:
		tmp = c0 * (math.sqrt((0.0 - A)) * math.sqrt(((-1.0 / V) / l)))
	elif (V * l) <= 1e-294:
		tmp = 1.0 / (math.sqrt((V / (A / l))) / c0)
	elif (V * l) <= 1e+285:
		tmp = c0 / (math.pow(A, -0.5) * math.sqrt((V * l)))
	else:
		tmp = c0 * math.sqrt(((A / 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) <= Float64(-Inf))
		tmp = Float64(c0 * Float64(sqrt(Float64(-1.0 / V)) * sqrt(Float64(0.0 - Float64(A / l)))));
	elseif (Float64(V * l) <= -1e-253)
		tmp = Float64(c0 * Float64(sqrt(Float64(0.0 - A)) * sqrt(Float64(Float64(-1.0 / V) / l))));
	elseif (Float64(V * l) <= 1e-294)
		tmp = Float64(1.0 / Float64(sqrt(Float64(V / Float64(A / l))) / c0));
	elseif (Float64(V * l) <= 1e+285)
		tmp = Float64(c0 / Float64((A ^ -0.5) * sqrt(Float64(V * l))));
	else
		tmp = Float64(c0 * sqrt(Float64(Float64(A / 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) <= -Inf)
		tmp = c0 * (sqrt((-1.0 / V)) * sqrt((0.0 - (A / l))));
	elseif ((V * l) <= -1e-253)
		tmp = c0 * (sqrt((0.0 - A)) * sqrt(((-1.0 / V) / l)));
	elseif ((V * l) <= 1e-294)
		tmp = 1.0 / (sqrt((V / (A / l))) / c0);
	elseif ((V * l) <= 1e+285)
		tmp = c0 / ((A ^ -0.5) * sqrt((V * l)));
	else
		tmp = c0 * sqrt(((A / 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], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(-1.0 / V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(0.0 - N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-253], N[(c0 * N[(N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(N[(-1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-294], N[(1.0 / N[(N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+285], N[(c0 / N[(N[Power[A, -0.5], $MachinePrecision] * N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $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 \left(\sqrt{\frac{-1}{V}} \cdot \sqrt{0 - \frac{A}{\ell}}\right)\\

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

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

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

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


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

    1. Initial program 45.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 V l) < -1.0000000000000001e-253

    1. Initial program 84.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{\mathsf{neg}\left(\frac{1}{\ell}\right)}{\mathsf{neg}\left(\left(\mathsf{neg}\left(V\right)\right)\right)}\right)\right), \left(\sqrt{\color{blue}{0} - A}\right)\right)\right) \]
      8. remove-double-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\mathsf{neg}\left(V\right)}\right), \ell\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(\color{blue}{0}, A\right)\right)\right)\right) \]
      6. metadata-evalN/A

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

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

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

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

    if -1.0000000000000001e-253 < (*.f64 V l) < 1.00000000000000002e-294

    1. Initial program 52.8%

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

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

        \[\leadsto \frac{\sqrt{A}}{\sqrt{V \cdot \ell}} \cdot c0 \]
      3. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000002e-294 < (*.f64 V l) < 9.9999999999999998e284

    1. Initial program 81.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999998e284 < (*.f64 V l)

    1. Initial program 38.2%

      \[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, \mathsf{sqrt.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right)\right)\right) \]
      2. /-lowering-/.f64N/A

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

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

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

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

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

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

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

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

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


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

    1. Initial program 48.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999992e292 < (*.f64 V l) < -9.9999999999999993e-273

    1. Initial program 84.9%

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

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

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

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

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

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

        \[\leadsto \frac{c0}{\frac{\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}}{\color{blue}{\sqrt{\mathsf{neg}\left(A\right)}}}} \]
      7. associate-/r/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.9999999999999993e-273 < (*.f64 V l) < 5.0000000023e-315

    1. Initial program 48.3%

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

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

        \[\leadsto \frac{\sqrt{A}}{\sqrt{V \cdot \ell}} \cdot c0 \]
      3. associate-*l/N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.0000000023e-315 < (*.f64 V l) < 9.9999999999999998e284

    1. Initial program 82.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.9999999999999998e284 < (*.f64 V l)

    1. Initial program 38.2%

      \[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, \mathsf{sqrt.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right)\right)\right) \]
      2. /-lowering-/.f64N/A

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 V l) < -9.9999999999999992e292

    1. Initial program 48.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{A}{V \cdot \ell}} \cdot \color{blue}{c0} \]
      2. sqrt-divN/A

        \[\leadsto \frac{\sqrt{A}}{\sqrt{V \cdot \ell}} \cdot c0 \]
      3. associate-*l/N/A

        \[\leadsto \frac{\sqrt{A} \cdot c0}{\color{blue}{\sqrt{V \cdot \ell}}} \]
      4. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A} \cdot c0}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\sqrt{V \cdot \ell}}{\sqrt{A} \cdot c0}\right)}\right) \]
      6. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}{\color{blue}{c0}}\right)\right) \]
      7. sqrt-divN/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{\sqrt{\frac{V \cdot \ell}{A}}}{c0}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\frac{V \cdot \ell}{A}}\right), \color{blue}{c0}\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{V \cdot \ell}{A}\right)\right), c0\right)\right) \]
      10. associate-*l/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{V}{A} \cdot \ell\right)\right), c0\right)\right) \]
      11. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right)\right), c0\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{A}{\ell}\right)\right)\right), c0\right)\right) \]
      13. /-lowering-/.f6476.1%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right)\right), c0\right)\right) \]
    4. Applied egg-rr76.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt{\frac{V}{\frac{A}{\ell}}}}{c0}}} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\frac{V}{A} \cdot \ell}\right), c0\right)\right) \]
      2. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}\right), c0\right)\right) \]
      3. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\frac{1}{\frac{A}{V}}} \cdot \sqrt{\ell}\right), c0\right)\right) \]
      4. sqrt-divN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{\sqrt{1}}{\sqrt{\frac{A}{V}}} \cdot \sqrt{\ell}\right), c0\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{1}{\sqrt{\frac{A}{V}}} \cdot \sqrt{\ell}\right), c0\right)\right) \]
      6. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{1}{{\left(\frac{A}{V}\right)}^{\frac{1}{2}}} \cdot \sqrt{\ell}\right), c0\right)\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{1}{\frac{{\left(\frac{A}{V}\right)}^{\frac{1}{2}}}{\sqrt{\ell}}}\right), c0\right)\right) \]
      8. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{\sqrt{\ell}}{{\left(\frac{A}{V}\right)}^{\frac{1}{2}}}\right), c0\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\sqrt{\ell}\right), \left({\left(\frac{A}{V}\right)}^{\frac{1}{2}}\right)\right), c0\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\ell\right), \left({\left(\frac{A}{V}\right)}^{\frac{1}{2}}\right)\right), c0\right)\right) \]
      11. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\ell\right), \mathsf{pow.f64}\left(\left(\frac{A}{V}\right), \frac{1}{2}\right)\right), c0\right)\right) \]
      12. /-lowering-/.f6442.0%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\ell\right), \mathsf{pow.f64}\left(\mathsf{/.f64}\left(A, V\right), \frac{1}{2}\right)\right), c0\right)\right) \]
    6. Applied egg-rr42.0%

      \[\leadsto \frac{1}{\frac{\color{blue}{\frac{\sqrt{\ell}}{{\left(\frac{A}{V}\right)}^{0.5}}}}{c0}} \]

    if -9.9999999999999992e292 < (*.f64 V l) < -9.9999999999999993e-273

    1. Initial program 84.9%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V \cdot \ell}{A}}} \]
      2. sqrt-divN/A

        \[\leadsto c0 \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{V \cdot \ell}{A}}}} \]
      3. metadata-evalN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}} \]
      4. un-div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{V \cdot \ell}{A}}}} \]
      5. frac-2negN/A

        \[\leadsto \frac{c0}{\sqrt{\frac{\mathsf{neg}\left(V \cdot \ell\right)}{\mathsf{neg}\left(A\right)}}} \]
      6. sqrt-divN/A

        \[\leadsto \frac{c0}{\frac{\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}}{\color{blue}{\sqrt{\mathsf{neg}\left(A\right)}}}} \]
      7. associate-/r/N/A

        \[\leadsto \frac{c0}{\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}} \cdot \color{blue}{\sqrt{\mathsf{neg}\left(A\right)}} \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{c0}{\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}}\right), \color{blue}{\left(\sqrt{\mathsf{neg}\left(A\right)}\right)}\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)\right), \left(\sqrt{\color{blue}{\mathsf{neg}\left(A\right)}}\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(V \cdot \ell\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(V \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      13. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \left(0 - \ell\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      14. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      15. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(A\right)\right)\right)\right) \]
      16. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\left(0 - A\right)\right)\right) \]
      17. --lowering--.f6498.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
    4. Applied egg-rr98.4%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \left(0 - \ell\right)}} \cdot \sqrt{0 - A}} \]
    5. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(V \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\left(\mathsf{neg}\left(\ell\right)\right) \cdot V\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      3. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(\ell \cdot V\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\left(\ell \cdot V\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      5. *-lowering-*.f6498.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\ell, V\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
    6. Applied egg-rr98.4%

      \[\leadsto \frac{c0}{\sqrt{\color{blue}{-\ell \cdot V}}} \cdot \sqrt{0 - A} \]

    if -9.9999999999999993e-273 < (*.f64 V l) < 5.0000000023e-315

    1. Initial program 48.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{A}{V \cdot \ell}} \cdot \color{blue}{c0} \]
      2. sqrt-divN/A

        \[\leadsto \frac{\sqrt{A}}{\sqrt{V \cdot \ell}} \cdot c0 \]
      3. associate-*l/N/A

        \[\leadsto \frac{\sqrt{A} \cdot c0}{\color{blue}{\sqrt{V \cdot \ell}}} \]
      4. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A} \cdot c0}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\sqrt{V \cdot \ell}}{\sqrt{A} \cdot c0}\right)}\right) \]
      6. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}{\color{blue}{c0}}\right)\right) \]
      7. sqrt-divN/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{\sqrt{\frac{V \cdot \ell}{A}}}{c0}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\frac{V \cdot \ell}{A}}\right), \color{blue}{c0}\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{V \cdot \ell}{A}\right)\right), c0\right)\right) \]
      10. associate-*l/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{V}{A} \cdot \ell\right)\right), c0\right)\right) \]
      11. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right)\right), c0\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{A}{\ell}\right)\right)\right), c0\right)\right) \]
      13. /-lowering-/.f6468.0%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right)\right), c0\right)\right) \]
    4. Applied egg-rr68.0%

      \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt{\frac{V}{\frac{A}{\ell}}}}{c0}}} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{V}{A} \cdot \ell\right)\right), c0\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\frac{V}{A}\right), \ell\right)\right), c0\right)\right) \]
      3. /-lowering-/.f6468.1%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(V, A\right), \ell\right)\right), c0\right)\right) \]
    6. Applied egg-rr68.1%

      \[\leadsto \frac{1}{\frac{\sqrt{\color{blue}{\frac{V}{A} \cdot \ell}}}{c0}} \]

    if 5.0000000023e-315 < (*.f64 V l) < 9.9999999999999998e284

    1. Initial program 82.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\ell \cdot V}{A}}\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\ell \cdot \frac{V}{A}}\right)\right)\right) \]
      4. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{\frac{V}{A}}\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), \left(\frac{V}{A}\right)\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), \left(\frac{V}{A}\right)\right)\right)\right) \]
      7. /-lowering-/.f6477.5%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), \mathsf{/.f64}\left(V, A\right)\right)\right)\right) \]
    4. Applied egg-rr77.5%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{\frac{V}{A}}}} \]
    5. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{A} \cdot \ell}} \]
      2. associate-/r/N/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{\frac{A}{\ell}}}} \]
      3. sqrt-divN/A

        \[\leadsto c0 \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      4. metadata-evalN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V}{\frac{A}{\ell}}}}} \]
      5. div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left(\sqrt{\frac{V}{\frac{A}{\ell}}}\right)}\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{A} \cdot \ell}\right)\right) \]
      8. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{A}} \cdot \color{blue}{\sqrt{\ell}}\right)\right) \]
      9. /-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{1}} \cdot \sqrt{\ell}\right)\right) \]
      10. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{1} \cdot \ell}\right)\right) \]
      11. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{\frac{1}{\ell}}}\right)\right) \]
      12. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{V}{A}}{\frac{1}{\ell}}\right)\right)\right) \]
      13. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\frac{A}{V}}}{\frac{1}{\ell}}\right)\right)\right) \]
      14. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{A}{V} \cdot \frac{1}{\ell}}\right)\right)\right) \]
      15. div-invN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\frac{A}{V}}{\ell}}\right)\right)\right) \]
      16. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\ell}{\frac{A}{V}}\right)\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \left(\frac{A}{V}\right)\right)\right)\right) \]
      18. /-lowering-/.f6477.8%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(A, V\right)\right)\right)\right) \]
    6. Applied egg-rr77.8%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}} \]
    7. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{1}{\frac{\frac{A}{V}}{\ell}}}\right)\right) \]
      2. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{1}{\frac{A}{\ell \cdot V}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{1}{A} \cdot \left(\ell \cdot V\right)}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{1}{A} \cdot \left(V \cdot \ell\right)}\right)\right) \]
      5. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{1}{A}} \cdot \color{blue}{\sqrt{V \cdot \ell}}\right)\right) \]
      6. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{A}\right)}^{\frac{1}{2}} \cdot \sqrt{\color{blue}{V \cdot \ell}}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left({\left(\frac{1}{A}\right)}^{\frac{1}{2}}\right), \color{blue}{\left(\sqrt{V \cdot \ell}\right)}\right)\right) \]
      8. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left({\left({A}^{-1}\right)}^{\frac{1}{2}}\right), \left(\sqrt{\color{blue}{V} \cdot \ell}\right)\right)\right) \]
      9. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left({A}^{\left(-1 \cdot \frac{1}{2}\right)}\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left({A}^{\frac{-1}{2}}\right), \left(\sqrt{V \cdot \color{blue}{\ell}}\right)\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left({A}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right), \left(\sqrt{V \cdot \color{blue}{\ell}}\right)\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(A, \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(A, \frac{-1}{2}\right), \left(\sqrt{V \cdot \color{blue}{\ell}}\right)\right)\right) \]
      14. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(A, \frac{-1}{2}\right), \mathsf{sqrt.f64}\left(\left(V \cdot \ell\right)\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(A, \frac{-1}{2}\right), \mathsf{sqrt.f64}\left(\left(\ell \cdot V\right)\right)\right)\right) \]
      16. *-lowering-*.f6499.5%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(A, \frac{-1}{2}\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, V\right)\right)\right)\right) \]
    8. Applied egg-rr99.5%

      \[\leadsto \frac{c0}{\color{blue}{{A}^{-0.5} \cdot \sqrt{\ell \cdot V}}} \]

    if 9.9999999999999998e284 < (*.f64 V l)

    1. Initial program 38.2%

      \[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, \mathsf{sqrt.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{A}{V}\right), \ell\right)\right)\right) \]
      3. /-lowering-/.f6485.9%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right)\right)\right) \]
    4. Applied egg-rr85.9%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification88.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+293}:\\ \;\;\;\;\frac{1}{\frac{\frac{\sqrt{\ell}}{{\left(\frac{A}{V}\right)}^{0.5}}}{c0}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-272}:\\ \;\;\;\;\sqrt{0 - A} \cdot \frac{c0}{\sqrt{0 - V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-315}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{\ell \cdot \frac{V}{A}}}{c0}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+285}:\\ \;\;\;\;\frac{c0}{{A}^{-0.5} \cdot \sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 90.5% 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 -1 \cdot 10^{+293}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-272}:\\ \;\;\;\;\sqrt{0 - A} \cdot \frac{c0}{\sqrt{0 - V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-315}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{\ell \cdot \frac{V}{A}}}{c0}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+285}:\\ \;\;\;\;\frac{c0}{{A}^{-0.5} \cdot \sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\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+293)
   (/ c0 (/ (sqrt l) (sqrt (/ A V))))
   (if (<= (* V l) -1e-272)
     (* (sqrt (- 0.0 A)) (/ c0 (sqrt (- 0.0 (* V l)))))
     (if (<= (* V l) 5e-315)
       (/ 1.0 (/ (sqrt (* l (/ V A))) c0))
       (if (<= (* V l) 1e+285)
         (/ c0 (* (pow A -0.5) (sqrt (* V l))))
         (* c0 (sqrt (/ (/ A 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+293) {
		tmp = c0 / (sqrt(l) / sqrt((A / V)));
	} else if ((V * l) <= -1e-272) {
		tmp = sqrt((0.0 - A)) * (c0 / sqrt((0.0 - (V * l))));
	} else if ((V * l) <= 5e-315) {
		tmp = 1.0 / (sqrt((l * (V / A))) / c0);
	} else if ((V * l) <= 1e+285) {
		tmp = c0 / (pow(A, -0.5) * sqrt((V * l)));
	} else {
		tmp = c0 * sqrt(((A / 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+293)) then
        tmp = c0 / (sqrt(l) / sqrt((a / v)))
    else if ((v * l) <= (-1d-272)) then
        tmp = sqrt((0.0d0 - a)) * (c0 / sqrt((0.0d0 - (v * l))))
    else if ((v * l) <= 5d-315) then
        tmp = 1.0d0 / (sqrt((l * (v / a))) / c0)
    else if ((v * l) <= 1d+285) then
        tmp = c0 / ((a ** (-0.5d0)) * sqrt((v * l)))
    else
        tmp = c0 * sqrt(((a / 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+293) {
		tmp = c0 / (Math.sqrt(l) / Math.sqrt((A / V)));
	} else if ((V * l) <= -1e-272) {
		tmp = Math.sqrt((0.0 - A)) * (c0 / Math.sqrt((0.0 - (V * l))));
	} else if ((V * l) <= 5e-315) {
		tmp = 1.0 / (Math.sqrt((l * (V / A))) / c0);
	} else if ((V * l) <= 1e+285) {
		tmp = c0 / (Math.pow(A, -0.5) * Math.sqrt((V * l)));
	} else {
		tmp = c0 * Math.sqrt(((A / 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+293:
		tmp = c0 / (math.sqrt(l) / math.sqrt((A / V)))
	elif (V * l) <= -1e-272:
		tmp = math.sqrt((0.0 - A)) * (c0 / math.sqrt((0.0 - (V * l))))
	elif (V * l) <= 5e-315:
		tmp = 1.0 / (math.sqrt((l * (V / A))) / c0)
	elif (V * l) <= 1e+285:
		tmp = c0 / (math.pow(A, -0.5) * math.sqrt((V * l)))
	else:
		tmp = c0 * math.sqrt(((A / 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+293)
		tmp = Float64(c0 / Float64(sqrt(l) / sqrt(Float64(A / V))));
	elseif (Float64(V * l) <= -1e-272)
		tmp = Float64(sqrt(Float64(0.0 - A)) * Float64(c0 / sqrt(Float64(0.0 - Float64(V * l)))));
	elseif (Float64(V * l) <= 5e-315)
		tmp = Float64(1.0 / Float64(sqrt(Float64(l * Float64(V / A))) / c0));
	elseif (Float64(V * l) <= 1e+285)
		tmp = Float64(c0 / Float64((A ^ -0.5) * sqrt(Float64(V * l))));
	else
		tmp = Float64(c0 * sqrt(Float64(Float64(A / 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+293)
		tmp = c0 / (sqrt(l) / sqrt((A / V)));
	elseif ((V * l) <= -1e-272)
		tmp = sqrt((0.0 - A)) * (c0 / sqrt((0.0 - (V * l))));
	elseif ((V * l) <= 5e-315)
		tmp = 1.0 / (sqrt((l * (V / A))) / c0);
	elseif ((V * l) <= 1e+285)
		tmp = c0 / ((A ^ -0.5) * sqrt((V * l)));
	else
		tmp = c0 * sqrt(((A / 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+293], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-272], N[(N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[N[(0.0 - N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-315], N[(1.0 / N[(N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+285], N[(c0 / N[(N[Power[A, -0.5], $MachinePrecision] * N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+293}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\

\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-272}:\\
\;\;\;\;\sqrt{0 - A} \cdot \frac{c0}{\sqrt{0 - V \cdot \ell}}\\

\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-315}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\ell \cdot \frac{V}{A}}}{c0}}\\

\mathbf{elif}\;V \cdot \ell \leq 10^{+285}:\\
\;\;\;\;\frac{c0}{{A}^{-0.5} \cdot \sqrt{V \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 V l) < -9.9999999999999992e292

    1. Initial program 48.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\ell \cdot V}{A}}\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\ell \cdot \frac{V}{A}}\right)\right)\right) \]
      4. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{\frac{V}{A}}\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), \left(\frac{V}{A}\right)\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), \left(\frac{V}{A}\right)\right)\right)\right) \]
      7. /-lowering-/.f6476.0%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), \mathsf{/.f64}\left(V, A\right)\right)\right)\right) \]
    4. Applied egg-rr76.0%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{\frac{V}{A}}}} \]
    5. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{A} \cdot \ell}} \]
      2. associate-/r/N/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{\frac{A}{\ell}}}} \]
      3. sqrt-divN/A

        \[\leadsto c0 \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      4. metadata-evalN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V}{\frac{A}{\ell}}}}} \]
      5. div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left(\sqrt{\frac{V}{\frac{A}{\ell}}}\right)}\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{A} \cdot \ell}\right)\right) \]
      8. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{A}} \cdot \color{blue}{\sqrt{\ell}}\right)\right) \]
      9. /-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{1}} \cdot \sqrt{\ell}\right)\right) \]
      10. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{1} \cdot \ell}\right)\right) \]
      11. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{\frac{1}{\ell}}}\right)\right) \]
      12. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{V}{A}}{\frac{1}{\ell}}\right)\right)\right) \]
      13. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\frac{A}{V}}}{\frac{1}{\ell}}\right)\right)\right) \]
      14. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{A}{V} \cdot \frac{1}{\ell}}\right)\right)\right) \]
      15. div-invN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\frac{A}{V}}{\ell}}\right)\right)\right) \]
      16. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\ell}{\frac{A}{V}}\right)\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \left(\frac{A}{V}\right)\right)\right)\right) \]
      18. /-lowering-/.f6476.1%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(A, V\right)\right)\right)\right) \]
    6. Applied egg-rr76.1%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}} \]
    7. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\frac{\sqrt{\ell}}{\color{blue}{\sqrt{\frac{A}{V}}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{\ell}\right), \color{blue}{\left(\sqrt{\frac{A}{V}}\right)}\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\ell\right), \left(\sqrt{\color{blue}{\frac{A}{V}}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\ell\right), \mathsf{sqrt.f64}\left(\left(\frac{A}{V}\right)\right)\right)\right) \]
      5. /-lowering-/.f6442.0%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, V\right)\right)\right)\right) \]
    8. Applied egg-rr42.0%

      \[\leadsto \frac{c0}{\color{blue}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]

    if -9.9999999999999992e292 < (*.f64 V l) < -9.9999999999999993e-273

    1. Initial program 84.9%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V \cdot \ell}{A}}} \]
      2. sqrt-divN/A

        \[\leadsto c0 \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{V \cdot \ell}{A}}}} \]
      3. metadata-evalN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}} \]
      4. un-div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{V \cdot \ell}{A}}}} \]
      5. frac-2negN/A

        \[\leadsto \frac{c0}{\sqrt{\frac{\mathsf{neg}\left(V \cdot \ell\right)}{\mathsf{neg}\left(A\right)}}} \]
      6. sqrt-divN/A

        \[\leadsto \frac{c0}{\frac{\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}}{\color{blue}{\sqrt{\mathsf{neg}\left(A\right)}}}} \]
      7. associate-/r/N/A

        \[\leadsto \frac{c0}{\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}} \cdot \color{blue}{\sqrt{\mathsf{neg}\left(A\right)}} \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\frac{c0}{\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}}\right), \color{blue}{\left(\sqrt{\mathsf{neg}\left(A\right)}\right)}\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \left(\sqrt{\mathsf{neg}\left(V \cdot \ell\right)}\right)\right), \left(\sqrt{\color{blue}{\mathsf{neg}\left(A\right)}}\right)\right) \]
      10. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(V \cdot \ell\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(V \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      13. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \left(0 - \ell\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      14. --lowering--.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right), \left(\sqrt{\mathsf{neg}\left(A\right)}\right)\right) \]
      15. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(A\right)\right)\right)\right) \]
      16. neg-sub0N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\left(0 - A\right)\right)\right) \]
      17. --lowering--.f6498.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{\_.f64}\left(0, \ell\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
    4. Applied egg-rr98.4%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \left(0 - \ell\right)}} \cdot \sqrt{0 - A}} \]
    5. Step-by-step derivation
      1. sub0-negN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(V \cdot \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\left(\mathsf{neg}\left(\ell\right)\right) \cdot V\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      3. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(\ell \cdot V\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      4. neg-lowering-neg.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\left(\ell \cdot V\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
      5. *-lowering-*.f6498.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\ell, V\right)\right)\right)\right), \mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right)\right) \]
    6. Applied egg-rr98.4%

      \[\leadsto \frac{c0}{\sqrt{\color{blue}{-\ell \cdot V}}} \cdot \sqrt{0 - A} \]

    if -9.9999999999999993e-273 < (*.f64 V l) < 5.0000000023e-315

    1. Initial program 48.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{A}{V \cdot \ell}} \cdot \color{blue}{c0} \]
      2. sqrt-divN/A

        \[\leadsto \frac{\sqrt{A}}{\sqrt{V \cdot \ell}} \cdot c0 \]
      3. associate-*l/N/A

        \[\leadsto \frac{\sqrt{A} \cdot c0}{\color{blue}{\sqrt{V \cdot \ell}}} \]
      4. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A} \cdot c0}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\sqrt{V \cdot \ell}}{\sqrt{A} \cdot c0}\right)}\right) \]
      6. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}{\color{blue}{c0}}\right)\right) \]
      7. sqrt-divN/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{\sqrt{\frac{V \cdot \ell}{A}}}{c0}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\frac{V \cdot \ell}{A}}\right), \color{blue}{c0}\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{V \cdot \ell}{A}\right)\right), c0\right)\right) \]
      10. associate-*l/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{V}{A} \cdot \ell\right)\right), c0\right)\right) \]
      11. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right)\right), c0\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{A}{\ell}\right)\right)\right), c0\right)\right) \]
      13. /-lowering-/.f6468.0%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right)\right), c0\right)\right) \]
    4. Applied egg-rr68.0%

      \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt{\frac{V}{\frac{A}{\ell}}}}{c0}}} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{V}{A} \cdot \ell\right)\right), c0\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\frac{V}{A}\right), \ell\right)\right), c0\right)\right) \]
      3. /-lowering-/.f6468.1%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(V, A\right), \ell\right)\right), c0\right)\right) \]
    6. Applied egg-rr68.1%

      \[\leadsto \frac{1}{\frac{\sqrt{\color{blue}{\frac{V}{A} \cdot \ell}}}{c0}} \]

    if 5.0000000023e-315 < (*.f64 V l) < 9.9999999999999998e284

    1. Initial program 82.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\ell \cdot V}{A}}\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\ell \cdot \frac{V}{A}}\right)\right)\right) \]
      4. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{\frac{V}{A}}\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), \left(\frac{V}{A}\right)\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), \left(\frac{V}{A}\right)\right)\right)\right) \]
      7. /-lowering-/.f6477.5%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), \mathsf{/.f64}\left(V, A\right)\right)\right)\right) \]
    4. Applied egg-rr77.5%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{\frac{V}{A}}}} \]
    5. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{A} \cdot \ell}} \]
      2. associate-/r/N/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{\frac{A}{\ell}}}} \]
      3. sqrt-divN/A

        \[\leadsto c0 \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      4. metadata-evalN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V}{\frac{A}{\ell}}}}} \]
      5. div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left(\sqrt{\frac{V}{\frac{A}{\ell}}}\right)}\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{A} \cdot \ell}\right)\right) \]
      8. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{A}} \cdot \color{blue}{\sqrt{\ell}}\right)\right) \]
      9. /-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{1}} \cdot \sqrt{\ell}\right)\right) \]
      10. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{1} \cdot \ell}\right)\right) \]
      11. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{\frac{1}{\ell}}}\right)\right) \]
      12. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{V}{A}}{\frac{1}{\ell}}\right)\right)\right) \]
      13. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\frac{A}{V}}}{\frac{1}{\ell}}\right)\right)\right) \]
      14. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{A}{V} \cdot \frac{1}{\ell}}\right)\right)\right) \]
      15. div-invN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\frac{A}{V}}{\ell}}\right)\right)\right) \]
      16. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\ell}{\frac{A}{V}}\right)\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \left(\frac{A}{V}\right)\right)\right)\right) \]
      18. /-lowering-/.f6477.8%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(A, V\right)\right)\right)\right) \]
    6. Applied egg-rr77.8%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}} \]
    7. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{1}{\frac{\frac{A}{V}}{\ell}}}\right)\right) \]
      2. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{1}{\frac{A}{\ell \cdot V}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{1}{A} \cdot \left(\ell \cdot V\right)}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{1}{A} \cdot \left(V \cdot \ell\right)}\right)\right) \]
      5. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{1}{A}} \cdot \color{blue}{\sqrt{V \cdot \ell}}\right)\right) \]
      6. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{A}\right)}^{\frac{1}{2}} \cdot \sqrt{\color{blue}{V \cdot \ell}}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left({\left(\frac{1}{A}\right)}^{\frac{1}{2}}\right), \color{blue}{\left(\sqrt{V \cdot \ell}\right)}\right)\right) \]
      8. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left({\left({A}^{-1}\right)}^{\frac{1}{2}}\right), \left(\sqrt{\color{blue}{V} \cdot \ell}\right)\right)\right) \]
      9. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left({A}^{\left(-1 \cdot \frac{1}{2}\right)}\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left({A}^{\frac{-1}{2}}\right), \left(\sqrt{V \cdot \color{blue}{\ell}}\right)\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left({A}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right), \left(\sqrt{V \cdot \color{blue}{\ell}}\right)\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(A, \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(A, \frac{-1}{2}\right), \left(\sqrt{V \cdot \color{blue}{\ell}}\right)\right)\right) \]
      14. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(A, \frac{-1}{2}\right), \mathsf{sqrt.f64}\left(\left(V \cdot \ell\right)\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(A, \frac{-1}{2}\right), \mathsf{sqrt.f64}\left(\left(\ell \cdot V\right)\right)\right)\right) \]
      16. *-lowering-*.f6499.5%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(A, \frac{-1}{2}\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, V\right)\right)\right)\right) \]
    8. Applied egg-rr99.5%

      \[\leadsto \frac{c0}{\color{blue}{{A}^{-0.5} \cdot \sqrt{\ell \cdot V}}} \]

    if 9.9999999999999998e284 < (*.f64 V l)

    1. Initial program 38.2%

      \[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, \mathsf{sqrt.f64}\left(\left(\frac{\frac{A}{V}}{\ell}\right)\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{A}{V}\right), \ell\right)\right)\right) \]
      3. /-lowering-/.f6485.9%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(A, V\right), \ell\right)\right)\right) \]
    4. Applied egg-rr85.9%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification88.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+293}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-272}:\\ \;\;\;\;\sqrt{0 - A} \cdot \frac{c0}{\sqrt{0 - V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-315}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{\ell \cdot \frac{V}{A}}}{c0}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{+285}:\\ \;\;\;\;\frac{c0}{{A}^{-0.5} \cdot \sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 86.9% 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 -5 \cdot 10^{+220}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-176}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{-294}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{\frac{V}{\frac{A}{\ell}}}}{c0}}\\ \mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+283}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\ \end{array} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (if (<= (* V l) -5e+220)
   (* (/ c0 (sqrt l)) (sqrt (/ A V)))
   (if (<= (* V l) -1e-176)
     (* c0 (sqrt (/ A (* V l))))
     (if (<= (* V l) 1e-294)
       (/ 1.0 (/ (sqrt (/ V (/ A l))) c0))
       (if (<= (* V l) 4e+283)
         (* c0 (/ (sqrt A) (sqrt (* V l))))
         (/ c0 (sqrt (/ l (/ A V)))))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -5e+220) {
		tmp = (c0 / sqrt(l)) * sqrt((A / V));
	} else if ((V * l) <= -1e-176) {
		tmp = c0 * sqrt((A / (V * l)));
	} else if ((V * l) <= 1e-294) {
		tmp = 1.0 / (sqrt((V / (A / l))) / c0);
	} else if ((V * l) <= 4e+283) {
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = c0 / sqrt((l / (A / V)));
	}
	return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: tmp
    if ((v * l) <= (-5d+220)) then
        tmp = (c0 / sqrt(l)) * sqrt((a / v))
    else if ((v * l) <= (-1d-176)) then
        tmp = c0 * sqrt((a / (v * l)))
    else if ((v * l) <= 1d-294) then
        tmp = 1.0d0 / (sqrt((v / (a / l))) / c0)
    else if ((v * l) <= 4d+283) then
        tmp = c0 * (sqrt(a) / sqrt((v * l)))
    else
        tmp = c0 / sqrt((l / (a / v)))
    end if
    code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -5e+220) {
		tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
	} else if ((V * l) <= -1e-176) {
		tmp = c0 * Math.sqrt((A / (V * l)));
	} else if ((V * l) <= 1e-294) {
		tmp = 1.0 / (Math.sqrt((V / (A / l))) / c0);
	} else if ((V * l) <= 4e+283) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = c0 / Math.sqrt((l / (A / V)));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	tmp = 0
	if (V * l) <= -5e+220:
		tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V))
	elif (V * l) <= -1e-176:
		tmp = c0 * math.sqrt((A / (V * l)))
	elif (V * l) <= 1e-294:
		tmp = 1.0 / (math.sqrt((V / (A / l))) / c0)
	elif (V * l) <= 4e+283:
		tmp = c0 * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = c0 / math.sqrt((l / (A / V)))
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= -5e+220)
		tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V)));
	elseif (Float64(V * l) <= -1e-176)
		tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l))));
	elseif (Float64(V * l) <= 1e-294)
		tmp = Float64(1.0 / Float64(sqrt(Float64(V / Float64(A / l))) / c0));
	elseif (Float64(V * l) <= 4e+283)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0 / sqrt(Float64(l / Float64(A / V))));
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -5e+220)
		tmp = (c0 / sqrt(l)) * sqrt((A / V));
	elseif ((V * l) <= -1e-176)
		tmp = c0 * sqrt((A / (V * l)));
	elseif ((V * l) <= 1e-294)
		tmp = 1.0 / (sqrt((V / (A / l))) / c0);
	elseif ((V * l) <= 4e+283)
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	else
		tmp = c0 / sqrt((l / (A / V)));
	end
	tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e+220], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-176], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-294], N[(1.0 / N[(N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+283], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l / N[(A / V), $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 -5 \cdot 10^{+220}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\

\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-176}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\

\mathbf{elif}\;V \cdot \ell \leq 10^{-294}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V}{\frac{A}{\ell}}}}{c0}}\\

\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+283}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 V l) < -5.0000000000000002e220

    1. Initial program 54.8%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{A}{V \cdot \ell}} \cdot \color{blue}{c0} \]
      2. associate-/r*N/A

        \[\leadsto \sqrt{\frac{\frac{A}{V}}{\ell}} \cdot c0 \]
      3. sqrt-divN/A

        \[\leadsto \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}} \cdot c0 \]
      4. associate-*l/N/A

        \[\leadsto \frac{\sqrt{\frac{A}{V}} \cdot c0}{\color{blue}{\sqrt{\ell}}} \]
      5. associate-*r/N/A

        \[\leadsto \sqrt{\frac{A}{V}} \cdot \color{blue}{\frac{c0}{\sqrt{\ell}}} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{A}{V}}\right), \color{blue}{\left(\frac{c0}{\sqrt{\ell}}\right)}\right) \]
      7. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{A}{V}\right)}^{\frac{1}{2}}\right), \left(\frac{\color{blue}{c0}}{\sqrt{\ell}}\right)\right) \]
      8. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{1}{\frac{V}{A}}\right)}^{\frac{1}{2}}\right), \left(\frac{c0}{\sqrt{\ell}}\right)\right) \]
      9. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left({\left(\frac{V}{A}\right)}^{-1}\right)}^{\frac{1}{2}}\right), \left(\frac{c0}{\sqrt{\ell}}\right)\right) \]
      10. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{V}{A}\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\right), \left(\frac{\color{blue}{c0}}{\sqrt{\ell}}\right)\right) \]
      11. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\frac{V}{A}\right), \left(-1 \cdot \frac{1}{2}\right)\right), \left(\frac{\color{blue}{c0}}{\sqrt{\ell}}\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, A\right), \left(-1 \cdot \frac{1}{2}\right)\right), \left(\frac{c0}{\sqrt{\ell}}\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, A\right), \frac{-1}{2}\right), \left(\frac{c0}{\sqrt{\ell}}\right)\right) \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, A\right), \frac{-1}{2}\right), \mathsf{/.f64}\left(c0, \color{blue}{\left(\sqrt{\ell}\right)}\right)\right) \]
      15. sqrt-lowering-sqrt.f6441.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, A\right), \frac{-1}{2}\right), \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\ell\right)\right)\right) \]
    4. Applied egg-rr41.6%

      \[\leadsto \color{blue}{{\left(\frac{V}{A}\right)}^{-0.5} \cdot \frac{c0}{\sqrt{\ell}}} \]
    5. Step-by-step derivation
      1. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{V}{A}\right)}^{\left(\frac{-1}{2}\right)}\right), \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\ell\right)\right)\right) \]
      2. sqrt-pow1N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{{\left(\frac{V}{A}\right)}^{-1}}\right), \mathsf{/.f64}\left(\color{blue}{c0}, \mathsf{sqrt.f64}\left(\ell\right)\right)\right) \]
      3. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{\frac{V}{A}}}\right), \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\ell\right)\right)\right) \]
      4. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{A}{V}}\right), \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\ell\right)\right)\right) \]
      5. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{A}{V}\right)\right), \mathsf{/.f64}\left(\color{blue}{c0}, \mathsf{sqrt.f64}\left(\ell\right)\right)\right) \]
      6. /-lowering-/.f6441.6%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, V\right)\right), \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\ell\right)\right)\right) \]
    6. Applied egg-rr41.6%

      \[\leadsto \color{blue}{\sqrt{\frac{A}{V}}} \cdot \frac{c0}{\sqrt{\ell}} \]

    if -5.0000000000000002e220 < (*.f64 V l) < -1e-176

    1. Initial program 87.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing

    if -1e-176 < (*.f64 V l) < 1.00000000000000002e-294

    1. Initial program 60.6%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{A}{V \cdot \ell}} \cdot \color{blue}{c0} \]
      2. sqrt-divN/A

        \[\leadsto \frac{\sqrt{A}}{\sqrt{V \cdot \ell}} \cdot c0 \]
      3. associate-*l/N/A

        \[\leadsto \frac{\sqrt{A} \cdot c0}{\color{blue}{\sqrt{V \cdot \ell}}} \]
      4. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A} \cdot c0}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{\sqrt{V \cdot \ell}}{\sqrt{A} \cdot c0}\right)}\right) \]
      6. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}{\color{blue}{c0}}\right)\right) \]
      7. sqrt-divN/A

        \[\leadsto \mathsf{/.f64}\left(1, \left(\frac{\sqrt{\frac{V \cdot \ell}{A}}}{c0}\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\sqrt{\frac{V \cdot \ell}{A}}\right), \color{blue}{c0}\right)\right) \]
      9. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{V \cdot \ell}{A}\right)\right), c0\right)\right) \]
      10. associate-*l/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{V}{A} \cdot \ell\right)\right), c0\right)\right) \]
      11. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right)\right), c0\right)\right) \]
      12. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{A}{\ell}\right)\right)\right), c0\right)\right) \]
      13. /-lowering-/.f6471.7%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right)\right), c0\right)\right) \]
    4. Applied egg-rr71.7%

      \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt{\frac{V}{\frac{A}{\ell}}}}{c0}}} \]

    if 1.00000000000000002e-294 < (*.f64 V l) < 3.99999999999999982e283

    1. Initial program 81.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{A}\right), \color{blue}{\left(\sqrt{V \cdot \ell}\right)}\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/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) \]
      5. *-lowering-*.f6499.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) \]
    4. Applied egg-rr99.5%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]

    if 3.99999999999999982e283 < (*.f64 V l)

    1. Initial program 41.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\ell \cdot V}{A}}\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\ell \cdot \frac{V}{A}}\right)\right)\right) \]
      4. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{\frac{V}{A}}\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), \left(\frac{V}{A}\right)\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), \left(\frac{V}{A}\right)\right)\right)\right) \]
      7. /-lowering-/.f6486.6%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), \mathsf{/.f64}\left(V, A\right)\right)\right)\right) \]
    4. Applied egg-rr86.6%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{\frac{V}{A}}}} \]
    5. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{A} \cdot \ell}} \]
      2. associate-/r/N/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{\frac{A}{\ell}}}} \]
      3. sqrt-divN/A

        \[\leadsto c0 \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      4. metadata-evalN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V}{\frac{A}{\ell}}}}} \]
      5. div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left(\sqrt{\frac{V}{\frac{A}{\ell}}}\right)}\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{A} \cdot \ell}\right)\right) \]
      8. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{A}} \cdot \color{blue}{\sqrt{\ell}}\right)\right) \]
      9. /-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{1}} \cdot \sqrt{\ell}\right)\right) \]
      10. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{1} \cdot \ell}\right)\right) \]
      11. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{\frac{1}{\ell}}}\right)\right) \]
      12. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{V}{A}}{\frac{1}{\ell}}\right)\right)\right) \]
      13. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\frac{A}{V}}}{\frac{1}{\ell}}\right)\right)\right) \]
      14. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{A}{V} \cdot \frac{1}{\ell}}\right)\right)\right) \]
      15. div-invN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\frac{A}{V}}{\ell}}\right)\right)\right) \]
      16. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\ell}{\frac{A}{V}}\right)\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \left(\frac{A}{V}\right)\right)\right)\right) \]
      18. /-lowering-/.f6486.7%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(A, V\right)\right)\right)\right) \]
    6. Applied egg-rr86.7%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification82.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+220}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-176}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{-294}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{\frac{V}{\frac{A}{\ell}}}}{c0}}\\ \mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+283}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 82.3% 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^{-294}:\\ \;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\ \mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+283}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\ \end{array} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (if (<= (* V l) 1e-294)
   (* c0 (pow (/ V (/ A l)) -0.5))
   (if (<= (* V l) 4e+283)
     (* c0 (/ (sqrt A) (sqrt (* V l))))
     (/ c0 (sqrt (/ l (/ A V)))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= 1e-294) {
		tmp = c0 * pow((V / (A / l)), -0.5);
	} else if ((V * l) <= 4e+283) {
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = c0 / sqrt((l / (A / V)));
	}
	return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: tmp
    if ((v * l) <= 1d-294) then
        tmp = c0 * ((v / (a / l)) ** (-0.5d0))
    else if ((v * l) <= 4d+283) then
        tmp = c0 * (sqrt(a) / sqrt((v * l)))
    else
        tmp = c0 / sqrt((l / (a / v)))
    end if
    code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= 1e-294) {
		tmp = c0 * Math.pow((V / (A / l)), -0.5);
	} else if ((V * l) <= 4e+283) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = c0 / Math.sqrt((l / (A / V)));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	tmp = 0
	if (V * l) <= 1e-294:
		tmp = c0 * math.pow((V / (A / l)), -0.5)
	elif (V * l) <= 4e+283:
		tmp = c0 * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = c0 / math.sqrt((l / (A / V)))
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= 1e-294)
		tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5));
	elseif (Float64(V * l) <= 4e+283)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0 / sqrt(Float64(l / Float64(A / V))));
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	tmp = 0.0;
	if ((V * l) <= 1e-294)
		tmp = c0 * ((V / (A / l)) ^ -0.5);
	elseif ((V * l) <= 4e+283)
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	else
		tmp = c0 / sqrt((l / (A / V)));
	end
	tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], 1e-294], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+283], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l / N[(A / V), $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^{-294}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\

\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+283}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 V l) < 1.00000000000000002e-294

    1. Initial program 72.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \sqrt{\frac{A}{V \cdot \ell}} \cdot \color{blue}{c0} \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{A}{V \cdot \ell}}\right), \color{blue}{c0}\right) \]
      3. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{A}{V \cdot \ell}\right)}^{\frac{1}{2}}\right), c0\right) \]
      4. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}^{\frac{1}{2}}\right), c0\right) \]
      5. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left({\left(\frac{V \cdot \ell}{A}\right)}^{-1}\right)}^{\frac{1}{2}}\right), c0\right) \]
      6. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(\frac{V \cdot \ell}{A}\right)}^{\left(-1 \cdot \frac{1}{2}\right)}\right), c0\right) \]
      7. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\frac{V \cdot \ell}{A}\right), \left(-1 \cdot \frac{1}{2}\right)\right), c0\right) \]
      8. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\frac{V}{A} \cdot \ell\right), \left(-1 \cdot \frac{1}{2}\right)\right), c0\right) \]
      9. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right), \left(-1 \cdot \frac{1}{2}\right)\right), c0\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{A}{\ell}\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right), c0\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right), c0\right) \]
      12. metadata-eval74.4%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \frac{-1}{2}\right), c0\right) \]
    4. Applied egg-rr74.4%

      \[\leadsto \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5} \cdot c0} \]

    if 1.00000000000000002e-294 < (*.f64 V l) < 3.99999999999999982e283

    1. Initial program 81.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{A}\right), \color{blue}{\left(\sqrt{V \cdot \ell}\right)}\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/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) \]
      5. *-lowering-*.f6499.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) \]
    4. Applied egg-rr99.5%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]

    if 3.99999999999999982e283 < (*.f64 V l)

    1. Initial program 41.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\ell \cdot V}{A}}\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\ell \cdot \frac{V}{A}}\right)\right)\right) \]
      4. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{\frac{V}{A}}\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), \left(\frac{V}{A}\right)\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), \left(\frac{V}{A}\right)\right)\right)\right) \]
      7. /-lowering-/.f6486.6%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), \mathsf{/.f64}\left(V, A\right)\right)\right)\right) \]
    4. Applied egg-rr86.6%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{\frac{V}{A}}}} \]
    5. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{A} \cdot \ell}} \]
      2. associate-/r/N/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{\frac{A}{\ell}}}} \]
      3. sqrt-divN/A

        \[\leadsto c0 \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      4. metadata-evalN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V}{\frac{A}{\ell}}}}} \]
      5. div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left(\sqrt{\frac{V}{\frac{A}{\ell}}}\right)}\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{A} \cdot \ell}\right)\right) \]
      8. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{A}} \cdot \color{blue}{\sqrt{\ell}}\right)\right) \]
      9. /-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{1}} \cdot \sqrt{\ell}\right)\right) \]
      10. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{1} \cdot \ell}\right)\right) \]
      11. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{\frac{1}{\ell}}}\right)\right) \]
      12. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{V}{A}}{\frac{1}{\ell}}\right)\right)\right) \]
      13. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\frac{A}{V}}}{\frac{1}{\ell}}\right)\right)\right) \]
      14. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{A}{V} \cdot \frac{1}{\ell}}\right)\right)\right) \]
      15. div-invN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\frac{A}{V}}{\ell}}\right)\right)\right) \]
      16. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\ell}{\frac{A}{V}}\right)\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \left(\frac{A}{V}\right)\right)\right)\right) \]
      18. /-lowering-/.f6486.7%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(A, V\right)\right)\right)\right) \]
    6. Applied egg-rr86.7%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification83.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq 10^{-294}:\\ \;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\ \mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+283}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 84.4% accurate, 0.5× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\frac{c0}{{A}^{-0.5} \cdot \sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\ \end{array} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (if (<= l -2e-310)
   (/ c0 (* (pow A -0.5) (sqrt (* V l))))
   (/ c0 (/ (sqrt l) (sqrt (/ A V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if (l <= -2e-310) {
		tmp = c0 / (pow(A, -0.5) * sqrt((V * l)));
	} else {
		tmp = c0 / (sqrt(l) / sqrt((A / V)));
	}
	return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: tmp
    if (l <= (-2d-310)) then
        tmp = c0 / ((a ** (-0.5d0)) * sqrt((v * l)))
    else
        tmp = c0 / (sqrt(l) / sqrt((a / v)))
    end if
    code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if (l <= -2e-310) {
		tmp = c0 / (Math.pow(A, -0.5) * Math.sqrt((V * l)));
	} else {
		tmp = c0 / (Math.sqrt(l) / Math.sqrt((A / V)));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	tmp = 0
	if l <= -2e-310:
		tmp = c0 / (math.pow(A, -0.5) * math.sqrt((V * l)))
	else:
		tmp = c0 / (math.sqrt(l) / math.sqrt((A / V)))
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (l <= -2e-310)
		tmp = Float64(c0 / Float64((A ^ -0.5) * sqrt(Float64(V * l))));
	else
		tmp = Float64(c0 / Float64(sqrt(l) / sqrt(Float64(A / V))));
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	tmp = 0.0;
	if (l <= -2e-310)
		tmp = c0 / ((A ^ -0.5) * sqrt((V * l)));
	else
		tmp = c0 / (sqrt(l) / sqrt((A / V)));
	end
	tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := If[LessEqual[l, -2e-310], N[(c0 / N[(N[Power[A, -0.5], $MachinePrecision] * N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{{A}^{-0.5} \cdot \sqrt{V \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.999999999999994e-310

    1. Initial program 73.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\ell \cdot V}{A}}\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\ell \cdot \frac{V}{A}}\right)\right)\right) \]
      4. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{\frac{V}{A}}\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), \left(\frac{V}{A}\right)\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), \left(\frac{V}{A}\right)\right)\right)\right) \]
      7. /-lowering-/.f6479.7%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), \mathsf{/.f64}\left(V, A\right)\right)\right)\right) \]
    4. Applied egg-rr79.7%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{\frac{V}{A}}}} \]
    5. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{A} \cdot \ell}} \]
      2. associate-/r/N/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{\frac{A}{\ell}}}} \]
      3. sqrt-divN/A

        \[\leadsto c0 \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      4. metadata-evalN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V}{\frac{A}{\ell}}}}} \]
      5. div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left(\sqrt{\frac{V}{\frac{A}{\ell}}}\right)}\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{A} \cdot \ell}\right)\right) \]
      8. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{A}} \cdot \color{blue}{\sqrt{\ell}}\right)\right) \]
      9. /-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{1}} \cdot \sqrt{\ell}\right)\right) \]
      10. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{1} \cdot \ell}\right)\right) \]
      11. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{\frac{1}{\ell}}}\right)\right) \]
      12. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{V}{A}}{\frac{1}{\ell}}\right)\right)\right) \]
      13. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\frac{A}{V}}}{\frac{1}{\ell}}\right)\right)\right) \]
      14. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{A}{V} \cdot \frac{1}{\ell}}\right)\right)\right) \]
      15. div-invN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\frac{A}{V}}{\ell}}\right)\right)\right) \]
      16. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\ell}{\frac{A}{V}}\right)\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \left(\frac{A}{V}\right)\right)\right)\right) \]
      18. /-lowering-/.f6479.3%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(A, V\right)\right)\right)\right) \]
    6. Applied egg-rr79.3%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}} \]
    7. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{1}{\frac{\frac{A}{V}}{\ell}}}\right)\right) \]
      2. associate-/l/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{1}{\frac{A}{\ell \cdot V}}}\right)\right) \]
      3. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{1}{A} \cdot \left(\ell \cdot V\right)}\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{1}{A} \cdot \left(V \cdot \ell\right)}\right)\right) \]
      5. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{1}{A}} \cdot \color{blue}{\sqrt{V \cdot \ell}}\right)\right) \]
      6. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{A}\right)}^{\frac{1}{2}} \cdot \sqrt{\color{blue}{V \cdot \ell}}\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left({\left(\frac{1}{A}\right)}^{\frac{1}{2}}\right), \color{blue}{\left(\sqrt{V \cdot \ell}\right)}\right)\right) \]
      8. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left({\left({A}^{-1}\right)}^{\frac{1}{2}}\right), \left(\sqrt{\color{blue}{V} \cdot \ell}\right)\right)\right) \]
      9. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left({A}^{\left(-1 \cdot \frac{1}{2}\right)}\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      10. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left({A}^{\frac{-1}{2}}\right), \left(\sqrt{V \cdot \color{blue}{\ell}}\right)\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\left({A}^{\left(\mathsf{neg}\left(\frac{1}{2}\right)\right)}\right), \left(\sqrt{V \cdot \color{blue}{\ell}}\right)\right)\right) \]
      12. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(A, \left(\mathsf{neg}\left(\frac{1}{2}\right)\right)\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      13. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(A, \frac{-1}{2}\right), \left(\sqrt{V \cdot \color{blue}{\ell}}\right)\right)\right) \]
      14. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(A, \frac{-1}{2}\right), \mathsf{sqrt.f64}\left(\left(V \cdot \ell\right)\right)\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(A, \frac{-1}{2}\right), \mathsf{sqrt.f64}\left(\left(\ell \cdot V\right)\right)\right)\right) \]
      16. *-lowering-*.f6440.4%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(A, \frac{-1}{2}\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\ell, V\right)\right)\right)\right) \]
    8. Applied egg-rr40.4%

      \[\leadsto \frac{c0}{\color{blue}{{A}^{-0.5} \cdot \sqrt{\ell \cdot V}}} \]

    if -1.999999999999994e-310 < l

    1. Initial program 72.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\ell \cdot V}{A}}\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\ell \cdot \frac{V}{A}}\right)\right)\right) \]
      4. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{\frac{V}{A}}\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), \left(\frac{V}{A}\right)\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), \left(\frac{V}{A}\right)\right)\right)\right) \]
      7. /-lowering-/.f6475.4%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), \mathsf{/.f64}\left(V, A\right)\right)\right)\right) \]
    4. Applied egg-rr75.4%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{\frac{V}{A}}}} \]
    5. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{A} \cdot \ell}} \]
      2. associate-/r/N/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{\frac{A}{\ell}}}} \]
      3. sqrt-divN/A

        \[\leadsto c0 \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      4. metadata-evalN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V}{\frac{A}{\ell}}}}} \]
      5. div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left(\sqrt{\frac{V}{\frac{A}{\ell}}}\right)}\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{A} \cdot \ell}\right)\right) \]
      8. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{A}} \cdot \color{blue}{\sqrt{\ell}}\right)\right) \]
      9. /-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{1}} \cdot \sqrt{\ell}\right)\right) \]
      10. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{1} \cdot \ell}\right)\right) \]
      11. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{\frac{1}{\ell}}}\right)\right) \]
      12. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{V}{A}}{\frac{1}{\ell}}\right)\right)\right) \]
      13. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\frac{A}{V}}}{\frac{1}{\ell}}\right)\right)\right) \]
      14. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{A}{V} \cdot \frac{1}{\ell}}\right)\right)\right) \]
      15. div-invN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\frac{A}{V}}{\ell}}\right)\right)\right) \]
      16. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\ell}{\frac{A}{V}}\right)\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \left(\frac{A}{V}\right)\right)\right)\right) \]
      18. /-lowering-/.f6475.2%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(A, V\right)\right)\right)\right) \]
    6. Applied egg-rr75.2%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}} \]
    7. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\frac{\sqrt{\ell}}{\color{blue}{\sqrt{\frac{A}{V}}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{\ell}\right), \color{blue}{\left(\sqrt{\frac{A}{V}}\right)}\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\ell\right), \left(\sqrt{\color{blue}{\frac{A}{V}}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\ell\right), \mathsf{sqrt.f64}\left(\left(\frac{A}{V}\right)\right)\right)\right) \]
      5. /-lowering-/.f6487.8%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, V\right)\right)\right)\right) \]
    8. Applied egg-rr87.8%

      \[\leadsto \frac{c0}{\color{blue}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification65.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\frac{c0}{{A}^{-0.5} \cdot \sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 84.4% accurate, 0.5× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\ \end{array} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (if (<= l -2e-310)
   (* c0 (/ (sqrt A) (sqrt (* V l))))
   (/ c0 (/ (sqrt l) (sqrt (/ A V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double tmp;
	if (l <= -2e-310) {
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = c0 / (sqrt(l) / sqrt((A / V)));
	}
	return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: tmp
    if (l <= (-2d-310)) then
        tmp = c0 * (sqrt(a) / sqrt((v * l)))
    else
        tmp = c0 / (sqrt(l) / sqrt((a / v)))
    end if
    code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if (l <= -2e-310) {
		tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = c0 / (Math.sqrt(l) / Math.sqrt((A / V)));
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	tmp = 0
	if l <= -2e-310:
		tmp = c0 * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = c0 / (math.sqrt(l) / math.sqrt((A / V)))
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	tmp = 0.0
	if (l <= -2e-310)
		tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0 / Float64(sqrt(l) / sqrt(Float64(A / V))));
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	tmp = 0.0;
	if (l <= -2e-310)
		tmp = c0 * (sqrt(A) / sqrt((V * l)));
	else
		tmp = c0 / (sqrt(l) / sqrt((A / V)));
	end
	tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := If[LessEqual[l, -2e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\

\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.999999999999994e-310

    1. Initial program 73.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\frac{\sqrt{A}}{\color{blue}{\sqrt{V \cdot \ell}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{A}\right), \color{blue}{\left(\sqrt{V \cdot \ell}\right)}\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(A\right), \left(\sqrt{\color{blue}{V \cdot \ell}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/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) \]
      5. *-lowering-*.f6440.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) \]
    4. Applied egg-rr40.4%

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{A}}{\sqrt{V \cdot \ell}}} \]

    if -1.999999999999994e-310 < l

    1. Initial program 72.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)\right)\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\ell \cdot V}{A}}\right)\right)\right) \]
      3. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\ell \cdot \frac{V}{A}}\right)\right)\right) \]
      4. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\ell}}{\frac{V}{A}}\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{\ell}\right), \left(\frac{V}{A}\right)\right)\right)\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), \left(\frac{V}{A}\right)\right)\right)\right) \]
      7. /-lowering-/.f6475.4%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, \ell\right), \mathsf{/.f64}\left(V, A\right)\right)\right)\right) \]
    4. Applied egg-rr75.4%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{\frac{V}{A}}}} \]
    5. Step-by-step derivation
      1. associate-/l/N/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{A} \cdot \ell}} \]
      2. associate-/r/N/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{\frac{A}{\ell}}}} \]
      3. sqrt-divN/A

        \[\leadsto c0 \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      4. metadata-evalN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V}{\frac{A}{\ell}}}}} \]
      5. div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left(\sqrt{\frac{V}{\frac{A}{\ell}}}\right)}\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{A} \cdot \ell}\right)\right) \]
      8. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{V}{A}} \cdot \color{blue}{\sqrt{\ell}}\right)\right) \]
      9. /-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{1}} \cdot \sqrt{\ell}\right)\right) \]
      10. sqrt-prodN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{1} \cdot \ell}\right)\right) \]
      11. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\sqrt{\frac{\frac{V}{A}}{\frac{1}{\ell}}}\right)\right) \]
      12. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{V}{A}}{\frac{1}{\ell}}\right)\right)\right) \]
      13. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{\frac{A}{V}}}{\frac{1}{\ell}}\right)\right)\right) \]
      14. associate-/r*N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{A}{V} \cdot \frac{1}{\ell}}\right)\right)\right) \]
      15. div-invN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{\frac{\frac{A}{V}}{\ell}}\right)\right)\right) \]
      16. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\ell}{\frac{A}{V}}\right)\right)\right) \]
      17. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \left(\frac{A}{V}\right)\right)\right)\right) \]
      18. /-lowering-/.f6475.2%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{/.f64}\left(A, V\right)\right)\right)\right) \]
    6. Applied egg-rr75.2%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}} \]
    7. Step-by-step derivation
      1. sqrt-divN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left(\frac{\sqrt{\ell}}{\color{blue}{\sqrt{\frac{A}{V}}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\left(\sqrt{\ell}\right), \color{blue}{\left(\sqrt{\frac{A}{V}}\right)}\right)\right) \]
      3. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\ell\right), \left(\sqrt{\color{blue}{\frac{A}{V}}}\right)\right)\right) \]
      4. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\ell\right), \mathsf{sqrt.f64}\left(\left(\frac{A}{V}\right)\right)\right)\right) \]
      5. /-lowering-/.f6487.8%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\ell\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(A, V\right)\right)\right)\right) \]
    8. Applied egg-rr87.8%

      \[\leadsto \frac{c0}{\color{blue}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 19: 74.5% 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 72.8%

    \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
  2. Add Preprocessing
  3. Add Preprocessing

Reproduce

?
herbie shell --seed 2024150 
(FPCore (c0 A V l)
  :name "Henrywood and Agarwal, Equation (3)"
  :precision binary64
  (* c0 (sqrt (/ A (* V l)))))