
(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 -5e-310) (* (/ (sqrt (- A)) (sqrt (- V))) (/ c0 (sqrt l))) (/ c0 (/ (sqrt (* V l)) (sqrt A)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = (sqrt(-A) / sqrt(-V)) * (c0 / sqrt(l));
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-5d-310)) then
tmp = (sqrt(-a) / sqrt(-v)) * (c0 / sqrt(l))
else
tmp = c0 / (sqrt((v * l)) / sqrt(a))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = (Math.sqrt(-A) / Math.sqrt(-V)) * (c0 / Math.sqrt(l));
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = (math.sqrt(-A) / math.sqrt(-V)) * (c0 / math.sqrt(l)) else: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * Float64(c0 / sqrt(l))); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -5e-310)
tmp = (sqrt(-A) / sqrt(-V)) * (c0 / sqrt(l));
else
tmp = c0 / (sqrt((V * l)) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -5e-310], N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-A}}{\sqrt{-V}} \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 66.8%
associate-/r*70.3%
clear-num69.1%
sqrt-div71.2%
metadata-eval71.2%
div-inv71.1%
clear-num71.2%
Applied egg-rr71.2%
*-commutative71.2%
associate-*l/66.9%
associate-/l*72.7%
Simplified72.7%
metadata-eval72.7%
sqrt-div70.4%
associate-*r/66.1%
clear-num66.8%
associate-/r*70.3%
sqrt-undiv38.7%
associate-*r/37.2%
clear-num37.2%
Applied egg-rr37.2%
associate-/r/37.2%
associate-*l/37.2%
*-commutative37.2%
associate-*l*37.2%
*-lft-identity37.2%
associate-/l*38.0%
Simplified38.0%
frac-2neg38.0%
sqrt-div48.5%
Applied egg-rr48.5%
if -4.999999999999985e-310 < A Initial program 74.8%
associate-/r*75.1%
clear-num75.1%
sqrt-div75.0%
metadata-eval75.0%
div-inv75.1%
clear-num75.1%
Applied egg-rr75.1%
*-commutative75.1%
associate-*l/74.7%
associate-/l*76.5%
Simplified76.5%
un-div-inv76.7%
associate-*r/74.8%
Applied egg-rr74.8%
sqrt-div86.1%
div-inv86.0%
Applied egg-rr86.0%
associate-*r/86.1%
*-rgt-identity86.1%
Simplified86.1%
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 5e-280) (not (<= t_0 4e+239)))
(* c0 (sqrt (/ (/ A l) V)))
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 <= 5e-280) || !(t_0 <= 4e+239)) {
tmp = c0 * sqrt(((A / l) / V));
} 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 <= 5d-280) .or. (.not. (t_0 <= 4d+239))) then
tmp = c0 * sqrt(((a / l) / v))
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 <= 5e-280) || !(t_0 <= 4e+239)) {
tmp = c0 * Math.sqrt(((A / l) / V));
} 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 <= 5e-280) or not (t_0 <= 4e+239): tmp = c0 * math.sqrt(((A / l) / V)) 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 <= 5e-280) || !(t_0 <= 4e+239)) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); 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 <= 5e-280) || ~((t_0 <= 4e+239)))
tmp = c0 * sqrt(((A / l) / V));
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, 5e-280], N[Not[LessEqual[t$95$0, 4e+239]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $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 5 \cdot 10^{-280} \lor \neg \left(t\_0 \leq 4 \cdot 10^{+239}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.00000000000000028e-280 or 3.99999999999999996e239 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 65.1%
*-un-lft-identity65.1%
times-frac69.8%
Applied egg-rr69.8%
associate-*l/69.8%
*-un-lft-identity69.8%
Applied egg-rr69.8%
if 5.00000000000000028e-280 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999996e239Initial program 98.1%
Final simplification74.8%
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 5e-280) (not (<= t_0 1e+240)))
(* 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 <= 5e-280) || !(t_0 <= 1e+240)) {
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 <= 5d-280) .or. (.not. (t_0 <= 1d+240))) 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 <= 5e-280) || !(t_0 <= 1e+240)) {
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 <= 5e-280) or not (t_0 <= 1e+240): 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 <= 5e-280) || !(t_0 <= 1e+240)) 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 <= 5e-280) || ~((t_0 <= 1e+240)))
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, 5e-280], N[Not[LessEqual[t$95$0, 1e+240]], $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 5 \cdot 10^{-280} \lor \neg \left(t\_0 \leq 10^{+240}\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)))) < 5.00000000000000028e-280 or 1.00000000000000001e240 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 64.9%
associate-/r*70.2%
Simplified70.2%
if 5.00000000000000028e-280 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.00000000000000001e240Initial program 98.1%
Final simplification75.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 5e-280)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 4e+239) 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 <= 5e-280) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 4e+239) {
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 <= 5d-280) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 4d+239) 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 <= 5e-280) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 4e+239) {
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 <= 5e-280: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 4e+239: 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 <= 5e-280) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 4e+239) 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 <= 5e-280)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 4e+239)
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, 5e-280], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+239], 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 5 \cdot 10^{-280}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+239}:\\
\;\;\;\;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)))) < 5.00000000000000028e-280Initial program 66.4%
*-un-lft-identity66.4%
times-frac71.1%
Applied egg-rr71.1%
associate-*l/71.1%
*-un-lft-identity71.1%
Applied egg-rr71.1%
if 5.00000000000000028e-280 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999996e239Initial program 98.1%
if 3.99999999999999996e239 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 59.4%
associate-/r*66.6%
clear-num66.5%
sqrt-div71.1%
metadata-eval71.1%
div-inv71.2%
clear-num71.2%
Applied egg-rr71.2%
*-commutative71.2%
associate-*l/60.1%
associate-/l*69.7%
Simplified69.7%
un-div-inv69.7%
associate-*r/60.1%
Applied egg-rr60.1%
associate-/l*69.7%
Simplified69.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -5e-310) (* c0 (/ (/ (sqrt (- A)) (sqrt (- V))) (sqrt l))) (/ c0 (/ (sqrt (* V l)) (sqrt A)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-5d-310)) then
tmp = c0 * ((sqrt(-a) / sqrt(-v)) / sqrt(l))
else
tmp = c0 / (sqrt((v * l)) / sqrt(a))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) / Math.sqrt(l));
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = c0 * ((math.sqrt(-A) / math.sqrt(-V)) / math.sqrt(l)) else: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / sqrt(l))); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -5e-310)
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
else
tmp = c0 / (sqrt((V * l)) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -5e-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[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 66.8%
associate-/r*70.3%
sqrt-div38.7%
div-inv38.7%
Applied egg-rr38.7%
associate-*r/38.7%
*-rgt-identity38.7%
Simplified38.7%
frac-2neg38.0%
sqrt-div48.5%
Applied egg-rr49.0%
if -4.999999999999985e-310 < A Initial program 74.8%
associate-/r*75.1%
clear-num75.1%
sqrt-div75.0%
metadata-eval75.0%
div-inv75.1%
clear-num75.1%
Applied egg-rr75.1%
*-commutative75.1%
associate-*l/74.7%
associate-/l*76.5%
Simplified76.5%
un-div-inv76.7%
associate-*r/74.8%
Applied egg-rr74.8%
sqrt-div86.1%
div-inv86.0%
Applied egg-rr86.0%
associate-*r/86.1%
*-rgt-identity86.1%
Simplified86.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))
(/ 1.0 (/ (/ (sqrt l) c0) (sqrt (/ A V))))
(if (<= (* V l) -1e-316)
(* c0 (/ (sqrt (- A)) (sqrt (- (* V l)))))
(if (<= (* V l) 0.0)
(* c0 (/ (/ 1.0 (sqrt (/ V A))) (sqrt l)))
(if (<= (* V l) 1e+307)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(/ c0 (sqrt (* l (/ V A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = 1.0 / ((sqrt(l) / c0) / sqrt((A / V)));
} else if ((V * l) <= -1e-316) {
tmp = c0 * (sqrt(-A) / sqrt(-(V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * ((1.0 / sqrt((V / A))) / sqrt(l));
} else if ((V * l) <= 1e+307) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = 1.0 / ((Math.sqrt(l) / c0) / Math.sqrt((A / V)));
} else if ((V * l) <= -1e-316) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt(-(V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * ((1.0 / Math.sqrt((V / A))) / Math.sqrt(l));
} else if ((V * l) <= 1e+307) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} 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): tmp = 0 if (V * l) <= -math.inf: tmp = 1.0 / ((math.sqrt(l) / c0) / math.sqrt((A / V))) elif (V * l) <= -1e-316: tmp = c0 * (math.sqrt(-A) / math.sqrt(-(V * l))) elif (V * l) <= 0.0: tmp = c0 * ((1.0 / math.sqrt((V / A))) / math.sqrt(l)) elif (V * l) <= 1e+307: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) 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) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(1.0 / Float64(Float64(sqrt(l) / c0) / sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -1e-316) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(-Float64(V * l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(Float64(1.0 / sqrt(Float64(V / A))) / sqrt(l))); elseif (Float64(V * l) <= 1e+307) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); 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)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = 1.0 / ((sqrt(l) / c0) / sqrt((A / V)));
elseif ((V * l) <= -1e-316)
tmp = c0 * (sqrt(-A) / sqrt(-(V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 * ((1.0 / sqrt((V / A))) / sqrt(l));
elseif ((V * l) <= 1e+307)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(1.0 / N[(N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-316], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-N[(V * l), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[(1.0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+307], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{1}{\frac{\frac{\sqrt{\ell}}{c0}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-316}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{-V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{\frac{1}{\sqrt{\frac{V}{A}}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+307}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 17.8%
associate-/r*53.0%
clear-num48.6%
sqrt-div48.7%
metadata-eval48.7%
div-inv48.6%
clear-num48.7%
Applied egg-rr48.7%
*-commutative48.7%
associate-*l/17.8%
associate-/l*48.7%
Simplified48.7%
metadata-eval48.7%
sqrt-div48.7%
associate-*r/17.8%
clear-num17.8%
associate-/r*53.0%
sqrt-undiv27.8%
associate-*r/27.7%
clear-num27.7%
Applied egg-rr27.7%
associate-/r*27.9%
Simplified27.9%
if -inf.0 < (*.f64 V l) < -9.999999837e-317Initial program 81.3%
frac-2neg81.3%
sqrt-div99.1%
distribute-rgt-neg-in99.1%
Applied egg-rr99.1%
distribute-rgt-neg-out99.1%
*-commutative99.1%
distribute-rgt-neg-in99.1%
Simplified99.1%
if -9.999999837e-317 < (*.f64 V l) < -0.0Initial program 41.7%
associate-/r*59.2%
sqrt-div39.2%
div-inv39.1%
Applied egg-rr39.1%
associate-*r/39.2%
*-rgt-identity39.2%
Simplified39.2%
clear-num39.1%
sqrt-div39.3%
metadata-eval39.3%
Applied egg-rr39.3%
if -0.0 < (*.f64 V l) < 9.99999999999999986e306Initial program 83.8%
associate-/r*77.8%
clear-num77.8%
sqrt-div77.8%
metadata-eval77.8%
div-inv77.8%
clear-num77.8%
Applied egg-rr77.8%
*-commutative77.8%
associate-*l/83.6%
associate-/l*79.6%
Simplified79.6%
un-div-inv79.7%
associate-*r/83.8%
Applied egg-rr83.8%
sqrt-div98.1%
div-inv98.0%
Applied egg-rr98.0%
associate-*r/98.1%
*-rgt-identity98.1%
Simplified98.1%
if 9.99999999999999986e306 < (*.f64 V l) Initial program 36.8%
associate-/r*68.3%
clear-num68.3%
sqrt-div68.2%
metadata-eval68.2%
div-inv68.2%
clear-num68.3%
Applied egg-rr68.3%
*-commutative68.3%
associate-*l/36.8%
associate-/l*68.3%
Simplified68.3%
un-div-inv68.6%
associate-*r/36.8%
Applied egg-rr36.8%
clear-num36.8%
associate-/r*68.5%
associate-/r/68.5%
clear-num68.6%
Applied egg-rr68.6%
Final simplification85.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -1e-316)
(* c0 (/ (sqrt (- A)) (sqrt (- (* V l)))))
(if (<= (* V l) 0.0)
(* c0 (/ (/ 1.0 (sqrt (/ V A))) (sqrt l)))
(if (<= (* V l) 1e+307)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(/ c0 (sqrt (* l (/ V A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -1e-316) {
tmp = c0 * (sqrt(-A) / sqrt(-(V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * ((1.0 / sqrt((V / A))) / sqrt(l));
} else if ((V * l) <= 1e+307) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -1e-316) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt(-(V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * ((1.0 / Math.sqrt((V / A))) / Math.sqrt(l));
} else if ((V * l) <= 1e+307) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} 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): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -1e-316: tmp = c0 * (math.sqrt(-A) / math.sqrt(-(V * l))) elif (V * l) <= 0.0: tmp = c0 * ((1.0 / math.sqrt((V / A))) / math.sqrt(l)) elif (V * l) <= 1e+307: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) 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) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -1e-316) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(-Float64(V * l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(Float64(1.0 / sqrt(Float64(V / A))) / sqrt(l))); elseif (Float64(V * l) <= 1e+307) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); 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)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -1e-316)
tmp = c0 * (sqrt(-A) / sqrt(-(V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 * ((1.0 / sqrt((V / A))) / sqrt(l));
elseif ((V * l) <= 1e+307)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-316], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-N[(V * l), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[(1.0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+307], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-316}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{-V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{\frac{1}{\sqrt{\frac{V}{A}}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+307}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 17.8%
associate-/r*53.0%
sqrt-div27.8%
div-inv27.8%
Applied egg-rr27.8%
associate-*r/27.8%
*-rgt-identity27.8%
Simplified27.8%
if -inf.0 < (*.f64 V l) < -9.999999837e-317Initial program 81.3%
frac-2neg81.3%
sqrt-div99.1%
distribute-rgt-neg-in99.1%
Applied egg-rr99.1%
distribute-rgt-neg-out99.1%
*-commutative99.1%
distribute-rgt-neg-in99.1%
Simplified99.1%
if -9.999999837e-317 < (*.f64 V l) < -0.0Initial program 41.7%
associate-/r*59.2%
sqrt-div39.2%
div-inv39.1%
Applied egg-rr39.1%
associate-*r/39.2%
*-rgt-identity39.2%
Simplified39.2%
clear-num39.1%
sqrt-div39.3%
metadata-eval39.3%
Applied egg-rr39.3%
if -0.0 < (*.f64 V l) < 9.99999999999999986e306Initial program 83.8%
associate-/r*77.8%
clear-num77.8%
sqrt-div77.8%
metadata-eval77.8%
div-inv77.8%
clear-num77.8%
Applied egg-rr77.8%
*-commutative77.8%
associate-*l/83.6%
associate-/l*79.6%
Simplified79.6%
un-div-inv79.7%
associate-*r/83.8%
Applied egg-rr83.8%
sqrt-div98.1%
div-inv98.0%
Applied egg-rr98.0%
associate-*r/98.1%
*-rgt-identity98.1%
Simplified98.1%
if 9.99999999999999986e306 < (*.f64 V l) Initial program 36.8%
associate-/r*68.3%
clear-num68.3%
sqrt-div68.2%
metadata-eval68.2%
div-inv68.2%
clear-num68.3%
Applied egg-rr68.3%
*-commutative68.3%
associate-*l/36.8%
associate-/l*68.3%
Simplified68.3%
un-div-inv68.6%
associate-*r/36.8%
Applied egg-rr36.8%
clear-num36.8%
associate-/r*68.5%
associate-/r/68.5%
clear-num68.6%
Applied egg-rr68.6%
Final simplification85.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -1e-316)
(* c0 (/ (sqrt (- A)) (sqrt (- (* V l)))))
(if (<= (* V l) 0.0)
(/ (/ c0 (sqrt l)) (sqrt (/ V A)))
(if (<= (* V l) 1e+307)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(/ c0 (sqrt (* l (/ V A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -1e-316) {
tmp = c0 * (sqrt(-A) / sqrt(-(V * l)));
} else if ((V * l) <= 0.0) {
tmp = (c0 / sqrt(l)) / sqrt((V / A));
} else if ((V * l) <= 1e+307) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -1e-316) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt(-(V * l)));
} else if ((V * l) <= 0.0) {
tmp = (c0 / Math.sqrt(l)) / Math.sqrt((V / A));
} else if ((V * l) <= 1e+307) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} 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): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -1e-316: tmp = c0 * (math.sqrt(-A) / math.sqrt(-(V * l))) elif (V * l) <= 0.0: tmp = (c0 / math.sqrt(l)) / math.sqrt((V / A)) elif (V * l) <= 1e+307: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) 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) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -1e-316) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(-Float64(V * l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(Float64(c0 / sqrt(l)) / sqrt(Float64(V / A))); elseif (Float64(V * l) <= 1e+307) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); 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)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -1e-316)
tmp = c0 * (sqrt(-A) / sqrt(-(V * l)));
elseif ((V * l) <= 0.0)
tmp = (c0 / sqrt(l)) / sqrt((V / A));
elseif ((V * l) <= 1e+307)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-316], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-N[(V * l), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+307], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-316}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{-V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{\frac{c0}{\sqrt{\ell}}}{\sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+307}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 17.8%
associate-/r*53.0%
sqrt-div27.8%
div-inv27.8%
Applied egg-rr27.8%
associate-*r/27.8%
*-rgt-identity27.8%
Simplified27.8%
if -inf.0 < (*.f64 V l) < -9.999999837e-317Initial program 81.3%
frac-2neg81.3%
sqrt-div99.1%
distribute-rgt-neg-in99.1%
Applied egg-rr99.1%
distribute-rgt-neg-out99.1%
*-commutative99.1%
distribute-rgt-neg-in99.1%
Simplified99.1%
if -9.999999837e-317 < (*.f64 V l) < -0.0Initial program 41.7%
associate-/r*59.2%
clear-num59.2%
sqrt-div64.7%
metadata-eval64.7%
div-inv64.7%
clear-num64.8%
Applied egg-rr64.8%
*-commutative64.8%
associate-*l/41.7%
associate-/l*64.7%
Simplified64.7%
pow1/264.7%
pow-flip64.8%
associate-*r/41.7%
metadata-eval41.7%
Applied egg-rr41.7%
associate-/l*64.8%
Simplified64.8%
*-commutative64.8%
metadata-eval64.8%
pow-flip64.7%
associate-*r/41.7%
pow1/241.7%
sqrt-div16.1%
clear-num16.1%
associate-*l/16.0%
sqrt-prod15.3%
frac-times18.0%
clear-num18.0%
frac-times18.0%
*-un-lft-identity18.0%
sqrt-undiv39.3%
Applied egg-rr39.3%
associate-/l/39.3%
Simplified39.3%
if -0.0 < (*.f64 V l) < 9.99999999999999986e306Initial program 83.8%
associate-/r*77.8%
clear-num77.8%
sqrt-div77.8%
metadata-eval77.8%
div-inv77.8%
clear-num77.8%
Applied egg-rr77.8%
*-commutative77.8%
associate-*l/83.6%
associate-/l*79.6%
Simplified79.6%
un-div-inv79.7%
associate-*r/83.8%
Applied egg-rr83.8%
sqrt-div98.1%
div-inv98.0%
Applied egg-rr98.0%
associate-*r/98.1%
*-rgt-identity98.1%
Simplified98.1%
if 9.99999999999999986e306 < (*.f64 V l) Initial program 36.8%
associate-/r*68.3%
clear-num68.3%
sqrt-div68.2%
metadata-eval68.2%
div-inv68.2%
clear-num68.3%
Applied egg-rr68.3%
*-commutative68.3%
associate-*l/36.8%
associate-/l*68.3%
Simplified68.3%
un-div-inv68.6%
associate-*r/36.8%
Applied egg-rr36.8%
clear-num36.8%
associate-/r*68.5%
associate-/r/68.5%
clear-num68.6%
Applied egg-rr68.6%
Final simplification85.0%
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) -5e+225)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= (* V l) -2e-156)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 2e-318)
(* c0 (pow (/ V (/ A l)) -0.5))
(if (<= (* V l) 1e+307)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(/ c0 (sqrt (* l (/ V A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+225) {
tmp = c0 * sqrt(((A / V) / l));
} else if ((V * l) <= -2e-156) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 2e-318) {
tmp = c0 * pow((V / (A / l)), -0.5);
} else if ((V * l) <= 1e+307) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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) :: tmp
if ((v * l) <= (-5d+225)) then
tmp = c0 * sqrt(((a / v) / l))
else if ((v * l) <= (-2d-156)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 2d-318) then
tmp = c0 * ((v / (a / l)) ** (-0.5d0))
else if ((v * l) <= 1d+307) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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 tmp;
if ((V * l) <= -5e+225) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if ((V * l) <= -2e-156) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 2e-318) {
tmp = c0 * Math.pow((V / (A / l)), -0.5);
} else if ((V * l) <= 1e+307) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} 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): tmp = 0 if (V * l) <= -5e+225: tmp = c0 * math.sqrt(((A / V) / l)) elif (V * l) <= -2e-156: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 2e-318: tmp = c0 * math.pow((V / (A / l)), -0.5) elif (V * l) <= 1e+307: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) 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) tmp = 0.0 if (Float64(V * l) <= -5e+225) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (Float64(V * l) <= -2e-156) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 2e-318) tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5)); elseif (Float64(V * l) <= 1e+307) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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)
tmp = 0.0;
if ((V * l) <= -5e+225)
tmp = c0 * sqrt(((A / V) / l));
elseif ((V * l) <= -2e-156)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 2e-318)
tmp = c0 * ((V / (A / l)) ^ -0.5);
elseif ((V * l) <= 1e+307)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e+225], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-156], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-318], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+307], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+225}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-156}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-318}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+307}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.99999999999999981e225Initial program 48.9%
associate-/r*62.5%
Simplified62.5%
if -4.99999999999999981e225 < (*.f64 V l) < -2.00000000000000008e-156Initial program 87.5%
associate-/r*80.7%
clear-num80.6%
sqrt-div80.7%
metadata-eval80.7%
div-inv80.7%
clear-num80.7%
Applied egg-rr80.7%
*-commutative80.7%
associate-*l/88.1%
associate-/l*82.5%
Simplified82.5%
un-div-inv82.6%
associate-*r/88.2%
Applied egg-rr88.2%
if -2.00000000000000008e-156 < (*.f64 V l) < 2.0000024e-318Initial program 49.1%
associate-/r*61.3%
clear-num61.2%
sqrt-div66.0%
metadata-eval66.0%
div-inv66.0%
clear-num66.1%
Applied egg-rr66.1%
*-commutative66.1%
associate-*l/50.4%
associate-/l*66.1%
Simplified66.1%
pow1/266.1%
pow-flip66.1%
associate-*r/50.5%
metadata-eval50.5%
Applied egg-rr50.5%
associate-/l*66.1%
Simplified66.1%
clear-num66.1%
un-div-inv66.1%
Applied egg-rr66.1%
if 2.0000024e-318 < (*.f64 V l) < 9.99999999999999986e306Initial program 84.9%
sqrt-div99.2%
div-inv99.1%
Applied egg-rr99.1%
associate-*r/99.2%
*-rgt-identity99.2%
Simplified99.2%
if 9.99999999999999986e306 < (*.f64 V l) Initial program 36.8%
associate-/r*68.3%
clear-num68.3%
sqrt-div68.2%
metadata-eval68.2%
div-inv68.2%
clear-num68.3%
Applied egg-rr68.3%
*-commutative68.3%
associate-*l/36.8%
associate-/l*68.3%
Simplified68.3%
un-div-inv68.6%
associate-*r/36.8%
Applied egg-rr36.8%
clear-num36.8%
associate-/r*68.5%
associate-/r/68.5%
clear-num68.6%
Applied egg-rr68.6%
Final simplification83.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -5e-310) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (/ c0 (/ (sqrt (* V l)) (sqrt A)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-5d-310)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 / (sqrt((v * l)) / sqrt(a))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -5e-310)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 / (sqrt((V * l)) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -5e-310], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 66.8%
associate-/r*70.3%
sqrt-div38.7%
div-inv38.7%
Applied egg-rr38.7%
associate-*r/38.7%
*-rgt-identity38.7%
Simplified38.7%
if -4.999999999999985e-310 < A Initial program 74.8%
associate-/r*75.1%
clear-num75.1%
sqrt-div75.0%
metadata-eval75.0%
div-inv75.1%
clear-num75.1%
Applied egg-rr75.1%
*-commutative75.1%
associate-*l/74.7%
associate-/l*76.5%
Simplified76.5%
un-div-inv76.7%
associate-*r/74.8%
Applied egg-rr74.8%
sqrt-div86.1%
div-inv86.0%
Applied egg-rr86.0%
associate-*r/86.1%
*-rgt-identity86.1%
Simplified86.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 (<= A -5e-310) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-5d-310)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -5e-310)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -5e-310], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 66.8%
associate-/r*70.3%
sqrt-div38.7%
div-inv38.7%
Applied egg-rr38.7%
associate-*r/38.7%
*-rgt-identity38.7%
Simplified38.7%
if -4.999999999999985e-310 < A Initial program 74.8%
sqrt-div86.1%
div-inv86.0%
Applied egg-rr86.0%
associate-*r/86.1%
*-rgt-identity86.1%
Simplified86.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 1e-311)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 2e+294)
(/ c0 (sqrt (/ (* V l) A)))
(* c0 (pow (/ V (/ A l)) -0.5))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-311) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 2e+294) {
tmp = c0 / sqrt(((V * l) / A));
} else {
tmp = c0 * pow((V / (A / l)), -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 = a / (v * l)
if (t_0 <= 1d-311) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 2d+294) then
tmp = c0 / sqrt(((v * l) / a))
else
tmp = c0 * ((v / (a / l)) ** (-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 = A / (V * l);
double tmp;
if (t_0 <= 1e-311) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 2e+294) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else {
tmp = c0 * Math.pow((V / (A / l)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 1e-311: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 2e+294: tmp = c0 / math.sqrt(((V * l) / A)) else: tmp = c0 * math.pow((V / (A / l)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 1e-311) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 2e+294) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); else tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-311)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 2e+294)
tmp = c0 / sqrt(((V * l) / A));
else
tmp = c0 * ((V / (A / l)) ^ -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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-311], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+294], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 10^{-311}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+294}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.99999999999948e-312Initial program 31.2%
*-un-lft-identity31.2%
times-frac48.5%
Applied egg-rr48.5%
associate-*l/48.5%
*-un-lft-identity48.5%
Applied egg-rr48.5%
if 9.99999999999948e-312 < (/.f64 A (*.f64 V l)) < 2.00000000000000013e294Initial program 99.1%
associate-/r*91.3%
clear-num91.2%
sqrt-div91.2%
metadata-eval91.2%
div-inv91.2%
clear-num91.2%
Applied egg-rr91.2%
*-commutative91.2%
associate-*l/99.0%
associate-/l*94.4%
Simplified94.4%
un-div-inv94.6%
associate-*r/99.2%
Applied egg-rr99.2%
if 2.00000000000000013e294 < (/.f64 A (*.f64 V l)) Initial program 44.1%
associate-/r*53.8%
clear-num53.7%
sqrt-div57.9%
metadata-eval57.9%
div-inv57.9%
clear-num58.0%
Applied egg-rr58.0%
*-commutative58.0%
associate-*l/45.8%
associate-/l*56.9%
Simplified56.9%
pow1/256.9%
pow-flip56.9%
associate-*r/45.8%
metadata-eval45.8%
Applied egg-rr45.8%
associate-/l*56.9%
Simplified56.9%
clear-num57.0%
un-div-inv56.9%
Applied egg-rr56.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 1e-311)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 2e+293)
(/ c0 (sqrt (/ (* V l) A)))
(/ 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 = A / (V * l);
double tmp;
if (t_0 <= 1e-311) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 2e+293) {
tmp = c0 / sqrt(((V * l) / A));
} 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 = a / (v * l)
if (t_0 <= 1d-311) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 2d+293) then
tmp = c0 / sqrt(((v * l) / a))
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 = A / (V * l);
double tmp;
if (t_0 <= 1e-311) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 2e+293) {
tmp = c0 / Math.sqrt(((V * l) / A));
} 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 = A / (V * l) tmp = 0 if t_0 <= 1e-311: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 2e+293: tmp = c0 / math.sqrt(((V * l) / A)) 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(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 1e-311) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 2e+293) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); 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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-311)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 2e+293)
tmp = c0 / sqrt(((V * l) / A));
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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-311], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+293], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 10^{-311}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+293}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.99999999999948e-312Initial program 31.2%
*-un-lft-identity31.2%
times-frac48.5%
Applied egg-rr48.5%
associate-*l/48.5%
*-un-lft-identity48.5%
Applied egg-rr48.5%
if 9.99999999999948e-312 < (/.f64 A (*.f64 V l)) < 1.9999999999999998e293Initial program 99.1%
associate-/r*91.2%
clear-num91.1%
sqrt-div91.1%
metadata-eval91.1%
div-inv91.1%
clear-num91.2%
Applied egg-rr91.2%
*-commutative91.2%
associate-*l/99.0%
associate-/l*94.4%
Simplified94.4%
un-div-inv94.6%
associate-*r/99.2%
Applied egg-rr99.2%
if 1.9999999999999998e293 < (/.f64 A (*.f64 V l)) Initial program 45.0%
associate-/r*54.5%
clear-num54.4%
sqrt-div58.6%
metadata-eval58.6%
div-inv58.6%
clear-num58.7%
Applied egg-rr58.7%
*-commutative58.7%
associate-*l/46.6%
associate-/l*57.6%
Simplified57.6%
un-div-inv57.7%
associate-*r/46.6%
Applied egg-rr46.6%
associate-/l*57.7%
Simplified57.7%
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 70.9%
herbie shell --seed 2024085
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))