
(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) (- INFINITY))
(* c0 (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* V l) -2e-305)
(* c0 (/ (sqrt (- A)) (sqrt (* 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) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= -2e-305) {
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) <= 5e+299) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 / sqrt((V / (A / l)));
}
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.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((V * l) <= -2e-305) {
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) <= 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) <= -math.inf: tmp = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= -2e-305: 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) <= 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) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -2e-305) 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) <= 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) <= -Inf)
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= -2e-305)
tmp = c0 * (sqrt(-A) / sqrt((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], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-305], 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], 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 -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-305}:\\
\;\;\;\;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 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) < -inf.0Initial program 31.4%
associate-/r*72.1%
div-inv72.1%
Applied egg-rr72.1%
associate-*l/72.0%
un-div-inv72.0%
Applied egg-rr72.0%
frac-2neg72.0%
sqrt-div41.7%
distribute-neg-frac41.7%
Applied egg-rr41.7%
if -inf.0 < (*.f64 V l) < -1.99999999999999999e-305Initial program 82.2%
frac-2neg82.2%
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 -1.99999999999999999e-305 < (*.f64 V l) < 0.0Initial program 47.6%
associate-/r*78.2%
div-inv78.3%
Applied egg-rr78.3%
un-div-inv78.2%
sqrt-undiv35.5%
associate-*r/35.4%
*-commutative35.4%
clear-num35.6%
associate-/r*35.5%
sqrt-undiv80.3%
Applied egg-rr80.3%
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 simplification91.8%
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 5e-305)
(/ 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 <= 5e-305) {
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 <= 5d-305) 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 <= 5e-305) {
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 <= 5e-305: 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 <= 5e-305) 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 <= 5e-305)
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, 5e-305], 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 5 \cdot 10^{-305}:\\
\;\;\;\;\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)))) < 4.99999999999999985e-305Initial program 67.2%
associate-/r*72.4%
div-inv72.4%
Applied egg-rr72.4%
un-div-inv72.4%
sqrt-undiv39.9%
associate-*r/39.4%
*-commutative39.4%
clear-num38.8%
associate-/r*39.4%
sqrt-undiv71.9%
Applied egg-rr71.9%
associate-/r/72.3%
associate-*l/72.5%
*-lft-identity72.5%
associate-/r/70.9%
associate-*l/66.8%
associate-*r/72.2%
Simplified72.2%
if 4.99999999999999985e-305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000002e279Initial program 98.5%
clear-num97.7%
associate-/r/98.6%
associate-/r*98.7%
Applied egg-rr98.7%
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 5e-305)
(/ 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 <= 5e-305) {
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 <= 5d-305) 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 <= 5e-305) {
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 <= 5e-305: 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 <= 5e-305) 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 <= 5e-305)
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, 5e-305], 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 5 \cdot 10^{-305}:\\
\;\;\;\;\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)))) < 4.99999999999999985e-305Initial program 67.2%
associate-/r*72.4%
div-inv72.4%
Applied egg-rr72.4%
un-div-inv72.4%
sqrt-undiv39.9%
associate-*r/39.4%
*-commutative39.4%
clear-num38.8%
associate-/r*39.4%
sqrt-undiv71.9%
Applied egg-rr71.9%
associate-/r/72.3%
associate-*l/72.5%
*-lft-identity72.5%
associate-/r/70.9%
associate-*l/66.8%
associate-*r/72.2%
Simplified72.2%
if 4.99999999999999985e-305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000002e279Initial program 98.5%
clear-num97.7%
associate-/r/98.6%
associate-/r*98.7%
Applied egg-rr98.7%
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 5e-305)
(/ 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 <= 5e-305) {
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 <= 5d-305) 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 <= 5e-305) {
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 <= 5e-305: 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 <= 5e-305) 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 <= 5e-305)
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, 5e-305], 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 5 \cdot 10^{-305}:\\
\;\;\;\;\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)))) < 4.99999999999999985e-305Initial program 67.2%
associate-/r*72.4%
div-inv72.4%
Applied egg-rr72.4%
un-div-inv72.4%
sqrt-undiv39.9%
associate-*r/39.4%
*-commutative39.4%
clear-num38.8%
associate-/r*39.4%
sqrt-undiv71.9%
Applied egg-rr71.9%
associate-/r/72.3%
associate-*l/72.5%
*-lft-identity72.5%
associate-/r/70.9%
associate-*l/66.8%
associate-*r/72.2%
Simplified72.2%
if 4.99999999999999985e-305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000002e279Initial program 98.5%
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 5e-305) (not (<= t_0 2e+119)))
(/ 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 <= 5e-305) || !(t_0 <= 2e+119)) {
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 <= 5d-305) .or. (.not. (t_0 <= 2d+119))) 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 <= 5e-305) || !(t_0 <= 2e+119)) {
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 <= 5e-305) or not (t_0 <= 2e+119): 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 <= 5e-305) || !(t_0 <= 2e+119)) 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 <= 5e-305) || ~((t_0 <= 2e+119)))
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, 5e-305], N[Not[LessEqual[t$95$0, 2e+119]], $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 5 \cdot 10^{-305} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+119}\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)))) < 4.99999999999999985e-305 or 1.99999999999999989e119 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 65.4%
associate-/r*71.6%
div-inv71.7%
Applied egg-rr71.7%
un-div-inv71.6%
sqrt-undiv39.0%
associate-*r/38.2%
*-commutative38.2%
clear-num37.8%
associate-/r*38.7%
sqrt-undiv71.3%
Applied egg-rr71.3%
associate-/r/71.6%
associate-*l/71.7%
*-lft-identity71.7%
associate-/r/71.5%
associate-*l/65.2%
associate-*r/71.5%
Simplified71.5%
if 4.99999999999999985e-305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999989e119Initial program 98.3%
Final simplification76.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 (or (<= t_0 0.0) (not (<= t_0 2e+129)))
(* 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 <= 2e+129)) {
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 <= 2d+129))) 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 <= 2e+129)) {
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 <= 2e+129): 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 <= 2e+129)) 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 <= 2e+129)))
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, 2e+129]], $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 2 \cdot 10^{+129}\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 2e129 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 65.1%
associate-/r*71.4%
Simplified71.4%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2e129Initial 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 5e-305)
(/ 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 <= 5e-305) {
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 <= 5d-305) 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 <= 5e-305) {
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 <= 5e-305: 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 <= 5e-305) 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 <= 5e-305)
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, 5e-305], 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 5 \cdot 10^{-305}:\\
\;\;\;\;\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)))) < 4.99999999999999985e-305Initial program 67.2%
associate-/r*72.4%
div-inv72.4%
Applied egg-rr72.4%
un-div-inv72.4%
sqrt-undiv39.9%
associate-*r/39.4%
*-commutative39.4%
clear-num38.8%
associate-/r*39.4%
sqrt-undiv71.9%
Applied egg-rr71.9%
associate-/r/72.3%
associate-*l/72.5%
*-lft-identity72.5%
associate-/r/70.9%
associate-*l/66.8%
associate-*r/72.2%
Simplified72.2%
if 4.99999999999999985e-305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000002e279Initial program 98.5%
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) (- INFINITY))
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) -2e-305)
(* c0 (/ (sqrt (- A)) (sqrt (* 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) <= -((double) INFINITY)) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((V * l) <= -2e-305) {
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) <= 5e+299) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 / sqrt((V / (A / l)));
}
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.sqrt(l)) * Math.sqrt((A / V));
} else if ((V * l) <= -2e-305) {
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) <= 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) <= -math.inf: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) elif (V * l) <= -2e-305: 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) <= 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) <= Float64(-Inf)) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= -2e-305) 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) <= 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) <= -Inf)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
elseif ((V * l) <= -2e-305)
tmp = c0 * (sqrt(-A) / sqrt((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], (-Infinity)], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-305], 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], 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 -\infty:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-305}:\\
\;\;\;\;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 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) < -inf.0Initial program 31.4%
*-commutative31.4%
associate-/r*72.1%
sqrt-div41.5%
associate-*l/36.0%
Applied egg-rr36.0%
associate-/l*41.5%
*-commutative41.5%
Applied egg-rr41.5%
if -inf.0 < (*.f64 V l) < -1.99999999999999999e-305Initial program 82.2%
frac-2neg82.2%
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 -1.99999999999999999e-305 < (*.f64 V l) < 0.0Initial program 47.6%
associate-/r*78.2%
div-inv78.3%
Applied egg-rr78.3%
un-div-inv78.2%
sqrt-undiv35.5%
associate-*r/35.4%
*-commutative35.4%
clear-num35.6%
associate-/r*35.5%
sqrt-undiv80.3%
Applied egg-rr80.3%
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 simplification91.8%
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 (sqrt (* l (/ V A)))))
(if (<= (* V l) -1.5e+268)
(/ c0 t_0)
(if (<= (* V l) -5e-182)
(* c0 (sqrt (* A (/ (/ 1.0 V) l))))
(if (<= (* V l) 0.0)
(* c0 (/ 1.0 t_0))
(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 t_0 = sqrt((l * (V / A)));
double tmp;
if ((V * l) <= -1.5e+268) {
tmp = c0 / t_0;
} else if ((V * l) <= -5e-182) {
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (1.0 / t_0);
} 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) :: t_0
real(8) :: tmp
t_0 = sqrt((l * (v / a)))
if ((v * l) <= (-1.5d+268)) then
tmp = c0 / t_0
else if ((v * l) <= (-5d-182)) then
tmp = c0 * sqrt((a * ((1.0d0 / v) / l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 * (1.0d0 / t_0)
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 t_0 = Math.sqrt((l * (V / A)));
double tmp;
if ((V * l) <= -1.5e+268) {
tmp = c0 / t_0;
} else if ((V * l) <= -5e-182) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (1.0 / t_0);
} 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): t_0 = math.sqrt((l * (V / A))) tmp = 0 if (V * l) <= -1.5e+268: tmp = c0 / t_0 elif (V * l) <= -5e-182: tmp = c0 * math.sqrt((A * ((1.0 / V) / l))) elif (V * l) <= 0.0: tmp = c0 * (1.0 / t_0) 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) t_0 = sqrt(Float64(l * Float64(V / A))) tmp = 0.0 if (Float64(V * l) <= -1.5e+268) tmp = Float64(c0 / t_0); elseif (Float64(V * l) <= -5e-182) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(1.0 / t_0)); 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)
t_0 = sqrt((l * (V / A)));
tmp = 0.0;
if ((V * l) <= -1.5e+268)
tmp = c0 / t_0;
elseif ((V * l) <= -5e-182)
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
elseif ((V * l) <= 0.0)
tmp = c0 * (1.0 / t_0);
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_] := Block[{t$95$0 = N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1.5e+268], N[(c0 / t$95$0), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-182], 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[(c0 * N[(1.0 / t$95$0), $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}
t_0 := \sqrt{\ell \cdot \frac{V}{A}}\\
\mathbf{if}\;V \cdot \ell \leq -1.5 \cdot 10^{+268}:\\
\;\;\;\;\frac{c0}{t\_0}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-182}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{1}{t\_0}\\
\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) < -1.49999999999999996e268Initial program 38.6%
associate-/r*70.0%
div-inv70.0%
Applied egg-rr70.0%
un-div-inv70.0%
sqrt-undiv36.6%
associate-*r/32.4%
*-commutative32.4%
clear-num31.4%
associate-/r*35.6%
sqrt-undiv68.6%
Applied egg-rr68.6%
associate-/r/69.8%
associate-*l/70.0%
*-lft-identity70.0%
associate-/r/70.0%
associate-*l/38.6%
associate-*r/70.0%
Simplified70.0%
if -1.49999999999999996e268 < (*.f64 V l) < -5.00000000000000024e-182Initial program 87.2%
clear-num85.6%
associate-/r/87.2%
associate-/r*87.3%
Applied egg-rr87.3%
if -5.00000000000000024e-182 < (*.f64 V l) < 0.0Initial program 48.6%
associate-/r*71.7%
clear-num71.7%
sqrt-div73.3%
metadata-eval73.3%
div-inv73.4%
clear-num73.4%
Applied egg-rr73.4%
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)))))