
(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
(let* ((t_0 (sqrt (- A))))
(if (<= (* V l) (- INFINITY))
(* (/ t_0 (sqrt (- V))) (/ c0 (sqrt l)))
(if (<= (* V l) -1e-312)
(* c0 (/ t_0 (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0 (* (sqrt (/ A V)) (sqrt (/ 1.0 l))))
(if (<= (* V l) 5e+301)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ 1.0 (* l (/ V A)))))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt(-A);
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (t_0 / sqrt(-V)) * (c0 / sqrt(l));
} else if ((V * l) <= -1e-312) {
tmp = c0 * (t_0 / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((A / V)) * sqrt((1.0 / l)));
} else if ((V * l) <= 5e+301) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt((1.0 / (l * (V / A))));
}
return tmp;
}
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);
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = (t_0 / Math.sqrt(-V)) * (c0 / Math.sqrt(l));
} else if ((V * l) <= -1e-312) {
tmp = c0 * (t_0 / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.sqrt((A / V)) * Math.sqrt((1.0 / l)));
} else if ((V * l) <= 5e+301) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt((1.0 / (l * (V / A))));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt(-A) tmp = 0 if (V * l) <= -math.inf: tmp = (t_0 / math.sqrt(-V)) * (c0 / math.sqrt(l)) elif (V * l) <= -1e-312: tmp = c0 * (t_0 / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 * (math.sqrt((A / V)) * math.sqrt((1.0 / l))) elif (V * l) <= 5e+301: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt((1.0 / (l * (V / A)))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(-A)) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(t_0 / sqrt(Float64(-V))) * Float64(c0 / sqrt(l))); elseif (Float64(V * l) <= -1e-312) tmp = Float64(c0 * Float64(t_0 / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) * sqrt(Float64(1.0 / l)))); elseif (Float64(V * l) <= 5e+301) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(1.0 / 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 = sqrt(-A);
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (t_0 / sqrt(-V)) * (c0 / sqrt(l));
elseif ((V * l) <= -1e-312)
tmp = c0 * (t_0 / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 * (sqrt((A / V)) * sqrt((1.0 / l)));
elseif ((V * l) <= 5e+301)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt((1.0 / (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[Sqrt[(-A)], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(t$95$0 / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-312], N[(c0 * N[(t$95$0 / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+301], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(1.0 / 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 := \sqrt{-A}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{t\_0}{\sqrt{-V}} \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-312}:\\
\;\;\;\;c0 \cdot \frac{t\_0}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot \sqrt{\frac{1}{\ell}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+301}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 36.8%
associate-/r*73.4%
sqrt-div22.4%
associate-*r/22.5%
Applied egg-rr22.5%
*-commutative22.5%
associate-/l*22.5%
Simplified22.5%
frac-2neg22.5%
sqrt-div33.2%
Applied egg-rr33.2%
if -inf.0 < (*.f64 V l) < -9.9999999999847e-313Initial program 86.2%
frac-2neg86.2%
sqrt-div99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
Applied egg-rr99.2%
if -9.9999999999847e-313 < (*.f64 V l) < -0.0Initial program 31.8%
pow1/231.8%
associate-/r*62.3%
div-inv62.3%
unpow-prod-down43.4%
pow1/243.4%
Applied egg-rr43.4%
unpow1/243.4%
Simplified43.4%
if -0.0 < (*.f64 V l) < 5.0000000000000004e301Initial program 84.9%
sqrt-div99.1%
associate-*r/96.4%
Applied egg-rr96.4%
associate-/l*99.1%
Simplified99.1%
if 5.0000000000000004e301 < (*.f64 V l) Initial program 50.9%
associate-/r*77.1%
div-inv77.1%
Applied egg-rr77.1%
div-inv77.1%
clear-num77.1%
associate-/l/77.1%
Applied egg-rr77.1%
Final simplification86.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 (/ A (* V l))))))
(if (<= t_0 0.0)
(/ c0 (sqrt (* l (/ V A))))
(if (<= t_0 2e+223) 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 <= 0.0) {
tmp = c0 / sqrt((l * (V / A)));
} else if (t_0 <= 2e+223) {
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 <= 0.0d0) then
tmp = c0 / sqrt((l * (v / a)))
else if (t_0 <= 2d+223) 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 <= 0.0) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if (t_0 <= 2e+223) {
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 <= 0.0: tmp = c0 / math.sqrt((l * (V / A))) elif t_0 <= 2e+223: 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 <= 0.0) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (t_0 <= 2e+223) 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 <= 0.0)
tmp = c0 / sqrt((l * (V / A)));
elseif (t_0 <= 2e+223)
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, 0.0], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+223], 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 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+223}:\\
\;\;\;\;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)))) < 0.0Initial program 70.0%
associate-/r*72.4%
div-inv72.4%
Applied egg-rr72.4%
div-inv72.4%
clear-num72.5%
sqrt-div72.9%
metadata-eval72.9%
div-inv72.5%
clear-num73.3%
Applied egg-rr73.3%
un-div-inv73.4%
associate-*r/70.3%
*-commutative70.3%
associate-/l*74.8%
Applied egg-rr74.8%
associate-*r/70.3%
*-commutative70.3%
associate-/l*73.4%
Simplified73.4%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000009e223Initial program 98.7%
if 2.00000000000000009e223 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 45.6%
associate-/r*59.0%
div-inv59.0%
Applied egg-rr59.0%
div-inv59.0%
clear-num59.0%
sqrt-div63.4%
metadata-eval63.4%
div-inv63.3%
clear-num63.3%
Applied egg-rr63.3%
un-div-inv63.4%
associate-*r/49.7%
*-commutative49.7%
associate-/l*63.2%
Applied egg-rr63.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 l))))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+223) 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 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+223) {
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 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+223) 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 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+223) {
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 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+223: 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 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+223) 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 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+223)
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, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+223], 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 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+223}:\\
\;\;\;\;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)))) < 0.0Initial program 70.0%
*-commutative70.0%
associate-/l/72.4%
Simplified72.4%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000009e223Initial program 98.7%
if 2.00000000000000009e223 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 45.6%
associate-/r*59.0%
div-inv59.0%
Applied egg-rr59.0%
div-inv59.0%
clear-num59.0%
sqrt-div63.4%
metadata-eval63.4%
div-inv63.3%
clear-num63.3%
Applied egg-rr63.3%
un-div-inv63.4%
associate-*r/49.7%
*-commutative49.7%
associate-/l*63.2%
Applied egg-rr63.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -1e-312)
(/ (* (/ (sqrt (- A)) (sqrt (- V))) c0) (sqrt l))
(if (<= (* V l) 0.0)
(* c0 (* (sqrt (/ A V)) (sqrt (/ 1.0 l))))
(if (<= (* V l) 5e+301)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ 1.0 (* l (/ V A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e-312) {
tmp = ((sqrt(-A) / sqrt(-V)) * c0) / sqrt(l);
} else if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((A / V)) * sqrt((1.0 / l)));
} else if ((V * l) <= 5e+301) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt((1.0 / (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) :: tmp
if ((v * l) <= (-1d-312)) then
tmp = ((sqrt(-a) / sqrt(-v)) * c0) / sqrt(l)
else if ((v * l) <= 0.0d0) then
tmp = c0 * (sqrt((a / v)) * sqrt((1.0d0 / l)))
else if ((v * l) <= 5d+301) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt((1.0d0 / (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 tmp;
if ((V * l) <= -1e-312) {
tmp = ((Math.sqrt(-A) / Math.sqrt(-V)) * c0) / Math.sqrt(l);
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.sqrt((A / V)) * Math.sqrt((1.0 / l)));
} else if ((V * l) <= 5e+301) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt((1.0 / (l * (V / A))));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e-312: tmp = ((math.sqrt(-A) / math.sqrt(-V)) * c0) / math.sqrt(l) elif (V * l) <= 0.0: tmp = c0 * (math.sqrt((A / V)) * math.sqrt((1.0 / l))) elif (V * l) <= 5e+301: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt((1.0 / (l * (V / 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) <= -1e-312) tmp = Float64(Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * c0) / sqrt(l)); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) * sqrt(Float64(1.0 / l)))); elseif (Float64(V * l) <= 5e+301) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(1.0 / 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)
tmp = 0.0;
if ((V * l) <= -1e-312)
tmp = ((sqrt(-A) / sqrt(-V)) * c0) / sqrt(l);
elseif ((V * l) <= 0.0)
tmp = c0 * (sqrt((A / V)) * sqrt((1.0 / l)));
elseif ((V * l) <= 5e+301)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt((1.0 / (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_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e-312], N[(N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * c0), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+301], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(1.0 / 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}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{-312}:\\
\;\;\;\;\frac{\frac{\sqrt{-A}}{\sqrt{-V}} \cdot c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot \sqrt{\frac{1}{\ell}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+301}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.9999999999847e-313Initial program 77.5%
*-commutative77.5%
associate-/r*74.6%
sqrt-div40.0%
associate-*l/39.0%
Applied egg-rr39.0%
frac-2neg39.0%
sqrt-div47.3%
Applied egg-rr47.3%
if -9.9999999999847e-313 < (*.f64 V l) < -0.0Initial program 31.8%
pow1/231.8%
associate-/r*62.3%
div-inv62.3%
unpow-prod-down43.4%
pow1/243.4%
Applied egg-rr43.4%
unpow1/243.4%
Simplified43.4%
if -0.0 < (*.f64 V l) < 5.0000000000000004e301Initial program 84.9%
sqrt-div99.1%
associate-*r/96.4%
Applied egg-rr96.4%
associate-/l*99.1%
Simplified99.1%
if 5.0000000000000004e301 < (*.f64 V l) Initial program 50.9%
associate-/r*77.1%
div-inv77.1%
Applied egg-rr77.1%
div-inv77.1%
clear-num77.1%
associate-/l/77.1%
Applied egg-rr77.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) (- INFINITY))
(* c0 (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* V l) -1e-312)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0 (* (sqrt (/ A V)) (sqrt (/ 1.0 l))))
(if (<= (* V l) 5e+301)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ 1.0 (* l (/ V 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 / -l)) / sqrt(-V));
} else if ((V * l) <= -1e-312) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((A / V)) * sqrt((1.0 / l)));
} else if ((V * l) <= 5e+301) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt((1.0 / (l * (V / 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 / -l)) / Math.sqrt(-V));
} else if ((V * l) <= -1e-312) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.sqrt((A / V)) * Math.sqrt((1.0 / l)));
} else if ((V * l) <= 5e+301) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt((1.0 / (l * (V / 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 / -l)) / math.sqrt(-V)) elif (V * l) <= -1e-312: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 * (math.sqrt((A / V)) * math.sqrt((1.0 / l))) elif (V * l) <= 5e+301: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt((1.0 / (l * (V / 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(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -1e-312) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) * sqrt(Float64(1.0 / l)))); elseif (Float64(V * l) <= 5e+301) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(1.0 / 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)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= -1e-312)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 * (sqrt((A / V)) * sqrt((1.0 / l)));
elseif ((V * l) <= 5e+301)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt((1.0 / (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_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-312], 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[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+301], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(1.0 / 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}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-312}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot \sqrt{\frac{1}{\ell}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+301}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 36.8%
associate-/r*73.4%
div-inv73.4%
Applied egg-rr73.4%
associate-*l/73.4%
div-inv73.4%
frac-2neg73.4%
sqrt-div22.4%
distribute-neg-frac222.4%
Applied egg-rr22.4%
distribute-frac-neg222.4%
distribute-frac-neg22.4%
Simplified22.4%
if -inf.0 < (*.f64 V l) < -9.9999999999847e-313Initial program 86.2%
frac-2neg86.2%
sqrt-div99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
Applied egg-rr99.2%
if -9.9999999999847e-313 < (*.f64 V l) < -0.0Initial program 31.8%
pow1/231.8%
associate-/r*62.3%
div-inv62.3%
unpow-prod-down43.4%
pow1/243.4%
Applied egg-rr43.4%
unpow1/243.4%
Simplified43.4%
if -0.0 < (*.f64 V l) < 5.0000000000000004e301Initial program 84.9%
sqrt-div99.1%
associate-*r/96.4%
Applied egg-rr96.4%
associate-/l*99.1%
Simplified99.1%
if 5.0000000000000004e301 < (*.f64 V l) Initial program 50.9%
associate-/r*77.1%
div-inv77.1%
Applied egg-rr77.1%
div-inv77.1%
clear-num77.1%
associate-/l/77.1%
Applied egg-rr77.1%
Final simplification86.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 (sqrt (/ A V))))
(if (<= (* V l) -4e+292)
(* (* c0 t_0) (pow l -0.5))
(if (<= (* V l) -1e-312)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0 (* t_0 (sqrt (/ 1.0 l))))
(if (<= (* V l) 1e+255)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (pow (* l (/ V 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) <= -4e+292) {
tmp = (c0 * t_0) * pow(l, -0.5);
} else if ((V * l) <= -1e-312) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (t_0 * sqrt((1.0 / l)));
} else if ((V * l) <= 1e+255) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * pow((l * (V / 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) <= (-4d+292)) then
tmp = (c0 * t_0) * (l ** (-0.5d0))
else if ((v * l) <= (-1d-312)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 * (t_0 * sqrt((1.0d0 / l)))
else if ((v * l) <= 1d+255) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * ((l * (v / 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) <= -4e+292) {
tmp = (c0 * t_0) * Math.pow(l, -0.5);
} else if ((V * l) <= -1e-312) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (t_0 * Math.sqrt((1.0 / l)));
} else if ((V * l) <= 1e+255) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.pow((l * (V / 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) <= -4e+292: tmp = (c0 * t_0) * math.pow(l, -0.5) elif (V * l) <= -1e-312: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 * (t_0 * math.sqrt((1.0 / l))) elif (V * l) <= 1e+255: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.pow((l * (V / 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) <= -4e+292) tmp = Float64(Float64(c0 * t_0) * (l ^ -0.5)); elseif (Float64(V * l) <= -1e-312) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(t_0 * sqrt(Float64(1.0 / l)))); elseif (Float64(V * l) <= 1e+255) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * (Float64(l * Float64(V / 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) <= -4e+292)
tmp = (c0 * t_0) * (l ^ -0.5);
elseif ((V * l) <= -1e-312)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 * (t_0 * sqrt((1.0 / l)));
elseif ((V * l) <= 1e+255)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * ((l * (V / 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], -4e+292], N[(N[(c0 * t$95$0), $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-312], 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[(t$95$0 * N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+255], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / 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 -4 \cdot 10^{+292}:\\
\;\;\;\;\left(c0 \cdot t\_0\right) \cdot {\ell}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-312}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \left(t\_0 \cdot \sqrt{\frac{1}{\ell}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.0000000000000001e292Initial program 43.1%
add-sqr-sqrt43.0%
sqrt-unprod43.1%
*-commutative43.1%
*-commutative43.1%
swap-sqr42.3%
add-sqr-sqrt42.4%
pow242.4%
Applied egg-rr42.4%
associate-/r*47.4%
Simplified47.4%
div-inv47.3%
*-commutative47.3%
sqrt-prod51.8%
sqrt-pow176.0%
metadata-eval76.0%
pow176.0%
sqrt-prod20.2%
associate-*r*20.2%
inv-pow20.2%
sqrt-pow120.3%
metadata-eval20.3%
Applied egg-rr20.3%
if -4.0000000000000001e292 < (*.f64 V l) < -9.9999999999847e-313Initial program 85.9%
frac-2neg85.9%
sqrt-div99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
Applied egg-rr99.2%
if -9.9999999999847e-313 < (*.f64 V l) < -0.0Initial program 31.8%
pow1/231.8%
associate-/r*62.3%
div-inv62.3%
unpow-prod-down43.4%
pow1/243.4%
Applied egg-rr43.4%
unpow1/243.4%
Simplified43.4%
if -0.0 < (*.f64 V l) < 9.99999999999999988e254Initial program 84.3%
sqrt-div99.0%
associate-*r/96.3%
Applied egg-rr96.3%
associate-/l*99.0%
Simplified99.0%
if 9.99999999999999988e254 < (*.f64 V l) Initial program 59.8%
associate-/r*81.2%
div-inv81.2%
Applied egg-rr81.2%
div-inv81.2%
clear-num81.2%
sqrt-div81.2%
metadata-eval81.2%
div-inv81.1%
clear-num81.2%
Applied egg-rr81.2%
inv-pow81.2%
sqrt-pow281.3%
associate-*r/59.8%
*-commutative59.8%
associate-/l*81.4%
metadata-eval81.4%
Applied egg-rr81.4%
associate-*r/59.8%
*-commutative59.8%
associate-/l*81.3%
Simplified81.3%
Final simplification85.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+116)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -5e-186)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) 5e+301)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ 1.0 (* l (/ V A))))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+116) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -5e-186) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 5e+301) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt((1.0 / (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) :: tmp
if ((v * l) <= (-5d+116)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-5d-186)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= 5d+301) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt((1.0d0 / (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 tmp;
if ((V * l) <= -5e+116) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -5e-186) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 5e+301) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt((1.0 / (l * (V / A))));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e+116: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -5e-186: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= 5e+301: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt((1.0 / (l * (V / 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+116) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -5e-186) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 5e+301) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(1.0 / 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)
tmp = 0.0;
if ((V * l) <= -5e+116)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -5e-186)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= 5e+301)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt((1.0 / (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_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e+116], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-186], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+301], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(1.0 / 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}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+116}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-186}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+301}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000025e116Initial program 56.0%
associate-/r*72.8%
sqrt-div35.9%
associate-*r/35.9%
Applied egg-rr35.9%
associate-/l*35.9%
Simplified35.9%
if -5.00000000000000025e116 < (*.f64 V l) < -5e-186Initial program 95.9%
associate-/r*77.3%
div-inv77.3%
Applied egg-rr77.3%
div-inv77.3%
clear-num77.5%
sqrt-div77.2%
metadata-eval77.2%
div-inv77.3%
clear-num79.2%
Applied egg-rr79.2%
un-div-inv79.4%
associate-*r/96.7%
*-commutative96.7%
associate-/l*81.9%
Applied egg-rr81.9%
*-commutative81.9%
associate-*l/96.7%
Applied egg-rr96.7%
if -5e-186 < (*.f64 V l) < -0.0Initial program 42.8%
associate-/r*64.1%
div-inv64.1%
Applied egg-rr64.1%
div-inv64.1%
clear-num64.1%
sqrt-div68.3%
metadata-eval68.3%
div-inv68.3%
clear-num68.3%
Applied egg-rr68.3%
un-div-inv68.4%
sqrt-prod47.4%
associate-/r*47.5%
Applied egg-rr47.5%
associate-/l/47.4%
Simplified47.4%
if -0.0 < (*.f64 V l) < 5.0000000000000004e301Initial program 84.9%
sqrt-div99.1%
associate-*r/96.4%
Applied egg-rr96.4%
associate-/l*99.1%
Simplified99.1%
if 5.0000000000000004e301 < (*.f64 V l) Initial program 50.9%
associate-/r*77.1%
div-inv77.1%
Applied egg-rr77.1%
div-inv77.1%
clear-num77.1%
associate-/l/77.1%
Applied egg-rr77.1%
Final simplification79.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -4e+22)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (/ l (/ A V))))
(if (<= (* V l) 5e+301)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ 1.0 (* l (/ V A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -4e+22) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt((l / (A / V)));
} else if ((V * l) <= 5e+301) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt((1.0 / (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) :: tmp
if ((v * l) <= (-4d+22)) then
tmp = c0 / sqrt((v * (l / a)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / sqrt((l / (a / v)))
else if ((v * l) <= 5d+301) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt((1.0d0 / (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 tmp;
if ((V * l) <= -4e+22) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt((l / (A / V)));
} else if ((V * l) <= 5e+301) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt((1.0 / (l * (V / A))));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -4e+22: tmp = c0 / math.sqrt((V * (l / A))) elif (V * l) <= 0.0: tmp = c0 / math.sqrt((l / (A / V))) elif (V * l) <= 5e+301: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt((1.0 / (l * (V / 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) <= -4e+22) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(l / Float64(A / V)))); elseif (Float64(V * l) <= 5e+301) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(1.0 / 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)
tmp = 0.0;
if ((V * l) <= -4e+22)
tmp = c0 / sqrt((V * (l / A)));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt((l / (A / V)));
elseif ((V * l) <= 5e+301)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt((1.0 / (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_] := If[LessEqual[N[(V * l), $MachinePrecision], -4e+22], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+301], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(1.0 / 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}
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+22}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+301}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4e22Initial program 66.8%
associate-/r*74.0%
div-inv74.0%
Applied egg-rr74.0%
div-inv74.0%
clear-num73.9%
sqrt-div73.9%
metadata-eval73.9%
div-inv73.8%
clear-num74.0%
Applied egg-rr74.0%
un-div-inv74.1%
associate-*r/67.0%
*-commutative67.0%
associate-/l*76.0%
Applied egg-rr76.0%
if -4e22 < (*.f64 V l) < -0.0Initial program 68.4%
associate-/r*70.6%
div-inv70.6%
Applied egg-rr70.6%
div-inv70.6%
clear-num70.7%
sqrt-div72.7%
metadata-eval72.7%
div-inv72.7%
clear-num74.0%
Applied egg-rr74.0%
un-div-inv74.1%
associate-*r/68.9%
*-commutative68.9%
associate-/l*74.5%
Applied egg-rr74.5%
*-commutative74.5%
associate-*l/68.9%
associate-*r/74.1%
clear-num72.7%
un-div-inv72.8%
Applied egg-rr72.8%
if -0.0 < (*.f64 V l) < 5.0000000000000004e301Initial program 84.9%
sqrt-div99.1%
associate-*r/96.4%
Applied egg-rr96.4%
associate-/l*99.1%
Simplified99.1%
if 5.0000000000000004e301 < (*.f64 V l) Initial program 50.9%
associate-/r*77.1%
div-inv77.1%
Applied egg-rr77.1%
div-inv77.1%
clear-num77.1%
associate-/l/77.1%
Applied egg-rr77.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) 0.0)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) 1e+255)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (pow (* l (/ V 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) <= 0.0) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= 1e+255) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * pow((l * (V / 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) <= 0.0d0) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= 1d+255) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * ((l * (v / 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) <= 0.0) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= 1e+255) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.pow((l * (V / 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) <= 0.0: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= 1e+255: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.pow((l * (V / 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) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= 1e+255) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * (Float64(l * Float64(V / 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) <= 0.0)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= 1e+255)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * ((l * (V / 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], 0.0], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+255], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / 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 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+255}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -0.0Initial program 67.8%
associate-/r*72.0%
sqrt-div40.7%
associate-*r/39.9%
Applied egg-rr39.9%
associate-/l*40.7%
Simplified40.7%
if -0.0 < (*.f64 V l) < 9.99999999999999988e254Initial program 84.3%
sqrt-div99.0%
associate-*r/96.3%
Applied egg-rr96.3%
associate-/l*99.0%
Simplified99.0%
if 9.99999999999999988e254 < (*.f64 V l) Initial program 59.8%
associate-/r*81.2%
div-inv81.2%
Applied egg-rr81.2%
div-inv81.2%
clear-num81.2%
sqrt-div81.2%
metadata-eval81.2%
div-inv81.1%
clear-num81.2%
Applied egg-rr81.2%
inv-pow81.2%
sqrt-pow281.3%
associate-*r/59.8%
*-commutative59.8%
associate-/l*81.4%
metadata-eval81.4%
Applied egg-rr81.4%
associate-*r/59.8%
*-commutative59.8%
associate-/l*81.3%
Simplified81.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 1e+299)))
(* c0 (sqrt (/ (/ A V) l)))
(* c0 (sqrt t_0)))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 1e+299)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 1d+299))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 1e+299)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 1e+299): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.sqrt(t_0) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 1e+299)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 1e+299)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 1e+299]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 10^{+299}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 1.0000000000000001e299 < (/.f64 A (*.f64 V l)) Initial program 36.6%
*-commutative36.6%
associate-/l/55.6%
Simplified55.6%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.0000000000000001e299Initial program 99.2%
Final simplification81.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 1e-308)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 1e+298)
(/ c0 (sqrt (/ (* V l) A)))
(/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-308) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 1e+298) {
tmp = c0 / sqrt(((V * l) / A));
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 1d-308) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 1d+298) then
tmp = c0 / sqrt(((v * l) / a))
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-308) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 1e+298) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 1e-308: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 1e+298: tmp = c0 / math.sqrt(((V * l) / A)) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 1e-308) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 1e+298) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-308)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 1e+298)
tmp = c0 / sqrt(((V * l) / A));
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-308], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+298], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 10^{-308}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 10^{+298}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.9999999999999991e-309Initial program 39.8%
Taylor expanded in c0 around 0 39.8%
*-commutative39.8%
associate-/r*61.6%
Simplified61.6%
if 9.9999999999999991e-309 < (/.f64 A (*.f64 V l)) < 9.9999999999999996e297Initial program 99.5%
associate-/r*85.8%
div-inv85.8%
Applied egg-rr85.8%
div-inv85.8%
clear-num85.9%
sqrt-div85.8%
metadata-eval85.8%
div-inv85.3%
clear-num87.0%
Applied egg-rr87.0%
un-div-inv87.0%
associate-*r/99.7%
*-commutative99.7%
associate-/l*90.3%
Applied egg-rr90.3%
*-commutative90.3%
associate-*l/99.7%
Applied egg-rr99.7%
if 9.9999999999999996e297 < (/.f64 A (*.f64 V l)) Initial program 37.1%
associate-/r*52.3%
div-inv52.3%
Applied egg-rr52.3%
div-inv52.3%
clear-num52.3%
sqrt-div57.0%
metadata-eval57.0%
div-inv57.0%
clear-num57.0%
Applied egg-rr57.0%
un-div-inv57.1%
associate-*r/40.8%
*-commutative40.8%
associate-/l*57.6%
Applied egg-rr57.6%
Final simplification82.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 (/ A (* V l))))
(if (<= t_0 1e-308)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 1e+299) (* c0 (sqrt t_0)) (* c0 (sqrt (/ (/ A V) l)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-308) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 1e+299) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 1d-308) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 1d+299) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * sqrt(((a / v) / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-308) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 1e+299) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 1e-308: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 1e+299: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 1e-308) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 1e+299) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-308)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 1e+299)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-308], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+299], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 10^{-308}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 10^{+299}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.9999999999999991e-309Initial program 39.8%
Taylor expanded in c0 around 0 39.8%
*-commutative39.8%
associate-/r*61.6%
Simplified61.6%
if 9.9999999999999991e-309 < (/.f64 A (*.f64 V l)) < 1.0000000000000001e299Initial program 99.5%
if 1.0000000000000001e299 < (/.f64 A (*.f64 V l)) Initial program 36.0%
*-commutative36.0%
associate-/l/51.5%
Simplified51.5%
Final simplification81.5%
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.8%
herbie shell --seed 2024157
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))