Henrywood and Agarwal, Equation (3)

Percentage Accurate: 73.2% → 90.3%
Time: 12.6s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 73.2% 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: 90.3% accurate, 0.5× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\left(\sqrt{\frac{A}{V}} \cdot {\ell}^{-0.5}\right) \cdot c0\_m\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-274}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;\sqrt{\frac{\frac{c0\_m}{V} \cdot \left(A \cdot c0\_m\right)}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+237}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (*
  c0_s
  (if (<= (* V l) (- INFINITY))
    (* (* (sqrt (/ A V)) (pow l -0.5)) c0_m)
    (if (<= (* V l) -1e-274)
      (* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
      (if (<= (* V l) 0.0)
        (sqrt (/ (* (/ c0_m V) (* A c0_m)) l))
        (if (<= (* V l) 4e+237)
          (* c0_m (/ (sqrt A) (sqrt (* V l))))
          (* c0_m (sqrt (/ (/ A V) l)))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -((double) INFINITY)) {
		tmp = (sqrt((A / V)) * pow(l, -0.5)) * c0_m;
	} else if ((V * l) <= -1e-274) {
		tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
	} else if ((V * l) <= 0.0) {
		tmp = sqrt((((c0_m / V) * (A * c0_m)) / l));
	} else if ((V * l) <= 4e+237) {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = c0_m * sqrt(((A / V) / l));
	}
	return c0_s * tmp;
}
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -Double.POSITIVE_INFINITY) {
		tmp = (Math.sqrt((A / V)) * Math.pow(l, -0.5)) * c0_m;
	} else if ((V * l) <= -1e-274) {
		tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if ((V * l) <= 0.0) {
		tmp = Math.sqrt((((c0_m / V) * (A * c0_m)) / l));
	} else if ((V * l) <= 4e+237) {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = c0_m * Math.sqrt(((A / V) / l));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	tmp = 0
	if (V * l) <= -math.inf:
		tmp = (math.sqrt((A / V)) * math.pow(l, -0.5)) * c0_m
	elif (V * l) <= -1e-274:
		tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l)))
	elif (V * l) <= 0.0:
		tmp = math.sqrt((((c0_m / V) * (A * c0_m)) / l))
	elif (V * l) <= 4e+237:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = c0_m * math.sqrt(((A / V) / l))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= Float64(-Inf))
		tmp = Float64(Float64(sqrt(Float64(A / V)) * (l ^ -0.5)) * c0_m);
	elseif (Float64(V * l) <= -1e-274)
		tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif (Float64(V * l) <= 0.0)
		tmp = sqrt(Float64(Float64(Float64(c0_m / V) * Float64(A * c0_m)) / l));
	elseif (Float64(V * l) <= 4e+237)
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l)));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -Inf)
		tmp = (sqrt((A / V)) * (l ^ -0.5)) * c0_m;
	elseif ((V * l) <= -1e-274)
		tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
	elseif ((V * l) <= 0.0)
		tmp = sqrt((((c0_m / V) * (A * c0_m)) / l));
	elseif ((V * l) <= 4e+237)
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	else
		tmp = c0_m * sqrt(((A / V) / l));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision] * c0$95$m), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-274], N[(c0$95$m * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Sqrt[N[(N[(N[(c0$95$m / V), $MachinePrecision] * N[(A * c0$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+237], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\left(\sqrt{\frac{A}{V}} \cdot {\ell}^{-0.5}\right) \cdot c0\_m\\

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

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

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

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


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

    1. Initial program 38.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sqrt{\frac{\color{blue}{\sqrt{A} \cdot \sqrt{A}}}{V}} \cdot \frac{1}{\sqrt{-\ell}}\right) \cdot c0 \]
      11. add-sqr-sqrt8.7%

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

        \[\leadsto \left(\sqrt{\color{blue}{\frac{1}{\frac{V}{A}}}} \cdot \frac{1}{\sqrt{-\ell}}\right) \cdot c0 \]
      13. clear-num8.7%

        \[\leadsto \left(\sqrt{\color{blue}{\frac{A}{V}}} \cdot \frac{1}{\sqrt{-\ell}}\right) \cdot c0 \]
      14. pow1/28.7%

        \[\leadsto \left(\sqrt{\frac{A}{V}} \cdot \frac{1}{\color{blue}{{\left(-\ell\right)}^{0.5}}}\right) \cdot c0 \]
      15. pow-flip8.7%

        \[\leadsto \left(\sqrt{\frac{A}{V}} \cdot \color{blue}{{\left(-\ell\right)}^{\left(-0.5\right)}}\right) \cdot c0 \]
      16. add-sqr-sqrt8.7%

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

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

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

        \[\leadsto \left(\sqrt{\frac{A}{V}} \cdot {\color{blue}{\left(\sqrt{\ell} \cdot \sqrt{\ell}\right)}}^{\left(-0.5\right)}\right) \cdot c0 \]
      20. add-sqr-sqrt61.1%

        \[\leadsto \left(\sqrt{\frac{A}{V}} \cdot {\color{blue}{\ell}}^{\left(-0.5\right)}\right) \cdot c0 \]
      21. metadata-eval61.1%

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

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

    if -inf.0 < (*.f64 V l) < -9.99999999999999966e-275

    1. Initial program 84.3%

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

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

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

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

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

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

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

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

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

    if -9.99999999999999966e-275 < (*.f64 V l) < -0.0

    1. Initial program 50.0%

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot c0\right)}} \]
      6. add-sqr-sqrt40.9%

        \[\leadsto \sqrt{\color{blue}{\frac{A}{V \cdot \ell}} \cdot \left(c0 \cdot c0\right)} \]
      7. pow240.9%

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell} \cdot {c0}^{2}}} \]
    7. Taylor expanded in A around 0 44.8%

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

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{{c0}^{2}}{\frac{V}{\frac{A}{\ell}}}}} \]
      4. associate-/r/45.2%

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

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

      \[\leadsto \sqrt{\color{blue}{\frac{\frac{{c0}^{2}}{\frac{V}{A}}}{\ell}}} \]
    10. Step-by-step derivation
      1. unpow245.2%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{\frac{c0}{V} \cdot \left(c0 \cdot {A}^{\color{blue}{1}}\right)}{\ell}} \]
      5. pow157.0%

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

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

    if -0.0 < (*.f64 V l) < 3.99999999999999976e237

    1. Initial program 86.1%

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

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

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

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

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

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

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

    if 3.99999999999999976e237 < (*.f64 V l)

    1. Initial program 47.0%

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

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

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

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

Alternative 2: 84.2% accurate, 0.5× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 10^{-322}:\\ \;\;\;\;c0\_m \cdot \frac{1}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+300}:\\ \;\;\;\;c0\_m \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{c0\_m}{V} \cdot \left(A \cdot c0\_m\right)}{\ell}}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (*
    c0_s
    (if (<= t_0 1e-322)
      (* c0_m (/ 1.0 (/ (sqrt l) (sqrt (/ A V)))))
      (if (<= t_0 4e+300)
        (* c0_m (pow (/ (* V l) A) -0.5))
        (sqrt (/ (* (/ c0_m V) (* A c0_m)) l)))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 1e-322) {
		tmp = c0_m * (1.0 / (sqrt(l) / sqrt((A / V))));
	} else if (t_0 <= 4e+300) {
		tmp = c0_m * pow(((V * l) / A), -0.5);
	} else {
		tmp = sqrt((((c0_m / V) * (A * c0_m)) / l));
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 1d-322) then
        tmp = c0_m * (1.0d0 / (sqrt(l) / sqrt((a / v))))
    else if (t_0 <= 4d+300) then
        tmp = c0_m * (((v * l) / a) ** (-0.5d0))
    else
        tmp = sqrt((((c0_m / v) * (a * c0_m)) / l))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 1e-322) {
		tmp = c0_m * (1.0 / (Math.sqrt(l) / Math.sqrt((A / V))));
	} else if (t_0 <= 4e+300) {
		tmp = c0_m * Math.pow(((V * l) / A), -0.5);
	} else {
		tmp = Math.sqrt((((c0_m / V) * (A * c0_m)) / l));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 1e-322:
		tmp = c0_m * (1.0 / (math.sqrt(l) / math.sqrt((A / V))))
	elif t_0 <= 4e+300:
		tmp = c0_m * math.pow(((V * l) / A), -0.5)
	else:
		tmp = math.sqrt((((c0_m / V) * (A * c0_m)) / l))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 1e-322)
		tmp = Float64(c0_m * Float64(1.0 / Float64(sqrt(l) / sqrt(Float64(A / V)))));
	elseif (t_0 <= 4e+300)
		tmp = Float64(c0_m * (Float64(Float64(V * l) / A) ^ -0.5));
	else
		tmp = sqrt(Float64(Float64(Float64(c0_m / V) * Float64(A * c0_m)) / l));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 1e-322)
		tmp = c0_m * (1.0 / (sqrt(l) / sqrt((A / V))));
	elseif (t_0 <= 4e+300)
		tmp = c0_m * (((V * l) / A) ^ -0.5);
	else
		tmp = sqrt((((c0_m / V) * (A * c0_m)) / l));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 1e-322], N[(c0$95$m * N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+300], N[(c0$95$m * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(N[(c0$95$m / V), $MachinePrecision] * N[(A * c0$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 10^{-322}:\\
\;\;\;\;c0\_m \cdot \frac{1}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\

\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+300}:\\
\;\;\;\;c0\_m \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\

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


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

    1. Initial program 35.5%

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

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

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

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

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

    if 9.88131e-323 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e300

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\ell \cdot \color{blue}{\left(\sqrt{-V} \cdot \sqrt{-V}\right)}}}{\sqrt{A}}} \]
      10. add-sqr-sqrt0.0%

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\color{blue}{\left(-V\right) \cdot \ell}}}{\sqrt{A}}} \]
      12. add-sqr-sqrt0.0%

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\color{blue}{\sqrt{\left(-V\right) \cdot \left(-V\right)}} \cdot \ell}}{\sqrt{A}}} \]
      14. sqr-neg12.7%

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\color{blue}{\left(\sqrt{V} \cdot \sqrt{V}\right)} \cdot \ell}}{\sqrt{A}}} \]
      16. add-sqr-sqrt53.1%

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

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

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

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

    if 4.0000000000000002e300 < (/.f64 A (*.f64 V l))

    1. Initial program 46.8%

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot c0\right)}} \]
      6. add-sqr-sqrt27.7%

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell} \cdot {c0}^{2}}} \]
    7. Taylor expanded in A around 0 32.6%

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

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{{c0}^{2}}{\frac{V}{\frac{A}{\ell}}}}} \]
      4. associate-/r/29.8%

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

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{{c0}^{2}}{\frac{V}{A}}}{\ell}}} \]
    9. Simplified31.4%

      \[\leadsto \sqrt{\color{blue}{\frac{\frac{{c0}^{2}}{\frac{V}{A}}}{\ell}}} \]
    10. Step-by-step derivation
      1. unpow231.4%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{\frac{c0}{V} \cdot \left(c0 \cdot {A}^{\color{blue}{1}}\right)}{\ell}} \]
      5. pow143.0%

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

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

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

Alternative 3: 84.2% accurate, 0.5× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 10^{-322}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+300}:\\ \;\;\;\;c0\_m \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{c0\_m}{V} \cdot \left(A \cdot c0\_m\right)}{\ell}}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (*
    c0_s
    (if (<= t_0 1e-322)
      (* c0_m (/ (sqrt (/ A V)) (sqrt l)))
      (if (<= t_0 4e+300)
        (* c0_m (pow (/ (* V l) A) -0.5))
        (sqrt (/ (* (/ c0_m V) (* A c0_m)) l)))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 1e-322) {
		tmp = c0_m * (sqrt((A / V)) / sqrt(l));
	} else if (t_0 <= 4e+300) {
		tmp = c0_m * pow(((V * l) / A), -0.5);
	} else {
		tmp = sqrt((((c0_m / V) * (A * c0_m)) / l));
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 1d-322) then
        tmp = c0_m * (sqrt((a / v)) / sqrt(l))
    else if (t_0 <= 4d+300) then
        tmp = c0_m * (((v * l) / a) ** (-0.5d0))
    else
        tmp = sqrt((((c0_m / v) * (a * c0_m)) / l))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 1e-322) {
		tmp = c0_m * (Math.sqrt((A / V)) / Math.sqrt(l));
	} else if (t_0 <= 4e+300) {
		tmp = c0_m * Math.pow(((V * l) / A), -0.5);
	} else {
		tmp = Math.sqrt((((c0_m / V) * (A * c0_m)) / l));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 1e-322:
		tmp = c0_m * (math.sqrt((A / V)) / math.sqrt(l))
	elif t_0 <= 4e+300:
		tmp = c0_m * math.pow(((V * l) / A), -0.5)
	else:
		tmp = math.sqrt((((c0_m / V) * (A * c0_m)) / l))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 1e-322)
		tmp = Float64(c0_m * Float64(sqrt(Float64(A / V)) / sqrt(l)));
	elseif (t_0 <= 4e+300)
		tmp = Float64(c0_m * (Float64(Float64(V * l) / A) ^ -0.5));
	else
		tmp = sqrt(Float64(Float64(Float64(c0_m / V) * Float64(A * c0_m)) / l));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 1e-322)
		tmp = c0_m * (sqrt((A / V)) / sqrt(l));
	elseif (t_0 <= 4e+300)
		tmp = c0_m * (((V * l) / A) ^ -0.5);
	else
		tmp = sqrt((((c0_m / V) * (A * c0_m)) / l));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 1e-322], N[(c0$95$m * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+300], N[(c0$95$m * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(N[(c0$95$m / V), $MachinePrecision] * N[(A * c0$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 10^{-322}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\

\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+300}:\\
\;\;\;\;c0\_m \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\

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


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

    1. Initial program 35.5%

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

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

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

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

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

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

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

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

    if 9.88131e-323 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e300

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\ell \cdot \color{blue}{\left(\sqrt{-V} \cdot \sqrt{-V}\right)}}}{\sqrt{A}}} \]
      10. add-sqr-sqrt0.0%

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\color{blue}{\left(-V\right) \cdot \ell}}}{\sqrt{A}}} \]
      12. add-sqr-sqrt0.0%

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\color{blue}{\sqrt{\left(-V\right) \cdot \left(-V\right)}} \cdot \ell}}{\sqrt{A}}} \]
      14. sqr-neg12.7%

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\color{blue}{\left(\sqrt{V} \cdot \sqrt{V}\right)} \cdot \ell}}{\sqrt{A}}} \]
      16. add-sqr-sqrt53.1%

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

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

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

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

    if 4.0000000000000002e300 < (/.f64 A (*.f64 V l))

    1. Initial program 46.8%

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot c0\right)}} \]
      6. add-sqr-sqrt27.7%

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell} \cdot {c0}^{2}}} \]
    7. Taylor expanded in A around 0 32.6%

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

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{{c0}^{2}}{\frac{V}{\frac{A}{\ell}}}}} \]
      4. associate-/r/29.8%

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

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{{c0}^{2}}{\frac{V}{A}}}{\ell}}} \]
    9. Simplified31.4%

      \[\leadsto \sqrt{\color{blue}{\frac{\frac{{c0}^{2}}{\frac{V}{A}}}{\ell}}} \]
    10. Step-by-step derivation
      1. unpow231.4%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{\frac{c0}{V} \cdot \left(c0 \cdot {A}^{\color{blue}{1}}\right)}{\ell}} \]
      5. pow143.0%

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

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

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

Alternative 4: 85.1% accurate, 0.8× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 10^{-322} \lor \neg \left(t\_0 \leq 4 \cdot 10^{+300}\right):\\ \;\;\;\;\sqrt{\frac{c0\_m}{V} \cdot \frac{A \cdot c0\_m}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0\_m \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (*
    c0_s
    (if (or (<= t_0 1e-322) (not (<= t_0 4e+300)))
      (sqrt (* (/ c0_m V) (/ (* A c0_m) l)))
      (* c0_m (pow (/ (* V l) A) -0.5))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 1e-322) || !(t_0 <= 4e+300)) {
		tmp = sqrt(((c0_m / V) * ((A * c0_m) / l)));
	} else {
		tmp = c0_m * pow(((V * l) / A), -0.5);
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if ((t_0 <= 1d-322) .or. (.not. (t_0 <= 4d+300))) then
        tmp = sqrt(((c0_m / v) * ((a * c0_m) / l)))
    else
        tmp = c0_m * (((v * l) / a) ** (-0.5d0))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 1e-322) || !(t_0 <= 4e+300)) {
		tmp = Math.sqrt(((c0_m / V) * ((A * c0_m) / l)));
	} else {
		tmp = c0_m * Math.pow(((V * l) / A), -0.5);
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if (t_0 <= 1e-322) or not (t_0 <= 4e+300):
		tmp = math.sqrt(((c0_m / V) * ((A * c0_m) / l)))
	else:
		tmp = c0_m * math.pow(((V * l) / A), -0.5)
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if ((t_0 <= 1e-322) || !(t_0 <= 4e+300))
		tmp = sqrt(Float64(Float64(c0_m / V) * Float64(Float64(A * c0_m) / l)));
	else
		tmp = Float64(c0_m * (Float64(Float64(V * l) / A) ^ -0.5));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if ((t_0 <= 1e-322) || ~((t_0 <= 4e+300)))
		tmp = sqrt(((c0_m / V) * ((A * c0_m) / l)));
	else
		tmp = c0_m * (((V * l) / A) ^ -0.5);
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 1e-322], N[Not[LessEqual[t$95$0, 4e+300]], $MachinePrecision]], N[Sqrt[N[(N[(c0$95$m / V), $MachinePrecision] * N[(N[(A * c0$95$m), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0$95$m * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 10^{-322} \lor \neg \left(t\_0 \leq 4 \cdot 10^{+300}\right):\\
\;\;\;\;\sqrt{\frac{c0\_m}{V} \cdot \frac{A \cdot c0\_m}{\ell}}\\

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


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

    1. Initial program 40.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell} \cdot {c0}^{2}}} \]
    7. Taylor expanded in A around 0 34.4%

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

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{{c0}^{2}}{\frac{V}{\frac{A}{\ell}}}}} \]
      4. associate-/r/32.9%

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

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{{c0}^{2}}{\frac{V}{A}}}{\ell}}} \]
    9. Simplified35.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.88131e-323 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e300

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\ell \cdot \color{blue}{\left(\sqrt{-V} \cdot \sqrt{-V}\right)}}}{\sqrt{A}}} \]
      10. add-sqr-sqrt0.0%

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\color{blue}{\left(-V\right) \cdot \ell}}}{\sqrt{A}}} \]
      12. add-sqr-sqrt0.0%

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\color{blue}{\sqrt{\left(-V\right) \cdot \left(-V\right)}} \cdot \ell}}{\sqrt{A}}} \]
      14. sqr-neg12.7%

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\color{blue}{\left(\sqrt{V} \cdot \sqrt{V}\right)} \cdot \ell}}{\sqrt{A}}} \]
      16. add-sqr-sqrt53.1%

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

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

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

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

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

Alternative 5: 85.2% accurate, 0.8× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 4 \cdot 10^{+300}\right):\\ \;\;\;\;\sqrt{\frac{\frac{c0\_m}{V} \cdot \left(A \cdot c0\_m\right)}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0\_m \cdot \sqrt{t\_0}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (*
    c0_s
    (if (or (<= t_0 0.0) (not (<= t_0 4e+300)))
      (sqrt (/ (* (/ c0_m V) (* A c0_m)) l))
      (* c0_m (sqrt t_0))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 4e+300)) {
		tmp = sqrt((((c0_m / V) * (A * c0_m)) / l));
	} else {
		tmp = c0_m * sqrt(t_0);
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+300))) then
        tmp = sqrt((((c0_m / v) * (a * c0_m)) / l))
    else
        tmp = c0_m * sqrt(t_0)
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 4e+300)) {
		tmp = Math.sqrt((((c0_m / V) * (A * c0_m)) / l));
	} else {
		tmp = c0_m * Math.sqrt(t_0);
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if (t_0 <= 0.0) or not (t_0 <= 4e+300):
		tmp = math.sqrt((((c0_m / V) * (A * c0_m)) / l))
	else:
		tmp = c0_m * math.sqrt(t_0)
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if ((t_0 <= 0.0) || !(t_0 <= 4e+300))
		tmp = sqrt(Float64(Float64(Float64(c0_m / V) * Float64(A * c0_m)) / l));
	else
		tmp = Float64(c0_m * sqrt(t_0));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if ((t_0 <= 0.0) || ~((t_0 <= 4e+300)))
		tmp = sqrt((((c0_m / V) * (A * c0_m)) / l));
	else
		tmp = c0_m * sqrt(t_0);
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+300]], $MachinePrecision]], N[Sqrt[N[(N[(N[(c0$95$m / V), $MachinePrecision] * N[(A * c0$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 4 \cdot 10^{+300}\right):\\
\;\;\;\;\sqrt{\frac{\frac{c0\_m}{V} \cdot \left(A \cdot c0\_m\right)}{\ell}}\\

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


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

    1. Initial program 40.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell} \cdot {c0}^{2}}} \]
    7. Taylor expanded in A around 0 34.7%

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

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{{c0}^{2}}{\frac{V}{\frac{A}{\ell}}}}} \]
      4. associate-/r/33.2%

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

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{{c0}^{2}}{\frac{V}{A}}}{\ell}}} \]
    9. Simplified36.2%

      \[\leadsto \sqrt{\color{blue}{\frac{\frac{{c0}^{2}}{\frac{V}{A}}}{\ell}}} \]
    10. Step-by-step derivation
      1. unpow236.2%

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e300

    1. Initial program 99.1%

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

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

Alternative 6: 85.2% accurate, 0.8× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\sqrt{\frac{\frac{c0\_m}{V} \cdot \frac{c0\_m}{\frac{1}{A}}}{\ell}}\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+300}:\\ \;\;\;\;c0\_m \cdot \sqrt{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{c0\_m}{V} \cdot \left(A \cdot c0\_m\right)}{\ell}}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (*
    c0_s
    (if (<= t_0 0.0)
      (sqrt (/ (* (/ c0_m V) (/ c0_m (/ 1.0 A))) l))
      (if (<= t_0 4e+300)
        (* c0_m (sqrt t_0))
        (sqrt (/ (* (/ c0_m V) (* A c0_m)) l)))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = sqrt((((c0_m / V) * (c0_m / (1.0 / A))) / l));
	} else if (t_0 <= 4e+300) {
		tmp = c0_m * sqrt(t_0);
	} else {
		tmp = sqrt((((c0_m / V) * (A * c0_m)) / l));
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 0.0d0) then
        tmp = sqrt((((c0_m / v) * (c0_m / (1.0d0 / a))) / l))
    else if (t_0 <= 4d+300) then
        tmp = c0_m * sqrt(t_0)
    else
        tmp = sqrt((((c0_m / v) * (a * c0_m)) / l))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = Math.sqrt((((c0_m / V) * (c0_m / (1.0 / A))) / l));
	} else if (t_0 <= 4e+300) {
		tmp = c0_m * Math.sqrt(t_0);
	} else {
		tmp = Math.sqrt((((c0_m / V) * (A * c0_m)) / l));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 0.0:
		tmp = math.sqrt((((c0_m / V) * (c0_m / (1.0 / A))) / l))
	elif t_0 <= 4e+300:
		tmp = c0_m * math.sqrt(t_0)
	else:
		tmp = math.sqrt((((c0_m / V) * (A * c0_m)) / l))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = sqrt(Float64(Float64(Float64(c0_m / V) * Float64(c0_m / Float64(1.0 / A))) / l));
	elseif (t_0 <= 4e+300)
		tmp = Float64(c0_m * sqrt(t_0));
	else
		tmp = sqrt(Float64(Float64(Float64(c0_m / V) * Float64(A * c0_m)) / l));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = sqrt((((c0_m / V) * (c0_m / (1.0 / A))) / l));
	elseif (t_0 <= 4e+300)
		tmp = c0_m * sqrt(t_0);
	else
		tmp = sqrt((((c0_m / V) * (A * c0_m)) / l));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m / N[(1.0 / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 4e+300], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(N[(c0$95$m / V), $MachinePrecision] * N[(A * c0$95$m), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{\frac{c0\_m}{V} \cdot \frac{c0\_m}{\frac{1}{A}}}{\ell}}\\

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

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


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

    1. Initial program 35.7%

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot c0\right)}} \]
      6. add-sqr-sqrt35.0%

        \[\leadsto \sqrt{\color{blue}{\frac{A}{V \cdot \ell}} \cdot \left(c0 \cdot c0\right)} \]
      7. pow235.0%

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell} \cdot {c0}^{2}}} \]
    7. Taylor expanded in A around 0 36.6%

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

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{{c0}^{2}}{\frac{V}{\frac{A}{\ell}}}}} \]
      4. associate-/r/36.2%

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

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{{c0}^{2}}{\frac{V}{A}}}{\ell}}} \]
    9. Simplified40.4%

      \[\leadsto \sqrt{\color{blue}{\frac{\frac{{c0}^{2}}{\frac{V}{A}}}{\ell}}} \]
    10. Step-by-step derivation
      1. unpow240.4%

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e300

    1. Initial program 99.1%

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

    if 4.0000000000000002e300 < (/.f64 A (*.f64 V l))

    1. Initial program 46.8%

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(\sqrt{\frac{A}{V \cdot \ell}} \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \cdot \left(c0 \cdot c0\right)}} \]
      6. add-sqr-sqrt27.7%

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

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

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

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

      \[\leadsto \color{blue}{\sqrt{\frac{\frac{A}{V}}{\ell} \cdot {c0}^{2}}} \]
    7. Taylor expanded in A around 0 32.6%

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

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

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

        \[\leadsto \sqrt{\color{blue}{\frac{{c0}^{2}}{\frac{V}{\frac{A}{\ell}}}}} \]
      4. associate-/r/29.8%

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

        \[\leadsto \sqrt{\color{blue}{\frac{\frac{{c0}^{2}}{\frac{V}{A}}}{\ell}}} \]
    9. Simplified31.4%

      \[\leadsto \sqrt{\color{blue}{\frac{\frac{{c0}^{2}}{\frac{V}{A}}}{\ell}}} \]
    10. Step-by-step derivation
      1. unpow231.4%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{\frac{c0}{V} \cdot \left(c0 \cdot {A}^{\color{blue}{1}}\right)}{\ell}} \]
      5. pow143.0%

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

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

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

Alternative 7: 79.7% accurate, 0.8× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-254}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+300}:\\ \;\;\;\;c0\_m \cdot \sqrt{t\_0}\\ \mathbf{else}:\\ \;\;\;\;c0\_m \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (*
    c0_s
    (if (<= t_0 2e-254)
      (* c0_m (sqrt (/ (/ A l) V)))
      (if (<= t_0 4e+300)
        (* c0_m (sqrt t_0))
        (* c0_m (pow (* V (/ l A)) -0.5)))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 2e-254) {
		tmp = c0_m * sqrt(((A / l) / V));
	} else if (t_0 <= 4e+300) {
		tmp = c0_m * sqrt(t_0);
	} else {
		tmp = c0_m * pow((V * (l / A)), -0.5);
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 2d-254) then
        tmp = c0_m * sqrt(((a / l) / v))
    else if (t_0 <= 4d+300) then
        tmp = c0_m * sqrt(t_0)
    else
        tmp = c0_m * ((v * (l / a)) ** (-0.5d0))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 2e-254) {
		tmp = c0_m * Math.sqrt(((A / l) / V));
	} else if (t_0 <= 4e+300) {
		tmp = c0_m * Math.sqrt(t_0);
	} else {
		tmp = c0_m * Math.pow((V * (l / A)), -0.5);
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 2e-254:
		tmp = c0_m * math.sqrt(((A / l) / V))
	elif t_0 <= 4e+300:
		tmp = c0_m * math.sqrt(t_0)
	else:
		tmp = c0_m * math.pow((V * (l / A)), -0.5)
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 2e-254)
		tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V)));
	elseif (t_0 <= 4e+300)
		tmp = Float64(c0_m * sqrt(t_0));
	else
		tmp = Float64(c0_m * (Float64(V * Float64(l / A)) ^ -0.5));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 2e-254)
		tmp = c0_m * sqrt(((A / l) / V));
	elseif (t_0 <= 4e+300)
		tmp = c0_m * sqrt(t_0);
	else
		tmp = c0_m * ((V * (l / A)) ^ -0.5);
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 2e-254], N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+300], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-254}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\

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

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


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

    1. Initial program 45.5%

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

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

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

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

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

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

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

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

    if 1.9999999999999998e-254 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e300

    1. Initial program 99.6%

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

    if 4.0000000000000002e300 < (/.f64 A (*.f64 V l))

    1. Initial program 46.8%

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

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

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}} \]
    7. Step-by-step derivation
      1. clear-num31.1%

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

        \[\leadsto c0 \cdot \frac{1}{\color{blue}{\sqrt{\frac{\ell \cdot \left(-V\right)}{-A}}}} \]
      3. distribute-rgt-neg-out51.5%

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

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

        \[\leadsto c0 \cdot \frac{1}{\color{blue}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}} \]
      6. add-sqr-sqrt27.0%

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

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

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\ell \cdot \color{blue}{\left(\sqrt{-V} \cdot \sqrt{-V}\right)}}}{\sqrt{A}}} \]
      10. add-sqr-sqrt0.1%

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\color{blue}{\left(-V\right) \cdot \ell}}}{\sqrt{A}}} \]
      12. add-sqr-sqrt0.0%

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

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

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\color{blue}{\left(\sqrt{V} \cdot \sqrt{V}\right)} \cdot \ell}}{\sqrt{A}}} \]
      16. add-sqr-sqrt46.6%

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

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

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

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

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

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

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

Alternative 8: 80.0% accurate, 0.8× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 10^{-322}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+300}:\\ \;\;\;\;c0\_m \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;c0\_m \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (*
    c0_s
    (if (<= t_0 1e-322)
      (* c0_m (sqrt (/ (/ A V) l)))
      (if (<= t_0 4e+300)
        (* c0_m (pow (/ (* V l) A) -0.5))
        (* c0_m (pow (* V (/ l A)) -0.5)))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 1e-322) {
		tmp = c0_m * sqrt(((A / V) / l));
	} else if (t_0 <= 4e+300) {
		tmp = c0_m * pow(((V * l) / A), -0.5);
	} else {
		tmp = c0_m * pow((V * (l / A)), -0.5);
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 1d-322) then
        tmp = c0_m * sqrt(((a / v) / l))
    else if (t_0 <= 4d+300) then
        tmp = c0_m * (((v * l) / a) ** (-0.5d0))
    else
        tmp = c0_m * ((v * (l / a)) ** (-0.5d0))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 1e-322) {
		tmp = c0_m * Math.sqrt(((A / V) / l));
	} else if (t_0 <= 4e+300) {
		tmp = c0_m * Math.pow(((V * l) / A), -0.5);
	} else {
		tmp = c0_m * Math.pow((V * (l / A)), -0.5);
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 1e-322:
		tmp = c0_m * math.sqrt(((A / V) / l))
	elif t_0 <= 4e+300:
		tmp = c0_m * math.pow(((V * l) / A), -0.5)
	else:
		tmp = c0_m * math.pow((V * (l / A)), -0.5)
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 1e-322)
		tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l)));
	elseif (t_0 <= 4e+300)
		tmp = Float64(c0_m * (Float64(Float64(V * l) / A) ^ -0.5));
	else
		tmp = Float64(c0_m * (Float64(V * Float64(l / A)) ^ -0.5));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 1e-322)
		tmp = c0_m * sqrt(((A / V) / l));
	elseif (t_0 <= 4e+300)
		tmp = c0_m * (((V * l) / A) ^ -0.5);
	else
		tmp = c0_m * ((V * (l / A)) ^ -0.5);
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 1e-322], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+300], N[(c0$95$m * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 10^{-322}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+300}:\\
\;\;\;\;c0\_m \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\

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


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

    1. Initial program 35.5%

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

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

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

    if 9.88131e-323 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e300

    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\ell \cdot \color{blue}{\left(\sqrt{-V} \cdot \sqrt{-V}\right)}}}{\sqrt{A}}} \]
      10. add-sqr-sqrt0.0%

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\color{blue}{\left(-V\right) \cdot \ell}}}{\sqrt{A}}} \]
      12. add-sqr-sqrt0.0%

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\color{blue}{\sqrt{\left(-V\right) \cdot \left(-V\right)}} \cdot \ell}}{\sqrt{A}}} \]
      14. sqr-neg12.7%

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\color{blue}{\left(\sqrt{V} \cdot \sqrt{V}\right)} \cdot \ell}}{\sqrt{A}}} \]
      16. add-sqr-sqrt53.1%

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

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

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

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

    if 4.0000000000000002e300 < (/.f64 A (*.f64 V l))

    1. Initial program 46.8%

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

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

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

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

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{\frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}} \]
    7. Step-by-step derivation
      1. clear-num31.1%

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

        \[\leadsto c0 \cdot \frac{1}{\color{blue}{\sqrt{\frac{\ell \cdot \left(-V\right)}{-A}}}} \]
      3. distribute-rgt-neg-out51.5%

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

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

        \[\leadsto c0 \cdot \frac{1}{\color{blue}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}} \]
      6. add-sqr-sqrt27.0%

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

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

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\ell \cdot \color{blue}{\left(\sqrt{-V} \cdot \sqrt{-V}\right)}}}{\sqrt{A}}} \]
      10. add-sqr-sqrt0.1%

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\color{blue}{\left(-V\right) \cdot \ell}}}{\sqrt{A}}} \]
      12. add-sqr-sqrt0.0%

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

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

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

        \[\leadsto c0 \cdot \frac{1}{\frac{\sqrt{\color{blue}{\left(\sqrt{V} \cdot \sqrt{V}\right)} \cdot \ell}}{\sqrt{A}}} \]
      16. add-sqr-sqrt46.6%

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

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

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

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

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

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

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

Alternative 9: 79.7% accurate, 0.9× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 4 \cdot 10^{-308} \lor \neg \left(t\_0 \leq 4 \cdot 10^{+300}\right):\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0\_m \cdot \sqrt{t\_0}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (*
    c0_s
    (if (or (<= t_0 4e-308) (not (<= t_0 4e+300)))
      (* c0_m (sqrt (/ (/ A V) l)))
      (* c0_m (sqrt t_0))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 4e-308) || !(t_0 <= 4e+300)) {
		tmp = c0_m * sqrt(((A / V) / l));
	} else {
		tmp = c0_m * sqrt(t_0);
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if ((t_0 <= 4d-308) .or. (.not. (t_0 <= 4d+300))) then
        tmp = c0_m * sqrt(((a / v) / l))
    else
        tmp = c0_m * sqrt(t_0)
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 4e-308) || !(t_0 <= 4e+300)) {
		tmp = c0_m * Math.sqrt(((A / V) / l));
	} else {
		tmp = c0_m * Math.sqrt(t_0);
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if (t_0 <= 4e-308) or not (t_0 <= 4e+300):
		tmp = c0_m * math.sqrt(((A / V) / l))
	else:
		tmp = c0_m * math.sqrt(t_0)
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if ((t_0 <= 4e-308) || !(t_0 <= 4e+300))
		tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l)));
	else
		tmp = Float64(c0_m * sqrt(t_0));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if ((t_0 <= 4e-308) || ~((t_0 <= 4e+300)))
		tmp = c0_m * sqrt(((A / V) / l));
	else
		tmp = c0_m * sqrt(t_0);
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 4e-308], N[Not[LessEqual[t$95$0, 4e+300]], $MachinePrecision]], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-308} \lor \neg \left(t\_0 \leq 4 \cdot 10^{+300}\right):\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

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


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 A (*.f64 V l)) < 4.00000000000000013e-308 or 4.0000000000000002e300 < (/.f64 A (*.f64 V l))

    1. Initial program 41.3%

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

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

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

    if 4.00000000000000013e-308 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e300

    1. Initial program 99.6%

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

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

Alternative 10: 79.2% accurate, 0.9× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-254}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+300}:\\ \;\;\;\;c0\_m \cdot \sqrt{t\_0}\\ \mathbf{else}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (*
    c0_s
    (if (<= t_0 2e-254)
      (* c0_m (sqrt (/ (/ A l) V)))
      (if (<= t_0 4e+300)
        (* c0_m (sqrt t_0))
        (* c0_m (sqrt (/ (/ A V) l))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 2e-254) {
		tmp = c0_m * sqrt(((A / l) / V));
	} else if (t_0 <= 4e+300) {
		tmp = c0_m * sqrt(t_0);
	} else {
		tmp = c0_m * sqrt(((A / V) / l));
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 2d-254) then
        tmp = c0_m * sqrt(((a / l) / v))
    else if (t_0 <= 4d+300) then
        tmp = c0_m * sqrt(t_0)
    else
        tmp = c0_m * sqrt(((a / v) / l))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 2e-254) {
		tmp = c0_m * Math.sqrt(((A / l) / V));
	} else if (t_0 <= 4e+300) {
		tmp = c0_m * Math.sqrt(t_0);
	} else {
		tmp = c0_m * Math.sqrt(((A / V) / l));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 2e-254:
		tmp = c0_m * math.sqrt(((A / l) / V))
	elif t_0 <= 4e+300:
		tmp = c0_m * math.sqrt(t_0)
	else:
		tmp = c0_m * math.sqrt(((A / V) / l))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 2e-254)
		tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V)));
	elseif (t_0 <= 4e+300)
		tmp = Float64(c0_m * sqrt(t_0));
	else
		tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l)));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 2e-254)
		tmp = c0_m * sqrt(((A / l) / V));
	elseif (t_0 <= 4e+300)
		tmp = c0_m * sqrt(t_0);
	else
		tmp = c0_m * sqrt(((A / V) / l));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 2e-254], N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+300], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-254}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\

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

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


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

    1. Initial program 45.5%

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

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

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

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

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

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

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

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

    if 1.9999999999999998e-254 < (/.f64 A (*.f64 V l)) < 4.0000000000000002e300

    1. Initial program 99.6%

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

    if 4.0000000000000002e300 < (/.f64 A (*.f64 V l))

    1. Initial program 46.8%

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

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

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

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

Alternative 11: 79.5% accurate, 0.9× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 2 \cdot 10^{-254}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+288}:\\ \;\;\;\;c0\_m \cdot \sqrt{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0\_m}{\sqrt{\ell \cdot \frac{V}{A}}}\\ \end{array} \end{array} \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (*
    c0_s
    (if (<= t_0 2e-254)
      (* c0_m (sqrt (/ (/ A l) V)))
      (if (<= t_0 5e+288)
        (* c0_m (sqrt t_0))
        (/ c0_m (sqrt (* l (/ V A)))))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 2e-254) {
		tmp = c0_m * sqrt(((A / l) / V));
	} else if (t_0 <= 5e+288) {
		tmp = c0_m * sqrt(t_0);
	} else {
		tmp = c0_m / sqrt((l * (V / A)));
	}
	return c0_s * tmp;
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 2d-254) then
        tmp = c0_m * sqrt(((a / l) / v))
    else if (t_0 <= 5d+288) then
        tmp = c0_m * sqrt(t_0)
    else
        tmp = c0_m / sqrt((l * (v / a)))
    end if
    code = c0_s * tmp
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 2e-254) {
		tmp = c0_m * Math.sqrt(((A / l) / V));
	} else if (t_0 <= 5e+288) {
		tmp = c0_m * Math.sqrt(t_0);
	} else {
		tmp = c0_m / Math.sqrt((l * (V / A)));
	}
	return c0_s * tmp;
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 2e-254:
		tmp = c0_m * math.sqrt(((A / l) / V))
	elif t_0 <= 5e+288:
		tmp = c0_m * math.sqrt(t_0)
	else:
		tmp = c0_m / math.sqrt((l * (V / A)))
	return c0_s * tmp
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 2e-254)
		tmp = Float64(c0_m * sqrt(Float64(Float64(A / l) / V)));
	elseif (t_0 <= 5e+288)
		tmp = Float64(c0_m * sqrt(t_0));
	else
		tmp = Float64(c0_m / sqrt(Float64(l * Float64(V / A))));
	end
	return Float64(c0_s * tmp)
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp_2 = code(c0_s, c0_m, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 2e-254)
		tmp = c0_m * sqrt(((A / l) / V));
	elseif (t_0 <= 5e+288)
		tmp = c0_m * sqrt(t_0);
	else
		tmp = c0_m / sqrt((l * (V / A)));
	end
	tmp_2 = c0_s * tmp;
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 2e-254], N[(c0$95$m * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+288], N[(c0$95$m * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0$95$m / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-254}:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\

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

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


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

    1. Initial program 45.5%

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

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

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

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

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

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

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

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

    if 1.9999999999999998e-254 < (/.f64 A (*.f64 V l)) < 5.0000000000000003e288

    1. Initial program 99.6%

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

    if 5.0000000000000003e288 < (/.f64 A (*.f64 V l))

    1. Initial program 49.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 73.2% accurate, 1.0× speedup?

\[\begin{array}{l} c0\_m = \left|c0\right| \\ c0\_s = \mathsf{copysign}\left(1, c0\right) \\ [c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\ \\ c0\_s \cdot \left(c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\right) \end{array} \]
c0\_m = (fabs.f64 c0)
c0\_s = (copysign.f64 #s(literal 1 binary64) c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0_s c0_m A V l)
 :precision binary64
 (* c0_s (* c0_m (sqrt (/ A (* V l))))))
c0\_m = fabs(c0);
c0\_s = copysign(1.0, c0);
assert(c0_m < A && A < V && V < l);
double code(double c0_s, double c0_m, double A, double V, double l) {
	return c0_s * (c0_m * sqrt((A / (V * l))));
}
c0\_m = abs(c0)
c0\_s = copysign(1.0d0, c0)
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0_s, c0_m, a, v, l)
    real(8), intent (in) :: c0_s
    real(8), intent (in) :: c0_m
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    code = c0_s * (c0_m * sqrt((a / (v * l))))
end function
c0\_m = Math.abs(c0);
c0\_s = Math.copySign(1.0, c0);
assert c0_m < A && A < V && V < l;
public static double code(double c0_s, double c0_m, double A, double V, double l) {
	return c0_s * (c0_m * Math.sqrt((A / (V * l))));
}
c0\_m = math.fabs(c0)
c0\_s = math.copysign(1.0, c0)
[c0_m, A, V, l] = sort([c0_m, A, V, l])
def code(c0_s, c0_m, A, V, l):
	return c0_s * (c0_m * math.sqrt((A / (V * l))))
c0\_m = abs(c0)
c0\_s = copysign(1.0, c0)
c0_m, A, V, l = sort([c0_m, A, V, l])
function code(c0_s, c0_m, A, V, l)
	return Float64(c0_s * Float64(c0_m * sqrt(Float64(A / Float64(V * l)))))
end
c0\_m = abs(c0);
c0\_s = sign(c0) * abs(1.0);
c0_m, A, V, l = num2cell(sort([c0_m, A, V, l])){:}
function tmp = code(c0_s, c0_m, A, V, l)
	tmp = c0_s * (c0_m * sqrt((A / (V * l))));
end
c0\_m = N[Abs[c0], $MachinePrecision]
c0\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[c0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
NOTE: c0_m, A, V, and l should be sorted in increasing order before calling this function.
code[c0$95$s_, c0$95$m_, A_, V_, l_] := N[(c0$95$s * N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
c0\_m = \left|c0\right|
\\
c0\_s = \mathsf{copysign}\left(1, c0\right)
\\
[c0_m, A, V, l] = \mathsf{sort}([c0_m, A, V, l])\\
\\
c0\_s \cdot \left(c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\right)
\end{array}
Derivation
  1. Initial program 73.9%

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

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

Reproduce

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