Henrywood and Agarwal, Equation (3)

Percentage Accurate: 73.8% → 96.7%
Time: 9.9s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 73.8% 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: 96.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ c0 \cdot {\left(\sqrt[3]{A} \cdot \frac{\sqrt[3]{\frac{1}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (* c0 (pow (* (cbrt A) (/ (cbrt (/ 1.0 V)) (cbrt l))) 1.5)))
double code(double c0, double A, double V, double l) {
	return c0 * pow((cbrt(A) * (cbrt((1.0 / V)) / cbrt(l))), 1.5);
}
public static double code(double c0, double A, double V, double l) {
	return c0 * Math.pow((Math.cbrt(A) * (Math.cbrt((1.0 / V)) / Math.cbrt(l))), 1.5);
}
function code(c0, A, V, l)
	return Float64(c0 * (Float64(cbrt(A) * Float64(cbrt(Float64(1.0 / V)) / cbrt(l))) ^ 1.5))
end
code[c0_, A_, V_, l_] := N[(c0 * N[Power[N[(N[Power[A, 1/3], $MachinePrecision] * N[(N[Power[N[(1.0 / V), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
c0 \cdot {\left(\sqrt[3]{A} \cdot \frac{\sqrt[3]{\frac{1}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5}
\end{array}
Derivation
  1. Initial program 75.5%

    \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
  2. Step-by-step derivation
    1. pow1/275.5%

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{A}{V \cdot \ell}\right)}^{0.5}} \]
    2. add-cube-cbrt75.1%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto c0 \cdot {\left(\sqrt[3]{A} \cdot \color{blue}{\frac{\sqrt[3]{{V}^{-1}}}{\sqrt[3]{\ell}}}\right)}^{1.5} \]
  8. Step-by-step derivation
    1. unpow-196.5%

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

    \[\leadsto c0 \cdot {\left(\sqrt[3]{A} \cdot \color{blue}{\frac{\sqrt[3]{\frac{1}{V}}}{\sqrt[3]{\ell}}}\right)}^{1.5} \]
  10. Final simplification96.5%

    \[\leadsto c0 \cdot {\left(\sqrt[3]{A} \cdot \frac{\sqrt[3]{\frac{1}{V}}}{\sqrt[3]{\ell}}\right)}^{1.5} \]

Alternative 2: 80.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+244}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-202}:\\ \;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{-182}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+295}:\\ \;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (if (<= (* V l) -1e+244)
   (* c0 (/ (sqrt (/ A V)) (sqrt l)))
   (if (<= (* V l) -1e-202)
     (* c0 (pow (/ (* V l) A) -0.5))
     (if (<= (* V l) 1e-182)
       (/ c0 (sqrt (* V (/ l A))))
       (if (<= (* V l) 5e+295)
         (* (sqrt A) (/ c0 (sqrt (* V l))))
         (* c0 (sqrt (* (/ A V) (/ 1.0 l)))))))))
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e+244) {
		tmp = c0 * (sqrt((A / V)) / sqrt(l));
	} else if ((V * l) <= -1e-202) {
		tmp = c0 * pow(((V * l) / A), -0.5);
	} else if ((V * l) <= 1e-182) {
		tmp = c0 / sqrt((V * (l / A)));
	} else if ((V * l) <= 5e+295) {
		tmp = sqrt(A) * (c0 / sqrt((V * l)));
	} else {
		tmp = c0 * sqrt(((A / V) * (1.0 / l)));
	}
	return tmp;
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: tmp
    if ((v * l) <= (-1d+244)) then
        tmp = c0 * (sqrt((a / v)) / sqrt(l))
    else if ((v * l) <= (-1d-202)) then
        tmp = c0 * (((v * l) / a) ** (-0.5d0))
    else if ((v * l) <= 1d-182) then
        tmp = c0 / sqrt((v * (l / a)))
    else if ((v * l) <= 5d+295) then
        tmp = sqrt(a) * (c0 / sqrt((v * l)))
    else
        tmp = c0 * sqrt(((a / v) * (1.0d0 / l)))
    end if
    code = tmp
end function
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e+244) {
		tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
	} else if ((V * l) <= -1e-202) {
		tmp = c0 * Math.pow(((V * l) / A), -0.5);
	} else if ((V * l) <= 1e-182) {
		tmp = c0 / Math.sqrt((V * (l / A)));
	} else if ((V * l) <= 5e+295) {
		tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
	} else {
		tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
	}
	return tmp;
}
def code(c0, A, V, l):
	tmp = 0
	if (V * l) <= -1e+244:
		tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l))
	elif (V * l) <= -1e-202:
		tmp = c0 * math.pow(((V * l) / A), -0.5)
	elif (V * l) <= 1e-182:
		tmp = c0 / math.sqrt((V * (l / A)))
	elif (V * l) <= 5e+295:
		tmp = math.sqrt(A) * (c0 / math.sqrt((V * l)))
	else:
		tmp = c0 * math.sqrt(((A / V) * (1.0 / l)))
	return tmp
function code(c0, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= -1e+244)
		tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l)));
	elseif (Float64(V * l) <= -1e-202)
		tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5));
	elseif (Float64(V * l) <= 1e-182)
		tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A))));
	elseif (Float64(V * l) <= 5e+295)
		tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l))));
	else
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / l))));
	end
	return tmp
end
function tmp_2 = code(c0, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -1e+244)
		tmp = c0 * (sqrt((A / V)) / sqrt(l));
	elseif ((V * l) <= -1e-202)
		tmp = c0 * (((V * l) / A) ^ -0.5);
	elseif ((V * l) <= 1e-182)
		tmp = c0 / sqrt((V * (l / A)));
	elseif ((V * l) <= 5e+295)
		tmp = sqrt(A) * (c0 / sqrt((V * l)));
	else
		tmp = c0 * sqrt(((A / V) * (1.0 / l)));
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+244], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-202], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-182], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+295], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+244}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\

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

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

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

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


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

    1. Initial program 38.8%

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

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

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

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

    if -1.00000000000000007e244 < (*.f64 V l) < -1e-202

    1. Initial program 86.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. pow1/286.2%

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

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

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

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{\left(-1 \cdot 0.5\right)}} \]
      5. associate-/l*75.3%

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

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

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

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

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

    if -1e-202 < (*.f64 V l) < 1e-182

    1. Initial program 60.9%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \ell}} \cdot \sqrt{A}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u11.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{c0}{\sqrt{V \cdot \ell}} \cdot \sqrt{A}\right)\right)} \]
      2. expm1-udef3.2%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}}\right)} - 1 \]
      4. associate-/l*3.2%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}}\right)} - 1 \]
      5. sqrt-div6.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{c0}{\color{blue}{\sqrt{\frac{V \cdot \ell}{A}}}}\right)} - 1 \]
      6. associate-*r/8.8%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{c0}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}}\right)} - 1 \]
    7. Applied egg-rr8.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def35.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\right)\right)} \]
      2. expm1-log1p77.9%

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

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

    if 1e-182 < (*.f64 V l) < 4.99999999999999991e295

    1. Initial program 85.3%

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

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

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

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

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

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

    if 4.99999999999999991e295 < (*.f64 V l)

    1. Initial program 57.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+244}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-202}:\\ \;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{-182}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+295}:\\ \;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\ \end{array} \]

Alternative 3: 81.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+244}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-202}:\\ \;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{-182}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+295}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (if (<= (* V l) -1e+244)
   (* c0 (/ (sqrt (/ A V)) (sqrt l)))
   (if (<= (* V l) -1e-202)
     (* c0 (pow (/ (* V l) A) -0.5))
     (if (<= (* V l) 1e-182)
       (/ c0 (sqrt (* V (/ l A))))
       (if (<= (* V l) 5e+295)
         (/ c0 (/ (sqrt (* V l)) (sqrt A)))
         (* c0 (sqrt (* (/ A V) (/ 1.0 l)))))))))
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e+244) {
		tmp = c0 * (sqrt((A / V)) / sqrt(l));
	} else if ((V * l) <= -1e-202) {
		tmp = c0 * pow(((V * l) / A), -0.5);
	} else if ((V * l) <= 1e-182) {
		tmp = c0 / sqrt((V * (l / A)));
	} else if ((V * l) <= 5e+295) {
		tmp = c0 / (sqrt((V * l)) / sqrt(A));
	} else {
		tmp = c0 * sqrt(((A / V) * (1.0 / l)));
	}
	return tmp;
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: tmp
    if ((v * l) <= (-1d+244)) then
        tmp = c0 * (sqrt((a / v)) / sqrt(l))
    else if ((v * l) <= (-1d-202)) then
        tmp = c0 * (((v * l) / a) ** (-0.5d0))
    else if ((v * l) <= 1d-182) then
        tmp = c0 / sqrt((v * (l / a)))
    else if ((v * l) <= 5d+295) then
        tmp = c0 / (sqrt((v * l)) / sqrt(a))
    else
        tmp = c0 * sqrt(((a / v) * (1.0d0 / l)))
    end if
    code = tmp
end function
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -1e+244) {
		tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
	} else if ((V * l) <= -1e-202) {
		tmp = c0 * Math.pow(((V * l) / A), -0.5);
	} else if ((V * l) <= 1e-182) {
		tmp = c0 / Math.sqrt((V * (l / A)));
	} else if ((V * l) <= 5e+295) {
		tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
	} else {
		tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
	}
	return tmp;
}
def code(c0, A, V, l):
	tmp = 0
	if (V * l) <= -1e+244:
		tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l))
	elif (V * l) <= -1e-202:
		tmp = c0 * math.pow(((V * l) / A), -0.5)
	elif (V * l) <= 1e-182:
		tmp = c0 / math.sqrt((V * (l / A)))
	elif (V * l) <= 5e+295:
		tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A))
	else:
		tmp = c0 * math.sqrt(((A / V) * (1.0 / l)))
	return tmp
function code(c0, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= -1e+244)
		tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l)));
	elseif (Float64(V * l) <= -1e-202)
		tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5));
	elseif (Float64(V * l) <= 1e-182)
		tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A))));
	elseif (Float64(V * l) <= 5e+295)
		tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A)));
	else
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / l))));
	end
	return tmp
end
function tmp_2 = code(c0, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -1e+244)
		tmp = c0 * (sqrt((A / V)) / sqrt(l));
	elseif ((V * l) <= -1e-202)
		tmp = c0 * (((V * l) / A) ^ -0.5);
	elseif ((V * l) <= 1e-182)
		tmp = c0 / sqrt((V * (l / A)));
	elseif ((V * l) <= 5e+295)
		tmp = c0 / (sqrt((V * l)) / sqrt(A));
	else
		tmp = c0 * sqrt(((A / V) * (1.0 / l)));
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+244], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-202], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-182], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+295], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+244}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\

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

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

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

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


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

    1. Initial program 38.8%

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

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

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

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

    if -1.00000000000000007e244 < (*.f64 V l) < -1e-202

    1. Initial program 86.2%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. pow1/286.2%

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

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

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

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{\left(-1 \cdot 0.5\right)}} \]
      5. associate-/l*75.3%

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

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

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

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

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

    if -1e-202 < (*.f64 V l) < 1e-182

    1. Initial program 60.9%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \ell}} \cdot \sqrt{A}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u11.8%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{c0}{\sqrt{V \cdot \ell}} \cdot \sqrt{A}\right)\right)} \]
      2. expm1-udef3.2%

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}}\right)} - 1 \]
      4. associate-/l*3.2%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}}\right)} - 1 \]
      5. sqrt-div6.3%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{c0}{\color{blue}{\sqrt{\frac{V \cdot \ell}{A}}}}\right)} - 1 \]
      6. associate-*r/8.8%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{c0}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}}\right)} - 1 \]
    7. Applied egg-rr8.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def35.6%

        \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\right)\right)} \]
      2. expm1-log1p77.9%

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

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

    if 1e-182 < (*.f64 V l) < 4.99999999999999991e295

    1. Initial program 85.3%

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

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

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

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

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

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

    if 4.99999999999999991e295 < (*.f64 V l)

    1. Initial program 57.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+244}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-202}:\\ \;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{-182}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+295}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\ \end{array} \]

Alternative 4: 86.6% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+279}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-279}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{-182}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+295}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (if (<= (* V l) -5e+279)
   (* c0 (/ (sqrt (/ A V)) (sqrt l)))
   (if (<= (* V l) -1e-279)
     (* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
     (if (<= (* V l) 1e-182)
       (/ c0 (sqrt (* V (/ l A))))
       (if (<= (* V l) 5e+295)
         (/ c0 (/ (sqrt (* V l)) (sqrt A)))
         (* c0 (sqrt (* (/ A V) (/ 1.0 l)))))))))
double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -5e+279) {
		tmp = c0 * (sqrt((A / V)) / sqrt(l));
	} else if ((V * l) <= -1e-279) {
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	} else if ((V * l) <= 1e-182) {
		tmp = c0 / sqrt((V * (l / A)));
	} else if ((V * l) <= 5e+295) {
		tmp = c0 / (sqrt((V * l)) / sqrt(A));
	} else {
		tmp = c0 * sqrt(((A / V) * (1.0 / l)));
	}
	return tmp;
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: tmp
    if ((v * l) <= (-5d+279)) then
        tmp = c0 * (sqrt((a / v)) / sqrt(l))
    else if ((v * l) <= (-1d-279)) then
        tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
    else if ((v * l) <= 1d-182) then
        tmp = c0 / sqrt((v * (l / a)))
    else if ((v * l) <= 5d+295) then
        tmp = c0 / (sqrt((v * l)) / sqrt(a))
    else
        tmp = c0 * sqrt(((a / v) * (1.0d0 / l)))
    end if
    code = tmp
end function
public static double code(double c0, double A, double V, double l) {
	double tmp;
	if ((V * l) <= -5e+279) {
		tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
	} else if ((V * l) <= -1e-279) {
		tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
	} else if ((V * l) <= 1e-182) {
		tmp = c0 / Math.sqrt((V * (l / A)));
	} else if ((V * l) <= 5e+295) {
		tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
	} else {
		tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
	}
	return tmp;
}
def code(c0, A, V, l):
	tmp = 0
	if (V * l) <= -5e+279:
		tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l))
	elif (V * l) <= -1e-279:
		tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l)))
	elif (V * l) <= 1e-182:
		tmp = c0 / math.sqrt((V * (l / A)))
	elif (V * l) <= 5e+295:
		tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A))
	else:
		tmp = c0 * math.sqrt(((A / V) * (1.0 / l)))
	return tmp
function code(c0, A, V, l)
	tmp = 0.0
	if (Float64(V * l) <= -5e+279)
		tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l)));
	elseif (Float64(V * l) <= -1e-279)
		tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l)))));
	elseif (Float64(V * l) <= 1e-182)
		tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A))));
	elseif (Float64(V * l) <= 5e+295)
		tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A)));
	else
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / l))));
	end
	return tmp
end
function tmp_2 = code(c0, A, V, l)
	tmp = 0.0;
	if ((V * l) <= -5e+279)
		tmp = c0 * (sqrt((A / V)) / sqrt(l));
	elseif ((V * l) <= -1e-279)
		tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
	elseif ((V * l) <= 1e-182)
		tmp = c0 / sqrt((V * (l / A)));
	elseif ((V * l) <= 5e+295)
		tmp = c0 / (sqrt((V * l)) / sqrt(A));
	else
		tmp = c0 * sqrt(((A / V) * (1.0 / l)));
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e+279], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-279], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-182], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+295], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+279}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\

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

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

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

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


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

    1. Initial program 39.3%

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

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

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

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

    if -5.0000000000000002e279 < (*.f64 V l) < -1.00000000000000006e-279

    1. Initial program 82.0%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. frac-2neg82.0%

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

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

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

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

    if -1.00000000000000006e-279 < (*.f64 V l) < 1e-182

    1. Initial program 61.1%

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{c0}{\sqrt{V \cdot \ell}} \cdot \sqrt{A}} \]
    6. Step-by-step derivation
      1. expm1-log1p-u13.9%

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}}\right)} - 1 \]
      4. associate-/l*3.8%

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}}\right)} - 1 \]
      5. sqrt-div6.8%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{c0}{\color{blue}{\sqrt{\frac{V \cdot \ell}{A}}}}\right)} - 1 \]
      6. associate-*r/9.8%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{c0}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}}\right)} - 1 \]
    7. Applied egg-rr9.8%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def31.5%

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

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

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

    if 1e-182 < (*.f64 V l) < 4.99999999999999991e295

    1. Initial program 85.3%

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

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

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

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

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

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

    if 4.99999999999999991e295 < (*.f64 V l)

    1. Initial program 57.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+279}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-279}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\ \mathbf{elif}\;V \cdot \ell \leq 10^{-182}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+295}:\\ \;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\ \end{array} \]

Alternative 5: 78.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 8 \cdot 10^{-308}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 8.00000000000000026e-308

    1. Initial program 75.9%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. pow1/275.9%

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

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

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

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{\left(-1 \cdot 0.5\right)}} \]
      5. associate-/l*74.1%

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

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

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

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V \cdot \ell}{A}\right)}}^{-0.5} \]
      2. *-lft-identity76.0%

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

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V}{1} \cdot \frac{\ell}{A}\right)}}^{-0.5} \]
      4. /-rgt-identity74.1%

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

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

    if 8.00000000000000026e-308 < l

    1. Initial program 75.2%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 8 \cdot 10^{-308}:\\ \;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\ \end{array} \]

Alternative 6: 79.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\ \mathbf{elif}\;t_0 \leq 10^{+276}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (<= t_0 0.0)
     (* c0 (pow (* V (/ l A)) -0.5))
     (if (<= t_0 1e+276) (* c0 (sqrt t_0)) (* c0 (pow (* l (/ V A)) -0.5))))))
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * pow((V * (l / A)), -0.5);
	} else if (t_0 <= 1e+276) {
		tmp = c0 * sqrt(t_0);
	} else {
		tmp = c0 * pow((l * (V / A)), -0.5);
	}
	return tmp;
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 0.0d0) then
        tmp = c0 * ((v * (l / a)) ** (-0.5d0))
    else if (t_0 <= 1d+276) then
        tmp = c0 * sqrt(t_0)
    else
        tmp = c0 * ((l * (v / a)) ** (-0.5d0))
    end if
    code = tmp
end function
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * Math.pow((V * (l / A)), -0.5);
	} else if (t_0 <= 1e+276) {
		tmp = c0 * Math.sqrt(t_0);
	} else {
		tmp = c0 * Math.pow((l * (V / A)), -0.5);
	}
	return tmp;
}
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 0.0:
		tmp = c0 * math.pow((V * (l / A)), -0.5)
	elif t_0 <= 1e+276:
		tmp = c0 * math.sqrt(t_0)
	else:
		tmp = c0 * math.pow((l * (V / A)), -0.5)
	return tmp
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5));
	elseif (t_0 <= 1e+276)
		tmp = Float64(c0 * sqrt(t_0));
	else
		tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5));
	end
	return tmp
end
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = c0 * ((V * (l / A)) ^ -0.5);
	elseif (t_0 <= 1e+276)
		tmp = c0 * sqrt(t_0);
	else
		tmp = c0 * ((l * (V / A)) ^ -0.5);
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+276], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\

\mathbf{elif}\;t_0 \leq 10^{+276}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\

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


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

    1. Initial program 38.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. pow1/238.3%

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

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

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

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{\left(-1 \cdot 0.5\right)}} \]
      5. associate-/l*53.0%

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

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

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

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

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

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V}{1} \cdot \frac{\ell}{A}\right)}}^{-0.5} \]
      4. /-rgt-identity53.0%

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 1.0000000000000001e276

    1. Initial program 98.4%

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

    if 1.0000000000000001e276 < (/.f64 A (*.f64 V l))

    1. Initial program 35.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. pow1/235.7%

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

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

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

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{\left(-1 \cdot 0.5\right)}} \]
      5. associate-/l*53.0%

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

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

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

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

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

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

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

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

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

Alternative 7: 79.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\ \mathbf{elif}\;t_0 \leq 10^{+276}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (<= t_0 0.0)
     (sqrt (* A (* (/ c0 l) (/ c0 V))))
     (if (<= t_0 1e+276) (* c0 (sqrt t_0)) (* c0 (pow (* l (/ V A)) -0.5))))))
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = sqrt((A * ((c0 / l) * (c0 / V))));
	} else if (t_0 <= 1e+276) {
		tmp = c0 * sqrt(t_0);
	} else {
		tmp = c0 * pow((l * (V / A)), -0.5);
	}
	return tmp;
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 0.0d0) then
        tmp = sqrt((a * ((c0 / l) * (c0 / v))))
    else if (t_0 <= 1d+276) then
        tmp = c0 * sqrt(t_0)
    else
        tmp = c0 * ((l * (v / a)) ** (-0.5d0))
    end if
    code = tmp
end function
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = Math.sqrt((A * ((c0 / l) * (c0 / V))));
	} else if (t_0 <= 1e+276) {
		tmp = c0 * Math.sqrt(t_0);
	} else {
		tmp = c0 * Math.pow((l * (V / A)), -0.5);
	}
	return tmp;
}
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 0.0:
		tmp = math.sqrt((A * ((c0 / l) * (c0 / V))))
	elif t_0 <= 1e+276:
		tmp = c0 * math.sqrt(t_0)
	else:
		tmp = c0 * math.pow((l * (V / A)), -0.5)
	return tmp
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = sqrt(Float64(A * Float64(Float64(c0 / l) * Float64(c0 / V))));
	elseif (t_0 <= 1e+276)
		tmp = Float64(c0 * sqrt(t_0));
	else
		tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5));
	end
	return tmp
end
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = sqrt((A * ((c0 / l) * (c0 / V))));
	elseif (t_0 <= 1e+276)
		tmp = c0 * sqrt(t_0);
	else
		tmp = c0 * ((l * (V / A)) ^ -0.5);
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(A * N[(N[(c0 / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 1e+276], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\

\mathbf{elif}\;t_0 \leq 10^{+276}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\

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


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

    1. Initial program 38.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. pow1/238.3%

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

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

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

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{\left(-1 \cdot 0.5\right)}} \]
      5. associate-/l*53.0%

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt38.3%

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{\left(-0.5 + -0.5\right)}} \cdot \left(c0 \cdot c0\right)} \]
      7. metadata-eval37.3%

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 1.0000000000000001e276

    1. Initial program 98.4%

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

    if 1.0000000000000001e276 < (/.f64 A (*.f64 V l))

    1. Initial program 35.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. pow1/235.7%

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

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

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

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{\left(-1 \cdot 0.5\right)}} \]
      5. associate-/l*53.0%

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

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

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

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

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

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

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

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

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

Alternative 8: 79.4% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;\sqrt{\frac{c0 \cdot A}{V \cdot \frac{\ell}{c0}}}\\ \mathbf{elif}\;t_0 \leq 10^{+276}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (<= t_0 0.0)
     (sqrt (/ (* c0 A) (* V (/ l c0))))
     (if (<= t_0 1e+276) (* c0 (sqrt t_0)) (* c0 (pow (* l (/ V A)) -0.5))))))
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = sqrt(((c0 * A) / (V * (l / c0))));
	} else if (t_0 <= 1e+276) {
		tmp = c0 * sqrt(t_0);
	} else {
		tmp = c0 * pow((l * (V / A)), -0.5);
	}
	return tmp;
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 0.0d0) then
        tmp = sqrt(((c0 * a) / (v * (l / c0))))
    else if (t_0 <= 1d+276) then
        tmp = c0 * sqrt(t_0)
    else
        tmp = c0 * ((l * (v / a)) ** (-0.5d0))
    end if
    code = tmp
end function
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = Math.sqrt(((c0 * A) / (V * (l / c0))));
	} else if (t_0 <= 1e+276) {
		tmp = c0 * Math.sqrt(t_0);
	} else {
		tmp = c0 * Math.pow((l * (V / A)), -0.5);
	}
	return tmp;
}
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 0.0:
		tmp = math.sqrt(((c0 * A) / (V * (l / c0))))
	elif t_0 <= 1e+276:
		tmp = c0 * math.sqrt(t_0)
	else:
		tmp = c0 * math.pow((l * (V / A)), -0.5)
	return tmp
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = sqrt(Float64(Float64(c0 * A) / Float64(V * Float64(l / c0))));
	elseif (t_0 <= 1e+276)
		tmp = Float64(c0 * sqrt(t_0));
	else
		tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5));
	end
	return tmp
end
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = sqrt(((c0 * A) / (V * (l / c0))));
	elseif (t_0 <= 1e+276)
		tmp = c0 * sqrt(t_0);
	else
		tmp = c0 * ((l * (V / A)) ^ -0.5);
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(N[(c0 * A), $MachinePrecision] / N[(V * N[(l / c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 1e+276], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{c0 \cdot A}{V \cdot \frac{\ell}{c0}}}\\

\mathbf{elif}\;t_0 \leq 10^{+276}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\

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


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

    1. Initial program 38.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. pow1/238.3%

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

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

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

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{\left(-1 \cdot 0.5\right)}} \]
      5. associate-/l*53.0%

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

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

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

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

      \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}} \]
    6. Step-by-step derivation
      1. add-sqr-sqrt38.3%

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

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

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

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

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

        \[\leadsto \sqrt{\color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{\left(-0.5 + -0.5\right)}} \cdot \left(c0 \cdot c0\right)} \]
      7. metadata-eval37.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 1.0000000000000001e276

    1. Initial program 98.4%

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

    if 1.0000000000000001e276 < (/.f64 A (*.f64 V l))

    1. Initial program 35.7%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. pow1/235.7%

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

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

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

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{\left(-1 \cdot 0.5\right)}} \]
      5. associate-/l*53.0%

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

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

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

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

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

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

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

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

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

Alternative 9: 79.4% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 2 \cdot 10^{-320} \lor \neg \left(t_0 \leq 10^{+276}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (or (<= t_0 2e-320) (not (<= t_0 1e+276)))
     (* c0 (sqrt (/ (/ A V) l)))
     (* c0 (sqrt t_0)))))
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 2e-320) || !(t_0 <= 1e+276)) {
		tmp = c0 * sqrt(((A / V) / l));
	} else {
		tmp = c0 * sqrt(t_0);
	}
	return tmp;
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if ((t_0 <= 2d-320) .or. (.not. (t_0 <= 1d+276))) then
        tmp = c0 * sqrt(((a / v) / l))
    else
        tmp = c0 * sqrt(t_0)
    end if
    code = tmp
end function
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if ((t_0 <= 2e-320) || !(t_0 <= 1e+276)) {
		tmp = c0 * Math.sqrt(((A / V) / l));
	} else {
		tmp = c0 * Math.sqrt(t_0);
	}
	return tmp;
}
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if (t_0 <= 2e-320) or not (t_0 <= 1e+276):
		tmp = c0 * math.sqrt(((A / V) / l))
	else:
		tmp = c0 * math.sqrt(t_0)
	return tmp
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if ((t_0 <= 2e-320) || !(t_0 <= 1e+276))
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	else
		tmp = Float64(c0 * sqrt(t_0));
	end
	return tmp
end
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if ((t_0 <= 2e-320) || ~((t_0 <= 1e+276)))
		tmp = c0 * sqrt(((A / V) / l));
	else
		tmp = c0 * sqrt(t_0);
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 2e-320], N[Not[LessEqual[t$95$0, 1e+276]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-320} \lor \neg \left(t_0 \leq 10^{+276}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 A (*.f64 V l)) < 1.99998e-320 or 1.0000000000000001e276 < (/.f64 A (*.f64 V l))

    1. Initial program 37.7%

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

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

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

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

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

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

    if 1.99998e-320 < (/.f64 A (*.f64 V l)) < 1.0000000000000001e276

    1. Initial program 98.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{A}{V \cdot \ell} \leq 2 \cdot 10^{-320} \lor \neg \left(\frac{A}{V \cdot \ell} \leq 10^{+276}\right):\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \end{array} \]

Alternative 10: 80.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ \mathbf{if}\;t_0 \leq 2 \cdot 10^{-320}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;t_0 \leq 2 \cdot 10^{+283}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))))
   (if (<= t_0 2e-320)
     (* c0 (sqrt (/ (/ A V) l)))
     (if (<= t_0 2e+283) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A))))))))
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 2e-320) {
		tmp = c0 * sqrt(((A / V) / l));
	} else if (t_0 <= 2e+283) {
		tmp = c0 * sqrt(t_0);
	} else {
		tmp = c0 / sqrt((V * (l / A)));
	}
	return tmp;
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: tmp
    t_0 = a / (v * l)
    if (t_0 <= 2d-320) then
        tmp = c0 * sqrt(((a / v) / l))
    else if (t_0 <= 2d+283) then
        tmp = c0 * sqrt(t_0)
    else
        tmp = c0 / sqrt((v * (l / a)))
    end if
    code = tmp
end function
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double tmp;
	if (t_0 <= 2e-320) {
		tmp = c0 * Math.sqrt(((A / V) / l));
	} else if (t_0 <= 2e+283) {
		tmp = c0 * Math.sqrt(t_0);
	} else {
		tmp = c0 / Math.sqrt((V * (l / A)));
	}
	return tmp;
}
def code(c0, A, V, l):
	t_0 = A / (V * l)
	tmp = 0
	if t_0 <= 2e-320:
		tmp = c0 * math.sqrt(((A / V) / l))
	elif t_0 <= 2e+283:
		tmp = c0 * math.sqrt(t_0)
	else:
		tmp = c0 / math.sqrt((V * (l / A)))
	return tmp
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	tmp = 0.0
	if (t_0 <= 2e-320)
		tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l)));
	elseif (t_0 <= 2e+283)
		tmp = Float64(c0 * sqrt(t_0));
	else
		tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A))));
	end
	return tmp
end
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	tmp = 0.0;
	if (t_0 <= 2e-320)
		tmp = c0 * sqrt(((A / V) / l));
	elseif (t_0 <= 2e+283)
		tmp = c0 * sqrt(t_0);
	else
		tmp = c0 / sqrt((V * (l / A)));
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-320], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+283], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-320}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\

\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+283}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\

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


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

    1. Initial program 38.8%

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

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

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

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

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

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

    if 1.99998e-320 < (/.f64 A (*.f64 V l)) < 1.99999999999999991e283

    1. Initial program 98.6%

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

    if 1.99999999999999991e283 < (/.f64 A (*.f64 V l))

    1. Initial program 32.1%

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

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

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

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

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}}\right)} - 1 \]
      4. associate-/l*5.8%

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

        \[\leadsto e^{\mathsf{log1p}\left(\frac{c0}{\color{blue}{\sqrt{\frac{V \cdot \ell}{A}}}}\right)} - 1 \]
      6. associate-*r/10.0%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{c0}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}}\right)} - 1 \]
    7. Applied egg-rr10.0%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def15.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{A}{V \cdot \ell} \leq 2 \cdot 10^{-320}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\ \mathbf{elif}\;\frac{A}{V \cdot \ell} \leq 2 \cdot 10^{+283}:\\ \;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\ \end{array} \]

Alternative 11: 80.0% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{A}{V \cdot \ell}\\ t_1 := V \cdot \frac{\ell}{A}\\ \mathbf{if}\;t_0 \leq 0:\\ \;\;\;\;c0 \cdot {t_1}^{-0.5}\\ \mathbf{elif}\;t_0 \leq 2 \cdot 10^{+283}:\\ \;\;\;\;c0 \cdot \sqrt{t_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\sqrt{t_1}}\\ \end{array} \end{array} \]
(FPCore (c0 A V l)
 :precision binary64
 (let* ((t_0 (/ A (* V l))) (t_1 (* V (/ l A))))
   (if (<= t_0 0.0)
     (* c0 (pow t_1 -0.5))
     (if (<= t_0 2e+283) (* c0 (sqrt t_0)) (/ c0 (sqrt t_1))))))
double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double t_1 = V * (l / A);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * pow(t_1, -0.5);
	} else if (t_0 <= 2e+283) {
		tmp = c0 * sqrt(t_0);
	} else {
		tmp = c0 / sqrt(t_1);
	}
	return tmp;
}
real(8) function code(c0, a, v, l)
    real(8), intent (in) :: c0
    real(8), intent (in) :: a
    real(8), intent (in) :: v
    real(8), intent (in) :: l
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = a / (v * l)
    t_1 = v * (l / a)
    if (t_0 <= 0.0d0) then
        tmp = c0 * (t_1 ** (-0.5d0))
    else if (t_0 <= 2d+283) then
        tmp = c0 * sqrt(t_0)
    else
        tmp = c0 / sqrt(t_1)
    end if
    code = tmp
end function
public static double code(double c0, double A, double V, double l) {
	double t_0 = A / (V * l);
	double t_1 = V * (l / A);
	double tmp;
	if (t_0 <= 0.0) {
		tmp = c0 * Math.pow(t_1, -0.5);
	} else if (t_0 <= 2e+283) {
		tmp = c0 * Math.sqrt(t_0);
	} else {
		tmp = c0 / Math.sqrt(t_1);
	}
	return tmp;
}
def code(c0, A, V, l):
	t_0 = A / (V * l)
	t_1 = V * (l / A)
	tmp = 0
	if t_0 <= 0.0:
		tmp = c0 * math.pow(t_1, -0.5)
	elif t_0 <= 2e+283:
		tmp = c0 * math.sqrt(t_0)
	else:
		tmp = c0 / math.sqrt(t_1)
	return tmp
function code(c0, A, V, l)
	t_0 = Float64(A / Float64(V * l))
	t_1 = Float64(V * Float64(l / A))
	tmp = 0.0
	if (t_0 <= 0.0)
		tmp = Float64(c0 * (t_1 ^ -0.5));
	elseif (t_0 <= 2e+283)
		tmp = Float64(c0 * sqrt(t_0));
	else
		tmp = Float64(c0 / sqrt(t_1));
	end
	return tmp
end
function tmp_2 = code(c0, A, V, l)
	t_0 = A / (V * l);
	t_1 = V * (l / A);
	tmp = 0.0;
	if (t_0 <= 0.0)
		tmp = c0 * (t_1 ^ -0.5);
	elseif (t_0 <= 2e+283)
		tmp = c0 * sqrt(t_0);
	else
		tmp = c0 / sqrt(t_1);
	end
	tmp_2 = tmp;
end
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Power[t$95$1, -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+283], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
t_1 := V \cdot \frac{\ell}{A}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot {t_1}^{-0.5}\\

\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+283}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{t_1}}\\


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

    1. Initial program 38.3%

      \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
    2. Step-by-step derivation
      1. pow1/238.3%

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

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

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

        \[\leadsto c0 \cdot \color{blue}{{\left(\frac{V \cdot \ell}{A}\right)}^{\left(-1 \cdot 0.5\right)}} \]
      5. associate-/l*53.0%

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

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

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

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

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

        \[\leadsto c0 \cdot {\color{blue}{\left(\frac{V}{1} \cdot \frac{\ell}{A}\right)}}^{-0.5} \]
      4. /-rgt-identity53.0%

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

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

    if 0.0 < (/.f64 A (*.f64 V l)) < 1.99999999999999991e283

    1. Initial program 98.4%

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

    if 1.99999999999999991e283 < (/.f64 A (*.f64 V l))

    1. Initial program 32.1%

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

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

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

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

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

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

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

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

        \[\leadsto e^{\mathsf{log1p}\left(\color{blue}{\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}}\right)} - 1 \]
      4. associate-/l*5.8%

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

        \[\leadsto e^{\mathsf{log1p}\left(\frac{c0}{\color{blue}{\sqrt{\frac{V \cdot \ell}{A}}}}\right)} - 1 \]
      6. associate-*r/10.0%

        \[\leadsto e^{\mathsf{log1p}\left(\frac{c0}{\sqrt{\color{blue}{V \cdot \frac{\ell}{A}}}}\right)} - 1 \]
    7. Applied egg-rr10.0%

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\right)} - 1} \]
    8. Step-by-step derivation
      1. expm1-def15.0%

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

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

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

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

Alternative 12: 73.8% 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}
Derivation
  1. Initial program 75.5%

    \[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \]
  2. Final simplification75.5%

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

Reproduce

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