
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -1e-307)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-320)
(* c0 (pow (* V (/ l A)) -0.5))
(/ (* c0 (sqrt A)) (sqrt (* V l)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -1e-307) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-320) {
tmp = c0 * pow((V * (l / A)), -0.5);
} else {
tmp = (c0 * sqrt(A)) / sqrt((V * l));
}
return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -1e-307) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-320) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} else {
tmp = (c0 * Math.sqrt(A)) / Math.sqrt((V * l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -1e-307: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-320: tmp = c0 * math.pow((V * (l / A)), -0.5) else: tmp = (c0 * math.sqrt(A)) / math.sqrt((V * l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -1e-307) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-320) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); else tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(V * l))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -1e-307)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-320)
tmp = c0 * ((V * (l / A)) ^ -0.5);
else
tmp = (c0 * sqrt(A)) / sqrt((V * l));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-307], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-320], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-307}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-320}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 24.1%
associate-/r*42.6%
sqrt-div30.5%
Applied egg-rr30.5%
if -inf.0 < (*.f64 V l) < -9.99999999999999909e-308Initial program 86.4%
frac-2neg86.4%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -9.99999999999999909e-308 < (*.f64 V l) < 4.99994e-320Initial program 41.3%
pow1/241.3%
clear-num41.3%
inv-pow41.3%
pow-pow41.3%
associate-/l*70.4%
metadata-eval70.4%
Applied egg-rr70.4%
associate-/l*41.3%
*-lft-identity41.3%
times-frac70.4%
/-rgt-identity70.4%
Simplified70.4%
if 4.99994e-320 < (*.f64 V l) Initial program 71.7%
*-commutative71.7%
sqrt-div91.7%
associate-*l/90.7%
Applied egg-rr90.7%
Final simplification89.6%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (or (<= t_0 -5e-322) (and (not (<= t_0 0.0)) (<= t_0 1e+304)))
t_0
(sqrt (* A (* (/ c0 l) (/ c0 V)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= -5e-322) || (!(t_0 <= 0.0) && (t_0 <= 1e+304))) {
tmp = t_0;
} else {
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if ((t_0 <= (-5d-322)) .or. (.not. (t_0 <= 0.0d0)) .and. (t_0 <= 1d+304)) then
tmp = t_0
else
tmp = sqrt((a * ((c0 / l) * (c0 / v))))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= -5e-322) || (!(t_0 <= 0.0) && (t_0 <= 1e+304))) {
tmp = t_0;
} else {
tmp = Math.sqrt((A * ((c0 / l) * (c0 / V))));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= -5e-322) or (not (t_0 <= 0.0) and (t_0 <= 1e+304)): tmp = t_0 else: tmp = math.sqrt((A * ((c0 / l) * (c0 / V)))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= -5e-322) || (!(t_0 <= 0.0) && (t_0 <= 1e+304))) tmp = t_0; else tmp = sqrt(Float64(A * Float64(Float64(c0 / l) * Float64(c0 / V)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= -5e-322) || (~((t_0 <= 0.0)) && (t_0 <= 1e+304)))
tmp = t_0;
else
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -5e-322], And[N[Not[LessEqual[t$95$0, 0.0]], $MachinePrecision], LessEqual[t$95$0, 1e+304]]], t$95$0, N[Sqrt[N[(A * N[(N[(c0 / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq -5 \cdot 10^{-322} \lor \neg \left(t_0 \leq 0\right) \land t_0 \leq 10^{+304}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < -4.99006e-322 or 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999994e303Initial program 90.6%
if -4.99006e-322 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 9.9999999999999994e303 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 40.5%
add-sqr-sqrt40.5%
pow240.5%
pow1/240.5%
sqrt-pow140.5%
metadata-eval40.5%
Applied egg-rr40.5%
add-sqr-sqrt40.5%
sqrt-unprod40.5%
*-commutative40.5%
*-commutative40.5%
swap-sqr40.0%
pow-pow40.0%
metadata-eval40.0%
metadata-eval40.0%
pow-pow40.0%
metadata-eval40.0%
metadata-eval40.0%
sqr-pow40.0%
pow140.0%
Applied egg-rr40.0%
associate-*l/52.5%
associate-*r/52.5%
times-frac65.1%
Simplified65.1%
Final simplification81.3%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 -5e-322)
t_0
(if (<= t_0 0.0)
(sqrt (* (/ c0 V) (/ (* c0 A) l)))
(if (<= t_0 1e+304) t_0 (sqrt (* A (* (/ c0 l) (/ c0 V)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= -5e-322) {
tmp = t_0;
} else if (t_0 <= 0.0) {
tmp = sqrt(((c0 / V) * ((c0 * A) / l)));
} else if (t_0 <= 1e+304) {
tmp = t_0;
} else {
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= (-5d-322)) then
tmp = t_0
else if (t_0 <= 0.0d0) then
tmp = sqrt(((c0 / v) * ((c0 * a) / l)))
else if (t_0 <= 1d+304) then
tmp = t_0
else
tmp = sqrt((a * ((c0 / l) * (c0 / v))))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= -5e-322) {
tmp = t_0;
} else if (t_0 <= 0.0) {
tmp = Math.sqrt(((c0 / V) * ((c0 * A) / l)));
} else if (t_0 <= 1e+304) {
tmp = t_0;
} else {
tmp = Math.sqrt((A * ((c0 / l) * (c0 / V))));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= -5e-322: tmp = t_0 elif t_0 <= 0.0: tmp = math.sqrt(((c0 / V) * ((c0 * A) / l))) elif t_0 <= 1e+304: tmp = t_0 else: tmp = math.sqrt((A * ((c0 / l) * (c0 / V)))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= -5e-322) tmp = t_0; elseif (t_0 <= 0.0) tmp = sqrt(Float64(Float64(c0 / V) * Float64(Float64(c0 * A) / l))); elseif (t_0 <= 1e+304) tmp = t_0; else tmp = sqrt(Float64(A * Float64(Float64(c0 / l) * Float64(c0 / V)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= -5e-322)
tmp = t_0;
elseif (t_0 <= 0.0)
tmp = sqrt(((c0 / V) * ((c0 * A) / l)));
elseif (t_0 <= 1e+304)
tmp = t_0;
else
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-322], t$95$0, If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(N[(c0 / V), $MachinePrecision] * N[(N[(c0 * A), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 1e+304], t$95$0, N[Sqrt[N[(A * N[(N[(c0 / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq -5 \cdot 10^{-322}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;t_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{c0}{V} \cdot \frac{c0 \cdot A}{\ell}}\\
\mathbf{elif}\;t_0 \leq 10^{+304}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < -4.99006e-322 or 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999994e303Initial program 90.6%
if -4.99006e-322 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 39.6%
sqrt-div45.6%
associate-*r/45.7%
Applied egg-rr45.7%
associate-*l/45.7%
Simplified45.7%
add-sqr-sqrt34.0%
sqrt-unprod34.5%
*-commutative34.5%
*-commutative34.5%
swap-sqr32.9%
add-sqr-sqrt32.9%
frac-times32.7%
add-sqr-sqrt50.3%
Applied egg-rr50.3%
frac-times58.5%
*-commutative58.5%
Applied egg-rr58.5%
Taylor expanded in A around 0 50.3%
associate-*r/50.3%
unpow250.3%
*-commutative50.3%
times-frac58.5%
*-commutative58.5%
*-commutative58.5%
associate-*l*61.7%
*-commutative61.7%
associate-*r/61.7%
Simplified61.7%
if 9.9999999999999994e303 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 42.2%
add-sqr-sqrt42.2%
pow242.2%
pow1/242.2%
sqrt-pow142.2%
metadata-eval42.2%
Applied egg-rr42.2%
add-sqr-sqrt42.2%
sqrt-unprod42.2%
*-commutative42.2%
*-commutative42.2%
swap-sqr41.6%
pow-pow41.6%
metadata-eval41.6%
metadata-eval41.6%
pow-pow41.6%
metadata-eval41.6%
metadata-eval41.6%
sqr-pow41.6%
pow141.6%
Applied egg-rr41.6%
associate-*l/56.4%
associate-*r/56.4%
times-frac77.1%
Simplified77.1%
Final simplification82.1%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 -5e-322)
t_0
(if (<= t_0 0.0)
(sqrt (/ (* A (* c0 (/ c0 l))) V))
(if (<= t_0 1e+304) t_0 (sqrt (* A (* (/ c0 l) (/ c0 V)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= -5e-322) {
tmp = t_0;
} else if (t_0 <= 0.0) {
tmp = sqrt(((A * (c0 * (c0 / l))) / V));
} else if (t_0 <= 1e+304) {
tmp = t_0;
} else {
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= (-5d-322)) then
tmp = t_0
else if (t_0 <= 0.0d0) then
tmp = sqrt(((a * (c0 * (c0 / l))) / v))
else if (t_0 <= 1d+304) then
tmp = t_0
else
tmp = sqrt((a * ((c0 / l) * (c0 / v))))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= -5e-322) {
tmp = t_0;
} else if (t_0 <= 0.0) {
tmp = Math.sqrt(((A * (c0 * (c0 / l))) / V));
} else if (t_0 <= 1e+304) {
tmp = t_0;
} else {
tmp = Math.sqrt((A * ((c0 / l) * (c0 / V))));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= -5e-322: tmp = t_0 elif t_0 <= 0.0: tmp = math.sqrt(((A * (c0 * (c0 / l))) / V)) elif t_0 <= 1e+304: tmp = t_0 else: tmp = math.sqrt((A * ((c0 / l) * (c0 / V)))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= -5e-322) tmp = t_0; elseif (t_0 <= 0.0) tmp = sqrt(Float64(Float64(A * Float64(c0 * Float64(c0 / l))) / V)); elseif (t_0 <= 1e+304) tmp = t_0; else tmp = sqrt(Float64(A * Float64(Float64(c0 / l) * Float64(c0 / V)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= -5e-322)
tmp = t_0;
elseif (t_0 <= 0.0)
tmp = sqrt(((A * (c0 * (c0 / l))) / V));
elseif (t_0 <= 1e+304)
tmp = t_0;
else
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-322], t$95$0, If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(N[(A * N[(c0 * N[(c0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 1e+304], t$95$0, N[Sqrt[N[(A * N[(N[(c0 / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq -5 \cdot 10^{-322}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;t_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0 \cdot \frac{c0}{\ell}\right)}{V}}\\
\mathbf{elif}\;t_0 \leq 10^{+304}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < -4.99006e-322 or 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999994e303Initial program 90.6%
if -4.99006e-322 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 39.6%
sqrt-div45.6%
associate-*r/45.7%
Applied egg-rr45.7%
associate-*l/45.7%
Simplified45.7%
add-sqr-sqrt34.0%
sqrt-unprod34.5%
*-commutative34.5%
*-commutative34.5%
swap-sqr32.9%
add-sqr-sqrt32.9%
frac-times32.7%
add-sqr-sqrt50.3%
Applied egg-rr50.3%
frac-times58.5%
*-commutative58.5%
associate-*l/56.9%
associate-*l/59.9%
Applied egg-rr59.9%
if 9.9999999999999994e303 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 42.2%
add-sqr-sqrt42.2%
pow242.2%
pow1/242.2%
sqrt-pow142.2%
metadata-eval42.2%
Applied egg-rr42.2%
add-sqr-sqrt42.2%
sqrt-unprod42.2%
*-commutative42.2%
*-commutative42.2%
swap-sqr41.6%
pow-pow41.6%
metadata-eval41.6%
metadata-eval41.6%
pow-pow41.6%
metadata-eval41.6%
metadata-eval41.6%
sqr-pow41.6%
pow141.6%
Applied egg-rr41.6%
associate-*l/56.4%
associate-*r/56.4%
times-frac77.1%
Simplified77.1%
Final simplification81.7%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (/ A V))))
(if (<= (* V l) -2e+176)
(* c0 (/ t_0 (sqrt l)))
(if (<= (* V l) -2e-38)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 5e-320)
(* c0 (* t_0 (pow l -0.5)))
(/ (* c0 (sqrt A)) (sqrt (* V l))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -2e+176) {
tmp = c0 * (t_0 / sqrt(l));
} else if ((V * l) <= -2e-38) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 5e-320) {
tmp = c0 * (t_0 * pow(l, -0.5));
} else {
tmp = (c0 * sqrt(A)) / sqrt((V * l));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-2d+176)) then
tmp = c0 * (t_0 / sqrt(l))
else if ((v * l) <= (-2d-38)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 5d-320) then
tmp = c0 * (t_0 * (l ** (-0.5d0)))
else
tmp = (c0 * sqrt(a)) / sqrt((v * l))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -2e+176) {
tmp = c0 * (t_0 / Math.sqrt(l));
} else if ((V * l) <= -2e-38) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 5e-320) {
tmp = c0 * (t_0 * Math.pow(l, -0.5));
} else {
tmp = (c0 * Math.sqrt(A)) / Math.sqrt((V * l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -2e+176: tmp = c0 * (t_0 / math.sqrt(l)) elif (V * l) <= -2e-38: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 5e-320: tmp = c0 * (t_0 * math.pow(l, -0.5)) else: tmp = (c0 * math.sqrt(A)) / math.sqrt((V * l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -2e+176) tmp = Float64(c0 * Float64(t_0 / sqrt(l))); elseif (Float64(V * l) <= -2e-38) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 5e-320) tmp = Float64(c0 * Float64(t_0 * (l ^ -0.5))); else tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(V * l))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -2e+176)
tmp = c0 * (t_0 / sqrt(l));
elseif ((V * l) <= -2e-38)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 5e-320)
tmp = c0 * (t_0 * (l ^ -0.5));
else
tmp = (c0 * sqrt(A)) / sqrt((V * l));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+176], N[(c0 * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-38], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-320], N[(c0 * N[(t$95$0 * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+176}:\\
\;\;\;\;c0 \cdot \frac{t_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-38}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-320}:\\
\;\;\;\;c0 \cdot \left(t_0 \cdot {\ell}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2e176Initial program 48.8%
associate-/r*55.9%
sqrt-div34.9%
Applied egg-rr34.9%
if -2e176 < (*.f64 V l) < -1.9999999999999999e-38Initial program 96.4%
if -1.9999999999999999e-38 < (*.f64 V l) < 4.99994e-320Initial program 63.5%
add-sqr-sqrt63.5%
pow263.5%
pow1/263.5%
sqrt-pow163.5%
metadata-eval63.5%
Applied egg-rr63.5%
pow-pow63.5%
metadata-eval63.5%
pow1/263.5%
associate-/r*71.7%
un-div-inv71.7%
sqrt-prod48.4%
*-commutative48.4%
inv-pow48.4%
sqrt-pow148.4%
metadata-eval48.4%
Applied egg-rr48.4%
if 4.99994e-320 < (*.f64 V l) Initial program 71.7%
*-commutative71.7%
sqrt-div91.7%
associate-*l/90.7%
Applied egg-rr90.7%
Final simplification76.6%
NOTE: 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)) (sqrt l)))))
(if (<= (* V l) -2e+176)
t_0
(if (<= (* V l) -2e-38)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 5e-320) t_0 (/ (* c0 (sqrt A)) (sqrt (* V l))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -2e+176) {
tmp = t_0;
} else if ((V * l) <= -2e-38) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 5e-320) {
tmp = t_0;
} else {
tmp = (c0 * sqrt(A)) / sqrt((V * l));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-2d+176)) then
tmp = t_0
else if ((v * l) <= (-2d-38)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 5d-320) then
tmp = t_0
else
tmp = (c0 * sqrt(a)) / sqrt((v * l))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -2e+176) {
tmp = t_0;
} else if ((V * l) <= -2e-38) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 5e-320) {
tmp = t_0;
} else {
tmp = (c0 * Math.sqrt(A)) / Math.sqrt((V * l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -2e+176: tmp = t_0 elif (V * l) <= -2e-38: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 5e-320: tmp = t_0 else: tmp = (c0 * math.sqrt(A)) / math.sqrt((V * l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -2e+176) tmp = t_0; elseif (Float64(V * l) <= -2e-38) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 5e-320) tmp = t_0; else tmp = Float64(Float64(c0 * sqrt(A)) / sqrt(Float64(V * l))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -2e+176)
tmp = t_0;
elseif ((V * l) <= -2e-38)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 5e-320)
tmp = t_0;
else
tmp = (c0 * sqrt(A)) / sqrt((V * l));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+176], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-38], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-320], t$95$0, N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+176}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-38}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-320}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2e176 or -1.9999999999999999e-38 < (*.f64 V l) < 4.99994e-320Initial program 58.9%
associate-/r*66.8%
sqrt-div44.3%
Applied egg-rr44.3%
if -2e176 < (*.f64 V l) < -1.9999999999999999e-38Initial program 96.4%
if 4.99994e-320 < (*.f64 V l) Initial program 71.7%
*-commutative71.7%
sqrt-div91.7%
associate-*l/90.7%
Applied egg-rr90.7%
Final simplification76.6%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l 6.2e-287) (* c0 (pow (/ 1.0 (/ A (* V l))) -0.5)) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= 6.2e-287) {
tmp = c0 * pow((1.0 / (A / (V * l))), -0.5);
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (l <= 6.2d-287) then
tmp = c0 * ((1.0d0 / (a / (v * l))) ** (-0.5d0))
else
tmp = c0 * (sqrt((a / v)) / sqrt(l))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= 6.2e-287) {
tmp = c0 * Math.pow((1.0 / (A / (V * l))), -0.5);
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if l <= 6.2e-287: tmp = c0 * math.pow((1.0 / (A / (V * l))), -0.5) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= 6.2e-287) tmp = Float64(c0 * (Float64(1.0 / Float64(A / Float64(V * l))) ^ -0.5)); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= 6.2e-287)
tmp = c0 * ((1.0 / (A / (V * l))) ^ -0.5);
else
tmp = c0 * (sqrt((A / V)) / sqrt(l));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[l, 6.2e-287], N[(c0 * N[Power[N[(1.0 / N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 6.2 \cdot 10^{-287}:\\
\;\;\;\;c0 \cdot {\left(\frac{1}{\frac{A}{V \cdot \ell}}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 6.2000000000000001e-287Initial program 77.1%
pow1/277.1%
clear-num76.1%
inv-pow76.1%
pow-pow76.1%
associate-/l*70.9%
metadata-eval70.9%
Applied egg-rr70.9%
associate-/l*76.1%
*-lft-identity76.1%
times-frac71.7%
/-rgt-identity71.7%
Simplified71.7%
associate-*r/76.1%
clear-num76.1%
Applied egg-rr76.1%
if 6.2000000000000001e-287 < l Initial program 67.5%
associate-/r*68.6%
sqrt-div81.9%
Applied egg-rr81.9%
Final simplification79.0%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -5e-310) (* (sqrt A) (/ c0 (sqrt (* V l)))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (l <= (-5d-310)) then
tmp = sqrt(a) * (c0 / sqrt((v * l)))
else
tmp = c0 * (sqrt((a / v)) / sqrt(l))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= -5e-310)
tmp = sqrt(A) * (c0 / sqrt((V * l)));
else
tmp = c0 * (sqrt((A / V)) / sqrt(l));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[l, -5e-310], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 77.7%
sqrt-div46.5%
associate-*r/45.6%
Applied egg-rr45.6%
associate-*l/45.1%
Simplified45.1%
if -4.999999999999985e-310 < l Initial program 67.0%
associate-/r*68.8%
sqrt-div82.1%
Applied egg-rr82.1%
Final simplification63.5%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+301) (* c0 (sqrt t_0)) (* c0 (pow (* V (/ l A)) -0.5))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+301) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+301) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+301) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+301: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow((V * (l / A)), -0.5) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = 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 <= 2e+301) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+301)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * ((V * (l / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $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+301], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+301}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 32.9%
add-sqr-sqrt32.9%
pow232.9%
pow1/232.9%
sqrt-pow132.9%
metadata-eval32.9%
Applied egg-rr32.9%
Taylor expanded in c0 around 0 32.9%
associate-/r*42.4%
Simplified42.4%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.00000000000000011e301Initial program 98.2%
if 2.00000000000000011e301 < (/.f64 A (*.f64 V l)) Initial program 31.3%
pow1/231.3%
clear-num31.3%
inv-pow31.3%
pow-pow32.5%
associate-/l*46.9%
metadata-eval46.9%
Applied egg-rr46.9%
associate-/l*32.5%
*-lft-identity32.5%
times-frac46.9%
/-rgt-identity46.9%
Simplified46.9%
Final simplification77.2%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+299) (* c0 (sqrt t_0)) (* c0 (pow (* l (/ V A)) -0.5))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+299) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow((l * (V / A)), -0.5);
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+299) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * ((l * (v / a)) ** (-0.5d0))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+299) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow((l * (V / A)), -0.5);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+299: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow((l * (V / A)), -0.5) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = 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 <= 2e+299) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+299)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * ((l * (V / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $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+299], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 32.9%
add-sqr-sqrt32.9%
pow232.9%
pow1/232.9%
sqrt-pow132.9%
metadata-eval32.9%
Applied egg-rr32.9%
Taylor expanded in c0 around 0 32.9%
associate-/r*42.4%
Simplified42.4%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e299Initial program 98.2%
if 2.0000000000000001e299 < (/.f64 A (*.f64 V l)) Initial program 32.8%
pow1/232.8%
clear-num32.8%
inv-pow32.8%
pow-pow33.9%
associate-/l*46.0%
metadata-eval46.0%
Applied egg-rr46.0%
associate-/l*33.9%
*-lft-identity33.9%
times-frac47.3%
/-rgt-identity47.3%
Simplified47.3%
Taylor expanded in V around 0 36.6%
exp-prod36.6%
log-prod45.9%
*-commutative45.9%
associate-*l/33.8%
associate-*r/46.6%
exp-prod46.6%
*-commutative46.6%
exp-to-pow48.1%
Simplified48.1%
Final simplification77.2%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 2e+301)))
(* c0 (sqrt (/ (/ A l) V)))
(* c0 (sqrt t_0)))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 2e+301)) {
tmp = c0 * sqrt(((A / l) / V));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 2d+301))) then
tmp = c0 * sqrt(((a / l) / v))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 2e+301)) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 2e+301): tmp = c0 * math.sqrt(((A / l) / V)) else: tmp = c0 * math.sqrt(t_0) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 2e+301)) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 2e+301)))
tmp = c0 * sqrt(((A / l) / V));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 2e+301]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 2 \cdot 10^{+301}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 2.00000000000000011e301 < (/.f64 A (*.f64 V l)) Initial program 32.2%
associate-/r*43.9%
div-inv43.9%
Applied egg-rr43.9%
associate-*l/44.0%
div-inv44.0%
Applied egg-rr44.0%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.00000000000000011e301Initial program 98.2%
Final simplification77.0%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 2e+299)))
(* c0 (sqrt (/ (/ A V) l)))
(* c0 (sqrt t_0)))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 2e+299)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 2d+299))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 2e+299)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 2e+299): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.sqrt(t_0) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 2e+299)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 2e+299)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 2e+299]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 2 \cdot 10^{+299}\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 2.0000000000000001e299 < (/.f64 A (*.f64 V l)) Initial program 32.8%
add-sqr-sqrt32.8%
pow232.8%
pow1/232.8%
sqrt-pow132.8%
metadata-eval32.8%
Applied egg-rr32.8%
Taylor expanded in c0 around 0 32.8%
associate-/r*44.5%
Simplified44.5%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e299Initial program 98.2%
Final simplification77.0%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+299) (* c0 (sqrt t_0)) (/ c0 (sqrt (* l (/ V A))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+299) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+299) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+299) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+299: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+299) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+299)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $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+299], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;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 32.9%
add-sqr-sqrt32.9%
pow232.9%
pow1/232.9%
sqrt-pow132.9%
metadata-eval32.9%
Applied egg-rr32.9%
Taylor expanded in c0 around 0 32.9%
associate-/r*42.4%
Simplified42.4%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e299Initial program 98.2%
if 2.0000000000000001e299 < (/.f64 A (*.f64 V l)) Initial program 32.8%
sqrt-div45.3%
associate-*r/45.2%
Applied egg-rr45.2%
associate-*l/45.3%
Simplified45.3%
expm1-log1p-u28.8%
expm1-udef24.4%
associate-*l/24.4%
associate-/l*24.4%
sqrt-div13.7%
associate-*r/19.2%
associate-*r/13.7%
associate-*l/19.2%
*-commutative19.2%
Applied egg-rr19.2%
expm1-def23.3%
expm1-log1p48.0%
Simplified48.0%
Final simplification77.2%
NOTE: 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(V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[V, l] = sort([V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
V, l = sort([V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
V, l = num2cell(sort([V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 72.4%
Final simplification72.4%
herbie shell --seed 2023256
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))