
(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 11 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 -1e-310) (/ (* (/ (sqrt (- A)) (sqrt (- V))) c0) (sqrt l)) (* c0 (* (/ (sqrt A) (sqrt (* V (cbrt l)))) (sqrt (pow (cbrt l) -2.0))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-310) {
tmp = ((sqrt(-A) / sqrt(-V)) * c0) / sqrt(l);
} else {
tmp = c0 * ((sqrt(A) / sqrt((V * cbrt(l)))) * sqrt(pow(cbrt(l), -2.0)));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-310) {
tmp = ((Math.sqrt(-A) / Math.sqrt(-V)) * c0) / Math.sqrt(l);
} else {
tmp = c0 * ((Math.sqrt(A) / Math.sqrt((V * Math.cbrt(l)))) * Math.sqrt(Math.pow(Math.cbrt(l), -2.0)));
}
return tmp;
}
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -1e-310) tmp = Float64(Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * c0) / sqrt(l)); else tmp = Float64(c0 * Float64(Float64(sqrt(A) / sqrt(Float64(V * cbrt(l)))) * sqrt((cbrt(l) ^ -2.0)))); end return 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, -1e-310], N[(N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * c0), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[Power[N[Power[l, 1/3], $MachinePrecision], -2.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{\sqrt{-A}}{\sqrt{-V}} \cdot c0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\frac{\sqrt{A}}{\sqrt{V \cdot \sqrt[3]{\ell}}} \cdot \sqrt{{\left(\sqrt[3]{\ell}\right)}^{-2}}\right)\\
\end{array}
\end{array}
if A < -9.999999999999969e-311Initial program 78.3%
*-commutative78.3%
associate-/r*77.5%
sqrt-div44.4%
associate-*l/44.5%
Applied egg-rr44.5%
frac-2neg44.5%
sqrt-div54.5%
Applied egg-rr54.5%
if -9.999999999999969e-311 < A Initial program 71.2%
associate-/r*69.1%
div-inv69.1%
add-cube-cbrt68.7%
times-frac73.8%
pow273.8%
Applied egg-rr73.8%
associate-*l/72.2%
associate-/l/71.5%
associate-*r/71.6%
*-rgt-identity71.6%
*-commutative71.6%
Simplified71.6%
div-inv71.6%
sqrt-prod76.8%
associate-/r*74.5%
pow-flip74.5%
metadata-eval74.5%
Applied egg-rr74.5%
associate-/l/76.9%
sqrt-div93.2%
Applied egg-rr93.2%
Final simplification75.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 0.0) (not (<= t_0 5e+303)))
(* c0 (sqrt (/ (/ A V) l)))
t_0)))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+303)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+303))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+303)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+303): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 5e+303)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 5e+303)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+303]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+303}\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 4.9999999999999997e303 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 65.8%
associate-/r*68.3%
Simplified68.3%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999997e303Initial program 99.1%
Final simplification76.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 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+242) t_0 (* c0 (sqrt (/ (/ A l) V)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 1e+242) {
tmp = t_0;
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 1d+242) then
tmp = t_0
else
tmp = c0 * sqrt(((a / l) / v))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+242) {
tmp = t_0;
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 1e+242: tmp = t_0 else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+242) tmp = t_0; else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 1e+242)
tmp = t_0;
else
tmp = c0 * sqrt(((A / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+242], t$95$0, N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $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 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 10^{+242}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 69.3%
associate-/r*71.5%
Simplified71.5%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.00000000000000005e242Initial program 99.1%
if 1.00000000000000005e242 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 46.4%
*-un-lft-identity46.4%
times-frac50.2%
Applied egg-rr50.2%
associate-*l/50.2%
*-un-lft-identity50.2%
Applied egg-rr50.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= V -4e-310) (* c0 (/ (sqrt (/ A (- l))) (sqrt (- V)))) (* c0 (/ (sqrt A) (* (sqrt l) (sqrt V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -4e-310) {
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
} else {
tmp = c0 * (sqrt(A) / (sqrt(l) * sqrt(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 (v <= (-4d-310)) then
tmp = c0 * (sqrt((a / -l)) / sqrt(-v))
else
tmp = c0 * (sqrt(a) / (sqrt(l) * sqrt(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 (V <= -4e-310) {
tmp = c0 * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else {
tmp = c0 * (Math.sqrt(A) / (Math.sqrt(l) * Math.sqrt(V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if V <= -4e-310: tmp = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) else: tmp = c0 * (math.sqrt(A) / (math.sqrt(l) * math.sqrt(V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= -4e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); else tmp = Float64(c0 * Float64(sqrt(A) / Float64(sqrt(l) * sqrt(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 (V <= -4e-310)
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
else
tmp = c0 * (sqrt(A) / (sqrt(l) * sqrt(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[V, -4e-310], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[V], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -4 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell} \cdot \sqrt{V}}\\
\end{array}
\end{array}
if V < -3.999999999999988e-310Initial program 76.0%
*-un-lft-identity76.0%
times-frac76.9%
Applied egg-rr76.9%
associate-*l/76.9%
*-un-lft-identity76.9%
Applied egg-rr76.9%
frac-2neg76.9%
sqrt-div91.7%
Applied egg-rr91.7%
distribute-frac-neg291.7%
Simplified91.7%
if -3.999999999999988e-310 < V Initial program 72.6%
associate-/r*73.6%
div-inv73.5%
add-cube-cbrt73.1%
times-frac75.0%
pow275.0%
Applied egg-rr75.0%
associate-*l/76.2%
associate-/l/75.6%
associate-*r/75.6%
*-rgt-identity75.6%
*-commutative75.6%
Simplified75.6%
associate-/r*73.1%
associate-/l/73.1%
unpow273.1%
add-cube-cbrt73.6%
un-div-inv73.6%
sqrt-unprod45.8%
*-commutative45.8%
sqrt-div57.3%
sqrt-div57.3%
metadata-eval57.3%
frac-times57.4%
*-un-lft-identity57.4%
Applied egg-rr57.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (* A (* (/ c0 l) (/ c0 V))))))
(if (<= (* V l) -5e+292)
t_0
(if (<= (* V l) -5e-300)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (or (<= (* V l) 0.0) (not (<= (* V l) 2e+256)))
t_0
(* c0 (/ (sqrt A) (sqrt (* V l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A * ((c0 / l) * (c0 / V))));
double tmp;
if ((V * l) <= -5e+292) {
tmp = t_0;
} else if ((V * l) <= -5e-300) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 2e+256)) {
tmp = t_0;
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a * ((c0 / l) * (c0 / v))))
if ((v * l) <= (-5d+292)) then
tmp = t_0
else if ((v * l) <= (-5d-300)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if (((v * l) <= 0.0d0) .or. (.not. ((v * l) <= 2d+256))) then
tmp = t_0
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A * ((c0 / l) * (c0 / V))));
double tmp;
if ((V * l) <= -5e+292) {
tmp = t_0;
} else if ((V * l) <= -5e-300) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 2e+256)) {
tmp = t_0;
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A * ((c0 / l) * (c0 / V)))) tmp = 0 if (V * l) <= -5e+292: tmp = t_0 elif (V * l) <= -5e-300: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif ((V * l) <= 0.0) or not ((V * l) <= 2e+256): tmp = t_0 else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A * Float64(Float64(c0 / l) * Float64(c0 / V)))) tmp = 0.0 if (Float64(V * l) <= -5e+292) tmp = t_0; elseif (Float64(V * l) <= -5e-300) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 2e+256)) tmp = t_0; 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)
t_0 = sqrt((A * ((c0 / l) * (c0 / V))));
tmp = 0.0;
if ((V * l) <= -5e+292)
tmp = t_0;
elseif ((V * l) <= -5e-300)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif (((V * l) <= 0.0) || ~(((V * l) <= 2e+256)))
tmp = t_0;
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A * N[(N[(c0 / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+292], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-300], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 2e+256]], $MachinePrecision]], t$95$0, 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}
t_0 := \sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+292}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-300}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 2 \cdot 10^{+256}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999996e292 or -4.99999999999999996e-300 < (*.f64 V l) < 0.0 or 2.0000000000000001e256 < (*.f64 V l) Initial program 39.7%
associate-/r*59.2%
div-inv59.2%
add-cube-cbrt59.1%
times-frac54.5%
pow254.5%
Applied egg-rr54.5%
associate-*l/54.5%
associate-/l/53.1%
associate-*r/53.1%
*-rgt-identity53.1%
*-commutative53.1%
Simplified53.1%
Applied egg-rr21.9%
associate-*l/20.9%
associate-/l*22.0%
Simplified22.0%
unpow222.0%
*-commutative22.0%
times-frac39.2%
Applied egg-rr39.2%
if -4.9999999999999996e292 < (*.f64 V l) < -4.99999999999999996e-300Initial program 92.8%
frac-2neg92.8%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if 0.0 < (*.f64 V l) < 2.0000000000000001e256Initial program 81.2%
sqrt-div99.0%
div-inv98.9%
Applied egg-rr98.9%
associate-*r/99.0%
*-rgt-identity99.0%
Simplified99.0%
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
(let* ((t_0 (sqrt (* A (* (/ c0 l) (/ c0 V))))))
(if (<= (* V l) -5e+292)
t_0
(if (<= (* V l) -5e-300)
(/ c0 (sqrt (/ (* V l) A)))
(if (or (<= (* V l) 0.0) (not (<= (* V l) 2e+256)))
t_0
(* c0 (/ (sqrt A) (sqrt (* V l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A * ((c0 / l) * (c0 / V))));
double tmp;
if ((V * l) <= -5e+292) {
tmp = t_0;
} else if ((V * l) <= -5e-300) {
tmp = c0 / sqrt(((V * l) / A));
} else if (((V * l) <= 0.0) || !((V * l) <= 2e+256)) {
tmp = t_0;
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a * ((c0 / l) * (c0 / v))))
if ((v * l) <= (-5d+292)) then
tmp = t_0
else if ((v * l) <= (-5d-300)) then
tmp = c0 / sqrt(((v * l) / a))
else if (((v * l) <= 0.0d0) .or. (.not. ((v * l) <= 2d+256))) then
tmp = t_0
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A * ((c0 / l) * (c0 / V))));
double tmp;
if ((V * l) <= -5e+292) {
tmp = t_0;
} else if ((V * l) <= -5e-300) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if (((V * l) <= 0.0) || !((V * l) <= 2e+256)) {
tmp = t_0;
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A * ((c0 / l) * (c0 / V)))) tmp = 0 if (V * l) <= -5e+292: tmp = t_0 elif (V * l) <= -5e-300: tmp = c0 / math.sqrt(((V * l) / A)) elif ((V * l) <= 0.0) or not ((V * l) <= 2e+256): tmp = t_0 else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A * Float64(Float64(c0 / l) * Float64(c0 / V)))) tmp = 0.0 if (Float64(V * l) <= -5e+292) tmp = t_0; elseif (Float64(V * l) <= -5e-300) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 2e+256)) tmp = t_0; 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)
t_0 = sqrt((A * ((c0 / l) * (c0 / V))));
tmp = 0.0;
if ((V * l) <= -5e+292)
tmp = t_0;
elseif ((V * l) <= -5e-300)
tmp = c0 / sqrt(((V * l) / A));
elseif (((V * l) <= 0.0) || ~(((V * l) <= 2e+256)))
tmp = t_0;
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A * N[(N[(c0 / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+292], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-300], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 2e+256]], $MachinePrecision]], t$95$0, 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}
t_0 := \sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+292}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-300}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 2 \cdot 10^{+256}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999996e292 or -4.99999999999999996e-300 < (*.f64 V l) < 0.0 or 2.0000000000000001e256 < (*.f64 V l) Initial program 39.7%
associate-/r*59.2%
div-inv59.2%
add-cube-cbrt59.1%
times-frac54.5%
pow254.5%
Applied egg-rr54.5%
associate-*l/54.5%
associate-/l/53.1%
associate-*r/53.1%
*-rgt-identity53.1%
*-commutative53.1%
Simplified53.1%
Applied egg-rr21.9%
associate-*l/20.9%
associate-/l*22.0%
Simplified22.0%
unpow222.0%
*-commutative22.0%
times-frac39.2%
Applied egg-rr39.2%
if -4.9999999999999996e292 < (*.f64 V l) < -4.99999999999999996e-300Initial program 92.8%
*-un-lft-identity92.8%
times-frac85.3%
Applied egg-rr85.3%
associate-*l/85.3%
*-un-lft-identity85.3%
Applied egg-rr85.3%
div-inv85.3%
clear-num85.0%
frac-times85.0%
*-commutative85.0%
add-sqr-sqrt84.8%
frac-times84.8%
sqrt-unprod85.4%
add-sqr-sqrt85.8%
un-div-inv85.9%
Applied egg-rr85.9%
associate-*r/93.7%
*-commutative93.7%
associate-/l*86.6%
Simplified86.6%
Taylor expanded in l around 0 93.7%
if 0.0 < (*.f64 V l) < 2.0000000000000001e256Initial program 81.2%
sqrt-div99.0%
div-inv98.9%
Applied egg-rr98.9%
associate-*r/99.0%
*-rgt-identity99.0%
Simplified99.0%
Final simplification81.8%
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 -4e-310)
(* c0 (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= V 1.05e-167)
(/ (/ c0 (sqrt V)) (sqrt (/ l A)))
(* c0 (/ (sqrt (/ A V)) (sqrt l))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -4e-310) {
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
} else if (V <= 1.05e-167) {
tmp = (c0 / sqrt(V)) / sqrt((l / A));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (v <= (-4d-310)) then
tmp = c0 * (sqrt((a / -l)) / sqrt(-v))
else if (v <= 1.05d-167) then
tmp = (c0 / sqrt(v)) / sqrt((l / a))
else
tmp = c0 * (sqrt((a / v)) / sqrt(l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -4e-310) {
tmp = c0 * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if (V <= 1.05e-167) {
tmp = (c0 / Math.sqrt(V)) / Math.sqrt((l / A));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if V <= -4e-310: tmp = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) elif V <= 1.05e-167: tmp = (c0 / math.sqrt(V)) / math.sqrt((l / A)) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= -4e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (V <= 1.05e-167) tmp = Float64(Float64(c0 / sqrt(V)) / sqrt(Float64(l / A))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (V <= -4e-310)
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
elseif (V <= 1.05e-167)
tmp = (c0 / sqrt(V)) / sqrt((l / A));
else
tmp = c0 * (sqrt((A / V)) / sqrt(l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[V, -4e-310], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[V, 1.05e-167], N[(N[(c0 / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(l / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -4 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \leq 1.05 \cdot 10^{-167}:\\
\;\;\;\;\frac{\frac{c0}{\sqrt{V}}}{\sqrt{\frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if V < -3.999999999999988e-310Initial program 76.0%
*-un-lft-identity76.0%
times-frac76.9%
Applied egg-rr76.9%
associate-*l/76.9%
*-un-lft-identity76.9%
Applied egg-rr76.9%
frac-2neg76.9%
sqrt-div91.7%
Applied egg-rr91.7%
distribute-frac-neg291.7%
Simplified91.7%
if -3.999999999999988e-310 < V < 1.05000000000000009e-167Initial program 69.2%
*-un-lft-identity69.2%
times-frac75.3%
Applied egg-rr75.3%
associate-*l/75.3%
*-un-lft-identity75.3%
Applied egg-rr75.3%
div-inv75.3%
clear-num75.3%
frac-times75.2%
*-commutative75.2%
add-sqr-sqrt75.1%
frac-times75.1%
sqrt-unprod74.9%
add-sqr-sqrt75.1%
associate-*r/75.2%
sqrt-prod95.4%
times-frac92.1%
metadata-eval92.1%
sqrt-div92.1%
clear-num92.1%
sqrt-div70.6%
times-frac67.3%
*-commutative67.3%
sqrt-prod45.5%
clear-num45.6%
Applied egg-rr92.0%
associate-/r*92.1%
associate-/r/91.9%
associate-*l/92.2%
*-lft-identity92.2%
Simplified92.2%
if 1.05000000000000009e-167 < V Initial program 73.6%
associate-/r*75.9%
sqrt-div43.3%
div-inv43.3%
Applied egg-rr43.3%
associate-*r/43.3%
*-rgt-identity43.3%
Simplified43.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 (* V l))))
(if (or (<= t_0 5e-315) (not (<= t_0 INFINITY)))
(sqrt (* A (* (/ c0 l) (/ c0 V))))
(* c0 (sqrt t_0)))))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 <= 5e-315) || !(t_0 <= ((double) INFINITY))) {
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
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 <= 5e-315) || !(t_0 <= Double.POSITIVE_INFINITY)) {
tmp = Math.sqrt((A * ((c0 / l) * (c0 / V))));
} else {
tmp = c0 * Math.sqrt(t_0);
}
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 <= 5e-315) or not (t_0 <= math.inf): tmp = math.sqrt((A * ((c0 / l) * (c0 / V)))) else: tmp = c0 * math.sqrt(t_0) 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 <= 5e-315) || !(t_0 <= Inf)) tmp = sqrt(Float64(A * Float64(Float64(c0 / l) * Float64(c0 / V)))); else tmp = Float64(c0 * sqrt(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 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 5e-315) || ~((t_0 <= Inf)))
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
else
tmp = c0 * sqrt(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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 5e-315], N[Not[LessEqual[t$95$0, Infinity]], $MachinePrecision]], N[Sqrt[N[(A * N[(N[(c0 / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $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 5 \cdot 10^{-315} \lor \neg \left(t\_0 \leq \infty\right):\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 5.0000000023e-315 or +inf.0 < (/.f64 A (*.f64 V l)) Initial program 38.2%
associate-/r*51.4%
div-inv51.5%
add-cube-cbrt51.4%
times-frac47.4%
pow247.4%
Applied egg-rr47.4%
associate-*l/47.4%
associate-/l/45.6%
associate-*r/45.6%
*-rgt-identity45.6%
*-commutative45.6%
Simplified45.6%
Applied egg-rr35.8%
associate-*l/39.6%
associate-/l*39.7%
Simplified39.7%
unpow239.7%
*-commutative39.7%
times-frac55.0%
Applied egg-rr55.0%
if 5.0000000023e-315 < (/.f64 A (*.f64 V l)) < +inf.0Initial program 83.6%
Final simplification77.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 (/ A (* V l))))
(if (<= t_0 5e-315)
(sqrt (* A (* c0 (/ c0 (* V l)))))
(if (<= t_0 5e+285) (* c0 (sqrt 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 = A / (V * l);
double tmp;
if (t_0 <= 5e-315) {
tmp = sqrt((A * (c0 * (c0 / (V * l)))));
} else if (t_0 <= 5e+285) {
tmp = c0 * sqrt(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 = a / (v * l)
if (t_0 <= 5d-315) then
tmp = sqrt((a * (c0 * (c0 / (v * l)))))
else if (t_0 <= 5d+285) then
tmp = c0 * sqrt(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 = A / (V * l);
double tmp;
if (t_0 <= 5e-315) {
tmp = Math.sqrt((A * (c0 * (c0 / (V * l)))));
} else if (t_0 <= 5e+285) {
tmp = c0 * Math.sqrt(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 = A / (V * l) tmp = 0 if t_0 <= 5e-315: tmp = math.sqrt((A * (c0 * (c0 / (V * l))))) elif t_0 <= 5e+285: tmp = c0 * math.sqrt(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(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 5e-315) tmp = sqrt(Float64(A * Float64(c0 * Float64(c0 / Float64(V * l))))); elseif (t_0 <= 5e+285) tmp = Float64(c0 * sqrt(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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 5e-315)
tmp = sqrt((A * (c0 * (c0 / (V * l)))));
elseif (t_0 <= 5e+285)
tmp = c0 * sqrt(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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-315], N[Sqrt[N[(A * N[(c0 * N[(c0 / N[(V * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 5e+285], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[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 5 \cdot 10^{-315}:\\
\;\;\;\;\sqrt{A \cdot \left(c0 \cdot \frac{c0}{V \cdot \ell}\right)}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+285}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 5.0000000023e-315Initial program 38.2%
associate-/r*51.4%
div-inv51.5%
add-cube-cbrt51.4%
times-frac47.4%
pow247.4%
Applied egg-rr47.4%
associate-*l/47.4%
associate-/l/45.6%
associate-*r/45.6%
*-rgt-identity45.6%
*-commutative45.6%
Simplified45.6%
Applied egg-rr35.8%
associate-*l/39.6%
associate-/l*39.7%
Simplified39.7%
unpow239.7%
associate-/l*47.9%
Applied egg-rr47.9%
if 5.0000000023e-315 < (/.f64 A (*.f64 V l)) < 5.00000000000000016e285Initial program 99.4%
if 5.00000000000000016e285 < (/.f64 A (*.f64 V l)) Initial program 37.6%
*-un-lft-identity37.6%
times-frac48.6%
Applied egg-rr48.6%
associate-*l/48.6%
*-un-lft-identity48.6%
Applied egg-rr48.6%
div-inv48.6%
clear-num48.5%
frac-times48.5%
*-commutative48.5%
add-sqr-sqrt48.5%
frac-times48.6%
sqrt-unprod50.7%
add-sqr-sqrt50.7%
un-div-inv50.8%
Applied egg-rr50.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 (/ A (* V l))))
(if (<= t_0 1e-272)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+285) (* c0 (sqrt 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 = A / (V * l);
double tmp;
if (t_0 <= 1e-272) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 5e+285) {
tmp = c0 * sqrt(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 = a / (v * l)
if (t_0 <= 1d-272) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 5d+285) then
tmp = c0 * sqrt(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 = A / (V * l);
double tmp;
if (t_0 <= 1e-272) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+285) {
tmp = c0 * Math.sqrt(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 = A / (V * l) tmp = 0 if t_0 <= 1e-272: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 5e+285: tmp = c0 * math.sqrt(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(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 1e-272) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+285) tmp = Float64(c0 * sqrt(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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-272)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 5e+285)
tmp = c0 * sqrt(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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-272], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+285], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[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^{-272}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+285}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.9999999999999993e-273Initial program 42.5%
*-un-lft-identity42.5%
times-frac53.7%
Applied egg-rr53.7%
associate-*l/53.7%
*-un-lft-identity53.7%
Applied egg-rr53.7%
if 9.9999999999999993e-273 < (/.f64 A (*.f64 V l)) < 5.00000000000000016e285Initial program 99.4%
if 5.00000000000000016e285 < (/.f64 A (*.f64 V l)) Initial program 37.6%
*-un-lft-identity37.6%
times-frac48.6%
Applied egg-rr48.6%
associate-*l/48.6%
*-un-lft-identity48.6%
Applied egg-rr48.6%
div-inv48.6%
clear-num48.5%
frac-times48.5%
*-commutative48.5%
add-sqr-sqrt48.5%
frac-times48.6%
sqrt-unprod50.7%
add-sqr-sqrt50.7%
un-div-inv50.8%
Applied egg-rr50.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 74.4%
herbie shell --seed 2024107
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))