
(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 12 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+189)
(* (sqrt (/ A V)) (/ c0 (sqrt l)))
(if (<= (* V l) -8e-294)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-316)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(* c0 (/ (sqrt A) (sqrt (* V l))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+189) {
tmp = sqrt((A / V)) * (c0 / sqrt(l));
} else if ((V * l) <= -8e-294) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-316) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else {
tmp = c0 * (sqrt(A) / 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+189)) then
tmp = sqrt((a / v)) * (c0 / sqrt(l))
else if ((v * l) <= (-8d-294)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 5d-316) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else
tmp = c0 * (sqrt(a) / 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+189) {
tmp = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
} else if ((V * l) <= -8e-294) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-316) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+189: tmp = math.sqrt((A / V)) * (c0 / math.sqrt(l)) elif (V * l) <= -8e-294: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-316: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) else: tmp = c0 * (math.sqrt(A) / 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+189) tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l))); elseif (Float64(V * l) <= -8e-294) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-316) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); else tmp = Float64(c0 * Float64(sqrt(A) / 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+189)
tmp = sqrt((A / V)) * (c0 / sqrt(l));
elseif ((V * l) <= -8e-294)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-316)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
else
tmp = c0 * (sqrt(A) / 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+189], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -8e-294], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-316], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $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^{+189}:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -8 \cdot 10^{-294}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-316}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1e189Initial program 52.2%
clear-num52.2%
sqrt-div52.2%
metadata-eval52.2%
*-commutative52.2%
associate-/l*71.8%
Applied egg-rr71.8%
associate-/l*52.2%
*-commutative52.2%
associate-/l*72.1%
associate-/r/69.6%
Simplified69.6%
add-sqr-sqrt40.6%
sqrt-unprod29.5%
swap-sqr29.2%
unpow229.2%
frac-times29.2%
add-sqr-sqrt29.2%
frac-times29.2%
clear-num31.5%
associate-*l*34.0%
*-commutative34.0%
div-inv34.0%
sqrt-div24.4%
Applied egg-rr44.7%
*-commutative44.7%
associate-*r/47.2%
Simplified47.2%
if -1e189 < (*.f64 V l) < -8.00000000000000013e-294Initial program 87.5%
frac-2neg87.5%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -8.00000000000000013e-294 < (*.f64 V l) < 5.000000017e-316Initial program 34.7%
clear-num34.7%
sqrt-div34.7%
metadata-eval34.7%
*-commutative34.7%
associate-/l*61.0%
Applied egg-rr61.0%
associate-/l*34.7%
*-commutative34.7%
associate-/l*61.1%
associate-/r/61.0%
Simplified61.0%
un-div-inv61.2%
sqrt-prod43.8%
associate-/r*43.7%
Applied egg-rr43.7%
associate-/l/43.8%
Simplified43.8%
if 5.000000017e-316 < (*.f64 V l) Initial program 75.9%
sqrt-div94.0%
associate-*r/88.4%
Applied egg-rr88.4%
*-commutative88.4%
associate-/l*92.2%
associate-/r/94.0%
Simplified94.0%
Final simplification83.0%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -2e-310) (* (/ (sqrt (- A)) (sqrt (- V))) (* (pow l -0.5) c0)) (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -2e-310) {
tmp = (sqrt(-A) / sqrt(-V)) * (pow(l, -0.5) * c0);
} else {
tmp = c0 * (sqrt(A) / 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 (a <= (-2d-310)) then
tmp = (sqrt(-a) / sqrt(-v)) * ((l ** (-0.5d0)) * c0)
else
tmp = c0 * (sqrt(a) / 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 (A <= -2e-310) {
tmp = (Math.sqrt(-A) / Math.sqrt(-V)) * (Math.pow(l, -0.5) * c0);
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -2e-310: tmp = (math.sqrt(-A) / math.sqrt(-V)) * (math.pow(l, -0.5) * c0) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -2e-310) tmp = Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * Float64((l ^ -0.5) * c0)); else tmp = Float64(c0 * Float64(sqrt(A) / 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 (A <= -2e-310)
tmp = (sqrt(-A) / sqrt(-V)) * ((l ^ -0.5) * c0);
else
tmp = c0 * (sqrt(A) / 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[A, -2e-310], N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * N[(N[Power[l, -0.5], $MachinePrecision] * c0), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{-A}}{\sqrt{-V}} \cdot \left({\ell}^{-0.5} \cdot c0\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -1.999999999999994e-310Initial program 72.9%
pow172.9%
metadata-eval72.9%
pow-prod-up38.0%
pow-prod-down29.8%
*-commutative29.8%
*-commutative29.8%
swap-sqr26.7%
add-sqr-sqrt26.7%
associate-/r*26.0%
pow226.0%
Applied egg-rr26.0%
unpow1/226.0%
associate-*l/26.8%
Simplified26.8%
div-inv26.8%
sqrt-prod14.5%
*-commutative14.5%
sqrt-prod15.2%
unpow215.2%
sqrt-prod15.3%
add-sqr-sqrt38.0%
associate-*r*40.5%
sqrt-prod71.6%
*-commutative71.6%
sqrt-prod40.5%
associate-*l*40.5%
inv-pow40.5%
sqrt-pow140.5%
metadata-eval40.5%
Applied egg-rr40.5%
frac-2neg40.5%
sqrt-div46.5%
Applied egg-rr46.5%
if -1.999999999999994e-310 < A Initial program 69.7%
sqrt-div85.4%
associate-*r/80.6%
Applied egg-rr80.6%
*-commutative80.6%
associate-/l*83.4%
associate-/r/85.4%
Simplified85.4%
Final simplification64.3%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -2e-310) (/ (* (/ (sqrt (- A)) (sqrt (- V))) c0) (sqrt l)) (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -2e-310) {
tmp = ((sqrt(-A) / sqrt(-V)) * c0) / sqrt(l);
} else {
tmp = c0 * (sqrt(A) / 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 (a <= (-2d-310)) then
tmp = ((sqrt(-a) / sqrt(-v)) * c0) / sqrt(l)
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -2e-310) {
tmp = ((Math.sqrt(-A) / Math.sqrt(-V)) * c0) / Math.sqrt(l);
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -2e-310: tmp = ((math.sqrt(-A) / math.sqrt(-V)) * c0) / math.sqrt(l) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -2e-310) tmp = Float64(Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * c0) / sqrt(l)); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -2e-310)
tmp = ((sqrt(-A) / sqrt(-V)) * c0) / sqrt(l);
else
tmp = c0 * (sqrt(A) / 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[A, -2e-310], N[(N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * c0), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{\sqrt{-A}}{\sqrt{-V}} \cdot c0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -1.999999999999994e-310Initial program 72.9%
clear-num72.6%
sqrt-div73.2%
metadata-eval73.2%
*-commutative73.2%
associate-/l*72.1%
Applied egg-rr72.1%
associate-/l*73.2%
*-commutative73.2%
associate-/l*71.0%
associate-/r/71.9%
Simplified71.9%
add-sqr-sqrt38.9%
sqrt-unprod28.7%
swap-sqr25.3%
unpow225.3%
frac-times25.3%
add-sqr-sqrt25.3%
frac-times25.3%
clear-num26.0%
associate-*l*26.8%
*-commutative26.8%
div-inv26.8%
sqrt-div14.5%
Applied egg-rr38.0%
frac-2neg40.5%
sqrt-div46.5%
Applied egg-rr42.9%
if -1.999999999999994e-310 < A Initial program 69.7%
sqrt-div85.4%
associate-*r/80.6%
Applied egg-rr80.6%
*-commutative80.6%
associate-/l*83.4%
associate-/r/85.4%
Simplified85.4%
Final simplification62.3%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
(if (<= (* V l) -2e+191)
t_0
(if (<= (* V l) -2e-90)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 5e-316) t_0 (* (sqrt A) (/ c0 (sqrt (* V l)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -2e+191) {
tmp = t_0;
} else if ((V * l) <= -2e-90) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 5e-316) {
tmp = t_0;
} else {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-2d+191)) then
tmp = t_0
else if ((v * l) <= (-2d-90)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 5d-316) then
tmp = t_0
else
tmp = sqrt(a) * (c0 / sqrt((v * l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -2e+191) {
tmp = t_0;
} else if ((V * l) <= -2e-90) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 5e-316) {
tmp = t_0;
} else {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -2e+191: tmp = t_0 elif (V * l) <= -2e-90: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 5e-316: tmp = t_0 else: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -2e+191) tmp = t_0; elseif (Float64(V * l) <= -2e-90) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 5e-316) tmp = t_0; else tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -2e+191)
tmp = t_0;
elseif ((V * l) <= -2e-90)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 5e-316)
tmp = t_0;
else
tmp = sqrt(A) * (c0 / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+191], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-90], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-316], t$95$0, N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+191}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-90}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-316}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000015e191 or -1.99999999999999999e-90 < (*.f64 V l) < 5.000000017e-316Initial program 54.8%
associate-/r*67.0%
sqrt-div46.6%
Applied egg-rr46.6%
if -2.00000000000000015e191 < (*.f64 V l) < -1.99999999999999999e-90Initial program 97.8%
if 5.000000017e-316 < (*.f64 V l) Initial program 75.9%
clear-num75.9%
sqrt-div77.4%
metadata-eval77.4%
*-commutative77.4%
associate-/l*75.4%
Applied egg-rr75.4%
associate-/l*77.4%
*-commutative77.4%
associate-/l*70.2%
associate-/r/74.7%
Simplified74.7%
un-div-inv74.7%
*-un-lft-identity74.7%
sqrt-prod41.0%
times-frac40.4%
metadata-eval40.4%
sqrt-div40.4%
clear-num40.4%
sqrt-div44.1%
times-frac43.9%
sqrt-prod88.4%
associate-/l*92.2%
Applied egg-rr92.2%
associate-/l*88.4%
associate-*r/92.0%
Simplified92.0%
Final simplification74.5%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (/ A V))))
(if (<= (* V l) -1e+189)
(* t_0 (/ c0 (sqrt l)))
(if (<= (* V l) -2e-90)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 5e-316)
(* c0 (/ t_0 (sqrt l)))
(* (sqrt A) (/ c0 (sqrt (* V l)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -1e+189) {
tmp = t_0 * (c0 / sqrt(l));
} else if ((V * l) <= -2e-90) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 5e-316) {
tmp = c0 * (t_0 / sqrt(l));
} else {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-1d+189)) then
tmp = t_0 * (c0 / sqrt(l))
else if ((v * l) <= (-2d-90)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 5d-316) then
tmp = c0 * (t_0 / sqrt(l))
else
tmp = sqrt(a) * (c0 / sqrt((v * l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -1e+189) {
tmp = t_0 * (c0 / Math.sqrt(l));
} else if ((V * l) <= -2e-90) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 5e-316) {
tmp = c0 * (t_0 / Math.sqrt(l));
} else {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -1e+189: tmp = t_0 * (c0 / math.sqrt(l)) elif (V * l) <= -2e-90: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 5e-316: tmp = c0 * (t_0 / math.sqrt(l)) else: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -1e+189) tmp = Float64(t_0 * Float64(c0 / sqrt(l))); elseif (Float64(V * l) <= -2e-90) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 5e-316) tmp = Float64(c0 * Float64(t_0 / sqrt(l))); else tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -1e+189)
tmp = t_0 * (c0 / sqrt(l));
elseif ((V * l) <= -2e-90)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 5e-316)
tmp = c0 * (t_0 / sqrt(l));
else
tmp = sqrt(A) * (c0 / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+189], N[(t$95$0 * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-90], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-316], N[(c0 * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+189}:\\
\;\;\;\;t_0 \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-90}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-316}:\\
\;\;\;\;c0 \cdot \frac{t_0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1e189Initial program 52.2%
clear-num52.2%
sqrt-div52.2%
metadata-eval52.2%
*-commutative52.2%
associate-/l*71.8%
Applied egg-rr71.8%
associate-/l*52.2%
*-commutative52.2%
associate-/l*72.1%
associate-/r/69.6%
Simplified69.6%
add-sqr-sqrt40.6%
sqrt-unprod29.5%
swap-sqr29.2%
unpow229.2%
frac-times29.2%
add-sqr-sqrt29.2%
frac-times29.2%
clear-num31.5%
associate-*l*34.0%
*-commutative34.0%
div-inv34.0%
sqrt-div24.4%
Applied egg-rr44.7%
*-commutative44.7%
associate-*r/47.2%
Simplified47.2%
if -1e189 < (*.f64 V l) < -1.99999999999999999e-90Initial program 97.8%
if -1.99999999999999999e-90 < (*.f64 V l) < 5.000000017e-316Initial program 56.9%
associate-/r*64.8%
sqrt-div45.6%
Applied egg-rr45.6%
if 5.000000017e-316 < (*.f64 V l) Initial program 75.9%
clear-num75.9%
sqrt-div77.4%
metadata-eval77.4%
*-commutative77.4%
associate-/l*75.4%
Applied egg-rr75.4%
associate-/l*77.4%
*-commutative77.4%
associate-/l*70.2%
associate-/r/74.7%
Simplified74.7%
un-div-inv74.7%
*-un-lft-identity74.7%
sqrt-prod41.0%
times-frac40.4%
metadata-eval40.4%
sqrt-div40.4%
clear-num40.4%
sqrt-div44.1%
times-frac43.9%
sqrt-prod88.4%
associate-/l*92.2%
Applied egg-rr92.2%
associate-/l*88.4%
associate-*r/92.0%
Simplified92.0%
Final simplification74.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 (sqrt (/ A V))))
(if (<= (* V l) -1e+189)
(* t_0 (/ c0 (sqrt l)))
(if (<= (* V l) -2e-90)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 5e-316)
(* c0 (/ t_0 (sqrt l)))
(* c0 (/ (sqrt A) (sqrt (* V l)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -1e+189) {
tmp = t_0 * (c0 / sqrt(l));
} else if ((V * l) <= -2e-90) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 5e-316) {
tmp = c0 * (t_0 / sqrt(l));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-1d+189)) then
tmp = t_0 * (c0 / sqrt(l))
else if ((v * l) <= (-2d-90)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 5d-316) then
tmp = c0 * (t_0 / sqrt(l))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -1e+189) {
tmp = t_0 * (c0 / Math.sqrt(l));
} else if ((V * l) <= -2e-90) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 5e-316) {
tmp = c0 * (t_0 / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -1e+189: tmp = t_0 * (c0 / math.sqrt(l)) elif (V * l) <= -2e-90: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 5e-316: tmp = c0 * (t_0 / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -1e+189) tmp = Float64(t_0 * Float64(c0 / sqrt(l))); elseif (Float64(V * l) <= -2e-90) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 5e-316) tmp = Float64(c0 * Float64(t_0 / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -1e+189)
tmp = t_0 * (c0 / sqrt(l));
elseif ((V * l) <= -2e-90)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 5e-316)
tmp = c0 * (t_0 / sqrt(l));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+189], N[(t$95$0 * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-90], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-316], N[(c0 * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+189}:\\
\;\;\;\;t_0 \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-90}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-316}:\\
\;\;\;\;c0 \cdot \frac{t_0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1e189Initial program 52.2%
clear-num52.2%
sqrt-div52.2%
metadata-eval52.2%
*-commutative52.2%
associate-/l*71.8%
Applied egg-rr71.8%
associate-/l*52.2%
*-commutative52.2%
associate-/l*72.1%
associate-/r/69.6%
Simplified69.6%
add-sqr-sqrt40.6%
sqrt-unprod29.5%
swap-sqr29.2%
unpow229.2%
frac-times29.2%
add-sqr-sqrt29.2%
frac-times29.2%
clear-num31.5%
associate-*l*34.0%
*-commutative34.0%
div-inv34.0%
sqrt-div24.4%
Applied egg-rr44.7%
*-commutative44.7%
associate-*r/47.2%
Simplified47.2%
if -1e189 < (*.f64 V l) < -1.99999999999999999e-90Initial program 97.8%
if -1.99999999999999999e-90 < (*.f64 V l) < 5.000000017e-316Initial program 56.9%
associate-/r*64.8%
sqrt-div45.6%
Applied egg-rr45.6%
if 5.000000017e-316 < (*.f64 V l) Initial program 75.9%
sqrt-div94.0%
associate-*r/88.4%
Applied egg-rr88.4%
*-commutative88.4%
associate-/l*92.2%
associate-/r/94.0%
Simplified94.0%
Final simplification74.9%
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+189)
(* (sqrt (/ A V)) (/ c0 (sqrt l)))
(if (<= (* V l) -1e-40)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 5e-316)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(* c0 (/ (sqrt A) (sqrt (* V l))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+189) {
tmp = sqrt((A / V)) * (c0 / sqrt(l));
} else if ((V * l) <= -1e-40) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 5e-316) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else {
tmp = c0 * (sqrt(A) / 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+189)) then
tmp = sqrt((a / v)) * (c0 / sqrt(l))
else if ((v * l) <= (-1d-40)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 5d-316) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else
tmp = c0 * (sqrt(a) / 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+189) {
tmp = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
} else if ((V * l) <= -1e-40) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 5e-316) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+189: tmp = math.sqrt((A / V)) * (c0 / math.sqrt(l)) elif (V * l) <= -1e-40: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 5e-316: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) else: tmp = c0 * (math.sqrt(A) / 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+189) tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l))); elseif (Float64(V * l) <= -1e-40) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 5e-316) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); else tmp = Float64(c0 * Float64(sqrt(A) / 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+189)
tmp = sqrt((A / V)) * (c0 / sqrt(l));
elseif ((V * l) <= -1e-40)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 5e-316)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
else
tmp = c0 * (sqrt(A) / 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+189], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-40], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-316], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $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^{+189}:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-40}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-316}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1e189Initial program 52.2%
clear-num52.2%
sqrt-div52.2%
metadata-eval52.2%
*-commutative52.2%
associate-/l*71.8%
Applied egg-rr71.8%
associate-/l*52.2%
*-commutative52.2%
associate-/l*72.1%
associate-/r/69.6%
Simplified69.6%
add-sqr-sqrt40.6%
sqrt-unprod29.5%
swap-sqr29.2%
unpow229.2%
frac-times29.2%
add-sqr-sqrt29.2%
frac-times29.2%
clear-num31.5%
associate-*l*34.0%
*-commutative34.0%
div-inv34.0%
sqrt-div24.4%
Applied egg-rr44.7%
*-commutative44.7%
associate-*r/47.2%
Simplified47.2%
if -1e189 < (*.f64 V l) < -9.9999999999999993e-41Initial program 99.8%
if -9.9999999999999993e-41 < (*.f64 V l) < 5.000000017e-316Initial program 57.9%
clear-num57.9%
sqrt-div58.9%
metadata-eval58.9%
*-commutative58.9%
associate-/l*66.0%
Applied egg-rr66.0%
associate-/l*58.9%
*-commutative58.9%
associate-/l*66.6%
associate-/r/66.0%
Simplified66.0%
un-div-inv66.2%
sqrt-prod44.5%
associate-/r*43.2%
Applied egg-rr43.2%
associate-/l/44.5%
Simplified44.5%
if 5.000000017e-316 < (*.f64 V l) Initial program 75.9%
sqrt-div94.0%
associate-*r/88.4%
Applied egg-rr88.4%
*-commutative88.4%
associate-/l*92.2%
associate-/r/94.0%
Simplified94.0%
Final simplification74.1%
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 (/ l (/ A V)))) (* 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((l / (A / V)));
} 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((l / (a / v)))
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((l / (A / V)));
} 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((l / (A / V))) 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 / sqrt(Float64(l / Float64(A / V)))); 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((l / (A / V)));
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[Sqrt[N[(l / N[(A / V), $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}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -3.999999999999988e-310Initial program 69.2%
clear-num69.2%
sqrt-div69.8%
metadata-eval69.8%
*-commutative69.8%
associate-/l*70.4%
Applied egg-rr70.4%
associate-/l*69.8%
*-commutative69.8%
associate-/l*69.4%
associate-/r/69.2%
Simplified69.2%
un-div-inv69.3%
clear-num69.2%
associate-*l/69.7%
associate-/l*69.4%
Applied egg-rr69.4%
associate-/r/69.4%
metadata-eval69.4%
associate-/r*69.4%
neg-mul-169.4%
associate-/r/69.4%
associate-/l*69.5%
*-commutative69.5%
associate-/l*69.5%
neg-mul-169.5%
associate-/l*69.5%
metadata-eval69.5%
associate-/r*69.5%
neg-mul-169.5%
associate-/l*69.5%
neg-mul-169.5%
remove-double-neg69.5%
/-rgt-identity69.5%
associate-/l*69.8%
associate-*r/69.5%
Simplified69.5%
*-commutative69.5%
associate-/r/70.4%
Applied egg-rr70.4%
if -3.999999999999988e-310 < l Initial program 73.8%
associate-/r*74.2%
sqrt-div86.3%
Applied egg-rr86.3%
Final simplification78.1%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 5e+257)))
(* 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 <= 5e+257)) {
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 <= 5d+257))) 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 <= 5e+257)) {
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 <= 5e+257): 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 <= 5e+257)) 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 <= 5e+257)))
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, 5e+257]], $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 5 \cdot 10^{+257}\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 5.00000000000000028e257 < (/.f64 A (*.f64 V l)) Initial program 41.4%
associate-/r*53.8%
div-inv53.7%
Applied egg-rr53.7%
un-div-inv53.8%
Applied egg-rr53.8%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000028e257Initial program 99.2%
Final simplification77.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) l)))
(if (<= t_0 5e+282) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 5e+282) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 5d+282) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 5e+282) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 5e+282: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 5e+282) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 5e+282)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+282], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+282}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 39.9%
associate-/r*57.8%
div-inv57.8%
Applied egg-rr57.8%
un-div-inv57.8%
Applied egg-rr57.8%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.99999999999999978e282Initial program 99.2%
if 4.99999999999999978e282 < (/.f64 A (*.f64 V l)) Initial program 36.8%
clear-num36.8%
sqrt-div40.8%
metadata-eval40.8%
*-commutative40.8%
associate-/l*52.0%
Applied egg-rr52.0%
associate-/l*40.8%
*-commutative40.8%
associate-/l*51.6%
associate-/r/52.0%
Simplified52.0%
un-div-inv52.1%
clear-num52.1%
associate-*l/40.8%
associate-/l*51.7%
Applied egg-rr51.7%
associate-/r/51.6%
metadata-eval51.6%
associate-/r*51.6%
neg-mul-151.6%
associate-/r/51.7%
associate-/l*51.7%
*-commutative51.7%
associate-/l*51.7%
neg-mul-151.7%
associate-/l*51.7%
metadata-eval51.7%
associate-/r*51.7%
neg-mul-151.7%
associate-/l*51.7%
neg-mul-151.7%
remove-double-neg51.7%
/-rgt-identity51.7%
associate-/l*40.8%
associate-*r/51.7%
Simplified51.7%
Final simplification78.9%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(/ c0 (sqrt (/ V (/ A l))))
(if (<= t_0 5e+282) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / sqrt((V / (A / l)));
} else if (t_0 <= 5e+282) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 / sqrt((v / (a / l)))
else if (t_0 <= 5d+282) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else if (t_0 <= 5e+282) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 / math.sqrt((V / (A / l))) elif t_0 <= 5e+282: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); elseif (t_0 <= 5e+282) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 / sqrt((V / (A / l)));
elseif (t_0 <= 5e+282)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+282], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+282}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 39.9%
clear-num39.9%
sqrt-div39.9%
metadata-eval39.9%
*-commutative39.9%
associate-/l*57.8%
Applied egg-rr57.8%
associate-/l*39.9%
*-commutative39.9%
associate-/l*57.8%
associate-/r/57.8%
Simplified57.8%
un-div-inv57.8%
associate-*l/39.9%
associate-/l*57.9%
Applied egg-rr57.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.99999999999999978e282Initial program 99.2%
if 4.99999999999999978e282 < (/.f64 A (*.f64 V l)) Initial program 36.8%
clear-num36.8%
sqrt-div40.8%
metadata-eval40.8%
*-commutative40.8%
associate-/l*52.0%
Applied egg-rr52.0%
associate-/l*40.8%
*-commutative40.8%
associate-/l*51.6%
associate-/r/52.0%
Simplified52.0%
un-div-inv52.1%
clear-num52.1%
associate-*l/40.8%
associate-/l*51.7%
Applied egg-rr51.7%
associate-/r/51.6%
metadata-eval51.6%
associate-/r*51.6%
neg-mul-151.6%
associate-/r/51.7%
associate-/l*51.7%
*-commutative51.7%
associate-/l*51.7%
neg-mul-151.7%
associate-/l*51.7%
metadata-eval51.7%
associate-/r*51.7%
neg-mul-151.7%
associate-/l*51.7%
neg-mul-151.7%
remove-double-neg51.7%
/-rgt-identity51.7%
associate-/l*40.8%
associate-*r/51.7%
Simplified51.7%
Final simplification78.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 71.4%
Final simplification71.4%
herbie shell --seed 2023306
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))