Henrywood and Agarwal, Equation (3)

Percentage Accurate: 73.5% → 88.9%
Time: 11.1s
Alternatives: 24
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 24 alternatives:

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

Initial Program: 73.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: 88.9% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 18.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 V l) < -3.99999999999999997e-299

    1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{A}{V \cdot \ell}}\right)\right) \]
      8. 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) \]
      9. sqrt-divN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \left(\sqrt{\mathsf{neg}\left(\color{blue}{V \cdot \ell}\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(0, A\right)\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(V \cdot \ell\right)\right)\right)\right)\right) \]
      15. distribute-rgt-neg-inN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\left(V \cdot \frac{{0}^{3} - {\ell}^{3}}{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}\right)\right)\right)\right) \]
      18. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\left(V \cdot \frac{1}{\frac{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}{{0}^{3} - {\ell}^{3}}}\right)\right)\right)\right) \]
      19. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}{{0}^{3} - {\ell}^{3}}\right)\right)\right)\right)\right) \]
      21. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{1}{\frac{{0}^{3} - {\ell}^{3}}{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}}\right)\right)\right)\right)\right) \]
      22. flip3--N/A

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

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

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

    if -3.99999999999999997e-299 < (*.f64 V l) < -0.0

    1. Initial program 27.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(\ell, A\right)\right), \frac{-1}{2}\right), \mathsf{pow.f64}\left(\mathsf{\_.f64}\left(0, V\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right)\right) \]
      20. metadata-eval40.4%

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

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

    if -0.0 < (*.f64 V l)

    1. Initial program 79.4%

      \[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. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 76.6% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+252}:\\
\;\;\;\;t\_0\\

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


\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 65.7%

      \[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-/.f6470.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-rr70.1%

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999997e252

    1. Initial program 98.9%

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

    if 4.9999999999999997e252 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 47.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 76.6% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+252}:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 65.7%

      \[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-/.f6470.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-rr70.1%

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999997e252

    1. Initial program 98.9%

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

    if 4.9999999999999997e252 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 47.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 76.6% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+256}:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\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 65.7%

      \[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-/.f6470.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-rr70.1%

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.00000000000000015e256

    1. Initial program 98.9%

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

    if 5.00000000000000015e256 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 44.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. /-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-/.f6455.2%

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

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

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

Alternative 5: 76.7% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+272}:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 65.7%

      \[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-/.f6470.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-rr70.1%

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.99999999999999973e272

    1. Initial program 98.9%

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

    if 4.99999999999999973e272 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 43.3%

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left(\sqrt{\frac{V \cdot \ell}{A}}\right)}\right) \]
      6. 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-/.f6453.9%

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

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

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

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

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

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

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

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

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

Alternative 6: 76.5% accurate, 0.3× speedup?

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

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+252}:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 65.7%

      \[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-/.f6470.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-rr70.1%

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999997e252

    1. Initial program 98.9%

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

    if 4.9999999999999997e252 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 47.7%

      \[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-/.f6455.3%

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

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

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

Alternative 7: 76.6% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 61.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-/.f6466.4%

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

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000001e300

    1. Initial program 98.9%

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

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

Alternative 8: 88.6% accurate, 0.3× speedup?

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

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


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

    1. Initial program 68.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < A

    1. Initial program 73.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. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 88.6% accurate, 0.3× speedup?

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

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


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

    1. Initial program 68.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < A

    1. Initial program 73.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. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 88.9% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 18.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 V l) < -3.99999999999999997e-299

    1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{A}{V \cdot \ell}}\right)\right) \]
      8. 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) \]
      9. sqrt-divN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \left(\sqrt{\mathsf{neg}\left(\color{blue}{V \cdot \ell}\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(0, A\right)\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(V \cdot \ell\right)\right)\right)\right)\right) \]
      15. distribute-rgt-neg-inN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\left(V \cdot \frac{{0}^{3} - {\ell}^{3}}{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}\right)\right)\right)\right) \]
      18. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\left(V \cdot \frac{1}{\frac{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}{{0}^{3} - {\ell}^{3}}}\right)\right)\right)\right) \]
      19. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}{{0}^{3} - {\ell}^{3}}\right)\right)\right)\right)\right) \]
      21. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{1}{\frac{{0}^{3} - {\ell}^{3}}{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}}\right)\right)\right)\right)\right) \]
      22. flip3--N/A

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

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

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

    if -3.99999999999999997e-299 < (*.f64 V l) < -0.0

    1. Initial program 27.7%

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left(\sqrt{\frac{V \cdot \ell}{A}}\right)}\right) \]
      6. 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-/.f6457.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 V l)

    1. Initial program 79.4%

      \[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. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 88.7% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 18.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 V l) < -3.99999999999999997e-299

    1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{A}{V \cdot \ell}}\right)\right) \]
      8. 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) \]
      9. sqrt-divN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \left(\sqrt{\mathsf{neg}\left(\color{blue}{V \cdot \ell}\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(0, A\right)\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(V \cdot \ell\right)\right)\right)\right)\right) \]
      15. distribute-rgt-neg-inN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\left(V \cdot \frac{{0}^{3} - {\ell}^{3}}{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}\right)\right)\right)\right) \]
      18. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\left(V \cdot \frac{1}{\frac{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}{{0}^{3} - {\ell}^{3}}}\right)\right)\right)\right) \]
      19. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}{{0}^{3} - {\ell}^{3}}\right)\right)\right)\right)\right) \]
      21. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{1}{\frac{{0}^{3} - {\ell}^{3}}{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}}\right)\right)\right)\right)\right) \]
      22. flip3--N/A

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

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

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

    if -3.99999999999999997e-299 < (*.f64 V l) < -0.0

    1. Initial program 27.7%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\left(\frac{A}{\mathsf{neg}\left(\ell\right)}\right)\right), \left({\color{blue}{\left(\mathsf{neg}\left(V\right)\right)}}^{\frac{1}{2}}\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{A}{\ell}\right)\right)\right), \left({\left(\mathsf{neg}\left(\color{blue}{V}\right)\right)}^{\frac{1}{2}}\right)\right)\right) \]
      9. neg-sub0N/A

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

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, \mathsf{/.f64}\left(A, \ell\right)\right)\right), \mathsf{pow.f64}\left(\left(\mathsf{neg}\left(V\right)\right), \color{blue}{\frac{1}{2}}\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(A, \ell\right)\right)\right), \mathsf{pow.f64}\left(\left(0 - V\right), \frac{1}{2}\right)\right)\right) \]
      14. --lowering--.f6440.5%

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

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

    if -0.0 < (*.f64 V l)

    1. Initial program 79.4%

      \[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. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 88.7% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 18.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 V l) < -3.99999999999999997e-299

    1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \left(\sqrt{\frac{A}{V \cdot \ell}}\right)\right) \]
      8. 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) \]
      9. sqrt-divN/A

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \left(\sqrt{\mathsf{neg}\left(\color{blue}{V \cdot \ell}\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(0, A\right)\right), \mathsf{sqrt.f64}\left(\left(\mathsf{neg}\left(V \cdot \ell\right)\right)\right)\right)\right) \]
      15. distribute-rgt-neg-inN/A

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

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\left(V \cdot \frac{{0}^{3} - {\ell}^{3}}{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}\right)\right)\right)\right) \]
      18. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\left(V \cdot \frac{1}{\frac{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}{{0}^{3} - {\ell}^{3}}}\right)\right)\right)\right) \]
      19. un-div-invN/A

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

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}{{0}^{3} - {\ell}^{3}}\right)\right)\right)\right)\right) \]
      21. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{/.f64}\left(\mathsf{sqrt.f64}\left(\mathsf{\_.f64}\left(0, A\right)\right), \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{1}{\frac{{0}^{3} - {\ell}^{3}}{0 \cdot 0 + \left(\ell \cdot \ell + 0 \cdot \ell\right)}}\right)\right)\right)\right)\right) \]
      22. flip3--N/A

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

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

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

    if -3.99999999999999997e-299 < (*.f64 V l) < -0.0

    1. Initial program 27.7%

      \[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. distribute-frac-neg2N/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(\mathsf{neg}\left(\frac{A}{\ell}\right)\right)\right)\right)\right) \]
      15. 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(\left(0 - \frac{A}{\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(0, \left(\frac{A}{\ell}\right)\right)\right)\right)\right) \]
      17. /-lowering-/.f6440.3%

        \[\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(0, \mathsf{/.f64}\left(A, \ell\right)\right)\right)\right)\right) \]
    4. Applied egg-rr40.3%

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

    if -0.0 < (*.f64 V l)

    1. Initial program 79.4%

      \[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. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 84.7% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;\frac{\frac{c0}{\sqrt{\ell}}}{\sqrt{\frac{V}{A}}}\\

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


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

    1. Initial program 50.5%

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

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

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

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

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

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

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

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

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

    if -2.00000000000000013e193 < (*.f64 V l) < -4.9999999999999999e-133

    1. Initial program 90.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999999e-133 < (*.f64 V l) < -0.0

    1. Initial program 49.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0 < (*.f64 V l)

    1. Initial program 79.4%

      \[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. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 82.2% accurate, 0.5× speedup?

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

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+297}:\\
\;\;\;\;\frac{c0}{{t\_0}^{-0.5}}\\

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


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

    1. Initial program 32.1%

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

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

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

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

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

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

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

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

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

    if 1.00000023e-317 < (/.f64 A (*.f64 V l)) < 4.9999999999999998e297

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.9999999999999998e297 < (/.f64 A (*.f64 V l))

    1. Initial program 29.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 82.0% accurate, 0.5× speedup?

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

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+297}:\\
\;\;\;\;\frac{c0}{{t\_0}^{-0.5}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 A (*.f64 V l)) < 1.00000023e-317 or 4.9999999999999998e297 < (/.f64 A (*.f64 V l))

    1. Initial program 30.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000023e-317 < (/.f64 A (*.f64 V l)) < 4.9999999999999998e297

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 83.6% accurate, 0.5× speedup?

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

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


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

    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-/r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.999999999999969e-311 < l

    1. Initial program 68.7%

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

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

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

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

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

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

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

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

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

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

Alternative 17: 83.5% accurate, 0.5× speedup?

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

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


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

    1. Initial program 71.0%

      \[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. distribute-frac-neg2N/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(\mathsf{neg}\left(\frac{A}{\ell}\right)\right)\right)\right)\right) \]
      15. 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(\left(0 - \frac{A}{\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(0, \left(\frac{A}{\ell}\right)\right)\right)\right)\right) \]
      17. /-lowering-/.f6482.0%

        \[\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(0, \mathsf{/.f64}\left(A, \ell\right)\right)\right)\right)\right) \]
    4. Applied egg-rr82.0%

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

    if -1.999999999999994e-310 < V

    1. Initial program 70.7%

      \[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. clear-numN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{{\left(V \cdot \ell\right)}^{-0.5} \cdot \frac{c0}{{A}^{-0.5}}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification58.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \leq -2 \cdot 10^{-310}:\\ \;\;\;\;c0 \cdot \left(\sqrt{0 - \frac{A}{\ell}} \cdot \sqrt{\frac{-1}{V}}\right)\\ \mathbf{else}:\\ \;\;\;\;{\left(\ell \cdot V\right)}^{-0.5} \cdot \frac{c0}{{A}^{-0.5}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 78.8% accurate, 0.8× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{\ell \cdot V}\\ \mathbf{if}\;t\_0 \leq 10^{-317}:\\ \;\;\;\;c0 \cdot \frac{\frac{A}{V}}{\sqrt{\frac{\ell}{\frac{V}{A}}}}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+275}:\\ \;\;\;\;\frac{c0}{{t\_0}^{-0.5}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\ \end{array} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* l V))))
   (if (<= t_0 1e-317)
     (* c0 (/ (/ A V) (sqrt (/ l (/ V A)))))
     (if (<= t_0 2e+275)
       (/ c0 (pow t_0 -0.5))
       (* c0 (pow (/ V (/ A l)) -0.5))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = A / (l * V);
	double tmp;
	if (t_0 <= 1e-317) {
		tmp = c0 * ((A / V) / sqrt((l / (V / A))));
	} else if (t_0 <= 2e+275) {
		tmp = c0 / pow(t_0, -0.5);
	} else {
		tmp = c0 * pow((V / (A / l)), -0.5);
	}
	return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (l * v)
    if (t_0 <= 1d-317) then
        tmp = c0 * ((a / v) / sqrt((l / (v / a))))
    else if (t_0 <= 2d+275) then
        tmp = c0 / (t_0 ** (-0.5d0))
    else
        tmp = c0 * ((v / (a / l)) ** (-0.5d0))
    end if
    code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (l * V);
	double tmp;
	if (t_0 <= 1e-317) {
		tmp = c0 * ((A / V) / Math.sqrt((l / (V / A))));
	} else if (t_0 <= 2e+275) {
		tmp = c0 / Math.pow(t_0, -0.5);
	} else {
		tmp = c0 * Math.pow((V / (A / l)), -0.5);
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	t_0 = A / (l * V)
	tmp = 0
	if t_0 <= 1e-317:
		tmp = c0 * ((A / V) / math.sqrt((l / (V / A))))
	elif t_0 <= 2e+275:
		tmp = c0 / math.pow(t_0, -0.5)
	else:
		tmp = c0 * math.pow((V / (A / l)), -0.5)
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(l * V))
	tmp = 0.0
	if (t_0 <= 1e-317)
		tmp = Float64(c0 * Float64(Float64(A / V) / sqrt(Float64(l / Float64(V / A)))));
	elseif (t_0 <= 2e+275)
		tmp = Float64(c0 / (t_0 ^ -0.5));
	else
		tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5));
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (l * V);
	tmp = 0.0;
	if (t_0 <= 1e-317)
		tmp = c0 * ((A / V) / sqrt((l / (V / A))));
	elseif (t_0 <= 2e+275)
		tmp = c0 / (t_0 ^ -0.5);
	else
		tmp = c0 * ((V / (A / l)) ^ -0.5);
	end
	tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-317], N[(c0 * N[(N[(A / V), $MachinePrecision] / N[Sqrt[N[(l / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+275], N[(c0 / N[Power[t$95$0, -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 10^{-317}:\\
\;\;\;\;c0 \cdot \frac{\frac{A}{V}}{\sqrt{\frac{\ell}{\frac{V}{A}}}}\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+275}:\\
\;\;\;\;\frac{c0}{{t\_0}^{-0.5}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 A (*.f64 V l)) < 1.00000023e-317

    1. Initial program 32.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}^{\frac{1}{2}}\right)\right) \]
      3. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left({\left(\frac{V \cdot \ell}{A}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      4. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V \cdot \ell}{A}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      6. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{A} \cdot \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{A}{\ell}\right)\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      10. metadata-eval43.7%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr43.7%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    5. Applied egg-rr31.2%

      \[\leadsto c0 \cdot \color{blue}{\frac{\frac{A}{V}}{\sqrt{\frac{\ell}{\frac{V}{A}}}}} \]

    if 1.00000023e-317 < (/.f64 A (*.f64 V l)) < 1.99999999999999992e275

    1. Initial program 99.6%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}^{\frac{1}{2}}\right)\right) \]
      3. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left({\left(\frac{V \cdot \ell}{A}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      4. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V \cdot \ell}{A}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      6. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{A} \cdot \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{A}{\ell}\right)\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      10. metadata-eval89.3%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr89.3%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{A} \cdot \ell\right), \frac{-1}{2}\right)\right) \]
      2. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V \cdot \ell}{A}\right), \frac{-1}{2}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(V \cdot \ell\right), A\right), \frac{-1}{2}\right)\right) \]
      4. *-lowering-*.f6499.6%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(V, \ell\right), A\right), \frac{-1}{2}\right)\right) \]
    6. Applied egg-rr99.6%

      \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V \cdot \ell}{A}\right)}}^{-0.5} \]
    7. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto c0 \cdot {\left(\frac{1}{\frac{A}{V \cdot \ell}}\right)}^{\frac{-1}{2}} \]
      2. associate-/l/N/A

        \[\leadsto c0 \cdot {\left(\frac{1}{\frac{\frac{A}{\ell}}{V}}\right)}^{\frac{-1}{2}} \]
      3. inv-powN/A

        \[\leadsto c0 \cdot {\left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{-1}\right)}^{\frac{-1}{2}} \]
      4. pow-powN/A

        \[\leadsto c0 \cdot {\left(\frac{\frac{A}{\ell}}{V}\right)}^{\color{blue}{\left(-1 \cdot \frac{-1}{2}\right)}} \]
      5. metadata-evalN/A

        \[\leadsto c0 \cdot {\left(\frac{\frac{A}{\ell}}{V}\right)}^{\frac{1}{2}} \]
      6. pow1/2N/A

        \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}} \]
      7. clear-numN/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{\frac{A}{\ell}}}} \]
      8. sqrt-divN/A

        \[\leadsto c0 \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      9. metadata-evalN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V}{\frac{A}{\ell}}}}} \]
      10. associate-/r/N/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\frac{V}{A} \cdot \ell}} \]
      11. sqrt-unprodN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\frac{V}{A}} \cdot \color{blue}{\sqrt{\ell}}} \]
      12. unpow1/2N/A

        \[\leadsto c0 \cdot \frac{1}{{\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot \sqrt{\color{blue}{\ell}}} \]
      13. div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{{\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot \sqrt{\ell}}} \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left({\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot \sqrt{\ell}\right)}\right) \]
      15. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot {\ell}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      16. pow-prod-downN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{A} \cdot \ell\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      17. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{\frac{1}{2}}\right)\right) \]
      18. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{\frac{\frac{A}{\ell}}{V}}\right)}^{\frac{1}{2}}\right)\right) \]
      19. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      20. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      21. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{\frac{-1}{2}}\right)\right) \]
      22. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{\frac{A}{\ell}}{V}\right), \color{blue}{\frac{-1}{2}}\right)\right) \]
    8. Applied egg-rr99.6%

      \[\leadsto \color{blue}{\frac{c0}{{\left(\frac{A}{V \cdot \ell}\right)}^{-0.5}}} \]

    if 1.99999999999999992e275 < (/.f64 A (*.f64 V l))

    1. Initial program 34.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}^{\frac{1}{2}}\right)\right) \]
      3. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left({\left(\frac{V \cdot \ell}{A}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      4. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V \cdot \ell}{A}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      6. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{A} \cdot \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{A}{\ell}\right)\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      10. metadata-eval47.5%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr47.5%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification73.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{A}{\ell \cdot V} \leq 10^{-317}:\\ \;\;\;\;c0 \cdot \frac{\frac{A}{V}}{\sqrt{\frac{\ell}{\frac{V}{A}}}}\\ \mathbf{elif}\;\frac{A}{\ell \cdot V} \leq 2 \cdot 10^{+275}:\\ \;\;\;\;\frac{c0}{{\left(\frac{A}{\ell \cdot V}\right)}^{-0.5}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 79.0% accurate, 0.8× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{\ell \cdot V}\\ \mathbf{if}\;t\_0 \leq 10^{-317}:\\ \;\;\;\;{\left(V \cdot \left(A \cdot \ell\right)\right)}^{-0.5} \cdot \left(A \cdot c0\right)\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+275}:\\ \;\;\;\;\frac{c0}{{t\_0}^{-0.5}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\ \end{array} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* l V))))
   (if (<= t_0 1e-317)
     (* (pow (* V (* A l)) -0.5) (* A c0))
     (if (<= t_0 2e+275)
       (/ c0 (pow t_0 -0.5))
       (* c0 (pow (/ V (/ A l)) -0.5))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = A / (l * V);
	double tmp;
	if (t_0 <= 1e-317) {
		tmp = pow((V * (A * l)), -0.5) * (A * c0);
	} else if (t_0 <= 2e+275) {
		tmp = c0 / pow(t_0, -0.5);
	} else {
		tmp = c0 * pow((V / (A / l)), -0.5);
	}
	return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (l * v)
    if (t_0 <= 1d-317) then
        tmp = ((v * (a * l)) ** (-0.5d0)) * (a * c0)
    else if (t_0 <= 2d+275) then
        tmp = c0 / (t_0 ** (-0.5d0))
    else
        tmp = c0 * ((v / (a / l)) ** (-0.5d0))
    end if
    code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (l * V);
	double tmp;
	if (t_0 <= 1e-317) {
		tmp = Math.pow((V * (A * l)), -0.5) * (A * c0);
	} else if (t_0 <= 2e+275) {
		tmp = c0 / Math.pow(t_0, -0.5);
	} else {
		tmp = c0 * Math.pow((V / (A / l)), -0.5);
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	t_0 = A / (l * V)
	tmp = 0
	if t_0 <= 1e-317:
		tmp = math.pow((V * (A * l)), -0.5) * (A * c0)
	elif t_0 <= 2e+275:
		tmp = c0 / math.pow(t_0, -0.5)
	else:
		tmp = c0 * math.pow((V / (A / l)), -0.5)
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(l * V))
	tmp = 0.0
	if (t_0 <= 1e-317)
		tmp = Float64((Float64(V * Float64(A * l)) ^ -0.5) * Float64(A * c0));
	elseif (t_0 <= 2e+275)
		tmp = Float64(c0 / (t_0 ^ -0.5));
	else
		tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5));
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (l * V);
	tmp = 0.0;
	if (t_0 <= 1e-317)
		tmp = ((V * (A * l)) ^ -0.5) * (A * c0);
	elseif (t_0 <= 2e+275)
		tmp = c0 / (t_0 ^ -0.5);
	else
		tmp = c0 * ((V / (A / l)) ^ -0.5);
	end
	tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-317], N[(N[Power[N[(V * N[(A * l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(A * c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+275], N[(c0 / N[Power[t$95$0, -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 10^{-317}:\\
\;\;\;\;{\left(V \cdot \left(A \cdot \ell\right)\right)}^{-0.5} \cdot \left(A \cdot c0\right)\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+275}:\\
\;\;\;\;\frac{c0}{{t\_0}^{-0.5}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 A (*.f64 V l)) < 1.00000023e-317

    1. Initial program 32.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}^{\frac{1}{2}}\right)\right) \]
      3. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left({\left(\frac{V \cdot \ell}{A}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      4. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V \cdot \ell}{A}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      6. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{A} \cdot \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{A}{\ell}\right)\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      10. metadata-eval43.7%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr43.7%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    5. Applied egg-rr45.1%

      \[\leadsto c0 \cdot \color{blue}{\left(A \cdot \sqrt{\frac{1}{A \cdot \left(V \cdot \ell\right)}}\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(c0 \cdot A\right) \cdot \color{blue}{\sqrt{\frac{1}{A \cdot \left(V \cdot \ell\right)}}} \]
      2. *-commutativeN/A

        \[\leadsto \sqrt{\frac{1}{A \cdot \left(V \cdot \ell\right)}} \cdot \color{blue}{\left(c0 \cdot A\right)} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{\frac{1}{A \cdot \left(V \cdot \ell\right)}}\right), \color{blue}{\left(c0 \cdot A\right)}\right) \]
      4. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(\left(\sqrt{{\left(A \cdot \left(V \cdot \ell\right)\right)}^{-1}}\right), \left(c0 \cdot A\right)\right) \]
      5. sqrt-pow1N/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(A \cdot \left(V \cdot \ell\right)\right)}^{\left(\frac{-1}{2}\right)}\right), \left(\color{blue}{c0} \cdot A\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\left({\left(A \cdot \left(V \cdot \ell\right)\right)}^{\frac{-1}{2}}\right), \left(c0 \cdot A\right)\right) \]
      7. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(A \cdot \left(V \cdot \ell\right)\right), \frac{-1}{2}\right), \left(\color{blue}{c0} \cdot A\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\left(A \cdot V\right) \cdot \ell\right), \frac{-1}{2}\right), \left(c0 \cdot A\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(\left(V \cdot A\right) \cdot \ell\right), \frac{-1}{2}\right), \left(c0 \cdot A\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\left(V \cdot \left(A \cdot \ell\right)\right), \frac{-1}{2}\right), \left(c0 \cdot A\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(V, \left(A \cdot \ell\right)\right), \frac{-1}{2}\right), \left(c0 \cdot A\right)\right) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(V, \mathsf{*.f64}\left(A, \ell\right)\right), \frac{-1}{2}\right), \left(c0 \cdot A\right)\right) \]
      13. *-lowering-*.f6444.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\mathsf{*.f64}\left(V, \mathsf{*.f64}\left(A, \ell\right)\right), \frac{-1}{2}\right), \mathsf{*.f64}\left(c0, \color{blue}{A}\right)\right) \]
    7. Applied egg-rr44.7%

      \[\leadsto \color{blue}{{\left(V \cdot \left(A \cdot \ell\right)\right)}^{-0.5} \cdot \left(c0 \cdot A\right)} \]

    if 1.00000023e-317 < (/.f64 A (*.f64 V l)) < 1.99999999999999992e275

    1. Initial program 99.6%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}^{\frac{1}{2}}\right)\right) \]
      3. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left({\left(\frac{V \cdot \ell}{A}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      4. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V \cdot \ell}{A}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      6. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{A} \cdot \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{A}{\ell}\right)\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      10. metadata-eval89.3%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr89.3%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{A} \cdot \ell\right), \frac{-1}{2}\right)\right) \]
      2. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V \cdot \ell}{A}\right), \frac{-1}{2}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(V \cdot \ell\right), A\right), \frac{-1}{2}\right)\right) \]
      4. *-lowering-*.f6499.6%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(V, \ell\right), A\right), \frac{-1}{2}\right)\right) \]
    6. Applied egg-rr99.6%

      \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V \cdot \ell}{A}\right)}}^{-0.5} \]
    7. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto c0 \cdot {\left(\frac{1}{\frac{A}{V \cdot \ell}}\right)}^{\frac{-1}{2}} \]
      2. associate-/l/N/A

        \[\leadsto c0 \cdot {\left(\frac{1}{\frac{\frac{A}{\ell}}{V}}\right)}^{\frac{-1}{2}} \]
      3. inv-powN/A

        \[\leadsto c0 \cdot {\left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{-1}\right)}^{\frac{-1}{2}} \]
      4. pow-powN/A

        \[\leadsto c0 \cdot {\left(\frac{\frac{A}{\ell}}{V}\right)}^{\color{blue}{\left(-1 \cdot \frac{-1}{2}\right)}} \]
      5. metadata-evalN/A

        \[\leadsto c0 \cdot {\left(\frac{\frac{A}{\ell}}{V}\right)}^{\frac{1}{2}} \]
      6. pow1/2N/A

        \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}} \]
      7. clear-numN/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{\frac{A}{\ell}}}} \]
      8. sqrt-divN/A

        \[\leadsto c0 \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      9. metadata-evalN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V}{\frac{A}{\ell}}}}} \]
      10. associate-/r/N/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\frac{V}{A} \cdot \ell}} \]
      11. sqrt-unprodN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\frac{V}{A}} \cdot \color{blue}{\sqrt{\ell}}} \]
      12. unpow1/2N/A

        \[\leadsto c0 \cdot \frac{1}{{\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot \sqrt{\color{blue}{\ell}}} \]
      13. div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{{\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot \sqrt{\ell}}} \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left({\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot \sqrt{\ell}\right)}\right) \]
      15. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot {\ell}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      16. pow-prod-downN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{A} \cdot \ell\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      17. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{\frac{1}{2}}\right)\right) \]
      18. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{\frac{\frac{A}{\ell}}{V}}\right)}^{\frac{1}{2}}\right)\right) \]
      19. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      20. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      21. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{\frac{-1}{2}}\right)\right) \]
      22. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{\frac{A}{\ell}}{V}\right), \color{blue}{\frac{-1}{2}}\right)\right) \]
    8. Applied egg-rr99.6%

      \[\leadsto \color{blue}{\frac{c0}{{\left(\frac{A}{V \cdot \ell}\right)}^{-0.5}}} \]

    if 1.99999999999999992e275 < (/.f64 A (*.f64 V l))

    1. Initial program 34.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}^{\frac{1}{2}}\right)\right) \]
      3. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left({\left(\frac{V \cdot \ell}{A}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      4. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V \cdot \ell}{A}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      6. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{A} \cdot \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{A}{\ell}\right)\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      10. metadata-eval47.5%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr47.5%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{A}{\ell \cdot V} \leq 10^{-317}:\\ \;\;\;\;{\left(V \cdot \left(A \cdot \ell\right)\right)}^{-0.5} \cdot \left(A \cdot c0\right)\\ \mathbf{elif}\;\frac{A}{\ell \cdot V} \leq 2 \cdot 10^{+275}:\\ \;\;\;\;\frac{c0}{{\left(\frac{A}{\ell \cdot V}\right)}^{-0.5}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 79.0% accurate, 0.8× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{\ell \cdot V}\\ \mathbf{if}\;t\_0 \leq 10^{-317}:\\ \;\;\;\;\frac{A \cdot c0}{\sqrt{V \cdot \left(A \cdot \ell\right)}}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+275}:\\ \;\;\;\;\frac{c0}{{t\_0}^{-0.5}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\ \end{array} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* l V))))
   (if (<= t_0 1e-317)
     (/ (* A c0) (sqrt (* V (* A l))))
     (if (<= t_0 2e+275)
       (/ c0 (pow t_0 -0.5))
       (* c0 (pow (/ V (/ A l)) -0.5))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = A / (l * V);
	double tmp;
	if (t_0 <= 1e-317) {
		tmp = (A * c0) / sqrt((V * (A * l)));
	} else if (t_0 <= 2e+275) {
		tmp = c0 / pow(t_0, -0.5);
	} else {
		tmp = c0 * pow((V / (A / l)), -0.5);
	}
	return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (l * v)
    if (t_0 <= 1d-317) then
        tmp = (a * c0) / sqrt((v * (a * l)))
    else if (t_0 <= 2d+275) then
        tmp = c0 / (t_0 ** (-0.5d0))
    else
        tmp = c0 * ((v / (a / l)) ** (-0.5d0))
    end if
    code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (l * V);
	double tmp;
	if (t_0 <= 1e-317) {
		tmp = (A * c0) / Math.sqrt((V * (A * l)));
	} else if (t_0 <= 2e+275) {
		tmp = c0 / Math.pow(t_0, -0.5);
	} else {
		tmp = c0 * Math.pow((V / (A / l)), -0.5);
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	t_0 = A / (l * V)
	tmp = 0
	if t_0 <= 1e-317:
		tmp = (A * c0) / math.sqrt((V * (A * l)))
	elif t_0 <= 2e+275:
		tmp = c0 / math.pow(t_0, -0.5)
	else:
		tmp = c0 * math.pow((V / (A / l)), -0.5)
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(l * V))
	tmp = 0.0
	if (t_0 <= 1e-317)
		tmp = Float64(Float64(A * c0) / sqrt(Float64(V * Float64(A * l))));
	elseif (t_0 <= 2e+275)
		tmp = Float64(c0 / (t_0 ^ -0.5));
	else
		tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5));
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (l * V);
	tmp = 0.0;
	if (t_0 <= 1e-317)
		tmp = (A * c0) / sqrt((V * (A * l)));
	elseif (t_0 <= 2e+275)
		tmp = c0 / (t_0 ^ -0.5);
	else
		tmp = c0 * ((V / (A / l)) ^ -0.5);
	end
	tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-317], N[(N[(A * c0), $MachinePrecision] / N[Sqrt[N[(V * N[(A * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+275], N[(c0 / N[Power[t$95$0, -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 10^{-317}:\\
\;\;\;\;\frac{A \cdot c0}{\sqrt{V \cdot \left(A \cdot \ell\right)}}\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+275}:\\
\;\;\;\;\frac{c0}{{t\_0}^{-0.5}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 A (*.f64 V l)) < 1.00000023e-317

    1. Initial program 32.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}^{\frac{1}{2}}\right)\right) \]
      3. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left({\left(\frac{V \cdot \ell}{A}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      4. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V \cdot \ell}{A}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      6. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{A} \cdot \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{A}{\ell}\right)\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      10. metadata-eval43.7%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr43.7%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    5. Applied egg-rr45.1%

      \[\leadsto c0 \cdot \color{blue}{\left(A \cdot \sqrt{\frac{1}{A \cdot \left(V \cdot \ell\right)}}\right)} \]
    6. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \left(c0 \cdot A\right) \cdot \color{blue}{\sqrt{\frac{1}{A \cdot \left(V \cdot \ell\right)}}} \]
      2. sqrt-divN/A

        \[\leadsto \left(c0 \cdot A\right) \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{A \cdot \left(V \cdot \ell\right)}}} \]
      3. metadata-evalN/A

        \[\leadsto \left(c0 \cdot A\right) \cdot \frac{1}{\sqrt{\color{blue}{A \cdot \left(V \cdot \ell\right)}}} \]
      4. un-div-invN/A

        \[\leadsto \frac{c0 \cdot A}{\color{blue}{\sqrt{A \cdot \left(V \cdot \ell\right)}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(c0 \cdot A\right), \color{blue}{\left(\sqrt{A \cdot \left(V \cdot \ell\right)}\right)}\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, A\right), \left(\sqrt{\color{blue}{A \cdot \left(V \cdot \ell\right)}}\right)\right) \]
      7. sqrt-lowering-sqrt.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, A\right), \mathsf{sqrt.f64}\left(\left(A \cdot \left(V \cdot \ell\right)\right)\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, A\right), \mathsf{sqrt.f64}\left(\left(\left(A \cdot V\right) \cdot \ell\right)\right)\right) \]
      9. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, A\right), \mathsf{sqrt.f64}\left(\left(\left(V \cdot A\right) \cdot \ell\right)\right)\right) \]
      10. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, A\right), \mathsf{sqrt.f64}\left(\left(V \cdot \left(A \cdot \ell\right)\right)\right)\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, A\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \left(A \cdot \ell\right)\right)\right)\right) \]
      12. *-lowering-*.f6444.7%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(c0, A\right), \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(V, \mathsf{*.f64}\left(A, \ell\right)\right)\right)\right) \]
    7. Applied egg-rr44.7%

      \[\leadsto \color{blue}{\frac{c0 \cdot A}{\sqrt{V \cdot \left(A \cdot \ell\right)}}} \]

    if 1.00000023e-317 < (/.f64 A (*.f64 V l)) < 1.99999999999999992e275

    1. Initial program 99.6%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}^{\frac{1}{2}}\right)\right) \]
      3. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left({\left(\frac{V \cdot \ell}{A}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      4. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V \cdot \ell}{A}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      6. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{A} \cdot \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{A}{\ell}\right)\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      10. metadata-eval89.3%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr89.3%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{A} \cdot \ell\right), \frac{-1}{2}\right)\right) \]
      2. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V \cdot \ell}{A}\right), \frac{-1}{2}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(V \cdot \ell\right), A\right), \frac{-1}{2}\right)\right) \]
      4. *-lowering-*.f6499.6%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(V, \ell\right), A\right), \frac{-1}{2}\right)\right) \]
    6. Applied egg-rr99.6%

      \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V \cdot \ell}{A}\right)}}^{-0.5} \]
    7. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto c0 \cdot {\left(\frac{1}{\frac{A}{V \cdot \ell}}\right)}^{\frac{-1}{2}} \]
      2. associate-/l/N/A

        \[\leadsto c0 \cdot {\left(\frac{1}{\frac{\frac{A}{\ell}}{V}}\right)}^{\frac{-1}{2}} \]
      3. inv-powN/A

        \[\leadsto c0 \cdot {\left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{-1}\right)}^{\frac{-1}{2}} \]
      4. pow-powN/A

        \[\leadsto c0 \cdot {\left(\frac{\frac{A}{\ell}}{V}\right)}^{\color{blue}{\left(-1 \cdot \frac{-1}{2}\right)}} \]
      5. metadata-evalN/A

        \[\leadsto c0 \cdot {\left(\frac{\frac{A}{\ell}}{V}\right)}^{\frac{1}{2}} \]
      6. pow1/2N/A

        \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}} \]
      7. clear-numN/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{\frac{A}{\ell}}}} \]
      8. sqrt-divN/A

        \[\leadsto c0 \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      9. metadata-evalN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V}{\frac{A}{\ell}}}}} \]
      10. associate-/r/N/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\frac{V}{A} \cdot \ell}} \]
      11. sqrt-unprodN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\frac{V}{A}} \cdot \color{blue}{\sqrt{\ell}}} \]
      12. unpow1/2N/A

        \[\leadsto c0 \cdot \frac{1}{{\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot \sqrt{\color{blue}{\ell}}} \]
      13. div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{{\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot \sqrt{\ell}}} \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left({\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot \sqrt{\ell}\right)}\right) \]
      15. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot {\ell}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      16. pow-prod-downN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{A} \cdot \ell\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      17. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{\frac{1}{2}}\right)\right) \]
      18. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{\frac{\frac{A}{\ell}}{V}}\right)}^{\frac{1}{2}}\right)\right) \]
      19. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      20. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      21. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{\frac{-1}{2}}\right)\right) \]
      22. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{\frac{A}{\ell}}{V}\right), \color{blue}{\frac{-1}{2}}\right)\right) \]
    8. Applied egg-rr99.6%

      \[\leadsto \color{blue}{\frac{c0}{{\left(\frac{A}{V \cdot \ell}\right)}^{-0.5}}} \]

    if 1.99999999999999992e275 < (/.f64 A (*.f64 V l))

    1. Initial program 34.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}^{\frac{1}{2}}\right)\right) \]
      3. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left({\left(\frac{V \cdot \ell}{A}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      4. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V \cdot \ell}{A}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      6. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{A} \cdot \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{A}{\ell}\right)\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      10. metadata-eval47.5%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr47.5%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{A}{\ell \cdot V} \leq 10^{-317}:\\ \;\;\;\;\frac{A \cdot c0}{\sqrt{V \cdot \left(A \cdot \ell\right)}}\\ \mathbf{elif}\;\frac{A}{\ell \cdot V} \leq 2 \cdot 10^{+275}:\\ \;\;\;\;\frac{c0}{{\left(\frac{A}{\ell \cdot V}\right)}^{-0.5}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 79.6% accurate, 0.8× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{\ell \cdot V}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{V}}{\frac{\ell}{A}}}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+275}:\\ \;\;\;\;\frac{c0}{{t\_0}^{-0.5}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\ \end{array} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* l V))))
   (if (<= t_0 0.0)
     (* c0 (sqrt (/ (/ 1.0 V) (/ l A))))
     (if (<= t_0 2e+275)
       (/ c0 (pow t_0 -0.5))
       (* c0 (pow (/ V (/ A l)) -0.5))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = A / (l * V);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * sqrt(((1.0 / V) / (l / A)));
	} else if (t_0 <= 2e+275) {
		tmp = c0 / pow(t_0, -0.5);
	} else {
		tmp = c0 * pow((V / (A / l)), -0.5);
	}
	return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (l * v)
    if (t_0 <= 0.0d0) then
        tmp = c0 * sqrt(((1.0d0 / v) / (l / a)))
    else if (t_0 <= 2d+275) then
        tmp = c0 / (t_0 ** (-0.5d0))
    else
        tmp = c0 * ((v / (a / l)) ** (-0.5d0))
    end if
    code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (l * V);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * Math.sqrt(((1.0 / V) / (l / A)));
	} else if (t_0 <= 2e+275) {
		tmp = c0 / Math.pow(t_0, -0.5);
	} else {
		tmp = c0 * Math.pow((V / (A / l)), -0.5);
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	t_0 = A / (l * V)
	tmp = 0
	if t_0 <= 0.0:
		tmp = c0 * math.sqrt(((1.0 / V) / (l / A)))
	elif t_0 <= 2e+275:
		tmp = c0 / math.pow(t_0, -0.5)
	else:
		tmp = c0 * math.pow((V / (A / l)), -0.5)
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(l * V))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / V) / Float64(l / A))));
	elseif (t_0 <= 2e+275)
		tmp = Float64(c0 / (t_0 ^ -0.5));
	else
		tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5));
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (l * V);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = c0 * sqrt(((1.0 / V) / (l / A)));
	elseif (t_0 <= 2e+275)
		tmp = c0 / (t_0 ^ -0.5);
	else
		tmp = c0 * ((V / (A / l)) ^ -0.5);
	end
	tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+275], N[(c0 / N[Power[t$95$0, -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{V}}{\frac{\ell}{A}}}\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+275}:\\
\;\;\;\;\frac{c0}{{t\_0}^{-0.5}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 A (*.f64 V l)) < 0.0

    1. Initial program 31.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. associate-/l*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{1}{V \cdot \frac{\ell}{A}}\right)\right)\right) \]
      3. associate-/r*N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{\frac{1}{V}}{\frac{\ell}{A}}\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{V}\right), \left(\frac{\ell}{A}\right)\right)\right)\right) \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, V\right), \left(\frac{\ell}{A}\right)\right)\right)\right) \]
      6. /-lowering-/.f6446.4%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(1, V\right), \mathsf{/.f64}\left(\ell, A\right)\right)\right)\right) \]
    4. Applied egg-rr46.4%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{1}{V}}{\frac{\ell}{A}}}} \]

    if 0.0 < (/.f64 A (*.f64 V l)) < 1.99999999999999992e275

    1. Initial program 99.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}^{\frac{1}{2}}\right)\right) \]
      3. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left({\left(\frac{V \cdot \ell}{A}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      4. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V \cdot \ell}{A}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      6. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{A} \cdot \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{A}{\ell}\right)\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      10. metadata-eval88.8%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr88.8%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{A} \cdot \ell\right), \frac{-1}{2}\right)\right) \]
      2. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V \cdot \ell}{A}\right), \frac{-1}{2}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(V \cdot \ell\right), A\right), \frac{-1}{2}\right)\right) \]
      4. *-lowering-*.f6498.9%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(V, \ell\right), A\right), \frac{-1}{2}\right)\right) \]
    6. Applied egg-rr98.9%

      \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V \cdot \ell}{A}\right)}}^{-0.5} \]
    7. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto c0 \cdot {\left(\frac{1}{\frac{A}{V \cdot \ell}}\right)}^{\frac{-1}{2}} \]
      2. associate-/l/N/A

        \[\leadsto c0 \cdot {\left(\frac{1}{\frac{\frac{A}{\ell}}{V}}\right)}^{\frac{-1}{2}} \]
      3. inv-powN/A

        \[\leadsto c0 \cdot {\left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{-1}\right)}^{\frac{-1}{2}} \]
      4. pow-powN/A

        \[\leadsto c0 \cdot {\left(\frac{\frac{A}{\ell}}{V}\right)}^{\color{blue}{\left(-1 \cdot \frac{-1}{2}\right)}} \]
      5. metadata-evalN/A

        \[\leadsto c0 \cdot {\left(\frac{\frac{A}{\ell}}{V}\right)}^{\frac{1}{2}} \]
      6. pow1/2N/A

        \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}} \]
      7. clear-numN/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{\frac{A}{\ell}}}} \]
      8. sqrt-divN/A

        \[\leadsto c0 \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      9. metadata-evalN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V}{\frac{A}{\ell}}}}} \]
      10. associate-/r/N/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\frac{V}{A} \cdot \ell}} \]
      11. sqrt-unprodN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\frac{V}{A}} \cdot \color{blue}{\sqrt{\ell}}} \]
      12. unpow1/2N/A

        \[\leadsto c0 \cdot \frac{1}{{\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot \sqrt{\color{blue}{\ell}}} \]
      13. div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{{\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot \sqrt{\ell}}} \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left({\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot \sqrt{\ell}\right)}\right) \]
      15. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot {\ell}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      16. pow-prod-downN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{A} \cdot \ell\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      17. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{\frac{1}{2}}\right)\right) \]
      18. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{\frac{\frac{A}{\ell}}{V}}\right)}^{\frac{1}{2}}\right)\right) \]
      19. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      20. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      21. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{\frac{-1}{2}}\right)\right) \]
      22. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{\frac{A}{\ell}}{V}\right), \color{blue}{\frac{-1}{2}}\right)\right) \]
    8. Applied egg-rr99.4%

      \[\leadsto \color{blue}{\frac{c0}{{\left(\frac{A}{V \cdot \ell}\right)}^{-0.5}}} \]

    if 1.99999999999999992e275 < (/.f64 A (*.f64 V l))

    1. Initial program 34.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}^{\frac{1}{2}}\right)\right) \]
      3. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left({\left(\frac{V \cdot \ell}{A}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      4. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V \cdot \ell}{A}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      6. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{A} \cdot \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{A}{\ell}\right)\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      10. metadata-eval47.5%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr47.5%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{A}{\ell \cdot V} \leq 0:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{V}}{\frac{\ell}{A}}}\\ \mathbf{elif}\;\frac{A}{\ell \cdot V} \leq 2 \cdot 10^{+275}:\\ \;\;\;\;\frac{c0}{{\left(\frac{A}{\ell \cdot V}\right)}^{-0.5}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 79.6% accurate, 0.8× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{\ell \cdot V}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+275}:\\ \;\;\;\;\frac{c0}{{t\_0}^{-0.5}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\ \end{array} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* l V))))
   (if (<= t_0 0.0)
     (* c0 (sqrt (/ (/ A V) l)))
     (if (<= t_0 2e+275)
       (/ c0 (pow t_0 -0.5))
       (* c0 (pow (/ V (/ A l)) -0.5))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	double t_0 = A / (l * V);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * sqrt(((A / V) / l));
	} else if (t_0 <= 2e+275) {
		tmp = c0 / pow(t_0, -0.5);
	} else {
		tmp = c0 * pow((V / (A / l)), -0.5);
	}
	return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (l * v)
    if (t_0 <= 0.0d0) then
        tmp = c0 * sqrt(((a / v) / l))
    else if (t_0 <= 2d+275) then
        tmp = c0 / (t_0 ** (-0.5d0))
    else
        tmp = c0 * ((v / (a / l)) ** (-0.5d0))
    end if
    code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (l * V);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * Math.sqrt(((A / V) / l));
	} else if (t_0 <= 2e+275) {
		tmp = c0 / Math.pow(t_0, -0.5);
	} else {
		tmp = c0 * Math.pow((V / (A / l)), -0.5);
	}
	return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	t_0 = A / (l * V)
	tmp = 0
	if t_0 <= 0.0:
		tmp = c0 * math.sqrt(((A / V) / l))
	elif t_0 <= 2e+275:
		tmp = c0 / math.pow(t_0, -0.5)
	else:
		tmp = c0 * math.pow((V / (A / l)), -0.5)
	return tmp
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(l * V))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	elseif (t_0 <= 2e+275)
		tmp = Float64(c0 / (t_0 ^ -0.5));
	else
		tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5));
	end
	return tmp
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (l * V);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = c0 * sqrt(((A / V) / l));
	elseif (t_0 <= 2e+275)
		tmp = c0 / (t_0 ^ -0.5);
	else
		tmp = c0 * ((V / (A / l)) ^ -0.5);
	end
	tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+275], N[(c0 / N[Power[t$95$0, -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+275}:\\
\;\;\;\;\frac{c0}{{t\_0}^{-0.5}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 A (*.f64 V l)) < 0.0

    1. Initial program 31.5%

      \[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-/.f6446.4%

        \[\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-rr46.4%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]

    if 0.0 < (/.f64 A (*.f64 V l)) < 1.99999999999999992e275

    1. Initial program 99.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}^{\frac{1}{2}}\right)\right) \]
      3. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left({\left(\frac{V \cdot \ell}{A}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      4. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V \cdot \ell}{A}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      6. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{A} \cdot \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{A}{\ell}\right)\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      10. metadata-eval88.8%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr88.8%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{A} \cdot \ell\right), \frac{-1}{2}\right)\right) \]
      2. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V \cdot \ell}{A}\right), \frac{-1}{2}\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\left(V \cdot \ell\right), A\right), \frac{-1}{2}\right)\right) \]
      4. *-lowering-*.f6498.9%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(V, \ell\right), A\right), \frac{-1}{2}\right)\right) \]
    6. Applied egg-rr98.9%

      \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V \cdot \ell}{A}\right)}}^{-0.5} \]
    7. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto c0 \cdot {\left(\frac{1}{\frac{A}{V \cdot \ell}}\right)}^{\frac{-1}{2}} \]
      2. associate-/l/N/A

        \[\leadsto c0 \cdot {\left(\frac{1}{\frac{\frac{A}{\ell}}{V}}\right)}^{\frac{-1}{2}} \]
      3. inv-powN/A

        \[\leadsto c0 \cdot {\left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{-1}\right)}^{\frac{-1}{2}} \]
      4. pow-powN/A

        \[\leadsto c0 \cdot {\left(\frac{\frac{A}{\ell}}{V}\right)}^{\color{blue}{\left(-1 \cdot \frac{-1}{2}\right)}} \]
      5. metadata-evalN/A

        \[\leadsto c0 \cdot {\left(\frac{\frac{A}{\ell}}{V}\right)}^{\frac{1}{2}} \]
      6. pow1/2N/A

        \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}} \]
      7. clear-numN/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V}{\frac{A}{\ell}}}} \]
      8. sqrt-divN/A

        \[\leadsto c0 \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
      9. metadata-evalN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V}{\frac{A}{\ell}}}}} \]
      10. associate-/r/N/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\frac{V}{A} \cdot \ell}} \]
      11. sqrt-unprodN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\frac{V}{A}} \cdot \color{blue}{\sqrt{\ell}}} \]
      12. unpow1/2N/A

        \[\leadsto c0 \cdot \frac{1}{{\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot \sqrt{\color{blue}{\ell}}} \]
      13. div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{{\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot \sqrt{\ell}}} \]
      14. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left({\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot \sqrt{\ell}\right)}\right) \]
      15. pow1/2N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{A}\right)}^{\frac{1}{2}} \cdot {\ell}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      16. pow-prod-downN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{A} \cdot \ell\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      17. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{V}{\frac{A}{\ell}}\right)}^{\frac{1}{2}}\right)\right) \]
      18. clear-numN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{1}{\frac{\frac{A}{\ell}}{V}}\right)}^{\frac{1}{2}}\right)\right) \]
      19. inv-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      20. pow-powN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      21. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(c0, \left({\left(\frac{\frac{A}{\ell}}{V}\right)}^{\frac{-1}{2}}\right)\right) \]
      22. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{\frac{A}{\ell}}{V}\right), \color{blue}{\frac{-1}{2}}\right)\right) \]
    8. Applied egg-rr99.4%

      \[\leadsto \color{blue}{\frac{c0}{{\left(\frac{A}{V \cdot \ell}\right)}^{-0.5}}} \]

    if 1.99999999999999992e275 < (/.f64 A (*.f64 V l))

    1. Initial program 34.1%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. pow1/2N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{A}{V \cdot \ell}\right)}^{\color{blue}{\frac{1}{2}}}\right)\right) \]
      2. clear-numN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{1}{\frac{V \cdot \ell}{A}}\right)}^{\frac{1}{2}}\right)\right) \]
      3. inv-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left({\left(\frac{V \cdot \ell}{A}\right)}^{-1}\right)}^{\frac{1}{2}}\right)\right) \]
      4. pow-powN/A

        \[\leadsto \mathsf{*.f64}\left(c0, \left({\left(\frac{V \cdot \ell}{A}\right)}^{\color{blue}{\left(-1 \cdot \frac{1}{2}\right)}}\right)\right) \]
      5. pow-lowering-pow.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V \cdot \ell}{A}\right), \color{blue}{\left(-1 \cdot \frac{1}{2}\right)}\right)\right) \]
      6. associate-*l/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{A} \cdot \ell\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      7. associate-/r/N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\left(\frac{V}{\frac{A}{\ell}}\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      8. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \left(\frac{A}{\ell}\right)\right), \left(\color{blue}{-1} \cdot \frac{1}{2}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \left(-1 \cdot \frac{1}{2}\right)\right)\right) \]
      10. metadata-eval47.5%

        \[\leadsto \mathsf{*.f64}\left(c0, \mathsf{pow.f64}\left(\mathsf{/.f64}\left(V, \mathsf{/.f64}\left(A, \ell\right)\right), \frac{-1}{2}\right)\right) \]
    4. Applied egg-rr47.5%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{A}{\ell \cdot V} \leq 0:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;\frac{A}{\ell \cdot V} \leq 2 \cdot 10^{+275}:\\ \;\;\;\;\frac{c0}{{\left(\frac{A}{\ell \cdot V}\right)}^{-0.5}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 79.9% accurate, 0.9× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{\ell \cdot V}\\ \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+297}:\\ \;\;\;\;c0 \cdot \sqrt{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 (/ A (* l V))))
   (if (<= t_0 0.0)
     (* c0 (sqrt (/ (/ A V) l)))
     (if (<= t_0 5e+297) (* c0 (sqrt 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 = A / (l * V);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * sqrt(((A / V) / l));
	} else if (t_0 <= 5e+297) {
		tmp = c0 * sqrt(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 = a / (l * v)
    if (t_0 <= 0.0d0) then
        tmp = c0 * sqrt(((a / v) / l))
    else if (t_0 <= 5d+297) then
        tmp = c0 * sqrt(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 = A / (l * V);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * Math.sqrt(((A / V) / l));
	} else if (t_0 <= 5e+297) {
		tmp = c0 * Math.sqrt(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 = A / (l * V)
	tmp = 0
	if t_0 <= 0.0:
		tmp = c0 * math.sqrt(((A / V) / l))
	elif t_0 <= 5e+297:
		tmp = c0 * math.sqrt(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(A / Float64(l * V))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	elseif (t_0 <= 5e+297)
		tmp = Float64(c0 * sqrt(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 = A / (l * V);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = c0 * sqrt(((A / V) / l));
	elseif (t_0 <= 5e+297)
		tmp = c0 * sqrt(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[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+297], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+297}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 A (*.f64 V l)) < 0.0

    1. Initial program 31.5%

      \[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-/.f6446.4%

        \[\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-rr46.4%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V}}{\ell}}} \]

    if 0.0 < (/.f64 A (*.f64 V l)) < 4.9999999999999998e297

    1. Initial program 99.4%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing

    if 4.9999999999999998e297 < (/.f64 A (*.f64 V l))

    1. Initial program 29.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto c0 \cdot \sqrt{\frac{1}{\frac{V \cdot \ell}{A}}} \]
      2. sqrt-divN/A

        \[\leadsto c0 \cdot \frac{\sqrt{1}}{\color{blue}{\sqrt{\frac{V \cdot \ell}{A}}}} \]
      3. metadata-evalN/A

        \[\leadsto c0 \cdot \frac{1}{\sqrt{\color{blue}{\frac{V \cdot \ell}{A}}}} \]
      4. un-div-invN/A

        \[\leadsto \frac{c0}{\color{blue}{\sqrt{\frac{V \cdot \ell}{A}}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \color{blue}{\left(\sqrt{\frac{V \cdot \ell}{A}}\right)}\right) \]
      6. 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-/.f6445.4%

        \[\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-rr45.4%

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}} \]
    5. Step-by-step derivation
      1. associate-/r/N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\left(\frac{V}{A} \cdot \ell\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\left(\frac{V}{A}\right), \ell\right)\right)\right) \]
      3. /-lowering-/.f6448.3%

        \[\leadsto \mathsf{/.f64}\left(c0, \mathsf{sqrt.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(V, A\right), \ell\right)\right)\right) \]
    6. Applied egg-rr48.3%

      \[\leadsto \frac{c0}{\sqrt{\color{blue}{\frac{V}{A} \cdot \ell}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification77.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{A}{\ell \cdot V} \leq 0:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;\frac{A}{\ell \cdot V} \leq 5 \cdot 10^{+297}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 73.5% accurate, 1.0× speedup?

\[\begin{array}{l} [c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\ \\ c0 \cdot \sqrt{\frac{A}{\ell \cdot V}} \end{array} \]
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* l V)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
	return c0 * sqrt((A / (l * V)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    code = c0 * sqrt((a / (l * v)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
	return c0 * Math.sqrt((A / (l * V)));
}
[c0, A, V, l] = sort([c0, A, V, l])
def code(c0, A, V, l):
	return c0 * math.sqrt((A / (l * V)))
c0, A, V, l = sort([c0, A, V, l])
function code(c0, A, V, l)
	return Float64(c0 * sqrt(Float64(A / Float64(l * V))))
end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
	tmp = c0 * sqrt((A / (l * V)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}
\end{array}
Derivation
  1. Initial program 70.8%

    \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
  2. Add Preprocessing
  3. Final simplification70.8%

    \[\leadsto c0 \cdot \sqrt{\frac{A}{\ell \cdot V}} \]
  4. Add Preprocessing

Reproduce

?
herbie shell --seed 2024161 
(FPCore (c0 A V l)
  :name "Henrywood and Agarwal, Equation (3)"
  :precision binary64
  (* c0 (sqrt (/ A (* V l)))))