
(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 13 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+290)
(* c0 (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* V l) -1e-308)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(/ 1.0 (/ (sqrt (/ l (/ A V))) c0))
(if (<= (* V l) 1e+308)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(/ c0 (sqrt (/ V (/ A l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+290) {
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= -1e-308) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = 1.0 / (sqrt((l / (A / V))) / c0);
} else if ((V * l) <= 1e+308) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 / sqrt((V / (A / 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 ((v * l) <= (-1d+290)) then
tmp = c0 * (sqrt((a / -l)) / sqrt(-v))
else if ((v * l) <= (-1d-308)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = 1.0d0 / (sqrt((l / (a / v))) / c0)
else if ((v * l) <= 1d+308) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = c0 / sqrt((v / (a / 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 ((V * l) <= -1e+290) {
tmp = c0 * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((V * l) <= -1e-308) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = 1.0 / (Math.sqrt((l / (A / V))) / c0);
} else if ((V * l) <= 1e+308) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+290: tmp = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= -1e-308: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = 1.0 / (math.sqrt((l / (A / V))) / c0) elif (V * l) <= 1e+308: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 / math.sqrt((V / (A / l))) 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+290) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -1e-308) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(1.0 / Float64(sqrt(Float64(l / Float64(A / V))) / c0)); elseif (Float64(V * l) <= 1e+308) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / 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 ((V * l) <= -1e+290)
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= -1e-308)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = 1.0 / (sqrt((l / (A / V))) / c0);
elseif ((V * l) <= 1e+308)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 / sqrt((V / (A / 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[N[(V * l), $MachinePrecision], -1e+290], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-308], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(1.0 / N[(N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+308], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $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^{+290}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-308}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{\ell}{\frac{A}{V}}}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+308}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.00000000000000006e290Initial program 38.7%
associate-/r*75.0%
div-inv75.0%
Applied egg-rr75.0%
associate-*l/75.0%
un-div-inv75.0%
Applied egg-rr75.0%
frac-2neg75.0%
sqrt-div42.5%
distribute-neg-frac42.5%
Applied egg-rr42.5%
if -1.00000000000000006e290 < (*.f64 V l) < -9.9999999999999991e-309Initial program 82.0%
frac-2neg82.0%
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.9999999999999991e-309 < (*.f64 V l) < 0.0Initial program 45.9%
associate-/r*77.5%
div-inv77.6%
Applied egg-rr77.6%
un-div-inv77.5%
sqrt-undiv33.3%
associate-*r/33.3%
*-commutative33.3%
clear-num33.4%
associate-/r*33.4%
sqrt-undiv79.7%
Applied egg-rr79.7%
if 0.0 < (*.f64 V l) < 1e308Initial program 79.9%
associate-/r*72.5%
div-inv72.5%
Applied egg-rr72.5%
un-div-inv72.5%
sqrt-undiv49.0%
associate-*r/48.1%
*-commutative48.1%
clear-num47.5%
associate-/r*48.4%
sqrt-undiv72.3%
Applied egg-rr72.3%
associate-/r/72.7%
associate-*l/72.9%
*-lft-identity72.9%
associate-/r/74.0%
associate-*l/80.2%
associate-*r/72.3%
Simplified72.3%
associate-*r/80.2%
sqrt-div99.4%
Applied egg-rr99.4%
if 1e308 < (*.f64 V l) Initial program 42.5%
associate-/r*74.3%
div-inv74.4%
Applied egg-rr74.4%
un-div-inv74.3%
sqrt-undiv37.5%
associate-*r/37.5%
*-commutative37.5%
clear-num37.5%
associate-/r*37.6%
sqrt-undiv74.5%
Applied egg-rr74.5%
associate-/r/74.3%
associate-*l/74.5%
*-lft-identity74.5%
associate-/r/74.5%
associate-*l/42.5%
associate-*r/74.5%
Simplified74.5%
*-commutative74.5%
associate-/r/74.7%
Applied egg-rr74.7%
Final simplification91.4%
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 1e-257)
(/ c0 (sqrt (* l (/ V A))))
(if (<= t_0 5e+279)
(* c0 (sqrt (* A (/ (/ 1.0 V) l))))
(* c0 (/ 1.0 (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 <= 1e-257) {
tmp = c0 / sqrt((l * (V / A)));
} else if (t_0 <= 5e+279) {
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
} else {
tmp = c0 * (1.0 / 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 <= 1d-257) then
tmp = c0 / sqrt((l * (v / a)))
else if (t_0 <= 5d+279) then
tmp = c0 * sqrt((a * ((1.0d0 / v) / l)))
else
tmp = c0 * (1.0d0 / 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 <= 1e-257) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if (t_0 <= 5e+279) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) / l)));
} else {
tmp = c0 * (1.0 / 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 <= 1e-257: tmp = c0 / math.sqrt((l * (V / A))) elif t_0 <= 5e+279: tmp = c0 * math.sqrt((A * ((1.0 / V) / l))) else: tmp = c0 * (1.0 / 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 <= 1e-257) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (t_0 <= 5e+279) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); else tmp = Float64(c0 * Float64(1.0 / 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 <= 1e-257)
tmp = c0 / sqrt((l * (V / A)));
elseif (t_0 <= 5e+279)
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
else
tmp = c0 * (1.0 / 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, 1e-257], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+279], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(1.0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $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 10^{-257}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+279}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999998e-258Initial program 68.4%
associate-/r*73.4%
div-inv73.4%
Applied egg-rr73.4%
un-div-inv73.4%
sqrt-undiv40.8%
associate-*r/40.3%
*-commutative40.3%
clear-num39.8%
associate-/r*40.3%
sqrt-undiv72.9%
Applied egg-rr72.9%
associate-/r/73.3%
associate-*l/73.5%
*-lft-identity73.5%
associate-/r/71.4%
associate-*l/68.0%
associate-*r/73.2%
Simplified73.2%
if 9.9999999999999998e-258 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000002e279Initial program 98.4%
clear-num97.4%
associate-/r/98.5%
associate-/r*98.6%
Applied egg-rr98.6%
if 5.0000000000000002e279 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 48.6%
associate-/r*65.6%
clear-num65.7%
sqrt-div65.6%
metadata-eval65.6%
div-inv65.7%
clear-num65.7%
Applied egg-rr65.7%
*-commutative65.7%
associate-*l/49.1%
associate-/l*66.2%
Simplified66.2%
Final simplification77.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 1e-257)
(/ c0 (sqrt (* l (/ V A))))
(if (<= t_0 5e+279)
(* c0 (sqrt (* A (/ (/ 1.0 V) l))))
(* c0 (pow (* V (/ l A)) -0.5))))))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 <= 1e-257) {
tmp = c0 / sqrt((l * (V / A)));
} else if (t_0 <= 5e+279) {
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
} else {
tmp = c0 * pow((V * (l / 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) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 1d-257) then
tmp = c0 / sqrt((l * (v / a)))
else if (t_0 <= 5d+279) then
tmp = c0 * sqrt((a * ((1.0d0 / v) / l)))
else
tmp = c0 * ((v * (l / 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 t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 1e-257) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if (t_0 <= 5e+279) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) / l)));
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
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 <= 1e-257: tmp = c0 / math.sqrt((l * (V / A))) elif t_0 <= 5e+279: tmp = c0 * math.sqrt((A * ((1.0 / V) / l))) else: tmp = c0 * math.pow((V * (l / A)), -0.5) 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 <= 1e-257) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (t_0 <= 5e+279) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); else tmp = Float64(c0 * (Float64(V * Float64(l / 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)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 1e-257)
tmp = c0 / sqrt((l * (V / A)));
elseif (t_0 <= 5e+279)
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
else
tmp = c0 * ((V * (l / 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_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-257], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+279], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $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 10^{-257}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+279}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999998e-258Initial program 68.4%
associate-/r*73.4%
div-inv73.4%
Applied egg-rr73.4%
un-div-inv73.4%
sqrt-undiv40.8%
associate-*r/40.3%
*-commutative40.3%
clear-num39.8%
associate-/r*40.3%
sqrt-undiv72.9%
Applied egg-rr72.9%
associate-/r/73.3%
associate-*l/73.5%
*-lft-identity73.5%
associate-/r/71.4%
associate-*l/68.0%
associate-*r/73.2%
Simplified73.2%
if 9.9999999999999998e-258 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000002e279Initial program 98.4%
clear-num97.4%
associate-/r/98.5%
associate-/r*98.6%
Applied egg-rr98.6%
if 5.0000000000000002e279 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 48.6%
associate-/r*65.6%
div-inv65.7%
Applied egg-rr65.7%
associate-*l/65.6%
un-div-inv65.6%
Applied egg-rr65.6%
clear-num65.7%
sqrt-div66.2%
metadata-eval66.2%
associate-/r/65.7%
*-commutative65.7%
pow1/265.7%
pow-flip65.6%
*-commutative65.6%
associate-/r/66.2%
div-inv66.2%
clear-num66.2%
metadata-eval66.2%
Applied egg-rr66.2%
Final simplification77.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 1e-257)
(/ c0 (sqrt (* l (/ V A))))
(if (<= t_0 5e+279) t_0 (* c0 (pow (* V (/ l A)) -0.5))))))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 <= 1e-257) {
tmp = c0 / sqrt((l * (V / A)));
} else if (t_0 <= 5e+279) {
tmp = t_0;
} else {
tmp = c0 * pow((V * (l / 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) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 1d-257) then
tmp = c0 / sqrt((l * (v / a)))
else if (t_0 <= 5d+279) then
tmp = t_0
else
tmp = c0 * ((v * (l / 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 t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 1e-257) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if (t_0 <= 5e+279) {
tmp = t_0;
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
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 <= 1e-257: tmp = c0 / math.sqrt((l * (V / A))) elif t_0 <= 5e+279: tmp = t_0 else: tmp = c0 * math.pow((V * (l / A)), -0.5) 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 <= 1e-257) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (t_0 <= 5e+279) tmp = t_0; else tmp = Float64(c0 * (Float64(V * Float64(l / 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)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 1e-257)
tmp = c0 / sqrt((l * (V / A)));
elseif (t_0 <= 5e+279)
tmp = t_0;
else
tmp = c0 * ((V * (l / 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_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-257], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+279], t$95$0, N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $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 10^{-257}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+279}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999998e-258Initial program 68.4%
associate-/r*73.4%
div-inv73.4%
Applied egg-rr73.4%
un-div-inv73.4%
sqrt-undiv40.8%
associate-*r/40.3%
*-commutative40.3%
clear-num39.8%
associate-/r*40.3%
sqrt-undiv72.9%
Applied egg-rr72.9%
associate-/r/73.3%
associate-*l/73.5%
*-lft-identity73.5%
associate-/r/71.4%
associate-*l/68.0%
associate-*r/73.2%
Simplified73.2%
if 9.9999999999999998e-258 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000002e279Initial program 98.4%
if 5.0000000000000002e279 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 48.6%
associate-/r*65.6%
div-inv65.7%
Applied egg-rr65.7%
associate-*l/65.6%
un-div-inv65.6%
Applied egg-rr65.6%
clear-num65.7%
sqrt-div66.2%
metadata-eval66.2%
associate-/r/65.7%
*-commutative65.7%
pow1/265.7%
pow-flip65.6%
*-commutative65.6%
associate-/r/66.2%
div-inv66.2%
clear-num66.2%
metadata-eval66.2%
Applied egg-rr66.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 1e-257) (not (<= t_0 5e+279)))
(/ c0 (sqrt (* l (/ V A))))
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 <= 1e-257) || !(t_0 <= 5e+279)) {
tmp = c0 / sqrt((l * (V / A)));
} 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 <= 1d-257) .or. (.not. (t_0 <= 5d+279))) then
tmp = c0 / sqrt((l * (v / a)))
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 <= 1e-257) || !(t_0 <= 5e+279)) {
tmp = c0 / Math.sqrt((l * (V / A)));
} 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 <= 1e-257) or not (t_0 <= 5e+279): tmp = c0 / math.sqrt((l * (V / A))) 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 <= 1e-257) || !(t_0 <= 5e+279)) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); 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 <= 1e-257) || ~((t_0 <= 5e+279)))
tmp = c0 / sqrt((l * (V / A)));
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, 1e-257], N[Not[LessEqual[t$95$0, 5e+279]], $MachinePrecision]], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $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 10^{-257} \lor \neg \left(t\_0 \leq 5 \cdot 10^{+279}\right):\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999998e-258 or 5.0000000000000002e279 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 64.6%
associate-/r*71.9%
div-inv71.9%
Applied egg-rr71.9%
un-div-inv71.9%
sqrt-undiv40.5%
associate-*r/40.1%
*-commutative40.1%
clear-num39.6%
associate-/r*40.1%
sqrt-undiv71.5%
Applied egg-rr71.5%
associate-/r/71.9%
associate-*l/72.0%
*-lft-identity72.0%
associate-/r/70.4%
associate-*l/64.4%
associate-*r/71.7%
Simplified71.7%
if 9.9999999999999998e-258 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000002e279Initial program 98.4%
Final simplification77.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 (or (<= t_0 5e-304) (not (<= t_0 2e+204)))
(* 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 <= 5e-304) || !(t_0 <= 2e+204)) {
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 <= 5d-304) .or. (.not. (t_0 <= 2d+204))) 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 <= 5e-304) || !(t_0 <= 2e+204)) {
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 <= 5e-304) or not (t_0 <= 2e+204): 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 <= 5e-304) || !(t_0 <= 2e+204)) 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 <= 5e-304) || ~((t_0 <= 2e+204)))
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, 5e-304], N[Not[LessEqual[t$95$0, 2e+204]], $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 5 \cdot 10^{-304} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+204}\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)))) < 4.99999999999999965e-304 or 1.99999999999999998e204 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 64.9%
associate-/r*71.2%
Simplified71.2%
if 4.99999999999999965e-304 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999998e204Initial program 98.3%
Final simplification76.5%
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 1e-257)
(/ c0 (sqrt (* l (/ V A))))
(if (<= t_0 5e+279) t_0 (/ c0 (sqrt (/ V (/ A l))))))))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 <= 1e-257) {
tmp = c0 / sqrt((l * (V / A)));
} else if (t_0 <= 5e+279) {
tmp = t_0;
} else {
tmp = c0 / sqrt((V / (A / 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) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 1d-257) then
tmp = c0 / sqrt((l * (v / a)))
else if (t_0 <= 5d+279) then
tmp = t_0
else
tmp = c0 / sqrt((v / (a / 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 t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 1e-257) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if (t_0 <= 5e+279) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
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 <= 1e-257: tmp = c0 / math.sqrt((l * (V / A))) elif t_0 <= 5e+279: tmp = t_0 else: tmp = c0 / math.sqrt((V / (A / l))) 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 <= 1e-257) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (t_0 <= 5e+279) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); 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 <= 1e-257)
tmp = c0 / sqrt((l * (V / A)));
elseif (t_0 <= 5e+279)
tmp = t_0;
else
tmp = c0 / sqrt((V / (A / 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_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-257], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+279], t$95$0, N[(c0 / N[Sqrt[N[(V / N[(A / l), $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 10^{-257}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+279}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999998e-258Initial program 68.4%
associate-/r*73.4%
div-inv73.4%
Applied egg-rr73.4%
un-div-inv73.4%
sqrt-undiv40.8%
associate-*r/40.3%
*-commutative40.3%
clear-num39.8%
associate-/r*40.3%
sqrt-undiv72.9%
Applied egg-rr72.9%
associate-/r/73.3%
associate-*l/73.5%
*-lft-identity73.5%
associate-/r/71.4%
associate-*l/68.0%
associate-*r/73.2%
Simplified73.2%
if 9.9999999999999998e-258 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000002e279Initial program 98.4%
if 5.0000000000000002e279 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 48.6%
associate-/r*65.6%
div-inv65.7%
Applied egg-rr65.7%
un-div-inv65.6%
sqrt-undiv38.9%
associate-*r/38.9%
*-commutative38.9%
clear-num39.0%
associate-/r*39.0%
sqrt-undiv65.7%
Applied egg-rr65.7%
associate-/r/65.6%
associate-*l/65.6%
*-lft-identity65.6%
associate-/r/66.2%
associate-*l/49.1%
associate-*r/65.6%
Simplified65.6%
*-commutative65.6%
associate-/r/66.2%
Applied egg-rr66.2%
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 -5e-310) (/ (* (/ (sqrt (- A)) (sqrt (- V))) c0) (sqrt l)) (/ c0 (/ (sqrt (* V l)) (sqrt A)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = ((sqrt(-A) / sqrt(-V)) * c0) / sqrt(l);
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(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) :: tmp
if (a <= (-5d-310)) then
tmp = ((sqrt(-a) / sqrt(-v)) * c0) / sqrt(l)
else
tmp = c0 / (sqrt((v * l)) / sqrt(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 tmp;
if (A <= -5e-310) {
tmp = ((Math.sqrt(-A) / Math.sqrt(-V)) * c0) / Math.sqrt(l);
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = ((math.sqrt(-A) / math.sqrt(-V)) * c0) / math.sqrt(l) else: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * c0) / sqrt(l)); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); 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 <= -5e-310)
tmp = ((sqrt(-A) / sqrt(-V)) * c0) / sqrt(l);
else
tmp = c0 / (sqrt((V * l)) / sqrt(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_] := If[LessEqual[A, -5e-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[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{\sqrt{-A}}{\sqrt{-V}} \cdot c0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 70.5%
*-commutative70.5%
associate-/r*74.0%
sqrt-div34.9%
associate-*l/34.2%
Applied egg-rr34.2%
frac-2neg34.2%
sqrt-div43.2%
Applied egg-rr43.2%
if -4.999999999999985e-310 < A Initial program 72.3%
associate-/r*74.1%
div-inv74.2%
Applied egg-rr74.2%
un-div-inv74.1%
sqrt-undiv45.0%
associate-*r/44.4%
*-commutative44.4%
clear-num44.0%
associate-/r*44.6%
sqrt-undiv74.0%
Applied egg-rr74.0%
associate-/r/74.3%
associate-*l/74.4%
*-lft-identity74.4%
associate-/r/75.3%
associate-*l/72.6%
associate-*r/74.0%
Simplified74.0%
associate-*r/72.6%
sqrt-div87.0%
Applied egg-rr87.0%
Final simplification65.2%
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+290)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) -1e-308)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(/ 1.0 (/ (sqrt (/ l (/ A V))) c0))
(if (<= (* V l) 1e+308)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(/ c0 (sqrt (/ V (/ A l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+290) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((V * l) <= -1e-308) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = 1.0 / (sqrt((l / (A / V))) / c0);
} else if ((V * l) <= 1e+308) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 / sqrt((V / (A / 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 ((v * l) <= (-1d+290)) then
tmp = (c0 / sqrt(l)) * sqrt((a / v))
else if ((v * l) <= (-1d-308)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = 1.0d0 / (sqrt((l / (a / v))) / c0)
else if ((v * l) <= 1d+308) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = c0 / sqrt((v / (a / 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 ((V * l) <= -1e+290) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((V * l) <= -1e-308) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = 1.0 / (Math.sqrt((l / (A / V))) / c0);
} else if ((V * l) <= 1e+308) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+290: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) elif (V * l) <= -1e-308: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = 1.0 / (math.sqrt((l / (A / V))) / c0) elif (V * l) <= 1e+308: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 / math.sqrt((V / (A / l))) 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+290) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= -1e-308) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(1.0 / Float64(sqrt(Float64(l / Float64(A / V))) / c0)); elseif (Float64(V * l) <= 1e+308) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / 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 ((V * l) <= -1e+290)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
elseif ((V * l) <= -1e-308)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = 1.0 / (sqrt((l / (A / V))) / c0);
elseif ((V * l) <= 1e+308)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 / sqrt((V / (A / 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[N[(V * l), $MachinePrecision], -1e+290], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-308], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(1.0 / N[(N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+308], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $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^{+290}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-308}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{\ell}{\frac{A}{V}}}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+308}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.00000000000000006e290Initial program 38.7%
*-commutative38.7%
associate-/r*75.0%
sqrt-div42.4%
associate-*l/37.5%
Applied egg-rr37.5%
associate-/l*42.4%
*-commutative42.4%
Applied egg-rr42.4%
if -1.00000000000000006e290 < (*.f64 V l) < -9.9999999999999991e-309Initial program 82.0%
frac-2neg82.0%
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.9999999999999991e-309 < (*.f64 V l) < 0.0Initial program 45.9%
associate-/r*77.5%
div-inv77.6%
Applied egg-rr77.6%
un-div-inv77.5%
sqrt-undiv33.3%
associate-*r/33.3%
*-commutative33.3%
clear-num33.4%
associate-/r*33.4%
sqrt-undiv79.7%
Applied egg-rr79.7%
if 0.0 < (*.f64 V l) < 1e308Initial program 79.9%
associate-/r*72.5%
div-inv72.5%
Applied egg-rr72.5%
un-div-inv72.5%
sqrt-undiv49.0%
associate-*r/48.1%
*-commutative48.1%
clear-num47.5%
associate-/r*48.4%
sqrt-undiv72.3%
Applied egg-rr72.3%
associate-/r/72.7%
associate-*l/72.9%
*-lft-identity72.9%
associate-/r/74.0%
associate-*l/80.2%
associate-*r/72.3%
Simplified72.3%
associate-*r/80.2%
sqrt-div99.4%
Applied egg-rr99.4%
if 1e308 < (*.f64 V l) Initial program 42.5%
associate-/r*74.3%
div-inv74.4%
Applied egg-rr74.4%
un-div-inv74.3%
sqrt-undiv37.5%
associate-*r/37.5%
*-commutative37.5%
clear-num37.5%
associate-/r*37.6%
sqrt-undiv74.5%
Applied egg-rr74.5%
associate-/r/74.3%
associate-*l/74.5%
*-lft-identity74.5%
associate-/r/74.5%
associate-*l/42.5%
associate-*r/74.5%
Simplified74.5%
*-commutative74.5%
associate-/r/74.7%
Applied egg-rr74.7%
Final simplification91.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 (<= (* V l) -1e+228)
(* c0 (sqrt (* (/ A l) (/ 1.0 V))))
(if (<= (* V l) -1e-224)
(* c0 (sqrt (* A (/ (/ 1.0 V) l))))
(if (<= (* V l) 0.0)
(/ 1.0 (/ (sqrt (/ l (/ A V))) c0))
(if (<= (* V l) 5e+299)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(/ c0 (sqrt (/ V (/ A l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+228) {
tmp = c0 * sqrt(((A / l) * (1.0 / V)));
} else if ((V * l) <= -1e-224) {
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 0.0) {
tmp = 1.0 / (sqrt((l / (A / V))) / c0);
} else if ((V * l) <= 5e+299) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 / sqrt((V / (A / 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 ((v * l) <= (-1d+228)) then
tmp = c0 * sqrt(((a / l) * (1.0d0 / v)))
else if ((v * l) <= (-1d-224)) then
tmp = c0 * sqrt((a * ((1.0d0 / v) / l)))
else if ((v * l) <= 0.0d0) then
tmp = 1.0d0 / (sqrt((l / (a / v))) / c0)
else if ((v * l) <= 5d+299) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 / sqrt((v / (a / 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 ((V * l) <= -1e+228) {
tmp = c0 * Math.sqrt(((A / l) * (1.0 / V)));
} else if ((V * l) <= -1e-224) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 0.0) {
tmp = 1.0 / (Math.sqrt((l / (A / V))) / c0);
} else if ((V * l) <= 5e+299) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+228: tmp = c0 * math.sqrt(((A / l) * (1.0 / V))) elif (V * l) <= -1e-224: tmp = c0 * math.sqrt((A * ((1.0 / V) / l))) elif (V * l) <= 0.0: tmp = 1.0 / (math.sqrt((l / (A / V))) / c0) elif (V * l) <= 5e+299: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 / math.sqrt((V / (A / l))) 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+228) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) * Float64(1.0 / V)))); elseif (Float64(V * l) <= -1e-224) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(1.0 / Float64(sqrt(Float64(l / Float64(A / V))) / c0)); elseif (Float64(V * l) <= 5e+299) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / 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 ((V * l) <= -1e+228)
tmp = c0 * sqrt(((A / l) * (1.0 / V)));
elseif ((V * l) <= -1e-224)
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
elseif ((V * l) <= 0.0)
tmp = 1.0 / (sqrt((l / (A / V))) / c0);
elseif ((V * l) <= 5e+299)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 / sqrt((V / (A / 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[N[(V * l), $MachinePrecision], -1e+228], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-224], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(1.0 / N[(N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+299], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $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^{+228}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell} \cdot \frac{1}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-224}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\frac{\ell}{\frac{A}{V}}}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+299}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.9999999999999992e227Initial program 48.3%
*-un-lft-identity48.3%
times-frac73.0%
Applied egg-rr73.0%
if -9.9999999999999992e227 < (*.f64 V l) < -1e-224Initial program 86.8%
clear-num85.2%
associate-/r/86.9%
associate-/r*87.0%
Applied egg-rr87.0%
if -1e-224 < (*.f64 V l) < 0.0Initial program 45.6%
associate-/r*71.2%
div-inv71.4%
Applied egg-rr71.4%
un-div-inv71.2%
sqrt-undiv37.9%
associate-*r/37.9%
*-commutative37.9%
clear-num37.9%
associate-/r*37.9%
sqrt-undiv73.1%
Applied egg-rr73.1%
if 0.0 < (*.f64 V l) < 5.0000000000000003e299Initial program 79.7%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 5.0000000000000003e299 < (*.f64 V l) Initial program 46.0%
associate-/r*75.9%
div-inv76.0%
Applied egg-rr76.0%
un-div-inv75.9%
sqrt-undiv41.3%
associate-*r/41.4%
*-commutative41.4%
clear-num41.3%
associate-/r*41.4%
sqrt-undiv76.0%
Applied egg-rr76.0%
associate-/r/75.9%
associate-*l/76.1%
*-lft-identity76.1%
associate-/r/76.1%
associate-*l/46.0%
associate-*r/76.1%
Simplified76.1%
*-commutative76.1%
associate-/r/76.2%
Applied egg-rr76.2%
Final simplification87.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 -5e-310) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (/ c0 (/ (sqrt (* V l)) (sqrt A)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
}
return tmp;
}
NOTE: 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 <= (-5d-310)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 / (sqrt((v * l)) / sqrt(a))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -5e-310)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 / (sqrt((V * l)) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -5e-310], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 70.5%
associate-/r*74.0%
sqrt-div34.9%
div-inv34.9%
Applied egg-rr34.9%
associate-*r/34.9%
*-rgt-identity34.9%
Simplified34.9%
if -4.999999999999985e-310 < A Initial program 72.3%
associate-/r*74.1%
div-inv74.2%
Applied egg-rr74.2%
un-div-inv74.1%
sqrt-undiv45.0%
associate-*r/44.4%
*-commutative44.4%
clear-num44.0%
associate-/r*44.6%
sqrt-undiv74.0%
Applied egg-rr74.0%
associate-/r/74.3%
associate-*l/74.4%
*-lft-identity74.4%
associate-/r/75.3%
associate-*l/72.6%
associate-*r/74.0%
Simplified74.0%
associate-*r/72.6%
sqrt-div87.0%
Applied egg-rr87.0%
Final simplification61.2%
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 -5e-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 <= -5e-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 <= (-5d-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 <= -5e-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 <= -5e-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 <= -5e-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 <= -5e-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, -5e-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 -5 \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 < -4.999999999999985e-310Initial program 70.5%
associate-/r*74.0%
sqrt-div34.9%
div-inv34.9%
Applied egg-rr34.9%
associate-*r/34.9%
*-rgt-identity34.9%
Simplified34.9%
if -4.999999999999985e-310 < A Initial program 72.3%
sqrt-div87.0%
div-inv86.9%
Applied egg-rr86.9%
associate-*r/87.0%
*-rgt-identity87.0%
Simplified87.0%
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 71.4%
herbie shell --seed 2024103
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))