
(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) (- INFINITY))
(/ (* c0 (sqrt (/ A V))) (sqrt l))
(if (<= (* V l) -5e-318)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0 (/ (pow (/ V A) -0.5) (sqrt l)))
(if (<= (* V l) 1e+284)
(* c0 (/ (sqrt A) (sqrt (* 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 tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (c0 * sqrt((A / V))) / sqrt(l);
} else if ((V * l) <= -5e-318) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (pow((V / A), -0.5) / sqrt(l));
} else if ((V * l) <= 1e+284) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = (c0 * Math.sqrt((A / V))) / Math.sqrt(l);
} else if ((V * l) <= -5e-318) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.pow((V / A), -0.5) / Math.sqrt(l));
} else if ((V * l) <= 1e+284) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((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): tmp = 0 if (V * l) <= -math.inf: tmp = (c0 * math.sqrt((A / V))) / math.sqrt(l) elif (V * l) <= -5e-318: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 * (math.pow((V / A), -0.5) / math.sqrt(l)) elif (V * l) <= 1e+284: tmp = c0 * (math.sqrt(A) / math.sqrt((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) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(c0 * sqrt(Float64(A / V))) / sqrt(l)); elseif (Float64(V * l) <= -5e-318) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64((Float64(V / A) ^ -0.5) / sqrt(l))); elseif (Float64(V * l) <= 1e+284) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (c0 * sqrt((A / V))) / sqrt(l);
elseif ((V * l) <= -5e-318)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 * (((V / A) ^ -0.5) / sqrt(l));
elseif ((V * l) <= 1e+284)
tmp = c0 * (sqrt(A) / sqrt((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_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-318], 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[(N[Power[N[(V / A), $MachinePrecision], -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+284], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * 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}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-318}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{{\left(\frac{V}{A}\right)}^{-0.5}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+284}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 30.6%
*-commutative30.6%
associate-/r*61.2%
sqrt-div38.1%
associate-*l/38.2%
Applied egg-rr38.2%
if -inf.0 < (*.f64 V l) < -4.9999987e-318Initial program 86.4%
frac-2neg86.4%
sqrt-div99.0%
distribute-rgt-neg-in99.0%
Applied egg-rr99.0%
distribute-rgt-neg-out99.0%
*-commutative99.0%
distribute-rgt-neg-in99.0%
Simplified99.0%
if -4.9999987e-318 < (*.f64 V l) < -0.0Initial program 32.8%
associate-/r*52.5%
sqrt-div42.3%
div-inv42.4%
Applied egg-rr42.4%
associate-*r/42.3%
*-rgt-identity42.3%
Simplified42.3%
clear-num42.3%
sqrt-div42.3%
metadata-eval42.3%
Applied egg-rr42.3%
inv-pow42.3%
sqrt-pow242.3%
metadata-eval42.3%
Applied egg-rr42.3%
if -0.0 < (*.f64 V l) < 1.00000000000000008e284Initial program 88.5%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 1.00000000000000008e284 < (*.f64 V l) Initial program 27.8%
associate-/r*61.4%
div-inv61.5%
Applied egg-rr61.5%
un-div-inv61.4%
associate-/r*27.8%
sqrt-div27.8%
clear-num27.8%
sqrt-div27.9%
associate-*r/61.4%
un-div-inv61.6%
clear-num61.6%
Applied egg-rr61.6%
associate-/r/61.4%
associate-*l/61.6%
*-lft-identity61.6%
Simplified61.6%
Final simplification86.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 (* c0 (sqrt (/ A (* V l))))))
(if (or (<= t_0 0.0) (not (<= t_0 2e+219)))
(* 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 <= 0.0) || !(t_0 <= 2e+219)) {
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 <= 0.0d0) .or. (.not. (t_0 <= 2d+219))) 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 <= 0.0) || !(t_0 <= 2e+219)) {
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 <= 0.0) or not (t_0 <= 2e+219): 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 <= 0.0) || !(t_0 <= 2e+219)) 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 <= 0.0) || ~((t_0 <= 2e+219)))
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, 0.0], N[Not[LessEqual[t$95$0, 2e+219]], $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 0 \lor \neg \left(t\_0 \leq 2 \cdot 10^{+219}\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)))) < 0.0 or 1.99999999999999993e219 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 63.7%
associate-/r*67.7%
Simplified67.7%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999993e219Initial program 99.6%
Final simplification76.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 5e-303)
(/ c0 (sqrt (* l (/ V A))))
(if (<= t_0 2e+219) 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 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 5e-303) {
tmp = c0 / sqrt((l * (V / A)));
} else if (t_0 <= 2e+219) {
tmp = 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 = c0 * sqrt((a / (v * l)))
if (t_0 <= 5d-303) then
tmp = c0 / sqrt((l * (v / a)))
else if (t_0 <= 2d+219) then
tmp = 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 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 5e-303) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if (t_0 <= 2e+219) {
tmp = 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 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 5e-303: tmp = c0 / math.sqrt((l * (V / A))) elif t_0 <= 2e+219: tmp = 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(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 5e-303) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (t_0 <= 2e+219) tmp = 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 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 5e-303)
tmp = c0 / sqrt((l * (V / A)));
elseif (t_0 <= 2e+219)
tmp = 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[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-303], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+219], t$95$0, N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-303}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+219}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999998e-303Initial program 65.8%
associate-/r*69.8%
div-inv69.8%
Applied egg-rr69.8%
un-div-inv69.8%
clear-num69.8%
Applied egg-rr69.8%
sqrt-div69.7%
metadata-eval69.7%
associate-/r/69.0%
*-commutative69.0%
div-inv69.1%
*-commutative69.1%
associate-/r/69.7%
div-inv69.7%
clear-num70.2%
Applied egg-rr70.2%
if 4.9999999999999998e-303 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999993e219Initial program 99.6%
if 1.99999999999999993e219 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 54.4%
associate-/r*58.1%
Simplified58.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 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 0.0)
(/ c0 (sqrt (* V (/ l A))))
(if (<= t_0 2e+219) 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 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / sqrt((V * (l / A)));
} else if (t_0 <= 2e+219) {
tmp = 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 = c0 * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = c0 / sqrt((v * (l / a)))
else if (t_0 <= 2d+219) then
tmp = 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 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if (t_0 <= 2e+219) {
tmp = 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 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0 / math.sqrt((V * (l / A))) elif t_0 <= 2e+219: tmp = 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(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (t_0 <= 2e+219) tmp = 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 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 / sqrt((V * (l / A)));
elseif (t_0 <= 2e+219)
tmp = 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[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+219], t$95$0, N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+219}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 65.2%
associate-/r*69.2%
div-inv69.2%
Applied egg-rr69.2%
un-div-inv69.2%
associate-/r*65.2%
sqrt-div32.4%
clear-num32.4%
sqrt-div65.1%
associate-*r/68.5%
un-div-inv68.5%
clear-num68.1%
Applied egg-rr68.1%
associate-/r/68.5%
associate-*l/68.5%
*-lft-identity68.5%
Simplified68.5%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999993e219Initial program 99.6%
if 1.99999999999999993e219 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 54.4%
associate-/r*58.1%
Simplified58.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -1e-310) (* c0 (/ (/ (sqrt (- A)) (sqrt (- V))) (sqrt l))) (* 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 (A <= -1e-310) {
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
} 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 (a <= (-1d-310)) then
tmp = c0 * ((sqrt(-a) / sqrt(-v)) / sqrt(l))
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 (A <= -1e-310) {
tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) / Math.sqrt(l));
} 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 A <= -1e-310: tmp = c0 * ((math.sqrt(-A) / math.sqrt(-V)) / math.sqrt(l)) 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 (A <= -1e-310) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / sqrt(l))); 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 (A <= -1e-310)
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
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[A, -1e-310], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $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}\;A \leq -1 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -9.999999999999969e-311Initial program 71.9%
associate-/r*70.4%
sqrt-div39.2%
div-inv39.2%
Applied egg-rr39.2%
associate-*r/39.2%
*-rgt-identity39.2%
Simplified39.2%
frac-2neg39.2%
sqrt-div46.9%
Applied egg-rr46.9%
if -9.999999999999969e-311 < A Initial program 75.7%
sqrt-div84.3%
div-inv84.2%
Applied egg-rr84.2%
associate-*r/84.3%
*-rgt-identity84.3%
Simplified84.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) -5e+206)
(* c0 (* (sqrt (/ A V)) (pow l -0.5)))
(if (<= (* V l) -5e-183)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
(* c0 (/ (pow (/ V A) -0.5) (sqrt l)))
(if (<= (* V l) 1e+284)
(* c0 (/ (sqrt A) (sqrt (* 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 tmp;
if ((V * l) <= -5e+206) {
tmp = c0 * (sqrt((A / V)) * pow(l, -0.5));
} else if ((V * l) <= -5e-183) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = c0 * (pow((V / A), -0.5) / sqrt(l));
} else if ((V * l) <= 1e+284) {
tmp = c0 * (sqrt(A) / sqrt((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) :: tmp
if ((v * l) <= (-5d+206)) then
tmp = c0 * (sqrt((a / v)) * (l ** (-0.5d0)))
else if ((v * l) <= (-5d-183)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = c0 * (((v / a) ** (-0.5d0)) / sqrt(l))
else if ((v * l) <= 1d+284) then
tmp = c0 * (sqrt(a) / sqrt((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 tmp;
if ((V * l) <= -5e+206) {
tmp = c0 * (Math.sqrt((A / V)) * Math.pow(l, -0.5));
} else if ((V * l) <= -5e-183) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.pow((V / A), -0.5) / Math.sqrt(l));
} else if ((V * l) <= 1e+284) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((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): tmp = 0 if (V * l) <= -5e+206: tmp = c0 * (math.sqrt((A / V)) * math.pow(l, -0.5)) elif (V * l) <= -5e-183: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = c0 * (math.pow((V / A), -0.5) / math.sqrt(l)) elif (V * l) <= 1e+284: tmp = c0 * (math.sqrt(A) / math.sqrt((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) tmp = 0.0 if (Float64(V * l) <= -5e+206) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) * (l ^ -0.5))); elseif (Float64(V * l) <= -5e-183) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64((Float64(V / A) ^ -0.5) / sqrt(l))); elseif (Float64(V * l) <= 1e+284) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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)
tmp = 0.0;
if ((V * l) <= -5e+206)
tmp = c0 * (sqrt((A / V)) * (l ^ -0.5));
elseif ((V * l) <= -5e-183)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = c0 * (((V / A) ^ -0.5) / sqrt(l));
elseif ((V * l) <= 1e+284)
tmp = c0 * (sqrt(A) / sqrt((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_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e+206], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-183], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Power[N[(V / A), $MachinePrecision], -0.5], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+284], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * 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}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+206}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot {\ell}^{-0.5}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-183}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{{\left(\frac{V}{A}\right)}^{-0.5}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+284}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.0000000000000002e206Initial program 44.7%
associate-/r*63.0%
div-inv63.0%
Applied egg-rr63.0%
un-div-inv63.0%
sqrt-undiv44.6%
clear-num44.6%
associate-/r/44.7%
pow1/244.7%
pow-flip44.7%
metadata-eval44.7%
Applied egg-rr44.7%
if -5.0000000000000002e206 < (*.f64 V l) < -5.0000000000000002e-183Initial program 94.1%
associate-/r*77.9%
div-inv77.9%
Applied egg-rr77.9%
un-div-inv77.9%
associate-/r*94.1%
sqrt-div0.0%
clear-num0.0%
sqrt-div94.1%
associate-*r/80.7%
un-div-inv80.8%
clear-num80.8%
Applied egg-rr80.8%
associate-/r/80.7%
associate-*l/80.8%
*-lft-identity80.8%
Simplified80.8%
Taylor expanded in V around 0 94.2%
if -5.0000000000000002e-183 < (*.f64 V l) < -0.0Initial program 48.9%
associate-/r*60.5%
sqrt-div34.9%
div-inv34.9%
Applied egg-rr34.9%
associate-*r/34.9%
*-rgt-identity34.9%
Simplified34.9%
clear-num34.9%
sqrt-div34.9%
metadata-eval34.9%
Applied egg-rr34.9%
inv-pow34.9%
sqrt-pow234.9%
metadata-eval34.9%
Applied egg-rr34.9%
if -0.0 < (*.f64 V l) < 1.00000000000000008e284Initial program 88.5%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 1.00000000000000008e284 < (*.f64 V l) Initial program 27.8%
associate-/r*61.4%
div-inv61.5%
Applied egg-rr61.5%
un-div-inv61.4%
associate-/r*27.8%
sqrt-div27.8%
clear-num27.8%
sqrt-div27.9%
associate-*r/61.4%
un-div-inv61.6%
clear-num61.6%
Applied egg-rr61.6%
associate-/r/61.4%
associate-*l/61.6%
*-lft-identity61.6%
Simplified61.6%
Final simplification77.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ (* c0 (sqrt (/ A V))) (sqrt l))))
(if (<= (* V l) -5e+206)
t_0
(if (<= (* V l) -5e-183)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 1e+284)
(* c0 (/ (sqrt A) (sqrt (* 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 = (c0 * sqrt((A / V))) / sqrt(l);
double tmp;
if ((V * l) <= -5e+206) {
tmp = t_0;
} else if ((V * l) <= -5e-183) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 1e+284) {
tmp = c0 * (sqrt(A) / sqrt((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 = (c0 * sqrt((a / v))) / sqrt(l)
if ((v * l) <= (-5d+206)) then
tmp = t_0
else if ((v * l) <= (-5d-183)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 1d+284) then
tmp = c0 * (sqrt(a) / sqrt((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 = (c0 * Math.sqrt((A / V))) / Math.sqrt(l);
double tmp;
if ((V * l) <= -5e+206) {
tmp = t_0;
} else if ((V * l) <= -5e-183) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 1e+284) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((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 = (c0 * math.sqrt((A / V))) / math.sqrt(l) tmp = 0 if (V * l) <= -5e+206: tmp = t_0 elif (V * l) <= -5e-183: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 1e+284: tmp = c0 * (math.sqrt(A) / math.sqrt((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(Float64(c0 * sqrt(Float64(A / V))) / sqrt(l)) tmp = 0.0 if (Float64(V * l) <= -5e+206) tmp = t_0; elseif (Float64(V * l) <= -5e-183) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 1e+284) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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 = (c0 * sqrt((A / V))) / sqrt(l);
tmp = 0.0;
if ((V * l) <= -5e+206)
tmp = t_0;
elseif ((V * l) <= -5e-183)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 1e+284)
tmp = c0 * (sqrt(A) / sqrt((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[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+206], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-183], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 1e+284], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * 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{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+206}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-183}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+284}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.0000000000000002e206 or -5.0000000000000002e-183 < (*.f64 V l) < -0.0Initial program 47.0%
*-commutative47.0%
associate-/r*61.6%
sqrt-div39.3%
associate-*l/39.4%
Applied egg-rr39.4%
if -5.0000000000000002e206 < (*.f64 V l) < -5.0000000000000002e-183Initial program 94.1%
associate-/r*77.9%
div-inv77.9%
Applied egg-rr77.9%
un-div-inv77.9%
associate-/r*94.1%
sqrt-div0.0%
clear-num0.0%
sqrt-div94.1%
associate-*r/80.7%
un-div-inv80.8%
clear-num80.8%
Applied egg-rr80.8%
associate-/r/80.7%
associate-*l/80.8%
*-lft-identity80.8%
Simplified80.8%
Taylor expanded in V around 0 94.2%
if -0.0 < (*.f64 V l) < 1.00000000000000008e284Initial program 88.5%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 1.00000000000000008e284 < (*.f64 V l) Initial program 27.8%
associate-/r*61.4%
div-inv61.5%
Applied egg-rr61.5%
un-div-inv61.4%
associate-/r*27.8%
sqrt-div27.8%
clear-num27.8%
sqrt-div27.9%
associate-*r/61.4%
un-div-inv61.6%
clear-num61.6%
Applied egg-rr61.6%
associate-/r/61.4%
associate-*l/61.6%
*-lft-identity61.6%
Simplified61.6%
Final simplification77.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 (sqrt (/ A V))))
(if (<= (* V l) -5e+206)
(* c0 (/ t_0 (sqrt l)))
(if (<= (* V l) -1e-187)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
(* t_0 (/ c0 (sqrt l)))
(if (<= (* V l) 1e+284)
(* c0 (/ (sqrt A) (sqrt (* 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 = sqrt((A / V));
double tmp;
if ((V * l) <= -5e+206) {
tmp = c0 * (t_0 / sqrt(l));
} else if ((V * l) <= -1e-187) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = t_0 * (c0 / sqrt(l));
} else if ((V * l) <= 1e+284) {
tmp = c0 * (sqrt(A) / sqrt((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 = sqrt((a / v))
if ((v * l) <= (-5d+206)) then
tmp = c0 * (t_0 / sqrt(l))
else if ((v * l) <= (-1d-187)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = t_0 * (c0 / sqrt(l))
else if ((v * l) <= 1d+284) then
tmp = c0 * (sqrt(a) / sqrt((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 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -5e+206) {
tmp = c0 * (t_0 / Math.sqrt(l));
} else if ((V * l) <= -1e-187) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = t_0 * (c0 / Math.sqrt(l));
} else if ((V * l) <= 1e+284) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((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 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -5e+206: tmp = c0 * (t_0 / math.sqrt(l)) elif (V * l) <= -1e-187: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = t_0 * (c0 / math.sqrt(l)) elif (V * l) <= 1e+284: tmp = c0 * (math.sqrt(A) / math.sqrt((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 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -5e+206) tmp = Float64(c0 * Float64(t_0 / sqrt(l))); elseif (Float64(V * l) <= -1e-187) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = Float64(t_0 * Float64(c0 / sqrt(l))); elseif (Float64(V * l) <= 1e+284) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -5e+206)
tmp = c0 * (t_0 / sqrt(l));
elseif ((V * l) <= -1e-187)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = t_0 * (c0 / sqrt(l));
elseif ((V * l) <= 1e+284)
tmp = c0 * (sqrt(A) / sqrt((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[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+206], N[(c0 * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-187], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(t$95$0 * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+284], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * 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 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+206}:\\
\;\;\;\;c0 \cdot \frac{t\_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-187}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0 \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+284}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.0000000000000002e206Initial program 44.7%
associate-/r*63.0%
sqrt-div44.6%
div-inv44.7%
Applied egg-rr44.7%
associate-*r/44.6%
*-rgt-identity44.6%
Simplified44.6%
if -5.0000000000000002e206 < (*.f64 V l) < -1e-187Initial program 94.3%
associate-/r*78.5%
div-inv78.5%
Applied egg-rr78.5%
un-div-inv78.5%
associate-/r*94.3%
sqrt-div0.0%
clear-num0.0%
sqrt-div94.3%
associate-*r/81.2%
un-div-inv81.3%
clear-num81.3%
Applied egg-rr81.3%
associate-/r/81.2%
associate-*l/81.3%
*-lft-identity81.3%
Simplified81.3%
Taylor expanded in V around 0 94.3%
if -1e-187 < (*.f64 V l) < -0.0Initial program 46.4%
associate-/r*58.5%
div-inv58.5%
Applied egg-rr58.5%
un-div-inv58.5%
sqrt-undiv34.1%
associate-*r/34.2%
clear-num34.1%
Applied egg-rr34.1%
associate-/r/34.1%
associate-*l/34.2%
*-commutative34.2%
associate-*l*34.2%
*-lft-identity34.2%
associate-/l*34.2%
Simplified34.2%
if -0.0 < (*.f64 V l) < 1.00000000000000008e284Initial program 88.5%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 1.00000000000000008e284 < (*.f64 V l) Initial program 27.8%
associate-/r*61.4%
div-inv61.5%
Applied egg-rr61.5%
un-div-inv61.4%
associate-/r*27.8%
sqrt-div27.8%
clear-num27.8%
sqrt-div27.9%
associate-*r/61.4%
un-div-inv61.6%
clear-num61.6%
Applied egg-rr61.6%
associate-/r/61.4%
associate-*l/61.6%
*-lft-identity61.6%
Simplified61.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)) (sqrt l)))))
(if (<= (* V l) -5e+206)
t_0
(if (<= (* V l) -5e-183)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 1e+284)
(* c0 (/ (sqrt A) (sqrt (* 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 = c0 * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -5e+206) {
tmp = t_0;
} else if ((V * l) <= -5e-183) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 1e+284) {
tmp = c0 * (sqrt(A) / sqrt((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 = c0 * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-5d+206)) then
tmp = t_0
else if ((v * l) <= (-5d-183)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 1d+284) then
tmp = c0 * (sqrt(a) / sqrt((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 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -5e+206) {
tmp = t_0;
} else if ((V * l) <= -5e-183) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 1e+284) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((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 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -5e+206: tmp = t_0 elif (V * l) <= -5e-183: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 1e+284: tmp = c0 * (math.sqrt(A) / math.sqrt((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(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -5e+206) tmp = t_0; elseif (Float64(V * l) <= -5e-183) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 1e+284) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -5e+206)
tmp = t_0;
elseif ((V * l) <= -5e-183)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 1e+284)
tmp = c0 * (sqrt(A) / sqrt((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[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+206], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-183], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 1e+284], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * 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 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+206}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-183}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+284}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.0000000000000002e206 or -5.0000000000000002e-183 < (*.f64 V l) < -0.0Initial program 47.0%
associate-/r*61.6%
sqrt-div39.3%
div-inv39.4%
Applied egg-rr39.4%
associate-*r/39.3%
*-rgt-identity39.3%
Simplified39.3%
if -5.0000000000000002e206 < (*.f64 V l) < -5.0000000000000002e-183Initial program 94.1%
associate-/r*77.9%
div-inv77.9%
Applied egg-rr77.9%
un-div-inv77.9%
associate-/r*94.1%
sqrt-div0.0%
clear-num0.0%
sqrt-div94.1%
associate-*r/80.7%
un-div-inv80.8%
clear-num80.8%
Applied egg-rr80.8%
associate-/r/80.7%
associate-*l/80.8%
*-lft-identity80.8%
Simplified80.8%
Taylor expanded in V around 0 94.2%
if -0.0 < (*.f64 V l) < 1.00000000000000008e284Initial program 88.5%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 1.00000000000000008e284 < (*.f64 V l) Initial program 27.8%
associate-/r*61.4%
div-inv61.5%
Applied egg-rr61.5%
un-div-inv61.4%
associate-/r*27.8%
sqrt-div27.8%
clear-num27.8%
sqrt-div27.9%
associate-*r/61.4%
un-div-inv61.6%
clear-num61.6%
Applied egg-rr61.6%
associate-/r/61.4%
associate-*l/61.6%
*-lft-identity61.6%
Simplified61.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) (/ 1.0 l))))))
(if (<= (* V l) -8e+240)
t_0
(if (<= (* V l) -5e-183)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 1e+284)
(* c0 (/ (sqrt A) (sqrt (* 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 = c0 * sqrt(((A / V) * (1.0 / l)));
double tmp;
if ((V * l) <= -8e+240) {
tmp = t_0;
} else if ((V * l) <= -5e-183) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 1e+284) {
tmp = c0 * (sqrt(A) / sqrt((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 = c0 * sqrt(((a / v) * (1.0d0 / l)))
if ((v * l) <= (-8d+240)) then
tmp = t_0
else if ((v * l) <= (-5d-183)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 1d+284) then
tmp = c0 * (sqrt(a) / sqrt((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 = c0 * Math.sqrt(((A / V) * (1.0 / l)));
double tmp;
if ((V * l) <= -8e+240) {
tmp = t_0;
} else if ((V * l) <= -5e-183) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 1e+284) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((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 = c0 * math.sqrt(((A / V) * (1.0 / l))) tmp = 0 if (V * l) <= -8e+240: tmp = t_0 elif (V * l) <= -5e-183: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 1e+284: tmp = c0 * (math.sqrt(A) / math.sqrt((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(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / l)))) tmp = 0.0 if (Float64(V * l) <= -8e+240) tmp = t_0; elseif (Float64(V * l) <= -5e-183) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 1e+284) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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 = c0 * sqrt(((A / V) * (1.0 / l)));
tmp = 0.0;
if ((V * l) <= -8e+240)
tmp = t_0;
elseif ((V * l) <= -5e-183)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 1e+284)
tmp = c0 * (sqrt(A) / sqrt((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[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -8e+240], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-183], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 1e+284], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * 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 := c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -8 \cdot 10^{+240}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-183}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+284}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -8.00000000000000011e240 or -5.0000000000000002e-183 < (*.f64 V l) < -0.0Initial program 46.1%
associate-/r*61.3%
div-inv61.4%
Applied egg-rr61.4%
if -8.00000000000000011e240 < (*.f64 V l) < -5.0000000000000002e-183Initial program 93.1%
associate-/r*77.5%
div-inv77.5%
Applied egg-rr77.5%
un-div-inv77.5%
associate-/r*93.1%
sqrt-div0.0%
clear-num0.0%
sqrt-div93.1%
associate-*r/80.2%
un-div-inv80.3%
clear-num80.3%
Applied egg-rr80.3%
associate-/r/80.2%
associate-*l/80.3%
*-lft-identity80.3%
Simplified80.3%
Taylor expanded in V around 0 93.1%
if -0.0 < (*.f64 V l) < 1.00000000000000008e284Initial program 88.5%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 1.00000000000000008e284 < (*.f64 V l) Initial program 27.8%
associate-/r*61.4%
div-inv61.5%
Applied egg-rr61.5%
un-div-inv61.4%
associate-/r*27.8%
sqrt-div27.8%
clear-num27.8%
sqrt-div27.9%
associate-*r/61.4%
un-div-inv61.6%
clear-num61.6%
Applied egg-rr61.6%
associate-/r/61.4%
associate-*l/61.6%
*-lft-identity61.6%
Simplified61.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 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (* (sqrt (/ A V)) (pow l -0.5)))
(if (<= t_0 5e+300)
(* c0 (sqrt t_0))
(sqrt (/ (/ (* A (pow c0 2.0)) l) V))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * (sqrt((A / V)) * pow(l, -0.5));
} else if (t_0 <= 5e+300) {
tmp = c0 * sqrt(t_0);
} else {
tmp = sqrt((((A * pow(c0, 2.0)) / l) / V));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * (sqrt((a / v)) * (l ** (-0.5d0)))
else if (t_0 <= 5d+300) then
tmp = c0 * sqrt(t_0)
else
tmp = sqrt((((a * (c0 ** 2.0d0)) / l) / v))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * (Math.sqrt((A / V)) * Math.pow(l, -0.5));
} else if (t_0 <= 5e+300) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = Math.sqrt((((A * Math.pow(c0, 2.0)) / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * (math.sqrt((A / V)) * math.pow(l, -0.5)) elif t_0 <= 5e+300: tmp = c0 * math.sqrt(t_0) else: tmp = math.sqrt((((A * math.pow(c0, 2.0)) / l) / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) * (l ^ -0.5))); elseif (t_0 <= 5e+300) tmp = Float64(c0 * sqrt(t_0)); else tmp = sqrt(Float64(Float64(Float64(A * (c0 ^ 2.0)) / l) / V)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * (sqrt((A / V)) * (l ^ -0.5));
elseif (t_0 <= 5e+300)
tmp = c0 * sqrt(t_0);
else
tmp = sqrt((((A * (c0 ^ 2.0)) / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+300], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(N[(A * N[Power[c0, 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] / V), $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 \left(\sqrt{\frac{A}{V}} \cdot {\ell}^{-0.5}\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{A \cdot {c0}^{2}}{\ell}}{V}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 26.7%
associate-/r*50.5%
div-inv50.6%
Applied egg-rr50.6%
un-div-inv50.5%
sqrt-undiv36.4%
clear-num36.3%
associate-/r/36.3%
pow1/236.3%
pow-flip36.4%
metadata-eval36.4%
Applied egg-rr36.4%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000026e300Initial program 99.6%
if 5.00000000000000026e300 < (/.f64 A (*.f64 V l)) Initial program 31.6%
add-sqr-sqrt13.1%
sqrt-unprod13.3%
*-commutative13.3%
*-commutative13.3%
swap-sqr13.1%
add-sqr-sqrt13.1%
pow213.1%
Applied egg-rr13.1%
associate-*l/24.4%
*-commutative24.4%
associate-/r*24.8%
Applied egg-rr24.8%
Final simplification74.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 V)) (sqrt l)))
(if (<= t_0 5e+300)
(* c0 (sqrt t_0))
(sqrt (/ (/ (* A (pow c0 2.0)) l) V))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if (t_0 <= 5e+300) {
tmp = c0 * sqrt(t_0);
} else {
tmp = sqrt((((A * pow(c0, 2.0)) / l) / V));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if (t_0 <= 5d+300) then
tmp = c0 * sqrt(t_0)
else
tmp = sqrt((((a * (c0 ** 2.0d0)) / l) / v))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if (t_0 <= 5e+300) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = Math.sqrt((((A * Math.pow(c0, 2.0)) / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif t_0 <= 5e+300: tmp = c0 * math.sqrt(t_0) else: tmp = math.sqrt((((A * math.pow(c0, 2.0)) / l) / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (t_0 <= 5e+300) tmp = Float64(c0 * sqrt(t_0)); else tmp = sqrt(Float64(Float64(Float64(A * (c0 ^ 2.0)) / l) / V)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif (t_0 <= 5e+300)
tmp = c0 * sqrt(t_0);
else
tmp = sqrt((((A * (c0 ^ 2.0)) / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+300], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(N[(A * N[Power[c0, 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision] / V), $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 \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{\frac{A \cdot {c0}^{2}}{\ell}}{V}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 26.7%
associate-/r*50.5%
sqrt-div36.4%
div-inv36.3%
Applied egg-rr36.3%
associate-*r/36.4%
*-rgt-identity36.4%
Simplified36.4%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000026e300Initial program 99.6%
if 5.00000000000000026e300 < (/.f64 A (*.f64 V l)) Initial program 31.6%
add-sqr-sqrt13.1%
sqrt-unprod13.3%
*-commutative13.3%
*-commutative13.3%
swap-sqr13.1%
add-sqr-sqrt13.1%
pow213.1%
Applied egg-rr13.1%
associate-*l/24.4%
*-commutative24.4%
associate-/r*24.8%
Applied egg-rr24.8%
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 73.7%
herbie shell --seed 2024094
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))