
(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 18 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: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -5e+281)
(* c0 (/ (sqrt (/ (- A) l)) (sqrt (- V))))
(if (<= (* V l) -4e-304)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0 (* (pow l -0.5) (sqrt (/ A V))))
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+281) {
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
} else if ((V * l) <= -4e-304) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (pow(l, -0.5) * sqrt((A / V)));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
NOTE: 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+281)) then
tmp = c0 * (sqrt((-a / l)) / sqrt(-v))
else if ((v * l) <= (-4d-304)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 * ((l ** (-0.5d0)) * sqrt((a / v)))
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / v) / l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+281) {
tmp = c0 * (Math.sqrt((-A / l)) / Math.sqrt(-V));
} else if ((V * l) <= -4e-304) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.pow(l, -0.5) * Math.sqrt((A / V)));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e+281: tmp = c0 * (math.sqrt((-A / l)) / math.sqrt(-V)) elif (V * l) <= -4e-304: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 * (math.pow(l, -0.5) * math.sqrt((A / V))) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e+281) tmp = Float64(c0 * Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -4e-304) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64((l ^ -0.5) * sqrt(Float64(A / V)))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e+281)
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
elseif ((V * l) <= -4e-304)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 * ((l ^ -0.5) * sqrt((A / V)));
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: 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+281], N[(c0 * N[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-304], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+281}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-304}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{A}{V}}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000016e281Initial program 52.0%
associate-/r*71.4%
div-inv71.5%
Applied egg-rr71.5%
associate-*l/71.6%
div-inv71.5%
Applied egg-rr71.5%
frac-2neg71.5%
sqrt-div56.6%
Applied egg-rr56.6%
distribute-neg-frac56.6%
Simplified56.6%
if -5.00000000000000016e281 < (*.f64 V l) < -3.99999999999999988e-304Initial program 92.0%
frac-2neg92.0%
sqrt-div99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -3.99999999999999988e-304 < (*.f64 V l) < -0.0Initial program 20.7%
add-sqr-sqrt18.5%
sqrt-unprod18.6%
pow1/218.6%
*-commutative18.6%
*-commutative18.6%
swap-sqr17.7%
add-sqr-sqrt17.7%
Applied egg-rr17.7%
unpow1/217.7%
Simplified17.7%
*-commutative17.7%
sqrt-prod17.7%
sqrt-prod18.5%
add-sqr-sqrt20.7%
associate-/r*36.8%
un-div-inv36.8%
sqrt-prod44.1%
associate-*r*43.9%
inv-pow43.9%
sqrt-pow144.0%
metadata-eval44.0%
Applied egg-rr44.0%
expm1-log1p-u26.0%
expm1-udef16.6%
*-commutative16.6%
associate-*l*16.6%
Applied egg-rr16.6%
expm1-def26.0%
expm1-log1p44.0%
*-commutative44.0%
associate-*l*44.1%
Simplified44.1%
if -0.0 < (*.f64 V l) Initial program 84.0%
pow1/284.0%
clear-num84.0%
inv-pow84.0%
pow-pow84.5%
associate-/l*74.9%
metadata-eval74.9%
Applied egg-rr74.9%
associate-/l*84.5%
Simplified84.5%
add-sqr-sqrt84.1%
sqrt-unprod84.0%
pow-prod-up84.0%
metadata-eval84.0%
inv-pow84.0%
clear-num84.0%
div-inv83.9%
sqrt-prod92.9%
Applied egg-rr92.9%
associate-/r*94.0%
Simplified94.0%
Final simplification86.7%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -5e-310) (* (* c0 (/ (sqrt (- A)) (sqrt (- V)))) (pow l -0.5)) (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = (c0 * (sqrt(-A) / sqrt(-V))) * pow(l, -0.5);
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
NOTE: 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 <= (-5d-310)) then
tmp = (c0 * (sqrt(-a) / sqrt(-v))) * (l ** (-0.5d0))
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / v) / l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = (c0 * (Math.sqrt(-A) / Math.sqrt(-V))) * Math.pow(l, -0.5);
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = (c0 * (math.sqrt(-A) / math.sqrt(-V))) * math.pow(l, -0.5) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(-V)))) * (l ^ -0.5)); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -5e-310)
tmp = (c0 * (sqrt(-A) / sqrt(-V))) * (l ^ -0.5);
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -5e-310], N[(N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(c0 \cdot \frac{\sqrt{-A}}{\sqrt{-V}}\right) \cdot {\ell}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 77.3%
add-sqr-sqrt44.1%
sqrt-unprod34.9%
pow1/234.9%
*-commutative34.9%
*-commutative34.9%
swap-sqr31.8%
add-sqr-sqrt31.8%
Applied egg-rr31.8%
unpow1/231.8%
Simplified31.8%
*-commutative31.8%
sqrt-prod34.6%
sqrt-prod40.8%
add-sqr-sqrt77.3%
associate-/r*81.9%
un-div-inv82.0%
sqrt-prod51.7%
associate-*r*48.2%
inv-pow48.2%
sqrt-pow148.2%
metadata-eval48.2%
Applied egg-rr48.2%
frac-2neg48.2%
sqrt-div51.1%
Applied egg-rr51.1%
if -4.999999999999985e-310 < A Initial program 75.6%
pow1/275.6%
clear-num75.6%
inv-pow75.6%
pow-pow76.1%
associate-/l*69.4%
metadata-eval69.4%
Applied egg-rr69.4%
associate-/l*76.1%
Simplified76.1%
add-sqr-sqrt75.7%
sqrt-unprod75.6%
pow-prod-up75.6%
metadata-eval75.6%
inv-pow75.6%
clear-num75.6%
div-inv75.5%
sqrt-prod83.5%
Applied egg-rr83.5%
associate-/r*84.5%
Simplified84.5%
Final simplification68.2%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= V -1e-310) (* c0 (/ (sqrt (/ (- A) l)) (sqrt (- V)))) (/ c0 (/ (* (sqrt l) (sqrt V)) (sqrt A)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -1e-310) {
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
} else {
tmp = c0 / ((sqrt(l) * sqrt(V)) / sqrt(A));
}
return tmp;
}
NOTE: 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 <= (-1d-310)) then
tmp = c0 * (sqrt((-a / l)) / sqrt(-v))
else
tmp = c0 / ((sqrt(l) * sqrt(v)) / sqrt(a))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -1e-310) {
tmp = c0 * (Math.sqrt((-A / l)) / Math.sqrt(-V));
} else {
tmp = c0 / ((Math.sqrt(l) * Math.sqrt(V)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if V <= -1e-310: tmp = c0 * (math.sqrt((-A / l)) / math.sqrt(-V)) else: tmp = c0 / ((math.sqrt(l) * math.sqrt(V)) / math.sqrt(A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= -1e-310) tmp = Float64(c0 * Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V)))); else tmp = Float64(c0 / Float64(Float64(sqrt(l) * sqrt(V)) / sqrt(A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (V <= -1e-310)
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
else
tmp = c0 / ((sqrt(l) * sqrt(V)) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[V, -1e-310], N[(c0 * N[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -1 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell} \cdot \sqrt{V}}{\sqrt{A}}}\\
\end{array}
\end{array}
if V < -9.999999999999969e-311Initial program 78.8%
associate-/r*76.9%
div-inv76.9%
Applied egg-rr76.9%
associate-*l/76.4%
div-inv76.3%
Applied egg-rr76.3%
frac-2neg76.3%
sqrt-div82.0%
Applied egg-rr82.0%
distribute-neg-frac82.0%
Simplified82.0%
if -9.999999999999969e-311 < V Initial program 74.0%
sqrt-div45.4%
associate-*r/43.3%
Applied egg-rr43.3%
associate-/l*45.4%
Simplified45.4%
*-commutative45.4%
sqrt-prod54.4%
Applied egg-rr54.4%
Final simplification68.4%
NOTE: 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+157)
(/ c0 (/ (sqrt l) t_0))
(if (<= (* V l) -1e-207)
(* c0 (pow (/ (* V l) A) -0.5))
(if (<= (* V l) 0.0)
(* c0 (* (pow l -0.5) t_0))
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -5e+157) {
tmp = c0 / (sqrt(l) / t_0);
} else if ((V * l) <= -1e-207) {
tmp = c0 * pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = c0 * (pow(l, -0.5) * t_0);
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
NOTE: 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+157)) then
tmp = c0 / (sqrt(l) / t_0)
else if ((v * l) <= (-1d-207)) then
tmp = c0 * (((v * l) / a) ** (-0.5d0))
else if ((v * l) <= 0.0d0) then
tmp = c0 * ((l ** (-0.5d0)) * t_0)
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / v) / l)))
end if
code = tmp
end function
assert 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+157) {
tmp = c0 / (Math.sqrt(l) / t_0);
} else if ((V * l) <= -1e-207) {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.pow(l, -0.5) * t_0);
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -5e+157: tmp = c0 / (math.sqrt(l) / t_0) elif (V * l) <= -1e-207: tmp = c0 * math.pow(((V * l) / A), -0.5) elif (V * l) <= 0.0: tmp = c0 * (math.pow(l, -0.5) * t_0) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -5e+157) tmp = Float64(c0 / Float64(sqrt(l) / t_0)); elseif (Float64(V * l) <= -1e-207) tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64((l ^ -0.5) * t_0)); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -5e+157)
tmp = c0 / (sqrt(l) / t_0);
elseif ((V * l) <= -1e-207)
tmp = c0 * (((V * l) / A) ^ -0.5);
elseif ((V * l) <= 0.0)
tmp = c0 * ((l ^ -0.5) * t_0);
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: 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+157], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-207], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+157}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{t_0}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-207}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -4.99999999999999976e157Initial program 70.6%
pow1/270.6%
clear-num70.5%
inv-pow70.5%
pow-pow70.5%
associate-/l*80.0%
metadata-eval80.0%
Applied egg-rr80.0%
associate-/l*70.5%
Simplified70.5%
add-sqr-sqrt70.4%
sqrt-unprod70.5%
pow-prod-up70.5%
metadata-eval70.5%
inv-pow70.5%
sqrt-div70.4%
metadata-eval70.4%
sqrt-undiv0.0%
div-inv0.0%
sqrt-undiv70.6%
associate-*r/80.2%
Applied egg-rr80.2%
associate-*r/70.6%
sqrt-div0.0%
sqrt-unprod0.0%
*-commutative0.0%
associate-/l*0.0%
sqrt-div48.8%
div-inv48.8%
Applied egg-rr48.8%
associate-*r/48.8%
*-rgt-identity48.8%
Simplified48.8%
if -4.99999999999999976e157 < (*.f64 V l) < -9.99999999999999925e-208Initial program 97.9%
pow1/297.9%
clear-num97.9%
inv-pow97.9%
pow-pow98.7%
associate-/l*78.6%
metadata-eval78.6%
Applied egg-rr78.6%
associate-/l*98.7%
Simplified98.7%
if -9.99999999999999925e-208 < (*.f64 V l) < -0.0Initial program 39.1%
add-sqr-sqrt18.3%
sqrt-unprod18.8%
pow1/218.8%
*-commutative18.8%
*-commutative18.8%
swap-sqr18.2%
add-sqr-sqrt18.3%
Applied egg-rr18.3%
unpow1/218.3%
Simplified18.3%
*-commutative18.3%
sqrt-prod18.2%
sqrt-prod18.3%
add-sqr-sqrt39.1%
associate-/r*49.0%
un-div-inv49.0%
sqrt-prod48.9%
associate-*r*45.1%
inv-pow45.1%
sqrt-pow145.2%
metadata-eval45.2%
Applied egg-rr45.2%
expm1-log1p-u23.0%
expm1-udef12.9%
*-commutative12.9%
associate-*l*12.9%
Applied egg-rr12.9%
expm1-def26.5%
expm1-log1p48.8%
*-commutative48.8%
associate-*l*48.9%
Simplified48.9%
if -0.0 < (*.f64 V l) Initial program 84.0%
pow1/284.0%
clear-num84.0%
inv-pow84.0%
pow-pow84.5%
associate-/l*74.9%
metadata-eval74.9%
Applied egg-rr74.9%
associate-/l*84.5%
Simplified84.5%
add-sqr-sqrt84.1%
sqrt-unprod84.0%
pow-prod-up84.0%
metadata-eval84.0%
inv-pow84.0%
clear-num84.0%
div-inv83.9%
sqrt-prod92.9%
Applied egg-rr92.9%
associate-/r*94.0%
Simplified94.0%
Final simplification79.5%
NOTE: 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+281)
(/ c0 (/ (sqrt l) t_0))
(if (<= (* V l) -4e-304)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0 (* (pow l -0.5) t_0))
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -5e+281) {
tmp = c0 / (sqrt(l) / t_0);
} else if ((V * l) <= -4e-304) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (pow(l, -0.5) * t_0);
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
NOTE: 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+281)) then
tmp = c0 / (sqrt(l) / t_0)
else if ((v * l) <= (-4d-304)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 * ((l ** (-0.5d0)) * t_0)
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / v) / l)))
end if
code = tmp
end function
assert 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+281) {
tmp = c0 / (Math.sqrt(l) / t_0);
} else if ((V * l) <= -4e-304) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.pow(l, -0.5) * t_0);
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -5e+281: tmp = c0 / (math.sqrt(l) / t_0) elif (V * l) <= -4e-304: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 * (math.pow(l, -0.5) * t_0) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -5e+281) tmp = Float64(c0 / Float64(sqrt(l) / t_0)); elseif (Float64(V * l) <= -4e-304) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64((l ^ -0.5) * t_0)); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -5e+281)
tmp = c0 / (sqrt(l) / t_0);
elseif ((V * l) <= -4e-304)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 * ((l ^ -0.5) * t_0);
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: 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+281], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-304], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+281}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{t_0}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-304}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000016e281Initial program 52.0%
pow1/252.0%
clear-num52.0%
inv-pow52.0%
pow-pow52.0%
associate-/l*68.9%
metadata-eval68.9%
Applied egg-rr68.9%
associate-/l*52.0%
Simplified52.0%
add-sqr-sqrt52.0%
sqrt-unprod52.0%
pow-prod-up52.0%
metadata-eval52.0%
inv-pow52.0%
sqrt-div51.9%
metadata-eval51.9%
sqrt-undiv0.0%
div-inv0.0%
sqrt-undiv52.0%
associate-*r/68.9%
Applied egg-rr68.9%
associate-*r/52.0%
sqrt-div0.0%
sqrt-unprod0.0%
*-commutative0.0%
associate-/l*0.0%
sqrt-div56.7%
div-inv56.7%
Applied egg-rr56.7%
associate-*r/56.7%
*-rgt-identity56.7%
Simplified56.7%
if -5.00000000000000016e281 < (*.f64 V l) < -3.99999999999999988e-304Initial program 92.0%
frac-2neg92.0%
sqrt-div99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -3.99999999999999988e-304 < (*.f64 V l) < -0.0Initial program 20.7%
add-sqr-sqrt18.5%
sqrt-unprod18.6%
pow1/218.6%
*-commutative18.6%
*-commutative18.6%
swap-sqr17.7%
add-sqr-sqrt17.7%
Applied egg-rr17.7%
unpow1/217.7%
Simplified17.7%
*-commutative17.7%
sqrt-prod17.7%
sqrt-prod18.5%
add-sqr-sqrt20.7%
associate-/r*36.8%
un-div-inv36.8%
sqrt-prod44.1%
associate-*r*43.9%
inv-pow43.9%
sqrt-pow144.0%
metadata-eval44.0%
Applied egg-rr44.0%
expm1-log1p-u26.0%
expm1-udef16.6%
*-commutative16.6%
associate-*l*16.6%
Applied egg-rr16.6%
expm1-def26.0%
expm1-log1p44.0%
*-commutative44.0%
associate-*l*44.1%
Simplified44.1%
if -0.0 < (*.f64 V l) Initial program 84.0%
pow1/284.0%
clear-num84.0%
inv-pow84.0%
pow-pow84.5%
associate-/l*74.9%
metadata-eval74.9%
Applied egg-rr74.9%
associate-/l*84.5%
Simplified84.5%
add-sqr-sqrt84.1%
sqrt-unprod84.0%
pow-prod-up84.0%
metadata-eval84.0%
inv-pow84.0%
clear-num84.0%
div-inv83.9%
sqrt-prod92.9%
Applied egg-rr92.9%
associate-/r*94.0%
Simplified94.0%
Final simplification86.7%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ c0 (/ (sqrt l) (sqrt (/ A V))))))
(if (<= (* V l) -5e+157)
t_0
(if (<= (* V l) -1e-235)
(* c0 (pow (/ (* V l) A) -0.5))
(if (<= (* V l) 0.0) t_0 (* c0 (* (sqrt A) (pow (* V l) -0.5))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 / (sqrt(l) / sqrt((A / V)));
double tmp;
if ((V * l) <= -5e+157) {
tmp = t_0;
} else if ((V * l) <= -1e-235) {
tmp = c0 * pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
}
return tmp;
}
NOTE: 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(l) / sqrt((a / v)))
if ((v * l) <= (-5d+157)) then
tmp = t_0
else if ((v * l) <= (-1d-235)) then
tmp = c0 * (((v * l) / a) ** (-0.5d0))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else
tmp = c0 * (sqrt(a) * ((v * l) ** (-0.5d0)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 / (Math.sqrt(l) / Math.sqrt((A / V)));
double tmp;
if ((V * l) <= -5e+157) {
tmp = t_0;
} else if ((V * l) <= -1e-235) {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 / (math.sqrt(l) / math.sqrt((A / V))) tmp = 0 if (V * l) <= -5e+157: tmp = t_0 elif (V * l) <= -1e-235: tmp = c0 * math.pow(((V * l) / A), -0.5) elif (V * l) <= 0.0: tmp = t_0 else: tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 / Float64(sqrt(l) / sqrt(Float64(A / V)))) tmp = 0.0 if (Float64(V * l) <= -5e+157) tmp = t_0; elseif (Float64(V * l) <= -1e-235) tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); elseif (Float64(V * l) <= 0.0) tmp = t_0; else tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 / (sqrt(l) / sqrt((A / V)));
tmp = 0.0;
if ((V * l) <= -5e+157)
tmp = t_0;
elseif ((V * l) <= -1e-235)
tmp = c0 * (((V * l) / A) ^ -0.5);
elseif ((V * l) <= 0.0)
tmp = t_0;
else
tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+157], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-235], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+157}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-235}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -4.99999999999999976e157 or -9.9999999999999996e-236 < (*.f64 V l) < -0.0Initial program 51.6%
pow1/251.6%
clear-num51.6%
inv-pow51.6%
pow-pow51.6%
associate-/l*62.5%
metadata-eval62.5%
Applied egg-rr62.5%
associate-/l*51.6%
Simplified51.6%
add-sqr-sqrt51.5%
sqrt-unprod51.6%
pow-prod-up51.6%
metadata-eval51.6%
inv-pow51.6%
sqrt-div51.5%
metadata-eval51.5%
sqrt-undiv1.9%
div-inv1.9%
sqrt-undiv51.6%
associate-*r/62.6%
Applied egg-rr62.6%
associate-*r/51.6%
sqrt-div1.9%
sqrt-unprod9.5%
*-commutative9.5%
associate-/l*9.5%
sqrt-div48.8%
div-inv48.7%
Applied egg-rr48.7%
associate-*r/48.8%
*-rgt-identity48.8%
Simplified48.8%
if -4.99999999999999976e157 < (*.f64 V l) < -9.9999999999999996e-236Initial program 98.0%
pow1/298.0%
clear-num98.0%
inv-pow98.0%
pow-pow98.8%
associate-/l*80.1%
metadata-eval80.1%
Applied egg-rr80.1%
associate-/l*98.8%
Simplified98.8%
if -0.0 < (*.f64 V l) Initial program 84.0%
div-inv83.9%
sqrt-prod92.9%
pow1/292.9%
inv-pow92.9%
pow-pow92.8%
metadata-eval92.8%
Applied egg-rr92.8%
Final simplification79.7%
NOTE: 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+157)
(/ c0 (/ (sqrt l) t_0))
(if (<= (* V l) -1e-207)
(* c0 (pow (/ (* V l) A) -0.5))
(if (<= (* V l) 0.0)
(* c0 (* (pow l -0.5) t_0))
(* c0 (* (sqrt A) (pow (* V l) -0.5))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -5e+157) {
tmp = c0 / (sqrt(l) / t_0);
} else if ((V * l) <= -1e-207) {
tmp = c0 * pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = c0 * (pow(l, -0.5) * t_0);
} else {
tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
}
return tmp;
}
NOTE: 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+157)) then
tmp = c0 / (sqrt(l) / t_0)
else if ((v * l) <= (-1d-207)) then
tmp = c0 * (((v * l) / a) ** (-0.5d0))
else if ((v * l) <= 0.0d0) then
tmp = c0 * ((l ** (-0.5d0)) * t_0)
else
tmp = c0 * (sqrt(a) * ((v * l) ** (-0.5d0)))
end if
code = tmp
end function
assert 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+157) {
tmp = c0 / (Math.sqrt(l) / t_0);
} else if ((V * l) <= -1e-207) {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.pow(l, -0.5) * t_0);
} else {
tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -5e+157: tmp = c0 / (math.sqrt(l) / t_0) elif (V * l) <= -1e-207: tmp = c0 * math.pow(((V * l) / A), -0.5) elif (V * l) <= 0.0: tmp = c0 * (math.pow(l, -0.5) * t_0) else: tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -5e+157) tmp = Float64(c0 / Float64(sqrt(l) / t_0)); elseif (Float64(V * l) <= -1e-207) tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64((l ^ -0.5) * t_0)); else tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -5e+157)
tmp = c0 / (sqrt(l) / t_0);
elseif ((V * l) <= -1e-207)
tmp = c0 * (((V * l) / A) ^ -0.5);
elseif ((V * l) <= 0.0)
tmp = c0 * ((l ^ -0.5) * t_0);
else
tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
end
tmp_2 = tmp;
end
NOTE: 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+157], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-207], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+157}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{t_0}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-207}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot t_0\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -4.99999999999999976e157Initial program 70.6%
pow1/270.6%
clear-num70.5%
inv-pow70.5%
pow-pow70.5%
associate-/l*80.0%
metadata-eval80.0%
Applied egg-rr80.0%
associate-/l*70.5%
Simplified70.5%
add-sqr-sqrt70.4%
sqrt-unprod70.5%
pow-prod-up70.5%
metadata-eval70.5%
inv-pow70.5%
sqrt-div70.4%
metadata-eval70.4%
sqrt-undiv0.0%
div-inv0.0%
sqrt-undiv70.6%
associate-*r/80.2%
Applied egg-rr80.2%
associate-*r/70.6%
sqrt-div0.0%
sqrt-unprod0.0%
*-commutative0.0%
associate-/l*0.0%
sqrt-div48.8%
div-inv48.8%
Applied egg-rr48.8%
associate-*r/48.8%
*-rgt-identity48.8%
Simplified48.8%
if -4.99999999999999976e157 < (*.f64 V l) < -9.99999999999999925e-208Initial program 97.9%
pow1/297.9%
clear-num97.9%
inv-pow97.9%
pow-pow98.7%
associate-/l*78.6%
metadata-eval78.6%
Applied egg-rr78.6%
associate-/l*98.7%
Simplified98.7%
if -9.99999999999999925e-208 < (*.f64 V l) < -0.0Initial program 39.1%
add-sqr-sqrt18.3%
sqrt-unprod18.8%
pow1/218.8%
*-commutative18.8%
*-commutative18.8%
swap-sqr18.2%
add-sqr-sqrt18.3%
Applied egg-rr18.3%
unpow1/218.3%
Simplified18.3%
*-commutative18.3%
sqrt-prod18.2%
sqrt-prod18.3%
add-sqr-sqrt39.1%
associate-/r*49.0%
un-div-inv49.0%
sqrt-prod48.9%
associate-*r*45.1%
inv-pow45.1%
sqrt-pow145.2%
metadata-eval45.2%
Applied egg-rr45.2%
expm1-log1p-u23.0%
expm1-udef12.9%
*-commutative12.9%
associate-*l*12.9%
Applied egg-rr12.9%
expm1-def26.5%
expm1-log1p48.8%
*-commutative48.8%
associate-*l*48.9%
Simplified48.9%
if -0.0 < (*.f64 V l) Initial program 84.0%
div-inv83.9%
sqrt-prod92.9%
pow1/292.9%
inv-pow92.9%
pow-pow92.8%
metadata-eval92.8%
Applied egg-rr92.8%
Final simplification78.9%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
(if (<= (* V l) -5e+157)
t_0
(if (<= (* V l) -2e-218)
(* c0 (pow (/ (* V l) A) -0.5))
(if (<= (* V l) 0.0) t_0 (* (sqrt A) (/ c0 (sqrt (* V l)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -5e+157) {
tmp = t_0;
} else if ((V * l) <= -2e-218) {
tmp = c0 * pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-5d+157)) then
tmp = t_0
else if ((v * l) <= (-2d-218)) then
tmp = c0 * (((v * l) / a) ** (-0.5d0))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else
tmp = sqrt(a) * (c0 / sqrt((v * l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -5e+157) {
tmp = t_0;
} else if ((V * l) <= -2e-218) {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -5e+157: tmp = t_0 elif (V * l) <= -2e-218: tmp = c0 * math.pow(((V * l) / A), -0.5) elif (V * l) <= 0.0: tmp = t_0 else: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -5e+157) tmp = t_0; elseif (Float64(V * l) <= -2e-218) tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); elseif (Float64(V * l) <= 0.0) tmp = t_0; else tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -5e+157)
tmp = t_0;
elseif ((V * l) <= -2e-218)
tmp = c0 * (((V * l) / A) ^ -0.5);
elseif ((V * l) <= 0.0)
tmp = t_0;
else
tmp = sqrt(A) * (c0 / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+157], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-218], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+157}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-218}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.99999999999999976e157 or -2.0000000000000001e-218 < (*.f64 V l) < -0.0Initial program 53.2%
associate-/r*63.7%
sqrt-div49.4%
Applied egg-rr49.4%
if -4.99999999999999976e157 < (*.f64 V l) < -2.0000000000000001e-218Initial program 98.0%
pow1/298.0%
clear-num97.9%
inv-pow97.9%
pow-pow98.7%
associate-/l*79.0%
metadata-eval79.0%
Applied egg-rr79.0%
associate-/l*98.7%
Simplified98.7%
if -0.0 < (*.f64 V l) Initial program 84.0%
add-sqr-sqrt48.4%
sqrt-unprod31.9%
pow1/231.9%
*-commutative31.9%
*-commutative31.9%
swap-sqr26.7%
add-sqr-sqrt26.6%
Applied egg-rr26.6%
unpow1/226.6%
Simplified26.6%
sqrt-prod30.7%
sqrt-div31.5%
clear-num31.5%
sqrt-prod49.5%
add-sqr-sqrt92.8%
associate-/r/92.1%
clear-num92.7%
associate-/r/91.2%
Applied egg-rr91.2%
Final simplification78.5%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ c0 (/ (sqrt l) (sqrt (/ A V))))))
(if (<= (* V l) -5e+157)
t_0
(if (<= (* V l) -1e-235)
(* c0 (pow (/ (* V l) A) -0.5))
(if (<= (* V l) 0.0) t_0 (* (sqrt A) (/ c0 (sqrt (* V l)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 / (sqrt(l) / sqrt((A / V)));
double tmp;
if ((V * l) <= -5e+157) {
tmp = t_0;
} else if ((V * l) <= -1e-235) {
tmp = c0 * pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
}
return tmp;
}
NOTE: 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(l) / sqrt((a / v)))
if ((v * l) <= (-5d+157)) then
tmp = t_0
else if ((v * l) <= (-1d-235)) then
tmp = c0 * (((v * l) / a) ** (-0.5d0))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else
tmp = sqrt(a) * (c0 / sqrt((v * l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 / (Math.sqrt(l) / Math.sqrt((A / V)));
double tmp;
if ((V * l) <= -5e+157) {
tmp = t_0;
} else if ((V * l) <= -1e-235) {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 / (math.sqrt(l) / math.sqrt((A / V))) tmp = 0 if (V * l) <= -5e+157: tmp = t_0 elif (V * l) <= -1e-235: tmp = c0 * math.pow(((V * l) / A), -0.5) elif (V * l) <= 0.0: tmp = t_0 else: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 / Float64(sqrt(l) / sqrt(Float64(A / V)))) tmp = 0.0 if (Float64(V * l) <= -5e+157) tmp = t_0; elseif (Float64(V * l) <= -1e-235) tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); elseif (Float64(V * l) <= 0.0) tmp = t_0; else tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 / (sqrt(l) / sqrt((A / V)));
tmp = 0.0;
if ((V * l) <= -5e+157)
tmp = t_0;
elseif ((V * l) <= -1e-235)
tmp = c0 * (((V * l) / A) ^ -0.5);
elseif ((V * l) <= 0.0)
tmp = t_0;
else
tmp = sqrt(A) * (c0 / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+157], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-235], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+157}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-235}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.99999999999999976e157 or -9.9999999999999996e-236 < (*.f64 V l) < -0.0Initial program 51.6%
pow1/251.6%
clear-num51.6%
inv-pow51.6%
pow-pow51.6%
associate-/l*62.5%
metadata-eval62.5%
Applied egg-rr62.5%
associate-/l*51.6%
Simplified51.6%
add-sqr-sqrt51.5%
sqrt-unprod51.6%
pow-prod-up51.6%
metadata-eval51.6%
inv-pow51.6%
sqrt-div51.5%
metadata-eval51.5%
sqrt-undiv1.9%
div-inv1.9%
sqrt-undiv51.6%
associate-*r/62.6%
Applied egg-rr62.6%
associate-*r/51.6%
sqrt-div1.9%
sqrt-unprod9.5%
*-commutative9.5%
associate-/l*9.5%
sqrt-div48.8%
div-inv48.7%
Applied egg-rr48.7%
associate-*r/48.8%
*-rgt-identity48.8%
Simplified48.8%
if -4.99999999999999976e157 < (*.f64 V l) < -9.9999999999999996e-236Initial program 98.0%
pow1/298.0%
clear-num98.0%
inv-pow98.0%
pow-pow98.8%
associate-/l*80.1%
metadata-eval80.1%
Applied egg-rr80.1%
associate-/l*98.8%
Simplified98.8%
if -0.0 < (*.f64 V l) Initial program 84.0%
add-sqr-sqrt48.4%
sqrt-unprod31.9%
pow1/231.9%
*-commutative31.9%
*-commutative31.9%
swap-sqr26.7%
add-sqr-sqrt26.6%
Applied egg-rr26.6%
unpow1/226.6%
Simplified26.6%
sqrt-prod30.7%
sqrt-div31.5%
clear-num31.5%
sqrt-prod49.5%
add-sqr-sqrt92.8%
associate-/r/92.1%
clear-num92.7%
associate-/r/91.2%
Applied egg-rr91.2%
Final simplification78.9%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ c0 (/ (sqrt l) (sqrt (/ A V))))))
(if (<= (* V l) -5e+157)
t_0
(if (<= (* V l) -1e-235)
(* c0 (pow (/ (* V l) A) -0.5))
(if (<= (* V l) 0.0) t_0 (/ c0 (/ (sqrt (* V l)) (sqrt A))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 / (sqrt(l) / sqrt((A / V)));
double tmp;
if ((V * l) <= -5e+157) {
tmp = t_0;
} else if ((V * l) <= -1e-235) {
tmp = c0 * pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
}
return tmp;
}
NOTE: 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(l) / sqrt((a / v)))
if ((v * l) <= (-5d+157)) then
tmp = t_0
else if ((v * l) <= (-1d-235)) then
tmp = c0 * (((v * l) / a) ** (-0.5d0))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else
tmp = c0 / (sqrt((v * l)) / sqrt(a))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 / (Math.sqrt(l) / Math.sqrt((A / V)));
double tmp;
if ((V * l) <= -5e+157) {
tmp = t_0;
} else if ((V * l) <= -1e-235) {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 / (math.sqrt(l) / math.sqrt((A / V))) tmp = 0 if (V * l) <= -5e+157: tmp = t_0 elif (V * l) <= -1e-235: tmp = c0 * math.pow(((V * l) / A), -0.5) elif (V * l) <= 0.0: tmp = t_0 else: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 / Float64(sqrt(l) / sqrt(Float64(A / V)))) tmp = 0.0 if (Float64(V * l) <= -5e+157) tmp = t_0; elseif (Float64(V * l) <= -1e-235) tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); elseif (Float64(V * l) <= 0.0) tmp = t_0; else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 / (sqrt(l) / sqrt((A / V)));
tmp = 0.0;
if ((V * l) <= -5e+157)
tmp = t_0;
elseif ((V * l) <= -1e-235)
tmp = c0 * (((V * l) / A) ^ -0.5);
elseif ((V * l) <= 0.0)
tmp = t_0;
else
tmp = c0 / (sqrt((V * l)) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+157], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-235], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+157}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-235}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.99999999999999976e157 or -9.9999999999999996e-236 < (*.f64 V l) < -0.0Initial program 51.6%
pow1/251.6%
clear-num51.6%
inv-pow51.6%
pow-pow51.6%
associate-/l*62.5%
metadata-eval62.5%
Applied egg-rr62.5%
associate-/l*51.6%
Simplified51.6%
add-sqr-sqrt51.5%
sqrt-unprod51.6%
pow-prod-up51.6%
metadata-eval51.6%
inv-pow51.6%
sqrt-div51.5%
metadata-eval51.5%
sqrt-undiv1.9%
div-inv1.9%
sqrt-undiv51.6%
associate-*r/62.6%
Applied egg-rr62.6%
associate-*r/51.6%
sqrt-div1.9%
sqrt-unprod9.5%
*-commutative9.5%
associate-/l*9.5%
sqrt-div48.8%
div-inv48.7%
Applied egg-rr48.7%
associate-*r/48.8%
*-rgt-identity48.8%
Simplified48.8%
if -4.99999999999999976e157 < (*.f64 V l) < -9.9999999999999996e-236Initial program 98.0%
pow1/298.0%
clear-num98.0%
inv-pow98.0%
pow-pow98.8%
associate-/l*80.1%
metadata-eval80.1%
Applied egg-rr80.1%
associate-/l*98.8%
Simplified98.8%
if -0.0 < (*.f64 V l) Initial program 84.0%
sqrt-div92.7%
associate-*r/87.5%
Applied egg-rr87.5%
associate-/l*92.7%
Simplified92.7%
Final simplification79.6%
NOTE: 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 5e+300)))
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(* c0 (pow (/ (* V l) A) -0.5)))))assert(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 <= 5e+300)) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 * pow(((V * l) / A), -0.5);
}
return tmp;
}
NOTE: 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 <= 5d+300))) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 * (((v * l) / a) ** (-0.5d0))
end if
code = tmp
end function
assert 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 <= 5e+300)) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+300): tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 * math.pow(((V * l) / A), -0.5) return tmp
V, l = sort([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 <= 5e+300)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); end return tmp end
V, l = num2cell(sort([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 <= 5e+300)))
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 * (((V * l) / A) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: 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, 5e+300]], $MachinePrecision]], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 5 \cdot 10^{+300}\right):\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 5.00000000000000026e300 < (/.f64 A (*.f64 V l)) Initial program 25.3%
associate-/r*40.5%
sqrt-div42.9%
Applied egg-rr42.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000026e300Initial program 99.6%
pow1/299.6%
clear-num99.6%
inv-pow99.6%
pow-pow99.6%
associate-/l*86.3%
metadata-eval86.3%
Applied egg-rr86.3%
associate-/l*99.6%
Simplified99.6%
Final simplification81.9%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+292)
(* c0 (pow (/ (* V l) A) -0.5))
(/ 1.0 (/ (sqrt (* V (/ l A))) c0))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 5e+292) {
tmp = c0 * pow(((V * l) / A), -0.5);
} else {
tmp = 1.0 / (sqrt((V * (l / A))) / c0);
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 5d+292) then
tmp = c0 * (((v * l) / a) ** (-0.5d0))
else
tmp = 1.0d0 / (sqrt((v * (l / a))) / c0)
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+292) {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
} else {
tmp = 1.0 / (Math.sqrt((V * (l / A))) / c0);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 5e+292: tmp = c0 * math.pow(((V * l) / A), -0.5) else: tmp = 1.0 / (math.sqrt((V * (l / A))) / c0) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+292) tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); else tmp = Float64(1.0 / Float64(sqrt(Float64(V * Float64(l / A))) / c0)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 5e+292)
tmp = c0 * (((V * l) / A) ^ -0.5);
else
tmp = 1.0 / (sqrt((V * (l / A))) / c0);
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+292], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{V \cdot \frac{\ell}{A}}}{c0}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 32.3%
associate-/r*51.1%
div-inv51.1%
Applied egg-rr51.1%
associate-*l/51.1%
div-inv51.1%
Applied egg-rr51.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.9999999999999996e292Initial program 99.6%
pow1/299.6%
clear-num99.6%
inv-pow99.6%
pow-pow99.6%
associate-/l*86.6%
metadata-eval86.6%
Applied egg-rr86.6%
associate-/l*99.6%
Simplified99.6%
if 4.9999999999999996e292 < (/.f64 A (*.f64 V l)) Initial program 26.0%
pow1/226.0%
clear-num25.9%
inv-pow25.9%
pow-pow28.2%
associate-/l*35.6%
metadata-eval35.6%
Applied egg-rr35.6%
associate-/l*28.2%
Simplified28.2%
add-sqr-sqrt28.1%
sqrt-unprod25.9%
pow-prod-up25.9%
metadata-eval25.9%
inv-pow25.9%
sqrt-div28.2%
metadata-eval28.2%
sqrt-undiv23.5%
div-inv23.4%
clear-num23.5%
sqrt-undiv28.2%
associate-*r/35.7%
Applied egg-rr35.7%
Final simplification81.0%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+292)
(* c0 (pow (/ (* V l) A) -0.5))
(/ c0 (sqrt (/ V (/ A l))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 5e+292) {
tmp = c0 * pow(((V * l) / A), -0.5);
} else {
tmp = c0 / sqrt((V / (A / l)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 5d+292) then
tmp = c0 * (((v * l) / a) ** (-0.5d0))
else
tmp = c0 / sqrt((v / (a / l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+292) {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 5e+292: tmp = c0 * math.pow(((V * l) / A), -0.5) else: tmp = c0 / math.sqrt((V / (A / l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+292) tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 5e+292)
tmp = c0 * (((V * l) / A) ^ -0.5);
else
tmp = c0 / sqrt((V / (A / l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+292], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 32.3%
associate-/r*51.1%
div-inv51.1%
Applied egg-rr51.1%
associate-*l/51.1%
div-inv51.1%
Applied egg-rr51.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.9999999999999996e292Initial program 99.6%
pow1/299.6%
clear-num99.6%
inv-pow99.6%
pow-pow99.6%
associate-/l*86.6%
metadata-eval86.6%
Applied egg-rr86.6%
associate-/l*99.6%
Simplified99.6%
if 4.9999999999999996e292 < (/.f64 A (*.f64 V l)) Initial program 26.0%
pow1/226.0%
clear-num25.9%
inv-pow25.9%
pow-pow28.2%
associate-/l*35.6%
metadata-eval35.6%
Applied egg-rr35.6%
associate-/l*28.2%
Simplified28.2%
add-sqr-sqrt28.1%
sqrt-unprod25.9%
pow-prod-up25.9%
metadata-eval25.9%
inv-pow25.9%
sqrt-div28.2%
metadata-eval28.2%
sqrt-undiv23.5%
div-inv23.4%
sqrt-undiv28.2%
associate-*r/35.6%
Applied egg-rr35.6%
expm1-log1p-u35.6%
expm1-udef19.6%
Applied egg-rr19.6%
expm1-def35.6%
expm1-log1p35.6%
associate-*r/28.2%
associate-/l*35.6%
Simplified35.6%
Final simplification81.0%
NOTE: 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 2e+299)))
(* c0 (sqrt (/ (/ A l) V)))
(* c0 (sqrt t_0)))))assert(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 <= 2e+299)) {
tmp = c0 * sqrt(((A / l) / V));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: 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 <= 2d+299))) then
tmp = c0 * sqrt(((a / l) / v))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert 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 <= 2e+299)) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 2e+299): tmp = c0 * math.sqrt(((A / l) / V)) else: tmp = c0 * math.sqrt(t_0) return tmp
V, l = sort([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 <= 2e+299)) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
V, l = num2cell(sort([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 <= 2e+299)))
tmp = c0 * sqrt(((A / l) / V));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: 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, 2e+299]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 2 \cdot 10^{+299}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 2.0000000000000001e299 < (/.f64 A (*.f64 V l)) Initial program 26.3%
associate-/r*41.3%
div-inv41.3%
Applied egg-rr41.3%
associate-*l/40.0%
div-inv40.0%
Applied egg-rr40.0%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e299Initial program 99.6%
Final simplification80.8%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+300) (* c0 (sqrt t_0)) (* c0 (sqrt (/ (/ A V) l)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 5e+300) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 5d+300) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * sqrt(((a / v) / l))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+300) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 5e+300: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+300) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 5e+300)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+300], 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}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 32.3%
associate-/r*51.1%
div-inv51.1%
Applied egg-rr51.1%
associate-*l/51.1%
div-inv51.1%
Applied egg-rr51.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000026e300Initial program 99.6%
if 5.00000000000000026e300 < (/.f64 A (*.f64 V l)) Initial program 18.7%
add-sqr-sqrt11.7%
sqrt-unprod11.9%
pow1/211.9%
*-commutative11.9%
*-commutative11.9%
swap-sqr11.1%
add-sqr-sqrt11.1%
Applied egg-rr11.1%
unpow1/211.1%
Simplified11.1%
sqrt-prod11.1%
associate-/r*18.3%
sqrt-prod21.0%
add-sqr-sqrt30.5%
Applied egg-rr30.5%
Final simplification81.2%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 2e+299) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 2e+299) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 2d+299) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 2e+299) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 2e+299: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 2e+299) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 2e+299)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+299], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 32.3%
associate-/r*51.1%
div-inv51.1%
Applied egg-rr51.1%
associate-*l/51.1%
div-inv51.1%
Applied egg-rr51.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e299Initial program 99.6%
if 2.0000000000000001e299 < (/.f64 A (*.f64 V l)) Initial program 20.7%
pow1/220.7%
clear-num20.7%
inv-pow20.7%
pow-pow23.1%
associate-/l*31.0%
metadata-eval31.0%
Applied egg-rr31.0%
associate-/l*23.1%
Simplified23.1%
add-sqr-sqrt23.1%
sqrt-unprod20.7%
pow-prod-up20.7%
metadata-eval20.7%
inv-pow20.7%
sqrt-div23.1%
metadata-eval23.1%
sqrt-undiv20.4%
div-inv20.4%
sqrt-undiv23.1%
associate-*r/31.1%
Applied egg-rr31.1%
Final simplification81.0%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 2e+299) (* c0 (sqrt t_0)) (/ c0 (sqrt (/ V (/ A l))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 2e+299) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V / (A / l)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 2d+299) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v / (a / l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 2e+299) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 2e+299: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V / (A / l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 2e+299) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 2e+299)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V / (A / l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+299], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 32.3%
associate-/r*51.1%
div-inv51.1%
Applied egg-rr51.1%
associate-*l/51.1%
div-inv51.1%
Applied egg-rr51.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e299Initial program 99.6%
if 2.0000000000000001e299 < (/.f64 A (*.f64 V l)) Initial program 20.7%
pow1/220.7%
clear-num20.7%
inv-pow20.7%
pow-pow23.1%
associate-/l*31.0%
metadata-eval31.0%
Applied egg-rr31.0%
associate-/l*23.1%
Simplified23.1%
add-sqr-sqrt23.1%
sqrt-unprod20.7%
pow-prod-up20.7%
metadata-eval20.7%
inv-pow20.7%
sqrt-div23.1%
metadata-eval23.1%
sqrt-undiv20.4%
div-inv20.4%
sqrt-undiv23.1%
associate-*r/31.1%
Applied egg-rr31.1%
expm1-log1p-u31.1%
expm1-udef18.4%
Applied egg-rr18.4%
expm1-def31.1%
expm1-log1p31.1%
associate-*r/23.1%
associate-/l*31.0%
Simplified31.0%
Final simplification81.0%
NOTE: 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(V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: 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 V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[V, l] = sort([V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
V, l = sort([V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
V, l = num2cell(sort([V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: 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}
[V, l] = \mathsf{sort}([V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 76.4%
Final simplification76.4%
herbie shell --seed 2023229
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))