
(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 11 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-191)
(* c0 (/ (sqrt (- A)) (sqrt (* l (- V)))))
(if (<= (* V l) 5e-309)
(* c0 (pow (* V (/ l A)) -0.5))
(/ c0 (* (pow A -0.5) (sqrt (* V l)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e-191) {
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
} else if ((V * l) <= 5e-309) {
tmp = c0 * pow((V * (l / A)), -0.5);
} else {
tmp = c0 / (pow(A, -0.5) * sqrt((V * l)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-1d-191)) then
tmp = c0 * (sqrt(-a) / sqrt((l * -v)))
else if ((v * l) <= 5d-309) then
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
else
tmp = c0 / ((a ** (-0.5d0)) * sqrt((v * l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e-191) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((l * -V)));
} else if ((V * l) <= 5e-309) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} else {
tmp = c0 / (Math.pow(A, -0.5) * Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e-191: tmp = c0 * (math.sqrt(-A) / math.sqrt((l * -V))) elif (V * l) <= 5e-309: tmp = c0 * math.pow((V * (l / A)), -0.5) else: tmp = c0 / (math.pow(A, -0.5) * math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e-191) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V))))); elseif (Float64(V * l) <= 5e-309) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); else tmp = Float64(c0 / Float64((A ^ -0.5) * sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -1e-191)
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
elseif ((V * l) <= 5e-309)
tmp = c0 * ((V * (l / A)) ^ -0.5);
else
tmp = c0 / ((A ^ -0.5) * sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e-191], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-309], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Power[A, -0.5], $MachinePrecision] * N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{-191}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{{A}^{-0.5} \cdot \sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1e-191Initial program 83.2%
frac-2neg83.2%
sqrt-div94.6%
*-commutative94.6%
distribute-rgt-neg-in94.6%
Applied egg-rr94.6%
if -1e-191 < (*.f64 V l) < 4.9999999999999995e-309Initial program 51.9%
pow1/251.9%
clear-num51.9%
inv-pow51.9%
pow-pow51.9%
associate-/l*76.2%
metadata-eval76.2%
Applied egg-rr76.2%
associate-/l*51.9%
*-lft-identity51.9%
times-frac76.2%
/-rgt-identity76.2%
Simplified76.2%
if 4.9999999999999995e-309 < (*.f64 V l) Initial program 83.0%
sqrt-div90.6%
associate-*r/89.8%
Applied egg-rr89.8%
associate-/l*90.7%
Simplified90.7%
sqrt-undiv82.9%
*-un-lft-identity82.9%
associate-*l/82.9%
sqrt-prod90.7%
inv-pow90.7%
sqrt-pow190.7%
metadata-eval90.7%
Applied egg-rr90.7%
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 (* V (/ l A))))
(if (<= (* V l) -5e-64)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) 5e-287)
(* c0 (pow t_0 -0.5))
(if (<= (* V l) 5e+237)
(* (sqrt A) (/ c0 (sqrt (* V l))))
(/ c0 (sqrt t_0)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = V * (l / A);
double tmp;
if ((V * l) <= -5e-64) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= 5e-287) {
tmp = c0 * pow(t_0, -0.5);
} else if ((V * l) <= 5e+237) {
tmp = sqrt(A) * (c0 / sqrt((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 = v * (l / a)
if ((v * l) <= (-5d-64)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= 5d-287) then
tmp = c0 * (t_0 ** (-0.5d0))
else if ((v * l) <= 5d+237) then
tmp = sqrt(a) * (c0 / sqrt((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 = V * (l / A);
double tmp;
if ((V * l) <= -5e-64) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= 5e-287) {
tmp = c0 * Math.pow(t_0, -0.5);
} else if ((V * l) <= 5e+237) {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
} else {
tmp = c0 / Math.sqrt(t_0);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = V * (l / A) tmp = 0 if (V * l) <= -5e-64: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= 5e-287: tmp = c0 * math.pow(t_0, -0.5) elif (V * l) <= 5e+237: tmp = math.sqrt(A) * (c0 / math.sqrt((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(V * Float64(l / A)) tmp = 0.0 if (Float64(V * l) <= -5e-64) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= 5e-287) tmp = Float64(c0 * (t_0 ^ -0.5)); elseif (Float64(V * l) <= 5e+237) tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(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 = V * (l / A);
tmp = 0.0;
if ((V * l) <= -5e-64)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= 5e-287)
tmp = c0 * (t_0 ^ -0.5);
elseif ((V * l) <= 5e+237)
tmp = sqrt(A) * (c0 / sqrt((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[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e-64], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-287], N[(c0 * N[Power[t$95$0, -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+237], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $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 := V \cdot \frac{\ell}{A}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-64}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-287}:\\
\;\;\;\;c0 \cdot {t_0}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+237}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{t_0}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000033e-64Initial program 81.3%
associate-/r*74.2%
sqrt-div34.7%
Applied egg-rr34.7%
if -5.00000000000000033e-64 < (*.f64 V l) < 5.00000000000000025e-287Initial program 65.4%
pow1/265.4%
clear-num65.4%
inv-pow65.4%
pow-pow65.3%
associate-/l*81.3%
metadata-eval81.3%
Applied egg-rr81.3%
associate-/l*65.3%
*-lft-identity65.3%
times-frac81.3%
/-rgt-identity81.3%
Simplified81.3%
if 5.00000000000000025e-287 < (*.f64 V l) < 5.0000000000000002e237Initial program 89.4%
sqrt-div99.3%
associate-*r/99.4%
Applied egg-rr99.4%
associate-*l/97.4%
Simplified97.4%
if 5.0000000000000002e237 < (*.f64 V l) Initial program 61.3%
pow1/261.3%
clear-num61.3%
inv-pow61.3%
pow-pow61.2%
associate-/l*71.7%
metadata-eval71.7%
Applied egg-rr71.7%
associate-/l*61.2%
Simplified61.2%
metadata-eval61.2%
sqrt-pow261.3%
inv-pow61.3%
un-div-inv61.5%
associate-*r/71.9%
Applied egg-rr71.9%
Final simplification71.8%
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-64)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) 5e-309)
(* c0 (pow (* V (/ l A)) -0.5))
(/ c0 (* (pow A -0.5) (sqrt (* V l)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-64) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= 5e-309) {
tmp = c0 * pow((V * (l / A)), -0.5);
} else {
tmp = c0 / (pow(A, -0.5) * sqrt((V * l)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-5d-64)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= 5d-309) then
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
else
tmp = c0 / ((a ** (-0.5d0)) * sqrt((v * l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-64) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= 5e-309) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} else {
tmp = c0 / (Math.pow(A, -0.5) * Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e-64: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= 5e-309: tmp = c0 * math.pow((V * (l / A)), -0.5) else: tmp = c0 / (math.pow(A, -0.5) * math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e-64) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= 5e-309) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); else tmp = Float64(c0 / Float64((A ^ -0.5) * sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e-64)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= 5e-309)
tmp = c0 * ((V * (l / A)) ^ -0.5);
else
tmp = c0 / ((A ^ -0.5) * sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e-64], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-309], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Power[A, -0.5], $MachinePrecision] * N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-64}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{{A}^{-0.5} \cdot \sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000033e-64Initial program 81.3%
associate-/r*74.2%
sqrt-div34.7%
Applied egg-rr34.7%
if -5.00000000000000033e-64 < (*.f64 V l) < 4.9999999999999995e-309Initial program 64.8%
pow1/264.8%
clear-num64.8%
inv-pow64.8%
pow-pow64.8%
associate-/l*81.0%
metadata-eval81.0%
Applied egg-rr81.0%
associate-/l*64.8%
*-lft-identity64.8%
times-frac81.0%
/-rgt-identity81.0%
Simplified81.0%
if 4.9999999999999995e-309 < (*.f64 V l) Initial program 83.0%
sqrt-div90.6%
associate-*r/89.8%
Applied egg-rr89.8%
associate-/l*90.7%
Simplified90.7%
sqrt-undiv82.9%
*-un-lft-identity82.9%
associate-*l/82.9%
sqrt-prod90.7%
inv-pow90.7%
sqrt-pow190.7%
metadata-eval90.7%
Applied egg-rr90.7%
Final simplification71.4%
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-64)
(* c0 (* (pow (/ V A) -0.5) (pow l -0.5)))
(if (<= (* V l) 5e-309)
(* c0 (pow (* V (/ l A)) -0.5))
(/ c0 (* (pow A -0.5) (sqrt (* V l)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-64) {
tmp = c0 * (pow((V / A), -0.5) * pow(l, -0.5));
} else if ((V * l) <= 5e-309) {
tmp = c0 * pow((V * (l / A)), -0.5);
} else {
tmp = c0 / (pow(A, -0.5) * sqrt((V * l)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-5d-64)) then
tmp = c0 * (((v / a) ** (-0.5d0)) * (l ** (-0.5d0)))
else if ((v * l) <= 5d-309) then
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
else
tmp = c0 / ((a ** (-0.5d0)) * sqrt((v * l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-64) {
tmp = c0 * (Math.pow((V / A), -0.5) * Math.pow(l, -0.5));
} else if ((V * l) <= 5e-309) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} else {
tmp = c0 / (Math.pow(A, -0.5) * Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e-64: tmp = c0 * (math.pow((V / A), -0.5) * math.pow(l, -0.5)) elif (V * l) <= 5e-309: tmp = c0 * math.pow((V * (l / A)), -0.5) else: tmp = c0 / (math.pow(A, -0.5) * math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e-64) tmp = Float64(c0 * Float64((Float64(V / A) ^ -0.5) * (l ^ -0.5))); elseif (Float64(V * l) <= 5e-309) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); else tmp = Float64(c0 / Float64((A ^ -0.5) * sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e-64)
tmp = c0 * (((V / A) ^ -0.5) * (l ^ -0.5));
elseif ((V * l) <= 5e-309)
tmp = c0 * ((V * (l / A)) ^ -0.5);
else
tmp = c0 / ((A ^ -0.5) * sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e-64], N[(c0 * N[(N[Power[N[(V / A), $MachinePrecision], -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-309], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Power[A, -0.5], $MachinePrecision] * N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-64}:\\
\;\;\;\;c0 \cdot \left({\left(\frac{V}{A}\right)}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{{A}^{-0.5} \cdot \sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000033e-64Initial program 81.3%
pow1/281.3%
clear-num81.3%
inv-pow81.3%
pow-pow81.3%
associate-/l*76.4%
metadata-eval76.4%
Applied egg-rr76.4%
associate-/l*81.3%
Simplified81.3%
clear-num81.3%
associate-/r/81.3%
Applied egg-rr81.3%
associate-*r*72.5%
unpow-prod-down34.7%
Applied egg-rr34.7%
associate-*l/34.8%
*-lft-identity34.8%
Simplified34.8%
if -5.00000000000000033e-64 < (*.f64 V l) < 4.9999999999999995e-309Initial program 64.8%
pow1/264.8%
clear-num64.8%
inv-pow64.8%
pow-pow64.8%
associate-/l*81.0%
metadata-eval81.0%
Applied egg-rr81.0%
associate-/l*64.8%
*-lft-identity64.8%
times-frac81.0%
/-rgt-identity81.0%
Simplified81.0%
if 4.9999999999999995e-309 < (*.f64 V l) Initial program 83.0%
sqrt-div90.6%
associate-*r/89.8%
Applied egg-rr89.8%
associate-/l*90.7%
Simplified90.7%
sqrt-undiv82.9%
*-un-lft-identity82.9%
associate-*l/82.9%
sqrt-prod90.7%
inv-pow90.7%
sqrt-pow190.7%
metadata-eval90.7%
Applied egg-rr90.7%
Final simplification71.4%
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-64)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) 5e-309)
(* c0 (pow (* V (/ l A)) -0.5))
(/ c0 (/ (sqrt (* V l)) (sqrt A))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-64) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= 5e-309) {
tmp = c0 * pow((V * (l / A)), -0.5);
} 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 ((v * l) <= (-5d-64)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= 5d-309) then
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
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 ((V * l) <= -5e-64) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= 5e-309) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} 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 (V * l) <= -5e-64: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= 5e-309: tmp = c0 * math.pow((V * (l / A)), -0.5) 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 (Float64(V * l) <= -5e-64) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= 5e-309) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); 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 ((V * l) <= -5e-64)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= 5e-309)
tmp = c0 * ((V * (l / A)) ^ -0.5);
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[N[(V * l), $MachinePrecision], -5e-64], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-309], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $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}\;V \cdot \ell \leq -5 \cdot 10^{-64}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000033e-64Initial program 81.3%
associate-/r*74.2%
sqrt-div34.7%
Applied egg-rr34.7%
if -5.00000000000000033e-64 < (*.f64 V l) < 4.9999999999999995e-309Initial program 64.8%
pow1/264.8%
clear-num64.8%
inv-pow64.8%
pow-pow64.8%
associate-/l*81.0%
metadata-eval81.0%
Applied egg-rr81.0%
associate-/l*64.8%
*-lft-identity64.8%
times-frac81.0%
/-rgt-identity81.0%
Simplified81.0%
if 4.9999999999999995e-309 < (*.f64 V l) Initial program 83.0%
sqrt-div90.6%
associate-*r/89.8%
Applied egg-rr89.8%
associate-/l*90.7%
Simplified90.7%
Final simplification71.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 V)) (sqrt l)))
(if (<= t_0 5e+263) (* c0 (sqrt t_0)) (* c0 (pow (* V (/ l A)) -0.5))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if (t_0 <= 5e+263) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if (t_0 <= 5d+263) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if (t_0 <= 5e+263) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif t_0 <= 5e+263: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow((V * (l / A)), -0.5) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (t_0 <= 5e+263) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif (t_0 <= 5e+263)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * ((V * (l / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[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+263], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / 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 \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+263}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 35.2%
associate-/r*46.0%
sqrt-div29.7%
Applied egg-rr29.7%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000022e263Initial program 99.1%
if 5.00000000000000022e263 < (/.f64 A (*.f64 V l)) Initial program 43.1%
pow1/243.1%
clear-num43.1%
inv-pow43.1%
pow-pow43.1%
associate-/l*62.1%
metadata-eval62.1%
Applied egg-rr62.1%
associate-/l*43.1%
*-lft-identity43.1%
times-frac62.1%
/-rgt-identity62.1%
Simplified62.1%
Final simplification80.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))) (t_1 (* V (/ l A))))
(if (<= t_0 0.0)
(/ c0 (sqrt t_1))
(if (<= t_0 5e+263) (* c0 (sqrt t_0)) (* c0 (pow t_1 -0.5))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double t_1 = V * (l / A);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / sqrt(t_1);
} else if (t_0 <= 5e+263) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow(t_1, -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) :: t_1
real(8) :: tmp
t_0 = a / (v * l)
t_1 = v * (l / a)
if (t_0 <= 0.0d0) then
tmp = c0 / sqrt(t_1)
else if (t_0 <= 5d+263) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * (t_1 ** (-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 t_1 = V * (l / A);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / Math.sqrt(t_1);
} else if (t_0 <= 5e+263) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow(t_1, -0.5);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) t_1 = V * (l / A) tmp = 0 if t_0 <= 0.0: tmp = c0 / math.sqrt(t_1) elif t_0 <= 5e+263: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow(t_1, -0.5) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) t_1 = Float64(V * Float64(l / A)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 / sqrt(t_1)); elseif (t_0 <= 5e+263) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (t_1 ^ -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);
t_1 = V * (l / A);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 / sqrt(t_1);
elseif (t_0 <= 5e+263)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * (t_1 ^ -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]}, Block[{t$95$1 = N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 / N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+263], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[t$95$1, -0.5], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
t_1 := V \cdot \frac{\ell}{A}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{t_1}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+263}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {t_1}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 35.2%
pow1/235.2%
clear-num35.2%
inv-pow35.2%
pow-pow35.2%
associate-/l*46.0%
metadata-eval46.0%
Applied egg-rr46.0%
associate-/l*35.2%
Simplified35.2%
metadata-eval35.2%
sqrt-pow235.2%
inv-pow35.2%
un-div-inv35.2%
associate-*r/46.0%
Applied egg-rr46.0%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000022e263Initial program 99.1%
if 5.00000000000000022e263 < (/.f64 A (*.f64 V l)) Initial program 43.1%
pow1/243.1%
clear-num43.1%
inv-pow43.1%
pow-pow43.1%
associate-/l*62.1%
metadata-eval62.1%
Applied egg-rr62.1%
associate-/l*43.1%
*-lft-identity43.1%
times-frac62.1%
/-rgt-identity62.1%
Simplified62.1%
Final simplification83.5%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 5e-323)
(sqrt (/ (* A (* c0 c0)) (* V l)))
(if (<= t_0 5e+263) (* c0 (sqrt t_0)) (* c0 (pow (* V (/ l A)) -0.5))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-323) {
tmp = sqrt(((A * (c0 * c0)) / (V * l)));
} else if (t_0 <= 5e+263) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 5d-323) then
tmp = sqrt(((a * (c0 * c0)) / (v * l)))
else if (t_0 <= 5d+263) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-323) {
tmp = Math.sqrt(((A * (c0 * c0)) / (V * l)));
} else if (t_0 <= 5e+263) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 5e-323: tmp = math.sqrt(((A * (c0 * c0)) / (V * l))) elif t_0 <= 5e+263: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow((V * (l / A)), -0.5) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 5e-323) tmp = sqrt(Float64(Float64(A * Float64(c0 * c0)) / Float64(V * l))); elseif (t_0 <= 5e+263) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 5e-323)
tmp = sqrt(((A * (c0 * c0)) / (V * l)));
elseif (t_0 <= 5e+263)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * ((V * (l / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-323], N[Sqrt[N[(N[(A * N[(c0 * c0), $MachinePrecision]), $MachinePrecision] / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 5e+263], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / 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^{-323}:\\
\;\;\;\;\sqrt{\frac{A \cdot \left(c0 \cdot c0\right)}{V \cdot \ell}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+263}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.94066e-323Initial program 35.1%
pow1/235.1%
clear-num34.5%
inv-pow34.5%
pow-pow34.5%
associate-/l*45.1%
metadata-eval45.1%
Applied egg-rr45.1%
associate-/l*34.5%
Simplified34.5%
add-sqr-sqrt34.5%
sqrt-unprod34.5%
*-commutative34.5%
*-commutative34.5%
swap-sqr33.8%
pow-prod-up33.8%
metadata-eval33.8%
inv-pow33.8%
clear-num34.4%
Applied egg-rr34.4%
associate-*l/46.5%
Simplified46.5%
if 4.94066e-323 < (/.f64 A (*.f64 V l)) < 5.00000000000000022e263Initial program 99.5%
if 5.00000000000000022e263 < (/.f64 A (*.f64 V l)) Initial program 43.1%
pow1/243.1%
clear-num43.1%
inv-pow43.1%
pow-pow43.1%
associate-/l*62.1%
metadata-eval62.1%
Applied egg-rr62.1%
associate-/l*43.1%
*-lft-identity43.1%
times-frac62.1%
/-rgt-identity62.1%
Simplified62.1%
Final simplification83.6%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 4e+296)))
(* 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+296)) {
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+296))) 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+296)) {
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+296): 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+296)) 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+296)))
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+296]], $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^{+296}\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 3.99999999999999993e296 < (/.f64 A (*.f64 V l)) Initial program 36.3%
pow1/236.3%
clear-num36.3%
inv-pow36.3%
pow-pow36.3%
associate-/l*53.1%
metadata-eval53.1%
Applied egg-rr53.1%
associate-/l*36.3%
Simplified36.3%
Taylor expanded in c0 around 0 36.3%
associate-/r*53.1%
Simplified53.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 3.99999999999999993e296Initial program 99.1%
Final simplification83.8%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 5e+263)))
(/ c0 (sqrt (* V (/ l A))))
(* 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+263)) {
tmp = c0 / sqrt((V * (l / A)));
} 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+263))) then
tmp = c0 / sqrt((v * (l / a)))
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+263)) {
tmp = c0 / Math.sqrt((V * (l / A)));
} 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+263): tmp = c0 / math.sqrt((V * (l / A))) 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+263)) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); 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+263)))
tmp = c0 / sqrt((V * (l / A)));
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+263]], $MachinePrecision]], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $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^{+263}\right):\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 5.00000000000000022e263 < (/.f64 A (*.f64 V l)) Initial program 39.2%
pow1/239.2%
clear-num39.2%
inv-pow39.2%
pow-pow39.2%
associate-/l*54.2%
metadata-eval54.2%
Applied egg-rr54.2%
associate-/l*39.2%
Simplified39.2%
metadata-eval39.2%
sqrt-pow239.2%
inv-pow39.2%
un-div-inv39.2%
associate-*r/54.2%
Applied egg-rr54.2%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000022e263Initial program 99.1%
Final simplification83.5%
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 78.2%
Final simplification78.2%
herbie shell --seed 2023200
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))