
(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: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -1e-244)
(* c0 (/ (/ (sqrt (- A)) (sqrt (- V))) (sqrt l)))
(if (<= (* V l) 5e-323)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) 2e+277)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (pow (* l (/ V A)) -0.5))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e-244) {
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
} else if ((V * l) <= 5e-323) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= 2e+277) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * pow((l * (V / A)), -0.5);
}
return tmp;
}
NOTE: c0, A, 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-244)) then
tmp = c0 * ((sqrt(-a) / sqrt(-v)) / sqrt(l))
else if ((v * l) <= 5d-323) then
tmp = c0 / sqrt((v * (l / a)))
else if ((v * l) <= 2d+277) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * ((l * (v / a)) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e-244) {
tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) / Math.sqrt(l));
} else if ((V * l) <= 5e-323) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if ((V * l) <= 2e+277) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.pow((l * (V / A)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e-244: tmp = c0 * ((math.sqrt(-A) / math.sqrt(-V)) / math.sqrt(l)) elif (V * l) <= 5e-323: tmp = c0 / math.sqrt((V * (l / A))) elif (V * l) <= 2e+277: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.pow((l * (V / A)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e-244) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / sqrt(l))); elseif (Float64(V * l) <= 5e-323) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 2e+277) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -1e-244)
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
elseif ((V * l) <= 5e-323)
tmp = c0 / sqrt((V * (l / A)));
elseif ((V * l) <= 2e+277)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * ((l * (V / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, 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-244], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-323], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+277], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{-244}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+277}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.9999999999999993e-245Initial program 75.8%
associate-/r*73.1%
sqrt-div44.6%
div-inv44.6%
Applied egg-rr44.6%
associate-*r/44.6%
*-rgt-identity44.6%
Simplified44.6%
frac-2neg44.6%
sqrt-div49.2%
Applied egg-rr49.2%
if -9.9999999999999993e-245 < (*.f64 V l) < 4.94066e-323Initial program 62.5%
associate-/r*88.7%
clear-num88.5%
sqrt-div88.6%
metadata-eval88.6%
div-inv88.6%
clear-num88.6%
Applied egg-rr88.6%
*-commutative88.6%
associate-*l/62.5%
associate-/l*88.6%
Simplified88.6%
un-div-inv88.8%
*-commutative88.8%
associate-/r/88.8%
sqrt-undiv42.7%
sqrt-undiv88.8%
div-inv88.8%
clear-num88.7%
Applied egg-rr88.7%
*-commutative88.7%
associate-*l/62.5%
associate-/l*88.8%
Simplified88.8%
if 4.94066e-323 < (*.f64 V l) < 2.00000000000000001e277Initial program 87.8%
sqrt-div98.6%
div-inv98.5%
Applied egg-rr98.5%
associate-*r/98.6%
*-rgt-identity98.6%
Simplified98.6%
if 2.00000000000000001e277 < (*.f64 V l) Initial program 53.7%
associate-/r*87.3%
clear-num87.3%
sqrt-div87.2%
metadata-eval87.2%
div-inv87.3%
clear-num87.2%
Applied egg-rr87.2%
*-commutative87.2%
associate-*l/53.7%
associate-/l*87.3%
Simplified87.3%
pow1/287.3%
pow-flip87.4%
*-commutative87.4%
associate-/r/87.3%
div-inv87.4%
clear-num87.3%
metadata-eval87.3%
Applied egg-rr87.3%
Final simplification76.2%
NOTE: c0, A, 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 (or (<= t_0 0.0) (not (<= t_0 5e+196)))
(* c0 (sqrt (/ (/ A V) l)))
t_0)))assert(c0 < A && A < V && 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) || !(t_0 <= 5e+196)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, 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) .or. (.not. (t_0 <= 5d+196))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && 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) || !(t_0 <= 5e+196)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+196): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, 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) || !(t_0 <= 5e+196)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, 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) || ~((t_0 <= 5e+196)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, 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[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+196]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+196}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 4.9999999999999998e196 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 71.3%
associate-/r*76.4%
Simplified76.4%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999998e196Initial program 97.5%
Final simplification81.1%
NOTE: c0, A, 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 1e+182) t_0 (* c0 (sqrt (/ (/ A l) V)))))))assert(c0 < A && A < V && 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 <= 1e+182) {
tmp = t_0;
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
NOTE: c0, A, 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 <= 1d+182) then
tmp = t_0
else
tmp = c0 * sqrt(((a / l) / v))
end if
code = tmp
end function
assert c0 < A && A < V && 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 <= 1e+182) {
tmp = t_0;
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, 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 <= 1e+182: tmp = t_0 else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
c0, A, V, l = sort([c0, A, 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 <= 1e+182) tmp = t_0; else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, 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 <= 1e+182)
tmp = t_0;
else
tmp = c0 * sqrt(((A / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, 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, 1e+182], t$95$0, N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, 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 10^{+182}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 71.9%
associate-/r*76.2%
Simplified76.2%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.0000000000000001e182Initial program 97.4%
if 1.0000000000000001e182 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 70.7%
associate-/r*78.2%
div-inv78.2%
Applied egg-rr78.2%
associate-*l/78.2%
div-inv78.2%
Applied egg-rr78.2%
Final simplification81.1%
NOTE: c0, A, 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 1e+182) t_0 (/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && 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 <= 1e+182) {
tmp = t_0;
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: c0, A, 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 <= 1d+182) then
tmp = t_0
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && 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 <= 1e+182) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, 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 <= 1e+182: tmp = t_0 else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, 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 <= 1e+182) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, 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 <= 1e+182)
tmp = t_0;
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, 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, 1e+182], t$95$0, N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, 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 10^{+182}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 71.9%
associate-/r*76.2%
Simplified76.2%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.0000000000000001e182Initial program 97.4%
if 1.0000000000000001e182 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 70.7%
associate-/r*78.2%
clear-num78.1%
sqrt-div79.3%
metadata-eval79.3%
div-inv79.3%
clear-num79.4%
Applied egg-rr79.4%
*-commutative79.4%
associate-*l/71.9%
associate-/l*79.3%
Simplified79.3%
un-div-inv79.5%
*-commutative79.5%
associate-/r/79.5%
sqrt-undiv43.2%
sqrt-undiv79.5%
div-inv79.5%
clear-num79.5%
Applied egg-rr79.5%
*-commutative79.5%
associate-*l/71.9%
associate-/l*79.5%
Simplified79.5%
Final simplification81.3%
NOTE: c0, A, 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 5e+204) t_0 (/ c0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && 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 <= 5e+204) {
tmp = t_0;
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: c0, A, 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 <= 5d+204) then
tmp = t_0
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert c0 < A && A < V && 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 <= 5e+204) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, 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 <= 5e+204: tmp = t_0 else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
c0, A, V, l = sort([c0, A, 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 <= 5e+204) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, 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 <= 5e+204)
tmp = t_0;
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, 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, 5e+204], t$95$0, N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, 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 5 \cdot 10^{+204}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 71.9%
associate-/r*76.2%
Simplified76.2%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.00000000000000008e204Initial program 97.5%
if 5.00000000000000008e204 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 68.5%
associate-/r*76.6%
clear-num76.6%
sqrt-div77.9%
metadata-eval77.9%
div-inv77.9%
clear-num77.9%
Applied egg-rr77.9%
*-commutative77.9%
associate-*l/69.9%
associate-/l*77.9%
Simplified77.9%
un-div-inv78.0%
*-commutative78.0%
associate-/r/78.0%
sqrt-undiv43.9%
sqrt-undiv78.0%
div-inv78.0%
clear-num78.0%
Applied egg-rr78.0%
Final simplification81.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* (* c0 (pow l -0.5)) (sqrt (/ A V)))
(if (<= (* V l) -1e-244)
(* c0 (/ (sqrt (- A)) (sqrt (* l (- V)))))
(if (<= (* V l) 5e-323)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) 2e+277)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (pow (* l (/ V A)) -0.5)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (c0 * pow(l, -0.5)) * sqrt((A / V));
} else if ((V * l) <= -1e-244) {
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
} else if ((V * l) <= 5e-323) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= 2e+277) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * pow((l * (V / A)), -0.5);
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = (c0 * Math.pow(l, -0.5)) * Math.sqrt((A / V));
} else if ((V * l) <= -1e-244) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((l * -V)));
} else if ((V * l) <= 5e-323) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if ((V * l) <= 2e+277) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.pow((l * (V / A)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = (c0 * math.pow(l, -0.5)) * math.sqrt((A / V)) elif (V * l) <= -1e-244: tmp = c0 * (math.sqrt(-A) / math.sqrt((l * -V))) elif (V * l) <= 5e-323: tmp = c0 / math.sqrt((V * (l / A))) elif (V * l) <= 2e+277: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.pow((l * (V / A)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(c0 * (l ^ -0.5)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= -1e-244) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V))))); elseif (Float64(V * l) <= 5e-323) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 2e+277) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (c0 * (l ^ -0.5)) * sqrt((A / V));
elseif ((V * l) <= -1e-244)
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
elseif ((V * l) <= 5e-323)
tmp = c0 / sqrt((V * (l / A)));
elseif ((V * l) <= 2e+277)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * ((l * (V / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0 * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-244], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-323], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+277], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\left(c0 \cdot {\ell}^{-0.5}\right) \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-244}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+277}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 39.8%
add-sqr-sqrt39.8%
sqrt-unprod39.8%
*-commutative39.8%
*-commutative39.8%
swap-sqr39.0%
add-sqr-sqrt39.0%
pow239.0%
Applied egg-rr39.0%
associate-/r*38.9%
Simplified38.9%
sqrt-prod38.8%
sqrt-undiv27.7%
sqrt-pow149.6%
metadata-eval49.6%
pow149.6%
*-commutative49.6%
div-inv49.5%
*-commutative49.5%
associate-*r*49.7%
inv-pow49.7%
sqrt-pow249.9%
metadata-eval49.9%
Applied egg-rr49.9%
if -inf.0 < (*.f64 V l) < -9.9999999999999993e-245Initial program 85.3%
frac-2neg85.3%
sqrt-div99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
distribute-rgt-neg-out99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Simplified99.5%
if -9.9999999999999993e-245 < (*.f64 V l) < 4.94066e-323Initial program 62.5%
associate-/r*88.7%
clear-num88.5%
sqrt-div88.6%
metadata-eval88.6%
div-inv88.6%
clear-num88.6%
Applied egg-rr88.6%
*-commutative88.6%
associate-*l/62.5%
associate-/l*88.6%
Simplified88.6%
un-div-inv88.8%
*-commutative88.8%
associate-/r/88.8%
sqrt-undiv42.7%
sqrt-undiv88.8%
div-inv88.8%
clear-num88.7%
Applied egg-rr88.7%
*-commutative88.7%
associate-*l/62.5%
associate-/l*88.8%
Simplified88.8%
if 4.94066e-323 < (*.f64 V l) < 2.00000000000000001e277Initial program 87.8%
sqrt-div98.6%
div-inv98.5%
Applied egg-rr98.5%
associate-*r/98.6%
*-rgt-identity98.6%
Simplified98.6%
if 2.00000000000000001e277 < (*.f64 V l) Initial program 53.7%
associate-/r*87.3%
clear-num87.3%
sqrt-div87.2%
metadata-eval87.2%
div-inv87.3%
clear-num87.2%
Applied egg-rr87.2%
*-commutative87.2%
associate-*l/53.7%
associate-/l*87.3%
Simplified87.3%
pow1/287.3%
pow-flip87.4%
*-commutative87.4%
associate-/r/87.3%
div-inv87.4%
clear-num87.3%
metadata-eval87.3%
Applied egg-rr87.3%
Final simplification92.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -1e-214)
(* c0 (sqrt (* A (/ (/ 1.0 V) l))))
(if (<= (* V l) 5e-323)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) 2e+277)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (pow (* l (/ V A)) -0.5))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e-214) {
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 5e-323) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= 2e+277) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * pow((l * (V / A)), -0.5);
}
return tmp;
}
NOTE: c0, A, 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-214)) then
tmp = c0 * sqrt((a * ((1.0d0 / v) / l)))
else if ((v * l) <= 5d-323) then
tmp = c0 / sqrt((v * (l / a)))
else if ((v * l) <= 2d+277) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * ((l * (v / a)) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e-214) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 5e-323) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if ((V * l) <= 2e+277) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.pow((l * (V / A)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e-214: tmp = c0 * math.sqrt((A * ((1.0 / V) / l))) elif (V * l) <= 5e-323: tmp = c0 / math.sqrt((V * (l / A))) elif (V * l) <= 2e+277: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.pow((l * (V / A)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e-214) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); elseif (Float64(V * l) <= 5e-323) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 2e+277) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -1e-214)
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
elseif ((V * l) <= 5e-323)
tmp = c0 / sqrt((V * (l / A)));
elseif ((V * l) <= 2e+277)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * ((l * (V / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, 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-214], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-323], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+277], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{-214}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-323}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+277}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999913e-215Initial program 75.8%
clear-num74.4%
associate-/r/75.8%
associate-/r*77.1%
Applied egg-rr77.1%
if -9.99999999999999913e-215 < (*.f64 V l) < 4.94066e-323Initial program 63.8%
associate-/r*87.3%
clear-num87.2%
sqrt-div87.2%
metadata-eval87.2%
div-inv87.2%
clear-num87.3%
Applied egg-rr87.3%
*-commutative87.3%
associate-*l/63.9%
associate-/l*87.3%
Simplified87.3%
un-div-inv87.4%
*-commutative87.4%
associate-/r/87.4%
sqrt-undiv40.9%
sqrt-undiv87.4%
div-inv87.5%
clear-num87.4%
Applied egg-rr87.4%
*-commutative87.4%
associate-*l/63.9%
associate-/l*87.4%
Simplified87.4%
if 4.94066e-323 < (*.f64 V l) < 2.00000000000000001e277Initial program 87.8%
sqrt-div98.6%
div-inv98.5%
Applied egg-rr98.5%
associate-*r/98.6%
*-rgt-identity98.6%
Simplified98.6%
if 2.00000000000000001e277 < (*.f64 V l) Initial program 53.7%
associate-/r*87.3%
clear-num87.3%
sqrt-div87.2%
metadata-eval87.2%
div-inv87.3%
clear-num87.2%
Applied egg-rr87.2%
*-commutative87.2%
associate-*l/53.7%
associate-/l*87.3%
Simplified87.3%
pow1/287.3%
pow-flip87.4%
*-commutative87.4%
associate-/r/87.3%
div-inv87.4%
clear-num87.3%
metadata-eval87.3%
Applied egg-rr87.3%
Final simplification87.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -4e-310) (/ c0 (* (sqrt l) (sqrt (/ V A)))) (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
NOTE: c0, A, 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 <= (-4d-310)) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / v) / l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -4e-310: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -4e-310) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -4e-310)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -4e-310], 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[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if A < -3.999999999999988e-310Initial program 75.1%
associate-/r*77.3%
clear-num76.2%
sqrt-div76.5%
metadata-eval76.5%
div-inv76.5%
clear-num77.8%
Applied egg-rr77.8%
*-commutative77.8%
associate-*l/74.3%
associate-/l*74.6%
Simplified74.6%
pow1/274.6%
pow-flip74.7%
*-commutative74.7%
associate-/r/76.5%
div-inv76.6%
clear-num77.9%
metadata-eval77.9%
Applied egg-rr77.9%
metadata-eval77.9%
pow-flip77.8%
pow1/277.8%
div-inv77.8%
sqrt-prod44.7%
associate-/r*42.5%
Applied egg-rr42.5%
associate-/l/44.7%
Simplified44.7%
if -3.999999999999988e-310 < A Initial program 79.1%
pow1/279.1%
div-inv78.9%
unpow-prod-down86.9%
pow1/286.9%
associate-/r*87.6%
Applied egg-rr87.6%
unpow1/287.6%
Simplified87.6%
Final simplification66.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -4e-310) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: c0, A, 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 <= (-4d-310)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -4e-310: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -4e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -4e-310)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -4e-310], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / 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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -3.999999999999988e-310Initial program 75.1%
associate-/r*77.3%
sqrt-div44.7%
div-inv44.6%
Applied egg-rr44.6%
associate-*r/44.7%
*-rgt-identity44.7%
Simplified44.7%
if -3.999999999999988e-310 < A Initial program 79.1%
sqrt-div87.2%
div-inv87.1%
Applied egg-rr87.1%
associate-*r/87.2%
*-rgt-identity87.2%
Simplified87.2%
Final simplification66.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -4e-310) (/ c0 (* (sqrt l) (sqrt (/ V A)))) (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: c0, A, 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 <= (-4d-310)) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -4e-310: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -4e-310) 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
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -4e-310)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -4e-310], 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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\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 A < -3.999999999999988e-310Initial program 75.1%
associate-/r*77.3%
clear-num76.2%
sqrt-div76.5%
metadata-eval76.5%
div-inv76.5%
clear-num77.8%
Applied egg-rr77.8%
*-commutative77.8%
associate-*l/74.3%
associate-/l*74.6%
Simplified74.6%
pow1/274.6%
pow-flip74.7%
*-commutative74.7%
associate-/r/76.5%
div-inv76.6%
clear-num77.9%
metadata-eval77.9%
Applied egg-rr77.9%
metadata-eval77.9%
pow-flip77.8%
pow1/277.8%
div-inv77.8%
sqrt-prod44.7%
associate-/r*42.5%
Applied egg-rr42.5%
associate-/l/44.7%
Simplified44.7%
if -3.999999999999988e-310 < A Initial program 79.1%
sqrt-div87.2%
div-inv87.1%
Applied egg-rr87.1%
associate-*r/87.2%
*-rgt-identity87.2%
Simplified87.2%
Final simplification66.5%
NOTE: c0, A, 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(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: c0, A, 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 c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: c0, A, 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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 77.1%
Final simplification77.1%
herbie shell --seed 2024075
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))