
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= A -5e-311)
(/ c0 (/ (sqrt l) (/ (sqrt (- A)) (sqrt (- V)))))
(if (<= A 2.8e-126)
(/ c0 (/ (sqrt (* l V)) (sqrt A)))
(if (<= A 6.8e+218)
(* c0 (sqrt (/ (/ 1.0 l) (/ V A))))
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-311) {
tmp = c0 / (sqrt(l) / (sqrt(-A) / sqrt(-V)));
} else if (A <= 2.8e-126) {
tmp = c0 / (sqrt((l * V)) / sqrt(A));
} else if (A <= 6.8e+218) {
tmp = c0 * sqrt(((1.0 / l) / (V / A)));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-5d-311)) then
tmp = c0 / (sqrt(l) / (sqrt(-a) / sqrt(-v)))
else if (a <= 2.8d-126) then
tmp = c0 / (sqrt((l * v)) / sqrt(a))
else if (a <= 6.8d+218) then
tmp = c0 * sqrt(((1.0d0 / l) / (v / a)))
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / v) / l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-311) {
tmp = c0 / (Math.sqrt(l) / (Math.sqrt(-A) / Math.sqrt(-V)));
} else if (A <= 2.8e-126) {
tmp = c0 / (Math.sqrt((l * V)) / Math.sqrt(A));
} else if (A <= 6.8e+218) {
tmp = c0 * Math.sqrt(((1.0 / l) / (V / A)));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-311: tmp = c0 / (math.sqrt(l) / (math.sqrt(-A) / math.sqrt(-V))) elif A <= 2.8e-126: tmp = c0 / (math.sqrt((l * V)) / math.sqrt(A)) elif A <= 6.8e+218: tmp = c0 * math.sqrt(((1.0 / l) / (V / A))) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-311) tmp = Float64(c0 / Float64(sqrt(l) / Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))))); elseif (A <= 2.8e-126) tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) / sqrt(A))); elseif (A <= 6.8e+218) tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / l) / Float64(V / A)))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -5e-311)
tmp = c0 / (sqrt(l) / (sqrt(-A) / sqrt(-V)));
elseif (A <= 2.8e-126)
tmp = c0 / (sqrt((l * V)) / sqrt(A));
elseif (A <= 6.8e+218)
tmp = c0 * sqrt(((1.0 / l) / (V / A)));
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -5e-311], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 2.8e-126], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 6.8e+218], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-311}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\frac{\sqrt{-A}}{\sqrt{-V}}}}\\
\mathbf{elif}\;A \leq 2.8 \cdot 10^{-126}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\
\mathbf{elif}\;A \leq 6.8 \cdot 10^{+218}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if A < -5.00000000000023e-311Initial program 72.3%
associate-/r*76.9%
sqrt-div30.9%
associate-*r/29.8%
Applied egg-rr29.8%
associate-/l*30.9%
Simplified30.9%
frac-2neg30.9%
sqrt-div38.3%
Applied egg-rr38.3%
if -5.00000000000023e-311 < A < 2.79999999999999992e-126Initial program 76.3%
*-un-lft-identity76.3%
times-frac70.3%
Applied egg-rr70.3%
associate-*l/70.2%
*-un-lft-identity70.2%
div-inv70.2%
associate-*l/68.8%
un-div-inv68.8%
sqrt-div31.6%
clear-num31.5%
expm1-log1p-u26.8%
div-inv26.8%
expm1-udef10.9%
Applied egg-rr46.9%
expm1-def59.6%
expm1-log1p68.0%
Simplified68.0%
associate-*r/76.4%
sqrt-div95.4%
*-commutative95.4%
Applied egg-rr95.4%
if 2.79999999999999992e-126 < A < 6.80000000000000017e218Initial program 72.7%
*-un-lft-identity72.7%
times-frac82.4%
Applied egg-rr82.4%
frac-times72.7%
*-commutative72.7%
frac-times80.1%
clear-num80.0%
un-div-inv81.1%
Applied egg-rr81.1%
if 6.80000000000000017e218 < A Initial program 73.4%
div-inv73.3%
sqrt-prod89.4%
associate-/r*89.4%
Applied egg-rr89.4%
Final simplification62.0%
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 (* l V))))))
(if (or (<= t_0 0.0) (not (<= t_0 1e+212)))
(* 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 / (l * V)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 1e+212)) {
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 / (l * v)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 1d+212))) 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 / (l * V)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 1e+212)) {
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 / (l * V))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 1e+212): 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(l * V)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 1e+212)) 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 / (l * V)));
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 1e+212)))
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[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 1e+212]], $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}{\ell \cdot V}}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 10^{+212}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 9.9999999999999991e211 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 67.7%
associate-/r*72.9%
Simplified72.9%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999991e211Initial program 99.0%
Final simplification77.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* l V))))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+232) t_0 (/ c0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (l * V)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 1e+232) {
tmp = t_0;
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (l * v)))
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 1d+232) then
tmp = t_0
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (l * V)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+232) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (l * V))) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 1e+232: tmp = t_0 else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(l * V)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+232) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (l * V)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 1e+232)
tmp = t_0;
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+232], t$95$0, N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 10^{+232}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 69.5%
associate-/r*73.2%
Simplified73.2%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.00000000000000006e232Initial program 99.1%
if 1.00000000000000006e232 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 55.9%
*-un-lft-identity55.9%
times-frac70.7%
Applied egg-rr70.7%
associate-*l/70.8%
*-un-lft-identity70.8%
div-inv70.8%
associate-*l/70.7%
un-div-inv70.7%
sqrt-div43.8%
clear-num43.9%
expm1-log1p-u42.8%
div-inv42.8%
expm1-udef33.0%
Applied egg-rr58.3%
expm1-def68.1%
expm1-log1p70.8%
Simplified70.8%
Taylor expanded in V around 0 55.9%
associate-*l/70.8%
Simplified70.8%
Final simplification77.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* l V))))))
(if (<= t_0 5e-297)
(* c0 (sqrt (* (/ 1.0 V) (/ A l))))
(if (<= t_0 1e+232) t_0 (/ c0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (l * V)));
double tmp;
if (t_0 <= 5e-297) {
tmp = c0 * sqrt(((1.0 / V) * (A / l)));
} else if (t_0 <= 1e+232) {
tmp = t_0;
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (l * v)))
if (t_0 <= 5d-297) then
tmp = c0 * sqrt(((1.0d0 / v) * (a / l)))
else if (t_0 <= 1d+232) then
tmp = t_0
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (l * V)));
double tmp;
if (t_0 <= 5e-297) {
tmp = c0 * Math.sqrt(((1.0 / V) * (A / l)));
} else if (t_0 <= 1e+232) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (l * V))) tmp = 0 if t_0 <= 5e-297: tmp = c0 * math.sqrt(((1.0 / V) * (A / l))) elif t_0 <= 1e+232: tmp = t_0 else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(l * V)))) tmp = 0.0 if (t_0 <= 5e-297) tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / V) * Float64(A / l)))); elseif (t_0 <= 1e+232) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (l * V)));
tmp = 0.0;
if (t_0 <= 5e-297)
tmp = c0 * sqrt(((1.0 / V) * (A / l)));
elseif (t_0 <= 1e+232)
tmp = t_0;
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-297], N[(c0 * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] * N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+232], t$95$0, N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{-297}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}\\
\mathbf{elif}\;t_0 \leq 10^{+232}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5e-297Initial program 70.0%
*-un-lft-identity70.0%
times-frac76.9%
Applied egg-rr76.9%
if 5e-297 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.00000000000000006e232Initial program 99.0%
if 1.00000000000000006e232 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 55.9%
*-un-lft-identity55.9%
times-frac70.7%
Applied egg-rr70.7%
associate-*l/70.8%
*-un-lft-identity70.8%
div-inv70.8%
associate-*l/70.7%
un-div-inv70.7%
sqrt-div43.8%
clear-num43.9%
expm1-log1p-u42.8%
div-inv42.8%
expm1-udef33.0%
Applied egg-rr58.3%
expm1-def68.1%
expm1-log1p70.8%
Simplified70.8%
Taylor expanded in V around 0 55.9%
associate-*l/70.8%
Simplified70.8%
Final simplification79.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) -1e+133)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= (* l V) -1e-177)
(/ c0 (sqrt (/ (* l V) A)))
(if (<= (* l V) 5e-297)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* l V) 4e+247)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(* c0 (sqrt (* (/ 1.0 l) (/ A V)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -1e+133) {
tmp = c0 * sqrt(((A / V) / l));
} else if ((l * V) <= -1e-177) {
tmp = c0 / sqrt(((l * V) / A));
} else if ((l * V) <= 5e-297) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((l * V) <= 4e+247) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 * sqrt(((1.0 / l) * (A / V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((l * v) <= (-1d+133)) then
tmp = c0 * sqrt(((a / v) / l))
else if ((l * v) <= (-1d-177)) then
tmp = c0 / sqrt(((l * v) / a))
else if ((l * v) <= 5d-297) then
tmp = c0 / sqrt((l * (v / a)))
else if ((l * v) <= 4d+247) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
else
tmp = c0 * sqrt(((1.0d0 / l) * (a / v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -1e+133) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if ((l * V) <= -1e-177) {
tmp = c0 / Math.sqrt(((l * V) / A));
} else if ((l * V) <= 5e-297) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((l * V) <= 4e+247) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = c0 * Math.sqrt(((1.0 / l) * (A / V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -1e+133: tmp = c0 * math.sqrt(((A / V) / l)) elif (l * V) <= -1e-177: tmp = c0 / math.sqrt(((l * V) / A)) elif (l * V) <= 5e-297: tmp = c0 / math.sqrt((l * (V / A))) elif (l * V) <= 4e+247: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = c0 * math.sqrt(((1.0 / l) * (A / V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= -1e+133) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (Float64(l * V) <= -1e-177) tmp = Float64(c0 / sqrt(Float64(Float64(l * V) / A))); elseif (Float64(l * V) <= 5e-297) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(l * V) <= 4e+247) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / l) * Float64(A / V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((l * V) <= -1e+133)
tmp = c0 * sqrt(((A / V) / l));
elseif ((l * V) <= -1e-177)
tmp = c0 / sqrt(((l * V) / A));
elseif ((l * V) <= 5e-297)
tmp = c0 / sqrt((l * (V / A)));
elseif ((l * V) <= 4e+247)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = c0 * sqrt(((1.0 / l) * (A / V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(l * V), $MachinePrecision], -1e+133], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -1e-177], N[(c0 / N[Sqrt[N[(N[(l * V), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 5e-297], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 4e+247], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] * N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -1 \cdot 10^{+133}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;\ell \cdot V \leq -1 \cdot 10^{-177}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell \cdot V}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq 5 \cdot 10^{-297}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq 4 \cdot 10^{+247}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{\ell} \cdot \frac{A}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1e133Initial program 62.5%
associate-/r*77.5%
Simplified77.5%
if -1e133 < (*.f64 V l) < -9.99999999999999952e-178Initial program 91.9%
*-un-lft-identity91.9%
times-frac83.5%
Applied egg-rr83.5%
associate-*l/83.6%
*-un-lft-identity83.6%
Applied egg-rr83.6%
div-inv83.5%
associate-*l/80.6%
div-inv80.7%
sqrt-undiv28.3%
clear-num28.3%
frac-2neg28.3%
sqrt-div37.7%
associate-/l*37.7%
sqrt-prod99.3%
un-div-inv99.4%
sqrt-undiv93.8%
distribute-rgt-neg-out93.8%
distribute-lft-neg-in93.8%
associate-*l/85.5%
frac-2neg85.5%
associate-*l/93.8%
Applied egg-rr93.8%
if -9.99999999999999952e-178 < (*.f64 V l) < 5e-297Initial program 55.5%
*-un-lft-identity55.5%
times-frac70.2%
Applied egg-rr70.2%
associate-*l/70.3%
*-un-lft-identity70.3%
div-inv70.2%
associate-*l/70.2%
un-div-inv70.2%
sqrt-div41.3%
clear-num41.4%
expm1-log1p-u29.4%
div-inv29.4%
expm1-udef15.4%
Applied egg-rr28.3%
expm1-def44.1%
expm1-log1p70.3%
Simplified70.3%
Taylor expanded in V around 0 55.5%
associate-*l/70.4%
Simplified70.4%
if 5e-297 < (*.f64 V l) < 3.99999999999999981e247Initial program 87.5%
sqrt-div99.4%
associate-*r/96.3%
Applied egg-rr96.3%
*-commutative96.3%
associate-/l*97.0%
associate-/r/99.4%
Simplified99.4%
if 3.99999999999999981e247 < (*.f64 V l) Initial program 45.2%
associate-/r*75.9%
div-inv75.9%
Applied egg-rr75.9%
Final simplification85.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 l) (sqrt (/ A V))))))
(if (<= (* l V) -1e+125)
t_0
(if (<= (* l V) -1e-162)
(/ c0 (sqrt (/ (* l V) A)))
(if (<= (* l V) 0.0)
t_0
(if (<= (* l V) 4e+247)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(* c0 (sqrt (* (/ 1.0 l) (/ A V))))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 / (sqrt(l) / sqrt((A / V)));
double tmp;
if ((l * V) <= -1e+125) {
tmp = t_0;
} else if ((l * V) <= -1e-162) {
tmp = c0 / sqrt(((l * V) / A));
} else if ((l * V) <= 0.0) {
tmp = t_0;
} else if ((l * V) <= 4e+247) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 * sqrt(((1.0 / l) * (A / V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 / (sqrt(l) / sqrt((a / v)))
if ((l * v) <= (-1d+125)) then
tmp = t_0
else if ((l * v) <= (-1d-162)) then
tmp = c0 / sqrt(((l * v) / a))
else if ((l * v) <= 0.0d0) then
tmp = t_0
else if ((l * v) <= 4d+247) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
else
tmp = c0 * sqrt(((1.0d0 / l) * (a / v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 / (Math.sqrt(l) / Math.sqrt((A / V)));
double tmp;
if ((l * V) <= -1e+125) {
tmp = t_0;
} else if ((l * V) <= -1e-162) {
tmp = c0 / Math.sqrt(((l * V) / A));
} else if ((l * V) <= 0.0) {
tmp = t_0;
} else if ((l * V) <= 4e+247) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = c0 * Math.sqrt(((1.0 / l) * (A / V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 / (math.sqrt(l) / math.sqrt((A / V))) tmp = 0 if (l * V) <= -1e+125: tmp = t_0 elif (l * V) <= -1e-162: tmp = c0 / math.sqrt(((l * V) / A)) elif (l * V) <= 0.0: tmp = t_0 elif (l * V) <= 4e+247: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = c0 * math.sqrt(((1.0 / l) * (A / V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 / Float64(sqrt(l) / sqrt(Float64(A / V)))) tmp = 0.0 if (Float64(l * V) <= -1e+125) tmp = t_0; elseif (Float64(l * V) <= -1e-162) tmp = Float64(c0 / sqrt(Float64(Float64(l * V) / A))); elseif (Float64(l * V) <= 0.0) tmp = t_0; elseif (Float64(l * V) <= 4e+247) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / l) * Float64(A / V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 / (sqrt(l) / sqrt((A / V)));
tmp = 0.0;
if ((l * V) <= -1e+125)
tmp = t_0;
elseif ((l * V) <= -1e-162)
tmp = c0 / sqrt(((l * V) / A));
elseif ((l * V) <= 0.0)
tmp = t_0;
elseif ((l * V) <= 4e+247)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = c0 * sqrt(((1.0 / l) * (A / V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(l * V), $MachinePrecision], -1e+125], t$95$0, If[LessEqual[N[(l * V), $MachinePrecision], -1e-162], N[(c0 / N[Sqrt[N[(N[(l * V), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(l * V), $MachinePrecision], 4e+247], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] * N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{if}\;\ell \cdot V \leq -1 \cdot 10^{+125}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \cdot V \leq -1 \cdot 10^{-162}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell \cdot V}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \cdot V \leq 4 \cdot 10^{+247}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{\ell} \cdot \frac{A}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.9999999999999992e124 or -9.99999999999999954e-163 < (*.f64 V l) < -0.0Initial program 57.3%
associate-/r*71.9%
sqrt-div36.7%
associate-*r/35.8%
Applied egg-rr35.8%
associate-/l*36.7%
Simplified36.7%
if -9.9999999999999992e124 < (*.f64 V l) < -9.99999999999999954e-163Initial program 95.2%
*-un-lft-identity95.2%
times-frac87.9%
Applied egg-rr87.9%
associate-*l/88.0%
*-un-lft-identity88.0%
Applied egg-rr88.0%
div-inv87.9%
associate-*l/82.4%
div-inv82.4%
sqrt-undiv25.4%
clear-num25.4%
frac-2neg25.4%
sqrt-div36.0%
associate-/l*36.1%
sqrt-prod99.3%
un-div-inv99.4%
sqrt-undiv97.4%
distribute-rgt-neg-out97.4%
distribute-lft-neg-in97.4%
associate-*l/90.1%
frac-2neg90.1%
associate-*l/97.4%
Applied egg-rr97.4%
if -0.0 < (*.f64 V l) < 3.99999999999999981e247Initial program 88.0%
sqrt-div99.1%
associate-*r/96.2%
Applied egg-rr96.2%
*-commutative96.2%
associate-/l*96.9%
associate-/r/99.1%
Simplified99.1%
if 3.99999999999999981e247 < (*.f64 V l) Initial program 45.2%
associate-/r*75.9%
div-inv75.9%
Applied egg-rr75.9%
Final simplification71.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 l) (sqrt (/ A V))))))
(if (<= (* l V) -1e+125)
t_0
(if (<= (* l V) -1e-162)
(/ c0 (sqrt (/ (* l V) A)))
(if (<= (* l V) 0.0)
t_0
(if (<= (* l V) 4e+247)
(/ c0 (/ (sqrt (* l V)) (sqrt A)))
(* c0 (sqrt (* (/ 1.0 l) (/ A V))))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 / (sqrt(l) / sqrt((A / V)));
double tmp;
if ((l * V) <= -1e+125) {
tmp = t_0;
} else if ((l * V) <= -1e-162) {
tmp = c0 / sqrt(((l * V) / A));
} else if ((l * V) <= 0.0) {
tmp = t_0;
} else if ((l * V) <= 4e+247) {
tmp = c0 / (sqrt((l * V)) / sqrt(A));
} else {
tmp = c0 * sqrt(((1.0 / l) * (A / V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 / (sqrt(l) / sqrt((a / v)))
if ((l * v) <= (-1d+125)) then
tmp = t_0
else if ((l * v) <= (-1d-162)) then
tmp = c0 / sqrt(((l * v) / a))
else if ((l * v) <= 0.0d0) then
tmp = t_0
else if ((l * v) <= 4d+247) then
tmp = c0 / (sqrt((l * v)) / sqrt(a))
else
tmp = c0 * sqrt(((1.0d0 / l) * (a / v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 / (Math.sqrt(l) / Math.sqrt((A / V)));
double tmp;
if ((l * V) <= -1e+125) {
tmp = t_0;
} else if ((l * V) <= -1e-162) {
tmp = c0 / Math.sqrt(((l * V) / A));
} else if ((l * V) <= 0.0) {
tmp = t_0;
} else if ((l * V) <= 4e+247) {
tmp = c0 / (Math.sqrt((l * V)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((1.0 / l) * (A / V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 / (math.sqrt(l) / math.sqrt((A / V))) tmp = 0 if (l * V) <= -1e+125: tmp = t_0 elif (l * V) <= -1e-162: tmp = c0 / math.sqrt(((l * V) / A)) elif (l * V) <= 0.0: tmp = t_0 elif (l * V) <= 4e+247: tmp = c0 / (math.sqrt((l * V)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(((1.0 / l) * (A / V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 / Float64(sqrt(l) / sqrt(Float64(A / V)))) tmp = 0.0 if (Float64(l * V) <= -1e+125) tmp = t_0; elseif (Float64(l * V) <= -1e-162) tmp = Float64(c0 / sqrt(Float64(Float64(l * V) / A))); elseif (Float64(l * V) <= 0.0) tmp = t_0; elseif (Float64(l * V) <= 4e+247) tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) / sqrt(A))); else tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / l) * Float64(A / V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 / (sqrt(l) / sqrt((A / V)));
tmp = 0.0;
if ((l * V) <= -1e+125)
tmp = t_0;
elseif ((l * V) <= -1e-162)
tmp = c0 / sqrt(((l * V) / A));
elseif ((l * V) <= 0.0)
tmp = t_0;
elseif ((l * V) <= 4e+247)
tmp = c0 / (sqrt((l * V)) / sqrt(A));
else
tmp = c0 * sqrt(((1.0 / l) * (A / V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(l * V), $MachinePrecision], -1e+125], t$95$0, If[LessEqual[N[(l * V), $MachinePrecision], -1e-162], N[(c0 / N[Sqrt[N[(N[(l * V), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(l * V), $MachinePrecision], 4e+247], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] * N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{if}\;\ell \cdot V \leq -1 \cdot 10^{+125}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \cdot V \leq -1 \cdot 10^{-162}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell \cdot V}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \cdot V \leq 4 \cdot 10^{+247}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{\ell} \cdot \frac{A}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.9999999999999992e124 or -9.99999999999999954e-163 < (*.f64 V l) < -0.0Initial program 57.3%
associate-/r*71.9%
sqrt-div36.7%
associate-*r/35.8%
Applied egg-rr35.8%
associate-/l*36.7%
Simplified36.7%
if -9.9999999999999992e124 < (*.f64 V l) < -9.99999999999999954e-163Initial program 95.2%
*-un-lft-identity95.2%
times-frac87.9%
Applied egg-rr87.9%
associate-*l/88.0%
*-un-lft-identity88.0%
Applied egg-rr88.0%
div-inv87.9%
associate-*l/82.4%
div-inv82.4%
sqrt-undiv25.4%
clear-num25.4%
frac-2neg25.4%
sqrt-div36.0%
associate-/l*36.1%
sqrt-prod99.3%
un-div-inv99.4%
sqrt-undiv97.4%
distribute-rgt-neg-out97.4%
distribute-lft-neg-in97.4%
associate-*l/90.1%
frac-2neg90.1%
associate-*l/97.4%
Applied egg-rr97.4%
if -0.0 < (*.f64 V l) < 3.99999999999999981e247Initial program 88.0%
*-un-lft-identity88.0%
times-frac81.4%
Applied egg-rr81.4%
associate-*l/81.4%
*-un-lft-identity81.4%
div-inv81.3%
associate-*l/76.3%
un-div-inv76.3%
sqrt-div34.7%
clear-num34.7%
expm1-log1p-u26.7%
div-inv26.7%
expm1-udef13.6%
Applied egg-rr34.6%
expm1-def57.5%
expm1-log1p80.6%
Simplified80.6%
associate-*r/88.0%
sqrt-div99.1%
*-commutative99.1%
Applied egg-rr99.1%
if 3.99999999999999981e247 < (*.f64 V l) Initial program 45.2%
associate-/r*75.9%
div-inv75.9%
Applied egg-rr75.9%
Final simplification71.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 (/ (sqrt (/ A V)) (/ (sqrt l) c0))))
(if (<= (* l V) -1e+187)
t_0
(if (<= (* l V) -1e-162)
(/ c0 (sqrt (/ (* l V) A)))
(if (<= (* l V) 0.0)
t_0
(if (<= (* l V) 4e+247)
(/ c0 (/ (sqrt (* l V)) (sqrt A)))
(* c0 (sqrt (* (/ 1.0 l) (/ A V))))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V)) / (sqrt(l) / c0);
double tmp;
if ((l * V) <= -1e+187) {
tmp = t_0;
} else if ((l * V) <= -1e-162) {
tmp = c0 / sqrt(((l * V) / A));
} else if ((l * V) <= 0.0) {
tmp = t_0;
} else if ((l * V) <= 4e+247) {
tmp = c0 / (sqrt((l * V)) / sqrt(A));
} else {
tmp = c0 * sqrt(((1.0 / l) * (A / V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v)) / (sqrt(l) / c0)
if ((l * v) <= (-1d+187)) then
tmp = t_0
else if ((l * v) <= (-1d-162)) then
tmp = c0 / sqrt(((l * v) / a))
else if ((l * v) <= 0.0d0) then
tmp = t_0
else if ((l * v) <= 4d+247) then
tmp = c0 / (sqrt((l * v)) / sqrt(a))
else
tmp = c0 * sqrt(((1.0d0 / l) * (a / v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V)) / (Math.sqrt(l) / c0);
double tmp;
if ((l * V) <= -1e+187) {
tmp = t_0;
} else if ((l * V) <= -1e-162) {
tmp = c0 / Math.sqrt(((l * V) / A));
} else if ((l * V) <= 0.0) {
tmp = t_0;
} else if ((l * V) <= 4e+247) {
tmp = c0 / (Math.sqrt((l * V)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((1.0 / l) * (A / V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) / (math.sqrt(l) / c0) tmp = 0 if (l * V) <= -1e+187: tmp = t_0 elif (l * V) <= -1e-162: tmp = c0 / math.sqrt(((l * V) / A)) elif (l * V) <= 0.0: tmp = t_0 elif (l * V) <= 4e+247: tmp = c0 / (math.sqrt((l * V)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(((1.0 / l) * (A / V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(sqrt(Float64(A / V)) / Float64(sqrt(l) / c0)) tmp = 0.0 if (Float64(l * V) <= -1e+187) tmp = t_0; elseif (Float64(l * V) <= -1e-162) tmp = Float64(c0 / sqrt(Float64(Float64(l * V) / A))); elseif (Float64(l * V) <= 0.0) tmp = t_0; elseif (Float64(l * V) <= 4e+247) tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) / sqrt(A))); else tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / l) * Float64(A / V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V)) / (sqrt(l) / c0);
tmp = 0.0;
if ((l * V) <= -1e+187)
tmp = t_0;
elseif ((l * V) <= -1e-162)
tmp = c0 / sqrt(((l * V) / A));
elseif ((l * V) <= 0.0)
tmp = t_0;
elseif ((l * V) <= 4e+247)
tmp = c0 / (sqrt((l * V)) / sqrt(A));
else
tmp = c0 * sqrt(((1.0 / l) * (A / V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(l * V), $MachinePrecision], -1e+187], t$95$0, If[LessEqual[N[(l * V), $MachinePrecision], -1e-162], N[(c0 / N[Sqrt[N[(N[(l * V), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(l * V), $MachinePrecision], 4e+247], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] * N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\
\mathbf{if}\;\ell \cdot V \leq -1 \cdot 10^{+187}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \cdot V \leq -1 \cdot 10^{-162}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell \cdot V}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \cdot V \leq 4 \cdot 10^{+247}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{\ell} \cdot \frac{A}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999907e186 or -9.99999999999999954e-163 < (*.f64 V l) < -0.0Initial program 51.9%
associate-/r*69.1%
sqrt-div37.7%
associate-*r/37.7%
Applied egg-rr37.7%
*-commutative37.7%
associate-/l*37.8%
Simplified37.8%
if -9.99999999999999907e186 < (*.f64 V l) < -9.99999999999999954e-163Initial program 93.1%
*-un-lft-identity93.1%
times-frac87.9%
Applied egg-rr87.9%
associate-*l/87.9%
*-un-lft-identity87.9%
Applied egg-rr87.9%
div-inv87.9%
associate-*l/83.8%
div-inv83.8%
sqrt-undiv26.9%
clear-num26.9%
frac-2neg26.9%
sqrt-div34.7%
associate-/l*34.7%
sqrt-prod99.3%
un-div-inv99.4%
sqrt-undiv94.7%
distribute-rgt-neg-out94.7%
distribute-lft-neg-in94.7%
associate-*l/89.4%
frac-2neg89.4%
associate-*l/94.7%
Applied egg-rr94.7%
if -0.0 < (*.f64 V l) < 3.99999999999999981e247Initial program 88.0%
*-un-lft-identity88.0%
times-frac81.4%
Applied egg-rr81.4%
associate-*l/81.4%
*-un-lft-identity81.4%
div-inv81.3%
associate-*l/76.3%
un-div-inv76.3%
sqrt-div34.7%
clear-num34.7%
expm1-log1p-u26.7%
div-inv26.7%
expm1-udef13.6%
Applied egg-rr34.6%
expm1-def57.5%
expm1-log1p80.6%
Simplified80.6%
associate-*r/88.0%
sqrt-div99.1%
*-commutative99.1%
Applied egg-rr99.1%
if 3.99999999999999981e247 < (*.f64 V l) Initial program 45.2%
associate-/r*75.9%
div-inv75.9%
Applied egg-rr75.9%
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 (sqrt (/ A V))))
(if (<= (* l V) -2e+294)
(/ c0 (/ (sqrt l) t_0))
(if (<= (* l V) -1e-212)
(* c0 (/ (sqrt (- A)) (sqrt (* l (- V)))))
(if (<= (* l V) 0.0)
(/ t_0 (/ (sqrt l) c0))
(if (<= (* l V) 4e+247)
(/ c0 (/ (sqrt (* l V)) (sqrt A)))
(* c0 (sqrt (* (/ 1.0 l) (/ A V))))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((l * V) <= -2e+294) {
tmp = c0 / (sqrt(l) / t_0);
} else if ((l * V) <= -1e-212) {
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
} else if ((l * V) <= 0.0) {
tmp = t_0 / (sqrt(l) / c0);
} else if ((l * V) <= 4e+247) {
tmp = c0 / (sqrt((l * V)) / sqrt(A));
} else {
tmp = c0 * sqrt(((1.0 / l) * (A / V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((l * v) <= (-2d+294)) then
tmp = c0 / (sqrt(l) / t_0)
else if ((l * v) <= (-1d-212)) then
tmp = c0 * (sqrt(-a) / sqrt((l * -v)))
else if ((l * v) <= 0.0d0) then
tmp = t_0 / (sqrt(l) / c0)
else if ((l * v) <= 4d+247) then
tmp = c0 / (sqrt((l * v)) / sqrt(a))
else
tmp = c0 * sqrt(((1.0d0 / l) * (a / v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double tmp;
if ((l * V) <= -2e+294) {
tmp = c0 / (Math.sqrt(l) / t_0);
} else if ((l * V) <= -1e-212) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((l * -V)));
} else if ((l * V) <= 0.0) {
tmp = t_0 / (Math.sqrt(l) / c0);
} else if ((l * V) <= 4e+247) {
tmp = c0 / (Math.sqrt((l * V)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((1.0 / l) * (A / V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (l * V) <= -2e+294: tmp = c0 / (math.sqrt(l) / t_0) elif (l * V) <= -1e-212: tmp = c0 * (math.sqrt(-A) / math.sqrt((l * -V))) elif (l * V) <= 0.0: tmp = t_0 / (math.sqrt(l) / c0) elif (l * V) <= 4e+247: tmp = c0 / (math.sqrt((l * V)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(((1.0 / l) * (A / V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(l * V) <= -2e+294) tmp = Float64(c0 / Float64(sqrt(l) / t_0)); elseif (Float64(l * V) <= -1e-212) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V))))); elseif (Float64(l * V) <= 0.0) tmp = Float64(t_0 / Float64(sqrt(l) / c0)); elseif (Float64(l * V) <= 4e+247) tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) / sqrt(A))); else tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / l) * Float64(A / V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((l * V) <= -2e+294)
tmp = c0 / (sqrt(l) / t_0);
elseif ((l * V) <= -1e-212)
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
elseif ((l * V) <= 0.0)
tmp = t_0 / (sqrt(l) / c0);
elseif ((l * V) <= 4e+247)
tmp = c0 / (sqrt((l * V)) / sqrt(A));
else
tmp = c0 * sqrt(((1.0 / l) * (A / V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(l * V), $MachinePrecision], -2e+294], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -1e-212], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 0.0], N[(t$95$0 / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 4e+247], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] * N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;\ell \cdot V \leq -2 \cdot 10^{+294}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{t_0}}\\
\mathbf{elif}\;\ell \cdot V \leq -1 \cdot 10^{-212}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\
\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;\frac{t_0}{\frac{\sqrt{\ell}}{c0}}\\
\mathbf{elif}\;\ell \cdot V \leq 4 \cdot 10^{+247}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{\ell} \cdot \frac{A}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000013e294Initial program 43.8%
associate-/r*78.4%
sqrt-div32.3%
associate-*r/32.2%
Applied egg-rr32.2%
associate-/l*32.2%
Simplified32.2%
if -2.00000000000000013e294 < (*.f64 V l) < -9.99999999999999954e-213Initial program 86.5%
frac-2neg86.5%
sqrt-div99.3%
distribute-rgt-neg-in99.3%
Applied egg-rr99.3%
distribute-rgt-neg-out99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Simplified99.3%
if -9.99999999999999954e-213 < (*.f64 V l) < -0.0Initial program 49.5%
associate-/r*65.9%
sqrt-div45.3%
associate-*r/45.4%
Applied egg-rr45.4%
*-commutative45.4%
associate-/l*45.5%
Simplified45.5%
if -0.0 < (*.f64 V l) < 3.99999999999999981e247Initial program 88.0%
*-un-lft-identity88.0%
times-frac81.4%
Applied egg-rr81.4%
associate-*l/81.4%
*-un-lft-identity81.4%
div-inv81.3%
associate-*l/76.3%
un-div-inv76.3%
sqrt-div34.7%
clear-num34.7%
expm1-log1p-u26.7%
div-inv26.7%
expm1-udef13.6%
Applied egg-rr34.6%
expm1-def57.5%
expm1-log1p80.6%
Simplified80.6%
associate-*r/88.0%
sqrt-div99.1%
*-commutative99.1%
Applied egg-rr99.1%
if 3.99999999999999981e247 < (*.f64 V l) Initial program 45.2%
associate-/r*75.9%
div-inv75.9%
Applied egg-rr75.9%
Final simplification81.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (/ A V))) (t_1 (/ (/ 1.0 V) l)))
(if (<= l -5e-310)
(* c0 (* (sqrt A) (sqrt t_1)))
(if (<= l 2.6e+68)
(/ c0 (/ (sqrt l) t_0))
(if (<= l 8.5e+187) (* c0 (sqrt (* A t_1))) (/ t_0 (/ (sqrt l) c0)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double t_1 = (1.0 / V) / l;
double tmp;
if (l <= -5e-310) {
tmp = c0 * (sqrt(A) * sqrt(t_1));
} else if (l <= 2.6e+68) {
tmp = c0 / (sqrt(l) / t_0);
} else if (l <= 8.5e+187) {
tmp = c0 * sqrt((A * t_1));
} else {
tmp = t_0 / (sqrt(l) / c0);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((a / v))
t_1 = (1.0d0 / v) / l
if (l <= (-5d-310)) then
tmp = c0 * (sqrt(a) * sqrt(t_1))
else if (l <= 2.6d+68) then
tmp = c0 / (sqrt(l) / t_0)
else if (l <= 8.5d+187) then
tmp = c0 * sqrt((a * t_1))
else
tmp = t_0 / (sqrt(l) / c0)
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double t_1 = (1.0 / V) / l;
double tmp;
if (l <= -5e-310) {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(t_1));
} else if (l <= 2.6e+68) {
tmp = c0 / (Math.sqrt(l) / t_0);
} else if (l <= 8.5e+187) {
tmp = c0 * Math.sqrt((A * t_1));
} else {
tmp = t_0 / (Math.sqrt(l) / c0);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) t_1 = (1.0 / V) / l tmp = 0 if l <= -5e-310: tmp = c0 * (math.sqrt(A) * math.sqrt(t_1)) elif l <= 2.6e+68: tmp = c0 / (math.sqrt(l) / t_0) elif l <= 8.5e+187: tmp = c0 * math.sqrt((A * t_1)) else: tmp = t_0 / (math.sqrt(l) / c0) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) t_1 = Float64(Float64(1.0 / V) / l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 * Float64(sqrt(A) * sqrt(t_1))); elseif (l <= 2.6e+68) tmp = Float64(c0 / Float64(sqrt(l) / t_0)); elseif (l <= 8.5e+187) tmp = Float64(c0 * sqrt(Float64(A * t_1))); else tmp = Float64(t_0 / Float64(sqrt(l) / c0)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
t_1 = (1.0 / V) / l;
tmp = 0.0;
if (l <= -5e-310)
tmp = c0 * (sqrt(A) * sqrt(t_1));
elseif (l <= 2.6e+68)
tmp = c0 / (sqrt(l) / t_0);
elseif (l <= 8.5e+187)
tmp = c0 * sqrt((A * t_1));
else
tmp = t_0 / (sqrt(l) / c0);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[l, -5e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2.6e+68], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 8.5e+187], N[(c0 * N[Sqrt[N[(A * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
t_1 := \frac{\frac{1}{V}}{\ell}\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{t_1}\right)\\
\mathbf{elif}\;\ell \leq 2.6 \cdot 10^{+68}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{t_0}}\\
\mathbf{elif}\;\ell \leq 8.5 \cdot 10^{+187}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{\frac{\sqrt{\ell}}{c0}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 75.3%
div-inv74.8%
sqrt-prod39.3%
associate-/r*41.0%
Applied egg-rr41.0%
if -4.999999999999985e-310 < l < 2.5999999999999998e68Initial program 68.0%
associate-/r*70.1%
sqrt-div75.3%
associate-*r/73.7%
Applied egg-rr73.7%
associate-/l*75.4%
Simplified75.4%
if 2.5999999999999998e68 < l < 8.49999999999999989e187Initial program 85.1%
clear-num85.1%
associate-/r/85.0%
associate-/r*85.1%
Applied egg-rr85.1%
if 8.49999999999999989e187 < l Initial program 54.9%
associate-/r*73.8%
sqrt-div94.2%
associate-*r/94.0%
Applied egg-rr94.0%
*-commutative94.0%
associate-/l*94.2%
Simplified94.2%
Final simplification58.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (/ A V))) (t_1 (/ (/ 1.0 V) l)))
(if (<= l -5e-310)
(* c0 (* (sqrt A) (sqrt t_1)))
(if (<= l 3.2e+68)
(* c0 (/ 1.0 (/ (sqrt l) t_0)))
(if (<= l 8.5e+187) (* c0 (sqrt (* A t_1))) (/ t_0 (/ (sqrt l) c0)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double t_1 = (1.0 / V) / l;
double tmp;
if (l <= -5e-310) {
tmp = c0 * (sqrt(A) * sqrt(t_1));
} else if (l <= 3.2e+68) {
tmp = c0 * (1.0 / (sqrt(l) / t_0));
} else if (l <= 8.5e+187) {
tmp = c0 * sqrt((A * t_1));
} else {
tmp = t_0 / (sqrt(l) / c0);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((a / v))
t_1 = (1.0d0 / v) / l
if (l <= (-5d-310)) then
tmp = c0 * (sqrt(a) * sqrt(t_1))
else if (l <= 3.2d+68) then
tmp = c0 * (1.0d0 / (sqrt(l) / t_0))
else if (l <= 8.5d+187) then
tmp = c0 * sqrt((a * t_1))
else
tmp = t_0 / (sqrt(l) / c0)
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double t_1 = (1.0 / V) / l;
double tmp;
if (l <= -5e-310) {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(t_1));
} else if (l <= 3.2e+68) {
tmp = c0 * (1.0 / (Math.sqrt(l) / t_0));
} else if (l <= 8.5e+187) {
tmp = c0 * Math.sqrt((A * t_1));
} else {
tmp = t_0 / (Math.sqrt(l) / c0);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) t_1 = (1.0 / V) / l tmp = 0 if l <= -5e-310: tmp = c0 * (math.sqrt(A) * math.sqrt(t_1)) elif l <= 3.2e+68: tmp = c0 * (1.0 / (math.sqrt(l) / t_0)) elif l <= 8.5e+187: tmp = c0 * math.sqrt((A * t_1)) else: tmp = t_0 / (math.sqrt(l) / c0) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) t_1 = Float64(Float64(1.0 / V) / l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 * Float64(sqrt(A) * sqrt(t_1))); elseif (l <= 3.2e+68) tmp = Float64(c0 * Float64(1.0 / Float64(sqrt(l) / t_0))); elseif (l <= 8.5e+187) tmp = Float64(c0 * sqrt(Float64(A * t_1))); else tmp = Float64(t_0 / Float64(sqrt(l) / c0)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
t_1 = (1.0 / V) / l;
tmp = 0.0;
if (l <= -5e-310)
tmp = c0 * (sqrt(A) * sqrt(t_1));
elseif (l <= 3.2e+68)
tmp = c0 * (1.0 / (sqrt(l) / t_0));
elseif (l <= 8.5e+187)
tmp = c0 * sqrt((A * t_1));
else
tmp = t_0 / (sqrt(l) / c0);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[l, -5e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.2e+68], N[(c0 * N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 8.5e+187], N[(c0 * N[Sqrt[N[(A * t$95$1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
t_1 := \frac{\frac{1}{V}}{\ell}\\
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{t_1}\right)\\
\mathbf{elif}\;\ell \leq 3.2 \cdot 10^{+68}:\\
\;\;\;\;c0 \cdot \frac{1}{\frac{\sqrt{\ell}}{t_0}}\\
\mathbf{elif}\;\ell \leq 8.5 \cdot 10^{+187}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{t_0}{\frac{\sqrt{\ell}}{c0}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 75.3%
div-inv74.8%
sqrt-prod39.3%
associate-/r*41.0%
Applied egg-rr41.0%
if -4.999999999999985e-310 < l < 3.19999999999999994e68Initial program 68.0%
associate-/r*70.1%
sqrt-div75.3%
clear-num75.4%
Applied egg-rr75.4%
if 3.19999999999999994e68 < l < 8.49999999999999989e187Initial program 85.1%
clear-num85.1%
associate-/r/85.0%
associate-/r*85.1%
Applied egg-rr85.1%
if 8.49999999999999989e187 < l Initial program 54.9%
associate-/r*73.8%
sqrt-div94.2%
associate-*r/94.0%
Applied egg-rr94.0%
*-commutative94.0%
associate-/l*94.2%
Simplified94.2%
Final simplification58.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* l V))))
(if (<= t_0 5e-267)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+304)
(/ c0 (sqrt (/ (* l V) A)))
(* c0 (pow (* l (/ V A)) -0.5))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 5e-267) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+304) {
tmp = c0 / sqrt(((l * V) / A));
} else {
tmp = c0 * pow((l * (V / A)), -0.5);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (l * v)
if (t_0 <= 5d-267) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+304) then
tmp = c0 / sqrt(((l * v) / a))
else
tmp = c0 * ((l * (v / a)) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 5e-267) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+304) {
tmp = c0 / Math.sqrt(((l * V) / A));
} else {
tmp = c0 * Math.pow((l * (V / A)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if t_0 <= 5e-267: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+304: tmp = c0 / math.sqrt(((l * V) / A)) else: tmp = c0 * math.pow((l * (V / A)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 5e-267) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+304) tmp = Float64(c0 / sqrt(Float64(Float64(l * V) / A))); else tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if (t_0 <= 5e-267)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+304)
tmp = c0 / sqrt(((l * V) / A));
else
tmp = c0 * ((l * (V / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-267], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+304], N[(c0 / N[Sqrt[N[(N[(l * V), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{-267}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+304}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell \cdot V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.9999999999999999e-267Initial program 44.6%
associate-/r*65.1%
Simplified65.1%
if 4.9999999999999999e-267 < (/.f64 A (*.f64 V l)) < 1.9999999999999999e304Initial program 99.3%
*-un-lft-identity99.3%
times-frac92.8%
Applied egg-rr92.8%
associate-*l/92.9%
*-un-lft-identity92.9%
Applied egg-rr92.9%
div-inv92.8%
associate-*l/87.7%
div-inv87.7%
sqrt-undiv35.4%
clear-num35.4%
frac-2neg35.4%
sqrt-div20.0%
associate-/l*20.0%
sqrt-prod53.4%
un-div-inv53.4%
sqrt-undiv99.3%
distribute-rgt-neg-out99.3%
distribute-lft-neg-in99.3%
associate-*l/92.9%
frac-2neg92.9%
associate-*l/99.3%
Applied egg-rr99.3%
if 1.9999999999999999e304 < (/.f64 A (*.f64 V l)) Initial program 43.3%
*-un-lft-identity43.3%
times-frac58.1%
Applied egg-rr58.1%
associate-*l/58.2%
*-un-lft-identity58.2%
Applied egg-rr58.2%
associate-/l/43.3%
associate-/r*58.2%
sqrt-undiv33.5%
clear-num33.5%
frac-2neg33.5%
sqrt-div11.9%
associate-/l*11.9%
sqrt-prod16.8%
sqrt-undiv45.1%
*-commutative45.1%
distribute-lft-neg-out45.1%
frac-2neg45.1%
associate-*r/60.0%
pow1/260.0%
pow-flip60.0%
*-commutative60.0%
associate-*l/45.2%
metadata-eval45.2%
Applied egg-rr45.2%
*-commutative45.2%
associate-*l/58.2%
Simplified58.2%
Final simplification81.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* l V)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (l * V)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (l * v)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (l * V)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (l * V)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(l * V)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (l * V)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}
\end{array}
Initial program 73.0%
Final simplification73.0%
herbie shell --seed 2023314
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))