
(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 16 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 (<= A -1e-310) (* (/ (sqrt (- A)) (sqrt (- V))) (* c0 (pow l -0.5))) (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-310) {
tmp = (sqrt(-A) / sqrt(-V)) * (c0 * pow(l, -0.5));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-1d-310)) then
tmp = (sqrt(-a) / sqrt(-v)) * (c0 * (l ** (-0.5d0)))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-310) {
tmp = (Math.sqrt(-A) / Math.sqrt(-V)) * (c0 * Math.pow(l, -0.5));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -1e-310: tmp = (math.sqrt(-A) / math.sqrt(-V)) * (c0 * math.pow(l, -0.5)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -1e-310) tmp = Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * Float64(c0 * (l ^ -0.5))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -1e-310)
tmp = (sqrt(-A) / sqrt(-V)) * (c0 * (l ^ -0.5));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -1e-310], N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * N[(c0 * N[Power[l, -0.5], $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}:\\
\;\;\;\;\frac{\sqrt{-A}}{\sqrt{-V}} \cdot \left(c0 \cdot {\ell}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -9.999999999999969e-311Initial program 79.8%
*-commutative79.8%
associate-/r*76.5%
sqrt-div39.9%
associate-*l/40.0%
Applied egg-rr40.0%
div-inv39.9%
*-commutative39.9%
pow1/239.9%
pow-flip40.0%
metadata-eval40.0%
Applied egg-rr40.0%
*-commutative40.0%
associate-*l*38.6%
Simplified38.6%
frac-2neg38.6%
sqrt-div45.2%
Applied egg-rr45.2%
if -9.999999999999969e-311 < A Initial program 72.7%
sqrt-div83.9%
div-inv83.9%
Applied egg-rr83.9%
associate-*r/83.9%
*-rgt-identity83.9%
Simplified83.9%
Final simplification64.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 1e-305)
(/ c0 (sqrt (* V (/ l A))))
(if (<= t_0 5e+241) t_0 (/ c0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 1e-305) {
tmp = c0 / sqrt((V * (l / A)));
} else if (t_0 <= 5e+241) {
tmp = t_0;
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 1d-305) then
tmp = c0 / sqrt((v * (l / a)))
else if (t_0 <= 5d+241) then
tmp = t_0
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 1e-305) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if (t_0 <= 5e+241) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 1e-305: tmp = c0 / math.sqrt((V * (l / A))) elif t_0 <= 5e+241: tmp = t_0 else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 1e-305) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (t_0 <= 5e+241) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 1e-305)
tmp = c0 / sqrt((V * (l / A)));
elseif (t_0 <= 5e+241)
tmp = t_0;
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-305], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+241], t$95$0, N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 10^{-305}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+241}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.99999999999999996e-306Initial program 71.0%
associate-/r*69.7%
clear-num69.7%
sqrt-div70.0%
metadata-eval70.0%
div-inv70.0%
clear-num70.3%
Applied egg-rr70.3%
*-commutative70.3%
associate-*l/71.2%
associate-/l*73.2%
Simplified73.2%
un-div-inv73.3%
associate-*r/71.3%
Applied egg-rr71.3%
associate-/l*73.3%
Simplified73.3%
if 9.99999999999999996e-306 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.00000000000000025e241Initial program 98.7%
if 5.00000000000000025e241 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 51.4%
associate-/r*50.8%
clear-num50.7%
sqrt-div52.0%
metadata-eval52.0%
div-inv52.1%
clear-num52.0%
Applied egg-rr52.0%
*-commutative52.0%
associate-*l/57.7%
associate-/l*59.9%
Simplified59.9%
un-div-inv59.9%
associate-*r/57.7%
Applied egg-rr57.7%
*-commutative57.7%
associate-/l*52.1%
Applied egg-rr52.1%
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 (if (<= A -1e-310) (/ (* (/ (sqrt (- A)) (sqrt (- V))) c0) (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 = ((sqrt(-A) / sqrt(-V)) * c0) / 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 = ((sqrt(-a) / sqrt(-v)) * c0) / 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 = ((Math.sqrt(-A) / Math.sqrt(-V)) * c0) / 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 = ((math.sqrt(-A) / math.sqrt(-V)) * c0) / 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(Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * c0) / 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 = ((sqrt(-A) / sqrt(-V)) * c0) / 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[(N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * c0), $MachinePrecision] / N[Sqrt[l], $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}:\\
\;\;\;\;\frac{\frac{\sqrt{-A}}{\sqrt{-V}} \cdot c0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -9.999999999999969e-311Initial program 79.8%
*-commutative79.8%
associate-/r*76.5%
sqrt-div39.9%
associate-*l/40.0%
Applied egg-rr40.0%
frac-2neg38.6%
sqrt-div45.2%
Applied egg-rr45.9%
if -9.999999999999969e-311 < A Initial program 72.7%
sqrt-div83.9%
div-inv83.9%
Applied egg-rr83.9%
associate-*r/83.9%
*-rgt-identity83.9%
Simplified83.9%
Final simplification64.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (/ A V))))
(if (<= (* V l) -5e+144)
(* (* c0 (pow l -0.5)) t_0)
(if (<= (* V l) -1e-139)
(/ 1.0 (/ (sqrt (/ (* V l) A)) c0))
(if (<= (* V l) 1e-276)
(* t_0 (/ c0 (sqrt l)))
(if (<= (* V l) 1e+226)
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 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 / V));
double tmp;
if ((V * l) <= -5e+144) {
tmp = (c0 * pow(l, -0.5)) * t_0;
} else if ((V * l) <= -1e-139) {
tmp = 1.0 / (sqrt(((V * l) / A)) / c0);
} else if ((V * l) <= 1e-276) {
tmp = t_0 * (c0 / sqrt(l));
} else if ((V * l) <= 1e+226) {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-5d+144)) then
tmp = (c0 * (l ** (-0.5d0))) * t_0
else if ((v * l) <= (-1d-139)) then
tmp = 1.0d0 / (sqrt(((v * l) / a)) / c0)
else if ((v * l) <= 1d-276) then
tmp = t_0 * (c0 / sqrt(l))
else if ((v * l) <= 1d+226) then
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / 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 t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -5e+144) {
tmp = (c0 * Math.pow(l, -0.5)) * t_0;
} else if ((V * l) <= -1e-139) {
tmp = 1.0 / (Math.sqrt(((V * l) / A)) / c0);
} else if ((V * l) <= 1e-276) {
tmp = t_0 * (c0 / Math.sqrt(l));
} else if ((V * l) <= 1e+226) {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / 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 / V)) tmp = 0 if (V * l) <= -5e+144: tmp = (c0 * math.pow(l, -0.5)) * t_0 elif (V * l) <= -1e-139: tmp = 1.0 / (math.sqrt(((V * l) / A)) / c0) elif (V * l) <= 1e-276: tmp = t_0 * (c0 / math.sqrt(l)) elif (V * l) <= 1e+226: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / 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 / V)) tmp = 0.0 if (Float64(V * l) <= -5e+144) tmp = Float64(Float64(c0 * (l ^ -0.5)) * t_0); elseif (Float64(V * l) <= -1e-139) tmp = Float64(1.0 / Float64(sqrt(Float64(Float64(V * l) / A)) / c0)); elseif (Float64(V * l) <= 1e-276) tmp = Float64(t_0 * Float64(c0 / sqrt(l))); elseif (Float64(V * l) <= 1e+226) tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / 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 / V));
tmp = 0.0;
if ((V * l) <= -5e+144)
tmp = (c0 * (l ^ -0.5)) * t_0;
elseif ((V * l) <= -1e-139)
tmp = 1.0 / (sqrt(((V * l) / A)) / c0);
elseif ((V * l) <= 1e-276)
tmp = t_0 * (c0 / sqrt(l));
elseif ((V * l) <= 1e+226)
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+144], N[(N[(c0 * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-139], N[(1.0 / N[(N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-276], N[(t$95$0 * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+226], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+144}:\\
\;\;\;\;\left(c0 \cdot {\ell}^{-0.5}\right) \cdot t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-139}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V \cdot \ell}{A}}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-276}:\\
\;\;\;\;t\_0 \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+226}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999999e144Initial program 69.6%
*-commutative69.6%
associate-/r*67.3%
sqrt-div45.1%
associate-*l/45.3%
Applied egg-rr45.3%
div-inv45.2%
*-commutative45.2%
pow1/245.2%
pow-flip45.3%
metadata-eval45.3%
Applied egg-rr45.3%
*-commutative45.3%
associate-*l*45.3%
Simplified45.3%
if -4.9999999999999999e144 < (*.f64 V l) < -1.00000000000000003e-139Initial program 95.7%
associate-/r*85.4%
clear-num85.4%
sqrt-div85.4%
metadata-eval85.4%
div-inv84.3%
clear-num85.3%
Applied egg-rr85.3%
*-commutative85.3%
associate-*l/97.2%
associate-/l*84.1%
Simplified84.1%
un-div-inv84.1%
clear-num84.1%
associate-*r/97.4%
Applied egg-rr97.4%
if -1.00000000000000003e-139 < (*.f64 V l) < 1e-276Initial program 66.2%
associate-/r*71.8%
sqrt-div39.6%
associate-*r/39.6%
Applied egg-rr39.6%
*-commutative39.6%
associate-/l*39.7%
Simplified39.7%
if 1e-276 < (*.f64 V l) < 9.99999999999999961e225Initial program 83.0%
div-inv82.9%
sqrt-prod99.5%
associate-/r*99.6%
Applied egg-rr99.6%
if 9.99999999999999961e225 < (*.f64 V l) Initial program 52.3%
*-un-lft-identity52.3%
times-frac79.7%
Applied egg-rr79.7%
associate-*r/79.7%
div-inv79.7%
associate-*l/79.6%
*-un-lft-identity79.6%
clear-num79.7%
associate-*l/79.8%
*-un-lft-identity79.8%
Applied egg-rr79.8%
Final simplification74.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* (sqrt (/ A V)) (/ c0 (sqrt l)))))
(if (<= (* V l) -5e+143)
t_0
(if (<= (* V l) -1e-139)
(/ 1.0 (/ (sqrt (/ (* V l) A)) c0))
(if (<= (* V l) 2e-318)
t_0
(if (<= (* V l) 1e+226)
(* 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 / V)) * (c0 / sqrt(l));
double tmp;
if ((V * l) <= -5e+143) {
tmp = t_0;
} else if ((V * l) <= -1e-139) {
tmp = 1.0 / (sqrt(((V * l) / A)) / c0);
} else if ((V * l) <= 2e-318) {
tmp = t_0;
} else if ((V * l) <= 1e+226) {
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) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v)) * (c0 / sqrt(l))
if ((v * l) <= (-5d+143)) then
tmp = t_0
else if ((v * l) <= (-1d-139)) then
tmp = 1.0d0 / (sqrt(((v * l) / a)) / c0)
else if ((v * l) <= 2d-318) then
tmp = t_0
else if ((v * l) <= 1d+226) 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 t_0 = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
double tmp;
if ((V * l) <= -5e+143) {
tmp = t_0;
} else if ((V * l) <= -1e-139) {
tmp = 1.0 / (Math.sqrt(((V * l) / A)) / c0);
} else if ((V * l) <= 2e-318) {
tmp = t_0;
} else if ((V * l) <= 1e+226) {
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 / V)) * (c0 / math.sqrt(l)) tmp = 0 if (V * l) <= -5e+143: tmp = t_0 elif (V * l) <= -1e-139: tmp = 1.0 / (math.sqrt(((V * l) / A)) / c0) elif (V * l) <= 2e-318: tmp = t_0 elif (V * l) <= 1e+226: 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 = Float64(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -5e+143) tmp = t_0; elseif (Float64(V * l) <= -1e-139) tmp = Float64(1.0 / Float64(sqrt(Float64(Float64(V * l) / A)) / c0)); elseif (Float64(V * l) <= 2e-318) tmp = t_0; elseif (Float64(V * l) <= 1e+226) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / 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 / V)) * (c0 / sqrt(l));
tmp = 0.0;
if ((V * l) <= -5e+143)
tmp = t_0;
elseif ((V * l) <= -1e-139)
tmp = 1.0 / (sqrt(((V * l) / A)) / c0);
elseif ((V * l) <= 2e-318)
tmp = t_0;
elseif ((V * l) <= 1e+226)
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[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+143], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-139], N[(1.0 / N[(N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-318], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 1e+226], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+143}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-139}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V \cdot \ell}{A}}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-318}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+226}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000012e143 or -1.00000000000000003e-139 < (*.f64 V l) < 2.0000024e-318Initial program 68.2%
associate-/r*69.6%
sqrt-div40.2%
associate-*r/40.3%
Applied egg-rr40.3%
*-commutative40.3%
associate-/l*40.3%
Simplified40.3%
if -5.00000000000000012e143 < (*.f64 V l) < -1.00000000000000003e-139Initial program 95.6%
associate-/r*87.1%
clear-num87.1%
sqrt-div87.1%
metadata-eval87.1%
div-inv86.0%
clear-num86.0%
Applied egg-rr86.0%
*-commutative86.0%
associate-*l/97.2%
associate-/l*83.7%
Simplified83.7%
un-div-inv83.7%
clear-num83.8%
associate-*r/97.4%
Applied egg-rr97.4%
if 2.0000024e-318 < (*.f64 V l) < 9.99999999999999961e225Initial program 82.3%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 9.99999999999999961e225 < (*.f64 V l) Initial program 52.3%
*-un-lft-identity52.3%
times-frac79.7%
Applied egg-rr79.7%
associate-*r/79.7%
div-inv79.7%
associate-*l/79.6%
*-un-lft-identity79.6%
clear-num79.7%
associate-*l/79.8%
*-un-lft-identity79.8%
Applied egg-rr79.8%
Final simplification74.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 (sqrt (/ A V))))
(if (<= (* V l) -5e+143)
(/ (* c0 t_0) (sqrt l))
(if (<= (* V l) -1e-139)
(/ 1.0 (/ (sqrt (/ (* V l) A)) c0))
(if (<= (* V l) 2e-318)
(* t_0 (/ c0 (sqrt l)))
(if (<= (* V l) 1e+226)
(* 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 / V));
double tmp;
if ((V * l) <= -5e+143) {
tmp = (c0 * t_0) / sqrt(l);
} else if ((V * l) <= -1e-139) {
tmp = 1.0 / (sqrt(((V * l) / A)) / c0);
} else if ((V * l) <= 2e-318) {
tmp = t_0 * (c0 / sqrt(l));
} else if ((V * l) <= 1e+226) {
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) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-5d+143)) then
tmp = (c0 * t_0) / sqrt(l)
else if ((v * l) <= (-1d-139)) then
tmp = 1.0d0 / (sqrt(((v * l) / a)) / c0)
else if ((v * l) <= 2d-318) then
tmp = t_0 * (c0 / sqrt(l))
else if ((v * l) <= 1d+226) 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 t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -5e+143) {
tmp = (c0 * t_0) / Math.sqrt(l);
} else if ((V * l) <= -1e-139) {
tmp = 1.0 / (Math.sqrt(((V * l) / A)) / c0);
} else if ((V * l) <= 2e-318) {
tmp = t_0 * (c0 / Math.sqrt(l));
} else if ((V * l) <= 1e+226) {
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 / V)) tmp = 0 if (V * l) <= -5e+143: tmp = (c0 * t_0) / math.sqrt(l) elif (V * l) <= -1e-139: tmp = 1.0 / (math.sqrt(((V * l) / A)) / c0) elif (V * l) <= 2e-318: tmp = t_0 * (c0 / math.sqrt(l)) elif (V * l) <= 1e+226: 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 / V)) tmp = 0.0 if (Float64(V * l) <= -5e+143) tmp = Float64(Float64(c0 * t_0) / sqrt(l)); elseif (Float64(V * l) <= -1e-139) tmp = Float64(1.0 / Float64(sqrt(Float64(Float64(V * l) / A)) / c0)); elseif (Float64(V * l) <= 2e-318) tmp = Float64(t_0 * Float64(c0 / sqrt(l))); elseif (Float64(V * l) <= 1e+226) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / 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 / V));
tmp = 0.0;
if ((V * l) <= -5e+143)
tmp = (c0 * t_0) / sqrt(l);
elseif ((V * l) <= -1e-139)
tmp = 1.0 / (sqrt(((V * l) / A)) / c0);
elseif ((V * l) <= 2e-318)
tmp = t_0 * (c0 / sqrt(l));
elseif ((V * l) <= 1e+226)
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[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+143], N[(N[(c0 * t$95$0), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-139], N[(1.0 / N[(N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-318], N[(t$95$0 * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+226], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+143}:\\
\;\;\;\;\frac{c0 \cdot t\_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-139}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V \cdot \ell}{A}}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-318}:\\
\;\;\;\;t\_0 \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+226}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000012e143Initial program 70.4%
*-commutative70.4%
associate-/r*65.7%
sqrt-div44.0%
associate-*l/44.2%
Applied egg-rr44.2%
if -5.00000000000000012e143 < (*.f64 V l) < -1.00000000000000003e-139Initial program 95.6%
associate-/r*87.1%
clear-num87.1%
sqrt-div87.1%
metadata-eval87.1%
div-inv86.0%
clear-num86.0%
Applied egg-rr86.0%
*-commutative86.0%
associate-*l/97.2%
associate-/l*83.7%
Simplified83.7%
un-div-inv83.7%
clear-num83.8%
associate-*r/97.4%
Applied egg-rr97.4%
if -1.00000000000000003e-139 < (*.f64 V l) < 2.0000024e-318Initial program 66.6%
associate-/r*72.5%
sqrt-div37.5%
associate-*r/37.5%
Applied egg-rr37.5%
*-commutative37.5%
associate-/l*37.5%
Simplified37.5%
if 2.0000024e-318 < (*.f64 V l) < 9.99999999999999961e225Initial program 82.3%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 9.99999999999999961e225 < (*.f64 V l) Initial program 52.3%
*-un-lft-identity52.3%
times-frac79.7%
Applied egg-rr79.7%
associate-*r/79.7%
div-inv79.7%
associate-*l/79.6%
*-un-lft-identity79.6%
clear-num79.7%
associate-*l/79.8%
*-un-lft-identity79.8%
Applied egg-rr79.8%
Final simplification74.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 (sqrt (/ A V))))
(if (<= (* V l) -5e+144)
(* (* c0 (pow l -0.5)) t_0)
(if (<= (* V l) -1e-139)
(/ 1.0 (/ (sqrt (/ (* V l) A)) c0))
(if (<= (* V l) 2e-318)
(* t_0 (/ c0 (sqrt l)))
(if (<= (* V l) 1e+226)
(* 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 / V));
double tmp;
if ((V * l) <= -5e+144) {
tmp = (c0 * pow(l, -0.5)) * t_0;
} else if ((V * l) <= -1e-139) {
tmp = 1.0 / (sqrt(((V * l) / A)) / c0);
} else if ((V * l) <= 2e-318) {
tmp = t_0 * (c0 / sqrt(l));
} else if ((V * l) <= 1e+226) {
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) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-5d+144)) then
tmp = (c0 * (l ** (-0.5d0))) * t_0
else if ((v * l) <= (-1d-139)) then
tmp = 1.0d0 / (sqrt(((v * l) / a)) / c0)
else if ((v * l) <= 2d-318) then
tmp = t_0 * (c0 / sqrt(l))
else if ((v * l) <= 1d+226) 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 t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -5e+144) {
tmp = (c0 * Math.pow(l, -0.5)) * t_0;
} else if ((V * l) <= -1e-139) {
tmp = 1.0 / (Math.sqrt(((V * l) / A)) / c0);
} else if ((V * l) <= 2e-318) {
tmp = t_0 * (c0 / Math.sqrt(l));
} else if ((V * l) <= 1e+226) {
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 / V)) tmp = 0 if (V * l) <= -5e+144: tmp = (c0 * math.pow(l, -0.5)) * t_0 elif (V * l) <= -1e-139: tmp = 1.0 / (math.sqrt(((V * l) / A)) / c0) elif (V * l) <= 2e-318: tmp = t_0 * (c0 / math.sqrt(l)) elif (V * l) <= 1e+226: 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 / V)) tmp = 0.0 if (Float64(V * l) <= -5e+144) tmp = Float64(Float64(c0 * (l ^ -0.5)) * t_0); elseif (Float64(V * l) <= -1e-139) tmp = Float64(1.0 / Float64(sqrt(Float64(Float64(V * l) / A)) / c0)); elseif (Float64(V * l) <= 2e-318) tmp = Float64(t_0 * Float64(c0 / sqrt(l))); elseif (Float64(V * l) <= 1e+226) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / 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 / V));
tmp = 0.0;
if ((V * l) <= -5e+144)
tmp = (c0 * (l ^ -0.5)) * t_0;
elseif ((V * l) <= -1e-139)
tmp = 1.0 / (sqrt(((V * l) / A)) / c0);
elseif ((V * l) <= 2e-318)
tmp = t_0 * (c0 / sqrt(l));
elseif ((V * l) <= 1e+226)
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[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+144], N[(N[(c0 * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-139], N[(1.0 / N[(N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-318], N[(t$95$0 * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+226], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+144}:\\
\;\;\;\;\left(c0 \cdot {\ell}^{-0.5}\right) \cdot t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-139}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{V \cdot \ell}{A}}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-318}:\\
\;\;\;\;t\_0 \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+226}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999999e144Initial program 69.6%
*-commutative69.6%
associate-/r*67.3%
sqrt-div45.1%
associate-*l/45.3%
Applied egg-rr45.3%
div-inv45.2%
*-commutative45.2%
pow1/245.2%
pow-flip45.3%
metadata-eval45.3%
Applied egg-rr45.3%
*-commutative45.3%
associate-*l*45.3%
Simplified45.3%
if -4.9999999999999999e144 < (*.f64 V l) < -1.00000000000000003e-139Initial program 95.7%
associate-/r*85.4%
clear-num85.4%
sqrt-div85.4%
metadata-eval85.4%
div-inv84.3%
clear-num85.3%
Applied egg-rr85.3%
*-commutative85.3%
associate-*l/97.2%
associate-/l*84.1%
Simplified84.1%
un-div-inv84.1%
clear-num84.1%
associate-*r/97.4%
Applied egg-rr97.4%
if -1.00000000000000003e-139 < (*.f64 V l) < 2.0000024e-318Initial program 66.6%
associate-/r*72.5%
sqrt-div37.5%
associate-*r/37.5%
Applied egg-rr37.5%
*-commutative37.5%
associate-/l*37.5%
Simplified37.5%
if 2.0000024e-318 < (*.f64 V l) < 9.99999999999999961e225Initial program 82.3%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 9.99999999999999961e225 < (*.f64 V l) Initial program 52.3%
*-un-lft-identity52.3%
times-frac79.7%
Applied egg-rr79.7%
associate-*r/79.7%
div-inv79.7%
associate-*l/79.6%
*-un-lft-identity79.6%
clear-num79.7%
associate-*l/79.8%
*-un-lft-identity79.8%
Applied egg-rr79.8%
Final simplification74.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2e-313)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-322)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= (* V l) 1e+226)
(* 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) <= -2e-313) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-322) {
tmp = c0 * sqrt(((A / V) / l));
} else if ((V * l) <= 1e+226) {
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) <= (-2d-313)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 5d-322) then
tmp = c0 * sqrt(((a / v) / l))
else if ((v * l) <= 1d+226) 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) <= -2e-313) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-322) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if ((V * l) <= 1e+226) {
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) <= -2e-313: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-322: tmp = c0 * math.sqrt(((A / V) / l)) elif (V * l) <= 1e+226: 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) <= -2e-313) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-322) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (Float64(V * l) <= 1e+226) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / 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) <= -2e-313)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-322)
tmp = c0 * sqrt(((A / V) / l));
elseif ((V * l) <= 1e+226)
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], -2e-313], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-322], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+226], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / 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 -2 \cdot 10^{-313}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-322}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+226}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.99999999998e-313Initial program 85.1%
frac-2neg85.1%
sqrt-div94.2%
distribute-rgt-neg-in94.2%
Applied egg-rr94.2%
distribute-rgt-neg-out94.2%
*-commutative94.2%
distribute-rgt-neg-in94.2%
Simplified94.2%
if -1.99999999998e-313 < (*.f64 V l) < 4.99006e-322Initial program 48.9%
associate-/r*60.1%
Simplified60.1%
if 4.99006e-322 < (*.f64 V l) < 9.99999999999999961e225Initial program 81.4%
sqrt-div98.9%
div-inv98.7%
Applied egg-rr98.7%
associate-*r/98.9%
*-rgt-identity98.9%
Simplified98.9%
if 9.99999999999999961e225 < (*.f64 V l) Initial program 52.3%
*-un-lft-identity52.3%
times-frac79.7%
Applied egg-rr79.7%
associate-*r/79.7%
div-inv79.7%
associate-*l/79.6%
*-un-lft-identity79.6%
clear-num79.7%
associate-*l/79.8%
*-un-lft-identity79.8%
Applied egg-rr79.8%
Final simplification90.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-322)
(* c0 (pow (/ (* V l) A) -0.5))
(if (<= (* V l) 1e+226)
(* 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-322) {
tmp = c0 * pow(((V * l) / A), -0.5);
} else if ((V * l) <= 1e+226) {
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-322) then
tmp = c0 * (((v * l) / a) ** (-0.5d0))
else if ((v * l) <= 1d+226) 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-322) {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
} else if ((V * l) <= 1e+226) {
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-322: tmp = c0 * math.pow(((V * l) / A), -0.5) elif (V * l) <= 1e+226: 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-322) tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); elseif (Float64(V * l) <= 1e+226) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / 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-322)
tmp = c0 * (((V * l) / A) ^ -0.5);
elseif ((V * l) <= 1e+226)
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-322], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+226], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / 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^{-322}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+226}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < 4.99006e-322Initial program 77.9%
associate-/r*75.9%
clear-num75.7%
sqrt-div75.6%
metadata-eval75.6%
div-inv75.2%
clear-num75.6%
Applied egg-rr75.6%
*-commutative75.6%
associate-*l/78.1%
associate-/l*75.8%
Simplified75.8%
pow1/275.8%
pow-flip75.8%
associate-*r/78.2%
metadata-eval78.2%
Applied egg-rr78.2%
if 4.99006e-322 < (*.f64 V l) < 9.99999999999999961e225Initial program 81.4%
sqrt-div98.9%
div-inv98.7%
Applied egg-rr98.7%
associate-*r/98.9%
*-rgt-identity98.9%
Simplified98.9%
if 9.99999999999999961e225 < (*.f64 V l) Initial program 52.3%
*-un-lft-identity52.3%
times-frac79.7%
Applied egg-rr79.7%
associate-*r/79.7%
div-inv79.7%
associate-*l/79.6%
*-un-lft-identity79.6%
clear-num79.7%
associate-*l/79.8%
*-un-lft-identity79.8%
Applied egg-rr79.8%
Final simplification85.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 (/ (/ 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) {
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) 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) {
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: 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) 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)
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[LessEqual[t$95$0, 0.0], 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:\\
\;\;\;\;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.0Initial program 70.9%
associate-/r*69.5%
Simplified69.5%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 84.3%
Final simplification75.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 (<= t_0 1e-305) (/ c0 (sqrt (* V (/ l A)))) 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 <= 1e-305) {
tmp = c0 / sqrt((V * (l / A)));
} 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 <= 1d-305) then
tmp = c0 / sqrt((v * (l / a)))
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 <= 1e-305) {
tmp = c0 / Math.sqrt((V * (l / A)));
} 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 <= 1e-305: tmp = c0 / math.sqrt((V * (l / A))) 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 <= 1e-305) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); 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 <= 1e-305)
tmp = c0 / sqrt((V * (l / A)));
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[LessEqual[t$95$0, 1e-305], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $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 10^{-305}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.99999999999999996e-306Initial program 71.0%
associate-/r*69.7%
clear-num69.7%
sqrt-div70.0%
metadata-eval70.0%
div-inv70.0%
clear-num70.3%
Applied egg-rr70.3%
*-commutative70.3%
associate-*l/71.2%
associate-/l*73.2%
Simplified73.2%
un-div-inv73.3%
associate-*r/71.3%
Applied egg-rr71.3%
associate-/l*73.3%
Simplified73.3%
if 9.99999999999999996e-306 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 84.2%
Final simplification77.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -1e-310) (* c0 (* (sqrt (/ A V)) (sqrt (/ 1.0 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 / V)) * sqrt((1.0 / 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 / v)) * sqrt((1.0d0 / 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 / V)) * Math.sqrt((1.0 / 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 / V)) * math.sqrt((1.0 / 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(sqrt(Float64(A / V)) * sqrt(Float64(1.0 / 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 / V)) * sqrt((1.0 / 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[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(1.0 / l), $MachinePrecision]], $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 \left(\sqrt{\frac{A}{V}} \cdot \sqrt{\frac{1}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -9.999999999999969e-311Initial program 79.8%
pow1/279.8%
associate-/r*76.5%
div-inv76.5%
unpow-prod-down39.9%
pow1/239.9%
Applied egg-rr39.9%
unpow1/239.9%
Simplified39.9%
if -9.999999999999969e-311 < A Initial program 72.7%
sqrt-div83.9%
div-inv83.9%
Applied egg-rr83.9%
associate-*r/83.9%
*-rgt-identity83.9%
Simplified83.9%
Final simplification61.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= (/ A (* V l)) 2e-310) (* c0 (sqrt (/ (/ 1.0 l) (/ V A)))) (* c0 (pow (/ (* V l) A) -0.5))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((A / (V * l)) <= 2e-310) {
tmp = c0 * sqrt(((1.0 / l) / (V / A)));
} else {
tmp = c0 * pow(((V * l) / A), -0.5);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((a / (v * l)) <= 2d-310) then
tmp = c0 * sqrt(((1.0d0 / l) / (v / a)))
else
tmp = c0 * (((v * l) / a) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((A / (V * l)) <= 2e-310) {
tmp = c0 * Math.sqrt(((1.0 / l) / (V / A)));
} else {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (A / (V * l)) <= 2e-310: tmp = c0 * math.sqrt(((1.0 / l) / (V / A))) else: tmp = c0 * math.pow(((V * l) / A), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(A / Float64(V * l)) <= 2e-310) tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / l) / Float64(V / A)))); else tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((A / (V * l)) <= 2e-310)
tmp = c0 * sqrt(((1.0 / l) / (V / A)));
else
tmp = c0 * (((V * l) / A) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision], 2e-310], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{A}{V \cdot \ell} \leq 2 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 1.999999999999994e-310Initial program 38.9%
*-un-lft-identity38.9%
times-frac55.8%
Applied egg-rr55.8%
associate-*r/54.1%
div-inv54.1%
associate-*l/54.1%
*-un-lft-identity54.1%
clear-num54.1%
associate-*l/54.1%
*-un-lft-identity54.1%
Applied egg-rr54.1%
if 1.999999999999994e-310 < (/.f64 A (*.f64 V l)) Initial program 85.5%
associate-/r*77.4%
clear-num77.3%
sqrt-div77.7%
metadata-eval77.7%
div-inv76.8%
clear-num77.0%
Applied egg-rr77.0%
*-commutative77.0%
associate-*l/87.0%
associate-/l*82.6%
Simplified82.6%
pow1/282.6%
pow-flip82.7%
associate-*r/87.1%
metadata-eval87.1%
Applied egg-rr87.1%
Final simplification80.5%
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 (* V l)) 2e-310) (* c0 (sqrt (/ (/ A V) l))) (* c0 (pow (/ (* V l) A) -0.5))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((A / (V * l)) <= 2e-310) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * pow(((V * l) / A), -0.5);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((a / (v * l)) <= 2d-310) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * (((v * l) / a) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((A / (V * l)) <= 2e-310) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (A / (V * l)) <= 2e-310: tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.pow(((V * l) / A), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(A / Float64(V * l)) <= 2e-310) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((A / (V * l)) <= 2e-310)
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 * (((V * l) / A) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision], 2e-310], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{A}{V \cdot \ell} \leq 2 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 1.999999999999994e-310Initial program 38.9%
associate-/r*54.1%
Simplified54.1%
if 1.999999999999994e-310 < (/.f64 A (*.f64 V l)) Initial program 85.5%
associate-/r*77.4%
clear-num77.3%
sqrt-div77.7%
metadata-eval77.7%
div-inv76.8%
clear-num77.0%
Applied egg-rr77.0%
*-commutative77.0%
associate-*l/87.0%
associate-/l*82.6%
Simplified82.6%
pow1/282.6%
pow-flip82.7%
associate-*r/87.1%
metadata-eval87.1%
Applied egg-rr87.1%
Final simplification80.5%
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 (* V l)) 2e-310) (* c0 (sqrt (/ (/ A 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 ((A / (V * l)) <= 2e-310) {
tmp = c0 * sqrt(((A / 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 ((a / (v * l)) <= 2d-310) then
tmp = c0 * sqrt(((a / 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 ((A / (V * l)) <= 2e-310) {
tmp = c0 * Math.sqrt(((A / 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 (A / (V * l)) <= 2e-310: tmp = c0 * math.sqrt(((A / 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(A / Float64(V * l)) <= 2e-310) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 / sqrt(Float64(Float64(V * 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 ((A / (V * l)) <= 2e-310)
tmp = c0 * sqrt(((A / 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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision], 2e-310], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{A}{V \cdot \ell} \leq 2 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 1.999999999999994e-310Initial program 38.9%
associate-/r*54.1%
Simplified54.1%
if 1.999999999999994e-310 < (/.f64 A (*.f64 V l)) Initial program 85.5%
associate-/r*77.4%
clear-num77.3%
sqrt-div77.7%
metadata-eval77.7%
div-inv76.8%
clear-num77.0%
Applied egg-rr77.0%
*-commutative77.0%
associate-*l/87.0%
associate-/l*82.6%
Simplified82.6%
un-div-inv82.7%
associate-*r/87.0%
Applied egg-rr87.0%
Final simplification80.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 76.2%
Final simplification76.2%
herbie shell --seed 2024041
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))