
(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 17 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) -1e-230)
(* c0 (/ (/ (sqrt (- A)) (sqrt (- V))) (sqrt l)))
(if (<= (* V l) 5e-323)
(/ c0 (sqrt (/ V (/ A l))))
(if (<= (* V l) 1e+290)
(* c0 (* (sqrt A) (pow (* V l) -0.5)))
(* (sqrt A) (/ (/ c0 (sqrt V)) (sqrt l)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e-230) {
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
} else if ((V * l) <= 5e-323) {
tmp = c0 / sqrt((V / (A / l)));
} else if ((V * l) <= 1e+290) {
tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
} else {
tmp = sqrt(A) * ((c0 / sqrt(V)) / sqrt(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) <= (-1d-230)) then
tmp = c0 * ((sqrt(-a) / sqrt(-v)) / sqrt(l))
else if ((v * l) <= 5d-323) then
tmp = c0 / sqrt((v / (a / l)))
else if ((v * l) <= 1d+290) then
tmp = c0 * (sqrt(a) * ((v * l) ** (-0.5d0)))
else
tmp = sqrt(a) * ((c0 / sqrt(v)) / sqrt(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) <= -1e-230) {
tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) / Math.sqrt(l));
} else if ((V * l) <= 5e-323) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else if ((V * l) <= 1e+290) {
tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
} else {
tmp = Math.sqrt(A) * ((c0 / Math.sqrt(V)) / Math.sqrt(l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e-230: tmp = c0 * ((math.sqrt(-A) / math.sqrt(-V)) / math.sqrt(l)) elif (V * l) <= 5e-323: tmp = c0 / math.sqrt((V / (A / l))) elif (V * l) <= 1e+290: tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5)) else: tmp = math.sqrt(A) * ((c0 / math.sqrt(V)) / math.sqrt(l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e-230) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / sqrt(l))); elseif (Float64(V * l) <= 5e-323) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); elseif (Float64(V * l) <= 1e+290) tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); else tmp = Float64(sqrt(A) * Float64(Float64(c0 / sqrt(V)) / sqrt(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) <= -1e-230)
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
elseif ((V * l) <= 5e-323)
tmp = c0 / sqrt((V / (A / l)));
elseif ((V * l) <= 1e+290)
tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
else
tmp = sqrt(A) * ((c0 / sqrt(V)) / sqrt(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], -1e-230], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-323], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+290], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[A], $MachinePrecision] * N[(N[(c0 / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{-230}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{\frac{c0}{\sqrt{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.00000000000000005e-230Initial program 82.8%
associate-/r*74.7%
sqrt-div40.6%
Applied egg-rr40.6%
frac-2neg40.6%
sqrt-div49.6%
Applied egg-rr49.6%
if -1.00000000000000005e-230 < (*.f64 V l) < 4.94066e-323Initial program 44.6%
*-un-lft-identity44.6%
times-frac78.2%
Applied egg-rr78.2%
*-commutative78.2%
associate-*l/80.6%
div-inv80.7%
sqrt-undiv54.9%
associate-*r/52.5%
associate-/l*54.9%
sqrt-undiv80.7%
associate-/l*44.6%
*-commutative44.6%
associate-*r/80.7%
Applied egg-rr80.7%
clear-num78.3%
div-inv78.3%
Applied egg-rr78.3%
if 4.94066e-323 < (*.f64 V l) < 1.00000000000000006e290Initial program 88.6%
div-inv88.6%
sqrt-prod97.7%
pow1/297.7%
inv-pow97.7%
pow-pow98.3%
metadata-eval98.3%
Applied egg-rr98.3%
if 1.00000000000000006e290 < (*.f64 V l) Initial program 5.1%
sqrt-div11.5%
associate-*r/11.3%
Applied egg-rr11.3%
associate-*l/11.5%
Simplified11.5%
*-un-lft-identity11.5%
sqrt-prod67.0%
times-frac66.6%
Applied egg-rr66.6%
associate-*r/66.8%
associate-*l/66.8%
*-lft-identity66.8%
Simplified66.8%
Final simplification75.1%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= V -5e-310) (* c0 (/ (sqrt (/ (- A) l)) (sqrt (- V)))) (* c0 (/ (/ (sqrt A) (sqrt V)) (sqrt l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -5e-310) {
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
} else {
tmp = c0 * ((sqrt(A) / sqrt(V)) / sqrt(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 <= (-5d-310)) then
tmp = c0 * (sqrt((-a / l)) / sqrt(-v))
else
tmp = c0 * ((sqrt(a) / sqrt(v)) / sqrt(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 <= -5e-310) {
tmp = c0 * (Math.sqrt((-A / l)) / Math.sqrt(-V));
} else {
tmp = c0 * ((Math.sqrt(A) / Math.sqrt(V)) / Math.sqrt(l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if V <= -5e-310: tmp = c0 * (math.sqrt((-A / l)) / math.sqrt(-V)) else: tmp = c0 * ((math.sqrt(A) / math.sqrt(V)) / math.sqrt(l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= -5e-310) tmp = Float64(c0 * Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V)))); else tmp = Float64(c0 * Float64(Float64(sqrt(A) / sqrt(V)) / sqrt(l))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (V <= -5e-310)
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
else
tmp = c0 * ((sqrt(A) / sqrt(V)) / sqrt(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[V, -5e-310], N[(c0 * N[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{A}}{\sqrt{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if V < -4.999999999999985e-310Initial program 75.8%
pow1/275.8%
clear-num75.2%
inv-pow75.2%
pow-pow75.2%
associate-/l*78.2%
metadata-eval78.2%
Applied egg-rr78.2%
associate-/l*75.2%
*-lft-identity75.2%
times-frac79.1%
/-rgt-identity79.1%
Simplified79.1%
Taylor expanded in c0 around 0 75.8%
associate-/l/78.2%
Simplified78.2%
frac-2neg78.2%
sqrt-div86.1%
distribute-neg-frac86.1%
Applied egg-rr86.1%
if -4.999999999999985e-310 < V Initial program 73.5%
associate-/r*74.1%
sqrt-div46.6%
Applied egg-rr46.6%
sqrt-div54.8%
Applied egg-rr54.8%
Final simplification70.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 (/ (* c0 (sqrt (/ A V))) (sqrt l))))
(if (<= (* V l) -4e+139)
t_0
(if (<= (* V l) -5e-223)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 5e-323)
(/ c0 (sqrt (/ V (/ A l))))
(if (<= (* V l) 1e+290)
(* c0 (* (sqrt A) (pow (* V l) -0.5)))
t_0))))))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) <= -4e+139) {
tmp = t_0;
} else if ((V * l) <= -5e-223) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 5e-323) {
tmp = c0 / sqrt((V / (A / l)));
} else if ((V * l) <= 1e+290) {
tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
} else {
tmp = 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 = (c0 * sqrt((a / v))) / sqrt(l)
if ((v * l) <= (-4d+139)) then
tmp = t_0
else if ((v * l) <= (-5d-223)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 5d-323) then
tmp = c0 / sqrt((v / (a / l)))
else if ((v * l) <= 1d+290) then
tmp = c0 * (sqrt(a) * ((v * l) ** (-0.5d0)))
else
tmp = 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 = (c0 * Math.sqrt((A / V))) / Math.sqrt(l);
double tmp;
if ((V * l) <= -4e+139) {
tmp = t_0;
} else if ((V * l) <= -5e-223) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 5e-323) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else if ((V * l) <= 1e+290) {
tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
} else {
tmp = t_0;
}
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) <= -4e+139: tmp = t_0 elif (V * l) <= -5e-223: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 5e-323: tmp = c0 / math.sqrt((V / (A / l))) elif (V * l) <= 1e+290: tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5)) else: tmp = t_0 return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(Float64(c0 * sqrt(Float64(A / V))) / sqrt(l)) tmp = 0.0 if (Float64(V * l) <= -4e+139) tmp = t_0; elseif (Float64(V * l) <= -5e-223) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 5e-323) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); elseif (Float64(V * l) <= 1e+290) tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); else tmp = t_0; 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) <= -4e+139)
tmp = t_0;
elseif ((V * l) <= -5e-223)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 5e-323)
tmp = c0 / sqrt((V / (A / l)));
elseif ((V * l) <= 1e+290)
tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
else
tmp = 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[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -4e+139], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-223], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-323], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+290], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+139}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-223}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (*.f64 V l) < -4.00000000000000013e139 or 1.00000000000000006e290 < (*.f64 V l) Initial program 41.2%
*-un-lft-identity41.2%
times-frac51.1%
Applied egg-rr51.1%
*-commutative51.1%
associate-*l/53.1%
div-inv53.1%
sqrt-undiv44.9%
associate-*r/45.0%
Applied egg-rr45.0%
if -4.00000000000000013e139 < (*.f64 V l) < -5.00000000000000024e-223Initial program 96.5%
*-un-lft-identity96.5%
times-frac89.0%
Applied egg-rr89.0%
*-commutative89.0%
associate-*l/81.0%
div-inv80.9%
sqrt-undiv40.3%
associate-*r/36.0%
associate-/l*40.4%
sqrt-undiv81.0%
associate-/l*96.6%
*-commutative96.6%
associate-*r/88.9%
Applied egg-rr88.9%
Taylor expanded in V around 0 96.6%
if -5.00000000000000024e-223 < (*.f64 V l) < 4.94066e-323Initial program 45.0%
*-un-lft-identity45.0%
times-frac77.0%
Applied egg-rr77.0%
*-commutative77.0%
associate-*l/79.4%
div-inv79.4%
sqrt-undiv52.5%
associate-*r/50.2%
associate-/l*52.5%
sqrt-undiv79.4%
associate-/l*45.0%
*-commutative45.0%
associate-*r/79.4%
Applied egg-rr79.4%
clear-num77.1%
div-inv77.1%
Applied egg-rr77.1%
if 4.94066e-323 < (*.f64 V l) < 1.00000000000000006e290Initial program 88.6%
div-inv88.6%
sqrt-prod97.7%
pow1/297.7%
inv-pow97.7%
pow-pow98.3%
metadata-eval98.3%
Applied egg-rr98.3%
Final simplification84.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 (/ (* c0 (sqrt (/ A V))) (sqrt l))))
(if (<= (* V l) -2e+262)
t_0
(if (<= (* V l) -1e-230)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-323)
(/ c0 (sqrt (/ V (/ A l))))
(if (<= (* V l) 1e+290)
(* c0 (* (sqrt A) (pow (* V l) -0.5)))
t_0))))))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) <= -2e+262) {
tmp = t_0;
} else if ((V * l) <= -1e-230) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-323) {
tmp = c0 / sqrt((V / (A / l)));
} else if ((V * l) <= 1e+290) {
tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
} else {
tmp = 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 = (c0 * sqrt((a / v))) / sqrt(l)
if ((v * l) <= (-2d+262)) then
tmp = t_0
else if ((v * l) <= (-1d-230)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 5d-323) then
tmp = c0 / sqrt((v / (a / l)))
else if ((v * l) <= 1d+290) then
tmp = c0 * (sqrt(a) * ((v * l) ** (-0.5d0)))
else
tmp = 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 = (c0 * Math.sqrt((A / V))) / Math.sqrt(l);
double tmp;
if ((V * l) <= -2e+262) {
tmp = t_0;
} else if ((V * l) <= -1e-230) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-323) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else if ((V * l) <= 1e+290) {
tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
} else {
tmp = t_0;
}
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) <= -2e+262: tmp = t_0 elif (V * l) <= -1e-230: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-323: tmp = c0 / math.sqrt((V / (A / l))) elif (V * l) <= 1e+290: tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5)) else: tmp = t_0 return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(Float64(c0 * sqrt(Float64(A / V))) / sqrt(l)) tmp = 0.0 if (Float64(V * l) <= -2e+262) tmp = t_0; elseif (Float64(V * l) <= -1e-230) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-323) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); elseif (Float64(V * l) <= 1e+290) tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); else tmp = t_0; 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) <= -2e+262)
tmp = t_0;
elseif ((V * l) <= -1e-230)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-323)
tmp = c0 / sqrt((V / (A / l)));
elseif ((V * l) <= 1e+290)
tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
else
tmp = 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[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+262], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-230], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-323], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+290], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+262}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-230}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (*.f64 V l) < -2e262 or 1.00000000000000006e290 < (*.f64 V l) Initial program 27.0%
*-un-lft-identity27.0%
times-frac45.6%
Applied egg-rr45.6%
*-commutative45.6%
associate-*l/45.6%
div-inv45.6%
sqrt-undiv50.4%
associate-*r/50.5%
Applied egg-rr50.5%
if -2e262 < (*.f64 V l) < -1.00000000000000005e-230Initial program 89.1%
frac-2neg89.1%
sqrt-div99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Applied egg-rr99.3%
if -1.00000000000000005e-230 < (*.f64 V l) < 4.94066e-323Initial program 44.6%
*-un-lft-identity44.6%
times-frac78.2%
Applied egg-rr78.2%
*-commutative78.2%
associate-*l/80.6%
div-inv80.7%
sqrt-undiv54.9%
associate-*r/52.5%
associate-/l*54.9%
sqrt-undiv80.7%
associate-/l*44.6%
*-commutative44.6%
associate-*r/80.7%
Applied egg-rr80.7%
clear-num78.3%
div-inv78.3%
Applied egg-rr78.3%
if 4.94066e-323 < (*.f64 V l) < 1.00000000000000006e290Initial program 88.6%
div-inv88.6%
sqrt-prod97.7%
pow1/297.7%
inv-pow97.7%
pow-pow98.3%
metadata-eval98.3%
Applied egg-rr98.3%
Final simplification89.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) -2e+163)
t_0
(if (<= (* V l) -5e-223)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 5e-323)
(/ c0 (sqrt (/ V (/ A l))))
(if (<= (* V l) 1e+290) (/ c0 (/ (sqrt (* V l)) (sqrt A))) t_0))))))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) <= -2e+163) {
tmp = t_0;
} else if ((V * l) <= -5e-223) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 5e-323) {
tmp = c0 / sqrt((V / (A / l)));
} else if ((V * l) <= 1e+290) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = 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 = c0 * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-2d+163)) then
tmp = t_0
else if ((v * l) <= (-5d-223)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 5d-323) then
tmp = c0 / sqrt((v / (a / l)))
else if ((v * l) <= 1d+290) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = 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 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -2e+163) {
tmp = t_0;
} else if ((V * l) <= -5e-223) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 5e-323) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else if ((V * l) <= 1e+290) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = t_0;
}
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) <= -2e+163: tmp = t_0 elif (V * l) <= -5e-223: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 5e-323: tmp = c0 / math.sqrt((V / (A / l))) elif (V * l) <= 1e+290: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = t_0 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) <= -2e+163) tmp = t_0; elseif (Float64(V * l) <= -5e-223) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 5e-323) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); elseif (Float64(V * l) <= 1e+290) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = t_0; 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) <= -2e+163)
tmp = t_0;
elseif ((V * l) <= -5e-223)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 5e-323)
tmp = c0 / sqrt((V / (A / l)));
elseif ((V * l) <= 1e+290)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = 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[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+163], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-223], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-323], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+290], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\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 -2 \cdot 10^{+163}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-223}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (*.f64 V l) < -1.9999999999999999e163 or 1.00000000000000006e290 < (*.f64 V l) Initial program 35.8%
associate-/r*48.8%
sqrt-div44.5%
Applied egg-rr44.5%
if -1.9999999999999999e163 < (*.f64 V l) < -5.00000000000000024e-223Initial program 96.7%
*-un-lft-identity96.7%
times-frac88.1%
Applied egg-rr88.1%
*-commutative88.1%
associate-*l/82.1%
div-inv82.0%
sqrt-undiv40.8%
associate-*r/36.8%
associate-/l*40.9%
sqrt-undiv82.1%
associate-/l*96.8%
*-commutative96.8%
associate-*r/89.4%
Applied egg-rr89.4%
Taylor expanded in V around 0 96.8%
if -5.00000000000000024e-223 < (*.f64 V l) < 4.94066e-323Initial program 45.0%
*-un-lft-identity45.0%
times-frac77.0%
Applied egg-rr77.0%
*-commutative77.0%
associate-*l/79.4%
div-inv79.4%
sqrt-undiv52.5%
associate-*r/50.2%
associate-/l*52.5%
sqrt-undiv79.4%
associate-/l*45.0%
*-commutative45.0%
associate-*r/79.4%
Applied egg-rr79.4%
clear-num77.1%
div-inv77.1%
Applied egg-rr77.1%
if 4.94066e-323 < (*.f64 V l) < 1.00000000000000006e290Initial program 88.6%
sqrt-div98.3%
associate-*r/94.2%
Applied egg-rr94.2%
associate-*l/94.4%
Simplified94.4%
*-commutative94.4%
clear-num93.7%
un-div-inv94.4%
*-commutative94.4%
Applied egg-rr94.4%
associate-/r/98.3%
associate-*l/94.2%
*-commutative94.2%
associate-/l*98.3%
*-commutative98.3%
Simplified98.3%
Final simplification85.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) -4e+139)
(/ t_0 (/ (sqrt l) c0))
(if (<= (* V l) -5e-223)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 5e-323)
(/ c0 (sqrt (/ V (/ A l))))
(if (<= (* V l) 1e+290)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (/ t_0 (sqrt 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) <= -4e+139) {
tmp = t_0 / (sqrt(l) / c0);
} else if ((V * l) <= -5e-223) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 5e-323) {
tmp = c0 / sqrt((V / (A / l)));
} else if ((V * l) <= 1e+290) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * (t_0 / sqrt(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) <= (-4d+139)) then
tmp = t_0 / (sqrt(l) / c0)
else if ((v * l) <= (-5d-223)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 5d-323) then
tmp = c0 / sqrt((v / (a / l)))
else if ((v * l) <= 1d+290) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = c0 * (t_0 / sqrt(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) <= -4e+139) {
tmp = t_0 / (Math.sqrt(l) / c0);
} else if ((V * l) <= -5e-223) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 5e-323) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else if ((V * l) <= 1e+290) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * (t_0 / Math.sqrt(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) <= -4e+139: tmp = t_0 / (math.sqrt(l) / c0) elif (V * l) <= -5e-223: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 5e-323: tmp = c0 / math.sqrt((V / (A / l))) elif (V * l) <= 1e+290: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * (t_0 / math.sqrt(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) <= -4e+139) tmp = Float64(t_0 / Float64(sqrt(l) / c0)); elseif (Float64(V * l) <= -5e-223) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 5e-323) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); elseif (Float64(V * l) <= 1e+290) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 * Float64(t_0 / sqrt(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) <= -4e+139)
tmp = t_0 / (sqrt(l) / c0);
elseif ((V * l) <= -5e-223)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 5e-323)
tmp = c0 / sqrt((V / (A / l)));
elseif ((V * l) <= 1e+290)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 * (t_0 / sqrt(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], -4e+139], N[(t$95$0 / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-223], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-323], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+290], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(t$95$0 / N[Sqrt[l], $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 -4 \cdot 10^{+139}:\\
\;\;\;\;\frac{t_0}{\frac{\sqrt{\ell}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-223}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{t_0}{\sqrt{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.00000000000000013e139Initial program 58.2%
sqrt-div0.0%
associate-*r/0.0%
Applied egg-rr0.0%
associate-*l/0.0%
Simplified0.0%
associate-*l/0.0%
*-un-lft-identity0.0%
times-frac0.0%
sqrt-div58.2%
*-commutative58.2%
associate-/l/63.8%
sqrt-div43.6%
times-frac43.7%
*-un-lft-identity43.7%
clear-num43.6%
associate-/r*43.5%
Applied egg-rr43.5%
associate-/r/43.5%
associate-*l/43.6%
*-lft-identity43.6%
Simplified43.6%
if -4.00000000000000013e139 < (*.f64 V l) < -5.00000000000000024e-223Initial program 96.5%
*-un-lft-identity96.5%
times-frac89.0%
Applied egg-rr89.0%
*-commutative89.0%
associate-*l/81.0%
div-inv80.9%
sqrt-undiv40.3%
associate-*r/36.0%
associate-/l*40.4%
sqrt-undiv81.0%
associate-/l*96.6%
*-commutative96.6%
associate-*r/88.9%
Applied egg-rr88.9%
Taylor expanded in V around 0 96.6%
if -5.00000000000000024e-223 < (*.f64 V l) < 4.94066e-323Initial program 45.0%
*-un-lft-identity45.0%
times-frac77.0%
Applied egg-rr77.0%
*-commutative77.0%
associate-*l/79.4%
div-inv79.4%
sqrt-undiv52.5%
associate-*r/50.2%
associate-/l*52.5%
sqrt-undiv79.4%
associate-/l*45.0%
*-commutative45.0%
associate-*r/79.4%
Applied egg-rr79.4%
clear-num77.1%
div-inv77.1%
Applied egg-rr77.1%
if 4.94066e-323 < (*.f64 V l) < 1.00000000000000006e290Initial program 88.6%
sqrt-div98.3%
associate-*r/94.2%
Applied egg-rr94.2%
associate-*l/94.4%
Simplified94.4%
*-commutative94.4%
clear-num93.7%
un-div-inv94.4%
*-commutative94.4%
Applied egg-rr94.4%
associate-/r/98.3%
associate-*l/94.2%
*-commutative94.2%
associate-/l*98.3%
*-commutative98.3%
Simplified98.3%
if 1.00000000000000006e290 < (*.f64 V l) Initial program 5.1%
associate-/r*30.3%
sqrt-div47.7%
Applied egg-rr47.7%
Final simplification84.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 (/ (* c0 (sqrt (/ A V))) (sqrt l))))
(if (<= (* V l) -4e+139)
t_0
(if (<= (* V l) -5e-223)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 5e-323)
(/ c0 (sqrt (/ V (/ A l))))
(if (<= (* V l) 1e+290) (/ c0 (/ (sqrt (* V l)) (sqrt A))) t_0))))))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) <= -4e+139) {
tmp = t_0;
} else if ((V * l) <= -5e-223) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 5e-323) {
tmp = c0 / sqrt((V / (A / l)));
} else if ((V * l) <= 1e+290) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = 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 = (c0 * sqrt((a / v))) / sqrt(l)
if ((v * l) <= (-4d+139)) then
tmp = t_0
else if ((v * l) <= (-5d-223)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 5d-323) then
tmp = c0 / sqrt((v / (a / l)))
else if ((v * l) <= 1d+290) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = 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 = (c0 * Math.sqrt((A / V))) / Math.sqrt(l);
double tmp;
if ((V * l) <= -4e+139) {
tmp = t_0;
} else if ((V * l) <= -5e-223) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 5e-323) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else if ((V * l) <= 1e+290) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = t_0;
}
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) <= -4e+139: tmp = t_0 elif (V * l) <= -5e-223: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 5e-323: tmp = c0 / math.sqrt((V / (A / l))) elif (V * l) <= 1e+290: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = t_0 return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(Float64(c0 * sqrt(Float64(A / V))) / sqrt(l)) tmp = 0.0 if (Float64(V * l) <= -4e+139) tmp = t_0; elseif (Float64(V * l) <= -5e-223) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 5e-323) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); elseif (Float64(V * l) <= 1e+290) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = t_0; 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) <= -4e+139)
tmp = t_0;
elseif ((V * l) <= -5e-223)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 5e-323)
tmp = c0 / sqrt((V / (A / l)));
elseif ((V * l) <= 1e+290)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = 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[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -4e+139], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-223], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-323], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+290], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+139}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-223}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (*.f64 V l) < -4.00000000000000013e139 or 1.00000000000000006e290 < (*.f64 V l) Initial program 41.2%
*-un-lft-identity41.2%
times-frac51.1%
Applied egg-rr51.1%
*-commutative51.1%
associate-*l/53.1%
div-inv53.1%
sqrt-undiv44.9%
associate-*r/45.0%
Applied egg-rr45.0%
if -4.00000000000000013e139 < (*.f64 V l) < -5.00000000000000024e-223Initial program 96.5%
*-un-lft-identity96.5%
times-frac89.0%
Applied egg-rr89.0%
*-commutative89.0%
associate-*l/81.0%
div-inv80.9%
sqrt-undiv40.3%
associate-*r/36.0%
associate-/l*40.4%
sqrt-undiv81.0%
associate-/l*96.6%
*-commutative96.6%
associate-*r/88.9%
Applied egg-rr88.9%
Taylor expanded in V around 0 96.6%
if -5.00000000000000024e-223 < (*.f64 V l) < 4.94066e-323Initial program 45.0%
*-un-lft-identity45.0%
times-frac77.0%
Applied egg-rr77.0%
*-commutative77.0%
associate-*l/79.4%
div-inv79.4%
sqrt-undiv52.5%
associate-*r/50.2%
associate-/l*52.5%
sqrt-undiv79.4%
associate-/l*45.0%
*-commutative45.0%
associate-*r/79.4%
Applied egg-rr79.4%
clear-num77.1%
div-inv77.1%
Applied egg-rr77.1%
if 4.94066e-323 < (*.f64 V l) < 1.00000000000000006e290Initial program 88.6%
sqrt-div98.3%
associate-*r/94.2%
Applied egg-rr94.2%
associate-*l/94.4%
Simplified94.4%
*-commutative94.4%
clear-num93.7%
un-div-inv94.4%
*-commutative94.4%
Applied egg-rr94.4%
associate-/r/98.3%
associate-*l/94.2%
*-commutative94.2%
associate-/l*98.3%
*-commutative98.3%
Simplified98.3%
Final simplification84.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 (<= t_0 0.0)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= t_0 5e+276)
(* c0 (sqrt (/ A (/ l (/ 1.0 V)))))
(/ 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 / V)) / sqrt(l));
} else if (t_0 <= 5e+276) {
tmp = c0 * sqrt((A / (l / (1.0 / V))));
} 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 / v)) / sqrt(l))
else if (t_0 <= 5d+276) then
tmp = c0 * sqrt((a / (l / (1.0d0 / v))))
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 / V)) / Math.sqrt(l));
} else if (t_0 <= 5e+276) {
tmp = c0 * Math.sqrt((A / (l / (1.0 / V))));
} 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 / V)) / math.sqrt(l)) elif t_0 <= 5e+276: tmp = c0 * math.sqrt((A / (l / (1.0 / V)))) 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 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (t_0 <= 5e+276) tmp = Float64(c0 * sqrt(Float64(A / Float64(l / Float64(1.0 / V))))); 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 / V)) / sqrt(l));
elseif (t_0 <= 5e+276)
tmp = c0 * sqrt((A / (l / (1.0 / V))));
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[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+276], N[(c0 * N[Sqrt[N[(A / N[(l / N[(1.0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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 \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+276}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{\frac{\ell}{\frac{1}{V}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 24.2%
associate-/r*36.9%
sqrt-div41.3%
Applied egg-rr41.3%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000001e276Initial program 98.8%
*-un-lft-identity98.8%
times-frac90.5%
Applied egg-rr90.5%
*-commutative90.5%
associate-*l/90.1%
associate-/l*98.8%
Applied egg-rr98.8%
if 5.00000000000000001e276 < (/.f64 A (*.f64 V l)) Initial program 46.1%
*-un-lft-identity46.1%
times-frac70.4%
Applied egg-rr70.4%
*-commutative70.4%
associate-*l/67.1%
div-inv67.2%
sqrt-undiv40.9%
associate-*r/39.1%
associate-/l*40.9%
sqrt-undiv67.2%
associate-/l*47.4%
*-commutative47.4%
associate-*r/71.8%
Applied egg-rr71.8%
clear-num71.8%
div-inv71.8%
Applied egg-rr71.8%
Final simplification83.1%
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)
(sqrt (* (/ c0 V) (/ c0 (/ l A))))
(if (<= t_0 5e+276)
(* c0 (sqrt (/ A (/ l (/ 1.0 V)))))
(/ 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 = sqrt(((c0 / V) * (c0 / (l / A))));
} else if (t_0 <= 5e+276) {
tmp = c0 * sqrt((A / (l / (1.0 / V))));
} 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 = sqrt(((c0 / v) * (c0 / (l / a))))
else if (t_0 <= 5d+276) then
tmp = c0 * sqrt((a / (l / (1.0d0 / v))))
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 = Math.sqrt(((c0 / V) * (c0 / (l / A))));
} else if (t_0 <= 5e+276) {
tmp = c0 * Math.sqrt((A / (l / (1.0 / V))));
} 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 = math.sqrt(((c0 / V) * (c0 / (l / A)))) elif t_0 <= 5e+276: tmp = c0 * math.sqrt((A / (l / (1.0 / V)))) 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 = sqrt(Float64(Float64(c0 / V) * Float64(c0 / Float64(l / A)))); elseif (t_0 <= 5e+276) tmp = Float64(c0 * sqrt(Float64(A / Float64(l / Float64(1.0 / V))))); 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 = sqrt(((c0 / V) * (c0 / (l / A))));
elseif (t_0 <= 5e+276)
tmp = c0 * sqrt((A / (l / (1.0 / V))));
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[Sqrt[N[(N[(c0 / V), $MachinePrecision] * N[(c0 / N[(l / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 5e+276], N[(c0 * N[Sqrt[N[(A / N[(l / N[(1.0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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:\\
\;\;\;\;\sqrt{\frac{c0}{V} \cdot \frac{c0}{\frac{\ell}{A}}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+276}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{\frac{\ell}{\frac{1}{V}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 24.2%
*-un-lft-identity24.2%
times-frac36.9%
Applied egg-rr36.9%
*-commutative36.9%
associate-*l/36.9%
div-inv36.9%
sqrt-undiv41.3%
associate-*r/41.4%
associate-/l*41.2%
sqrt-undiv35.0%
associate-/l*24.2%
*-commutative24.2%
associate-*r/35.0%
Applied egg-rr35.0%
clear-num35.0%
associate-*r/24.2%
un-div-inv24.2%
add-sqr-sqrt24.2%
sqrt-unprod24.2%
un-div-inv24.2%
associate-*r/24.2%
clear-num24.2%
un-div-inv24.2%
associate-*r/26.3%
clear-num26.3%
frac-times25.3%
Applied egg-rr25.3%
times-frac36.7%
Simplified36.7%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000001e276Initial program 98.8%
*-un-lft-identity98.8%
times-frac90.5%
Applied egg-rr90.5%
*-commutative90.5%
associate-*l/90.1%
associate-/l*98.8%
Applied egg-rr98.8%
if 5.00000000000000001e276 < (/.f64 A (*.f64 V l)) Initial program 46.1%
*-un-lft-identity46.1%
times-frac70.4%
Applied egg-rr70.4%
*-commutative70.4%
associate-*l/67.1%
div-inv67.2%
sqrt-undiv40.9%
associate-*r/39.1%
associate-/l*40.9%
sqrt-undiv67.2%
associate-/l*47.4%
*-commutative47.4%
associate-*r/71.8%
Applied egg-rr71.8%
clear-num71.8%
div-inv71.8%
Applied egg-rr71.8%
Final simplification82.3%
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)
(/ 1.0 (sqrt (* (/ V c0) (/ (/ l A) c0))))
(if (<= t_0 5e+276)
(* c0 (sqrt (/ A (/ l (/ 1.0 V)))))
(/ 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 = 1.0 / sqrt(((V / c0) * ((l / A) / c0)));
} else if (t_0 <= 5e+276) {
tmp = c0 * sqrt((A / (l / (1.0 / V))));
} 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 = 1.0d0 / sqrt(((v / c0) * ((l / a) / c0)))
else if (t_0 <= 5d+276) then
tmp = c0 * sqrt((a / (l / (1.0d0 / v))))
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 = 1.0 / Math.sqrt(((V / c0) * ((l / A) / c0)));
} else if (t_0 <= 5e+276) {
tmp = c0 * Math.sqrt((A / (l / (1.0 / V))));
} 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 = 1.0 / math.sqrt(((V / c0) * ((l / A) / c0))) elif t_0 <= 5e+276: tmp = c0 * math.sqrt((A / (l / (1.0 / V)))) 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(1.0 / sqrt(Float64(Float64(V / c0) * Float64(Float64(l / A) / c0)))); elseif (t_0 <= 5e+276) tmp = Float64(c0 * sqrt(Float64(A / Float64(l / Float64(1.0 / V))))); 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 = 1.0 / sqrt(((V / c0) * ((l / A) / c0)));
elseif (t_0 <= 5e+276)
tmp = c0 * sqrt((A / (l / (1.0 / V))));
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[(1.0 / N[Sqrt[N[(N[(V / c0), $MachinePrecision] * N[(N[(l / A), $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+276], N[(c0 * N[Sqrt[N[(A / N[(l / N[(1.0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $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:\\
\;\;\;\;\frac{1}{\sqrt{\frac{V}{c0} \cdot \frac{\frac{\ell}{A}}{c0}}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+276}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{\frac{\ell}{\frac{1}{V}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 24.2%
*-un-lft-identity24.2%
times-frac36.9%
Applied egg-rr36.9%
*-commutative36.9%
associate-*l/36.9%
div-inv36.9%
sqrt-undiv41.3%
associate-*r/41.4%
clear-num41.2%
Applied egg-rr41.2%
Taylor expanded in c0 around 0 24.2%
add-sqr-sqrt9.1%
sqrt-unprod24.2%
un-div-inv24.2%
associate-*r/24.2%
un-div-inv24.2%
associate-*r/26.3%
frac-times25.3%
add-sqr-sqrt25.3%
Applied egg-rr25.3%
times-frac36.9%
Simplified36.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000001e276Initial program 98.8%
*-un-lft-identity98.8%
times-frac90.5%
Applied egg-rr90.5%
*-commutative90.5%
associate-*l/90.1%
associate-/l*98.8%
Applied egg-rr98.8%
if 5.00000000000000001e276 < (/.f64 A (*.f64 V l)) Initial program 46.1%
*-un-lft-identity46.1%
times-frac70.4%
Applied egg-rr70.4%
*-commutative70.4%
associate-*l/67.1%
div-inv67.2%
sqrt-undiv40.9%
associate-*r/39.1%
associate-/l*40.9%
sqrt-undiv67.2%
associate-/l*47.4%
*-commutative47.4%
associate-*r/71.8%
Applied egg-rr71.8%
clear-num71.8%
div-inv71.8%
Applied egg-rr71.8%
Final simplification82.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 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 4e+306)))
(* c0 (sqrt (/ (/ A V) l)))
(* 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 <= 4e+306)) {
tmp = c0 * sqrt(((A / V) / l));
} 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 <= 4d+306))) then
tmp = c0 * sqrt(((a / v) / l))
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 <= 4e+306)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} 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 <= 4e+306): tmp = c0 * math.sqrt(((A / V) / l)) 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 <= 4e+306)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); 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 <= 4e+306)))
tmp = c0 * sqrt(((A / V) / l));
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, 4e+306]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[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 4 \cdot 10^{+306}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 4.00000000000000007e306 < (/.f64 A (*.f64 V l)) Initial program 35.1%
pow1/235.1%
clear-num35.1%
inv-pow35.1%
pow-pow35.8%
associate-/l*54.5%
metadata-eval54.5%
Applied egg-rr54.5%
associate-/l*35.8%
*-lft-identity35.8%
times-frac54.5%
/-rgt-identity54.5%
Simplified54.5%
Taylor expanded in c0 around 0 35.1%
associate-/r*54.6%
Simplified54.6%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.00000000000000007e306Initial program 98.8%
Final simplification82.1%
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+276)))
(* 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 <= 5e+276)) {
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 <= 5d+276))) 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 <= 5e+276)) {
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 <= 5e+276): 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 <= 5e+276)) 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 <= 5e+276)))
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, 5e+276]], $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 5 \cdot 10^{+276}\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 5.00000000000000001e276 < (/.f64 A (*.f64 V l)) Initial program 36.4%
pow1/236.4%
clear-num36.4%
inv-pow36.4%
pow-pow37.1%
associate-/l*55.4%
metadata-eval55.4%
Applied egg-rr55.4%
associate-/l*37.1%
*-lft-identity37.1%
times-frac55.4%
/-rgt-identity55.4%
Simplified55.4%
Taylor expanded in c0 around 0 36.4%
associate-/l/55.5%
Simplified55.5%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000001e276Initial program 98.8%
Final simplification82.1%
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+276) (* 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 <= 5e+276) {
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 <= 5d+276) 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 <= 5e+276) {
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 <= 5e+276: 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 <= 5e+276) 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 <= 5e+276)
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, 5e+276], 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 5 \cdot 10^{+276}:\\
\;\;\;\;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 24.2%
pow1/224.2%
clear-num24.2%
inv-pow24.2%
pow-pow24.2%
associate-/l*35.0%
metadata-eval35.0%
Applied egg-rr35.0%
associate-/l*24.2%
*-lft-identity24.2%
times-frac35.0%
/-rgt-identity35.0%
Simplified35.0%
Taylor expanded in c0 around 0 24.2%
associate-/l/36.9%
Simplified36.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000001e276Initial program 98.8%
if 5.00000000000000001e276 < (/.f64 A (*.f64 V l)) Initial program 46.1%
*-un-lft-identity46.1%
times-frac70.4%
Applied egg-rr70.4%
*-commutative70.4%
associate-*l/67.1%
div-inv67.2%
sqrt-undiv40.9%
associate-*r/39.1%
associate-/l*40.9%
sqrt-undiv67.2%
associate-/l*47.4%
*-commutative47.4%
associate-*r/71.8%
Applied egg-rr71.8%
Final simplification82.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 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+276) (* 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 <= 5e+276) {
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 <= 5d+276) 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 <= 5e+276) {
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 <= 5e+276: 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 <= 5e+276) 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 <= 5e+276)
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, 5e+276], 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 5 \cdot 10^{+276}:\\
\;\;\;\;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 24.2%
pow1/224.2%
clear-num24.2%
inv-pow24.2%
pow-pow24.2%
associate-/l*35.0%
metadata-eval35.0%
Applied egg-rr35.0%
associate-/l*24.2%
*-lft-identity24.2%
times-frac35.0%
/-rgt-identity35.0%
Simplified35.0%
Taylor expanded in c0 around 0 24.2%
associate-/l/36.9%
Simplified36.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000001e276Initial program 98.8%
if 5.00000000000000001e276 < (/.f64 A (*.f64 V l)) Initial program 46.1%
*-un-lft-identity46.1%
times-frac70.4%
Applied egg-rr70.4%
*-commutative70.4%
associate-*l/67.1%
div-inv67.2%
sqrt-undiv40.9%
associate-*r/39.1%
associate-/l*40.9%
sqrt-undiv67.2%
associate-/l*47.4%
*-commutative47.4%
associate-*r/71.8%
Applied egg-rr71.8%
clear-num71.8%
div-inv71.8%
Applied egg-rr71.8%
Final simplification82.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 (/ A (* V l))))
(if (<= t_0 5e-310)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+276)
(/ c0 (sqrt (/ (* V l) A)))
(/ 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 <= 5e-310) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 5e+276) {
tmp = c0 / sqrt(((V * l) / A));
} 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 <= 5d-310) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 5d+276) then
tmp = c0 / sqrt(((v * l) / a))
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 <= 5e-310) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+276) {
tmp = c0 / Math.sqrt(((V * l) / A));
} 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 <= 5e-310: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 5e+276: tmp = c0 / math.sqrt(((V * l) / A)) 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 <= 5e-310) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+276) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); 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 <= 5e-310)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 5e+276)
tmp = c0 / sqrt(((V * l) / A));
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, 5e-310], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+276], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $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 5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+276}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.999999999999985e-310Initial program 27.4%
pow1/227.4%
clear-num25.2%
inv-pow25.2%
pow-pow25.2%
associate-/l*35.6%
metadata-eval35.6%
Applied egg-rr35.6%
associate-/l*25.2%
*-lft-identity25.2%
times-frac35.5%
/-rgt-identity35.5%
Simplified35.5%
Taylor expanded in c0 around 0 27.4%
associate-/l/37.5%
Simplified37.5%
if 4.999999999999985e-310 < (/.f64 A (*.f64 V l)) < 5.00000000000000001e276Initial program 98.9%
*-un-lft-identity98.9%
times-frac91.0%
Applied egg-rr91.0%
*-commutative91.0%
associate-*l/90.1%
div-inv90.1%
sqrt-undiv44.8%
associate-*r/41.2%
associate-/l*44.9%
sqrt-undiv90.2%
associate-/l*98.9%
*-commutative98.9%
associate-*r/92.4%
Applied egg-rr92.4%
Taylor expanded in V around 0 98.9%
if 5.00000000000000001e276 < (/.f64 A (*.f64 V l)) Initial program 46.1%
*-un-lft-identity46.1%
times-frac70.4%
Applied egg-rr70.4%
*-commutative70.4%
associate-*l/67.1%
div-inv67.2%
sqrt-undiv40.9%
associate-*r/39.1%
associate-/l*40.9%
sqrt-undiv67.2%
associate-/l*47.4%
*-commutative47.4%
associate-*r/71.8%
Applied egg-rr71.8%
clear-num71.8%
div-inv71.8%
Applied egg-rr71.8%
Final simplification82.1%
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)
(sqrt (* (/ c0 V) (/ c0 (/ l A))))
(if (<= t_0 5e+276) (* 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 = sqrt(((c0 / V) * (c0 / (l / A))));
} else if (t_0 <= 5e+276) {
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 = sqrt(((c0 / v) * (c0 / (l / a))))
else if (t_0 <= 5d+276) 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 = Math.sqrt(((c0 / V) * (c0 / (l / A))));
} else if (t_0 <= 5e+276) {
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 = math.sqrt(((c0 / V) * (c0 / (l / A)))) elif t_0 <= 5e+276: 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 = sqrt(Float64(Float64(c0 / V) * Float64(c0 / Float64(l / A)))); elseif (t_0 <= 5e+276) 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 = sqrt(((c0 / V) * (c0 / (l / A))));
elseif (t_0 <= 5e+276)
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[Sqrt[N[(N[(c0 / V), $MachinePrecision] * N[(c0 / N[(l / A), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 5e+276], 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:\\
\;\;\;\;\sqrt{\frac{c0}{V} \cdot \frac{c0}{\frac{\ell}{A}}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+276}:\\
\;\;\;\;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 24.2%
*-un-lft-identity24.2%
times-frac36.9%
Applied egg-rr36.9%
*-commutative36.9%
associate-*l/36.9%
div-inv36.9%
sqrt-undiv41.3%
associate-*r/41.4%
associate-/l*41.2%
sqrt-undiv35.0%
associate-/l*24.2%
*-commutative24.2%
associate-*r/35.0%
Applied egg-rr35.0%
clear-num35.0%
associate-*r/24.2%
un-div-inv24.2%
add-sqr-sqrt24.2%
sqrt-unprod24.2%
un-div-inv24.2%
associate-*r/24.2%
clear-num24.2%
un-div-inv24.2%
associate-*r/26.3%
clear-num26.3%
frac-times25.3%
Applied egg-rr25.3%
times-frac36.7%
Simplified36.7%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000001e276Initial program 98.8%
if 5.00000000000000001e276 < (/.f64 A (*.f64 V l)) Initial program 46.1%
*-un-lft-identity46.1%
times-frac70.4%
Applied egg-rr70.4%
*-commutative70.4%
associate-*l/67.1%
div-inv67.2%
sqrt-undiv40.9%
associate-*r/39.1%
associate-/l*40.9%
sqrt-undiv67.2%
associate-/l*47.4%
*-commutative47.4%
associate-*r/71.8%
Applied egg-rr71.8%
clear-num71.8%
div-inv71.8%
Applied egg-rr71.8%
Final simplification82.3%
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 74.7%
Final simplification74.7%
herbie shell --seed 2023214
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))