
(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 12 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 (<= (* V l) (- INFINITY))
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -1e-314)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* (pow l -0.5) (/ c0 (sqrt (/ V A))))
(if (<= (* V l) 1e+300)
(* c0 (* (pow (* V l) -0.5) (sqrt A)))
(* c0 (sqrt (/ (/ A V) l))))))))assert(c0 < A && A < V && 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-314) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = pow(l, -0.5) * (c0 / sqrt((V / A)));
} else if ((V * l) <= 1e+300) {
tmp = c0 * (pow((V * l), -0.5) * sqrt(A));
} else {
tmp = c0 * sqrt(((A / 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 ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -1e-314) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = Math.pow(l, -0.5) * (c0 / Math.sqrt((V / A)));
} else if ((V * l) <= 1e+300) {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, 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-314: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = math.pow(l, -0.5) * (c0 / math.sqrt((V / A))) elif (V * l) <= 1e+300: tmp = c0 * (math.pow((V * l), -0.5) * math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, 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-314) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64((l ^ -0.5) * Float64(c0 / sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 1e+300) tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * sqrt(A))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / 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 ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -1e-314)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = (l ^ -0.5) * (c0 / sqrt((V / A)));
elseif ((V * l) <= 1e+300)
tmp = c0 * (((V * l) ^ -0.5) * sqrt(A));
else
tmp = c0 * sqrt(((A / 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[(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-314], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[Power[l, -0.5], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+300], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, 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^{-314}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;{\ell}^{-0.5} \cdot \frac{c0}{\sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+300}:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 38.5%
associate-/r*73.5%
sqrt-div37.0%
div-inv37.0%
Applied egg-rr37.0%
associate-*r/37.0%
*-rgt-identity37.0%
Simplified37.0%
if -inf.0 < (*.f64 V l) < -9.9999999996e-315Initial program 84.0%
frac-2neg84.0%
sqrt-div98.9%
distribute-rgt-neg-in98.9%
Applied egg-rr98.9%
distribute-rgt-neg-out98.9%
*-commutative98.9%
distribute-rgt-neg-in98.9%
Simplified98.9%
if -9.9999999996e-315 < (*.f64 V l) < -0.0Initial program 43.3%
*-un-lft-identity43.3%
times-frac59.9%
Applied egg-rr59.9%
associate-*r/59.9%
sqrt-div51.4%
associate-*l/51.4%
*-un-lft-identity51.4%
clear-num51.6%
un-div-inv51.7%
clear-num51.5%
sqrt-undiv60.0%
associate-/r*43.3%
frac-2neg43.3%
*-commutative43.3%
distribute-rgt-neg-out43.3%
sqrt-undiv24.5%
clear-num24.5%
sqrt-undiv43.3%
distribute-rgt-neg-out43.3%
*-commutative43.3%
frac-2neg43.3%
Applied egg-rr62.3%
*-un-lft-identity62.3%
sqrt-prod51.6%
times-frac51.5%
pow1/251.5%
pow-flip51.6%
metadata-eval51.6%
Applied egg-rr51.6%
if -0.0 < (*.f64 V l) < 1.0000000000000001e300Initial program 80.8%
*-un-lft-identity80.8%
times-frac66.7%
Applied egg-rr66.7%
associate-*r/76.7%
associate-*l/79.0%
*-commutative79.0%
associate-*r/76.7%
div-inv76.8%
frac-2neg76.8%
associate-/l/80.8%
sqrt-undiv0.0%
clear-num0.0%
associate-/r/0.0%
pow1/20.0%
pow-flip0.0%
*-commutative0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
metadata-eval0.0%
add-sqr-sqrt0.0%
sqrt-unprod63.5%
sqr-neg63.5%
sqrt-unprod98.5%
Applied egg-rr98.5%
if 1.0000000000000001e300 < (*.f64 V l) Initial program 31.6%
associate-/r*76.7%
Simplified76.7%
Final simplification88.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 (<= (* V l) -5e+178)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -5e-236)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
(* (pow l -0.5) (/ c0 (sqrt (/ V A))))
(if (<= (* V l) 1e+300)
(* c0 (* (pow (* V l) -0.5) (sqrt A)))
(* c0 (sqrt (/ (/ A V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+178) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -5e-236) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = pow(l, -0.5) * (c0 / sqrt((V / A)));
} else if ((V * l) <= 1e+300) {
tmp = c0 * (pow((V * l), -0.5) * sqrt(A));
} else {
tmp = c0 * sqrt(((A / 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 ((v * l) <= (-5d+178)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-5d-236)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = (l ** (-0.5d0)) * (c0 / sqrt((v / a)))
else if ((v * l) <= 1d+300) then
tmp = c0 * (((v * l) ** (-0.5d0)) * sqrt(a))
else
tmp = c0 * sqrt(((a / 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 ((V * l) <= -5e+178) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -5e-236) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = Math.pow(l, -0.5) * (c0 / Math.sqrt((V / A)));
} else if ((V * l) <= 1e+300) {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e+178: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -5e-236: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = math.pow(l, -0.5) * (c0 / math.sqrt((V / A))) elif (V * l) <= 1e+300: tmp = c0 * (math.pow((V * l), -0.5) * math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e+178) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -5e-236) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = Float64((l ^ -0.5) * Float64(c0 / sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 1e+300) tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * sqrt(A))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / 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 ((V * l) <= -5e+178)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -5e-236)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = (l ^ -0.5) * (c0 / sqrt((V / A)));
elseif ((V * l) <= 1e+300)
tmp = c0 * (((V * l) ^ -0.5) * sqrt(A));
else
tmp = c0 * sqrt(((A / 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[(V * l), $MachinePrecision], -5e+178], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-236], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[Power[l, -0.5], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+300], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+178}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-236}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;{\ell}^{-0.5} \cdot \frac{c0}{\sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+300}:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999999e178Initial program 53.2%
associate-/r*68.1%
sqrt-div37.2%
div-inv37.1%
Applied egg-rr37.1%
associate-*r/37.2%
*-rgt-identity37.2%
Simplified37.2%
if -4.9999999999999999e178 < (*.f64 V l) < -4.9999999999999998e-236Initial program 92.0%
*-un-lft-identity92.0%
times-frac83.3%
Applied egg-rr83.3%
associate-*r/79.3%
sqrt-div39.1%
associate-*l/39.1%
*-un-lft-identity39.1%
clear-num39.2%
un-div-inv39.2%
clear-num39.0%
sqrt-undiv79.4%
associate-/r*92.0%
frac-2neg92.0%
*-commutative92.0%
distribute-rgt-neg-out92.0%
sqrt-undiv99.3%
clear-num99.4%
sqrt-undiv92.4%
distribute-rgt-neg-out92.4%
*-commutative92.4%
frac-2neg92.4%
Applied egg-rr77.8%
associate-*r/92.4%
Applied egg-rr92.4%
if -4.9999999999999998e-236 < (*.f64 V l) < -0.0Initial program 46.3%
*-un-lft-identity46.3%
times-frac59.1%
Applied egg-rr59.1%
associate-*r/59.1%
sqrt-div45.2%
associate-*l/45.2%
*-un-lft-identity45.2%
clear-num45.4%
un-div-inv45.5%
clear-num45.3%
sqrt-undiv59.1%
associate-/r*46.3%
frac-2neg46.3%
*-commutative46.3%
distribute-rgt-neg-out46.3%
sqrt-undiv42.9%
clear-num43.0%
sqrt-undiv46.3%
distribute-rgt-neg-out46.3%
*-commutative46.3%
frac-2neg46.3%
Applied egg-rr60.8%
*-un-lft-identity60.8%
sqrt-prod45.4%
times-frac45.4%
pow1/245.4%
pow-flip45.4%
metadata-eval45.4%
Applied egg-rr45.4%
if -0.0 < (*.f64 V l) < 1.0000000000000001e300Initial program 80.8%
*-un-lft-identity80.8%
times-frac66.7%
Applied egg-rr66.7%
associate-*r/76.7%
associate-*l/79.0%
*-commutative79.0%
associate-*r/76.7%
div-inv76.8%
frac-2neg76.8%
associate-/l/80.8%
sqrt-undiv0.0%
clear-num0.0%
associate-/r/0.0%
pow1/20.0%
pow-flip0.0%
*-commutative0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
metadata-eval0.0%
add-sqr-sqrt0.0%
sqrt-unprod63.5%
sqr-neg63.5%
sqrt-unprod98.5%
Applied egg-rr98.5%
if 1.0000000000000001e300 < (*.f64 V l) Initial program 31.6%
associate-/r*76.7%
Simplified76.7%
Final simplification80.0%
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 l) -5e+178)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -5e-236)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 1e+300)
(* c0 (* (pow (* V l) -0.5) (sqrt A)))
(* c0 (sqrt (/ (/ A V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+178) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -5e-236) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 1e+300) {
tmp = c0 * (pow((V * l), -0.5) * sqrt(A));
} else {
tmp = c0 * sqrt(((A / 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 ((v * l) <= (-5d+178)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-5d-236)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 1d+300) then
tmp = c0 * (((v * l) ** (-0.5d0)) * sqrt(a))
else
tmp = c0 * sqrt(((a / 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 ((V * l) <= -5e+178) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -5e-236) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 1e+300) {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e+178: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -5e-236: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 1e+300: tmp = c0 * (math.pow((V * l), -0.5) * math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e+178) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -5e-236) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 1e+300) tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * sqrt(A))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / 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 ((V * l) <= -5e+178)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -5e-236)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 1e+300)
tmp = c0 * (((V * l) ^ -0.5) * sqrt(A));
else
tmp = c0 * sqrt(((A / 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[(V * l), $MachinePrecision], -5e+178], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-236], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+300], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+178}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-236}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+300}:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999999e178Initial program 53.2%
associate-/r*68.1%
sqrt-div37.2%
div-inv37.1%
Applied egg-rr37.1%
associate-*r/37.2%
*-rgt-identity37.2%
Simplified37.2%
if -4.9999999999999999e178 < (*.f64 V l) < -4.9999999999999998e-236Initial program 92.0%
*-un-lft-identity92.0%
times-frac83.3%
Applied egg-rr83.3%
associate-*r/79.3%
sqrt-div39.1%
associate-*l/39.1%
*-un-lft-identity39.1%
clear-num39.2%
un-div-inv39.2%
clear-num39.0%
sqrt-undiv79.4%
associate-/r*92.0%
frac-2neg92.0%
*-commutative92.0%
distribute-rgt-neg-out92.0%
sqrt-undiv99.3%
clear-num99.4%
sqrt-undiv92.4%
distribute-rgt-neg-out92.4%
*-commutative92.4%
frac-2neg92.4%
Applied egg-rr77.8%
associate-*r/92.4%
Applied egg-rr92.4%
if -4.9999999999999998e-236 < (*.f64 V l) < -0.0Initial program 46.3%
*-un-lft-identity46.3%
times-frac59.1%
Applied egg-rr59.1%
associate-*r/59.1%
sqrt-div45.2%
associate-*l/45.2%
*-un-lft-identity45.2%
clear-num45.4%
un-div-inv45.5%
clear-num45.3%
sqrt-undiv59.1%
associate-/r*46.3%
frac-2neg46.3%
*-commutative46.3%
distribute-rgt-neg-out46.3%
sqrt-undiv42.9%
clear-num43.0%
sqrt-undiv46.3%
distribute-rgt-neg-out46.3%
*-commutative46.3%
frac-2neg46.3%
Applied egg-rr60.8%
*-commutative60.8%
sqrt-prod45.4%
Applied egg-rr45.4%
if -0.0 < (*.f64 V l) < 1.0000000000000001e300Initial program 80.8%
*-un-lft-identity80.8%
times-frac66.7%
Applied egg-rr66.7%
associate-*r/76.7%
associate-*l/79.0%
*-commutative79.0%
associate-*r/76.7%
div-inv76.8%
frac-2neg76.8%
associate-/l/80.8%
sqrt-undiv0.0%
clear-num0.0%
associate-/r/0.0%
pow1/20.0%
pow-flip0.0%
*-commutative0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
metadata-eval0.0%
add-sqr-sqrt0.0%
sqrt-unprod63.5%
sqr-neg63.5%
sqrt-unprod98.5%
Applied egg-rr98.5%
if 1.0000000000000001e300 < (*.f64 V l) Initial program 31.6%
associate-/r*76.7%
Simplified76.7%
Final simplification80.0%
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 l) -5e+178)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -5e-236)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 1e+300)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (sqrt (/ (/ A V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+178) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -5e-236) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 1e+300) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * sqrt(((A / 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 ((v * l) <= (-5d+178)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-5d-236)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 1d+300) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = c0 * sqrt(((a / 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 ((V * l) <= -5e+178) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -5e-236) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 1e+300) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e+178: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -5e-236: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 1e+300: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e+178) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -5e-236) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 1e+300) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / 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 ((V * l) <= -5e+178)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -5e-236)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 1e+300)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 * sqrt(((A / 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[(V * l), $MachinePrecision], -5e+178], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-236], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+300], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+178}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-236}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+300}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999999e178Initial program 53.2%
associate-/r*68.1%
sqrt-div37.2%
div-inv37.1%
Applied egg-rr37.1%
associate-*r/37.2%
*-rgt-identity37.2%
Simplified37.2%
if -4.9999999999999999e178 < (*.f64 V l) < -4.9999999999999998e-236Initial program 92.0%
*-un-lft-identity92.0%
times-frac83.3%
Applied egg-rr83.3%
associate-*r/79.3%
sqrt-div39.1%
associate-*l/39.1%
*-un-lft-identity39.1%
clear-num39.2%
un-div-inv39.2%
clear-num39.0%
sqrt-undiv79.4%
associate-/r*92.0%
frac-2neg92.0%
*-commutative92.0%
distribute-rgt-neg-out92.0%
sqrt-undiv99.3%
clear-num99.4%
sqrt-undiv92.4%
distribute-rgt-neg-out92.4%
*-commutative92.4%
frac-2neg92.4%
Applied egg-rr77.8%
associate-*r/92.4%
Applied egg-rr92.4%
if -4.9999999999999998e-236 < (*.f64 V l) < -0.0Initial program 46.3%
*-un-lft-identity46.3%
times-frac59.1%
Applied egg-rr59.1%
associate-*r/59.1%
sqrt-div45.2%
associate-*l/45.2%
*-un-lft-identity45.2%
clear-num45.4%
un-div-inv45.5%
clear-num45.3%
sqrt-undiv59.1%
associate-/r*46.3%
frac-2neg46.3%
*-commutative46.3%
distribute-rgt-neg-out46.3%
sqrt-undiv42.9%
clear-num43.0%
sqrt-undiv46.3%
distribute-rgt-neg-out46.3%
*-commutative46.3%
frac-2neg46.3%
Applied egg-rr60.8%
*-commutative60.8%
sqrt-prod45.4%
Applied egg-rr45.4%
if -0.0 < (*.f64 V l) < 1.0000000000000001e300Initial program 80.8%
*-un-lft-identity80.8%
times-frac66.7%
Applied egg-rr66.7%
associate-*r/76.7%
sqrt-div44.8%
associate-*l/44.8%
*-un-lft-identity44.8%
clear-num44.8%
un-div-inv44.8%
clear-num44.7%
sqrt-undiv76.7%
associate-/r*80.7%
frac-2neg80.7%
*-commutative80.7%
distribute-rgt-neg-out80.7%
sqrt-undiv0.0%
clear-num0.0%
sqrt-undiv80.5%
distribute-rgt-neg-out80.5%
*-commutative80.5%
frac-2neg80.5%
Applied egg-rr75.6%
associate-*r/80.5%
*-commutative80.5%
sqrt-div98.5%
*-commutative98.5%
Applied egg-rr98.5%
if 1.0000000000000001e300 < (*.f64 V l) Initial program 31.6%
associate-/r*76.7%
Simplified76.7%
Final simplification80.0%
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 l) -5e+178)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -5e-236)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 1e+300)
(* (sqrt A) (/ c0 (sqrt (* V l))))
(* c0 (sqrt (/ (/ A V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+178) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -5e-236) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 1e+300) {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / 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 ((v * l) <= (-5d+178)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-5d-236)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 1d+300) then
tmp = sqrt(a) * (c0 / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / 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 ((V * l) <= -5e+178) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -5e-236) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 1e+300) {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e+178: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -5e-236: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 1e+300: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e+178) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -5e-236) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 1e+300) tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / 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 ((V * l) <= -5e+178)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -5e-236)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 1e+300)
tmp = sqrt(A) * (c0 / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / 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[(V * l), $MachinePrecision], -5e+178], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-236], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+300], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+178}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-236}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+300}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999999e178Initial program 53.2%
associate-/r*68.1%
sqrt-div37.2%
div-inv37.1%
Applied egg-rr37.1%
associate-*r/37.2%
*-rgt-identity37.2%
Simplified37.2%
if -4.9999999999999999e178 < (*.f64 V l) < -4.9999999999999998e-236Initial program 92.0%
*-un-lft-identity92.0%
times-frac83.3%
Applied egg-rr83.3%
associate-*r/79.3%
sqrt-div39.1%
associate-*l/39.1%
*-un-lft-identity39.1%
clear-num39.2%
un-div-inv39.2%
clear-num39.0%
sqrt-undiv79.4%
associate-/r*92.0%
frac-2neg92.0%
*-commutative92.0%
distribute-rgt-neg-out92.0%
sqrt-undiv99.3%
clear-num99.4%
sqrt-undiv92.4%
distribute-rgt-neg-out92.4%
*-commutative92.4%
frac-2neg92.4%
Applied egg-rr77.8%
associate-*r/92.4%
Applied egg-rr92.4%
if -4.9999999999999998e-236 < (*.f64 V l) < -0.0Initial program 46.3%
*-un-lft-identity46.3%
times-frac59.1%
Applied egg-rr59.1%
associate-*r/59.1%
sqrt-div45.2%
associate-*l/45.2%
*-un-lft-identity45.2%
clear-num45.4%
un-div-inv45.5%
clear-num45.3%
sqrt-undiv59.1%
associate-/r*46.3%
frac-2neg46.3%
*-commutative46.3%
distribute-rgt-neg-out46.3%
sqrt-undiv42.9%
clear-num43.0%
sqrt-undiv46.3%
distribute-rgt-neg-out46.3%
*-commutative46.3%
frac-2neg46.3%
Applied egg-rr60.8%
*-commutative60.8%
sqrt-prod45.4%
Applied egg-rr45.4%
if -0.0 < (*.f64 V l) < 1.0000000000000001e300Initial program 80.8%
*-un-lft-identity80.8%
times-frac66.7%
Applied egg-rr66.7%
associate-*r/76.7%
sqrt-div44.8%
associate-*l/44.8%
*-un-lft-identity44.8%
clear-num44.8%
un-div-inv44.8%
clear-num44.7%
sqrt-undiv76.7%
associate-/r*80.7%
frac-2neg80.7%
*-commutative80.7%
distribute-rgt-neg-out80.7%
sqrt-undiv0.0%
clear-num0.0%
sqrt-undiv80.5%
distribute-rgt-neg-out80.5%
*-commutative80.5%
frac-2neg80.5%
Applied egg-rr75.6%
clear-num73.9%
associate-*r/78.8%
*-commutative78.8%
sqrt-div96.8%
associate-/r*94.8%
*-commutative94.8%
clear-num95.8%
*-commutative95.8%
associate-/l*94.8%
*-commutative94.8%
Applied egg-rr94.8%
if 1.0000000000000001e300 < (*.f64 V l) Initial program 31.6%
associate-/r*76.7%
Simplified76.7%
Final simplification78.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
(if (<= (* V l) -5e+178)
t_0
(if (<= (* V l) -1e-84)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 1e+300)
(* (sqrt A) (/ c0 (sqrt (* V l))))
(* c0 (sqrt (/ (/ A V) l)))))))))assert(c0 < A && A < V && 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) <= -5e+178) {
tmp = t_0;
} else if ((V * l) <= -1e-84) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 1e+300) {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-5d+178)) then
tmp = t_0
else if ((v * l) <= (-1d-84)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 1d+300) then
tmp = sqrt(a) * (c0 / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / v) / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -5e+178) {
tmp = t_0;
} else if ((V * l) <= -1e-84) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 1e+300) {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -5e+178: tmp = t_0 elif (V * l) <= -1e-84: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 1e+300: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, 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) <= -5e+178) tmp = t_0; elseif (Float64(V * l) <= -1e-84) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 1e+300) tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -5e+178)
tmp = t_0;
elseif ((V * l) <= -1e-84)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 1e+300)
tmp = sqrt(A) * (c0 / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+178], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-84], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 1e+300], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+178}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-84}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+300}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999999e178 or -1e-84 < (*.f64 V l) < -0.0Initial program 58.7%
associate-/r*68.9%
sqrt-div42.0%
div-inv41.9%
Applied egg-rr41.9%
associate-*r/42.0%
*-rgt-identity42.0%
Simplified42.0%
if -4.9999999999999999e178 < (*.f64 V l) < -1e-84Initial program 92.5%
*-un-lft-identity92.5%
times-frac81.5%
Applied egg-rr81.5%
associate-*r/75.6%
sqrt-div38.1%
associate-*l/38.1%
*-un-lft-identity38.1%
clear-num38.2%
un-div-inv38.3%
clear-num38.1%
sqrt-undiv75.7%
associate-/r*92.5%
frac-2neg92.5%
*-commutative92.5%
distribute-rgt-neg-out92.5%
sqrt-undiv99.3%
clear-num99.5%
sqrt-undiv93.1%
distribute-rgt-neg-out93.1%
*-commutative93.1%
frac-2neg93.1%
Applied egg-rr74.8%
associate-*r/93.1%
Applied egg-rr93.1%
if -0.0 < (*.f64 V l) < 1.0000000000000001e300Initial program 80.8%
*-un-lft-identity80.8%
times-frac66.7%
Applied egg-rr66.7%
associate-*r/76.7%
sqrt-div44.8%
associate-*l/44.8%
*-un-lft-identity44.8%
clear-num44.8%
un-div-inv44.8%
clear-num44.7%
sqrt-undiv76.7%
associate-/r*80.7%
frac-2neg80.7%
*-commutative80.7%
distribute-rgt-neg-out80.7%
sqrt-undiv0.0%
clear-num0.0%
sqrt-undiv80.5%
distribute-rgt-neg-out80.5%
*-commutative80.5%
frac-2neg80.5%
Applied egg-rr75.6%
clear-num73.9%
associate-*r/78.8%
*-commutative78.8%
sqrt-div96.8%
associate-/r*94.8%
*-commutative94.8%
clear-num95.8%
*-commutative95.8%
associate-/l*94.8%
*-commutative94.8%
Applied egg-rr94.8%
if 1.0000000000000001e300 < (*.f64 V l) Initial program 31.6%
associate-/r*76.7%
Simplified76.7%
Final simplification74.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 (<= l 1.55e-305) (* c0 (sqrt (/ (/ A V) l))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= 1.55e-305) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (l <= 1.55d-305) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * (sqrt((a / v)) / sqrt(l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= 1.55e-305) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= 1.55e-305: tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= 1.55e-305) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= 1.55e-305)
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 * (sqrt((A / V)) / sqrt(l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[l, 1.55e-305], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.55 \cdot 10^{-305}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 1.5499999999999999e-305Initial program 71.7%
associate-/r*74.1%
Simplified74.1%
if 1.5499999999999999e-305 < l Initial program 74.2%
associate-/r*73.3%
sqrt-div85.3%
div-inv85.2%
Applied egg-rr85.2%
associate-*r/85.3%
*-rgt-identity85.3%
Simplified85.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 5e-324) (not (<= t_0 2e+273)))
(* c0 (sqrt (/ (/ A V) l)))
(* c0 (sqrt t_0)))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 5e-324) || !(t_0 <= 2e+273)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 5d-324) .or. (.not. (t_0 <= 2d+273))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 5e-324) || !(t_0 <= 2e+273)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 5e-324) or not (t_0 <= 2e+273): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.sqrt(t_0) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 5e-324) || !(t_0 <= 2e+273)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 5e-324) || ~((t_0 <= 2e+273)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 5e-324], N[Not[LessEqual[t$95$0, 2e+273]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-324} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+273}\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)) < 4.94066e-324 or 1.99999999999999989e273 < (/.f64 A (*.f64 V l)) Initial program 37.1%
associate-/r*51.5%
Simplified51.5%
if 4.94066e-324 < (/.f64 A (*.f64 V l)) < 1.99999999999999989e273Initial program 99.0%
Final simplification79.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 (/ A (* V l))))
(if (<= t_0 5e-324)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+273) (* c0 (sqrt t_0)) (/ c0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-324) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+273) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 5d-324) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+273) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-324) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+273) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 5e-324: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+273: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 5e-324) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+273) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 5e-324)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+273)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-324], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+273], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-324}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+273}:\\
\;\;\;\;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)) < 4.94066e-324Initial program 31.8%
associate-/r*53.8%
Simplified53.8%
if 4.94066e-324 < (/.f64 A (*.f64 V l)) < 1.99999999999999989e273Initial program 99.0%
if 1.99999999999999989e273 < (/.f64 A (*.f64 V l)) Initial program 41.3%
*-un-lft-identity41.3%
times-frac49.7%
Applied egg-rr49.7%
associate-*r/49.8%
sqrt-div44.3%
associate-*l/44.3%
*-un-lft-identity44.3%
clear-num44.5%
un-div-inv44.6%
clear-num44.4%
sqrt-undiv49.8%
associate-/r*41.3%
frac-2neg41.3%
*-commutative41.3%
distribute-rgt-neg-out41.3%
sqrt-undiv33.1%
clear-num33.1%
sqrt-undiv43.8%
distribute-rgt-neg-out43.8%
*-commutative43.8%
frac-2neg43.8%
Applied egg-rr51.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 5e-324)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 5e+266) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-324) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 5e+266) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 5d-324) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 5d+266) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-324) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 5e+266) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 5e-324: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 5e+266: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 5e-324) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 5e+266) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 5e-324)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 5e+266)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-324], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+266], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-324}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+266}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.94066e-324Initial program 31.8%
associate-/r*53.8%
Simplified53.8%
if 4.94066e-324 < (/.f64 A (*.f64 V l)) < 4.9999999999999999e266Initial program 99.0%
if 4.9999999999999999e266 < (/.f64 A (*.f64 V l)) Initial program 43.1%
*-un-lft-identity43.1%
times-frac51.3%
Applied egg-rr51.3%
associate-*r/51.3%
sqrt-div44.5%
associate-*l/44.5%
*-un-lft-identity44.5%
clear-num44.6%
un-div-inv44.7%
clear-num44.5%
sqrt-undiv51.3%
associate-/r*43.1%
frac-2neg43.1%
*-commutative43.1%
distribute-rgt-neg-out43.1%
sqrt-undiv35.2%
clear-num35.2%
sqrt-undiv45.6%
distribute-rgt-neg-out45.6%
*-commutative45.6%
frac-2neg45.6%
Applied egg-rr53.4%
associate-*r/45.6%
associate-*l/54.9%
*-commutative54.9%
Simplified54.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 5e-324)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+273) (* c0 (sqrt t_0)) (* c0 (sqrt (/ (/ A l) V)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-324) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+273) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 5d-324) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+273) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * sqrt(((a / l) / v))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-324) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+273) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 5e-324: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+273: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 5e-324) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+273) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 5e-324)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+273)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * sqrt(((A / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-324], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+273], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-324}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+273}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.94066e-324Initial program 31.8%
associate-/r*53.8%
Simplified53.8%
if 4.94066e-324 < (/.f64 A (*.f64 V l)) < 1.99999999999999989e273Initial program 99.0%
if 1.99999999999999989e273 < (/.f64 A (*.f64 V l)) Initial program 41.3%
*-un-lft-identity41.3%
times-frac49.7%
Applied egg-rr49.7%
Taylor expanded in V around 0 41.3%
associate-/l/49.7%
Simplified49.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 72.9%
herbie shell --seed 2024097
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))