
(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 13 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 l) (- INFINITY))
(* c0 (* (pow l -0.5) (sqrt (/ A V))))
(if (<= (* V l) -5e-318)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0 (/ (sqrt (/ (- A) l)) (sqrt (- V))))
(if (<= (* V l) 2e+305)
(/ c0 (* (/ 1.0 (sqrt A)) (sqrt (* V l))))
(* c0 (sqrt (* (/ A V) (/ 1.0 l)))))))))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 * (pow(l, -0.5) * sqrt((A / V)));
} else if ((V * l) <= -5e-318) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
} else if ((V * l) <= 2e+305) {
tmp = c0 / ((1.0 / sqrt(A)) * sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
}
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.pow(l, -0.5) * Math.sqrt((A / V)));
} else if ((V * l) <= -5e-318) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.sqrt((-A / l)) / Math.sqrt(-V));
} else if ((V * l) <= 2e+305) {
tmp = c0 / ((1.0 / Math.sqrt(A)) * Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
}
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.pow(l, -0.5) * math.sqrt((A / V))) elif (V * l) <= -5e-318: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 * (math.sqrt((-A / l)) / math.sqrt(-V)) elif (V * l) <= 2e+305: tmp = c0 / ((1.0 / math.sqrt(A)) * math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) * (1.0 / 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) <= Float64(-Inf)) tmp = Float64(c0 * Float64((l ^ -0.5) * sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -5e-318) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= 2e+305) tmp = Float64(c0 / Float64(Float64(1.0 / sqrt(A)) * sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / 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) <= -Inf)
tmp = c0 * ((l ^ -0.5) * sqrt((A / V)));
elseif ((V * l) <= -5e-318)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
elseif ((V * l) <= 2e+305)
tmp = c0 / ((1.0 / sqrt(A)) * sqrt((V * l)));
else
tmp = c0 * sqrt(((A / V) * (1.0 / 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], (-Infinity)], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-318], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+305], N[(c0 / N[(N[(1.0 / N[Sqrt[A], $MachinePrecision]), $MachinePrecision] * 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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{A}{V}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-318}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+305}:\\
\;\;\;\;\frac{c0}{\frac{1}{\sqrt{A}} \cdot \sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 40.5%
associate-/r*69.6%
Simplified69.6%
div-inv69.7%
Applied egg-rr69.7%
sqrt-prod43.5%
*-commutative43.5%
inv-pow43.5%
sqrt-pow143.5%
metadata-eval43.5%
Applied egg-rr43.5%
if -inf.0 < (*.f64 V l) < -4.9999987e-318Initial program 83.9%
frac-2neg83.9%
sqrt-div99.0%
distribute-rgt-neg-in99.0%
Applied egg-rr99.0%
distribute-rgt-neg-out99.0%
*-commutative99.0%
distribute-rgt-neg-in99.0%
Simplified99.0%
if -4.9999987e-318 < (*.f64 V l) < -0.0Initial program 28.5%
add-sqr-sqrt28.5%
pow228.5%
pow1/228.5%
sqrt-pow128.5%
metadata-eval28.5%
Applied egg-rr28.5%
Taylor expanded in c0 around 0 28.5%
associate-/l/52.5%
Simplified52.5%
frac-2neg52.5%
sqrt-div37.7%
distribute-neg-frac37.7%
Applied egg-rr37.7%
if -0.0 < (*.f64 V l) < 1.9999999999999999e305Initial program 86.1%
associate-/r*77.2%
Simplified77.2%
div-inv77.2%
clear-num76.7%
frac-times76.2%
metadata-eval76.2%
inv-pow76.2%
Applied egg-rr76.2%
unpow-176.2%
sqrt-div76.1%
metadata-eval76.1%
associate-*l/84.8%
associate-*r/73.6%
un-div-inv73.8%
associate-*r/85.0%
associate-*l/76.3%
*-commutative76.3%
clear-num75.6%
un-div-inv76.0%
Applied egg-rr76.0%
sqrt-div39.0%
clear-num39.0%
sqrt-div77.2%
pow1/277.2%
associate-/r*86.1%
pow1/286.1%
sqrt-div99.4%
associate-/r/99.4%
*-commutative99.4%
Applied egg-rr99.4%
if 1.9999999999999999e305 < (*.f64 V l) Initial program 44.2%
associate-/r*93.2%
Simplified93.2%
div-inv93.3%
Applied egg-rr93.3%
Final simplification89.6%
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 t_0))))
(if (<= t_1 5e-308)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_1 5e+250) (/ c0 (pow t_0 -0.5)) (/ c0 (sqrt (/ l (/ A V))))))))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(t_0);
double tmp;
if (t_1 <= 5e-308) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_1 <= 5e+250) {
tmp = c0 / pow(t_0, -0.5);
} else {
tmp = c0 / sqrt((l / (A / V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = a / (v * l)
t_1 = c0 * sqrt(t_0)
if (t_1 <= 5d-308) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_1 <= 5d+250) then
tmp = c0 / (t_0 ** (-0.5d0))
else
tmp = c0 / sqrt((l / (a / v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double t_1 = c0 * Math.sqrt(t_0);
double tmp;
if (t_1 <= 5e-308) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_1 <= 5e+250) {
tmp = c0 / Math.pow(t_0, -0.5);
} else {
tmp = c0 / Math.sqrt((l / (A / V)));
}
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(t_0) tmp = 0 if t_1 <= 5e-308: tmp = c0 * math.sqrt(((A / l) / V)) elif t_1 <= 5e+250: tmp = c0 / math.pow(t_0, -0.5) else: tmp = c0 / math.sqrt((l / (A / V))) 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(t_0)) tmp = 0.0 if (t_1 <= 5e-308) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_1 <= 5e+250) tmp = Float64(c0 / (t_0 ^ -0.5)); else tmp = Float64(c0 / sqrt(Float64(l / Float64(A / V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
t_1 = c0 * sqrt(t_0);
tmp = 0.0;
if (t_1 <= 5e-308)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_1 <= 5e+250)
tmp = c0 / (t_0 ^ -0.5);
else
tmp = c0 / sqrt((l / (A / V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-308], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+250], N[(c0 / N[Power[t$95$0, -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\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{t\_0}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-308}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+250}:\\
\;\;\;\;\frac{c0}{{t\_0}^{-0.5}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.99999999999999955e-308Initial program 69.2%
add-sqr-sqrt69.0%
pow269.0%
pow1/269.0%
sqrt-pow169.0%
metadata-eval69.0%
Applied egg-rr69.0%
Taylor expanded in c0 around 0 69.2%
associate-/l/74.8%
Simplified74.8%
if 4.99999999999999955e-308 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000002e250Initial program 99.0%
associate-/r*84.8%
Simplified84.8%
div-inv84.6%
clear-num83.7%
frac-times82.6%
metadata-eval82.6%
inv-pow82.6%
Applied egg-rr82.6%
unpow-182.6%
sqrt-div82.6%
metadata-eval82.6%
associate-*l/97.8%
associate-*r/82.3%
un-div-inv82.6%
associate-*r/98.0%
associate-*l/82.7%
*-commutative82.7%
clear-num82.8%
un-div-inv83.6%
Applied egg-rr83.6%
sqrt-div47.7%
clear-num47.7%
sqrt-div84.7%
inv-pow84.7%
sqrt-pow284.8%
associate-/l/99.3%
metadata-eval99.3%
Applied egg-rr99.3%
if 5.0000000000000002e250 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 52.4%
associate-/r*55.9%
Simplified55.9%
div-inv55.9%
clear-num55.9%
frac-times55.9%
metadata-eval55.9%
inv-pow55.9%
Applied egg-rr55.9%
unpow-155.9%
sqrt-div55.8%
metadata-eval55.8%
associate-*l/52.4%
associate-*r/55.8%
un-div-inv55.8%
associate-*r/52.4%
associate-*l/55.7%
*-commutative55.7%
clear-num55.8%
un-div-inv55.8%
Applied egg-rr55.8%
Final simplification78.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (or (<= t_0 0.0) (not (<= t_0 4e+250)))
(* c0 (sqrt (/ (/ A V) l)))
t_0)))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+250)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+250))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+250)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 4e+250): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 4e+250)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 4e+250)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+250]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 4 \cdot 10^{+250}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 3.9999999999999997e250 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 66.6%
associate-/r*71.4%
Simplified71.4%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.9999999999999997e250Initial program 99.1%
Final simplification78.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 1e-305)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+250) t_0 (/ c0 (sqrt (/ l (/ A V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 1e-305) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 5e+250) {
tmp = t_0;
} else {
tmp = c0 / sqrt((l / (A / V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 1d-305) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 5d+250) then
tmp = t_0
else
tmp = c0 / sqrt((l / (a / v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 1e-305) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+250) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((l / (A / V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 1e-305: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 5e+250: tmp = t_0 else: tmp = c0 / math.sqrt((l / (A / V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 1e-305) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+250) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(l / Float64(A / V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 1e-305)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 5e+250)
tmp = t_0;
else
tmp = c0 / sqrt((l / (A / V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-305], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+250], t$95$0, N[(c0 / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 10^{-305}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+250}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.99999999999999996e-306Initial program 69.4%
add-sqr-sqrt69.1%
pow269.1%
pow1/269.1%
sqrt-pow169.2%
metadata-eval69.2%
Applied egg-rr69.2%
Taylor expanded in c0 around 0 69.4%
associate-/l/75.0%
Simplified75.0%
if 9.99999999999999996e-306 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000002e250Initial program 99.0%
if 5.0000000000000002e250 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 52.4%
associate-/r*55.9%
Simplified55.9%
div-inv55.9%
clear-num55.9%
frac-times55.9%
metadata-eval55.9%
inv-pow55.9%
Applied egg-rr55.9%
unpow-155.9%
sqrt-div55.8%
metadata-eval55.8%
associate-*l/52.4%
associate-*r/55.8%
un-div-inv55.8%
associate-*r/52.4%
associate-*l/55.7%
*-commutative55.7%
clear-num55.8%
un-div-inv55.8%
Applied egg-rr55.8%
Final simplification78.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 1e-305)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 4e+250) t_0 (* c0 (sqrt (/ (/ A V) l)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 1e-305) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 4e+250) {
tmp = t_0;
} else {
tmp = c0 * sqrt(((A / 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) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 1d-305) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 4d+250) then
tmp = t_0
else
tmp = c0 * sqrt(((a / 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 t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 1e-305) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 4e+250) {
tmp = t_0;
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 1e-305: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 4e+250: tmp = t_0 else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 1e-305) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 4e+250) tmp = t_0; else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 1e-305)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 4e+250)
tmp = t_0;
else
tmp = c0 * sqrt(((A / 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_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-305], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+250], t$95$0, N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 10^{-305}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+250}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.99999999999999996e-306Initial program 69.4%
add-sqr-sqrt69.1%
pow269.1%
pow1/269.1%
sqrt-pow169.2%
metadata-eval69.2%
Applied egg-rr69.2%
Taylor expanded in c0 around 0 69.4%
associate-/l/75.0%
Simplified75.0%
if 9.99999999999999996e-306 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.9999999999999997e250Initial program 99.0%
if 3.9999999999999997e250 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 54.0%
associate-/r*57.4%
Simplified57.4%
Final simplification78.6%
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 (* (pow l -0.5) (sqrt (/ A V))))
(if (<= (* V l) -5e-318)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0 (/ (sqrt (/ (- A) l)) (sqrt (- V))))
(if (<= (* V l) 2e+305)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (sqrt (* (/ A V) (/ 1.0 l)))))))))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 * (pow(l, -0.5) * sqrt((A / V)));
} else if ((V * l) <= -5e-318) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
} else if ((V * l) <= 2e+305) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
}
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.pow(l, -0.5) * Math.sqrt((A / V)));
} else if ((V * l) <= -5e-318) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.sqrt((-A / l)) / Math.sqrt(-V));
} else if ((V * l) <= 2e+305) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
}
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.pow(l, -0.5) * math.sqrt((A / V))) elif (V * l) <= -5e-318: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 * (math.sqrt((-A / l)) / math.sqrt(-V)) elif (V * l) <= 2e+305: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / V) * (1.0 / 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) <= Float64(-Inf)) tmp = Float64(c0 * Float64((l ^ -0.5) * sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -5e-318) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= 2e+305) 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
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 * ((l ^ -0.5) * sqrt((A / V)));
elseif ((V * l) <= -5e-318)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
elseif ((V * l) <= 2e+305)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 * sqrt(((A / V) * (1.0 / 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], (-Infinity)], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-318], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+305], 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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{A}{V}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-318}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+305}:\\
\;\;\;\;\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}
if (*.f64 V l) < -inf.0Initial program 40.5%
associate-/r*69.6%
Simplified69.6%
div-inv69.7%
Applied egg-rr69.7%
sqrt-prod43.5%
*-commutative43.5%
inv-pow43.5%
sqrt-pow143.5%
metadata-eval43.5%
Applied egg-rr43.5%
if -inf.0 < (*.f64 V l) < -4.9999987e-318Initial program 83.9%
frac-2neg83.9%
sqrt-div99.0%
distribute-rgt-neg-in99.0%
Applied egg-rr99.0%
distribute-rgt-neg-out99.0%
*-commutative99.0%
distribute-rgt-neg-in99.0%
Simplified99.0%
if -4.9999987e-318 < (*.f64 V l) < -0.0Initial program 28.5%
add-sqr-sqrt28.5%
pow228.5%
pow1/228.5%
sqrt-pow128.5%
metadata-eval28.5%
Applied egg-rr28.5%
Taylor expanded in c0 around 0 28.5%
associate-/l/52.5%
Simplified52.5%
frac-2neg52.5%
sqrt-div37.7%
distribute-neg-frac37.7%
Applied egg-rr37.7%
if -0.0 < (*.f64 V l) < 1.9999999999999999e305Initial program 86.1%
associate-/r*77.2%
Simplified77.2%
div-inv77.2%
clear-num76.7%
frac-times76.2%
metadata-eval76.2%
inv-pow76.2%
Applied egg-rr76.2%
unpow-176.2%
sqrt-div76.1%
metadata-eval76.1%
associate-*l/84.8%
associate-*r/73.6%
un-div-inv73.8%
associate-*r/85.0%
associate-*l/76.3%
*-commutative76.3%
clear-num75.6%
un-div-inv76.0%
Applied egg-rr76.0%
associate-/r/73.8%
associate-*l/85.0%
*-commutative85.0%
sqrt-div99.4%
*-commutative99.4%
Applied egg-rr99.4%
if 1.9999999999999999e305 < (*.f64 V l) Initial program 44.2%
associate-/r*93.2%
Simplified93.2%
div-inv93.3%
Applied egg-rr93.3%
Final simplification89.6%
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 (* (pow l -0.5) (sqrt (/ A V))))
(if (<= (* V l) -4e-320)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 1.02e-238)
(* c0 (pow (/ l (/ A V)) -0.5))
(if (<= (* V l) 2e+305)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (sqrt (* (/ A V) (/ 1.0 l)))))))))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 * (pow(l, -0.5) * sqrt((A / V)));
} else if ((V * l) <= -4e-320) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 1.02e-238) {
tmp = c0 * pow((l / (A / V)), -0.5);
} else if ((V * l) <= 2e+305) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
}
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.pow(l, -0.5) * Math.sqrt((A / V)));
} else if ((V * l) <= -4e-320) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 1.02e-238) {
tmp = c0 * Math.pow((l / (A / V)), -0.5);
} else if ((V * l) <= 2e+305) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
}
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.pow(l, -0.5) * math.sqrt((A / V))) elif (V * l) <= -4e-320: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 1.02e-238: tmp = c0 * math.pow((l / (A / V)), -0.5) elif (V * l) <= 2e+305: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / V) * (1.0 / 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) <= Float64(-Inf)) tmp = Float64(c0 * Float64((l ^ -0.5) * sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -4e-320) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 1.02e-238) tmp = Float64(c0 * (Float64(l / Float64(A / V)) ^ -0.5)); elseif (Float64(V * l) <= 2e+305) 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
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 * ((l ^ -0.5) * sqrt((A / V)));
elseif ((V * l) <= -4e-320)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 1.02e-238)
tmp = c0 * ((l / (A / V)) ^ -0.5);
elseif ((V * l) <= 2e+305)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 * sqrt(((A / V) * (1.0 / 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], (-Infinity)], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-320], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1.02e-238], N[(c0 * N[Power[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+305], 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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{A}{V}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-320}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 1.02 \cdot 10^{-238}:\\
\;\;\;\;c0 \cdot {\left(\frac{\ell}{\frac{A}{V}}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+305}:\\
\;\;\;\;\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}
if (*.f64 V l) < -inf.0Initial program 40.5%
associate-/r*69.6%
Simplified69.6%
div-inv69.7%
Applied egg-rr69.7%
sqrt-prod43.5%
*-commutative43.5%
inv-pow43.5%
sqrt-pow143.5%
metadata-eval43.5%
Applied egg-rr43.5%
if -inf.0 < (*.f64 V l) < -3.99996e-320Initial program 83.0%
frac-2neg83.0%
sqrt-div98.4%
distribute-rgt-neg-in98.4%
Applied egg-rr98.4%
distribute-rgt-neg-out98.4%
*-commutative98.4%
distribute-rgt-neg-in98.4%
Simplified98.4%
if -3.99996e-320 < (*.f64 V l) < 1.01999999999999992e-238Initial program 45.9%
add-sqr-sqrt45.9%
pow245.9%
pow1/245.9%
sqrt-pow145.9%
metadata-eval45.9%
Applied egg-rr45.9%
Taylor expanded in c0 around 0 45.9%
associate-/l/65.1%
Simplified65.1%
associate-/l/45.9%
clear-num45.9%
associate-*l/65.1%
unpow-165.1%
sqrt-pow165.2%
*-commutative65.2%
clear-num65.2%
un-div-inv65.2%
metadata-eval65.2%
Applied egg-rr65.2%
if 1.01999999999999992e-238 < (*.f64 V l) < 1.9999999999999999e305Initial program 85.2%
associate-/r*75.7%
Simplified75.7%
div-inv75.7%
clear-num75.1%
frac-times74.6%
metadata-eval74.6%
inv-pow74.6%
Applied egg-rr74.6%
unpow-174.6%
sqrt-div74.5%
metadata-eval74.5%
associate-*l/83.8%
associate-*r/71.8%
un-div-inv72.0%
associate-*r/84.0%
associate-*l/74.7%
*-commutative74.7%
clear-num73.9%
un-div-inv74.4%
Applied egg-rr74.4%
associate-/r/72.0%
associate-*l/84.0%
*-commutative84.0%
sqrt-div99.4%
*-commutative99.4%
Applied egg-rr99.4%
if 1.9999999999999999e305 < (*.f64 V l) Initial program 44.2%
associate-/r*93.2%
Simplified93.2%
div-inv93.3%
Applied egg-rr93.3%
Final simplification91.2%
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+40)
(* c0 (* (pow l -0.5) (sqrt (/ A V))))
(if (<= (* V l) -5e-42)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 2e+305)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (sqrt (* (/ A V) (/ 1.0 l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+40) {
tmp = c0 * (pow(l, -0.5) * sqrt((A / V)));
} else if ((V * l) <= -5e-42) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 2e+305) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * sqrt(((A / V) * (1.0 / 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+40)) then
tmp = c0 * ((l ** (-0.5d0)) * sqrt((a / v)))
else if ((v * l) <= (-5d-42)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 2d+305) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = c0 * sqrt(((a / v) * (1.0d0 / 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+40) {
tmp = c0 * (Math.pow(l, -0.5) * Math.sqrt((A / V)));
} else if ((V * l) <= -5e-42) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 2e+305) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+40: tmp = c0 * (math.pow(l, -0.5) * math.sqrt((A / V))) elif (V * l) <= -5e-42: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 2e+305: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / V) * (1.0 / 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+40) tmp = Float64(c0 * Float64((l ^ -0.5) * sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -5e-42) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 2e+305) 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
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+40)
tmp = c0 * ((l ^ -0.5) * sqrt((A / V)));
elseif ((V * l) <= -5e-42)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 2e+305)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 * sqrt(((A / V) * (1.0 / 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+40], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-42], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+305], 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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+40}:\\
\;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{A}{V}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-42}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+305}:\\
\;\;\;\;\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}
if (*.f64 V l) < -1.00000000000000003e40Initial program 68.7%
associate-/r*74.7%
Simplified74.7%
div-inv74.7%
Applied egg-rr74.7%
sqrt-prod38.9%
*-commutative38.9%
inv-pow38.9%
sqrt-pow138.9%
metadata-eval38.9%
Applied egg-rr38.9%
if -1.00000000000000003e40 < (*.f64 V l) < -5.00000000000000003e-42Initial program 99.6%
if -5.00000000000000003e-42 < (*.f64 V l) < -0.0Initial program 63.2%
associate-/r*68.6%
Simplified68.6%
div-inv68.5%
clear-num68.5%
frac-times68.4%
metadata-eval68.4%
inv-pow68.4%
Applied egg-rr68.4%
unpow-168.4%
sqrt-div68.4%
metadata-eval68.4%
associate-*l/63.1%
associate-*r/69.7%
un-div-inv69.8%
associate-*r/63.2%
associate-*l/68.4%
*-commutative68.4%
clear-num68.4%
un-div-inv68.6%
Applied egg-rr68.6%
pow1/268.6%
div-inv68.4%
unpow-prod-down39.7%
pow1/239.7%
clear-num40.3%
Applied egg-rr40.3%
unpow1/240.3%
Simplified40.3%
if -0.0 < (*.f64 V l) < 1.9999999999999999e305Initial program 86.1%
associate-/r*77.2%
Simplified77.2%
div-inv77.2%
clear-num76.7%
frac-times76.2%
metadata-eval76.2%
inv-pow76.2%
Applied egg-rr76.2%
unpow-176.2%
sqrt-div76.1%
metadata-eval76.1%
associate-*l/84.8%
associate-*r/73.6%
un-div-inv73.8%
associate-*r/85.0%
associate-*l/76.3%
*-commutative76.3%
clear-num75.6%
un-div-inv76.0%
Applied egg-rr76.0%
associate-/r/73.8%
associate-*l/85.0%
*-commutative85.0%
sqrt-div99.4%
*-commutative99.4%
Applied egg-rr99.4%
if 1.9999999999999999e305 < (*.f64 V l) Initial program 44.2%
associate-/r*93.2%
Simplified93.2%
div-inv93.3%
Applied egg-rr93.3%
Final simplification71.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 (<= (* V l) -1e+40)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -5e-42)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 2e+305)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (sqrt (* (/ A V) (/ 1.0 l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+40) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -5e-42) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 2e+305) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * sqrt(((A / V) * (1.0 / 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+40)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-5d-42)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 2d+305) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = c0 * sqrt(((a / v) * (1.0d0 / 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+40) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -5e-42) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 2e+305) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+40: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -5e-42: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 2e+305: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / V) * (1.0 / 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+40) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -5e-42) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 2e+305) 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
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+40)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -5e-42)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 2e+305)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 * sqrt(((A / V) * (1.0 / 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+40], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-42], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+305], 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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+40}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-42}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+305}:\\
\;\;\;\;\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}
if (*.f64 V l) < -1.00000000000000003e40Initial program 68.7%
associate-/r*74.7%
sqrt-div38.9%
div-inv38.9%
Applied egg-rr38.9%
associate-*r/38.9%
*-rgt-identity38.9%
Simplified38.9%
if -1.00000000000000003e40 < (*.f64 V l) < -5.00000000000000003e-42Initial program 99.6%
if -5.00000000000000003e-42 < (*.f64 V l) < -0.0Initial program 63.2%
associate-/r*68.6%
Simplified68.6%
div-inv68.5%
clear-num68.5%
frac-times68.4%
metadata-eval68.4%
inv-pow68.4%
Applied egg-rr68.4%
unpow-168.4%
sqrt-div68.4%
metadata-eval68.4%
associate-*l/63.1%
associate-*r/69.7%
un-div-inv69.8%
associate-*r/63.2%
associate-*l/68.4%
*-commutative68.4%
clear-num68.4%
un-div-inv68.6%
Applied egg-rr68.6%
pow1/268.6%
div-inv68.4%
unpow-prod-down39.7%
pow1/239.7%
clear-num40.3%
Applied egg-rr40.3%
unpow1/240.3%
Simplified40.3%
if -0.0 < (*.f64 V l) < 1.9999999999999999e305Initial program 86.1%
associate-/r*77.2%
Simplified77.2%
div-inv77.2%
clear-num76.7%
frac-times76.2%
metadata-eval76.2%
inv-pow76.2%
Applied egg-rr76.2%
unpow-176.2%
sqrt-div76.1%
metadata-eval76.1%
associate-*l/84.8%
associate-*r/73.6%
un-div-inv73.8%
associate-*r/85.0%
associate-*l/76.3%
*-commutative76.3%
clear-num75.6%
un-div-inv76.0%
Applied egg-rr76.0%
associate-/r/73.8%
associate-*l/85.0%
*-commutative85.0%
sqrt-div99.4%
*-commutative99.4%
Applied egg-rr99.4%
if 1.9999999999999999e305 < (*.f64 V l) Initial program 44.2%
associate-/r*93.2%
Simplified93.2%
div-inv93.3%
Applied egg-rr93.3%
Final simplification71.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 (<= (* V l) -1e+40)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -5e-42)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 2e+305)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (* (/ A V) (/ 1.0 l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+40) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -5e-42) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 2e+305) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / V) * (1.0 / 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+40)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-5d-42)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 2d+305) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / v) * (1.0d0 / 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+40) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -5e-42) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 2e+305) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+40: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -5e-42: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 2e+305: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) * (1.0 / 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+40) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -5e-42) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 2e+305) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / 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+40)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -5e-42)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 2e+305)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / V) * (1.0 / 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+40], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-42], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+305], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / 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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+40}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-42}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+305}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.00000000000000003e40Initial program 68.7%
associate-/r*74.7%
sqrt-div38.9%
div-inv38.9%
Applied egg-rr38.9%
associate-*r/38.9%
*-rgt-identity38.9%
Simplified38.9%
if -1.00000000000000003e40 < (*.f64 V l) < -5.00000000000000003e-42Initial program 99.6%
if -5.00000000000000003e-42 < (*.f64 V l) < -0.0Initial program 63.2%
associate-/r*68.6%
Simplified68.6%
div-inv68.5%
clear-num68.5%
frac-times68.4%
metadata-eval68.4%
inv-pow68.4%
Applied egg-rr68.4%
unpow-168.4%
sqrt-div68.4%
metadata-eval68.4%
associate-*l/63.1%
associate-*r/69.7%
un-div-inv69.8%
associate-*r/63.2%
associate-*l/68.4%
*-commutative68.4%
clear-num68.4%
un-div-inv68.6%
Applied egg-rr68.6%
pow1/268.6%
div-inv68.4%
unpow-prod-down39.7%
pow1/239.7%
clear-num40.3%
Applied egg-rr40.3%
unpow1/240.3%
Simplified40.3%
if -0.0 < (*.f64 V l) < 1.9999999999999999e305Initial program 86.1%
sqrt-div99.3%
div-inv99.2%
Applied egg-rr99.2%
associate-*r/99.3%
*-rgt-identity99.3%
Simplified99.3%
if 1.9999999999999999e305 < (*.f64 V l) Initial program 44.2%
associate-/r*93.2%
Simplified93.2%
div-inv93.3%
Applied egg-rr93.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
(if (<= (* V l) -2e+130)
t_0
(if (<= (* V l) -5e-88)
(/ c0 (pow (/ A (* V l)) -0.5))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 2e+305)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (* (/ A V) (/ 1.0 l))))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -2e+130) {
tmp = t_0;
} else if ((V * l) <= -5e-88) {
tmp = c0 / pow((A / (V * l)), -0.5);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 2e+305) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-2d+130)) then
tmp = t_0
else if ((v * l) <= (-5d-88)) then
tmp = c0 / ((a / (v * l)) ** (-0.5d0))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 2d+305) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / v) * (1.0d0 / l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -2e+130) {
tmp = t_0;
} else if ((V * l) <= -5e-88) {
tmp = c0 / Math.pow((A / (V * l)), -0.5);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 2e+305) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -2e+130: tmp = t_0 elif (V * l) <= -5e-88: tmp = c0 / math.pow((A / (V * l)), -0.5) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 2e+305: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) * (1.0 / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -2e+130) tmp = t_0; elseif (Float64(V * l) <= -5e-88) tmp = Float64(c0 / (Float64(A / Float64(V * l)) ^ -0.5)); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 2e+305) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -2e+130)
tmp = t_0;
elseif ((V * l) <= -5e-88)
tmp = c0 / ((A / (V * l)) ^ -0.5);
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 2e+305)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+130], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-88], N[(c0 / N[Power[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 2e+305], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / 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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+130}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-88}:\\
\;\;\;\;\frac{c0}{{\left(\frac{A}{V \cdot \ell}\right)}^{-0.5}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+305}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.0000000000000001e130 or -5.00000000000000009e-88 < (*.f64 V l) < -0.0Initial program 61.1%
associate-/r*69.2%
sqrt-div38.6%
div-inv38.6%
Applied egg-rr38.6%
associate-*r/38.6%
*-rgt-identity38.6%
Simplified38.6%
if -2.0000000000000001e130 < (*.f64 V l) < -5.00000000000000009e-88Initial program 99.4%
associate-/r*76.7%
Simplified76.7%
div-inv76.6%
clear-num76.6%
frac-times76.6%
metadata-eval76.6%
inv-pow76.6%
Applied egg-rr76.6%
unpow-176.6%
sqrt-div76.5%
metadata-eval76.5%
associate-*l/95.6%
associate-*r/84.2%
un-div-inv84.5%
associate-*r/95.8%
associate-*l/76.7%
*-commutative76.7%
clear-num76.7%
un-div-inv76.7%
Applied egg-rr76.7%
sqrt-div40.3%
clear-num40.1%
sqrt-div76.5%
inv-pow76.5%
sqrt-pow276.7%
associate-/l/99.5%
metadata-eval99.5%
Applied egg-rr99.5%
if -0.0 < (*.f64 V l) < 1.9999999999999999e305Initial program 86.1%
sqrt-div99.3%
div-inv99.2%
Applied egg-rr99.2%
associate-*r/99.3%
*-rgt-identity99.3%
Simplified99.3%
if 1.9999999999999999e305 < (*.f64 V l) Initial program 44.2%
associate-/r*93.2%
Simplified93.2%
div-inv93.3%
Applied egg-rr93.3%
Final simplification73.9%
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+131)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= (* V l) -5e-88)
(/ c0 (pow (/ A (* V l)) -0.5))
(if (<= (* V l) 1.02e-238)
(* c0 (pow (/ l (/ A V)) -0.5))
(if (<= (* V l) 2e+305)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (* (/ A V) (/ 1.0 l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+131) {
tmp = c0 * sqrt(((A / l) / V));
} else if ((V * l) <= -5e-88) {
tmp = c0 / pow((A / (V * l)), -0.5);
} else if ((V * l) <= 1.02e-238) {
tmp = c0 * pow((l / (A / V)), -0.5);
} else if ((V * l) <= 2e+305) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / V) * (1.0 / 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+131)) then
tmp = c0 * sqrt(((a / l) / v))
else if ((v * l) <= (-5d-88)) then
tmp = c0 / ((a / (v * l)) ** (-0.5d0))
else if ((v * l) <= 1.02d-238) then
tmp = c0 * ((l / (a / v)) ** (-0.5d0))
else if ((v * l) <= 2d+305) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / v) * (1.0d0 / 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+131) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if ((V * l) <= -5e-88) {
tmp = c0 / Math.pow((A / (V * l)), -0.5);
} else if ((V * l) <= 1.02e-238) {
tmp = c0 * Math.pow((l / (A / V)), -0.5);
} else if ((V * l) <= 2e+305) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+131: tmp = c0 * math.sqrt(((A / l) / V)) elif (V * l) <= -5e-88: tmp = c0 / math.pow((A / (V * l)), -0.5) elif (V * l) <= 1.02e-238: tmp = c0 * math.pow((l / (A / V)), -0.5) elif (V * l) <= 2e+305: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) * (1.0 / 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+131) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (Float64(V * l) <= -5e-88) tmp = Float64(c0 / (Float64(A / Float64(V * l)) ^ -0.5)); elseif (Float64(V * l) <= 1.02e-238) tmp = Float64(c0 * (Float64(l / Float64(A / V)) ^ -0.5)); elseif (Float64(V * l) <= 2e+305) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / 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+131)
tmp = c0 * sqrt(((A / l) / V));
elseif ((V * l) <= -5e-88)
tmp = c0 / ((A / (V * l)) ^ -0.5);
elseif ((V * l) <= 1.02e-238)
tmp = c0 * ((l / (A / V)) ^ -0.5);
elseif ((V * l) <= 2e+305)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / V) * (1.0 / 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+131], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-88], N[(c0 / N[Power[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1.02e-238], N[(c0 * N[Power[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+305], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / 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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+131}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-88}:\\
\;\;\;\;\frac{c0}{{\left(\frac{A}{V \cdot \ell}\right)}^{-0.5}}\\
\mathbf{elif}\;V \cdot \ell \leq 1.02 \cdot 10^{-238}:\\
\;\;\;\;c0 \cdot {\left(\frac{\ell}{\frac{A}{V}}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+305}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.9999999999999991e130Initial program 61.2%
add-sqr-sqrt61.0%
pow261.0%
pow1/261.0%
sqrt-pow161.0%
metadata-eval61.0%
Applied egg-rr61.0%
Taylor expanded in c0 around 0 61.2%
associate-/l/71.4%
Simplified71.4%
if -9.9999999999999991e130 < (*.f64 V l) < -5.00000000000000009e-88Initial program 99.5%
associate-/r*73.9%
Simplified73.9%
div-inv73.8%
clear-num73.8%
frac-times73.8%
metadata-eval73.8%
inv-pow73.8%
Applied egg-rr73.8%
unpow-173.8%
sqrt-div73.8%
metadata-eval73.8%
associate-*l/95.7%
associate-*r/84.8%
un-div-inv85.1%
associate-*r/96.0%
associate-*l/73.9%
*-commutative73.9%
clear-num73.9%
un-div-inv73.9%
Applied egg-rr73.9%
sqrt-div38.7%
clear-num38.6%
sqrt-div73.8%
inv-pow73.8%
sqrt-pow273.9%
associate-/l/99.5%
metadata-eval99.5%
Applied egg-rr99.5%
if -5.00000000000000009e-88 < (*.f64 V l) < 1.01999999999999992e-238Initial program 64.2%
add-sqr-sqrt63.9%
pow263.9%
pow1/263.9%
sqrt-pow164.0%
metadata-eval64.0%
Applied egg-rr64.0%
Taylor expanded in c0 around 0 64.2%
associate-/l/70.7%
Simplified70.7%
associate-/l/64.2%
clear-num64.1%
associate-*l/70.5%
unpow-170.5%
sqrt-pow170.6%
*-commutative70.6%
clear-num70.6%
un-div-inv70.7%
metadata-eval70.7%
Applied egg-rr70.7%
if 1.01999999999999992e-238 < (*.f64 V l) < 1.9999999999999999e305Initial program 85.2%
sqrt-div99.3%
div-inv99.2%
Applied egg-rr99.2%
associate-*r/99.3%
*-rgt-identity99.3%
Simplified99.3%
if 1.9999999999999999e305 < (*.f64 V l) Initial program 44.2%
associate-/r*93.2%
Simplified93.2%
div-inv93.3%
Applied egg-rr93.3%
Final simplification86.6%
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 74.6%
herbie shell --seed 2024111
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))