
(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 (* (pow l -0.5) (sqrt (/ A V))))
(if (<= (* V l) -1e-314)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) 1e+266)
(* 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 * (pow(l, -0.5) * sqrt((A / V)));
} else if ((V * l) <= -1e-314) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= 1e+266) {
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.pow(l, -0.5) * Math.sqrt((A / V)));
} else if ((V * l) <= -1e-314) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if ((V * l) <= 1e+266) {
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.pow(l, -0.5) * math.sqrt((A / V))) elif (V * l) <= -1e-314: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 / math.sqrt((V * (l / A))) elif (V * l) <= 1e+266: 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((l ^ -0.5) * sqrt(Float64(A / V)))); 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(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 1e+266) 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 * ((l ^ -0.5) * sqrt((A / V)));
elseif ((V * l) <= -1e-314)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt((V * (l / A)));
elseif ((V * l) <= 1e+266)
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[Power[l, -0.5], $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $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[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+266], 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 \left({\ell}^{-0.5} \cdot \sqrt{\frac{A}{V}}\right)\\
\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:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+266}:\\
\;\;\;\;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 31.3%
associate-/r*63.3%
clear-num63.4%
sqrt-div63.4%
metadata-eval63.4%
div-inv63.4%
clear-num63.4%
Applied egg-rr63.4%
*-commutative63.4%
associate-*l/31.3%
associate-/l*63.4%
Simplified63.4%
add-sqr-sqrt63.3%
sqrt-unprod63.4%
frac-times63.3%
add-sqr-sqrt63.4%
*-commutative63.4%
frac-times63.4%
clear-num63.4%
div-inv63.3%
associate-*r*32.9%
*-commutative32.9%
pow1/232.9%
associate-*r*63.4%
unpow-prod-down34.0%
un-div-inv34.1%
pow1/234.1%
inv-pow34.1%
sqrt-pow134.2%
metadata-eval34.2%
Applied egg-rr34.2%
unpow1/234.2%
*-commutative34.2%
Simplified34.2%
if -inf.0 < (*.f64 V l) < -9.9999999996e-315Initial program 80.6%
frac-2neg80.6%
sqrt-div99.2%
distribute-rgt-neg-in99.2%
Applied egg-rr99.2%
distribute-rgt-neg-out99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
Simplified99.2%
if -9.9999999996e-315 < (*.f64 V l) < 0.0Initial program 33.6%
associate-/r*69.6%
clear-num69.6%
sqrt-div72.5%
metadata-eval72.5%
div-inv72.4%
clear-num72.4%
Applied egg-rr72.4%
*-commutative72.4%
associate-*l/33.6%
associate-/l*72.5%
Simplified72.5%
un-div-inv72.6%
associate-*r/33.6%
*-commutative33.6%
associate-/l*72.5%
Applied egg-rr72.5%
associate-*r/33.6%
*-commutative33.6%
associate-/l*72.6%
Simplified72.6%
if 0.0 < (*.f64 V l) < 1e266Initial program 78.0%
associate-/r*71.5%
clear-num70.2%
sqrt-div71.4%
metadata-eval71.4%
div-inv71.3%
clear-num71.4%
Applied egg-rr71.4%
*-commutative71.4%
associate-*l/78.9%
associate-/l*67.9%
Simplified67.9%
add-sqr-sqrt67.7%
sqrt-unprod66.4%
frac-times66.5%
add-sqr-sqrt66.6%
frac-times66.4%
clear-num66.4%
frac-times78.0%
*-un-lft-identity78.0%
associate-/r*71.5%
un-div-inv71.5%
associate-*r/78.0%
sqrt-unprod99.2%
*-commutative99.2%
Applied egg-rr99.4%
if 1e266 < (*.f64 V l) Initial program 51.0%
associate-/r*78.9%
Simplified78.9%
Final simplification89.3%
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) -4e+51)
(* c0 (* (pow l -0.5) (sqrt (/ A V))))
(if (<= (* V l) -2e-199)
(* c0 (sqrt (* A (/ (/ 1.0 l) V))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) 1e+266)
(* 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) <= -4e+51) {
tmp = c0 * (pow(l, -0.5) * sqrt((A / V)));
} else if ((V * l) <= -2e-199) {
tmp = c0 * sqrt((A * ((1.0 / l) / V)));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= 1e+266) {
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) <= (-4d+51)) then
tmp = c0 * ((l ** (-0.5d0)) * sqrt((a / v)))
else if ((v * l) <= (-2d-199)) then
tmp = c0 * sqrt((a * ((1.0d0 / l) / v)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / sqrt((v * (l / a)))
else if ((v * l) <= 1d+266) 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) <= -4e+51) {
tmp = c0 * (Math.pow(l, -0.5) * Math.sqrt((A / V)));
} else if ((V * l) <= -2e-199) {
tmp = c0 * Math.sqrt((A * ((1.0 / l) / V)));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if ((V * l) <= 1e+266) {
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) <= -4e+51: tmp = c0 * (math.pow(l, -0.5) * math.sqrt((A / V))) elif (V * l) <= -2e-199: tmp = c0 * math.sqrt((A * ((1.0 / l) / V))) elif (V * l) <= 0.0: tmp = c0 / math.sqrt((V * (l / A))) elif (V * l) <= 1e+266: 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) <= -4e+51) tmp = Float64(c0 * Float64((l ^ -0.5) * sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -2e-199) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / l) / V)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 1e+266) 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) <= -4e+51)
tmp = c0 * ((l ^ -0.5) * sqrt((A / V)));
elseif ((V * l) <= -2e-199)
tmp = c0 * sqrt((A * ((1.0 / l) / V)));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt((V * (l / A)));
elseif ((V * l) <= 1e+266)
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], -4e+51], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-199], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / l), $MachinePrecision] / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+266], 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 -4 \cdot 10^{+51}:\\
\;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{A}{V}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-199}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{\ell}}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+266}:\\
\;\;\;\;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) < -4e51Initial program 56.8%
associate-/r*62.5%
clear-num61.2%
sqrt-div61.1%
metadata-eval61.1%
div-inv60.4%
clear-num60.4%
Applied egg-rr60.4%
*-commutative60.4%
associate-*l/55.4%
associate-/l*65.1%
Simplified65.1%
add-sqr-sqrt64.8%
sqrt-unprod65.1%
frac-times64.9%
add-sqr-sqrt65.1%
*-commutative65.1%
frac-times65.1%
clear-num65.1%
div-inv65.1%
associate-*r*57.4%
*-commutative57.4%
pow1/257.4%
associate-*r*62.4%
unpow-prod-down34.9%
un-div-inv34.9%
pow1/234.9%
inv-pow34.9%
sqrt-pow134.9%
metadata-eval34.9%
Applied egg-rr34.9%
unpow1/234.9%
*-commutative34.9%
Simplified34.9%
if -4e51 < (*.f64 V l) < -1.99999999999999996e-199Initial program 97.2%
associate-/r*82.0%
div-inv82.1%
div-inv82.0%
associate-*l*97.2%
Applied egg-rr97.2%
associate-*l/97.3%
*-un-lft-identity97.3%
Applied egg-rr97.3%
if -1.99999999999999996e-199 < (*.f64 V l) < 0.0Initial program 47.6%
associate-/r*69.1%
clear-num69.1%
sqrt-div70.8%
metadata-eval70.8%
div-inv70.7%
clear-num70.7%
Applied egg-rr70.7%
*-commutative70.7%
associate-*l/49.0%
associate-/l*72.2%
Simplified72.2%
un-div-inv72.3%
associate-*r/49.0%
*-commutative49.0%
associate-/l*70.8%
Applied egg-rr70.8%
associate-*r/49.0%
*-commutative49.0%
associate-/l*72.3%
Simplified72.3%
if 0.0 < (*.f64 V l) < 1e266Initial program 78.0%
associate-/r*71.5%
clear-num70.2%
sqrt-div71.4%
metadata-eval71.4%
div-inv71.3%
clear-num71.4%
Applied egg-rr71.4%
*-commutative71.4%
associate-*l/78.9%
associate-/l*67.9%
Simplified67.9%
add-sqr-sqrt67.7%
sqrt-unprod66.4%
frac-times66.5%
add-sqr-sqrt66.6%
frac-times66.4%
clear-num66.4%
frac-times78.0%
*-un-lft-identity78.0%
associate-/r*71.5%
un-div-inv71.5%
associate-*r/78.0%
sqrt-unprod99.2%
*-commutative99.2%
Applied egg-rr99.4%
if 1e266 < (*.f64 V l) Initial program 51.0%
associate-/r*78.9%
Simplified78.9%
Final simplification77.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) (- INFINITY))
(* c0 (sqrt (/ (/ A l) V)))
(if (<= (* V l) -2e-199)
(* c0 (sqrt (* A (/ (/ 1.0 V) l))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) 1e+266)
(* c0 (/ (sqrt A) (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) <= -((double) INFINITY)) {
tmp = c0 * sqrt(((A / l) / V));
} else if ((V * l) <= -2e-199) {
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= 1e+266) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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 / l) / V));
} else if ((V * l) <= -2e-199) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if ((V * l) <= 1e+266) {
tmp = c0 * (Math.sqrt(A) / 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) <= -math.inf: tmp = c0 * math.sqrt(((A / l) / V)) elif (V * l) <= -2e-199: tmp = c0 * math.sqrt((A * ((1.0 / V) / l))) elif (V * l) <= 0.0: tmp = c0 / math.sqrt((V * (l / A))) elif (V * l) <= 1e+266: tmp = c0 * (math.sqrt(A) / 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) <= Float64(-Inf)) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (Float64(V * l) <= -2e-199) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 1e+266) tmp = Float64(c0 * Float64(sqrt(A) / 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) <= -Inf)
tmp = c0 * sqrt(((A / l) / V));
elseif ((V * l) <= -2e-199)
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt((V * (l / A)));
elseif ((V * l) <= 1e+266)
tmp = c0 * (sqrt(A) / 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], (-Infinity)], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-199], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+266], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / 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 -\infty:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-199}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+266}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 31.3%
*-un-lft-identity31.3%
times-frac63.4%
Applied egg-rr63.4%
associate-*l/63.4%
*-un-lft-identity63.4%
Applied egg-rr63.4%
if -inf.0 < (*.f64 V l) < -1.99999999999999996e-199Initial program 83.9%
clear-num82.8%
associate-/r/83.9%
associate-/r*83.9%
Applied egg-rr83.9%
if -1.99999999999999996e-199 < (*.f64 V l) < 0.0Initial program 47.6%
associate-/r*69.1%
clear-num69.1%
sqrt-div70.8%
metadata-eval70.8%
div-inv70.7%
clear-num70.7%
Applied egg-rr70.7%
*-commutative70.7%
associate-*l/49.0%
associate-/l*72.2%
Simplified72.2%
un-div-inv72.3%
associate-*r/49.0%
*-commutative49.0%
associate-/l*70.8%
Applied egg-rr70.8%
associate-*r/49.0%
*-commutative49.0%
associate-/l*72.3%
Simplified72.3%
if 0.0 < (*.f64 V l) < 1e266Initial program 78.0%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 1e266 < (*.f64 V l) Initial program 51.0%
associate-/r*78.9%
Simplified78.9%
Final simplification84.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -4e+51)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -2e-199)
(* c0 (sqrt (* A (/ (/ 1.0 l) V))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) 1e+266)
(* c0 (/ (sqrt A) (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) <= -4e+51) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -2e-199) {
tmp = c0 * sqrt((A * ((1.0 / l) / V)));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= 1e+266) {
tmp = c0 * (sqrt(A) / 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) <= (-4d+51)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-2d-199)) then
tmp = c0 * sqrt((a * ((1.0d0 / l) / v)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / sqrt((v * (l / a)))
else if ((v * l) <= 1d+266) then
tmp = c0 * (sqrt(a) / 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) <= -4e+51) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -2e-199) {
tmp = c0 * Math.sqrt((A * ((1.0 / l) / V)));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if ((V * l) <= 1e+266) {
tmp = c0 * (Math.sqrt(A) / 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) <= -4e+51: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -2e-199: tmp = c0 * math.sqrt((A * ((1.0 / l) / V))) elif (V * l) <= 0.0: tmp = c0 / math.sqrt((V * (l / A))) elif (V * l) <= 1e+266: tmp = c0 * (math.sqrt(A) / 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) <= -4e+51) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -2e-199) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / l) / V)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 1e+266) tmp = Float64(c0 * Float64(sqrt(A) / 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) <= -4e+51)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -2e-199)
tmp = c0 * sqrt((A * ((1.0 / l) / V)));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt((V * (l / A)));
elseif ((V * l) <= 1e+266)
tmp = c0 * (sqrt(A) / 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], -4e+51], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-199], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / l), $MachinePrecision] / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+266], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / 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 -4 \cdot 10^{+51}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-199}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{\ell}}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+266}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4e51Initial program 56.8%
associate-/r*62.5%
sqrt-div34.9%
div-inv34.9%
Applied egg-rr34.9%
associate-*r/34.9%
*-rgt-identity34.9%
Simplified34.9%
if -4e51 < (*.f64 V l) < -1.99999999999999996e-199Initial program 97.2%
associate-/r*82.0%
div-inv82.1%
div-inv82.0%
associate-*l*97.2%
Applied egg-rr97.2%
associate-*l/97.3%
*-un-lft-identity97.3%
Applied egg-rr97.3%
if -1.99999999999999996e-199 < (*.f64 V l) < 0.0Initial program 47.6%
associate-/r*69.1%
clear-num69.1%
sqrt-div70.8%
metadata-eval70.8%
div-inv70.7%
clear-num70.7%
Applied egg-rr70.7%
*-commutative70.7%
associate-*l/49.0%
associate-/l*72.2%
Simplified72.2%
un-div-inv72.3%
associate-*r/49.0%
*-commutative49.0%
associate-/l*70.8%
Applied egg-rr70.8%
associate-*r/49.0%
*-commutative49.0%
associate-/l*72.3%
Simplified72.3%
if 0.0 < (*.f64 V l) < 1e266Initial program 78.0%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 1e266 < (*.f64 V l) Initial program 51.0%
associate-/r*78.9%
Simplified78.9%
Final simplification77.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) -4e+51)
(* (sqrt (/ A V)) (/ c0 (sqrt l)))
(if (<= (* V l) -2e-199)
(* c0 (sqrt (* A (/ (/ 1.0 l) V))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) 1e+266)
(* c0 (/ (sqrt A) (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) <= -4e+51) {
tmp = sqrt((A / V)) * (c0 / sqrt(l));
} else if ((V * l) <= -2e-199) {
tmp = c0 * sqrt((A * ((1.0 / l) / V)));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= 1e+266) {
tmp = c0 * (sqrt(A) / 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) <= (-4d+51)) then
tmp = sqrt((a / v)) * (c0 / sqrt(l))
else if ((v * l) <= (-2d-199)) then
tmp = c0 * sqrt((a * ((1.0d0 / l) / v)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / sqrt((v * (l / a)))
else if ((v * l) <= 1d+266) then
tmp = c0 * (sqrt(a) / 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) <= -4e+51) {
tmp = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
} else if ((V * l) <= -2e-199) {
tmp = c0 * Math.sqrt((A * ((1.0 / l) / V)));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if ((V * l) <= 1e+266) {
tmp = c0 * (Math.sqrt(A) / 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) <= -4e+51: tmp = math.sqrt((A / V)) * (c0 / math.sqrt(l)) elif (V * l) <= -2e-199: tmp = c0 * math.sqrt((A * ((1.0 / l) / V))) elif (V * l) <= 0.0: tmp = c0 / math.sqrt((V * (l / A))) elif (V * l) <= 1e+266: tmp = c0 * (math.sqrt(A) / 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) <= -4e+51) tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l))); elseif (Float64(V * l) <= -2e-199) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / l) / V)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 1e+266) tmp = Float64(c0 * Float64(sqrt(A) / 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) <= -4e+51)
tmp = sqrt((A / V)) * (c0 / sqrt(l));
elseif ((V * l) <= -2e-199)
tmp = c0 * sqrt((A * ((1.0 / l) / V)));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt((V * (l / A)));
elseif ((V * l) <= 1e+266)
tmp = c0 * (sqrt(A) / 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], -4e+51], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-199], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / l), $MachinePrecision] / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+266], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / 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 -4 \cdot 10^{+51}:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-199}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{\ell}}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+266}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4e51Initial program 56.8%
associate-/r*62.5%
sqrt-div34.9%
associate-*r/34.9%
Applied egg-rr34.9%
*-commutative34.9%
associate-/l*34.9%
Simplified34.9%
if -4e51 < (*.f64 V l) < -1.99999999999999996e-199Initial program 97.2%
associate-/r*82.0%
div-inv82.1%
div-inv82.0%
associate-*l*97.2%
Applied egg-rr97.2%
associate-*l/97.3%
*-un-lft-identity97.3%
Applied egg-rr97.3%
if -1.99999999999999996e-199 < (*.f64 V l) < 0.0Initial program 47.6%
associate-/r*69.1%
clear-num69.1%
sqrt-div70.8%
metadata-eval70.8%
div-inv70.7%
clear-num70.7%
Applied egg-rr70.7%
*-commutative70.7%
associate-*l/49.0%
associate-/l*72.2%
Simplified72.2%
un-div-inv72.3%
associate-*r/49.0%
*-commutative49.0%
associate-/l*70.8%
Applied egg-rr70.8%
associate-*r/49.0%
*-commutative49.0%
associate-/l*72.3%
Simplified72.3%
if 0.0 < (*.f64 V l) < 1e266Initial program 78.0%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 1e266 < (*.f64 V l) Initial program 51.0%
associate-/r*78.9%
Simplified78.9%
Final simplification77.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) -4e+51)
(* c0 (* (pow l -0.5) (sqrt (/ A V))))
(if (<= (* V l) -2e-199)
(* c0 (sqrt (* A (/ (/ 1.0 l) V))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) 1e+266)
(* c0 (/ (sqrt A) (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) <= -4e+51) {
tmp = c0 * (pow(l, -0.5) * sqrt((A / V)));
} else if ((V * l) <= -2e-199) {
tmp = c0 * sqrt((A * ((1.0 / l) / V)));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= 1e+266) {
tmp = c0 * (sqrt(A) / 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) <= (-4d+51)) then
tmp = c0 * ((l ** (-0.5d0)) * sqrt((a / v)))
else if ((v * l) <= (-2d-199)) then
tmp = c0 * sqrt((a * ((1.0d0 / l) / v)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / sqrt((v * (l / a)))
else if ((v * l) <= 1d+266) then
tmp = c0 * (sqrt(a) / 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) <= -4e+51) {
tmp = c0 * (Math.pow(l, -0.5) * Math.sqrt((A / V)));
} else if ((V * l) <= -2e-199) {
tmp = c0 * Math.sqrt((A * ((1.0 / l) / V)));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if ((V * l) <= 1e+266) {
tmp = c0 * (Math.sqrt(A) / 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) <= -4e+51: tmp = c0 * (math.pow(l, -0.5) * math.sqrt((A / V))) elif (V * l) <= -2e-199: tmp = c0 * math.sqrt((A * ((1.0 / l) / V))) elif (V * l) <= 0.0: tmp = c0 / math.sqrt((V * (l / A))) elif (V * l) <= 1e+266: tmp = c0 * (math.sqrt(A) / 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) <= -4e+51) tmp = Float64(c0 * Float64((l ^ -0.5) * sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -2e-199) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / l) / V)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 1e+266) tmp = Float64(c0 * Float64(sqrt(A) / 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) <= -4e+51)
tmp = c0 * ((l ^ -0.5) * sqrt((A / V)));
elseif ((V * l) <= -2e-199)
tmp = c0 * sqrt((A * ((1.0 / l) / V)));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt((V * (l / A)));
elseif ((V * l) <= 1e+266)
tmp = c0 * (sqrt(A) / 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], -4e+51], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-199], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / l), $MachinePrecision] / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+266], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / 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 -4 \cdot 10^{+51}:\\
\;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{A}{V}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-199}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{\ell}}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+266}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4e51Initial program 56.8%
associate-/r*62.5%
clear-num61.2%
sqrt-div61.1%
metadata-eval61.1%
div-inv60.4%
clear-num60.4%
Applied egg-rr60.4%
*-commutative60.4%
associate-*l/55.4%
associate-/l*65.1%
Simplified65.1%
add-sqr-sqrt64.8%
sqrt-unprod65.1%
frac-times64.9%
add-sqr-sqrt65.1%
*-commutative65.1%
frac-times65.1%
clear-num65.1%
div-inv65.1%
associate-*r*57.4%
*-commutative57.4%
pow1/257.4%
associate-*r*62.4%
unpow-prod-down34.9%
un-div-inv34.9%
pow1/234.9%
inv-pow34.9%
sqrt-pow134.9%
metadata-eval34.9%
Applied egg-rr34.9%
unpow1/234.9%
*-commutative34.9%
Simplified34.9%
if -4e51 < (*.f64 V l) < -1.99999999999999996e-199Initial program 97.2%
associate-/r*82.0%
div-inv82.1%
div-inv82.0%
associate-*l*97.2%
Applied egg-rr97.2%
associate-*l/97.3%
*-un-lft-identity97.3%
Applied egg-rr97.3%
if -1.99999999999999996e-199 < (*.f64 V l) < 0.0Initial program 47.6%
associate-/r*69.1%
clear-num69.1%
sqrt-div70.8%
metadata-eval70.8%
div-inv70.7%
clear-num70.7%
Applied egg-rr70.7%
*-commutative70.7%
associate-*l/49.0%
associate-/l*72.2%
Simplified72.2%
un-div-inv72.3%
associate-*r/49.0%
*-commutative49.0%
associate-/l*70.8%
Applied egg-rr70.8%
associate-*r/49.0%
*-commutative49.0%
associate-/l*72.3%
Simplified72.3%
if 0.0 < (*.f64 V l) < 1e266Initial program 78.0%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 1e266 < (*.f64 V l) Initial program 51.0%
associate-/r*78.9%
Simplified78.9%
Final simplification77.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 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 2e+281)
(* c0 (sqrt (* A (/ (/ 1.0 l) V))))
(/ 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 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 2e+281) {
tmp = c0 * sqrt((A * ((1.0 / l) / V)));
} 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 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 2d+281) then
tmp = c0 * sqrt((a * ((1.0d0 / l) / v)))
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 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 2e+281) {
tmp = c0 * Math.sqrt((A * ((1.0 / l) / V)));
} 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 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 2e+281: tmp = c0 * math.sqrt((A * ((1.0 / l) / V))) 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 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 2e+281) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / l) / V)))); 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 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 2e+281)
tmp = c0 * sqrt((A * ((1.0 / l) / V)));
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, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+281], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / l), $MachinePrecision] / V), $MachinePrecision]), $MachinePrecision]], $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 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+281}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 34.6%
*-un-lft-identity34.6%
times-frac53.2%
Applied egg-rr53.2%
associate-*l/53.3%
*-un-lft-identity53.3%
Applied egg-rr53.3%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e281Initial program 98.9%
associate-/r*87.1%
div-inv87.1%
div-inv87.1%
associate-*l*98.9%
Applied egg-rr98.9%
associate-*l/98.9%
*-un-lft-identity98.9%
Applied egg-rr98.9%
if 2.0000000000000001e281 < (/.f64 A (*.f64 V l)) Initial program 40.1%
associate-/r*56.9%
clear-num56.9%
sqrt-div60.0%
metadata-eval60.0%
div-inv60.0%
clear-num60.0%
Applied egg-rr60.0%
*-commutative60.0%
associate-*l/44.2%
associate-/l*61.5%
Simplified61.5%
un-div-inv61.5%
associate-*r/44.2%
*-commutative44.2%
associate-/l*60.0%
Applied egg-rr60.0%
associate-*r/44.2%
*-commutative44.2%
associate-/l*61.5%
Simplified61.5%
Final simplification78.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 2e+281)
(* c0 (sqrt (* A (/ (/ 1.0 V) l))))
(/ 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 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 2e+281) {
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
} 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 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 2d+281) then
tmp = c0 * sqrt((a * ((1.0d0 / v) / l)))
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 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 2e+281) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) / l)));
} 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 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 2e+281: tmp = c0 * math.sqrt((A * ((1.0 / V) / l))) 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 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 2e+281) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); 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 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 2e+281)
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
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, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+281], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $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 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+281}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 34.6%
*-un-lft-identity34.6%
times-frac53.2%
Applied egg-rr53.2%
associate-*l/53.3%
*-un-lft-identity53.3%
Applied egg-rr53.3%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e281Initial program 98.9%
clear-num97.4%
associate-/r/98.9%
associate-/r*98.9%
Applied egg-rr98.9%
if 2.0000000000000001e281 < (/.f64 A (*.f64 V l)) Initial program 40.1%
associate-/r*56.9%
clear-num56.9%
sqrt-div60.0%
metadata-eval60.0%
div-inv60.0%
clear-num60.0%
Applied egg-rr60.0%
*-commutative60.0%
associate-*l/44.2%
associate-/l*61.5%
Simplified61.5%
un-div-inv61.5%
associate-*r/44.2%
*-commutative44.2%
associate-/l*60.0%
Applied egg-rr60.0%
associate-*r/44.2%
*-commutative44.2%
associate-/l*61.5%
Simplified61.5%
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
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 1.2e+275)))
(* 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 <= 0.0) || !(t_0 <= 1.2e+275)) {
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 <= 0.0d0) .or. (.not. (t_0 <= 1.2d+275))) 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 <= 0.0) || !(t_0 <= 1.2e+275)) {
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 <= 0.0) or not (t_0 <= 1.2e+275): 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 <= 0.0) || !(t_0 <= 1.2e+275)) 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 <= 0.0) || ~((t_0 <= 1.2e+275)))
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, 0.0], N[Not[LessEqual[t$95$0, 1.2e+275]], $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 0 \lor \neg \left(t\_0 \leq 1.2 \cdot 10^{+275}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 1.19999999999999998e275 < (/.f64 A (*.f64 V l)) Initial program 38.4%
associate-/r*55.1%
Simplified55.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.19999999999999998e275Initial program 98.8%
Final simplification76.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 1.2e+275) (* c0 (sqrt t_0)) (* 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 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 1.2e+275) {
tmp = c0 * sqrt(t_0);
} 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 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 1.2d+275) then
tmp = c0 * sqrt(t_0)
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 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 1.2e+275) {
tmp = c0 * Math.sqrt(t_0);
} 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 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 1.2e+275: tmp = c0 * math.sqrt(t_0) 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(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 1.2e+275) tmp = Float64(c0 * sqrt(t_0)); 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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 1.2e+275)
tmp = c0 * sqrt(t_0);
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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.2e+275], N[(c0 * N[Sqrt[t$95$0], $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 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 1.2 \cdot 10^{+275}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 34.6%
*-un-lft-identity34.6%
times-frac53.2%
Applied egg-rr53.2%
associate-*l/53.3%
*-un-lft-identity53.3%
Applied egg-rr53.3%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.19999999999999998e275Initial program 98.8%
if 1.19999999999999998e275 < (/.f64 A (*.f64 V l)) Initial program 41.8%
associate-/r*56.8%
Simplified56.8%
Final simplification76.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 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 2e+281) (* 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 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 2e+281) {
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 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 2d+281) 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 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 2e+281) {
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 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 2e+281: 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 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 2e+281) 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 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 2e+281)
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, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+281], 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 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+281}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 34.6%
*-un-lft-identity34.6%
times-frac53.2%
Applied egg-rr53.2%
associate-*l/53.3%
*-un-lft-identity53.3%
Applied egg-rr53.3%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e281Initial program 98.9%
if 2.0000000000000001e281 < (/.f64 A (*.f64 V l)) Initial program 40.1%
associate-/r*56.9%
clear-num56.9%
sqrt-div60.0%
metadata-eval60.0%
div-inv60.0%
clear-num60.0%
Applied egg-rr60.0%
*-commutative60.0%
associate-*l/44.2%
associate-/l*61.5%
Simplified61.5%
un-div-inv61.5%
associate-*r/44.2%
*-commutative44.2%
associate-/l*60.0%
Applied egg-rr60.0%
associate-*r/44.2%
*-commutative44.2%
associate-/l*61.5%
Simplified61.5%
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 (* 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 67.9%
Final simplification67.9%
herbie shell --seed 2024039
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))