Henrywood and Agarwal, Equation (3)

Percentage Accurate: 73.7% → 94.0%
Time: 18.7s
Alternatives: 14
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 14 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.7% 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: 94.0% accurate, 0.2× 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}\;A \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\frac{\frac{\sqrt{-A}}{\sqrt{-V}} \cdot c0\_m}{\sqrt{\ell}}\\ \mathbf{elif}\;A \leq 5.2 \cdot 10^{+290}:\\ \;\;\;\;c0\_m \cdot \left(\frac{\sqrt{A}}{\sqrt{V \cdot \sqrt[3]{\ell}}} \cdot \sqrt{{\left(\sqrt[3]{\ell}\right)}^{-2}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\left(A \cdot c0\_m\right) \cdot \frac{c0\_m}{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 (<= A -1e-310)
    (/ (* (/ (sqrt (- A)) (sqrt (- V))) c0_m) (sqrt l))
    (if (<= A 5.2e+290)
      (*
       c0_m
       (* (/ (sqrt A) (sqrt (* V (cbrt l)))) (sqrt (pow (cbrt l) -2.0))))
      (sqrt (/ (* (* A c0_m) (/ c0_m 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 (A <= -1e-310) {
		tmp = ((sqrt(-A) / sqrt(-V)) * c0_m) / sqrt(l);
	} else if (A <= 5.2e+290) {
		tmp = c0_m * ((sqrt(A) / sqrt((V * cbrt(l)))) * sqrt(pow(cbrt(l), -2.0)));
	} else {
		tmp = sqrt((((A * c0_m) * (c0_m / 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 (A <= -1e-310) {
		tmp = ((Math.sqrt(-A) / Math.sqrt(-V)) * c0_m) / Math.sqrt(l);
	} else if (A <= 5.2e+290) {
		tmp = c0_m * ((Math.sqrt(A) / Math.sqrt((V * Math.cbrt(l)))) * Math.sqrt(Math.pow(Math.cbrt(l), -2.0)));
	} else {
		tmp = Math.sqrt((((A * c0_m) * (c0_m / 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 (A <= -1e-310)
		tmp = Float64(Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * c0_m) / sqrt(l));
	elseif (A <= 5.2e+290)
		tmp = Float64(c0_m * Float64(Float64(sqrt(A) / sqrt(Float64(V * cbrt(l)))) * sqrt((cbrt(l) ^ -2.0))));
	else
		tmp = sqrt(Float64(Float64(Float64(A * c0_m) * Float64(c0_m / V)) / l));
	end
	return Float64(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[A, -1e-310], N[(N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * c0$95$m), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 5.2e+290], N[(c0$95$m * N[(N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[Power[N[Power[l, 1/3], $MachinePrecision], -2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(N[(A * c0$95$m), $MachinePrecision] * N[(c0$95$m / V), $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])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;A \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{\sqrt{-A}}{\sqrt{-V}} \cdot c0\_m}{\sqrt{\ell}}\\

\mathbf{elif}\;A \leq 5.2 \cdot 10^{+290}:\\
\;\;\;\;c0\_m \cdot \left(\frac{\sqrt{A}}{\sqrt{V \cdot \sqrt[3]{\ell}}} \cdot \sqrt{{\left(\sqrt[3]{\ell}\right)}^{-2}}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if A < -9.999999999999969e-311

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

    if -9.999999999999969e-311 < A < 5.19999999999999997e290

    1. Initial program 72.1%

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot \frac{\frac{1}{V}}{\sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
      2. associate-/l/72.4%

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

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

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

        \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{\color{blue}{V \cdot \sqrt[3]{\ell}}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}} \]
    6. Simplified72.4%

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

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

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

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

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

        \[\leadsto c0 \cdot \left(\sqrt{\frac{\frac{A}{V}}{\sqrt[3]{\ell}}} \cdot \sqrt{{\left(\sqrt[3]{\ell}\right)}^{\color{blue}{-2}}}\right) \]
    8. Applied egg-rr74.9%

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

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

        \[\leadsto c0 \cdot \left(\color{blue}{\frac{\sqrt{A}}{\sqrt{\sqrt[3]{\ell} \cdot V}}} \cdot \sqrt{{\left(\sqrt[3]{\ell}\right)}^{-2}}\right) \]
    10. Applied egg-rr93.6%

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

    if 5.19999999999999997e290 < A

    1. Initial program 51.7%

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

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

        \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{A \cdot \frac{1}{V}}}{\ell}} \]
      3. add-cube-cbrt51.6%

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot \frac{\frac{1}{V}}{\sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
      2. associate-/l/51.3%

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

        \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{A \cdot 1}{\sqrt[3]{\ell} \cdot V}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}} \]
      4. *-rgt-identity51.6%

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

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V \cdot \sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
    7. Applied egg-rr17.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 85.7% accurate, 0.3× 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 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\sqrt{\frac{\frac{A}{\frac{\ell}{c0\_m}}}{\frac{V}{c0\_m}}}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+274}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{\frac{V}{c0\_m} \cdot \frac{\frac{\ell}{c0\_m}}{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 (* c0_m (sqrt (/ A (* V l))))))
   (*
    c0_s
    (if (<= t_0 0.0)
      (sqrt (/ (/ A (/ l c0_m)) (/ V c0_m)))
      (if (<= t_0 2e+274)
        t_0
        (/ 1.0 (sqrt (* (/ V c0_m) (/ (/ l c0_m) 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 = c0_m * sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = sqrt(((A / (l / c0_m)) / (V / c0_m)));
	} else if (t_0 <= 2e+274) {
		tmp = t_0;
	} else {
		tmp = 1.0 / sqrt(((V / c0_m) * ((l / c0_m) / 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 = c0_m * sqrt((a / (v * l)))
    if (t_0 <= 0.0d0) then
        tmp = sqrt(((a / (l / c0_m)) / (v / c0_m)))
    else if (t_0 <= 2d+274) then
        tmp = t_0
    else
        tmp = 1.0d0 / sqrt(((v / c0_m) * ((l / c0_m) / 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 = c0_m * Math.sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = Math.sqrt(((A / (l / c0_m)) / (V / c0_m)));
	} else if (t_0 <= 2e+274) {
		tmp = t_0;
	} else {
		tmp = 1.0 / Math.sqrt(((V / c0_m) * ((l / c0_m) / 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 = c0_m * math.sqrt((A / (V * l)))
	tmp = 0
	if t_0 <= 0.0:
		tmp = math.sqrt(((A / (l / c0_m)) / (V / c0_m)))
	elif t_0 <= 2e+274:
		tmp = t_0
	else:
		tmp = 1.0 / math.sqrt(((V / c0_m) * ((l / c0_m) / 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(c0_m * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = sqrt(Float64(Float64(A / Float64(l / c0_m)) / Float64(V / c0_m)));
	elseif (t_0 <= 2e+274)
		tmp = t_0;
	else
		tmp = Float64(1.0 / sqrt(Float64(Float64(V / c0_m) * Float64(Float64(l / c0_m) / 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 = c0_m * sqrt((A / (V * l)));
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = sqrt(((A / (l / c0_m)) / (V / c0_m)));
	elseif (t_0 <= 2e+274)
		tmp = t_0;
	else
		tmp = 1.0 / sqrt(((V / c0_m) * ((l / c0_m) / 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[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(N[(A / N[(l / c0$95$m), $MachinePrecision]), $MachinePrecision] / N[(V / c0$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 2e+274], t$95$0, N[(1.0 / N[Sqrt[N[(N[(V / c0$95$m), $MachinePrecision] * N[(N[(l / c0$95$m), $MachinePrecision] / 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 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{\frac{A}{\frac{\ell}{c0\_m}}}{\frac{V}{c0\_m}}}\\

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

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


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

    1. Initial program 69.3%

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot \frac{\frac{1}{V}}{\sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
      2. associate-/l/72.4%

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

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

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

        \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{\color{blue}{V \cdot \sqrt[3]{\ell}}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}} \]
    6. Simplified72.4%

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{A \cdot \color{blue}{\left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}} \]
    12. Step-by-step derivation
      1. *-commutative23.3%

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

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

        \[\leadsto \sqrt{A \cdot \color{blue}{\frac{1 \cdot c0}{\frac{V}{c0} \cdot \ell}}} \]
      4. *-un-lft-identity22.7%

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

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

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

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

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

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

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

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

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

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

    1. Initial program 99.1%

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

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

    1. Initial program 44.2%

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot \frac{\frac{1}{V}}{\sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
      2. associate-/l/44.5%

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

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

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

        \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{\color{blue}{V \cdot \sqrt[3]{\ell}}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}} \]
    6. Simplified44.4%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V \cdot \sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
    7. Applied egg-rr35.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 85.9% accurate, 0.3× 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 := c0\_m \cdot \sqrt{\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^{+278}\right):\\ \;\;\;\;\sqrt{\frac{\frac{A}{\frac{\ell}{c0\_m}}}{\frac{V}{c0\_m}}}\\ \mathbf{else}:\\ \;\;\;\;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 (* c0_m (sqrt (/ A (* V l))))))
   (*
    c0_s
    (if (or (<= t_0 0.0) (not (<= t_0 4e+278)))
      (sqrt (/ (/ A (/ l c0_m)) (/ V c0_m)))
      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 = c0_m * sqrt((A / (V * l)));
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 4e+278)) {
		tmp = sqrt(((A / (l / c0_m)) / (V / c0_m)));
	} else {
		tmp = 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 = c0_m * sqrt((a / (v * l)))
    if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+278))) then
        tmp = sqrt(((a / (l / c0_m)) / (v / c0_m)))
    else
        tmp = 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 = c0_m * Math.sqrt((A / (V * l)));
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 4e+278)) {
		tmp = Math.sqrt(((A / (l / c0_m)) / (V / c0_m)));
	} else {
		tmp = 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 = c0_m * math.sqrt((A / (V * l)))
	tmp = 0
	if (t_0 <= 0.0) or not (t_0 <= 4e+278):
		tmp = math.sqrt(((A / (l / c0_m)) / (V / c0_m)))
	else:
		tmp = 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(c0_m * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if ((t_0 <= 0.0) || !(t_0 <= 4e+278))
		tmp = sqrt(Float64(Float64(A / Float64(l / c0_m)) / Float64(V / c0_m)));
	else
		tmp = 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 = c0_m * sqrt((A / (V * l)));
	tmp = 0.0;
	if ((t_0 <= 0.0) || ~((t_0 <= 4e+278)))
		tmp = sqrt(((A / (l / c0_m)) / (V / c0_m)));
	else
		tmp = 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[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+278]], $MachinePrecision]], N[Sqrt[N[(N[(A / N[(l / c0$95$m), $MachinePrecision]), $MachinePrecision] / N[(V / c0$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]), $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 := c0\_m \cdot \sqrt{\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^{+278}\right):\\
\;\;\;\;\sqrt{\frac{\frac{A}{\frac{\ell}{c0\_m}}}{\frac{V}{c0\_m}}}\\

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


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

    1. Initial program 66.0%

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot \frac{\frac{1}{V}}{\sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
      2. associate-/l/68.7%

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

        \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{A \cdot 1}{\sqrt[3]{\ell} \cdot V}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}} \]
      4. *-rgt-identity68.7%

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

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V \cdot \sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
    7. Applied egg-rr19.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sqrt{A \cdot \color{blue}{\frac{1 \cdot c0}{\frac{V}{c0} \cdot \ell}}} \]
      4. *-un-lft-identity27.6%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{\color{blue}{\frac{A}{\frac{\ell}{c0}}}}{\frac{V}{c0}}} \]
    15. Applied egg-rr29.0%

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999985e278

    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 simplification46.8%

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

Alternative 4: 86.2% accurate, 0.3× 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 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+303}\right):\\ \;\;\;\;\sqrt{A \cdot \left(\frac{c0\_m}{V} \cdot \frac{c0\_m}{\ell}\right)}\\ \mathbf{else}:\\ \;\;\;\;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 (* c0_m (sqrt (/ A (* V l))))))
   (*
    c0_s
    (if (or (<= t_0 0.0) (not (<= t_0 5e+303)))
      (sqrt (* A (* (/ c0_m V) (/ c0_m l))))
      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 = c0_m * sqrt((A / (V * l)));
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 5e+303)) {
		tmp = sqrt((A * ((c0_m / V) * (c0_m / l))));
	} else {
		tmp = 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 = c0_m * sqrt((a / (v * l)))
    if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+303))) then
        tmp = sqrt((a * ((c0_m / v) * (c0_m / l))))
    else
        tmp = 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 = c0_m * Math.sqrt((A / (V * l)));
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 5e+303)) {
		tmp = Math.sqrt((A * ((c0_m / V) * (c0_m / l))));
	} else {
		tmp = 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 = c0_m * math.sqrt((A / (V * l)))
	tmp = 0
	if (t_0 <= 0.0) or not (t_0 <= 5e+303):
		tmp = math.sqrt((A * ((c0_m / V) * (c0_m / l))))
	else:
		tmp = 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(c0_m * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if ((t_0 <= 0.0) || !(t_0 <= 5e+303))
		tmp = sqrt(Float64(A * Float64(Float64(c0_m / V) * Float64(c0_m / l))));
	else
		tmp = 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 = c0_m * sqrt((A / (V * l)));
	tmp = 0.0;
	if ((t_0 <= 0.0) || ~((t_0 <= 5e+303)))
		tmp = sqrt((A * ((c0_m / V) * (c0_m / l))));
	else
		tmp = 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[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+303]], $MachinePrecision]], N[Sqrt[N[(A * N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]), $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 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+303}\right):\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0\_m}{V} \cdot \frac{c0\_m}{\ell}\right)}\\

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


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

    1. Initial program 65.8%

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot \frac{\frac{1}{V}}{\sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
      2. associate-/l/69.0%

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

        \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{A \cdot 1}{\sqrt[3]{\ell} \cdot V}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}} \]
      4. *-rgt-identity69.0%

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

        \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{\color{blue}{V \cdot \sqrt[3]{\ell}}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}} \]
    6. Simplified69.0%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V \cdot \sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
    7. Applied egg-rr19.6%

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

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

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

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

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

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

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

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

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

    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 simplification46.5%

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

Alternative 5: 83.8% accurate, 0.3× 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 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\sqrt{\frac{\left(A \cdot c0\_m\right) \cdot \frac{c0\_m}{V}}{\ell}}\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+278}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{A \cdot c0\_m}{\ell \cdot \frac{V}{c0\_m}}}\\ \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 (* c0_m (sqrt (/ A (* V l))))))
   (*
    c0_s
    (if (<= t_0 0.0)
      (sqrt (/ (* (* A c0_m) (/ c0_m V)) l))
      (if (<= t_0 4e+278) t_0 (sqrt (/ (* A c0_m) (* l (/ V c0_m)))))))))
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 = c0_m * sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = sqrt((((A * c0_m) * (c0_m / V)) / l));
	} else if (t_0 <= 4e+278) {
		tmp = t_0;
	} else {
		tmp = sqrt(((A * c0_m) / (l * (V / c0_m))));
	}
	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 = c0_m * sqrt((a / (v * l)))
    if (t_0 <= 0.0d0) then
        tmp = sqrt((((a * c0_m) * (c0_m / v)) / l))
    else if (t_0 <= 4d+278) then
        tmp = t_0
    else
        tmp = sqrt(((a * c0_m) / (l * (v / c0_m))))
    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 = c0_m * Math.sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = Math.sqrt((((A * c0_m) * (c0_m / V)) / l));
	} else if (t_0 <= 4e+278) {
		tmp = t_0;
	} else {
		tmp = Math.sqrt(((A * c0_m) / (l * (V / c0_m))));
	}
	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 = c0_m * math.sqrt((A / (V * l)))
	tmp = 0
	if t_0 <= 0.0:
		tmp = math.sqrt((((A * c0_m) * (c0_m / V)) / l))
	elif t_0 <= 4e+278:
		tmp = t_0
	else:
		tmp = math.sqrt(((A * c0_m) / (l * (V / c0_m))))
	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(c0_m * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = sqrt(Float64(Float64(Float64(A * c0_m) * Float64(c0_m / V)) / l));
	elseif (t_0 <= 4e+278)
		tmp = t_0;
	else
		tmp = sqrt(Float64(Float64(A * c0_m) / Float64(l * Float64(V / c0_m))));
	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 = c0_m * sqrt((A / (V * l)));
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = sqrt((((A * c0_m) * (c0_m / V)) / l));
	elseif (t_0 <= 4e+278)
		tmp = t_0;
	else
		tmp = sqrt(((A * c0_m) / (l * (V / c0_m))));
	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[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(N[(N[(A * c0$95$m), $MachinePrecision] * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 4e+278], t$95$0, N[Sqrt[N[(N[(A * c0$95$m), $MachinePrecision] / N[(l * N[(V / c0$95$m), $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 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{\left(A \cdot c0\_m\right) \cdot \frac{c0\_m}{V}}{\ell}}\\

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

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


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

    1. Initial program 69.3%

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot \frac{\frac{1}{V}}{\sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
      2. associate-/l/72.4%

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

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

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

        \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{\color{blue}{V \cdot \sqrt[3]{\ell}}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}} \]
    6. Simplified72.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999985e278

    1. Initial program 99.1%

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

    if 3.99999999999999985e278 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 41.7%

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot \frac{\frac{1}{V}}{\sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
      2. associate-/l/42.1%

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

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

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

        \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{\color{blue}{V \cdot \sqrt[3]{\ell}}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}} \]
    6. Simplified42.1%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V \cdot \sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
    7. Applied egg-rr37.0%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(A \cdot c0\right) \cdot \frac{c0}{V \cdot \ell}}} \]
      2. clear-num49.8%

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

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

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

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

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

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

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

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

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

Alternative 6: 84.2% accurate, 0.3× 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 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\sqrt{A \cdot \left(\frac{c0\_m}{V} \cdot \frac{c0\_m}{\ell}\right)}\\ \mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+278}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{A \cdot c0\_m}{\ell \cdot \frac{V}{c0\_m}}}\\ \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 (* c0_m (sqrt (/ A (* V l))))))
   (*
    c0_s
    (if (<= t_0 0.0)
      (sqrt (* A (* (/ c0_m V) (/ c0_m l))))
      (if (<= t_0 4e+278) t_0 (sqrt (/ (* A c0_m) (* l (/ V c0_m)))))))))
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 = c0_m * sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = sqrt((A * ((c0_m / V) * (c0_m / l))));
	} else if (t_0 <= 4e+278) {
		tmp = t_0;
	} else {
		tmp = sqrt(((A * c0_m) / (l * (V / c0_m))));
	}
	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 = c0_m * sqrt((a / (v * l)))
    if (t_0 <= 0.0d0) then
        tmp = sqrt((a * ((c0_m / v) * (c0_m / l))))
    else if (t_0 <= 4d+278) then
        tmp = t_0
    else
        tmp = sqrt(((a * c0_m) / (l * (v / c0_m))))
    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 = c0_m * Math.sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = Math.sqrt((A * ((c0_m / V) * (c0_m / l))));
	} else if (t_0 <= 4e+278) {
		tmp = t_0;
	} else {
		tmp = Math.sqrt(((A * c0_m) / (l * (V / c0_m))));
	}
	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 = c0_m * math.sqrt((A / (V * l)))
	tmp = 0
	if t_0 <= 0.0:
		tmp = math.sqrt((A * ((c0_m / V) * (c0_m / l))))
	elif t_0 <= 4e+278:
		tmp = t_0
	else:
		tmp = math.sqrt(((A * c0_m) / (l * (V / c0_m))))
	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(c0_m * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = sqrt(Float64(A * Float64(Float64(c0_m / V) * Float64(c0_m / l))));
	elseif (t_0 <= 4e+278)
		tmp = t_0;
	else
		tmp = sqrt(Float64(Float64(A * c0_m) / Float64(l * Float64(V / c0_m))));
	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 = c0_m * sqrt((A / (V * l)));
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = sqrt((A * ((c0_m / V) * (c0_m / l))));
	elseif (t_0 <= 4e+278)
		tmp = t_0;
	else
		tmp = sqrt(((A * c0_m) / (l * (V / c0_m))));
	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[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(A * N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 4e+278], t$95$0, N[Sqrt[N[(N[(A * c0$95$m), $MachinePrecision] / N[(l * N[(V / c0$95$m), $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 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0\_m}{V} \cdot \frac{c0\_m}{\ell}\right)}\\

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

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


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

    1. Initial program 69.3%

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot \frac{\frac{1}{V}}{\sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
      2. associate-/l/72.4%

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

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

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

        \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{\color{blue}{V \cdot \sqrt[3]{\ell}}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}} \]
    6. Simplified72.4%

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999985e278

    1. Initial program 99.1%

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

    if 3.99999999999999985e278 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 41.7%

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot \frac{\frac{1}{V}}{\sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
      2. associate-/l/42.1%

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

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

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

        \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{\color{blue}{V \cdot \sqrt[3]{\ell}}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}} \]
    6. Simplified42.1%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V \cdot \sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
    7. Applied egg-rr37.0%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{\left(A \cdot c0\right) \cdot \frac{c0}{V \cdot \ell}}} \]
      2. clear-num49.8%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 84.8% accurate, 0.3× 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 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\sqrt{A \cdot \left(\frac{c0\_m}{V} \cdot \frac{c0\_m}{\ell}\right)}\\ \mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+284}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\sqrt{A \cdot \frac{c0\_m}{\ell \cdot \frac{V}{c0\_m}}}\\ \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 (* c0_m (sqrt (/ A (* V l))))))
   (*
    c0_s
    (if (<= t_0 0.0)
      (sqrt (* A (* (/ c0_m V) (/ c0_m l))))
      (if (<= t_0 2e+284) t_0 (sqrt (* A (/ c0_m (* l (/ V c0_m))))))))))
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 = c0_m * sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = sqrt((A * ((c0_m / V) * (c0_m / l))));
	} else if (t_0 <= 2e+284) {
		tmp = t_0;
	} else {
		tmp = sqrt((A * (c0_m / (l * (V / c0_m)))));
	}
	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 = c0_m * sqrt((a / (v * l)))
    if (t_0 <= 0.0d0) then
        tmp = sqrt((a * ((c0_m / v) * (c0_m / l))))
    else if (t_0 <= 2d+284) then
        tmp = t_0
    else
        tmp = sqrt((a * (c0_m / (l * (v / c0_m)))))
    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 = c0_m * Math.sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = Math.sqrt((A * ((c0_m / V) * (c0_m / l))));
	} else if (t_0 <= 2e+284) {
		tmp = t_0;
	} else {
		tmp = Math.sqrt((A * (c0_m / (l * (V / c0_m)))));
	}
	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 = c0_m * math.sqrt((A / (V * l)))
	tmp = 0
	if t_0 <= 0.0:
		tmp = math.sqrt((A * ((c0_m / V) * (c0_m / l))))
	elif t_0 <= 2e+284:
		tmp = t_0
	else:
		tmp = math.sqrt((A * (c0_m / (l * (V / c0_m)))))
	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(c0_m * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = sqrt(Float64(A * Float64(Float64(c0_m / V) * Float64(c0_m / l))));
	elseif (t_0 <= 2e+284)
		tmp = t_0;
	else
		tmp = sqrt(Float64(A * Float64(c0_m / Float64(l * Float64(V / c0_m)))));
	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 = c0_m * sqrt((A / (V * l)));
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = sqrt((A * ((c0_m / V) * (c0_m / l))));
	elseif (t_0 <= 2e+284)
		tmp = t_0;
	else
		tmp = sqrt((A * (c0_m / (l * (V / c0_m)))));
	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[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(A * N[(N[(c0$95$m / V), $MachinePrecision] * N[(c0$95$m / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 2e+284], t$95$0, N[Sqrt[N[(A * N[(c0$95$m / N[(l * N[(V / c0$95$m), $MachinePrecision]), $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 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0\_m}{V} \cdot \frac{c0\_m}{\ell}\right)}\\

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

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


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

    1. Initial program 69.3%

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot \frac{\frac{1}{V}}{\sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
      2. associate-/l/72.4%

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

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

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

        \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{\color{blue}{V \cdot \sqrt[3]{\ell}}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}} \]
    6. Simplified72.4%

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000016e284

    1. Initial program 99.1%

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

    if 2.00000000000000016e284 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 41.7%

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot \frac{\frac{1}{V}}{\sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
      2. associate-/l/42.1%

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

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

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

        \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{\color{blue}{V \cdot \sqrt[3]{\ell}}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}} \]
    6. Simplified42.1%

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V \cdot \sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
    7. Applied egg-rr37.0%

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

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

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

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

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

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

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

      \[\leadsto \sqrt{A \cdot \color{blue}{\left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}} \]
    12. Step-by-step derivation
      1. *-commutative63.3%

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

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

        \[\leadsto \sqrt{A \cdot \color{blue}{\frac{1 \cdot c0}{\frac{V}{c0} \cdot \ell}}} \]
      4. *-un-lft-identity63.1%

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

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

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

Alternative 8: 79.2% accurate, 0.3× 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 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 2.5 \cdot 10^{+212}\right):\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;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 (* c0_m (sqrt (/ A (* V l))))))
   (*
    c0_s
    (if (or (<= t_0 0.0) (not (<= t_0 2.5e+212)))
      (* c0_m (sqrt (/ (/ A V) l)))
      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 = c0_m * sqrt((A / (V * l)));
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 2.5e+212)) {
		tmp = c0_m * sqrt(((A / V) / l));
	} else {
		tmp = 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 = c0_m * sqrt((a / (v * l)))
    if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 2.5d+212))) then
        tmp = c0_m * sqrt(((a / v) / l))
    else
        tmp = 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 = c0_m * Math.sqrt((A / (V * l)));
	double tmp;
	if ((t_0 <= 0.0) || !(t_0 <= 2.5e+212)) {
		tmp = c0_m * Math.sqrt(((A / V) / l));
	} else {
		tmp = 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 = c0_m * math.sqrt((A / (V * l)))
	tmp = 0
	if (t_0 <= 0.0) or not (t_0 <= 2.5e+212):
		tmp = c0_m * math.sqrt(((A / V) / l))
	else:
		tmp = 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(c0_m * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if ((t_0 <= 0.0) || !(t_0 <= 2.5e+212))
		tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l)));
	else
		tmp = 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 = c0_m * sqrt((A / (V * l)));
	tmp = 0.0;
	if ((t_0 <= 0.0) || ~((t_0 <= 2.5e+212)))
		tmp = c0_m * sqrt(((A / V) / l));
	else
		tmp = 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[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 2.5e+212]], $MachinePrecision]], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]), $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 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 2.5 \cdot 10^{+212}\right):\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

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


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

    1. Initial program 66.7%

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

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

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.49999999999999996e212

    1. Initial program 99.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 0 \lor \neg \left(c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 2.5 \cdot 10^{+212}\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 9: 78.4% accurate, 0.3× 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 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;\sqrt{A \cdot \left(c0\_m \cdot \frac{c0\_m}{V \cdot \ell}\right)}\\ \mathbf{elif}\;t\_0 \leq 10^{+185}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{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 (* c0_m (sqrt (/ A (* V l))))))
   (*
    c0_s
    (if (<= t_0 0.0)
      (sqrt (* A (* c0_m (/ c0_m (* V l)))))
      (if (<= t_0 1e+185) t_0 (/ c0_m (sqrt (* V (/ l 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 = c0_m * sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = sqrt((A * (c0_m * (c0_m / (V * l)))));
	} else if (t_0 <= 1e+185) {
		tmp = t_0;
	} else {
		tmp = c0_m / sqrt((V * (l / 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 = c0_m * sqrt((a / (v * l)))
    if (t_0 <= 0.0d0) then
        tmp = sqrt((a * (c0_m * (c0_m / (v * l)))))
    else if (t_0 <= 1d+185) then
        tmp = t_0
    else
        tmp = c0_m / sqrt((v * (l / 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 = c0_m * Math.sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = Math.sqrt((A * (c0_m * (c0_m / (V * l)))));
	} else if (t_0 <= 1e+185) {
		tmp = t_0;
	} else {
		tmp = c0_m / Math.sqrt((V * (l / 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 = c0_m * math.sqrt((A / (V * l)))
	tmp = 0
	if t_0 <= 0.0:
		tmp = math.sqrt((A * (c0_m * (c0_m / (V * l)))))
	elif t_0 <= 1e+185:
		tmp = t_0
	else:
		tmp = c0_m / math.sqrt((V * (l / 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(c0_m * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = sqrt(Float64(A * Float64(c0_m * Float64(c0_m / Float64(V * l)))));
	elseif (t_0 <= 1e+185)
		tmp = t_0;
	else
		tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / 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 = c0_m * sqrt((A / (V * l)));
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = sqrt((A * (c0_m * (c0_m / (V * l)))));
	elseif (t_0 <= 1e+185)
		tmp = t_0;
	else
		tmp = c0_m / sqrt((V * (l / 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[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(A * N[(c0$95$m * N[(c0$95$m / N[(V * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 1e+185], t$95$0, N[(c0$95$m / N[Sqrt[N[(V * N[(l / 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 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\sqrt{A \cdot \left(c0\_m \cdot \frac{c0\_m}{V \cdot \ell}\right)}\\

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

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


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

    1. Initial program 69.3%

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot \frac{\frac{1}{V}}{\sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
      2. associate-/l/72.4%

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

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

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

        \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{\color{blue}{V \cdot \sqrt[3]{\ell}}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}} \]
    6. Simplified72.4%

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999998e184

    1. Initial program 99.1%

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

    if 9.9999999999999998e184 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 56.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 79.2% accurate, 0.3× 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 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq 0:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t\_0 \leq 10^{+185}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0\_m}{\sqrt{V \cdot \frac{\ell}{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 (* c0_m (sqrt (/ A (* V l))))))
   (*
    c0_s
    (if (<= t_0 0.0)
      (* c0_m (sqrt (/ (/ A V) l)))
      (if (<= t_0 1e+185) t_0 (/ c0_m (sqrt (* V (/ l 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 = c0_m * sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0_m * sqrt(((A / V) / l));
	} else if (t_0 <= 1e+185) {
		tmp = t_0;
	} else {
		tmp = c0_m / sqrt((V * (l / 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 = c0_m * sqrt((a / (v * l)))
    if (t_0 <= 0.0d0) then
        tmp = c0_m * sqrt(((a / v) / l))
    else if (t_0 <= 1d+185) then
        tmp = t_0
    else
        tmp = c0_m / sqrt((v * (l / 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 = c0_m * Math.sqrt((A / (V * l)));
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0_m * Math.sqrt(((A / V) / l));
	} else if (t_0 <= 1e+185) {
		tmp = t_0;
	} else {
		tmp = c0_m / Math.sqrt((V * (l / 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 = c0_m * math.sqrt((A / (V * l)))
	tmp = 0
	if t_0 <= 0.0:
		tmp = c0_m * math.sqrt(((A / V) / l))
	elif t_0 <= 1e+185:
		tmp = t_0
	else:
		tmp = c0_m / math.sqrt((V * (l / 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(c0_m * sqrt(Float64(A / Float64(V * l))))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(c0_m * sqrt(Float64(Float64(A / V) / l)));
	elseif (t_0 <= 1e+185)
		tmp = t_0;
	else
		tmp = Float64(c0_m / sqrt(Float64(V * Float64(l / 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 = c0_m * sqrt((A / (V * l)));
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = c0_m * sqrt(((A / V) / l));
	elseif (t_0 <= 1e+185)
		tmp = t_0;
	else
		tmp = c0_m / sqrt((V * (l / 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[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(c0$95$s * If[LessEqual[t$95$0, 0.0], N[(c0$95$m * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+185], t$95$0, N[(c0$95$m / N[Sqrt[N[(V * N[(l / 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 := c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0\_m \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

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

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


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

    1. Initial program 69.3%

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

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

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

    if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999998e184

    1. Initial program 99.1%

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

    if 9.9999999999999998e184 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l))))

    1. Initial program 56.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 86.1% accurate, 0.3× 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 \leq -9 \cdot 10^{-297}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\ \mathbf{else}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{\ell} \cdot \sqrt{V}}\\ \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 -9e-297)
    (* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
    (* c0_m (/ (sqrt A) (* (sqrt l) (sqrt V)))))))
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 <= -9e-297) {
		tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
	} else {
		tmp = c0_m * (sqrt(A) / (sqrt(l) * sqrt(V)));
	}
	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) :: tmp
    if (v <= (-9d-297)) then
        tmp = c0_m * (sqrt((a / -l)) / sqrt(-v))
    else
        tmp = c0_m * (sqrt(a) / (sqrt(l) * sqrt(v)))
    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 tmp;
	if (V <= -9e-297) {
		tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
	} else {
		tmp = c0_m * (Math.sqrt(A) / (Math.sqrt(l) * Math.sqrt(V)));
	}
	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 <= -9e-297:
		tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V))
	else:
		tmp = c0_m * (math.sqrt(A) / (math.sqrt(l) * math.sqrt(V)))
	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 (V <= -9e-297)
		tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V))));
	else
		tmp = Float64(c0_m * Float64(sqrt(A) / Float64(sqrt(l) * sqrt(V))));
	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 <= -9e-297)
		tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
	else
		tmp = c0_m * (sqrt(A) / (sqrt(l) * sqrt(V)));
	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[V, -9e-297], N[(c0$95$m * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[V], $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 \begin{array}{l}
\mathbf{if}\;V \leq -9 \cdot 10^{-297}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\

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


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

    1. Initial program 76.2%

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.99999999999999951e-297 < V

    1. Initial program 72.5%

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot \frac{\frac{1}{V}}{\sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
      2. associate-/l/75.4%

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

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

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

        \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{\color{blue}{V \cdot \sqrt[3]{\ell}}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}} \]
    6. Simplified75.4%

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

        \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{\frac{A}{V}}{\sqrt[3]{\ell}}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}} \]
      2. associate-/l/73.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \color{blue}{\frac{1 \cdot \sqrt{A}}{\sqrt{\ell} \cdot \sqrt{V}}} \]
      12. *-un-lft-identity56.0%

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

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

Alternative 12: 90.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])\\ \\ c0\_s \cdot \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -\infty:\\ \;\;\;\;\sqrt{A \cdot \frac{c0\_m \cdot \frac{c0\_m}{V}}{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-300}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 0:\\ \;\;\;\;\frac{1}{\sqrt{\frac{V}{c0\_m} \cdot \frac{\frac{\ell}{c0\_m}}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+209}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{\frac{A}{\frac{\ell}{c0\_m}}}{\frac{V}{c0\_m}}}\\ \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 (/ (* c0_m (/ c0_m V)) l)))
    (if (<= (* V l) -5e-300)
      (* c0_m (/ (sqrt (- A)) (sqrt (* V (- l)))))
      (if (<= (* V l) 0.0)
        (/ 1.0 (sqrt (* (/ V c0_m) (/ (/ l c0_m) A))))
        (if (<= (* V l) 5e+209)
          (* c0_m (/ (sqrt A) (sqrt (* V l))))
          (sqrt (/ (/ A (/ l c0_m)) (/ V c0_m)))))))))
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 * ((c0_m * (c0_m / V)) / l)));
	} else if ((V * l) <= -5e-300) {
		tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
	} else if ((V * l) <= 0.0) {
		tmp = 1.0 / sqrt(((V / c0_m) * ((l / c0_m) / A)));
	} else if ((V * l) <= 5e+209) {
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	} else {
		tmp = sqrt(((A / (l / c0_m)) / (V / c0_m)));
	}
	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 * ((c0_m * (c0_m / V)) / l)));
	} else if ((V * l) <= -5e-300) {
		tmp = c0_m * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if ((V * l) <= 0.0) {
		tmp = 1.0 / Math.sqrt(((V / c0_m) * ((l / c0_m) / A)));
	} else if ((V * l) <= 5e+209) {
		tmp = c0_m * (Math.sqrt(A) / Math.sqrt((V * l)));
	} else {
		tmp = Math.sqrt(((A / (l / c0_m)) / (V / c0_m)));
	}
	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 * ((c0_m * (c0_m / V)) / l)))
	elif (V * l) <= -5e-300:
		tmp = c0_m * (math.sqrt(-A) / math.sqrt((V * -l)))
	elif (V * l) <= 0.0:
		tmp = 1.0 / math.sqrt(((V / c0_m) * ((l / c0_m) / A)))
	elif (V * l) <= 5e+209:
		tmp = c0_m * (math.sqrt(A) / math.sqrt((V * l)))
	else:
		tmp = math.sqrt(((A / (l / c0_m)) / (V / c0_m)))
	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 = sqrt(Float64(A * Float64(Float64(c0_m * Float64(c0_m / V)) / l)));
	elseif (Float64(V * l) <= -5e-300)
		tmp = Float64(c0_m * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif (Float64(V * l) <= 0.0)
		tmp = Float64(1.0 / sqrt(Float64(Float64(V / c0_m) * Float64(Float64(l / c0_m) / A))));
	elseif (Float64(V * l) <= 5e+209)
		tmp = Float64(c0_m * Float64(sqrt(A) / sqrt(Float64(V * l))));
	else
		tmp = sqrt(Float64(Float64(A / Float64(l / c0_m)) / Float64(V / c0_m)));
	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 * ((c0_m * (c0_m / V)) / l)));
	elseif ((V * l) <= -5e-300)
		tmp = c0_m * (sqrt(-A) / sqrt((V * -l)));
	elseif ((V * l) <= 0.0)
		tmp = 1.0 / sqrt(((V / c0_m) * ((l / c0_m) / A)));
	elseif ((V * l) <= 5e+209)
		tmp = c0_m * (sqrt(A) / sqrt((V * l)));
	else
		tmp = sqrt(((A / (l / c0_m)) / (V / c0_m)));
	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[Sqrt[N[(A * N[(N[(c0$95$m * N[(c0$95$m / V), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-300], 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[(1.0 / N[Sqrt[N[(N[(V / c0$95$m), $MachinePrecision] * N[(N[(l / c0$95$m), $MachinePrecision] / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+209], N[(c0$95$m * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A / N[(l / c0$95$m), $MachinePrecision]), $MachinePrecision] / N[(V / c0$95$m), $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:\\
\;\;\;\;\sqrt{A \cdot \frac{c0\_m \cdot \frac{c0\_m}{V}}{\ell}}\\

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

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

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

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


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

    1. Initial program 36.5%

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

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

        \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{A \cdot \frac{1}{V}}}{\ell}} \]
      3. add-cube-cbrt55.6%

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot \frac{\frac{1}{V}}{\sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
      2. associate-/l/49.4%

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

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

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

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V \cdot \sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
    7. Applied egg-rr35.0%

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

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

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

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 V l) < -4.99999999999999996e-300

    1. Initial program 92.5%

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

        \[\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 -4.99999999999999996e-300 < (*.f64 V l) < 0.0

    1. Initial program 32.2%

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot \frac{\frac{1}{V}}{\sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
      2. associate-/l/48.9%

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

        \[\leadsto c0 \cdot \sqrt{\frac{\color{blue}{\frac{A \cdot 1}{\sqrt[3]{\ell} \cdot V}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}} \]
      4. *-rgt-identity49.0%

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

        \[\leadsto c0 \cdot \sqrt{\frac{\frac{A}{\color{blue}{V \cdot \sqrt[3]{\ell}}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}} \]
    6. Simplified49.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sqrt{\color{blue}{\frac{A \cdot c0}{\frac{V \cdot \ell}{c0}}}} \]
    14. Step-by-step derivation
      1. clear-num9.1%

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

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

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

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

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

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

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

    if 0.0 < (*.f64 V l) < 4.99999999999999964e209

    1. Initial program 83.2%

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

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

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

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

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

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

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

    if 4.99999999999999964e209 < (*.f64 V l)

    1. Initial program 56.3%

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

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

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

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

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

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

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

        \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{A \cdot \frac{\frac{1}{V}}{\sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
      2. associate-/l/62.3%

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

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

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

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

      \[\leadsto c0 \cdot \sqrt{\color{blue}{\frac{\frac{A}{V \cdot \sqrt[3]{\ell}}}{{\left(\sqrt[3]{\ell}\right)}^{2}}}} \]
    7. Applied egg-rr34.0%

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

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

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

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

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

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

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

      \[\leadsto \sqrt{A \cdot \color{blue}{\left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}} \]
    12. Step-by-step derivation
      1. *-commutative53.3%

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

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

        \[\leadsto \sqrt{A \cdot \color{blue}{\frac{1 \cdot c0}{\frac{V}{c0} \cdot \ell}}} \]
      4. *-un-lft-identity53.3%

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

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

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

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

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

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

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

        \[\leadsto \sqrt{\frac{\color{blue}{\frac{A}{\frac{\ell}{c0}}}}{\frac{V}{c0}}} \]
    15. Applied egg-rr59.5%

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

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

Alternative 13: 84.1% 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 \leq -4 \cdot 10^{-310}:\\ \;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\ \mathbf{elif}\;V \leq 10^{-288}:\\ \;\;\;\;c0\_m \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{elif}\;V \leq 9 \cdot 10^{-214}:\\ \;\;\;\;\frac{c0\_m}{\sqrt{V} \cdot \sqrt{\frac{\ell}{A}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0\_m}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\ \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 -4e-310)
    (* c0_m (/ (sqrt (/ A (- l))) (sqrt (- V))))
    (if (<= V 1e-288)
      (* c0_m (sqrt (/ A (* V l))))
      (if (<= V 9e-214)
        (/ c0_m (* (sqrt V) (sqrt (/ l A))))
        (/ c0_m (* (sqrt l) (sqrt (/ 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 tmp;
	if (V <= -4e-310) {
		tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
	} else if (V <= 1e-288) {
		tmp = c0_m * sqrt((A / (V * l)));
	} else if (V <= 9e-214) {
		tmp = c0_m / (sqrt(V) * sqrt((l / A)));
	} else {
		tmp = c0_m / (sqrt(l) * sqrt((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) :: tmp
    if (v <= (-4d-310)) then
        tmp = c0_m * (sqrt((a / -l)) / sqrt(-v))
    else if (v <= 1d-288) then
        tmp = c0_m * sqrt((a / (v * l)))
    else if (v <= 9d-214) then
        tmp = c0_m / (sqrt(v) * sqrt((l / a)))
    else
        tmp = c0_m / (sqrt(l) * sqrt((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 tmp;
	if (V <= -4e-310) {
		tmp = c0_m * (Math.sqrt((A / -l)) / Math.sqrt(-V));
	} else if (V <= 1e-288) {
		tmp = c0_m * Math.sqrt((A / (V * l)));
	} else if (V <= 9e-214) {
		tmp = c0_m / (Math.sqrt(V) * Math.sqrt((l / A)));
	} else {
		tmp = c0_m / (Math.sqrt(l) * Math.sqrt((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):
	tmp = 0
	if V <= -4e-310:
		tmp = c0_m * (math.sqrt((A / -l)) / math.sqrt(-V))
	elif V <= 1e-288:
		tmp = c0_m * math.sqrt((A / (V * l)))
	elif V <= 9e-214:
		tmp = c0_m / (math.sqrt(V) * math.sqrt((l / A)))
	else:
		tmp = c0_m / (math.sqrt(l) * math.sqrt((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)
	tmp = 0.0
	if (V <= -4e-310)
		tmp = Float64(c0_m * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V))));
	elseif (V <= 1e-288)
		tmp = Float64(c0_m * sqrt(Float64(A / Float64(V * l))));
	elseif (V <= 9e-214)
		tmp = Float64(c0_m / Float64(sqrt(V) * sqrt(Float64(l / A))));
	else
		tmp = Float64(c0_m / Float64(sqrt(l) * sqrt(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)
	tmp = 0.0;
	if (V <= -4e-310)
		tmp = c0_m * (sqrt((A / -l)) / sqrt(-V));
	elseif (V <= 1e-288)
		tmp = c0_m * sqrt((A / (V * l)));
	elseif (V <= 9e-214)
		tmp = c0_m / (sqrt(V) * sqrt((l / A)));
	else
		tmp = c0_m / (sqrt(l) * sqrt((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_] := N[(c0$95$s * If[LessEqual[V, -4e-310], N[(c0$95$m * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[V, 1e-288], N[(c0$95$m * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[V, 9e-214], N[(c0$95$m / N[(N[Sqrt[V], $MachinePrecision] * N[Sqrt[N[(l / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0$95$m / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[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])\\
\\
c0\_s \cdot \begin{array}{l}
\mathbf{if}\;V \leq -4 \cdot 10^{-310}:\\
\;\;\;\;c0\_m \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\

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

\mathbf{elif}\;V \leq 9 \cdot 10^{-214}:\\
\;\;\;\;\frac{c0\_m}{\sqrt{V} \cdot \sqrt{\frac{\ell}{A}}}\\

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


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

    1. Initial program 76.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.999999999999988e-310 < V < 1.00000000000000006e-288

    1. Initial program 100.0%

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

    if 1.00000000000000006e-288 < V < 9.0000000000000002e-214

    1. Initial program 52.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.0000000000000002e-214 < V

    1. Initial program 74.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 73.7% 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 74.4%

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

Reproduce

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