
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -1e+208)
(/ c0 (/ (sqrt (- V)) (sqrt (/ A (- l)))))
(if (<= (* V l) -2e-304)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-298)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) 1e+299)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (pow (* V (/ l A)) -0.5)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+208) {
tmp = c0 / (sqrt(-V) / sqrt((A / -l)));
} else if ((V * l) <= -2e-304) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-298) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((V * l) <= 1e+299) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-1d+208)) then
tmp = c0 / (sqrt(-v) / sqrt((a / -l)))
else if ((v * l) <= (-2d-304)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 5d-298) then
tmp = (c0 / sqrt(l)) * sqrt((a / v))
else if ((v * l) <= 1d+299) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+208) {
tmp = c0 / (Math.sqrt(-V) / Math.sqrt((A / -l)));
} else if ((V * l) <= -2e-304) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-298) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((V * l) <= 1e+299) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+208: tmp = c0 / (math.sqrt(-V) / math.sqrt((A / -l))) elif (V * l) <= -2e-304: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-298: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) elif (V * l) <= 1e+299: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.pow((V * (l / A)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e+208) tmp = Float64(c0 / Float64(sqrt(Float64(-V)) / sqrt(Float64(A / Float64(-l))))); elseif (Float64(V * l) <= -2e-304) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-298) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= 1e+299) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -1e+208)
tmp = c0 / (sqrt(-V) / sqrt((A / -l)));
elseif ((V * l) <= -2e-304)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-298)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
elseif ((V * l) <= 1e+299)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 * ((V * (l / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+208], N[(c0 / N[(N[Sqrt[(-V)], $MachinePrecision] / N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-304], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-298], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+299], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+208}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{-V}}{\sqrt{\frac{A}{-\ell}}}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-304}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-298}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+299}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.9999999999999998e207Initial program 52.1%
associate-/r*70.6%
clear-num67.0%
sqrt-div67.0%
metadata-eval67.0%
div-inv67.0%
clear-num67.0%
Applied egg-rr67.0%
*-commutative67.0%
associate-*l/52.1%
associate-/l*67.1%
Simplified67.1%
un-div-inv67.2%
clear-num66.9%
Applied egg-rr66.9%
associate-/r/67.1%
associate-*l/67.2%
*-lft-identity67.2%
associate-*r/52.2%
associate-*l/67.0%
associate-/r/67.1%
Simplified67.1%
frac-2neg67.1%
sqrt-div50.1%
distribute-neg-frac250.1%
Applied egg-rr50.1%
if -9.9999999999999998e207 < (*.f64 V l) < -1.99999999999999994e-304Initial program 85.5%
frac-2neg85.5%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if -1.99999999999999994e-304 < (*.f64 V l) < 5.0000000000000002e-298Initial program 46.1%
add-sqr-sqrt31.8%
sqrt-unprod28.0%
*-commutative28.0%
*-commutative28.0%
swap-sqr27.6%
add-sqr-sqrt27.6%
pow227.6%
Applied egg-rr27.6%
sqrt-prod31.7%
div-inv31.7%
associate-/r*31.7%
*-commutative31.7%
*-commutative31.7%
associate-*r/44.6%
div-inv44.7%
frac-2neg44.7%
associate-/r*31.7%
*-commutative31.7%
sqrt-undiv17.9%
sqrt-pow125.2%
metadata-eval25.2%
pow125.2%
*-commutative25.2%
associate-*r/25.1%
sqrt-prod30.3%
times-frac30.3%
sqrt-div60.6%
Applied egg-rr60.6%
if 5.0000000000000002e-298 < (*.f64 V l) < 1.0000000000000001e299Initial program 85.4%
associate-/r*78.2%
clear-num77.3%
sqrt-div77.3%
metadata-eval77.3%
div-inv76.4%
clear-num76.7%
Applied egg-rr76.7%
*-commutative76.7%
associate-*l/84.9%
associate-/l*75.2%
Simplified75.2%
un-div-inv75.3%
Applied egg-rr75.3%
associate-*r/85.1%
frac-2neg85.1%
*-commutative85.1%
distribute-rgt-neg-out85.1%
sqrt-undiv0.0%
div-inv0.0%
*-commutative0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
sqrt-unprod63.2%
sqr-neg63.2%
sqrt-unprod99.3%
add-sqr-sqrt99.3%
Applied egg-rr99.3%
associate-*r/99.5%
*-rgt-identity99.5%
Simplified99.5%
if 1.0000000000000001e299 < (*.f64 V l) Initial program 12.2%
associate-/r*65.0%
clear-num64.9%
sqrt-div64.9%
metadata-eval64.9%
div-inv64.9%
clear-num64.9%
Applied egg-rr64.9%
*-commutative64.9%
associate-*l/12.2%
associate-/l*64.9%
Simplified64.9%
inv-pow64.9%
sqrt-pow265.0%
metadata-eval65.0%
Applied egg-rr65.0%
Final simplification88.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 (* c0 (sqrt (/ A (* V l))))))
(if (or (<= t_0 5e-298) (not (<= t_0 2e+231)))
(* c0 (sqrt (/ (/ A V) l)))
t_0)))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 5e-298) || !(t_0 <= 2e+231)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if ((t_0 <= 5d-298) .or. (.not. (t_0 <= 2d+231))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 5e-298) || !(t_0 <= 2e+231)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 5e-298) or not (t_0 <= 2e+231): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 5e-298) || !(t_0 <= 2e+231)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 5e-298) || ~((t_0 <= 2e+231)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 5e-298], N[Not[LessEqual[t$95$0, 2e+231]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-298} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+231}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000002e-298 or 2.0000000000000001e231 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 66.8%
associate-/r*73.4%
Simplified73.4%
if 5.0000000000000002e-298 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000001e231Initial program 99.2%
Final simplification79.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 5e-298)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 5e+304) 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 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 5e-298) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 5e+304) {
tmp = 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 = c0 * sqrt((a / (v * l)))
if (t_0 <= 5d-298) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 5d+304) then
tmp = 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 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 5e-298) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 5e+304) {
tmp = 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 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 5e-298: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 5e+304: tmp = 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(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 5e-298) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 5e+304) tmp = 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 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 5e-298)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 5e+304)
tmp = 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[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-298], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+304], t$95$0, 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 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-298}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+304}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000002e-298Initial program 66.9%
associate-/r*72.8%
Simplified72.8%
if 5.0000000000000002e-298 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999997e304Initial program 99.2%
if 4.9999999999999997e304 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 60.1%
associate-/r*73.5%
clear-num73.4%
sqrt-div76.5%
metadata-eval76.5%
div-inv76.5%
clear-num76.5%
Applied egg-rr76.5%
*-commutative76.5%
associate-*l/61.3%
associate-/l*76.0%
Simplified76.0%
un-div-inv76.0%
Applied egg-rr76.0%
Final simplification80.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 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 5e-298)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+231) 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 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 5e-298) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+231) {
tmp = 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 = c0 * sqrt((a / (v * l)))
if (t_0 <= 5d-298) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+231) then
tmp = 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 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 5e-298) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+231) {
tmp = 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 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 5e-298: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+231: tmp = 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(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 5e-298) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+231) tmp = 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 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 5e-298)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+231)
tmp = 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[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-298], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+231], t$95$0, 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 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-298}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+231}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000002e-298Initial program 66.9%
associate-/r*72.8%
Simplified72.8%
if 5.0000000000000002e-298 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000001e231Initial program 99.2%
if 2.0000000000000001e231 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 66.4%
associate-/r*75.7%
clear-num75.6%
sqrt-div78.2%
metadata-eval78.2%
div-inv78.2%
clear-num78.2%
Applied egg-rr78.2%
*-commutative78.2%
associate-*l/67.5%
associate-/l*78.6%
Simplified78.6%
un-div-inv78.7%
clear-num78.6%
Applied egg-rr78.6%
associate-/r/78.6%
associate-*l/78.7%
*-lft-identity78.7%
associate-*r/67.5%
associate-*l/78.3%
associate-/r/77.7%
Simplified77.7%
associate-/r/78.3%
Applied egg-rr78.3%
Final simplification80.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2e+62)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= (* V l) -5e-170)
(/ c0 (sqrt (/ (* V l) A)))
(if (or (<= (* V l) 0.0) (not (<= (* V l) 1e+299)))
(* c0 (pow (* V (/ l A)) -0.5))
(* c0 (/ (sqrt A) (sqrt (* V l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+62) {
tmp = c0 * sqrt(((A / l) / V));
} else if ((V * l) <= -5e-170) {
tmp = c0 / sqrt(((V * l) / A));
} else if (((V * l) <= 0.0) || !((V * l) <= 1e+299)) {
tmp = c0 * pow((V * (l / A)), -0.5);
} else {
tmp = c0 * (sqrt(A) / sqrt((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) <= (-2d+62)) then
tmp = c0 * sqrt(((a / l) / v))
else if ((v * l) <= (-5d-170)) then
tmp = c0 / sqrt(((v * l) / a))
else if (((v * l) <= 0.0d0) .or. (.not. ((v * l) <= 1d+299))) then
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
else
tmp = c0 * (sqrt(a) / sqrt((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) <= -2e+62) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if ((V * l) <= -5e-170) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if (((V * l) <= 0.0) || !((V * l) <= 1e+299)) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -2e+62: tmp = c0 * math.sqrt(((A / l) / V)) elif (V * l) <= -5e-170: tmp = c0 / math.sqrt(((V * l) / A)) elif ((V * l) <= 0.0) or not ((V * l) <= 1e+299): tmp = c0 * math.pow((V * (l / A)), -0.5) else: tmp = c0 * (math.sqrt(A) / math.sqrt((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) <= -2e+62) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (Float64(V * l) <= -5e-170) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 1e+299)) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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) <= -2e+62)
tmp = c0 * sqrt(((A / l) / V));
elseif ((V * l) <= -5e-170)
tmp = c0 / sqrt(((V * l) / A));
elseif (((V * l) <= 0.0) || ~(((V * l) <= 1e+299)))
tmp = c0 * ((V * (l / A)) ^ -0.5);
else
tmp = c0 * (sqrt(A) / sqrt((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], -2e+62], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-170], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 1e+299]], $MachinePrecision]], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $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 -2 \cdot 10^{+62}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-170}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 10^{+299}\right):\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000007e62Initial program 66.3%
clear-num66.4%
associate-/r/66.3%
associate-/r*66.3%
Applied egg-rr66.3%
*-commutative66.3%
associate-/r*66.3%
div-inv66.3%
*-commutative66.3%
associate-/r*77.3%
Applied egg-rr77.3%
if -2.00000000000000007e62 < (*.f64 V l) < -5.0000000000000001e-170Initial program 88.2%
clear-num88.2%
associate-/r/88.3%
associate-/r*88.3%
Applied egg-rr88.3%
*-commutative88.3%
associate-/r*88.3%
div-inv88.2%
*-commutative88.2%
associate-/r*75.6%
Applied egg-rr75.6%
clear-num75.6%
sqrt-div75.8%
metadata-eval75.8%
div-inv75.2%
clear-num76.1%
div-inv76.2%
*-commutative76.2%
associate-*l/90.3%
Applied egg-rr90.3%
if -5.0000000000000001e-170 < (*.f64 V l) < -0.0 or 1.0000000000000001e299 < (*.f64 V l) Initial program 46.1%
associate-/r*72.2%
clear-num72.1%
sqrt-div73.8%
metadata-eval73.8%
div-inv73.8%
clear-num73.8%
Applied egg-rr73.8%
*-commutative73.8%
associate-*l/46.0%
associate-/l*73.8%
Simplified73.8%
inv-pow73.8%
sqrt-pow273.9%
metadata-eval73.9%
Applied egg-rr73.9%
if -0.0 < (*.f64 V l) < 1.0000000000000001e299Initial program 85.6%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
Final simplification88.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
(if (<= (* V l) -5e+95)
t_0
(if (<= (* V l) -2e-69)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 5e-298)
t_0
(if (<= (* V l) 1e+299)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (pow (* V (/ l A)) -0.5))))))))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+95) {
tmp = t_0;
} else if ((V * l) <= -2e-69) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 5e-298) {
tmp = t_0;
} else if ((V * l) <= 1e+299) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-5d+95)) then
tmp = t_0
else if ((v * l) <= (-2d-69)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 5d-298) then
tmp = t_0
else if ((v * l) <= 1d+299) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -5e+95) {
tmp = t_0;
} else if ((V * l) <= -2e-69) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 5e-298) {
tmp = t_0;
} else if ((V * l) <= 1e+299) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
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+95: tmp = t_0 elif (V * l) <= -2e-69: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 5e-298: tmp = t_0 elif (V * l) <= 1e+299: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.pow((V * (l / A)), -0.5) 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+95) tmp = t_0; elseif (Float64(V * l) <= -2e-69) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 5e-298) tmp = t_0; elseif (Float64(V * l) <= 1e+299) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); 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+95)
tmp = t_0;
elseif ((V * l) <= -2e-69)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 5e-298)
tmp = t_0;
elseif ((V * l) <= 1e+299)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * ((V * (l / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := 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+95], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-69], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-298], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 1e+299], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $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^{+95}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-69}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-298}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+299}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000025e95 or -1.9999999999999999e-69 < (*.f64 V l) < 5.0000000000000002e-298Initial program 65.5%
associate-/r*75.2%
sqrt-div47.2%
div-inv47.3%
Applied egg-rr47.3%
associate-*r/47.2%
*-rgt-identity47.2%
Simplified47.2%
if -5.00000000000000025e95 < (*.f64 V l) < -1.9999999999999999e-69Initial program 93.4%
clear-num93.3%
associate-/r/93.4%
associate-/r*93.4%
Applied egg-rr93.4%
*-commutative93.4%
associate-/r*93.4%
div-inv93.4%
*-commutative93.4%
associate-/r*73.0%
Applied egg-rr73.0%
clear-num73.0%
sqrt-div73.0%
metadata-eval73.0%
div-inv72.0%
clear-num73.4%
div-inv73.5%
*-commutative73.5%
associate-*l/95.1%
Applied egg-rr95.1%
if 5.0000000000000002e-298 < (*.f64 V l) < 1.0000000000000001e299Initial program 85.4%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 1.0000000000000001e299 < (*.f64 V l) Initial program 12.2%
associate-/r*65.0%
clear-num64.9%
sqrt-div64.9%
metadata-eval64.9%
div-inv64.9%
clear-num64.9%
Applied egg-rr64.9%
*-commutative64.9%
associate-*l/12.2%
associate-/l*64.9%
Simplified64.9%
inv-pow64.9%
sqrt-pow265.0%
metadata-eval65.0%
Applied egg-rr65.0%
Final simplification74.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (/ A V))))
(if (<= (* V l) -5e+165)
(* (/ c0 (sqrt l)) t_0)
(if (<= (* V l) -2e-69)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 5e-298)
(* c0 (/ t_0 (sqrt l)))
(if (<= (* V l) 1e+299)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (pow (* V (/ l A)) -0.5))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -5e+165) {
tmp = (c0 / sqrt(l)) * t_0;
} else if ((V * l) <= -2e-69) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 5e-298) {
tmp = c0 * (t_0 / sqrt(l));
} else if ((V * l) <= 1e+299) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-5d+165)) then
tmp = (c0 / sqrt(l)) * t_0
else if ((v * l) <= (-2d-69)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 5d-298) then
tmp = c0 * (t_0 / sqrt(l))
else if ((v * l) <= 1d+299) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -5e+165) {
tmp = (c0 / Math.sqrt(l)) * t_0;
} else if ((V * l) <= -2e-69) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 5e-298) {
tmp = c0 * (t_0 / Math.sqrt(l));
} else if ((V * l) <= 1e+299) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -5e+165: tmp = (c0 / math.sqrt(l)) * t_0 elif (V * l) <= -2e-69: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 5e-298: tmp = c0 * (t_0 / math.sqrt(l)) elif (V * l) <= 1e+299: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.pow((V * (l / A)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -5e+165) tmp = Float64(Float64(c0 / sqrt(l)) * t_0); elseif (Float64(V * l) <= -2e-69) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 5e-298) tmp = Float64(c0 * Float64(t_0 / sqrt(l))); elseif (Float64(V * l) <= 1e+299) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -5e+165)
tmp = (c0 / sqrt(l)) * t_0;
elseif ((V * l) <= -2e-69)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 5e-298)
tmp = c0 * (t_0 / sqrt(l));
elseif ((V * l) <= 1e+299)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * ((V * (l / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+165], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-69], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-298], N[(c0 * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+299], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+165}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-69}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-298}:\\
\;\;\;\;c0 \cdot \frac{t\_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+299}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999997e165Initial program 54.7%
add-sqr-sqrt39.0%
sqrt-unprod39.7%
*-commutative39.7%
*-commutative39.7%
swap-sqr34.1%
add-sqr-sqrt34.1%
pow234.1%
Applied egg-rr34.1%
sqrt-prod34.0%
div-inv34.0%
associate-/r*34.0%
*-commutative34.0%
*-commutative34.0%
associate-*r/34.1%
div-inv34.1%
frac-2neg34.1%
associate-/r*34.0%
*-commutative34.0%
sqrt-undiv36.4%
sqrt-pow162.0%
metadata-eval62.0%
pow162.0%
*-commutative62.0%
associate-*r/61.7%
sqrt-prod55.2%
times-frac63.0%
sqrt-div56.0%
Applied egg-rr56.0%
if -4.9999999999999997e165 < (*.f64 V l) < -1.9999999999999999e-69Initial program 95.1%
clear-num95.0%
associate-/r/95.1%
associate-/r*95.1%
Applied egg-rr95.1%
*-commutative95.1%
associate-/r*95.1%
div-inv95.1%
*-commutative95.1%
associate-/r*80.0%
Applied egg-rr80.0%
clear-num80.0%
sqrt-div80.0%
metadata-eval80.0%
div-inv79.3%
clear-num80.3%
div-inv80.3%
*-commutative80.3%
associate-*l/96.3%
Applied egg-rr96.3%
if -1.9999999999999999e-69 < (*.f64 V l) < 5.0000000000000002e-298Initial program 66.1%
associate-/r*73.9%
sqrt-div45.4%
div-inv45.5%
Applied egg-rr45.5%
associate-*r/45.4%
*-rgt-identity45.4%
Simplified45.4%
if 5.0000000000000002e-298 < (*.f64 V l) < 1.0000000000000001e299Initial program 85.4%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 1.0000000000000001e299 < (*.f64 V l) Initial program 12.2%
associate-/r*65.0%
clear-num64.9%
sqrt-div64.9%
metadata-eval64.9%
div-inv64.9%
clear-num64.9%
Applied egg-rr64.9%
*-commutative64.9%
associate-*l/12.2%
associate-/l*64.9%
Simplified64.9%
inv-pow64.9%
sqrt-pow265.0%
metadata-eval65.0%
Applied egg-rr65.0%
Final simplification77.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 (sqrt (/ A V))))
(if (<= (* V l) -5e+165)
(* (/ c0 (sqrt l)) t_0)
(if (<= (* V l) -2e-69)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 5e-298)
(* c0 (/ t_0 (sqrt l)))
(if (<= (* V l) 1e+299)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (pow (* V (/ l A)) -0.5))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -5e+165) {
tmp = (c0 / sqrt(l)) * t_0;
} else if ((V * l) <= -2e-69) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 5e-298) {
tmp = c0 * (t_0 / sqrt(l));
} else if ((V * l) <= 1e+299) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-5d+165)) then
tmp = (c0 / sqrt(l)) * t_0
else if ((v * l) <= (-2d-69)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 5d-298) then
tmp = c0 * (t_0 / sqrt(l))
else if ((v * l) <= 1d+299) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -5e+165) {
tmp = (c0 / Math.sqrt(l)) * t_0;
} else if ((V * l) <= -2e-69) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 5e-298) {
tmp = c0 * (t_0 / Math.sqrt(l));
} else if ((V * l) <= 1e+299) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -5e+165: tmp = (c0 / math.sqrt(l)) * t_0 elif (V * l) <= -2e-69: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 5e-298: tmp = c0 * (t_0 / math.sqrt(l)) elif (V * l) <= 1e+299: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.pow((V * (l / A)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -5e+165) tmp = Float64(Float64(c0 / sqrt(l)) * t_0); elseif (Float64(V * l) <= -2e-69) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 5e-298) tmp = Float64(c0 * Float64(t_0 / sqrt(l))); elseif (Float64(V * l) <= 1e+299) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -5e+165)
tmp = (c0 / sqrt(l)) * t_0;
elseif ((V * l) <= -2e-69)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 5e-298)
tmp = c0 * (t_0 / sqrt(l));
elseif ((V * l) <= 1e+299)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 * ((V * (l / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+165], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-69], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-298], N[(c0 * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+299], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+165}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-69}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-298}:\\
\;\;\;\;c0 \cdot \frac{t\_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+299}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999997e165Initial program 54.7%
add-sqr-sqrt39.0%
sqrt-unprod39.7%
*-commutative39.7%
*-commutative39.7%
swap-sqr34.1%
add-sqr-sqrt34.1%
pow234.1%
Applied egg-rr34.1%
sqrt-prod34.0%
div-inv34.0%
associate-/r*34.0%
*-commutative34.0%
*-commutative34.0%
associate-*r/34.1%
div-inv34.1%
frac-2neg34.1%
associate-/r*34.0%
*-commutative34.0%
sqrt-undiv36.4%
sqrt-pow162.0%
metadata-eval62.0%
pow162.0%
*-commutative62.0%
associate-*r/61.7%
sqrt-prod55.2%
times-frac63.0%
sqrt-div56.0%
Applied egg-rr56.0%
if -4.9999999999999997e165 < (*.f64 V l) < -1.9999999999999999e-69Initial program 95.1%
clear-num95.0%
associate-/r/95.1%
associate-/r*95.1%
Applied egg-rr95.1%
*-commutative95.1%
associate-/r*95.1%
div-inv95.1%
*-commutative95.1%
associate-/r*80.0%
Applied egg-rr80.0%
clear-num80.0%
sqrt-div80.0%
metadata-eval80.0%
div-inv79.3%
clear-num80.3%
div-inv80.3%
*-commutative80.3%
associate-*l/96.3%
Applied egg-rr96.3%
if -1.9999999999999999e-69 < (*.f64 V l) < 5.0000000000000002e-298Initial program 66.1%
associate-/r*73.9%
sqrt-div45.4%
div-inv45.5%
Applied egg-rr45.5%
associate-*r/45.4%
*-rgt-identity45.4%
Simplified45.4%
if 5.0000000000000002e-298 < (*.f64 V l) < 1.0000000000000001e299Initial program 85.4%
associate-/r*78.2%
clear-num77.3%
sqrt-div77.3%
metadata-eval77.3%
div-inv76.4%
clear-num76.7%
Applied egg-rr76.7%
*-commutative76.7%
associate-*l/84.9%
associate-/l*75.2%
Simplified75.2%
un-div-inv75.3%
Applied egg-rr75.3%
associate-*r/85.1%
frac-2neg85.1%
*-commutative85.1%
distribute-rgt-neg-out85.1%
sqrt-undiv0.0%
div-inv0.0%
*-commutative0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
sqrt-unprod63.2%
sqr-neg63.2%
sqrt-unprod99.3%
add-sqr-sqrt99.3%
Applied egg-rr99.3%
associate-*r/99.5%
*-rgt-identity99.5%
Simplified99.5%
if 1.0000000000000001e299 < (*.f64 V l) Initial program 12.2%
associate-/r*65.0%
clear-num64.9%
sqrt-div64.9%
metadata-eval64.9%
div-inv64.9%
clear-num64.9%
Applied egg-rr64.9%
*-commutative64.9%
associate-*l/12.2%
associate-/l*64.9%
Simplified64.9%
inv-pow64.9%
sqrt-pow265.0%
metadata-eval65.0%
Applied egg-rr65.0%
Final simplification77.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 (* (/ c0 (sqrt l)) (sqrt (/ A V)))))
(if (<= (* V l) (- INFINITY))
t_0
(if (<= (* V l) -2e-304)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-298)
t_0
(if (<= (* V l) 1e+299)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (pow (* V (/ l A)) -0.5))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = (c0 / sqrt(l)) * sqrt((A / V));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((V * l) <= -2e-304) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-298) {
tmp = t_0;
} else if ((V * l) <= 1e+299) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
return tmp;
}
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(l)) * Math.sqrt((A / V));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if ((V * l) <= -2e-304) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-298) {
tmp = t_0;
} else if ((V * l) <= 1e+299) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = (c0 / math.sqrt(l)) * math.sqrt((A / V)) tmp = 0 if (V * l) <= -math.inf: tmp = t_0 elif (V * l) <= -2e-304: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-298: tmp = t_0 elif (V * l) <= 1e+299: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.pow((V * (l / A)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = t_0; elseif (Float64(V * l) <= -2e-304) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-298) tmp = t_0; elseif (Float64(V * l) <= 1e+299) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); 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(l)) * sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = t_0;
elseif ((V * l) <= -2e-304)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-298)
tmp = t_0;
elseif ((V * l) <= 1e+299)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 * ((V * (l / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-304], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-298], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 1e+299], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-304}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-298}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+299}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or -1.99999999999999994e-304 < (*.f64 V l) < 5.0000000000000002e-298Initial program 37.9%
add-sqr-sqrt30.2%
sqrt-unprod28.2%
*-commutative28.2%
*-commutative28.2%
swap-sqr27.5%
add-sqr-sqrt27.5%
pow227.5%
Applied egg-rr27.5%
sqrt-prod29.7%
div-inv29.7%
associate-/r*29.7%
*-commutative29.7%
*-commutative29.7%
associate-*r/36.6%
div-inv36.7%
frac-2neg36.7%
associate-/r*29.7%
*-commutative29.7%
sqrt-undiv22.3%
sqrt-pow126.7%
metadata-eval26.7%
pow126.7%
*-commutative26.7%
associate-*r/26.3%
sqrt-prod32.6%
times-frac39.4%
sqrt-div51.8%
Applied egg-rr51.8%
if -inf.0 < (*.f64 V l) < -1.99999999999999994e-304Initial program 86.3%
frac-2neg86.3%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if 5.0000000000000002e-298 < (*.f64 V l) < 1.0000000000000001e299Initial program 85.4%
associate-/r*78.2%
clear-num77.3%
sqrt-div77.3%
metadata-eval77.3%
div-inv76.4%
clear-num76.7%
Applied egg-rr76.7%
*-commutative76.7%
associate-*l/84.9%
associate-/l*75.2%
Simplified75.2%
un-div-inv75.3%
Applied egg-rr75.3%
associate-*r/85.1%
frac-2neg85.1%
*-commutative85.1%
distribute-rgt-neg-out85.1%
sqrt-undiv0.0%
div-inv0.0%
*-commutative0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
sqrt-unprod63.2%
sqr-neg63.2%
sqrt-unprod99.3%
add-sqr-sqrt99.3%
Applied egg-rr99.3%
associate-*r/99.5%
*-rgt-identity99.5%
Simplified99.5%
if 1.0000000000000001e299 < (*.f64 V l) Initial program 12.2%
associate-/r*65.0%
clear-num64.9%
sqrt-div64.9%
metadata-eval64.9%
div-inv64.9%
clear-num64.9%
Applied egg-rr64.9%
*-commutative64.9%
associate-*l/12.2%
associate-/l*64.9%
Simplified64.9%
inv-pow64.9%
sqrt-pow265.0%
metadata-eval65.0%
Applied egg-rr65.0%
Final simplification90.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) -1e+208)
(* c0 (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* V l) -2e-304)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-298)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) 1e+299)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (pow (* V (/ l A)) -0.5)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+208) {
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= -2e-304) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-298) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((V * l) <= 1e+299) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-1d+208)) then
tmp = c0 * (sqrt((a / -l)) / sqrt(-v))
else if ((v * l) <= (-2d-304)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 5d-298) then
tmp = (c0 / sqrt(l)) * sqrt((a / v))
else if ((v * l) <= 1d+299) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+208) {
tmp = c0 * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((V * l) <= -2e-304) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-298) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((V * l) <= 1e+299) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+208: tmp = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= -2e-304: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-298: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) elif (V * l) <= 1e+299: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.pow((V * (l / A)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e+208) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -2e-304) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-298) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= 1e+299) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -1e+208)
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= -2e-304)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-298)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
elseif ((V * l) <= 1e+299)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 * ((V * (l / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+208], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-304], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-298], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+299], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+208}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-304}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-298}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+299}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.9999999999999998e207Initial program 52.1%
clear-num52.2%
associate-/r/52.1%
associate-/r*52.1%
Applied egg-rr52.1%
*-commutative52.1%
associate-/r*52.1%
div-inv52.1%
*-commutative52.1%
associate-/r*70.6%
Applied egg-rr70.6%
frac-2neg70.6%
sqrt-div50.1%
distribute-neg-frac250.1%
Applied egg-rr50.1%
distribute-frac-neg250.1%
distribute-neg-frac50.1%
Simplified50.1%
if -9.9999999999999998e207 < (*.f64 V l) < -1.99999999999999994e-304Initial program 85.5%
frac-2neg85.5%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if -1.99999999999999994e-304 < (*.f64 V l) < 5.0000000000000002e-298Initial program 46.1%
add-sqr-sqrt31.8%
sqrt-unprod28.0%
*-commutative28.0%
*-commutative28.0%
swap-sqr27.6%
add-sqr-sqrt27.6%
pow227.6%
Applied egg-rr27.6%
sqrt-prod31.7%
div-inv31.7%
associate-/r*31.7%
*-commutative31.7%
*-commutative31.7%
associate-*r/44.6%
div-inv44.7%
frac-2neg44.7%
associate-/r*31.7%
*-commutative31.7%
sqrt-undiv17.9%
sqrt-pow125.2%
metadata-eval25.2%
pow125.2%
*-commutative25.2%
associate-*r/25.1%
sqrt-prod30.3%
times-frac30.3%
sqrt-div60.6%
Applied egg-rr60.6%
if 5.0000000000000002e-298 < (*.f64 V l) < 1.0000000000000001e299Initial program 85.4%
associate-/r*78.2%
clear-num77.3%
sqrt-div77.3%
metadata-eval77.3%
div-inv76.4%
clear-num76.7%
Applied egg-rr76.7%
*-commutative76.7%
associate-*l/84.9%
associate-/l*75.2%
Simplified75.2%
un-div-inv75.3%
Applied egg-rr75.3%
associate-*r/85.1%
frac-2neg85.1%
*-commutative85.1%
distribute-rgt-neg-out85.1%
sqrt-undiv0.0%
div-inv0.0%
*-commutative0.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
sqrt-unprod63.2%
sqr-neg63.2%
sqrt-unprod99.3%
add-sqr-sqrt99.3%
Applied egg-rr99.3%
associate-*r/99.5%
*-rgt-identity99.5%
Simplified99.5%
if 1.0000000000000001e299 < (*.f64 V l) Initial program 12.2%
associate-/r*65.0%
clear-num64.9%
sqrt-div64.9%
metadata-eval64.9%
div-inv64.9%
clear-num64.9%
Applied egg-rr64.9%
*-commutative64.9%
associate-*l/12.2%
associate-/l*64.9%
Simplified64.9%
inv-pow64.9%
sqrt-pow265.0%
metadata-eval65.0%
Applied egg-rr65.0%
Final simplification88.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 (<= t_0 4e-312)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+292)
(/ c0 (sqrt (/ (* V l) A)))
(* c0 (/ 1.0 (sqrt (* l (/ V A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 4e-312) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+292) {
tmp = c0 / sqrt(((V * l) / A));
} else {
tmp = c0 * (1.0 / sqrt((l * (V / A))));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 4d-312) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+292) then
tmp = c0 / sqrt(((v * l) / a))
else
tmp = c0 * (1.0d0 / sqrt((l * (v / a))))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 4e-312) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+292) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else {
tmp = c0 * (1.0 / Math.sqrt((l * (V / A))));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 4e-312: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+292: tmp = c0 / math.sqrt(((V * l) / A)) else: tmp = c0 * (1.0 / math.sqrt((l * (V / A)))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 4e-312) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+292) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); else tmp = Float64(c0 * Float64(1.0 / sqrt(Float64(l * Float64(V / A))))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 4e-312)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+292)
tmp = c0 / sqrt(((V * l) / A));
else
tmp = c0 * (1.0 / sqrt((l * (V / A))));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-312], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+292], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(1.0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-312}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+292}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 3.9999999999988e-312Initial program 34.6%
associate-/r*56.8%
Simplified56.8%
if 3.9999999999988e-312 < (/.f64 A (*.f64 V l)) < 2e292Initial program 99.5%
clear-num99.5%
associate-/r/99.5%
associate-/r*99.5%
Applied egg-rr99.5%
*-commutative99.5%
associate-/r*99.5%
div-inv99.5%
*-commutative99.5%
associate-/r*89.2%
Applied egg-rr89.2%
clear-num89.2%
sqrt-div89.1%
metadata-eval89.1%
div-inv88.2%
clear-num88.8%
div-inv88.9%
*-commutative88.9%
associate-*l/99.6%
Applied egg-rr99.6%
if 2e292 < (/.f64 A (*.f64 V l)) Initial program 42.1%
associate-/r*55.3%
clear-num55.3%
sqrt-div58.5%
metadata-eval58.5%
div-inv58.5%
clear-num59.0%
Applied egg-rr59.0%
Final simplification82.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 4e-312)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+292)
(/ c0 (sqrt (/ (* V l) A)))
(/ 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 <= 4e-312) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+292) {
tmp = c0 / sqrt(((V * l) / A));
} 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 <= 4d-312) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+292) then
tmp = c0 / sqrt(((v * l) / a))
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 <= 4e-312) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+292) {
tmp = c0 / Math.sqrt(((V * l) / A));
} 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 <= 4e-312: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+292: tmp = c0 / math.sqrt(((V * l) / A)) 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 <= 4e-312) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+292) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); 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 <= 4e-312)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+292)
tmp = c0 / sqrt(((V * l) / A));
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, 4e-312], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+292], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $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 4 \cdot 10^{-312}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+292}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 3.9999999999988e-312Initial program 34.6%
associate-/r*56.8%
Simplified56.8%
if 3.9999999999988e-312 < (/.f64 A (*.f64 V l)) < 2e292Initial program 99.5%
clear-num99.5%
associate-/r/99.5%
associate-/r*99.5%
Applied egg-rr99.5%
*-commutative99.5%
associate-/r*99.5%
div-inv99.5%
*-commutative99.5%
associate-/r*89.2%
Applied egg-rr89.2%
clear-num89.2%
sqrt-div89.1%
metadata-eval89.1%
div-inv88.2%
clear-num88.8%
div-inv88.9%
*-commutative88.9%
associate-*l/99.6%
Applied egg-rr99.6%
if 2e292 < (/.f64 A (*.f64 V l)) Initial program 42.1%
associate-/r*55.3%
clear-num55.3%
sqrt-div58.5%
metadata-eval58.5%
div-inv58.5%
clear-num59.0%
Applied egg-rr59.0%
*-commutative59.0%
associate-*l/44.5%
associate-/l*57.7%
Simplified57.7%
un-div-inv57.6%
clear-num57.6%
Applied egg-rr57.6%
associate-/r/57.7%
associate-*l/57.6%
*-lft-identity57.6%
associate-*r/44.5%
associate-*l/59.0%
associate-/r/57.6%
Simplified57.6%
associate-/r/59.0%
Applied egg-rr59.0%
Final simplification82.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 74.6%
Final simplification74.6%
herbie shell --seed 2024073
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))