
(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:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= V -2e-310) (* c0 (/ (sqrt (- 0.0 (/ A l))) (sqrt (- 0.0 V)))) (/ (/ c0 (sqrt l)) (/ (sqrt V) (sqrt A)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -2e-310) {
tmp = c0 * (sqrt((0.0 - (A / l))) / sqrt((0.0 - V)));
} else {
tmp = (c0 / sqrt(l)) / (sqrt(V) / sqrt(A));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (v <= (-2d-310)) then
tmp = c0 * (sqrt((0.0d0 - (a / l))) / sqrt((0.0d0 - v)))
else
tmp = (c0 / sqrt(l)) / (sqrt(v) / sqrt(a))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -2e-310) {
tmp = c0 * (Math.sqrt((0.0 - (A / l))) / Math.sqrt((0.0 - V)));
} else {
tmp = (c0 / Math.sqrt(l)) / (Math.sqrt(V) / Math.sqrt(A));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if V <= -2e-310: tmp = c0 * (math.sqrt((0.0 - (A / l))) / math.sqrt((0.0 - V))) else: tmp = (c0 / math.sqrt(l)) / (math.sqrt(V) / math.sqrt(A)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= -2e-310) tmp = Float64(c0 * Float64(sqrt(Float64(0.0 - Float64(A / l))) / sqrt(Float64(0.0 - V)))); else tmp = Float64(Float64(c0 / sqrt(l)) / Float64(sqrt(V) / sqrt(A))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (V <= -2e-310)
tmp = c0 * (sqrt((0.0 - (A / l))) / sqrt((0.0 - V)));
else
tmp = (c0 / sqrt(l)) / (sqrt(V) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[V, -2e-310], N[(c0 * N[(N[Sqrt[N[(0.0 - N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(0.0 - V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[V], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -2 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{0 - \frac{A}{\ell}}}{\sqrt{0 - V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{c0}{\sqrt{\ell}}}{\frac{\sqrt{V}}{\sqrt{A}}}\\
\end{array}
\end{array}
if V < -1.999999999999994e-310Initial program 66.6%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval73.5%
Applied egg-rr73.5%
div-invN/A
associate-/r*N/A
metadata-evalN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
associate-/l/N/A
associate-/r/N/A
clear-numN/A
frac-2negN/A
sqrt-divN/A
pow1/2N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f6487.6%
Applied egg-rr87.6%
if -1.999999999999994e-310 < V Initial program 71.8%
Applied egg-rr40.4%
sqrt-divN/A
pow1/2N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f6446.4%
Applied egg-rr46.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= V -2e-310) (* c0 (/ (sqrt (- 0.0 (/ A l))) (sqrt (- 0.0 V)))) (/ (* (sqrt A) (/ c0 (sqrt V))) (sqrt l))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -2e-310) {
tmp = c0 * (sqrt((0.0 - (A / l))) / sqrt((0.0 - V)));
} else {
tmp = (sqrt(A) * (c0 / sqrt(V))) / sqrt(l);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (v <= (-2d-310)) then
tmp = c0 * (sqrt((0.0d0 - (a / l))) / sqrt((0.0d0 - v)))
else
tmp = (sqrt(a) * (c0 / sqrt(v))) / sqrt(l)
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -2e-310) {
tmp = c0 * (Math.sqrt((0.0 - (A / l))) / Math.sqrt((0.0 - V)));
} else {
tmp = (Math.sqrt(A) * (c0 / Math.sqrt(V))) / Math.sqrt(l);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if V <= -2e-310: tmp = c0 * (math.sqrt((0.0 - (A / l))) / math.sqrt((0.0 - V))) else: tmp = (math.sqrt(A) * (c0 / math.sqrt(V))) / math.sqrt(l) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= -2e-310) tmp = Float64(c0 * Float64(sqrt(Float64(0.0 - Float64(A / l))) / sqrt(Float64(0.0 - V)))); else tmp = Float64(Float64(sqrt(A) * Float64(c0 / sqrt(V))) / sqrt(l)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (V <= -2e-310)
tmp = c0 * (sqrt((0.0 - (A / l))) / sqrt((0.0 - V)));
else
tmp = (sqrt(A) * (c0 / sqrt(V))) / sqrt(l);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[V, -2e-310], N[(c0 * N[(N[Sqrt[N[(0.0 - N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(0.0 - V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[V], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -2 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{0 - \frac{A}{\ell}}}{\sqrt{0 - V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{A} \cdot \frac{c0}{\sqrt{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if V < -1.999999999999994e-310Initial program 66.6%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval73.5%
Applied egg-rr73.5%
div-invN/A
associate-/r*N/A
metadata-evalN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
associate-/l/N/A
associate-/r/N/A
clear-numN/A
frac-2negN/A
sqrt-divN/A
pow1/2N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f6487.6%
Applied egg-rr87.6%
if -1.999999999999994e-310 < V Initial program 71.8%
sqrt-divN/A
associate-*r/N/A
sqrt-prodN/A
times-fracN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f6448.8%
Applied egg-rr48.8%
Final simplification66.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -1e-266)
(* c0 (/ (sqrt (- 0.0 A)) (sqrt (- 0.0 (* V l)))))
(if (<= (* V l) 2e-273)
(/ c0 (sqrt (* l (/ V A))))
(/ c0 (/ (pow (* V l) 0.5) (sqrt A)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -1e-266) {
tmp = c0 * (sqrt((0.0 - A)) / sqrt((0.0 - (V * l))));
} else if ((V * l) <= 2e-273) {
tmp = c0 / sqrt((l * (V / A)));
} else {
tmp = c0 / (pow((V * l), 0.5) / sqrt(A));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -1e-266) {
tmp = c0 * (Math.sqrt((0.0 - A)) / Math.sqrt((0.0 - (V * l))));
} else if ((V * l) <= 2e-273) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else {
tmp = c0 / (Math.pow((V * l), 0.5) / Math.sqrt(A));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -1e-266: tmp = c0 * (math.sqrt((0.0 - A)) / math.sqrt((0.0 - (V * l)))) elif (V * l) <= 2e-273: tmp = c0 / math.sqrt((l * (V / A))) else: tmp = c0 / (math.pow((V * l), 0.5) / math.sqrt(A)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -1e-266) tmp = Float64(c0 * Float64(sqrt(Float64(0.0 - A)) / sqrt(Float64(0.0 - Float64(V * l))))); elseif (Float64(V * l) <= 2e-273) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); else tmp = Float64(c0 / Float64((Float64(V * l) ^ 0.5) / sqrt(A))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -1e-266)
tmp = c0 * (sqrt((0.0 - A)) / sqrt((0.0 - (V * l))));
elseif ((V * l) <= 2e-273)
tmp = c0 / sqrt((l * (V / A)));
else
tmp = c0 / (((V * l) ^ 0.5) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-266], N[(c0 * N[(N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(0.0 - N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-273], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Power[N[(V * l), $MachinePrecision], 0.5], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-266}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{0 - A}}{\sqrt{0 - V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-273}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{{\left(V \cdot \ell\right)}^{0.5}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 30.9%
associate-/r*N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6437.4%
Applied egg-rr37.4%
if -inf.0 < (*.f64 V l) < -9.9999999999999998e-267Initial program 79.0%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval72.1%
Applied egg-rr72.1%
div-invN/A
associate-/r*N/A
metadata-evalN/A
sqrt-pow1N/A
inv-powN/A
associate-/r/N/A
clear-numN/A
div-invN/A
frac-2negN/A
associate-/l/N/A
sqrt-divN/A
pow1/2N/A
*-commutativeN/A
/-lowering-/.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
distribute-lft-neg-inN/A
*-commutativeN/A
neg-sub0N/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6499.4%
Applied egg-rr99.4%
sub0-negN/A
neg-lowering-neg.f6499.4%
Applied egg-rr99.4%
if -9.9999999999999998e-267 < (*.f64 V l) < 2e-273Initial program 43.3%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval68.2%
Applied egg-rr68.2%
associate-/r/N/A
unpow-prod-downN/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
metadata-evalN/A
sqrt-divN/A
clear-numN/A
pow1/2N/A
div-invN/A
associate-*r/N/A
pow1/2N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
associate-/r*N/A
Applied egg-rr68.2%
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6468.2%
Applied egg-rr68.2%
if 2e-273 < (*.f64 V l) Initial program 77.2%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval73.9%
Applied egg-rr73.9%
associate-/r/N/A
unpow-prod-downN/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
metadata-evalN/A
sqrt-divN/A
clear-numN/A
pow1/2N/A
div-invN/A
associate-*r/N/A
pow1/2N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
associate-/r*N/A
Applied egg-rr73.8%
associate-/r/N/A
associate-*l/N/A
sqrt-undivN/A
pow1/2N/A
sqr-powN/A
pow-prod-downN/A
sqr-negN/A
sub0-negN/A
sub0-negN/A
pow-prod-downN/A
sqr-powN/A
pow1/2N/A
/-lowering-/.f64N/A
Applied egg-rr91.0%
Final simplification86.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= V -2e-310) (* c0 (/ (sqrt (- 0.0 (/ A l))) (sqrt (- 0.0 V)))) (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -2e-310) {
tmp = c0 * (sqrt((0.0 - (A / l))) / sqrt((0.0 - V)));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (v <= (-2d-310)) then
tmp = c0 * (sqrt((0.0d0 - (a / l))) / sqrt((0.0d0 - v)))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -2e-310) {
tmp = c0 * (Math.sqrt((0.0 - (A / l))) / Math.sqrt((0.0 - V)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if V <= -2e-310: tmp = c0 * (math.sqrt((0.0 - (A / l))) / math.sqrt((0.0 - V))) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= -2e-310) tmp = Float64(c0 * Float64(sqrt(Float64(0.0 - Float64(A / l))) / sqrt(Float64(0.0 - V)))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (V <= -2e-310)
tmp = c0 * (sqrt((0.0 - (A / l))) / sqrt((0.0 - V)));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[V, -2e-310], N[(c0 * N[(N[Sqrt[N[(0.0 - N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(0.0 - V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -2 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{0 - \frac{A}{\ell}}}{\sqrt{0 - V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if V < -1.999999999999994e-310Initial program 66.6%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval73.5%
Applied egg-rr73.5%
div-invN/A
associate-/r*N/A
metadata-evalN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
associate-/l/N/A
associate-/r/N/A
clear-numN/A
frac-2negN/A
sqrt-divN/A
pow1/2N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f6487.6%
Applied egg-rr87.6%
if -1.999999999999994e-310 < V Initial program 71.8%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval71.3%
Applied egg-rr71.3%
div-invN/A
associate-/r*N/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
associate-/r*N/A
div-invN/A
associate-/r/N/A
sqrt-unprodN/A
sqrt-divN/A
pow1/2N/A
associate-*l/N/A
clear-numN/A
/-lowering-/.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
sqrt-prodN/A
*-commutativeN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f6444.5%
Applied egg-rr44.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= (* V l) 1e-322) (/ c0 (sqrt (/ V (/ A l)))) (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 1e-322) {
tmp = c0 / sqrt((V / (A / l)));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= 1d-322) then
tmp = c0 / sqrt((v / (a / l)))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 1e-322) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 1e-322: tmp = c0 / math.sqrt((V / (A / l))) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 1e-322) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= 1e-322)
tmp = c0 / sqrt((V / (A / l)));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], 1e-322], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 10^{-322}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < 9.88131e-323Initial program 62.3%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval70.2%
Applied egg-rr70.2%
associate-/r/N/A
unpow-prod-downN/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
metadata-evalN/A
sqrt-divN/A
clear-numN/A
pow1/2N/A
div-invN/A
associate-*r/N/A
pow1/2N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
associate-/r*N/A
Applied egg-rr70.3%
if 9.88131e-323 < (*.f64 V l) Initial program 78.0%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval74.7%
Applied egg-rr74.7%
div-invN/A
associate-/r*N/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
associate-/r*N/A
div-invN/A
associate-/r/N/A
sqrt-unprodN/A
sqrt-divN/A
pow1/2N/A
associate-*l/N/A
clear-numN/A
/-lowering-/.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
sqrt-prodN/A
*-commutativeN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f6491.3%
Applied egg-rr91.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -1e-309) (/ c0 (* (sqrt l) (sqrt (/ V A)))) (/ c0 (/ (pow (* V l) 0.5) (sqrt A)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-309) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else {
tmp = c0 / (pow((V * l), 0.5) / sqrt(A));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-1d-309)) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else
tmp = c0 / (((v * l) ** 0.5d0) / sqrt(a))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-309) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else {
tmp = c0 / (Math.pow((V * l), 0.5) / Math.sqrt(A));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -1e-309: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) else: tmp = c0 / (math.pow((V * l), 0.5) / math.sqrt(A)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -1e-309) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); else tmp = Float64(c0 / Float64((Float64(V * l) ^ 0.5) / sqrt(A))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -1e-309)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
else
tmp = c0 / (((V * l) ^ 0.5) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -1e-309], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Power[N[(V * l), $MachinePrecision], 0.5], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{{\left(V \cdot \ell\right)}^{0.5}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -1.000000000000002e-309Initial program 66.1%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval72.8%
Applied egg-rr72.8%
associate-/r/N/A
unpow-prod-downN/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
metadata-evalN/A
sqrt-divN/A
clear-numN/A
pow1/2N/A
div-invN/A
associate-*r/N/A
pow1/2N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
associate-/r*N/A
Applied egg-rr72.9%
associate-/r/N/A
sqrt-prodN/A
pow1/2N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f6435.6%
Applied egg-rr35.6%
if -1.000000000000002e-309 < A Initial program 72.3%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval71.9%
Applied egg-rr71.9%
associate-/r/N/A
unpow-prod-downN/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
metadata-evalN/A
sqrt-divN/A
clear-numN/A
pow1/2N/A
div-invN/A
associate-*r/N/A
pow1/2N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
associate-/r*N/A
Applied egg-rr71.8%
associate-/r/N/A
associate-*l/N/A
sqrt-undivN/A
pow1/2N/A
sqr-powN/A
pow-prod-downN/A
sqr-negN/A
sub0-negN/A
sub0-negN/A
pow-prod-downN/A
sqr-powN/A
pow1/2N/A
/-lowering-/.f64N/A
Applied egg-rr83.4%
Final simplification61.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -1e-309) (/ c0 (* (sqrt l) (sqrt (/ V A)))) (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-309) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-1d-309)) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-309) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -1e-309: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -1e-309) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -1e-309)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -1e-309], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -1.000000000000002e-309Initial program 66.1%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval72.8%
Applied egg-rr72.8%
associate-/r/N/A
unpow-prod-downN/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
metadata-evalN/A
sqrt-divN/A
clear-numN/A
pow1/2N/A
div-invN/A
associate-*r/N/A
pow1/2N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
associate-/r*N/A
Applied egg-rr72.9%
associate-/r/N/A
sqrt-prodN/A
pow1/2N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f6435.6%
Applied egg-rr35.6%
if -1.000000000000002e-309 < A Initial program 72.3%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval71.9%
Applied egg-rr71.9%
div-invN/A
associate-/r*N/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
associate-/r*N/A
div-invN/A
associate-/r/N/A
sqrt-unprodN/A
sqrt-divN/A
pow1/2N/A
associate-*l/N/A
clear-numN/A
/-lowering-/.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
sqrt-prodN/A
*-commutativeN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f6483.4%
Applied egg-rr83.4%
Final simplification61.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -1e-309) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-309) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-1d-309)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-309) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -1e-309: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -1e-309) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -1e-309)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -1e-309], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -1.000000000000002e-309Initial program 66.1%
associate-/r*N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6435.7%
Applied egg-rr35.7%
if -1.000000000000002e-309 < A Initial program 72.3%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval71.9%
Applied egg-rr71.9%
div-invN/A
associate-/r*N/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
associate-/r*N/A
div-invN/A
associate-/r/N/A
sqrt-unprodN/A
sqrt-divN/A
pow1/2N/A
associate-*l/N/A
clear-numN/A
/-lowering-/.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
sqrt-prodN/A
*-commutativeN/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
*-lowering-*.f6483.4%
Applied egg-rr83.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (/ A (* V l))) (t_1 (* c0 (sqrt (/ (/ A V) l))))) (if (<= t_0 0.0) t_1 (if (<= t_0 2e+304) (* c0 (sqrt t_0)) t_1))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double t_1 = c0 * sqrt(((A / V) / l));
double tmp;
if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 2e+304) {
tmp = c0 * sqrt(t_0);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = a / (v * l)
t_1 = c0 * sqrt(((a / v) / l))
if (t_0 <= 0.0d0) then
tmp = t_1
else if (t_0 <= 2d+304) then
tmp = c0 * sqrt(t_0)
else
tmp = t_1
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double t_1 = c0 * Math.sqrt(((A / V) / l));
double tmp;
if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 2e+304) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = t_1;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) t_1 = c0 * math.sqrt(((A / V) / l)) tmp = 0 if t_0 <= 0.0: tmp = t_1 elif t_0 <= 2e+304: tmp = c0 * math.sqrt(t_0) else: tmp = t_1 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) t_1 = Float64(c0 * sqrt(Float64(Float64(A / V) / l))) tmp = 0.0 if (t_0 <= 0.0) tmp = t_1; elseif (t_0 <= 2e+304) tmp = Float64(c0 * sqrt(t_0)); else tmp = t_1; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
t_1 = c0 * sqrt(((A / V) / l));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = t_1;
elseif (t_0 <= 2e+304)
tmp = c0 * sqrt(t_0);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], t$95$1, If[LessEqual[t$95$0, 2e+304], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
t_1 := c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 1.9999999999999999e304 < (/.f64 A (*.f64 V l)) Initial program 36.9%
sqrt-lowering-sqrt.f64N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6453.0%
Applied egg-rr53.0%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.9999999999999999e304Initial program 99.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (/ c0 (sqrt (/ V (/ A l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 / sqrt((V / (A / l)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 / sqrt((v / (a / l)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 / Math.sqrt((V / (A / l)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 / math.sqrt((V / (A / l)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 / sqrt(Float64(V / Float64(A / l)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 / sqrt((V / (A / l)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}
\end{array}
Initial program 69.5%
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
metadata-eval72.3%
Applied egg-rr72.3%
associate-/r/N/A
unpow-prod-downN/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
metadata-evalN/A
pow-flipN/A
pow1/2N/A
metadata-evalN/A
sqrt-divN/A
clear-numN/A
pow1/2N/A
div-invN/A
associate-*r/N/A
pow1/2N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
associate-/r*N/A
Applied egg-rr72.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ (/ A l) V))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt(((A / l) / V));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt(((a / l) / v))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt(((A / l) / V));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt(((A / l) / V))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(Float64(A / l) / V))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt(((A / l) / V));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}
\end{array}
Initial program 69.5%
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f6472.0%
Applied egg-rr72.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 69.5%
herbie shell --seed 2024194
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))