
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) (- INFINITY))
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* l V) -2e-298)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* l V) 0.0)
(* c0 (/ 1.0 (sqrt (* V (/ l A)))))
(* c0 (/ (sqrt A) (sqrt (* l V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((l * V) <= -2e-298) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((l * V) <= 0.0) {
tmp = c0 * (1.0 / sqrt((V * (l / A))));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((l * V) <= -2e-298) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((l * V) <= 0.0) {
tmp = c0 * (1.0 / Math.sqrt((V * (l / A))));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -math.inf: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (l * V) <= -2e-298: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (l * V) <= 0.0: tmp = c0 * (1.0 / math.sqrt((V * (l / A)))) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * 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) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(l * V) <= -2e-298) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(l * V) <= 0.0) tmp = Float64(c0 * Float64(1.0 / sqrt(Float64(V * Float64(l / A))))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * 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) <= -Inf)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((l * V) <= -2e-298)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((l * V) <= 0.0)
tmp = c0 * (1.0 / sqrt((V * (l / A))));
else
tmp = c0 * (sqrt(A) / sqrt((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_] := If[LessEqual[N[(l * V), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -2e-298], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 0.0], N[(c0 * N[(1.0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * 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 -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;\ell \cdot V \leq -2 \cdot 10^{-298}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 33.0%
associate-/r*61.6%
sqrt-div40.0%
associate-*r/40.0%
Applied egg-rr40.0%
*-commutative40.0%
associate-/l*40.0%
associate-/r/40.0%
Simplified40.0%
if -inf.0 < (*.f64 V l) < -1.99999999999999982e-298Initial program 82.0%
frac-2neg82.0%
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 -1.99999999999999982e-298 < (*.f64 V l) < -0.0Initial program 34.2%
associate-/r*63.3%
clear-num63.4%
sqrt-div63.3%
metadata-eval63.3%
div-inv63.3%
clear-num63.3%
Applied egg-rr63.3%
associate-*r/34.2%
*-commutative34.2%
*-lft-identity34.2%
times-frac63.4%
remove-double-div63.3%
associate-/r*63.3%
*-rgt-identity63.3%
remove-double-div63.4%
Simplified63.4%
if -0.0 < (*.f64 V l) Initial program 73.1%
sqrt-div92.6%
associate-*r/91.8%
Applied egg-rr91.8%
*-commutative91.8%
associate-/l*91.9%
associate-/r/92.6%
Simplified92.6%
Final simplification90.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* l V))))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+290) t_0 (* c0 (/ 1.0 (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+290) {
tmp = t_0;
} else {
tmp = c0 * (1.0 / 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+290) then
tmp = t_0
else
tmp = c0 * (1.0d0 / 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+290) {
tmp = t_0;
} else {
tmp = c0 * (1.0 / 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+290: tmp = t_0 else: tmp = c0 * (1.0 / 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+290) tmp = t_0; else tmp = Float64(c0 * Float64(1.0 / 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+290)
tmp = t_0;
else
tmp = c0 * (1.0 / 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+290], t$95$0, N[(c0 * N[(1.0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $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^{+290}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 67.2%
*-commutative67.2%
associate-/l/68.0%
Simplified68.0%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.00000000000000006e290Initial program 99.5%
if 1.00000000000000006e290 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 31.7%
associate-/r*41.5%
clear-num41.5%
sqrt-div41.5%
metadata-eval41.5%
div-inv41.5%
clear-num41.5%
Applied egg-rr41.5%
Final simplification72.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -5e-310) (/ (/ c0 (sqrt l)) (/ (sqrt (- V)) (sqrt (- A)))) (* c0 (/ (sqrt A) (sqrt (* l V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = (c0 / sqrt(l)) / (sqrt(-V) / sqrt(-A));
} else {
tmp = c0 * (sqrt(A) / sqrt((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) :: tmp
if (a <= (-5d-310)) then
tmp = (c0 / sqrt(l)) / (sqrt(-v) / sqrt(-a))
else
tmp = c0 * (sqrt(a) / sqrt((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 tmp;
if (A <= -5e-310) {
tmp = (c0 / Math.sqrt(l)) / (Math.sqrt(-V) / Math.sqrt(-A));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = (c0 / math.sqrt(l)) / (math.sqrt(-V) / math.sqrt(-A)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(Float64(c0 / sqrt(l)) / Float64(sqrt(Float64(-V)) / sqrt(Float64(-A)))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * 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 (A <= -5e-310)
tmp = (c0 / sqrt(l)) / (sqrt(-V) / sqrt(-A));
else
tmp = c0 * (sqrt(A) / sqrt((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_] := If[LessEqual[A, -5e-310], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[(-V)], $MachinePrecision] / N[Sqrt[(-A)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{c0}{\sqrt{\ell}}}{\frac{\sqrt{-V}}{\sqrt{-A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 72.2%
associate-/r*71.4%
clear-num71.1%
sqrt-div71.3%
metadata-eval71.3%
div-inv71.3%
clear-num71.3%
Applied egg-rr71.3%
un-div-inv71.4%
sqrt-prod41.8%
associate-/r*41.9%
Applied egg-rr41.9%
frac-2neg41.9%
sqrt-div48.9%
Applied egg-rr48.9%
if -4.999999999999985e-310 < A Initial program 69.7%
sqrt-div87.6%
associate-*r/86.9%
Applied egg-rr86.9%
*-commutative86.9%
associate-/l*87.0%
associate-/r/87.6%
Simplified87.6%
Final simplification69.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l 4.2e-272) (/ c0 (sqrt (/ l (/ A V)))) (* (/ c0 (sqrt l)) (sqrt (/ A V)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= 4.2e-272) {
tmp = c0 / sqrt((l / (A / V)));
} else {
tmp = (c0 / sqrt(l)) * sqrt((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 <= 4.2d-272) then
tmp = c0 / sqrt((l / (a / v)))
else
tmp = (c0 / sqrt(l)) * sqrt((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 <= 4.2e-272) {
tmp = c0 / Math.sqrt((l / (A / V)));
} else {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= 4.2e-272: tmp = c0 / math.sqrt((l / (A / V))) else: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= 4.2e-272) tmp = Float64(c0 / sqrt(Float64(l / Float64(A / V)))); else tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(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 <= 4.2e-272)
tmp = c0 / sqrt((l / (A / V)));
else
tmp = (c0 / sqrt(l)) * sqrt((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[l, 4.2e-272], N[(c0 / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 4.2 \cdot 10^{-272}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\end{array}
\end{array}
if l < 4.19999999999999974e-272Initial program 70.7%
associate-/r*72.1%
clear-num71.8%
sqrt-div71.7%
metadata-eval71.7%
div-inv71.7%
clear-num71.7%
Applied egg-rr71.7%
associate-*r/71.8%
sqrt-prod2.9%
times-frac2.9%
metadata-eval2.9%
sqrt-div2.9%
clear-num2.9%
frac-2neg2.9%
sqrt-div1.4%
times-frac1.4%
sqrt-prod36.6%
associate-/l*37.9%
sqrt-undiv70.5%
distribute-rgt-neg-out70.5%
*-commutative70.5%
frac-2neg70.5%
associate-/l*70.5%
Applied egg-rr70.5%
associate-/r/71.8%
Simplified71.8%
*-commutative71.8%
clear-num71.8%
un-div-inv71.8%
Applied egg-rr71.8%
if 4.19999999999999974e-272 < l Initial program 71.1%
associate-/r*67.3%
clear-num67.2%
sqrt-div67.4%
metadata-eval67.4%
div-inv67.1%
clear-num67.1%
Applied egg-rr67.1%
associate-*r/67.2%
sqrt-prod77.5%
times-frac77.1%
metadata-eval77.1%
sqrt-div77.1%
clear-num78.1%
frac-2neg78.1%
sqrt-div48.8%
times-frac48.1%
sqrt-prod43.1%
associate-/l*43.1%
sqrt-undiv71.3%
distribute-rgt-neg-out71.3%
*-commutative71.3%
frac-2neg71.3%
associate-/l*68.1%
Applied egg-rr68.1%
associate-/r/67.2%
Simplified67.2%
*-commutative67.2%
clear-num67.1%
un-div-inv67.5%
Applied egg-rr67.5%
sqrt-div78.5%
associate-/r/78.1%
Applied egg-rr78.1%
Final simplification74.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -5e-310) (* (/ c0 (sqrt l)) (sqrt (/ A V))) (* (sqrt A) (/ c0 (sqrt (* l V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else {
tmp = sqrt(A) * (c0 / sqrt((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) :: tmp
if (a <= (-5d-310)) then
tmp = (c0 / sqrt(l)) * sqrt((a / v))
else
tmp = sqrt(a) * (c0 / sqrt((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 tmp;
if (A <= -5e-310) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) else: tmp = math.sqrt(A) * (c0 / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); else tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(l * 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 (A <= -5e-310)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
else
tmp = sqrt(A) * (c0 / sqrt((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_] := If[LessEqual[A, -5e-310], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 72.2%
associate-/r*71.4%
clear-num71.1%
sqrt-div71.3%
metadata-eval71.3%
div-inv71.3%
clear-num71.3%
Applied egg-rr71.3%
associate-*r/71.4%
sqrt-prod41.8%
times-frac41.8%
metadata-eval41.8%
sqrt-div41.8%
clear-num41.8%
frac-2neg41.8%
sqrt-div48.9%
times-frac48.1%
sqrt-prod84.4%
associate-/l*85.9%
sqrt-undiv72.2%
distribute-rgt-neg-out72.2%
*-commutative72.2%
frac-2neg72.2%
associate-/l*71.5%
Applied egg-rr71.5%
associate-/r/71.4%
Simplified71.4%
*-commutative71.4%
clear-num71.4%
un-div-inv71.4%
Applied egg-rr71.4%
sqrt-div41.9%
associate-/r/41.8%
Applied egg-rr41.8%
if -4.999999999999985e-310 < A Initial program 69.7%
associate-/r*68.5%
clear-num68.5%
sqrt-div68.4%
metadata-eval68.4%
div-inv68.1%
clear-num68.1%
Applied egg-rr68.1%
associate-*r/68.3%
sqrt-prod32.1%
times-frac31.8%
metadata-eval31.8%
sqrt-div31.9%
clear-num32.7%
frac-2neg32.7%
sqrt-div0.0%
times-frac0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
sqrt-prod0.0%
add-sqr-sqrt0.0%
sqrt-unprod26.5%
sqr-neg26.5%
sqrt-unprod40.5%
add-sqr-sqrt86.9%
Applied egg-rr86.9%
associate-/l*87.6%
associate-/r/87.0%
*-commutative87.0%
Simplified87.0%
Final simplification65.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 (<= A -5e-310) (* (/ c0 (sqrt l)) (sqrt (/ A V))) (* c0 (/ (sqrt A) (sqrt (* l V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else {
tmp = c0 * (sqrt(A) / sqrt((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) :: tmp
if (a <= (-5d-310)) then
tmp = (c0 / sqrt(l)) * sqrt((a / v))
else
tmp = c0 * (sqrt(a) / sqrt((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 tmp;
if (A <= -5e-310) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * 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 (A <= -5e-310)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
else
tmp = c0 * (sqrt(A) / sqrt((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_] := If[LessEqual[A, -5e-310], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 72.2%
associate-/r*71.4%
clear-num71.1%
sqrt-div71.3%
metadata-eval71.3%
div-inv71.3%
clear-num71.3%
Applied egg-rr71.3%
associate-*r/71.4%
sqrt-prod41.8%
times-frac41.8%
metadata-eval41.8%
sqrt-div41.8%
clear-num41.8%
frac-2neg41.8%
sqrt-div48.9%
times-frac48.1%
sqrt-prod84.4%
associate-/l*85.9%
sqrt-undiv72.2%
distribute-rgt-neg-out72.2%
*-commutative72.2%
frac-2neg72.2%
associate-/l*71.5%
Applied egg-rr71.5%
associate-/r/71.4%
Simplified71.4%
*-commutative71.4%
clear-num71.4%
un-div-inv71.4%
Applied egg-rr71.4%
sqrt-div41.9%
associate-/r/41.8%
Applied egg-rr41.8%
if -4.999999999999985e-310 < A Initial program 69.7%
sqrt-div87.6%
associate-*r/86.9%
Applied egg-rr86.9%
*-commutative86.9%
associate-/l*87.0%
associate-/r/87.6%
Simplified87.6%
Final simplification66.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 (<= A -5e-310) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (* c0 (/ (sqrt A) (sqrt (* l V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 * (sqrt(A) / sqrt((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) :: tmp
if (a <= (-5d-310)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 * (sqrt(a) / sqrt((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 tmp;
if (A <= -5e-310) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * 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 (A <= -5e-310)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 * (sqrt(A) / sqrt((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_] := If[LessEqual[A, -5e-310], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 72.2%
associate-/r*71.4%
sqrt-div41.9%
associate-*r/41.9%
Applied egg-rr41.9%
*-commutative41.9%
associate-/l*41.8%
associate-/r/41.9%
Simplified41.9%
if -4.999999999999985e-310 < A Initial program 69.7%
sqrt-div87.6%
associate-*r/86.9%
Applied egg-rr86.9%
*-commutative86.9%
associate-/l*87.0%
associate-/r/87.6%
Simplified87.6%
Final simplification66.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 (/ A (* l V))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+301)
(* c0 (sqrt t_0))
(* c0 (/ 1.0 (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 / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 1e+301) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * (1.0 / 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 / (l * v)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 1d+301) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * (1.0d0 / 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 / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+301) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * (1.0 / 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 / (l * V) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 1e+301: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * (1.0 / 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(l * V)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+301) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * Float64(1.0 / 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 / (l * V);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 1e+301)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * (1.0 / 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[(l * V), $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+301], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(1.0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 10^{+301}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 27.0%
*-commutative27.0%
associate-/l/38.3%
Simplified38.3%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.00000000000000005e301Initial program 99.1%
if 1.00000000000000005e301 < (/.f64 A (*.f64 V l)) Initial program 30.7%
associate-/r*45.3%
clear-num45.3%
sqrt-div45.8%
metadata-eval45.8%
div-inv45.8%
clear-num45.9%
Applied egg-rr45.9%
associate-*r/31.3%
*-commutative31.3%
*-lft-identity31.3%
times-frac45.8%
remove-double-div45.8%
associate-/r*45.8%
*-rgt-identity45.8%
remove-double-div45.8%
Simplified45.8%
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 (/ A (* l V))))
(if (or (<= t_0 0.0) (not (<= t_0 4e+286)))
(* c0 (sqrt (/ (/ A V) l)))
(* 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 / (l * V);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+286)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(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 = a / (l * v)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+286))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(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 = A / (l * V);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+286)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} 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 / (l * V) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 4e+286): tmp = c0 * math.sqrt(((A / V) / l)) 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(l * V)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 4e+286)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); 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 / (l * V);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 4e+286)))
tmp = c0 * sqrt(((A / V) / l));
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[(l * V), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+286]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[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 0 \lor \neg \left(t_0 \leq 4 \cdot 10^{+286}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 4.00000000000000013e286 < (/.f64 A (*.f64 V l)) Initial program 31.5%
*-commutative31.5%
associate-/l/43.1%
Simplified43.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.00000000000000013e286Initial program 99.1%
Final simplification75.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 (/ A (* l V))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+288) (* c0 (sqrt 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 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+288) {
tmp = c0 * sqrt(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 = a / (l * v)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+288) then
tmp = c0 * sqrt(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 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+288) {
tmp = c0 * Math.sqrt(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 = A / (l * V) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+288: tmp = c0 * math.sqrt(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(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+288) tmp = Float64(c0 * sqrt(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 = A / (l * V);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+288)
tmp = c0 * sqrt(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[(A / N[(l * V), $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, 2e+288], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], 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 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+288}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 27.0%
*-commutative27.0%
associate-/l/38.3%
Simplified38.3%
if 0.0 < (/.f64 A (*.f64 V l)) < 2e288Initial program 99.1%
if 2e288 < (/.f64 A (*.f64 V l)) Initial program 33.3%
associate-/r*47.3%
clear-num47.4%
sqrt-div47.8%
metadata-eval47.8%
div-inv47.8%
clear-num47.8%
Applied egg-rr47.8%
Taylor expanded in c0 around 0 33.3%
*-commutative33.3%
associate-/l/47.4%
Simplified47.4%
Final simplification76.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* l V))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+301) (* 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 / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 1e+301) {
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 / (l * v)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 1d+301) 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 / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+301) {
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 / (l * V) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 1e+301: 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(l * V)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+301) 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 / (l * V);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 1e+301)
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[(l * V), $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+301], 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}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 10^{+301}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 27.0%
*-commutative27.0%
associate-/l/38.3%
Simplified38.3%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.00000000000000005e301Initial program 99.1%
if 1.00000000000000005e301 < (/.f64 A (*.f64 V l)) Initial program 30.7%
associate-/r*45.3%
clear-num45.3%
sqrt-div45.8%
metadata-eval45.8%
div-inv45.8%
clear-num45.9%
Applied egg-rr45.9%
associate-*r/45.8%
sqrt-prod31.8%
times-frac31.8%
metadata-eval31.8%
sqrt-div31.7%
clear-num31.7%
frac-2neg31.7%
sqrt-div24.8%
times-frac23.1%
sqrt-prod31.6%
associate-/l*31.6%
sqrt-undiv31.3%
distribute-rgt-neg-out31.3%
*-commutative31.3%
frac-2neg31.3%
associate-/l*45.3%
Applied egg-rr45.3%
associate-/l*31.3%
*-commutative31.3%
associate-*l/45.7%
*-commutative45.7%
Simplified45.7%
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 (/ A (* l V))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+301) (* c0 (sqrt 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 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 1e+301) {
tmp = c0 * sqrt(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 = a / (l * v)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 1d+301) then
tmp = c0 * sqrt(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 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+301) {
tmp = c0 * Math.sqrt(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 = A / (l * V) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 1e+301: tmp = c0 * math.sqrt(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(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+301) tmp = Float64(c0 * sqrt(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 = A / (l * V);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 1e+301)
tmp = c0 * sqrt(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[(A / N[(l * V), $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+301], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[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 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 10^{+301}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 27.0%
*-commutative27.0%
associate-/l/38.3%
Simplified38.3%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.00000000000000005e301Initial program 99.1%
if 1.00000000000000005e301 < (/.f64 A (*.f64 V l)) Initial program 30.7%
associate-/r*45.3%
clear-num45.3%
sqrt-div45.8%
metadata-eval45.8%
div-inv45.8%
clear-num45.9%
Applied egg-rr45.9%
associate-*r/45.8%
sqrt-prod31.8%
times-frac31.8%
metadata-eval31.8%
sqrt-div31.7%
clear-num31.7%
frac-2neg31.7%
sqrt-div24.8%
times-frac23.1%
sqrt-prod31.6%
associate-/l*31.6%
sqrt-undiv31.3%
distribute-rgt-neg-out31.3%
*-commutative31.3%
frac-2neg31.3%
associate-/l*45.3%
Applied egg-rr45.3%
associate-/r/45.8%
Simplified45.8%
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 (/ A (* l V))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 4e+286) (* c0 (sqrt t_0)) (/ c0 (sqrt (/ l (/ A V))))))))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 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 4e+286) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((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 = a / (l * v)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 4d+286) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((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 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 4e+286) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((l / (A / V)));
}
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 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 4e+286: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((l / (A / V))) 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 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 4e+286) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(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 = A / (l * V);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 4e+286)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((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[(A / N[(l * V), $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, 4e+286], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l / 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{A}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 4 \cdot 10^{+286}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 27.0%
*-commutative27.0%
associate-/l/38.3%
Simplified38.3%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.00000000000000013e286Initial program 99.1%
if 4.00000000000000013e286 < (/.f64 A (*.f64 V l)) Initial program 35.7%
associate-/r*47.5%
clear-num47.5%
sqrt-div47.9%
metadata-eval47.9%
div-inv47.9%
clear-num47.9%
Applied egg-rr47.9%
associate-*r/47.9%
sqrt-prod31.3%
times-frac31.3%
metadata-eval31.3%
sqrt-div31.2%
clear-num31.2%
frac-2neg31.2%
sqrt-div23.0%
times-frac21.5%
sqrt-prod31.1%
associate-/l*31.1%
sqrt-undiv36.1%
distribute-rgt-neg-out36.1%
*-commutative36.1%
frac-2neg36.1%
associate-/l*47.4%
Applied egg-rr47.4%
associate-/r/47.9%
Simplified47.9%
*-commutative47.9%
clear-num47.9%
un-div-inv47.9%
Applied egg-rr47.9%
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 (* 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 70.9%
Final simplification70.9%
herbie shell --seed 2024021
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))