
(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: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -4e-310) (/ c0 (/ (pow l 0.5) (/ (sqrt (- A)) (sqrt (- V))))) (/ c0 (/ (sqrt (* l V)) (sqrt A)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 / (pow(l, 0.5) / (sqrt(-A) / sqrt(-V)));
} else {
tmp = c0 / (sqrt((l * V)) / sqrt(A));
}
return tmp;
}
NOTE: 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 <= (-4d-310)) then
tmp = c0 / ((l ** 0.5d0) / (sqrt(-a) / sqrt(-v)))
else
tmp = c0 / (sqrt((l * v)) / sqrt(a))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 / (Math.pow(l, 0.5) / (Math.sqrt(-A) / Math.sqrt(-V)));
} else {
tmp = c0 / (Math.sqrt((l * V)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -4e-310: tmp = c0 / (math.pow(l, 0.5) / (math.sqrt(-A) / math.sqrt(-V))) else: tmp = c0 / (math.sqrt((l * V)) / math.sqrt(A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -4e-310) tmp = Float64(c0 / Float64((l ^ 0.5) / Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))))); else tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) / sqrt(A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -4e-310)
tmp = c0 / ((l ^ 0.5) / (sqrt(-A) / sqrt(-V)));
else
tmp = c0 / (sqrt((l * V)) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -4e-310], N[(c0 / N[(N[Power[l, 0.5], $MachinePrecision] / N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\frac{{\ell}^{0.5}}{\frac{\sqrt{-A}}{\sqrt{-V}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -3.999999999999988e-310Initial program 70.4%
*-un-lft-identity70.4%
times-frac70.2%
Applied egg-rr70.2%
frac-times70.4%
*-un-lft-identity70.4%
associate-/r*73.1%
sqrt-undiv38.0%
associate-*r/38.0%
add-sqr-sqrt37.9%
associate-/r*37.9%
pow1/237.9%
sqrt-pow137.9%
metadata-eval37.9%
pow1/237.9%
sqrt-pow137.9%
metadata-eval37.9%
Applied egg-rr37.9%
associate-/l/37.9%
associate-/l*37.8%
pow-sqr38.0%
metadata-eval38.0%
Simplified38.0%
frac-2neg38.0%
sqrt-div42.1%
Applied egg-rr42.1%
if -3.999999999999988e-310 < A Initial program 75.9%
sqrt-div83.8%
associate-*r/83.0%
Applied egg-rr83.0%
associate-/l*83.8%
Simplified83.8%
Final simplification61.5%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -4e-310) (* c0 (/ (/ (sqrt (- A)) (sqrt (- V))) (sqrt l))) (/ c0 (/ (sqrt (* l V)) (sqrt A)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
} else {
tmp = c0 / (sqrt((l * V)) / sqrt(A));
}
return tmp;
}
NOTE: 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 <= (-4d-310)) then
tmp = c0 * ((sqrt(-a) / sqrt(-v)) / sqrt(l))
else
tmp = c0 / (sqrt((l * v)) / sqrt(a))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) / Math.sqrt(l));
} else {
tmp = c0 / (Math.sqrt((l * V)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -4e-310: tmp = c0 * ((math.sqrt(-A) / math.sqrt(-V)) / math.sqrt(l)) else: tmp = c0 / (math.sqrt((l * V)) / math.sqrt(A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -4e-310) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / sqrt(l))); else tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) / sqrt(A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -4e-310)
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
else
tmp = c0 / (sqrt((l * V)) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -4e-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[N[(l * V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -3.999999999999988e-310Initial program 70.4%
associate-/r*73.1%
sqrt-div38.0%
Applied egg-rr38.0%
frac-2neg38.0%
sqrt-div42.1%
Applied egg-rr42.1%
if -3.999999999999988e-310 < A Initial program 75.9%
sqrt-div83.8%
associate-*r/83.0%
Applied egg-rr83.0%
associate-/l*83.8%
Simplified83.8%
Final simplification61.5%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* l V))))
(if (or (<= t_0 0.0) (not (<= t_0 4e+301)))
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(/ c0 (pow t_0 -0.5)))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+301)) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 / pow(t_0, -0.5);
}
return tmp;
}
NOTE: 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 = a / (l * v)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+301))) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 / (t_0 ** (-0.5d0))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+301)) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 / Math.pow(t_0, -0.5);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 4e+301): tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 / math.pow(t_0, -0.5) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 4e+301)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 / (t_0 ^ -0.5)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 4e+301)))
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 / (t_0 ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: 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[(l * V), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+301]], $MachinePrecision]], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[Power[t$95$0, -0.5], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 4 \cdot 10^{+301}\right):\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{{t_0}^{-0.5}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 4.00000000000000021e301 < (/.f64 A (*.f64 V l)) Initial program 33.2%
associate-/r*49.2%
sqrt-div42.1%
Applied egg-rr42.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.00000000000000021e301Initial program 98.4%
*-un-lft-identity98.4%
times-frac88.1%
Applied egg-rr88.1%
frac-times98.4%
*-un-lft-identity98.4%
associate-/r*91.3%
sqrt-undiv47.4%
clear-num47.3%
un-div-inv47.3%
sqrt-undiv91.1%
associate-/l*97.8%
*-commutative97.8%
*-un-lft-identity97.8%
times-frac87.5%
/-rgt-identity87.5%
Applied egg-rr87.5%
*-commutative87.5%
associate-*l/97.8%
associate-*r/90.7%
Simplified90.7%
clear-num90.5%
div-inv91.1%
sqrt-undiv47.3%
clear-num47.3%
sqrt-div91.3%
pow1/291.3%
pow-flip91.3%
associate-/l/98.4%
metadata-eval98.4%
Applied egg-rr98.4%
Final simplification76.4%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* l V))))
(if (<= t_0 0.0)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= t_0 1e+298)
(/ c0 (pow t_0 -0.5))
(/ c0 (* (sqrt l) (sqrt (/ V A))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if (t_0 <= 1e+298) {
tmp = c0 / pow(t_0, -0.5);
} else {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
}
return tmp;
}
NOTE: 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 = a / (l * v)
if (t_0 <= 0.0d0) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if (t_0 <= 1d+298) then
tmp = c0 / (t_0 ** (-0.5d0))
else
tmp = c0 / (sqrt(l) * sqrt((v / a)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if (t_0 <= 1e+298) {
tmp = c0 / Math.pow(t_0, -0.5);
} else {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if t_0 <= 0.0: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif t_0 <= 1e+298: tmp = c0 / math.pow(t_0, -0.5) else: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (t_0 <= 1e+298) tmp = Float64(c0 / (t_0 ^ -0.5)); else tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif (t_0 <= 1e+298)
tmp = c0 / (t_0 ^ -0.5);
else
tmp = c0 / (sqrt(l) * sqrt((V / A)));
end
tmp_2 = tmp;
end
NOTE: 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[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+298], N[(c0 / N[Power[t$95$0, -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;t_0 \leq 10^{+298}:\\
\;\;\;\;\frac{c0}{{t_0}^{-0.5}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 28.0%
associate-/r*42.1%
sqrt-div37.9%
Applied egg-rr37.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999996e297Initial program 98.4%
*-un-lft-identity98.4%
times-frac88.1%
Applied egg-rr88.1%
frac-times98.4%
*-un-lft-identity98.4%
associate-/r*91.2%
sqrt-undiv47.0%
clear-num46.9%
un-div-inv47.0%
sqrt-undiv91.0%
associate-/l*97.8%
*-commutative97.8%
*-un-lft-identity97.8%
times-frac87.4%
/-rgt-identity87.4%
Applied egg-rr87.4%
*-commutative87.4%
associate-*l/97.8%
associate-*r/90.7%
Simplified90.7%
clear-num90.4%
div-inv91.0%
sqrt-undiv47.0%
clear-num47.0%
sqrt-div91.2%
pow1/291.2%
pow-flip91.3%
associate-/l/98.4%
metadata-eval98.4%
Applied egg-rr98.4%
if 9.9999999999999996e297 < (/.f64 A (*.f64 V l)) Initial program 38.7%
*-un-lft-identity38.7%
times-frac55.8%
Applied egg-rr55.8%
frac-times38.7%
*-un-lft-identity38.7%
associate-/r*55.7%
sqrt-undiv46.4%
clear-num46.4%
un-div-inv46.5%
sqrt-undiv58.0%
associate-/l*41.7%
*-commutative41.7%
*-un-lft-identity41.7%
times-frac58.8%
/-rgt-identity58.8%
Applied egg-rr58.8%
*-commutative58.8%
associate-*l/41.7%
associate-*r/58.0%
Simplified58.0%
*-commutative58.0%
sqrt-prod46.5%
Applied egg-rr46.5%
Final simplification76.4%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -5e-310) (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 l) V)))) (/ c0 (/ (sqrt (/ V A)) (pow l -0.5)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / l) / V)));
} else {
tmp = c0 / (sqrt((V / A)) / pow(l, -0.5));
}
return tmp;
}
NOTE: 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 <= (-5d-310)) then
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / l) / v)))
else
tmp = c0 / (sqrt((v / a)) / (l ** (-0.5d0)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / l) / V)));
} else {
tmp = c0 / (Math.sqrt((V / A)) / Math.pow(l, -0.5));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / l) / V))) else: tmp = c0 / (math.sqrt((V / A)) / math.pow(l, -0.5)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / l) / V)))); else tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) / (l ^ -0.5))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= -5e-310)
tmp = c0 * (sqrt(A) * sqrt(((1.0 / l) / V)));
else
tmp = c0 / (sqrt((V / A)) / (l ^ -0.5));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[l, -5e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] / N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{\ell}}{V}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\frac{V}{A}}}{{\ell}^{-0.5}}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 69.8%
*-un-lft-identity69.8%
times-frac70.8%
Applied egg-rr70.8%
frac-times69.8%
*-un-lft-identity69.8%
associate-/r*71.4%
Applied egg-rr71.4%
associate-/l/69.8%
sqrt-div31.6%
sqrt-prod0.0%
/-rgt-identity0.0%
sqrt-prod31.6%
associate-/r/31.6%
sqrt-div69.8%
div-inv69.3%
sqrt-prod31.6%
associate-/r/31.6%
/-rgt-identity31.6%
Applied egg-rr31.6%
associate-/r*32.3%
Simplified32.3%
if -4.999999999999985e-310 < l Initial program 76.0%
*-un-lft-identity76.0%
times-frac75.0%
Applied egg-rr75.0%
frac-times76.0%
*-un-lft-identity76.0%
associate-/r*78.2%
sqrt-undiv89.9%
clear-num89.7%
un-div-inv89.9%
sqrt-undiv78.5%
associate-/l*75.9%
*-commutative75.9%
*-un-lft-identity75.9%
times-frac75.0%
/-rgt-identity75.0%
Applied egg-rr75.0%
*-commutative75.0%
associate-*l/75.9%
associate-*r/78.5%
Simplified78.5%
*-un-lft-identity78.5%
sqrt-prod89.9%
times-frac89.9%
pow1/289.9%
pow-flip90.0%
metadata-eval90.0%
Applied egg-rr90.0%
*-commutative90.0%
associate-*l/88.0%
associate-/l*90.0%
Simplified90.0%
Final simplification61.4%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -5e-310) (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 l) V)))) (* c0 (* (pow (/ V A) -0.5) (pow l -0.5)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / l) / V)));
} else {
tmp = c0 * (pow((V / A), -0.5) * pow(l, -0.5));
}
return tmp;
}
NOTE: 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 <= (-5d-310)) then
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / l) / v)))
else
tmp = c0 * (((v / a) ** (-0.5d0)) * (l ** (-0.5d0)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / l) / V)));
} else {
tmp = c0 * (Math.pow((V / A), -0.5) * Math.pow(l, -0.5));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / l) / V))) else: tmp = c0 * (math.pow((V / A), -0.5) * math.pow(l, -0.5)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / l) / V)))); else tmp = Float64(c0 * Float64((Float64(V / A) ^ -0.5) * (l ^ -0.5))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= -5e-310)
tmp = c0 * (sqrt(A) * sqrt(((1.0 / l) / V)));
else
tmp = c0 * (((V / A) ^ -0.5) * (l ^ -0.5));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[l, -5e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Power[N[(V / A), $MachinePrecision], -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{\ell}}{V}}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left({\left(\frac{V}{A}\right)}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 69.8%
*-un-lft-identity69.8%
times-frac70.8%
Applied egg-rr70.8%
frac-times69.8%
*-un-lft-identity69.8%
associate-/r*71.4%
Applied egg-rr71.4%
associate-/l/69.8%
sqrt-div31.6%
sqrt-prod0.0%
/-rgt-identity0.0%
sqrt-prod31.6%
associate-/r/31.6%
sqrt-div69.8%
div-inv69.3%
sqrt-prod31.6%
associate-/r/31.6%
/-rgt-identity31.6%
Applied egg-rr31.6%
associate-/r*32.3%
Simplified32.3%
if -4.999999999999985e-310 < l Initial program 76.0%
*-un-lft-identity76.0%
times-frac75.0%
Applied egg-rr75.0%
frac-times76.0%
associate-/l*75.5%
inv-pow75.5%
associate-/l*74.5%
metadata-eval74.5%
pow-prod-up74.5%
sqrt-unprod74.6%
add-sqr-sqrt74.8%
associate-/r/78.5%
unpow-prod-down90.0%
Applied egg-rr90.0%
Final simplification61.4%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -5e-310) (/ c0 (/ (sqrt (* l V)) (sqrt A))) (/ c0 (/ (sqrt (/ V A)) (pow l -0.5)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 / (sqrt((l * V)) / sqrt(A));
} else {
tmp = c0 / (sqrt((V / A)) / pow(l, -0.5));
}
return tmp;
}
NOTE: 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 <= (-5d-310)) then
tmp = c0 / (sqrt((l * v)) / sqrt(a))
else
tmp = c0 / (sqrt((v / a)) / (l ** (-0.5d0)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 / (Math.sqrt((l * V)) / Math.sqrt(A));
} else {
tmp = c0 / (Math.sqrt((V / A)) / Math.pow(l, -0.5));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = c0 / (math.sqrt((l * V)) / math.sqrt(A)) else: tmp = c0 / (math.sqrt((V / A)) / math.pow(l, -0.5)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) / sqrt(A))); else tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) / (l ^ -0.5))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= -5e-310)
tmp = c0 / (sqrt((l * V)) / sqrt(A));
else
tmp = c0 / (sqrt((V / A)) / (l ^ -0.5));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[l, -5e-310], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] / N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\frac{V}{A}}}{{\ell}^{-0.5}}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 69.8%
sqrt-div31.6%
associate-*r/30.9%
Applied egg-rr30.9%
associate-/l*31.6%
Simplified31.6%
if -4.999999999999985e-310 < l Initial program 76.0%
*-un-lft-identity76.0%
times-frac75.0%
Applied egg-rr75.0%
frac-times76.0%
*-un-lft-identity76.0%
associate-/r*78.2%
sqrt-undiv89.9%
clear-num89.7%
un-div-inv89.9%
sqrt-undiv78.5%
associate-/l*75.9%
*-commutative75.9%
*-un-lft-identity75.9%
times-frac75.0%
/-rgt-identity75.0%
Applied egg-rr75.0%
*-commutative75.0%
associate-*l/75.9%
associate-*r/78.5%
Simplified78.5%
*-un-lft-identity78.5%
sqrt-prod89.9%
times-frac89.9%
pow1/289.9%
pow-flip90.0%
metadata-eval90.0%
Applied egg-rr90.0%
*-commutative90.0%
associate-*l/88.0%
associate-/l*90.0%
Simplified90.0%
Final simplification61.0%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -5e-310) (/ c0 (/ (sqrt (* l V)) (sqrt A))) (/ c0 (* (sqrt l) (sqrt (/ V A))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 / (sqrt((l * V)) / sqrt(A));
} else {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
}
return tmp;
}
NOTE: 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 <= (-5d-310)) then
tmp = c0 / (sqrt((l * v)) / sqrt(a))
else
tmp = c0 / (sqrt(l) * sqrt((v / a)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 / (Math.sqrt((l * V)) / Math.sqrt(A));
} else {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = c0 / (math.sqrt((l * V)) / math.sqrt(A)) else: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) / sqrt(A))); else tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= -5e-310)
tmp = c0 / (sqrt((l * V)) / sqrt(A));
else
tmp = c0 / (sqrt(l) * sqrt((V / A)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[l, -5e-310], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 69.8%
sqrt-div31.6%
associate-*r/30.9%
Applied egg-rr30.9%
associate-/l*31.6%
Simplified31.6%
if -4.999999999999985e-310 < l Initial program 76.0%
*-un-lft-identity76.0%
times-frac75.0%
Applied egg-rr75.0%
frac-times76.0%
*-un-lft-identity76.0%
associate-/r*78.2%
sqrt-undiv89.9%
clear-num89.7%
un-div-inv89.9%
sqrt-undiv78.5%
associate-/l*75.9%
*-commutative75.9%
*-un-lft-identity75.9%
times-frac75.0%
/-rgt-identity75.0%
Applied egg-rr75.0%
*-commutative75.0%
associate-*l/75.9%
associate-*r/78.5%
Simplified78.5%
*-commutative78.5%
sqrt-prod89.9%
Applied egg-rr89.9%
Final simplification61.0%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* l V))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 1e+283) (/ c0 (pow t_0 -0.5)) (/ c0 (sqrt (* l (/ V A))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 1e+283) {
tmp = c0 / pow(t_0, -0.5);
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: 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 = a / (l * v)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 1d+283) then
tmp = c0 / (t_0 ** (-0.5d0))
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 1e+283) {
tmp = c0 / Math.pow(t_0, -0.5);
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 1e+283: tmp = c0 / math.pow(t_0, -0.5) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 1e+283) tmp = Float64(c0 / (t_0 ^ -0.5)); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 1e+283)
tmp = c0 / (t_0 ^ -0.5);
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: 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[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+283], N[(c0 / N[Power[t$95$0, -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 10^{+283}:\\
\;\;\;\;\frac{c0}{{t_0}^{-0.5}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 28.0%
*-un-lft-identity28.0%
times-frac42.1%
Applied egg-rr42.1%
associate-*l/42.1%
*-un-lft-identity42.1%
Applied egg-rr42.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.99999999999999955e282Initial program 98.4%
*-un-lft-identity98.4%
times-frac87.7%
Applied egg-rr87.7%
frac-times98.4%
*-un-lft-identity98.4%
associate-/r*91.0%
sqrt-undiv46.6%
clear-num46.5%
un-div-inv46.6%
sqrt-undiv90.7%
associate-/l*97.7%
*-commutative97.7%
*-un-lft-identity97.7%
times-frac87.0%
/-rgt-identity87.0%
Applied egg-rr87.0%
*-commutative87.0%
associate-*l/97.7%
associate-*r/90.3%
Simplified90.3%
clear-num90.1%
div-inv90.7%
sqrt-undiv46.6%
clear-num46.6%
sqrt-div91.0%
pow1/290.9%
pow-flip91.0%
associate-/l/98.4%
metadata-eval98.4%
Applied egg-rr98.4%
if 9.99999999999999955e282 < (/.f64 A (*.f64 V l)) Initial program 43.7%
*-un-lft-identity43.7%
times-frac59.4%
Applied egg-rr59.4%
frac-times43.7%
*-un-lft-identity43.7%
associate-/r*59.3%
sqrt-undiv47.5%
clear-num47.5%
un-div-inv47.6%
sqrt-undiv61.4%
associate-/l*46.5%
*-commutative46.5%
*-un-lft-identity46.5%
times-frac62.1%
/-rgt-identity62.1%
Applied egg-rr62.1%
*-commutative62.1%
associate-*l/46.5%
associate-*r/61.4%
Simplified61.4%
Final simplification79.7%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* l V))))
(if (or (<= t_0 0.0) (not (<= t_0 4e+301)))
(* c0 (sqrt (/ (/ A V) l)))
(* c0 (sqrt t_0)))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+301)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: 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 = a / (l * v)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+301))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+301)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 4e+301): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.sqrt(t_0) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 4e+301)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 4e+301)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: 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[(l * V), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+301]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 4 \cdot 10^{+301}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 4.00000000000000021e301 < (/.f64 A (*.f64 V l)) Initial program 33.2%
*-un-lft-identity33.2%
times-frac49.2%
Applied egg-rr49.2%
frac-times33.2%
*-un-lft-identity33.2%
associate-/r*49.2%
Applied egg-rr49.2%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.00000000000000021e301Initial program 98.4%
Final simplification79.2%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* l V))))
(if (or (<= t_0 0.0) (not (<= t_0 4e+301)))
(* c0 (sqrt (/ (/ A l) V)))
(* c0 (sqrt t_0)))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+301)) {
tmp = c0 * sqrt(((A / l) / V));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: 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 = a / (l * v)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+301))) then
tmp = c0 * sqrt(((a / l) / v))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+301)) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 4e+301): tmp = c0 * math.sqrt(((A / l) / V)) else: tmp = c0 * math.sqrt(t_0) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 4e+301)) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 4e+301)))
tmp = c0 * sqrt(((A / l) / V));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: 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[(l * V), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+301]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 4 \cdot 10^{+301}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 4.00000000000000021e301 < (/.f64 A (*.f64 V l)) Initial program 33.2%
*-un-lft-identity33.2%
times-frac49.2%
Applied egg-rr49.2%
associate-*l/49.2%
*-un-lft-identity49.2%
Applied egg-rr49.2%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.00000000000000021e301Initial program 98.4%
Final simplification79.2%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* l V))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+274) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 5e+274) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: 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 = a / (l * v)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 5d+274) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+274) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 5e+274: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+274) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 5e+274)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: 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[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+274], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+274}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 28.0%
*-un-lft-identity28.0%
times-frac42.1%
Applied egg-rr42.1%
associate-*l/42.1%
*-un-lft-identity42.1%
Applied egg-rr42.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.9999999999999998e274Initial program 98.3%
if 4.9999999999999998e274 < (/.f64 A (*.f64 V l)) Initial program 44.6%
*-un-lft-identity44.6%
times-frac60.0%
Applied egg-rr60.0%
frac-times44.6%
*-un-lft-identity44.6%
associate-/r*58.5%
sqrt-undiv46.9%
clear-num46.9%
un-div-inv47.0%
sqrt-undiv60.5%
associate-/l*47.3%
*-commutative47.3%
*-un-lft-identity47.3%
times-frac62.7%
/-rgt-identity62.7%
Applied egg-rr62.7%
Final simplification79.8%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* l V))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 1e+283) (* c0 (sqrt t_0)) (/ c0 (sqrt (* l (/ V A))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 1e+283) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: 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 = a / (l * v)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 1d+283) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 1e+283) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 1e+283: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 1e+283) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 1e+283)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: 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[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+283], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 10^{+283}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 28.0%
*-un-lft-identity28.0%
times-frac42.1%
Applied egg-rr42.1%
associate-*l/42.1%
*-un-lft-identity42.1%
Applied egg-rr42.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.99999999999999955e282Initial program 98.4%
if 9.99999999999999955e282 < (/.f64 A (*.f64 V l)) Initial program 43.7%
*-un-lft-identity43.7%
times-frac59.4%
Applied egg-rr59.4%
frac-times43.7%
*-un-lft-identity43.7%
associate-/r*59.3%
sqrt-undiv47.5%
clear-num47.5%
un-div-inv47.6%
sqrt-undiv61.4%
associate-/l*46.5%
*-commutative46.5%
*-un-lft-identity46.5%
times-frac62.1%
/-rgt-identity62.1%
Applied egg-rr62.1%
*-commutative62.1%
associate-*l/46.5%
associate-*r/61.4%
Simplified61.4%
Final simplification79.7%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* l V)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (l * V)));
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (l * v)))
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (l * V)));
}
[V, l] = sort([V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (l * V)))
V, l = sort([V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(l * V)))) end
V, l = num2cell(sort([V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (l * V)));
end
NOTE: 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[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}
\end{array}
Initial program 73.0%
Final simplification73.0%
herbie shell --seed 2023271
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))