
(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 14 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 (<= A -2e-310) (* c0 (/ (/ (sqrt (- A)) (sqrt (- V))) (sqrt l))) (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -2e-310) {
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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 <= (-2d-310)) then
tmp = c0 * ((sqrt(-a) / sqrt(-v)) / sqrt(l))
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / 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 <= -2e-310) {
tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -2e-310: tmp = c0 * ((math.sqrt(-A) / math.sqrt(-V)) / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -2e-310) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / 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 <= -2e-310)
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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, -2e-310], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / 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 -2 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if A < -1.999999999999994e-310Initial program 75.6%
associate-/r*76.8%
sqrt-div47.0%
associate-*r/44.0%
Applied egg-rr44.0%
associate-/l*47.0%
Simplified47.0%
frac-2neg47.0%
sqrt-div53.0%
Applied egg-rr53.0%
if -1.999999999999994e-310 < A Initial program 75.3%
pow1/275.3%
div-inv75.3%
unpow-prod-down88.1%
pow1/288.1%
Applied egg-rr88.1%
unpow1/288.1%
associate-/r*88.4%
Simplified88.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 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 4e-272)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+185) t_0 (* c0 (pow (* l (/ V A)) -0.5))))))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 <= 4e-272) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 1e+185) {
tmp = t_0;
} else {
tmp = c0 * pow((l * (V / A)), -0.5);
}
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 <= 4d-272) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 1d+185) then
tmp = t_0
else
tmp = c0 * ((l * (v / a)) ** (-0.5d0))
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 <= 4e-272) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+185) {
tmp = t_0;
} else {
tmp = c0 * Math.pow((l * (V / A)), -0.5);
}
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 <= 4e-272: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 1e+185: tmp = t_0 else: tmp = c0 * math.pow((l * (V / A)), -0.5) 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 <= 4e-272) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+185) tmp = t_0; else tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5)); 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 <= 4e-272)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 1e+185)
tmp = t_0;
else
tmp = c0 * ((l * (V / A)) ^ -0.5);
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, 4e-272], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+185], t$95$0, N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $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 4 \cdot 10^{-272}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 10^{+185}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999972e-272Initial program 71.6%
associate-/r*75.8%
Simplified75.8%
if 3.99999999999999972e-272 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999998e184Initial program 99.7%
if 9.9999999999999998e184 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 64.3%
associate-/r*67.6%
div-inv67.6%
Applied egg-rr67.6%
associate-*l/66.5%
div-inv66.5%
frac-2neg66.5%
sqrt-div44.0%
Applied egg-rr44.0%
distribute-neg-frac244.0%
Simplified44.0%
clear-num43.9%
sqrt-undiv68.0%
add-sqr-sqrt38.8%
sqrt-unprod34.9%
sqr-neg34.9%
sqrt-unprod0.1%
add-sqr-sqrt0.1%
add-sqr-sqrt0.0%
sqrt-unprod27.8%
sqr-neg27.8%
sqrt-unprod34.8%
add-sqr-sqrt68.0%
un-div-inv67.5%
clear-num67.5%
associate-*r/65.9%
associate-*l/68.5%
*-commutative68.5%
pow1/268.5%
Applied egg-rr68.5%
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 4e-272) (not (<= t_0 1e+121)))
(* 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 <= 4e-272) || !(t_0 <= 1e+121)) {
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 <= 4d-272) .or. (.not. (t_0 <= 1d+121))) 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 <= 4e-272) || !(t_0 <= 1e+121)) {
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 <= 4e-272) or not (t_0 <= 1e+121): 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 <= 4e-272) || !(t_0 <= 1e+121)) 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 <= 4e-272) || ~((t_0 <= 1e+121)))
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, 4e-272], N[Not[LessEqual[t$95$0, 1e+121]], $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 4 \cdot 10^{-272} \lor \neg \left(t\_0 \leq 10^{+121}\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)))) < 3.99999999999999972e-272 or 1.00000000000000004e121 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 70.2%
associate-/r*74.1%
Simplified74.1%
if 3.99999999999999972e-272 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.00000000000000004e121Initial program 99.7%
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 4e-272)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+157) t_0 (/ c0 (sqrt (* l (/ V A))))))))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 <= 4e-272) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+157) {
tmp = t_0;
} else {
tmp = c0 / sqrt((l * (V / 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) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 4d-272) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+157) then
tmp = t_0
else
tmp = c0 / sqrt((l * (v / 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 t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-272) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+157) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
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 <= 4e-272: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+157: tmp = t_0 else: tmp = c0 / math.sqrt((l * (V / A))) 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 <= 4e-272) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+157) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); 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 <= 4e-272)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+157)
tmp = t_0;
else
tmp = c0 / sqrt((l * (V / 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_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-272], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+157], t$95$0, N[(c0 / N[Sqrt[N[(l * N[(V / A), $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 4 \cdot 10^{-272}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+157}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999972e-272Initial program 71.6%
associate-/r*75.8%
Simplified75.8%
if 3.99999999999999972e-272 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999997e157Initial program 99.7%
if 1.99999999999999997e157 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 65.6%
associate-/r*68.8%
div-inv68.7%
Applied egg-rr68.7%
un-div-inv68.8%
sqrt-undiv47.0%
clear-num47.0%
un-div-inv47.0%
sqrt-undiv69.7%
Applied egg-rr69.7%
associate-/r/66.9%
associate-*l/67.0%
associate-*r/69.6%
Simplified69.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 4e-272)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+224) t_0 (/ c0 (sqrt (* V (/ l A))))))))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 <= 4e-272) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+224) {
tmp = t_0;
} else {
tmp = c0 / sqrt((V * (l / 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) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 4d-272) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+224) then
tmp = t_0
else
tmp = c0 / sqrt((v * (l / 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 t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-272) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+224) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
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 <= 4e-272: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+224: tmp = t_0 else: tmp = c0 / math.sqrt((V * (l / A))) 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 <= 4e-272) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+224) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); 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 <= 4e-272)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+224)
tmp = t_0;
else
tmp = c0 / sqrt((V * (l / 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_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-272], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+224], t$95$0, N[(c0 / N[Sqrt[N[(V * N[(l / A), $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 4 \cdot 10^{-272}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+224}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999972e-272Initial program 71.6%
associate-/r*75.8%
Simplified75.8%
if 3.99999999999999972e-272 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999994e224Initial program 99.7%
if 1.99999999999999994e224 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 58.5%
associate-/r*64.4%
div-inv64.4%
Applied egg-rr64.4%
un-div-inv64.4%
sqrt-undiv48.4%
clear-num48.4%
un-div-inv48.4%
sqrt-undiv65.4%
Applied egg-rr65.4%
associate-/r/66.1%
*-commutative66.1%
Simplified66.1%
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 l) (sqrt (/ V A))))
(if (<= (* V l) -2e-225)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 1e-288)
(* c0 (/ 1.0 (sqrt (* V (/ l A)))))
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) 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 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= -2e-225) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 1e-288) {
tmp = c0 * (1.0 / sqrt((V * (l / A))));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / 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.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= -2e-225) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 1e-288) {
tmp = c0 * (1.0 / Math.sqrt((V * (l / A))));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / 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.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= -2e-225: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 1e-288: tmp = c0 * (1.0 / math.sqrt((V * (l / A)))) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / 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) <= Float64(-Inf)) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= -2e-225) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 1e-288) tmp = Float64(c0 * Float64(1.0 / sqrt(Float64(V * Float64(l / A))))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / 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) <= -Inf)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= -2e-225)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 1e-288)
tmp = c0 * (1.0 / sqrt((V * (l / A))));
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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], (-Infinity)], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-225], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-288], N[(c0 * N[(1.0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / 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:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-225}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-288}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 25.6%
associate-/r*73.3%
div-inv73.4%
Applied egg-rr73.4%
un-div-inv73.3%
sqrt-undiv44.5%
clear-num44.4%
un-div-inv44.7%
sqrt-undiv68.1%
Applied egg-rr68.1%
associate-/r/68.2%
associate-*l/25.6%
associate-*r/68.2%
Simplified68.2%
add-sqr-sqrt27.7%
sqrt-prod5.6%
times-frac5.6%
Applied egg-rr5.6%
associate-*l/5.6%
associate-*r/5.6%
rem-square-sqrt44.8%
associate-/r*44.9%
Simplified44.9%
if -inf.0 < (*.f64 V l) < -1.9999999999999999e-225Initial program 90.1%
frac-2neg90.1%
sqrt-div99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -1.9999999999999999e-225 < (*.f64 V l) < 1.00000000000000006e-288Initial program 59.9%
associate-/r*76.5%
clear-num76.4%
sqrt-div76.5%
metadata-eval76.5%
clear-num76.5%
associate-/r*59.8%
clear-num59.8%
associate-/l*76.5%
Applied egg-rr76.5%
if 1.00000000000000006e-288 < (*.f64 V l) Initial program 77.8%
pow1/277.8%
div-inv77.8%
unpow-prod-down92.8%
pow1/292.8%
Applied egg-rr92.8%
unpow1/292.8%
associate-/r*93.2%
Simplified93.2%
Final simplification89.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 l) (sqrt (/ V A))))))
(if (<= (* V l) -1e+150)
t_0
(if (<= (* V l) -2e-124)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0) t_0 (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 / (sqrt(l) * sqrt((V / A)));
double tmp;
if ((V * l) <= -1e+150) {
tmp = t_0;
} else if ((V * l) <= -2e-124) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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(l) * sqrt((v / a)))
if ((v * l) <= (-1d+150)) then
tmp = t_0
else if ((v * l) <= (-2d-124)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / 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(l) * Math.sqrt((V / A)));
double tmp;
if ((V * l) <= -1e+150) {
tmp = t_0;
} else if ((V * l) <= -2e-124) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 / (math.sqrt(l) * math.sqrt((V / A))) tmp = 0 if (V * l) <= -1e+150: tmp = t_0 elif (V * l) <= -2e-124: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = t_0 else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))) tmp = 0.0 if (Float64(V * l) <= -1e+150) tmp = t_0; elseif (Float64(V * l) <= -2e-124) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = t_0; else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / 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(l) * sqrt((V / A)));
tmp = 0.0;
if ((V * l) <= -1e+150)
tmp = t_0;
elseif ((V * l) <= -2e-124)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+150], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-124], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+150}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-124}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999981e149 or -1.99999999999999987e-124 < (*.f64 V l) < -0.0Initial program 57.7%
associate-/r*73.2%
div-inv73.1%
Applied egg-rr73.1%
un-div-inv73.2%
sqrt-undiv46.5%
clear-num46.5%
un-div-inv46.5%
sqrt-undiv72.6%
Applied egg-rr72.6%
associate-/r/73.6%
associate-*l/56.7%
associate-*r/72.6%
Simplified72.6%
add-sqr-sqrt35.1%
sqrt-prod20.8%
times-frac20.8%
Applied egg-rr20.8%
associate-*l/20.8%
associate-*r/20.8%
rem-square-sqrt44.8%
associate-/r*47.0%
Simplified47.0%
if -9.99999999999999981e149 < (*.f64 V l) < -1.99999999999999987e-124Initial program 95.9%
if -0.0 < (*.f64 V l) Initial program 78.4%
pow1/278.4%
div-inv78.4%
unpow-prod-down93.0%
pow1/293.0%
Applied egg-rr93.0%
unpow1/293.0%
associate-/r*93.3%
Simplified93.3%
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 l) (sqrt (/ V A))))))
(if (<= (* V l) -1e+150)
t_0
(if (<= (* V l) -2e-124)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0) t_0 (* (pow (* V l) -0.5) (* c0 (sqrt A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 / (sqrt(l) * sqrt((V / A)));
double tmp;
if ((V * l) <= -1e+150) {
tmp = t_0;
} else if ((V * l) <= -2e-124) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = pow((V * l), -0.5) * (c0 * 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) :: t_0
real(8) :: tmp
t_0 = c0 / (sqrt(l) * sqrt((v / a)))
if ((v * l) <= (-1d+150)) then
tmp = t_0
else if ((v * l) <= (-2d-124)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else
tmp = ((v * l) ** (-0.5d0)) * (c0 * 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 t_0 = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
double tmp;
if ((V * l) <= -1e+150) {
tmp = t_0;
} else if ((V * l) <= -2e-124) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = Math.pow((V * l), -0.5) * (c0 * Math.sqrt(A));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 / (math.sqrt(l) * math.sqrt((V / A))) tmp = 0 if (V * l) <= -1e+150: tmp = t_0 elif (V * l) <= -2e-124: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = t_0 else: tmp = math.pow((V * l), -0.5) * (c0 * math.sqrt(A)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))) tmp = 0.0 if (Float64(V * l) <= -1e+150) tmp = t_0; elseif (Float64(V * l) <= -2e-124) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = t_0; else tmp = Float64((Float64(V * l) ^ -0.5) * Float64(c0 * sqrt(A))); 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(l) * sqrt((V / A)));
tmp = 0.0;
if ((V * l) <= -1e+150)
tmp = t_0;
elseif ((V * l) <= -2e-124)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
else
tmp = ((V * l) ^ -0.5) * (c0 * 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_] := Block[{t$95$0 = N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+150], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-124], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+150}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-124}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;{\left(V \cdot \ell\right)}^{-0.5} \cdot \left(c0 \cdot \sqrt{A}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999981e149 or -1.99999999999999987e-124 < (*.f64 V l) < -0.0Initial program 57.7%
associate-/r*73.2%
div-inv73.1%
Applied egg-rr73.1%
un-div-inv73.2%
sqrt-undiv46.5%
clear-num46.5%
un-div-inv46.5%
sqrt-undiv72.6%
Applied egg-rr72.6%
associate-/r/73.6%
associate-*l/56.7%
associate-*r/72.6%
Simplified72.6%
add-sqr-sqrt35.1%
sqrt-prod20.8%
times-frac20.8%
Applied egg-rr20.8%
associate-*l/20.8%
associate-*r/20.8%
rem-square-sqrt44.8%
associate-/r*47.0%
Simplified47.0%
if -9.99999999999999981e149 < (*.f64 V l) < -1.99999999999999987e-124Initial program 95.9%
if -0.0 < (*.f64 V l) Initial program 78.4%
*-commutative78.4%
sqrt-div93.0%
associate-*l/90.5%
Applied egg-rr90.5%
clear-num90.4%
associate-/r/90.5%
pow1/290.5%
pow-flip90.7%
metadata-eval90.7%
*-commutative90.7%
Applied egg-rr90.7%
Final simplification77.5%
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 l) (sqrt (/ V A))))))
(if (<= (* V l) -1e+150)
t_0
(if (<= (* V l) -2e-124)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0) t_0 (/ (* c0 (sqrt A)) (sqrt (* V l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 / (sqrt(l) * sqrt((V / A)));
double tmp;
if ((V * l) <= -1e+150) {
tmp = t_0;
} else if ((V * l) <= -2e-124) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = c0 / (sqrt(l) * sqrt((v / a)))
if ((v * l) <= (-1d+150)) then
tmp = t_0
else if ((v * l) <= (-2d-124)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = t_0
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 t_0 = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
double tmp;
if ((V * l) <= -1e+150) {
tmp = t_0;
} else if ((V * l) <= -2e-124) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} 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): t_0 = c0 / (math.sqrt(l) * math.sqrt((V / A))) tmp = 0 if (V * l) <= -1e+150: tmp = t_0 elif (V * l) <= -2e-124: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = t_0 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) t_0 = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))) tmp = 0.0 if (Float64(V * l) <= -1e+150) tmp = t_0; elseif (Float64(V * l) <= -2e-124) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = t_0; else tmp = Float64(Float64(c0 * 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)
t_0 = c0 / (sqrt(l) * sqrt((V / A)));
tmp = 0.0;
if ((V * l) <= -1e+150)
tmp = t_0;
elseif ((V * l) <= -2e-124)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
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_] := Block[{t$95$0 = N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+150], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-124], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+150}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-124}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999981e149 or -1.99999999999999987e-124 < (*.f64 V l) < -0.0Initial program 57.7%
associate-/r*73.2%
div-inv73.1%
Applied egg-rr73.1%
un-div-inv73.2%
sqrt-undiv46.5%
clear-num46.5%
un-div-inv46.5%
sqrt-undiv72.6%
Applied egg-rr72.6%
associate-/r/73.6%
associate-*l/56.7%
associate-*r/72.6%
Simplified72.6%
add-sqr-sqrt35.1%
sqrt-prod20.8%
times-frac20.8%
Applied egg-rr20.8%
associate-*l/20.8%
associate-*r/20.8%
rem-square-sqrt44.8%
associate-/r*47.0%
Simplified47.0%
if -9.99999999999999981e149 < (*.f64 V l) < -1.99999999999999987e-124Initial program 95.9%
if -0.0 < (*.f64 V l) Initial program 78.4%
associate-/r*73.4%
div-inv73.2%
Applied egg-rr73.2%
associate-*l/75.8%
div-inv75.9%
frac-2neg75.9%
sqrt-div44.8%
Applied egg-rr44.8%
distribute-neg-frac244.8%
Simplified44.8%
clear-num44.8%
sqrt-undiv76.4%
add-sqr-sqrt41.3%
sqrt-unprod35.3%
sqr-neg35.3%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
sqrt-unprod21.1%
sqr-neg21.1%
sqrt-unprod34.9%
add-sqr-sqrt76.4%
un-div-inv76.3%
clear-num76.4%
associate-*r/78.8%
associate-*l/73.6%
*-commutative73.6%
pow1/273.6%
Applied egg-rr73.6%
Applied egg-rr90.5%
Final simplification77.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 (/ c0 (* (sqrt l) (sqrt (/ V A))))))
(if (<= (* V l) -1e+150)
t_0
(if (<= (* V l) -2e-124)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0) t_0 (* (sqrt A) (/ c0 (sqrt (* V l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 / (sqrt(l) * sqrt((V / A)));
double tmp;
if ((V * l) <= -1e+150) {
tmp = t_0;
} else if ((V * l) <= -2e-124) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = sqrt(A) * (c0 / 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) :: t_0
real(8) :: tmp
t_0 = c0 / (sqrt(l) * sqrt((v / a)))
if ((v * l) <= (-1d+150)) then
tmp = t_0
else if ((v * l) <= (-2d-124)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else
tmp = sqrt(a) * (c0 / 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 t_0 = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
double tmp;
if ((V * l) <= -1e+150) {
tmp = t_0;
} else if ((V * l) <= -2e-124) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 / (math.sqrt(l) * math.sqrt((V / A))) tmp = 0 if (V * l) <= -1e+150: tmp = t_0 elif (V * l) <= -2e-124: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = t_0 else: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))) tmp = 0.0 if (Float64(V * l) <= -1e+150) tmp = t_0; elseif (Float64(V * l) <= -2e-124) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = t_0; else tmp = Float64(sqrt(A) * Float64(c0 / 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)
t_0 = c0 / (sqrt(l) * sqrt((V / A)));
tmp = 0.0;
if ((V * l) <= -1e+150)
tmp = t_0;
elseif ((V * l) <= -2e-124)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
else
tmp = sqrt(A) * (c0 / 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_] := Block[{t$95$0 = N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+150], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-124], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / 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}
t_0 := \frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+150}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-124}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999981e149 or -1.99999999999999987e-124 < (*.f64 V l) < -0.0Initial program 57.7%
associate-/r*73.2%
div-inv73.1%
Applied egg-rr73.1%
un-div-inv73.2%
sqrt-undiv46.5%
clear-num46.5%
un-div-inv46.5%
sqrt-undiv72.6%
Applied egg-rr72.6%
associate-/r/73.6%
associate-*l/56.7%
associate-*r/72.6%
Simplified72.6%
add-sqr-sqrt35.1%
sqrt-prod20.8%
times-frac20.8%
Applied egg-rr20.8%
associate-*l/20.8%
associate-*r/20.8%
rem-square-sqrt44.8%
associate-/r*47.0%
Simplified47.0%
if -9.99999999999999981e149 < (*.f64 V l) < -1.99999999999999987e-124Initial program 95.9%
if -0.0 < (*.f64 V l) Initial program 78.4%
sqrt-div93.0%
associate-*r/90.5%
Applied egg-rr90.5%
*-commutative90.5%
associate-/l*90.5%
Simplified90.5%
Final simplification77.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 (sqrt (/ A V))))
(if (<= (* V l) -1e+150)
(* c0 (/ t_0 (sqrt l)))
(if (<= (* V l) -2e-124)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(* t_0 (/ c0 (sqrt l)))
(* (sqrt A) (/ c0 (sqrt (* V l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -1e+150) {
tmp = c0 * (t_0 / sqrt(l));
} else if ((V * l) <= -2e-124) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0 * (c0 / sqrt(l));
} else {
tmp = sqrt(A) * (c0 / 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) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-1d+150)) then
tmp = c0 * (t_0 / sqrt(l))
else if ((v * l) <= (-2d-124)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = t_0 * (c0 / sqrt(l))
else
tmp = sqrt(a) * (c0 / 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 t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -1e+150) {
tmp = c0 * (t_0 / Math.sqrt(l));
} else if ((V * l) <= -2e-124) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0 * (c0 / Math.sqrt(l));
} else {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -1e+150: tmp = c0 * (t_0 / math.sqrt(l)) elif (V * l) <= -2e-124: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = t_0 * (c0 / math.sqrt(l)) else: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -1e+150) tmp = Float64(c0 * Float64(t_0 / sqrt(l))); elseif (Float64(V * l) <= -2e-124) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(t_0 * Float64(c0 / sqrt(l))); else tmp = Float64(sqrt(A) * Float64(c0 / 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)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -1e+150)
tmp = c0 * (t_0 / sqrt(l));
elseif ((V * l) <= -2e-124)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = t_0 * (c0 / sqrt(l));
else
tmp = sqrt(A) * (c0 / 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_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+150], N[(c0 * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-124], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(t$95$0 * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / 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}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+150}:\\
\;\;\;\;c0 \cdot \frac{t\_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-124}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0 \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999981e149Initial program 51.3%
associate-/r*72.7%
sqrt-div44.0%
associate-*r/44.1%
Applied egg-rr44.1%
associate-/l*44.0%
Simplified44.0%
if -9.99999999999999981e149 < (*.f64 V l) < -1.99999999999999987e-124Initial program 95.9%
if -1.99999999999999987e-124 < (*.f64 V l) < -0.0Initial program 62.1%
associate-/r*73.4%
sqrt-div48.3%
associate-*r/44.6%
Applied egg-rr44.6%
*-commutative44.6%
associate-/l*46.3%
Simplified46.3%
if -0.0 < (*.f64 V l) Initial program 78.4%
sqrt-div93.0%
associate-*r/90.5%
Applied egg-rr90.5%
*-commutative90.5%
associate-/l*90.5%
Simplified90.5%
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) -1e+150)
t_0
(if (<= (* V l) -2e-124)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0) t_0 (* (sqrt A) (/ c0 (sqrt (* 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)) / sqrt(l));
double tmp;
if ((V * l) <= -1e+150) {
tmp = t_0;
} else if ((V * l) <= -2e-124) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = sqrt(A) * (c0 / 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) :: t_0
real(8) :: tmp
t_0 = c0 * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-1d+150)) then
tmp = t_0
else if ((v * l) <= (-2d-124)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else
tmp = sqrt(a) * (c0 / 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 t_0 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -1e+150) {
tmp = t_0;
} else if ((V * l) <= -2e-124) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((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)) / math.sqrt(l)) tmp = 0 if (V * l) <= -1e+150: tmp = t_0 elif (V * l) <= -2e-124: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = t_0 else: tmp = math.sqrt(A) * (c0 / math.sqrt((V * 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) <= -1e+150) tmp = t_0; elseif (Float64(V * l) <= -2e-124) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = t_0; else tmp = Float64(sqrt(A) * Float64(c0 / 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)
t_0 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -1e+150)
tmp = t_0;
elseif ((V * l) <= -2e-124)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
else
tmp = sqrt(A) * (c0 / 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_] := 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], -1e+150], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-124], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / 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}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+150}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-124}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999981e149 or -1.99999999999999987e-124 < (*.f64 V l) < -0.0Initial program 57.7%
associate-/r*73.2%
sqrt-div46.5%
associate-*r/44.4%
Applied egg-rr44.4%
associate-/l*46.5%
Simplified46.5%
if -9.99999999999999981e149 < (*.f64 V l) < -1.99999999999999987e-124Initial program 95.9%
if -0.0 < (*.f64 V l) Initial program 78.4%
sqrt-div93.0%
associate-*r/90.5%
Applied egg-rr90.5%
*-commutative90.5%
associate-/l*90.5%
Simplified90.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 (<= l 1.05e-268) (/ c0 (sqrt (/ (* V l) A))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= 1.05e-268) {
tmp = c0 / sqrt(((V * l) / A));
} else {
tmp = c0 * (sqrt((A / 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 (l <= 1.05d-268) then
tmp = c0 / sqrt(((v * l) / a))
else
tmp = c0 * (sqrt((a / 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 (l <= 1.05e-268) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= 1.05e-268: tmp = c0 / math.sqrt(((V * l) / A)) else: tmp = c0 * (math.sqrt((A / 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 (l <= 1.05e-268) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / 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 (l <= 1.05e-268)
tmp = c0 / sqrt(((V * l) / A));
else
tmp = c0 * (sqrt((A / 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[l, 1.05e-268], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.05 \cdot 10^{-268}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 1.04999999999999999e-268Initial program 78.8%
associate-/r*77.8%
div-inv77.8%
Applied egg-rr77.8%
un-div-inv77.8%
sqrt-undiv5.4%
clear-num5.4%
un-div-inv5.4%
sqrt-undiv77.0%
Applied egg-rr77.0%
associate-/r/75.4%
associate-*l/78.2%
associate-*r/77.3%
Simplified77.3%
associate-*r/78.2%
Applied egg-rr78.2%
if 1.04999999999999999e-268 < l Initial program 71.8%
associate-/r*72.4%
sqrt-div82.5%
associate-*r/79.2%
Applied egg-rr79.2%
associate-/l*82.5%
Simplified82.5%
Final simplification80.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 (* 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 75.4%
herbie shell --seed 2024129
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))