
(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) -5e+251)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -5e-98)
(* c0 (/ 1.0 (/ (sqrt (* V (- l))) (sqrt (- A)))))
(if (<= (* V l) 0.0)
(* c0 (/ (sqrt (/ (- A) l)) (sqrt (- V))))
(* c0 (* (sqrt A) (pow (* V l) -0.5)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+251) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -5e-98) {
tmp = c0 * (1.0 / (sqrt((V * -l)) / sqrt(-A)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
} 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) :: tmp
if ((v * l) <= (-5d+251)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-5d-98)) then
tmp = c0 * (1.0d0 / (sqrt((v * -l)) / sqrt(-a)))
else if ((v * l) <= 0.0d0) then
tmp = c0 * (sqrt((-a / l)) / sqrt(-v))
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 tmp;
if ((V * l) <= -5e+251) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -5e-98) {
tmp = c0 * (1.0 / (Math.sqrt((V * -l)) / Math.sqrt(-A)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.sqrt((-A / l)) / Math.sqrt(-V));
} 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): tmp = 0 if (V * l) <= -5e+251: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -5e-98: tmp = c0 * (1.0 / (math.sqrt((V * -l)) / math.sqrt(-A))) elif (V * l) <= 0.0: tmp = c0 * (math.sqrt((-A / l)) / math.sqrt(-V)) 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) tmp = 0.0 if (Float64(V * l) <= -5e+251) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -5e-98) tmp = Float64(c0 * Float64(1.0 / Float64(sqrt(Float64(V * Float64(-l))) / sqrt(Float64(-A))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V)))); 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)
tmp = 0.0;
if ((V * l) <= -5e+251)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -5e-98)
tmp = c0 * (1.0 / (sqrt((V * -l)) / sqrt(-A)));
elseif ((V * l) <= 0.0)
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e+251], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-98], N[(c0 * N[(1.0 / N[(N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-A)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $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}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+251}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-98}:\\
\;\;\;\;c0 \cdot \frac{1}{\frac{\sqrt{V \cdot \left(-\ell\right)}}{\sqrt{-A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -5.0000000000000005e251Initial program 58.0%
associate-/r*81.2%
sqrt-div48.0%
Applied egg-rr48.0%
if -5.0000000000000005e251 < (*.f64 V l) < -5.00000000000000018e-98Initial program 96.6%
clear-num94.3%
sqrt-div94.3%
metadata-eval94.3%
associate-/l*82.0%
Applied egg-rr82.0%
associate-/l*94.3%
Simplified94.3%
frac-2neg94.3%
sqrt-div99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -5.00000000000000018e-98 < (*.f64 V l) < -0.0Initial program 60.0%
associate-/r*67.2%
div-inv67.2%
Applied egg-rr67.2%
un-div-inv67.2%
Applied egg-rr67.2%
associate-/r*60.0%
associate-/l/67.0%
frac-2neg67.0%
sqrt-div41.7%
distribute-neg-frac41.7%
Applied egg-rr41.7%
if -0.0 < (*.f64 V l) Initial program 84.0%
div-inv83.9%
sqrt-prod93.3%
pow1/293.3%
inv-pow93.3%
pow-pow93.4%
metadata-eval93.4%
Applied egg-rr93.4%
Final simplification76.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 (/ A (* V l))))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 4e+283) t_0 (sqrt (* A (* (/ c0 l) (/ c0 V))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 4e+283) {
tmp = t_0;
} else {
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
}
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 * l)))
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 4d+283) then
tmp = t_0
else
tmp = sqrt((a * ((c0 / l) * (c0 / v))))
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 * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 4e+283) {
tmp = t_0;
} else {
tmp = Math.sqrt((A * ((c0 / l) * (c0 / V))));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 4e+283: tmp = t_0 else: tmp = math.sqrt((A * ((c0 / l) * (c0 / V)))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 4e+283) tmp = t_0; else tmp = sqrt(Float64(A * Float64(Float64(c0 / l) * Float64(c0 / V)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 4e+283)
tmp = t_0;
else
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
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[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+283], t$95$0, N[Sqrt[N[(A * N[(N[(c0 / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 4 \cdot 10^{+283}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < -0.0Initial program 76.1%
associate-/r*79.2%
div-inv79.2%
Applied egg-rr79.2%
un-div-inv79.2%
Applied egg-rr79.2%
if -0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999982e283Initial program 99.3%
if 3.99999999999999982e283 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 41.3%
add-sqr-sqrt41.3%
sqrt-unprod41.3%
pow1/241.3%
*-commutative41.3%
*-commutative41.3%
swap-sqr40.6%
add-sqr-sqrt40.6%
Applied egg-rr40.6%
unpow1/240.6%
Simplified40.6%
Taylor expanded in A around 0 50.0%
unpow250.0%
associate-*r/50.1%
*-commutative50.1%
times-frac78.7%
Simplified78.7%
Final simplification84.3%
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) (pow (* V l) -0.5)))))
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) * 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) :: tmp
if (a <= (-5d-310)) then
tmp = (c0 * (sqrt(-a) / sqrt(-v))) * (l ** (-0.5d0))
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 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.pow((V * l), -0.5));
}
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.pow((V * l), -0.5)) 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) * (Float64(V * l) ^ -0.5))); 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) * ((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_] := 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[Power[N[(V * l), $MachinePrecision], -0.5], $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 {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 76.4%
add-sqr-sqrt38.9%
sqrt-unprod30.1%
pow1/230.1%
*-commutative30.1%
*-commutative30.1%
swap-sqr26.2%
add-sqr-sqrt26.3%
Applied egg-rr26.3%
unpow1/226.3%
Simplified26.3%
*-commutative26.3%
sqrt-prod29.1%
sqrt-prod34.8%
associate-/r*34.7%
un-div-inv34.7%
add-sqr-sqrt78.2%
sqrt-prod40.1%
associate-*r*38.7%
inv-pow38.7%
sqrt-pow138.7%
metadata-eval38.7%
Applied egg-rr38.7%
frac-2neg38.7%
sqrt-div44.4%
Applied egg-rr44.4%
if -4.999999999999985e-310 < A Initial program 79.4%
div-inv79.3%
sqrt-prod87.8%
pow1/287.8%
inv-pow87.8%
pow-pow87.8%
metadata-eval87.8%
Applied egg-rr87.8%
Final simplification65.3%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= V -4e-310) (* c0 (/ (sqrt (/ (- A) l)) (sqrt (- V)))) (* (sqrt A) (* c0 (/ (sqrt (/ 1.0 V)) (sqrt l))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -4e-310) {
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
} else {
tmp = sqrt(A) * (c0 * (sqrt((1.0 / 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 <= (-4d-310)) then
tmp = c0 * (sqrt((-a / l)) / sqrt(-v))
else
tmp = sqrt(a) * (c0 * (sqrt((1.0d0 / 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 <= -4e-310) {
tmp = c0 * (Math.sqrt((-A / l)) / Math.sqrt(-V));
} else {
tmp = Math.sqrt(A) * (c0 * (Math.sqrt((1.0 / V)) / Math.sqrt(l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if V <= -4e-310: tmp = c0 * (math.sqrt((-A / l)) / math.sqrt(-V)) else: tmp = math.sqrt(A) * (c0 * (math.sqrt((1.0 / V)) / math.sqrt(l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= -4e-310) tmp = Float64(c0 * Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V)))); else tmp = Float64(sqrt(A) * Float64(c0 * Float64(sqrt(Float64(1.0 / 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 <= -4e-310)
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
else
tmp = sqrt(A) * (c0 * (sqrt((1.0 / 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, -4e-310], N[(c0 * N[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 * N[(N[Sqrt[N[(1.0 / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -4 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \left(c0 \cdot \frac{\sqrt{\frac{1}{V}}}{\sqrt{\ell}}\right)\\
\end{array}
\end{array}
if V < -3.999999999999988e-310Initial program 76.3%
associate-/r*76.6%
div-inv76.6%
Applied egg-rr76.6%
un-div-inv76.6%
Applied egg-rr76.6%
associate-/r*76.3%
associate-/l/77.1%
frac-2neg77.1%
sqrt-div86.4%
distribute-neg-frac86.4%
Applied egg-rr86.4%
if -3.999999999999988e-310 < V Initial program 79.0%
sqrt-div44.1%
associate-*r/42.9%
Applied egg-rr42.9%
associate-*l/43.4%
Simplified43.4%
Taylor expanded in c0 around 0 43.5%
associate-/r*43.4%
sqrt-div50.0%
inv-pow50.0%
Applied egg-rr50.0%
unpow-150.0%
Simplified50.0%
Final simplification65.8%
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) (* (/ (sqrt (- A)) (sqrt (- V))) (/ c0 (sqrt l))) (* c0 (* (sqrt A) (pow (* V l) -0.5)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = (sqrt(-A) / sqrt(-V)) * (c0 / sqrt(l));
} 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) :: tmp
if (a <= (-5d-310)) then
tmp = (sqrt(-a) / sqrt(-v)) * (c0 / sqrt(l))
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 tmp;
if (A <= -5e-310) {
tmp = (Math.sqrt(-A) / Math.sqrt(-V)) * (c0 / Math.sqrt(l));
} 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): tmp = 0 if A <= -5e-310: tmp = (math.sqrt(-A) / math.sqrt(-V)) * (c0 / math.sqrt(l)) 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) tmp = 0.0 if (A <= -5e-310) tmp = Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * Float64(c0 / sqrt(l))); 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)
tmp = 0.0;
if (A <= -5e-310)
tmp = (sqrt(-A) / sqrt(-V)) * (c0 / sqrt(l));
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_] := If[LessEqual[A, -5e-310], N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $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}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-A}}{\sqrt{-V}} \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 76.4%
associate-/r*78.2%
div-inv78.2%
Applied egg-rr78.2%
un-div-inv78.2%
Applied egg-rr78.2%
sqrt-div40.1%
associate-*r/38.7%
Applied egg-rr38.7%
associate-/l*40.1%
associate-/r/39.4%
Simplified39.4%
frac-2neg38.7%
sqrt-div44.4%
Applied egg-rr44.2%
if -4.999999999999985e-310 < A Initial program 79.4%
div-inv79.3%
sqrt-prod87.8%
pow1/287.8%
inv-pow87.8%
pow-pow87.8%
metadata-eval87.8%
Applied egg-rr87.8%
Final simplification65.2%
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+251)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -5e-98)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0 (/ (sqrt (/ (- A) l)) (sqrt (- V))))
(* c0 (* (sqrt A) (pow (* V l) -0.5)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+251) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -5e-98) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
} 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) :: tmp
if ((v * l) <= (-5d+251)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-5d-98)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 * (sqrt((-a / l)) / sqrt(-v))
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 tmp;
if ((V * l) <= -5e+251) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -5e-98) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.sqrt((-A / l)) / Math.sqrt(-V));
} 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): tmp = 0 if (V * l) <= -5e+251: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -5e-98: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 * (math.sqrt((-A / l)) / math.sqrt(-V)) 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) tmp = 0.0 if (Float64(V * l) <= -5e+251) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -5e-98) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V)))); 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)
tmp = 0.0;
if ((V * l) <= -5e+251)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -5e-98)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e+251], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-98], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $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}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+251}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-98}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -5.0000000000000005e251Initial program 58.0%
associate-/r*81.2%
sqrt-div48.0%
Applied egg-rr48.0%
if -5.0000000000000005e251 < (*.f64 V l) < -5.00000000000000018e-98Initial program 96.6%
frac-2neg96.6%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -5.00000000000000018e-98 < (*.f64 V l) < -0.0Initial program 60.0%
associate-/r*67.2%
div-inv67.2%
Applied egg-rr67.2%
un-div-inv67.2%
Applied egg-rr67.2%
associate-/r*60.0%
associate-/l/67.0%
frac-2neg67.0%
sqrt-div41.7%
distribute-neg-frac41.7%
Applied egg-rr41.7%
if -0.0 < (*.f64 V l) Initial program 84.0%
div-inv83.9%
sqrt-prod93.3%
pow1/293.3%
inv-pow93.3%
pow-pow93.4%
metadata-eval93.4%
Applied egg-rr93.4%
Final simplification76.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+251)
(* c0 (/ t_0 (sqrt l)))
(if (<= (* V l) -5e-293)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(/ (* c0 t_0) (sqrt l))
(* 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+251) {
tmp = c0 * (t_0 / sqrt(l));
} else if ((V * l) <= -5e-293) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = (c0 * t_0) / sqrt(l);
} 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+251)) then
tmp = c0 * (t_0 / sqrt(l))
else if ((v * l) <= (-5d-293)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = (c0 * t_0) / sqrt(l)
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+251) {
tmp = c0 * (t_0 / Math.sqrt(l));
} else if ((V * l) <= -5e-293) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = (c0 * t_0) / Math.sqrt(l);
} 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+251: tmp = c0 * (t_0 / math.sqrt(l)) elif (V * l) <= -5e-293: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = (c0 * t_0) / math.sqrt(l) 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+251) tmp = Float64(c0 * Float64(t_0 / sqrt(l))); elseif (Float64(V * l) <= -5e-293) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(Float64(c0 * t_0) / sqrt(l)); 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+251)
tmp = c0 * (t_0 / sqrt(l));
elseif ((V * l) <= -5e-293)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = (c0 * t_0) / sqrt(l);
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+251], N[(c0 * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-293], 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[(N[(c0 * t$95$0), $MachinePrecision] / N[Sqrt[l], $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^{+251}:\\
\;\;\;\;c0 \cdot \frac{t_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-293}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0 \cdot t_0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -5.0000000000000005e251Initial program 58.0%
associate-/r*81.2%
sqrt-div48.0%
Applied egg-rr48.0%
if -5.0000000000000005e251 < (*.f64 V l) < -5.0000000000000003e-293Initial program 89.7%
frac-2neg89.7%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -5.0000000000000003e-293 < (*.f64 V l) < -0.0Initial program 47.0%
associate-/r*64.7%
div-inv64.7%
Applied egg-rr64.7%
un-div-inv64.7%
Applied egg-rr64.7%
sqrt-div39.7%
associate-*r/39.7%
Applied egg-rr39.7%
if -0.0 < (*.f64 V l) Initial program 84.0%
div-inv83.9%
sqrt-prod93.3%
pow1/293.3%
inv-pow93.3%
pow-pow93.4%
metadata-eval93.4%
Applied egg-rr93.4%
Final simplification82.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 (or (<= t_0 5e-291) (not (<= t_0 1e+294)))
(* c0 (/ (sqrt (/ A V)) (sqrt 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 <= 5e-291) || !(t_0 <= 1e+294)) {
tmp = c0 * (sqrt((A / V)) / sqrt(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 <= 5d-291) .or. (.not. (t_0 <= 1d+294))) then
tmp = c0 * (sqrt((a / v)) / sqrt(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 <= 5e-291) || !(t_0 <= 1e+294)) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(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 <= 5e-291) or not (t_0 <= 1e+294): tmp = c0 * (math.sqrt((A / V)) / math.sqrt(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 <= 5e-291) || !(t_0 <= 1e+294)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(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 <= 5e-291) || ~((t_0 <= 1e+294)))
tmp = c0 * (sqrt((A / V)) / sqrt(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, 5e-291], N[Not[LessEqual[t$95$0, 1e+294]], $MachinePrecision]], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[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 5 \cdot 10^{-291} \lor \neg \left(t_0 \leq 10^{+294}\right):\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 5.0000000000000003e-291 or 1.00000000000000007e294 < (/.f64 A (*.f64 V l)) Initial program 41.0%
associate-/r*56.7%
sqrt-div45.7%
Applied egg-rr45.7%
if 5.0000000000000003e-291 < (/.f64 A (*.f64 V l)) < 1.00000000000000007e294Initial program 99.6%
Final simplification79.6%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -4e-310) (* c0 (* (sqrt A) (pow (* V l) -0.5))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -4e-310) {
tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
} else {
tmp = c0 * (sqrt((A / 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 (l <= (-4d-310)) then
tmp = c0 * (sqrt(a) * ((v * l) ** (-0.5d0)))
else
tmp = c0 * (sqrt((a / 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 (l <= -4e-310) {
tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if l <= -4e-310: tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5)) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -4e-310) tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / 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 (l <= -4e-310)
tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
else
tmp = c0 * (sqrt((A / 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[l, -4e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -3.999999999999988e-310Initial program 82.8%
div-inv82.7%
sqrt-prod36.7%
pow1/236.7%
inv-pow36.7%
pow-pow36.8%
metadata-eval36.8%
Applied egg-rr36.8%
if -3.999999999999988e-310 < l Initial program 73.5%
associate-/r*74.1%
sqrt-div83.8%
Applied egg-rr83.8%
Final simplification61.8%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -4e-310) (* (sqrt A) (/ c0 (sqrt (* V l)))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -4e-310) {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
} else {
tmp = c0 * (sqrt((A / 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 (l <= (-4d-310)) then
tmp = sqrt(a) * (c0 / sqrt((v * l)))
else
tmp = c0 * (sqrt((a / 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 (l <= -4e-310) {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if l <= -4e-310: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -4e-310) tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / 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 (l <= -4e-310)
tmp = sqrt(A) * (c0 / sqrt((V * l)));
else
tmp = c0 * (sqrt((A / 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[l, -4e-310], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -3.999999999999988e-310Initial program 82.8%
sqrt-div36.6%
associate-*r/35.9%
Applied egg-rr35.9%
associate-*l/36.2%
Simplified36.2%
if -3.999999999999988e-310 < l Initial program 73.5%
associate-/r*74.1%
sqrt-div83.8%
Applied egg-rr83.8%
Final simplification61.5%
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 V)) (sqrt l))) (/ c0 (/ (sqrt (* V l)) (sqrt A)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} 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) :: tmp
if (a <= (-5d-310)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
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 tmp;
if (A <= -5e-310) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); 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)
tmp = 0.0;
if (A <= -5e-310)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
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_] := If[LessEqual[A, -5e-310], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 76.4%
associate-/r*78.2%
sqrt-div40.1%
Applied egg-rr40.1%
if -4.999999999999985e-310 < A Initial program 79.4%
sqrt-div87.7%
associate-*r/85.5%
Applied egg-rr85.5%
associate-/l*87.7%
Simplified87.7%
Final simplification63.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 5e-291)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+294) (* c0 (sqrt t_0)) (* c0 (pow (* l (/ V 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 <= 5e-291) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 1e+294) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow((l * (V / 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 <= 5d-291) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 1d+294) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * ((l * (v / 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 <= 5e-291) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+294) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow((l * (V / 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 <= 5e-291: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 1e+294: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow((l * (V / 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 <= 5e-291) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+294) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (Float64(l * Float64(V / 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 <= 5e-291)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 1e+294)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * ((l * (V / 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[LessEqual[t$95$0, 5e-291], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+294], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $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 5 \cdot 10^{-291}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 10^{+294}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 5.0000000000000003e-291Initial program 37.0%
associate-/r*59.9%
div-inv59.9%
Applied egg-rr59.9%
un-div-inv59.9%
Applied egg-rr59.9%
if 5.0000000000000003e-291 < (/.f64 A (*.f64 V l)) < 1.00000000000000007e294Initial program 99.6%
if 1.00000000000000007e294 < (/.f64 A (*.f64 V l)) Initial program 43.4%
associate-/r*54.8%
div-inv54.8%
Applied egg-rr54.8%
un-div-inv54.8%
associate-/r*43.4%
clear-num43.4%
associate-*r/54.8%
inv-pow54.8%
metadata-eval54.8%
pow-prod-up54.8%
sqrt-unprod54.7%
add-sqr-sqrt54.8%
associate-*r/44.3%
*-commutative44.3%
*-un-lft-identity44.3%
times-frac55.7%
/-rgt-identity55.7%
Applied egg-rr55.7%
Final simplification83.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 (pow (/ V (/ A l)) -0.5))
(if (<= t_0 1e+294) (* c0 (sqrt t_0)) (* c0 (pow (* l (/ V 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) {
tmp = c0 * pow((V / (A / l)), -0.5);
} else if (t_0 <= 1e+294) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow((l * (V / 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) then
tmp = c0 * ((v / (a / l)) ** (-0.5d0))
else if (t_0 <= 1d+294) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * ((l * (v / 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) {
tmp = c0 * Math.pow((V / (A / l)), -0.5);
} else if (t_0 <= 1e+294) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow((l * (V / 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: tmp = c0 * math.pow((V / (A / l)), -0.5) elif t_0 <= 1e+294: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow((l * (V / 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) tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5)); elseif (t_0 <= 1e+294) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (Float64(l * Float64(V / 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)
tmp = c0 * ((V / (A / l)) ^ -0.5);
elseif (t_0 <= 1e+294)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * ((l * (V / 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[LessEqual[t$95$0, 0.0], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+294], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $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:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\
\mathbf{elif}\;t_0 \leq 10^{+294}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 33.4%
pow1/233.4%
clear-num33.4%
inv-pow33.4%
pow-pow33.4%
associate-/l*59.7%
metadata-eval59.7%
Applied egg-rr59.7%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.00000000000000007e294Initial program 99.2%
if 1.00000000000000007e294 < (/.f64 A (*.f64 V l)) Initial program 43.4%
associate-/r*54.8%
div-inv54.8%
Applied egg-rr54.8%
un-div-inv54.8%
associate-/r*43.4%
clear-num43.4%
associate-*r/54.8%
inv-pow54.8%
metadata-eval54.8%
pow-prod-up54.8%
sqrt-unprod54.7%
add-sqr-sqrt54.8%
associate-*r/44.3%
*-commutative44.3%
*-un-lft-identity44.3%
times-frac55.7%
/-rgt-identity55.7%
Applied egg-rr55.7%
Final simplification84.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 5e-291) (not (<= t_0 1e+294)))
(* 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 <= 5e-291) || !(t_0 <= 1e+294)) {
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 <= 5d-291) .or. (.not. (t_0 <= 1d+294))) 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 <= 5e-291) || !(t_0 <= 1e+294)) {
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 <= 5e-291) or not (t_0 <= 1e+294): 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 <= 5e-291) || !(t_0 <= 1e+294)) 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 <= 5e-291) || ~((t_0 <= 1e+294)))
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, 5e-291], N[Not[LessEqual[t$95$0, 1e+294]], $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 5 \cdot 10^{-291} \lor \neg \left(t_0 \leq 10^{+294}\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)) < 5.0000000000000003e-291 or 1.00000000000000007e294 < (/.f64 A (*.f64 V l)) Initial program 41.0%
associate-/r*56.7%
div-inv56.7%
Applied egg-rr56.7%
un-div-inv56.7%
Applied egg-rr56.7%
if 5.0000000000000003e-291 < (/.f64 A (*.f64 V l)) < 1.00000000000000007e294Initial program 99.6%
Final simplification83.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 (/ A (* V l))))
(if (<= t_0 5e-291)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+248) (* c0 (sqrt t_0)) (* c0 (sqrt (/ (/ A l) V)))))))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-291) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+248) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * sqrt(((A / l) / V));
}
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-291) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+248) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * sqrt(((a / l) / v))
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-291) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+248) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 5e-291: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+248: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.sqrt(((A / l) / V)) 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-291) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+248) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); 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-291)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+248)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * sqrt(((A / l) / V));
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-291], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+248], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $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^{-291}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+248}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 5.0000000000000003e-291Initial program 37.0%
associate-/r*59.9%
div-inv59.9%
Applied egg-rr59.9%
un-div-inv59.9%
Applied egg-rr59.9%
if 5.0000000000000003e-291 < (/.f64 A (*.f64 V l)) < 2.00000000000000009e248Initial program 99.6%
if 2.00000000000000009e248 < (/.f64 A (*.f64 V l)) Initial program 44.3%
associate-/r*53.9%
div-inv53.9%
Applied egg-rr53.9%
associate-*l/55.5%
div-inv55.5%
Applied egg-rr55.5%
Final simplification83.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 (/ A (* V l))))
(if (<= t_0 5e-291)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+294) (* c0 (sqrt t_0)) (/ c0 (sqrt (* l (/ V 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 <= 5e-291) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 1e+294) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((l * (V / 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 <= 5d-291) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 1d+294) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((l * (v / 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 <= 5e-291) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+294) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 5e-291: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 1e+294: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((l * (V / 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 <= 5e-291) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+294) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / 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 <= 5e-291)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 1e+294)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((l * (V / 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, 5e-291], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+294], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / 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 5 \cdot 10^{-291}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 10^{+294}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 5.0000000000000003e-291Initial program 37.0%
associate-/r*59.9%
div-inv59.9%
Applied egg-rr59.9%
un-div-inv59.9%
Applied egg-rr59.9%
if 5.0000000000000003e-291 < (/.f64 A (*.f64 V l)) < 1.00000000000000007e294Initial program 99.6%
if 1.00000000000000007e294 < (/.f64 A (*.f64 V l)) Initial program 43.4%
pow1/243.4%
clear-num43.4%
inv-pow43.4%
pow-pow44.3%
associate-/l*54.8%
metadata-eval54.8%
Applied egg-rr54.8%
div-inv54.8%
clear-num54.8%
metadata-eval54.8%
pow-flip54.8%
pow1/254.8%
div-inv54.7%
clear-num54.7%
div-inv54.7%
associate-/r/55.6%
Applied egg-rr55.6%
Final simplification83.9%
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 77.8%
Final simplification77.8%
herbie shell --seed 2023279
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))