
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -5e-310) (/ c0 (/ (sqrt l) (/ (sqrt (- A)) (sqrt (- V))))) (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 / (sqrt(l) / (sqrt(-A) / sqrt(-V)));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-5d-310)) then
tmp = c0 / (sqrt(l) / (sqrt(-a) / sqrt(-v)))
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / v) / l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 / (Math.sqrt(l) / (Math.sqrt(-A) / Math.sqrt(-V)));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = c0 / (math.sqrt(l) / (math.sqrt(-A) / math.sqrt(-V))) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(c0 / Float64(sqrt(l) / Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -5e-310)
tmp = c0 / (sqrt(l) / (sqrt(-A) / sqrt(-V)));
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -5e-310], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\frac{\sqrt{-A}}{\sqrt{-V}}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 75.7%
associate-/r*74.0%
sqrt-div43.2%
associate-*r/41.1%
Applied egg-rr41.1%
associate-/l*43.1%
Simplified43.1%
frac-2neg43.1%
sqrt-div50.8%
Applied egg-rr50.8%
if -4.999999999999985e-310 < A Initial program 72.8%
div-inv72.2%
sqrt-prod85.0%
associate-/r*85.5%
Applied egg-rr85.5%
Final simplification67.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= V -5e-310) (* c0 (/ (sqrt (/ -1.0 V)) (sqrt (/ (- l) A)))) (/ (* c0 (sqrt A)) (/ (sqrt l) (pow V -0.5)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -5e-310) {
tmp = c0 * (sqrt((-1.0 / V)) / sqrt((-l / A)));
} else {
tmp = (c0 * sqrt(A)) / (sqrt(l) / pow(V, -0.5));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (v <= (-5d-310)) then
tmp = c0 * (sqrt(((-1.0d0) / v)) / sqrt((-l / a)))
else
tmp = (c0 * sqrt(a)) / (sqrt(l) / (v ** (-0.5d0)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -5e-310) {
tmp = c0 * (Math.sqrt((-1.0 / V)) / Math.sqrt((-l / A)));
} else {
tmp = (c0 * Math.sqrt(A)) / (Math.sqrt(l) / Math.pow(V, -0.5));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if V <= -5e-310: tmp = c0 * (math.sqrt((-1.0 / V)) / math.sqrt((-l / A))) else: tmp = (c0 * math.sqrt(A)) / (math.sqrt(l) / math.pow(V, -0.5)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= -5e-310) tmp = Float64(c0 * Float64(sqrt(Float64(-1.0 / V)) / sqrt(Float64(Float64(-l) / A)))); else tmp = Float64(Float64(c0 * sqrt(A)) / Float64(sqrt(l) / (V ^ -0.5))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (V <= -5e-310)
tmp = c0 * (sqrt((-1.0 / V)) / sqrt((-l / A)));
else
tmp = (c0 * sqrt(A)) / (sqrt(l) / (V ^ -0.5));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[V, -5e-310], N[(c0 * N[(N[Sqrt[N[(-1.0 / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[((-l) / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / N[Power[V, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-1}{V}}}{\sqrt{\frac{-\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\frac{\sqrt{\ell}}{{V}^{-0.5}}}\\
\end{array}
\end{array}
if V < -4.999999999999985e-310Initial program 72.6%
clear-num71.9%
associate-/r/72.5%
associate-/r*72.6%
Applied egg-rr72.6%
associate-*l/74.1%
associate-*r/70.9%
associate-*l/70.9%
*-un-lft-identity70.9%
Applied egg-rr70.9%
associate-/l/72.6%
*-un-lft-identity72.6%
frac-times70.9%
clear-num70.9%
div-inv70.9%
frac-2neg70.9%
sqrt-div82.8%
distribute-neg-frac82.8%
metadata-eval82.8%
distribute-neg-frac82.8%
Applied egg-rr82.8%
if -4.999999999999985e-310 < V Initial program 76.0%
clear-num75.8%
associate-/r/75.4%
associate-/r*76.0%
Applied egg-rr76.0%
sqrt-prod44.0%
*-commutative44.0%
associate-*r*41.9%
*-commutative41.9%
sqrt-div47.9%
associate-*r/47.2%
*-commutative47.2%
inv-pow47.2%
sqrt-pow147.2%
metadata-eval47.2%
Applied egg-rr47.2%
associate-/l*47.9%
Simplified47.9%
Final simplification65.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 V) (- INFINITY))
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* l V) -5e-297)
(* c0 (/ (sqrt (- A)) (sqrt (* l (- V)))))
(if (<= (* l V) 1e-302)
(sqrt (* (/ A l) (/ (pow c0 2.0) V)))
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((l * V) <= -5e-297) {
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
} else if ((l * V) <= 1e-302) {
tmp = sqrt(((A / l) * (pow(c0, 2.0) / V)));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
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) <= -5e-297) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((l * -V)));
} else if ((l * V) <= 1e-302) {
tmp = Math.sqrt(((A / l) * (Math.pow(c0, 2.0) / V)));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -math.inf: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (l * V) <= -5e-297: tmp = c0 * (math.sqrt(-A) / math.sqrt((l * -V))) elif (l * V) <= 1e-302: tmp = math.sqrt(((A / l) * (math.pow(c0, 2.0) / V))) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(l * V) <= -5e-297) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V))))); elseif (Float64(l * V) <= 1e-302) tmp = sqrt(Float64(Float64(A / l) * Float64((c0 ^ 2.0) / V))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((l * V) <= -Inf)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((l * V) <= -5e-297)
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
elseif ((l * V) <= 1e-302)
tmp = sqrt(((A / l) * ((c0 ^ 2.0) / V)));
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[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], -5e-297], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 1e-302], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(N[Power[c0, 2.0], $MachinePrecision] / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;\ell \cdot V \leq -5 \cdot 10^{-297}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\
\mathbf{elif}\;\ell \cdot V \leq 10^{-302}:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \frac{{c0}^{2}}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 36.6%
associate-/r*62.9%
sqrt-div52.2%
associate-*r/52.1%
Applied egg-rr52.1%
*-commutative52.1%
associate-/l*52.0%
associate-/r/52.2%
Simplified52.2%
if -inf.0 < (*.f64 V l) < -5e-297Initial program 86.3%
frac-2neg86.3%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if -5e-297 < (*.f64 V l) < 9.9999999999999996e-303Initial program 54.6%
clear-num54.6%
associate-/r/52.2%
associate-/r*52.2%
Applied egg-rr52.2%
sqrt-prod34.6%
*-commutative34.6%
add-sqr-sqrt20.3%
sqrt-unprod20.5%
*-commutative20.5%
*-commutative20.5%
swap-sqr20.2%
swap-sqr20.2%
add-sqr-sqrt20.2%
add-sqr-sqrt36.9%
associate-/r*36.9%
div-inv39.3%
pow239.3%
Applied egg-rr39.3%
associate-*l/39.4%
*-commutative39.4%
times-frac40.3%
Simplified40.3%
if 9.9999999999999996e-303 < (*.f64 V l) Initial program 75.6%
div-inv75.6%
sqrt-prod89.6%
associate-/r*90.3%
Applied egg-rr90.3%
Final simplification85.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ (/ 1.0 V) l)))
(if (<= A -4.2e-132)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= A 1.3e-305)
(* c0 (sqrt (* A t_0)))
(if (<= A 8.2e-169)
(* (sqrt A) (* c0 (pow (* l V) -0.5)))
(* c0 (* (sqrt A) (sqrt t_0))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = (1.0 / V) / l;
double tmp;
if (A <= -4.2e-132) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if (A <= 1.3e-305) {
tmp = c0 * sqrt((A * t_0));
} else if (A <= 8.2e-169) {
tmp = sqrt(A) * (c0 * pow((l * V), -0.5));
} else {
tmp = c0 * (sqrt(A) * 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 = (1.0d0 / v) / l
if (a <= (-4.2d-132)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if (a <= 1.3d-305) then
tmp = c0 * sqrt((a * t_0))
else if (a <= 8.2d-169) then
tmp = sqrt(a) * (c0 * ((l * v) ** (-0.5d0)))
else
tmp = c0 * (sqrt(a) * 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 = (1.0 / V) / l;
double tmp;
if (A <= -4.2e-132) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if (A <= 1.3e-305) {
tmp = c0 * Math.sqrt((A * t_0));
} else if (A <= 8.2e-169) {
tmp = Math.sqrt(A) * (c0 * Math.pow((l * V), -0.5));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(t_0));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = (1.0 / V) / l tmp = 0 if A <= -4.2e-132: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif A <= 1.3e-305: tmp = c0 * math.sqrt((A * t_0)) elif A <= 8.2e-169: tmp = math.sqrt(A) * (c0 * math.pow((l * V), -0.5)) else: tmp = c0 * (math.sqrt(A) * math.sqrt(t_0)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(Float64(1.0 / V) / l) tmp = 0.0 if (A <= -4.2e-132) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (A <= 1.3e-305) tmp = Float64(c0 * sqrt(Float64(A * t_0))); elseif (A <= 8.2e-169) tmp = Float64(sqrt(A) * Float64(c0 * (Float64(l * V) ^ -0.5))); else tmp = Float64(c0 * Float64(sqrt(A) * 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 = (1.0 / V) / l;
tmp = 0.0;
if (A <= -4.2e-132)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif (A <= 1.3e-305)
tmp = c0 * sqrt((A * t_0));
elseif (A <= 8.2e-169)
tmp = sqrt(A) * (c0 * ((l * V) ^ -0.5));
else
tmp = c0 * (sqrt(A) * 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[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[A, -4.2e-132], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.3e-305], N[(c0 * N[Sqrt[N[(A * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 8.2e-169], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 * N[Power[N[(l * V), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{1}{V}}{\ell}\\
\mathbf{if}\;A \leq -4.2 \cdot 10^{-132}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;A \leq 1.3 \cdot 10^{-305}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot t_0}\\
\mathbf{elif}\;A \leq 8.2 \cdot 10^{-169}:\\
\;\;\;\;\sqrt{A} \cdot \left(c0 \cdot {\left(\ell \cdot V\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{t_0}\right)\\
\end{array}
\end{array}
if A < -4.2000000000000002e-132Initial program 73.5%
associate-/r*74.9%
sqrt-div45.5%
associate-*r/43.6%
Applied egg-rr43.6%
*-commutative43.6%
associate-/l*44.5%
associate-/r/45.5%
Simplified45.5%
if -4.2000000000000002e-132 < A < 1.3000000000000001e-305Initial program 82.2%
clear-num82.2%
associate-/r/82.2%
associate-/r*82.3%
Applied egg-rr82.3%
if 1.3000000000000001e-305 < A < 8.1999999999999996e-169Initial program 72.5%
*-commutative72.5%
sqrt-div92.0%
associate-*l/85.5%
Applied egg-rr85.5%
div-inv85.4%
*-commutative85.4%
metadata-eval85.4%
sqrt-div82.8%
associate-/r*82.7%
associate-*r*89.2%
*-commutative89.2%
associate-*r*89.3%
associate-/r*89.5%
sqrt-div92.0%
metadata-eval92.0%
pow1/292.0%
pow-flip92.1%
metadata-eval92.1%
Applied egg-rr92.1%
if 8.1999999999999996e-169 < A Initial program 72.6%
div-inv72.6%
sqrt-prod83.5%
associate-/r*84.3%
Applied egg-rr84.3%
Final simplification70.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 (<= (* l V) -1e+234)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= (* l V) 4e-314)
(* c0 (sqrt (/ 1.0 (/ (* l V) A))))
(* (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 ((l * V) <= -1e+234) {
tmp = c0 * sqrt(((A / V) / l));
} else if ((l * V) <= 4e-314) {
tmp = c0 * sqrt((1.0 / ((l * V) / A)));
} 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 ((l * v) <= (-1d+234)) then
tmp = c0 * sqrt(((a / v) / l))
else if ((l * v) <= 4d-314) then
tmp = c0 * sqrt((1.0d0 / ((l * v) / a)))
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 ((l * V) <= -1e+234) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if ((l * V) <= 4e-314) {
tmp = c0 * Math.sqrt((1.0 / ((l * V) / A)));
} 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 (l * V) <= -1e+234: tmp = c0 * math.sqrt(((A / V) / l)) elif (l * V) <= 4e-314: tmp = c0 * math.sqrt((1.0 / ((l * V) / A))) 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 (Float64(l * V) <= -1e+234) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (Float64(l * V) <= 4e-314) tmp = Float64(c0 * sqrt(Float64(1.0 / Float64(Float64(l * V) / A)))); 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 ((l * V) <= -1e+234)
tmp = c0 * sqrt(((A / V) / l));
elseif ((l * V) <= 4e-314)
tmp = c0 * sqrt((1.0 / ((l * V) / A)));
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[N[(l * V), $MachinePrecision], -1e+234], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 4e-314], N[(c0 * N[Sqrt[N[(1.0 / N[(N[(l * V), $MachinePrecision] / A), $MachinePrecision]), $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}\;\ell \cdot V \leq -1 \cdot 10^{+234}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;\ell \cdot V \leq 4 \cdot 10^{-314}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{\frac{\ell \cdot V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.00000000000000002e234Initial program 46.2%
*-commutative46.2%
associate-/l/64.4%
Simplified64.4%
if -1.00000000000000002e234 < (*.f64 V l) < 3.9999999999e-314Initial program 80.2%
clear-num80.2%
associate-/r/79.5%
associate-/r*79.6%
Applied egg-rr79.6%
associate-*l/74.1%
associate-*r/72.9%
frac-times80.2%
associate-/l*80.2%
Applied egg-rr80.2%
if 3.9999999999e-314 < (*.f64 V l) Initial program 75.4%
*-commutative75.4%
sqrt-div89.8%
associate-*l/84.9%
Applied egg-rr84.9%
Applied egg-rr75.2%
associate-*r*75.2%
associate-/l/71.6%
associate-/l/75.0%
pow-prod-up75.2%
metadata-eval75.2%
pow1/275.2%
*-commutative75.2%
associate-/l/75.4%
associate-/r*75.3%
sqrt-div42.2%
clear-num42.2%
div-inv42.3%
associate-/r/42.0%
sqrt-div49.9%
frac-times47.6%
sqrt-prod84.9%
*-commutative84.9%
Applied egg-rr84.9%
associate-/l*89.8%
associate-/r/88.1%
Simplified88.1%
Final simplification81.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (* c0 (sqrt (/ A (* l V)))))) (if (<= t_0 1e-190) (* c0 (sqrt (* (/ 1.0 V) (/ A l)))) t_0)))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (l * V)));
double tmp;
if (t_0 <= 1e-190) {
tmp = c0 * sqrt(((1.0 / V) * (A / l)));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (l * v)))
if (t_0 <= 1d-190) then
tmp = c0 * sqrt(((1.0d0 / v) * (a / l)))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (l * V)));
double tmp;
if (t_0 <= 1e-190) {
tmp = c0 * Math.sqrt(((1.0 / V) * (A / l)));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (l * V))) tmp = 0 if t_0 <= 1e-190: tmp = c0 * math.sqrt(((1.0 / V) * (A / l))) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(l * V)))) tmp = 0.0 if (t_0 <= 1e-190) tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / V) * Float64(A / l)))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (l * V)));
tmp = 0.0;
if (t_0 <= 1e-190)
tmp = c0 * sqrt(((1.0 / V) * (A / l)));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-190], N[(c0 * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] * N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
\mathbf{if}\;t_0 \leq 10^{-190}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1e-190Initial program 69.1%
*-un-lft-identity69.1%
times-frac70.4%
Applied egg-rr70.4%
if 1e-190 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 84.9%
Final simplification75.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (* c0 (sqrt (/ A (* l V)))))) (if (<= t_0 4e-252) (* c0 (sqrt (/ (/ 1.0 V) (/ l A)))) t_0)))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (l * V)));
double tmp;
if (t_0 <= 4e-252) {
tmp = c0 * sqrt(((1.0 / V) / (l / A)));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (l * v)))
if (t_0 <= 4d-252) then
tmp = c0 * sqrt(((1.0d0 / v) / (l / a)))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (l * V)));
double tmp;
if (t_0 <= 4e-252) {
tmp = c0 * Math.sqrt(((1.0 / V) / (l / A)));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (l * V))) tmp = 0 if t_0 <= 4e-252: tmp = c0 * math.sqrt(((1.0 / V) / (l / A))) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(l * V)))) tmp = 0.0 if (t_0 <= 4e-252) tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / V) / Float64(l / A)))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (l * V)));
tmp = 0.0;
if (t_0 <= 4e-252)
tmp = c0 * sqrt(((1.0 / V) / (l / A)));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-252], N[(c0 * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
\mathbf{if}\;t_0 \leq 4 \cdot 10^{-252}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{V}}{\frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999977e-252Initial program 68.4%
clear-num67.9%
associate-/r/68.4%
associate-/r*68.8%
Applied egg-rr68.8%
associate-*l/71.9%
associate-/l*69.3%
Applied egg-rr69.3%
if 3.99999999999999977e-252 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 85.6%
Final simplification74.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= A -1.85e-133)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= A 1.3e-305)
(* c0 (sqrt (* A (/ (/ 1.0 V) l))))
(* (sqrt A) (* c0 (pow (* l V) -0.5))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1.85e-133) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if (A <= 1.3e-305) {
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
} else {
tmp = sqrt(A) * (c0 * pow((l * V), -0.5));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-1.85d-133)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if (a <= 1.3d-305) then
tmp = c0 * sqrt((a * ((1.0d0 / v) / l)))
else
tmp = sqrt(a) * (c0 * ((l * v) ** (-0.5d0)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1.85e-133) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if (A <= 1.3e-305) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) / l)));
} else {
tmp = Math.sqrt(A) * (c0 * Math.pow((l * V), -0.5));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -1.85e-133: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif A <= 1.3e-305: tmp = c0 * math.sqrt((A * ((1.0 / V) / l))) else: tmp = math.sqrt(A) * (c0 * math.pow((l * V), -0.5)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -1.85e-133) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (A <= 1.3e-305) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); else tmp = Float64(sqrt(A) * Float64(c0 * (Float64(l * V) ^ -0.5))); 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 <= -1.85e-133)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif (A <= 1.3e-305)
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
else
tmp = sqrt(A) * (c0 * ((l * V) ^ -0.5));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -1.85e-133], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.3e-305], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 * N[Power[N[(l * V), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1.85 \cdot 10^{-133}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;A \leq 1.3 \cdot 10^{-305}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \left(c0 \cdot {\left(\ell \cdot V\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if A < -1.85000000000000018e-133Initial program 73.5%
associate-/r*74.9%
sqrt-div45.5%
associate-*r/43.6%
Applied egg-rr43.6%
*-commutative43.6%
associate-/l*44.5%
associate-/r/45.5%
Simplified45.5%
if -1.85000000000000018e-133 < A < 1.3000000000000001e-305Initial program 82.2%
clear-num82.2%
associate-/r/82.2%
associate-/r*82.3%
Applied egg-rr82.3%
if 1.3000000000000001e-305 < A Initial program 72.6%
*-commutative72.6%
sqrt-div85.4%
associate-*l/81.0%
Applied egg-rr81.0%
div-inv80.9%
*-commutative80.9%
metadata-eval80.9%
sqrt-div80.3%
associate-/r*81.0%
associate-*r*85.4%
*-commutative85.4%
associate-*r*84.1%
associate-/r*84.1%
sqrt-div84.6%
metadata-eval84.6%
pow1/284.6%
pow-flip84.7%
metadata-eval84.7%
Applied egg-rr84.7%
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 (let* ((t_0 (* c0 (sqrt (/ A (* l V)))))) (if (<= t_0 0.0) (* c0 (sqrt (/ (/ A V) l))) t_0)))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (l * V)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (l * v)))
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (l * V)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (l * V))) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(l * V)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (l * V)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 67.8%
*-commutative67.8%
associate-/l/71.5%
Simplified71.5%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 86.0%
Final simplification76.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (* c0 (sqrt (/ A (* l V)))))) (if (<= t_0 5e-180) (* c0 (sqrt (/ (/ A l) V))) t_0)))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (l * V)));
double tmp;
if (t_0 <= 5e-180) {
tmp = c0 * sqrt(((A / l) / V));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (l * v)))
if (t_0 <= 5d-180) then
tmp = c0 * sqrt(((a / l) / v))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (l * V)));
double tmp;
if (t_0 <= 5e-180) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (l * V))) tmp = 0 if t_0 <= 5e-180: tmp = c0 * math.sqrt(((A / l) / V)) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(l * V)))) tmp = 0.0 if (t_0 <= 5e-180) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (l * V)));
tmp = 0.0;
if (t_0 <= 5e-180)
tmp = c0 * sqrt(((A / l) / V));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-180], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{-180}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000001e-180Initial program 68.9%
clear-num68.2%
associate-/r/68.9%
associate-/r*69.4%
Applied egg-rr69.4%
associate-*l/72.4%
associate-*r/70.2%
associate-*l/70.2%
*-un-lft-identity70.2%
Applied egg-rr70.2%
if 5.0000000000000001e-180 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 85.5%
Final simplification75.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= A -8.8e-131)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= A 1.3e-305)
(* c0 (sqrt (* A (/ (/ 1.0 V) l))))
(* (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 <= -8.8e-131) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if (A <= 1.3e-305) {
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
} 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 <= (-8.8d-131)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if (a <= 1.3d-305) then
tmp = c0 * sqrt((a * ((1.0d0 / v) / l)))
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 <= -8.8e-131) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if (A <= 1.3e-305) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) / l)));
} 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 <= -8.8e-131: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif A <= 1.3e-305: tmp = c0 * math.sqrt((A * ((1.0 / V) / l))) 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 <= -8.8e-131) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (A <= 1.3e-305) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); 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 <= -8.8e-131)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif (A <= 1.3e-305)
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
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, -8.8e-131], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 1.3e-305], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $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 -8.8 \cdot 10^{-131}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;A \leq 1.3 \cdot 10^{-305}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -8.7999999999999999e-131Initial program 73.5%
associate-/r*74.9%
sqrt-div45.5%
associate-*r/43.6%
Applied egg-rr43.6%
*-commutative43.6%
associate-/l*44.5%
associate-/r/45.5%
Simplified45.5%
if -8.7999999999999999e-131 < A < 1.3000000000000001e-305Initial program 82.2%
clear-num82.2%
associate-/r/82.2%
associate-/r*82.3%
Applied egg-rr82.3%
if 1.3000000000000001e-305 < A Initial program 72.6%
*-commutative72.6%
sqrt-div85.4%
associate-*l/81.0%
Applied egg-rr81.0%
Applied egg-rr72.5%
associate-*r*72.4%
associate-/l/69.3%
associate-/l/72.5%
pow-prod-up72.6%
metadata-eval72.6%
pow1/272.6%
*-commutative72.6%
associate-/l/72.6%
associate-/r*72.7%
sqrt-div43.2%
clear-num43.2%
div-inv43.2%
associate-/r/43.0%
sqrt-div51.5%
frac-times49.5%
sqrt-prod81.0%
*-commutative81.0%
Applied egg-rr81.0%
associate-/l*85.3%
associate-/r/84.6%
Simplified84.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 (<= V 7e-309) (* c0 (sqrt (* A (/ (/ 1.0 V) l)))) (* (/ c0 (sqrt V)) (sqrt (/ A l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= 7e-309) {
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
} else {
tmp = (c0 / sqrt(V)) * sqrt((A / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (v <= 7d-309) then
tmp = c0 * sqrt((a * ((1.0d0 / v) / l)))
else
tmp = (c0 / sqrt(v)) * sqrt((a / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (V <= 7e-309) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) / l)));
} else {
tmp = (c0 / Math.sqrt(V)) * Math.sqrt((A / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if V <= 7e-309: tmp = c0 * math.sqrt((A * ((1.0 / V) / l))) else: tmp = (c0 / math.sqrt(V)) * math.sqrt((A / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= 7e-309) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); else tmp = Float64(Float64(c0 / sqrt(V)) * sqrt(Float64(A / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (V <= 7e-309)
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
else
tmp = (c0 / sqrt(V)) * sqrt((A / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[V, 7e-309], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(c0 / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq 7 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V}} \cdot \sqrt{\frac{A}{\ell}}\\
\end{array}
\end{array}
if V < 6.9999999999999984e-309Initial program 72.6%
clear-num71.9%
associate-/r/72.5%
associate-/r*72.6%
Applied egg-rr72.6%
if 6.9999999999999984e-309 < V Initial program 76.0%
*-commutative76.0%
sqrt-div44.0%
associate-*l/41.9%
Applied egg-rr41.9%
*-commutative41.9%
sqrt-prod47.9%
times-frac49.3%
sqrt-div83.4%
Applied egg-rr83.4%
Final simplification78.0%
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 74.3%
Final simplification74.3%
herbie shell --seed 2024017
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))