
(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) -5e-233)
(* c0 (/ 1.0 (/ (sqrt l) (/ (sqrt (- A)) (sqrt (- V))))))
(if (<= (* V l) 0.0)
(* (pow l -0.5) (/ c0 (sqrt (/ V A))))
(* c0 (/ (sqrt A) (sqrt (* V l)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-233) {
tmp = c0 * (1.0 / (sqrt(l) / (sqrt(-A) / sqrt(-V))));
} else if ((V * l) <= 0.0) {
tmp = pow(l, -0.5) * (c0 / sqrt((V / A)));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-5d-233)) then
tmp = c0 * (1.0d0 / (sqrt(l) / (sqrt(-a) / sqrt(-v))))
else if ((v * l) <= 0.0d0) then
tmp = (l ** (-0.5d0)) * (c0 / sqrt((v / a)))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-233) {
tmp = c0 * (1.0 / (Math.sqrt(l) / (Math.sqrt(-A) / Math.sqrt(-V))));
} else if ((V * l) <= 0.0) {
tmp = Math.pow(l, -0.5) * (c0 / Math.sqrt((V / A)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e-233: tmp = c0 * (1.0 / (math.sqrt(l) / (math.sqrt(-A) / math.sqrt(-V)))) elif (V * l) <= 0.0: tmp = math.pow(l, -0.5) * (c0 / math.sqrt((V / A))) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e-233) tmp = Float64(c0 * Float64(1.0 / Float64(sqrt(l) / Float64(sqrt(Float64(-A)) / sqrt(Float64(-V)))))); elseif (Float64(V * l) <= 0.0) tmp = Float64((l ^ -0.5) * Float64(c0 / sqrt(Float64(V / A)))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e-233)
tmp = c0 * (1.0 / (sqrt(l) / (sqrt(-A) / sqrt(-V))));
elseif ((V * l) <= 0.0)
tmp = (l ^ -0.5) * (c0 / sqrt((V / A)));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e-233], N[(c0 * N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] / N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[Power[l, -0.5], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-233}:\\
\;\;\;\;c0 \cdot \frac{1}{\frac{\sqrt{\ell}}{\frac{\sqrt{-A}}{\sqrt{-V}}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;{\ell}^{-0.5} \cdot \frac{c0}{\sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000012e-233Initial program 76.6%
associate-/r*71.1%
sqrt-div40.9%
div-inv40.8%
Applied egg-rr40.8%
*-commutative40.8%
associate-/r/40.9%
Simplified40.9%
frac-2neg40.9%
sqrt-div52.8%
Applied egg-rr52.8%
if -5.00000000000000012e-233 < (*.f64 V l) < -0.0Initial program 42.7%
associate-/r*78.8%
clear-num78.8%
sqrt-div80.7%
metadata-eval80.7%
clear-num78.6%
associate-/r*42.7%
clear-num42.7%
associate-/l*78.2%
Applied egg-rr78.2%
inv-pow78.2%
sqrt-pow278.2%
associate-*r/42.7%
*-commutative42.7%
*-un-lft-identity42.7%
times-frac80.7%
/-rgt-identity80.7%
clear-num80.8%
div-inv80.8%
sqrt-pow280.7%
sqrt-undiv52.7%
inv-pow52.7%
un-div-inv52.6%
sqrt-undiv80.7%
div-inv80.7%
clear-num80.7%
Applied egg-rr80.7%
*-un-lft-identity80.7%
sqrt-prod53.4%
times-frac49.8%
metadata-eval49.8%
sqrt-div49.8%
inv-pow49.8%
sqrt-pow149.8%
metadata-eval49.8%
Applied egg-rr49.8%
if -0.0 < (*.f64 V l) Initial program 87.4%
sqrt-div95.8%
associate-*r/93.9%
Applied egg-rr93.9%
associate-/l*95.8%
Simplified95.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 (or (<= t_0 0.0) (not (<= t_0 1e+308)))
(* 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 <= 1e+308)) {
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 <= 1d+308))) 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 <= 1e+308)) {
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 <= 1e+308): 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 <= 1e+308)) 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 <= 1e+308)))
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, 1e+308]], $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 10^{+308}\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 1e308 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 65.9%
associate-/r*73.1%
Simplified73.1%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1e308Initial program 98.8%
Final simplification80.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+277) t_0 (/ c0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 1e+277) {
tmp = t_0;
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 1d+277) then
tmp = t_0
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+277) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 1e+277: tmp = t_0 else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+277) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 1e+277)
tmp = t_0;
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+277], t$95$0, N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 10^{+277}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 69.2%
associate-/r*75.1%
Simplified75.1%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1e277Initial program 98.7%
if 1e277 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 56.7%
associate-/r*68.4%
clear-num68.4%
sqrt-div73.6%
metadata-eval73.6%
clear-num68.4%
associate-/r*56.6%
clear-num59.4%
associate-/l*73.6%
Applied egg-rr73.6%
inv-pow73.6%
sqrt-pow273.7%
associate-*r/59.4%
*-commutative59.4%
*-un-lft-identity59.4%
times-frac73.6%
/-rgt-identity73.6%
clear-num73.6%
div-inv73.7%
sqrt-pow273.6%
sqrt-undiv43.0%
inv-pow43.0%
un-div-inv43.1%
sqrt-undiv73.7%
div-inv73.7%
clear-num73.8%
Applied egg-rr73.8%
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) -5e-233)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* (pow l -0.5) (/ c0 (sqrt (/ V A))))
(* c0 (/ (sqrt A) (sqrt (* V l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= -5e-233) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = pow(l, -0.5) * (c0 / sqrt((V / A)));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * 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) <= -5e-233) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = Math.pow(l, -0.5) * (c0 / Math.sqrt((V / A)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= -5e-233: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = math.pow(l, -0.5) * (c0 / math.sqrt((V / A))) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -5e-233) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64((l ^ -0.5) * Float64(c0 / sqrt(Float64(V / A)))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= -5e-233)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = (l ^ -0.5) * (c0 / sqrt((V / A)));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[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], -5e-233], 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[(N[Power[l, -0.5], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-233}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;{\ell}^{-0.5} \cdot \frac{c0}{\sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 26.5%
Taylor expanded in c0 around 0 26.5%
*-commutative26.5%
associate-/r*51.8%
Simplified51.8%
frac-2neg51.8%
sqrt-div29.0%
distribute-neg-frac229.0%
Applied egg-rr29.0%
distribute-frac-neg229.0%
distribute-frac-neg29.0%
Simplified29.0%
if -inf.0 < (*.f64 V l) < -5.00000000000000012e-233Initial program 86.1%
frac-2neg86.1%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -5.00000000000000012e-233 < (*.f64 V l) < -0.0Initial program 42.7%
associate-/r*78.8%
clear-num78.8%
sqrt-div80.7%
metadata-eval80.7%
clear-num78.6%
associate-/r*42.7%
clear-num42.7%
associate-/l*78.2%
Applied egg-rr78.2%
inv-pow78.2%
sqrt-pow278.2%
associate-*r/42.7%
*-commutative42.7%
*-un-lft-identity42.7%
times-frac80.7%
/-rgt-identity80.7%
clear-num80.8%
div-inv80.8%
sqrt-pow280.7%
sqrt-undiv52.7%
inv-pow52.7%
un-div-inv52.6%
sqrt-undiv80.7%
div-inv80.7%
clear-num80.7%
Applied egg-rr80.7%
*-un-lft-identity80.7%
sqrt-prod53.4%
times-frac49.8%
metadata-eval49.8%
sqrt-div49.8%
inv-pow49.8%
sqrt-pow149.8%
metadata-eval49.8%
Applied egg-rr49.8%
if -0.0 < (*.f64 V l) Initial program 87.4%
sqrt-div95.8%
associate-*r/93.9%
Applied egg-rr93.9%
associate-/l*95.8%
Simplified95.8%
Final simplification85.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) -2e+244)
(/ (* c0 (sqrt (/ A V))) (sqrt l))
(if (<= (* V l) -5e-233)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* (pow l -0.5) (/ c0 (sqrt (/ V A))))
(* c0 (/ (sqrt A) (sqrt (* V l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+244) {
tmp = (c0 * sqrt((A / V))) / sqrt(l);
} else if ((V * l) <= -5e-233) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = pow(l, -0.5) * (c0 / sqrt((V / A)));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-2d+244)) then
tmp = (c0 * sqrt((a / v))) / sqrt(l)
else if ((v * l) <= (-5d-233)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = (l ** (-0.5d0)) * (c0 / sqrt((v / a)))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+244) {
tmp = (c0 * Math.sqrt((A / V))) / Math.sqrt(l);
} else if ((V * l) <= -5e-233) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = Math.pow(l, -0.5) * (c0 / Math.sqrt((V / A)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -2e+244: tmp = (c0 * math.sqrt((A / V))) / math.sqrt(l) elif (V * l) <= -5e-233: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = math.pow(l, -0.5) * (c0 / math.sqrt((V / A))) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e+244) tmp = Float64(Float64(c0 * sqrt(Float64(A / V))) / sqrt(l)); elseif (Float64(V * l) <= -5e-233) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64((l ^ -0.5) * Float64(c0 / sqrt(Float64(V / A)))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -2e+244)
tmp = (c0 * sqrt((A / V))) / sqrt(l);
elseif ((V * l) <= -5e-233)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = (l ^ -0.5) * (c0 / sqrt((V / A)));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e+244], N[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-233], 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[(N[Power[l, -0.5], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+244}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-233}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;{\ell}^{-0.5} \cdot \frac{c0}{\sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000015e244Initial program 49.3%
*-commutative49.3%
associate-/r*64.5%
sqrt-div37.1%
associate-*l/37.3%
Applied egg-rr37.3%
if -2.00000000000000015e244 < (*.f64 V l) < -5.00000000000000012e-233Initial program 86.5%
frac-2neg86.5%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -5.00000000000000012e-233 < (*.f64 V l) < -0.0Initial program 42.7%
associate-/r*78.8%
clear-num78.8%
sqrt-div80.7%
metadata-eval80.7%
clear-num78.6%
associate-/r*42.7%
clear-num42.7%
associate-/l*78.2%
Applied egg-rr78.2%
inv-pow78.2%
sqrt-pow278.2%
associate-*r/42.7%
*-commutative42.7%
*-un-lft-identity42.7%
times-frac80.7%
/-rgt-identity80.7%
clear-num80.8%
div-inv80.8%
sqrt-pow280.7%
sqrt-undiv52.7%
inv-pow52.7%
un-div-inv52.6%
sqrt-undiv80.7%
div-inv80.7%
clear-num80.7%
Applied egg-rr80.7%
*-un-lft-identity80.7%
sqrt-prod53.4%
times-frac49.8%
metadata-eval49.8%
sqrt-div49.8%
inv-pow49.8%
sqrt-pow149.8%
metadata-eval49.8%
Applied egg-rr49.8%
if -0.0 < (*.f64 V l) Initial program 87.4%
sqrt-div95.8%
associate-*r/93.9%
Applied egg-rr93.9%
associate-/l*95.8%
Simplified95.8%
Final simplification82.9%
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+215)
(/ (* c0 (sqrt (/ A V))) (sqrt l))
(if (<= (* V l) -5e-124)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
(* (pow l -0.5) (/ c0 (sqrt (/ V A))))
(* c0 (/ (sqrt A) (sqrt (* V l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+215) {
tmp = (c0 * sqrt((A / V))) / sqrt(l);
} else if ((V * l) <= -5e-124) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = pow(l, -0.5) * (c0 / sqrt((V / A)));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-1d+215)) then
tmp = (c0 * sqrt((a / v))) / sqrt(l)
else if ((v * l) <= (-5d-124)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = (l ** (-0.5d0)) * (c0 / sqrt((v / a)))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+215) {
tmp = (c0 * Math.sqrt((A / V))) / Math.sqrt(l);
} else if ((V * l) <= -5e-124) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = Math.pow(l, -0.5) * (c0 / Math.sqrt((V / A)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+215: tmp = (c0 * math.sqrt((A / V))) / math.sqrt(l) elif (V * l) <= -5e-124: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = math.pow(l, -0.5) * (c0 / math.sqrt((V / A))) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e+215) tmp = Float64(Float64(c0 * sqrt(Float64(A / V))) / sqrt(l)); elseif (Float64(V * l) <= -5e-124) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = Float64((l ^ -0.5) * Float64(c0 / sqrt(Float64(V / A)))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -1e+215)
tmp = (c0 * sqrt((A / V))) / sqrt(l);
elseif ((V * l) <= -5e-124)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = (l ^ -0.5) * (c0 / sqrt((V / A)));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+215], N[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-124], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(N[Power[l, -0.5], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+215}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-124}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;{\ell}^{-0.5} \cdot \frac{c0}{\sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999907e214Initial program 50.1%
*-commutative50.1%
associate-/r*62.3%
sqrt-div35.6%
associate-*l/35.7%
Applied egg-rr35.7%
if -9.99999999999999907e214 < (*.f64 V l) < -5.0000000000000003e-124Initial program 90.1%
associate-/r*72.2%
clear-num72.2%
sqrt-div72.2%
metadata-eval72.2%
clear-num72.2%
associate-/r*90.0%
clear-num90.1%
associate-/l*76.8%
Applied egg-rr76.8%
inv-pow76.8%
sqrt-pow276.9%
associate-*r/90.1%
*-commutative90.1%
*-un-lft-identity90.1%
times-frac72.6%
/-rgt-identity72.6%
clear-num71.1%
div-inv72.2%
sqrt-pow272.2%
sqrt-undiv48.4%
inv-pow48.4%
un-div-inv48.4%
sqrt-undiv72.2%
div-inv71.1%
clear-num72.5%
Applied egg-rr72.5%
associate-*r/90.1%
Applied egg-rr90.1%
if -5.0000000000000003e-124 < (*.f64 V l) < -0.0Initial program 55.6%
associate-/r*81.3%
clear-num81.3%
sqrt-div82.6%
metadata-eval82.6%
clear-num81.1%
associate-/r*55.5%
clear-num55.5%
associate-/l*79.2%
Applied egg-rr79.2%
inv-pow79.2%
sqrt-pow279.3%
associate-*r/55.5%
*-commutative55.5%
*-un-lft-identity55.5%
times-frac82.6%
/-rgt-identity82.6%
clear-num82.7%
div-inv82.7%
sqrt-pow282.6%
sqrt-undiv44.8%
inv-pow44.8%
un-div-inv44.8%
sqrt-undiv82.7%
div-inv82.7%
clear-num82.7%
Applied egg-rr82.7%
*-un-lft-identity82.7%
sqrt-prod45.4%
times-frac42.7%
metadata-eval42.7%
sqrt-div42.8%
inv-pow42.8%
sqrt-pow142.7%
metadata-eval42.7%
Applied egg-rr42.7%
if -0.0 < (*.f64 V l) Initial program 87.4%
sqrt-div95.8%
associate-*r/93.9%
Applied egg-rr93.9%
associate-/l*95.8%
Simplified95.8%
Final simplification74.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 (sqrt (/ A V))))
(if (<= (* V l) -1e+215)
(/ (* c0 t_0) (sqrt l))
(if (<= (* V l) -5e-124)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
(* c0 (/ t_0 (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 t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -1e+215) {
tmp = (c0 * t_0) / sqrt(l);
} else if ((V * l) <= -5e-124) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = c0 * (t_0 / 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) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-1d+215)) then
tmp = (c0 * t_0) / sqrt(l)
else if ((v * l) <= (-5d-124)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = c0 * (t_0 / 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 t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -1e+215) {
tmp = (c0 * t_0) / Math.sqrt(l);
} else if ((V * l) <= -5e-124) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = c0 * (t_0 / 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): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -1e+215: tmp = (c0 * t_0) / math.sqrt(l) elif (V * l) <= -5e-124: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = c0 * (t_0 / 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) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -1e+215) tmp = Float64(Float64(c0 * t_0) / sqrt(l)); elseif (Float64(V * l) <= -5e-124) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(t_0 / 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)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -1e+215)
tmp = (c0 * t_0) / sqrt(l);
elseif ((V * l) <= -5e-124)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = c0 * (t_0 / 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_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+215], N[(N[(c0 * t$95$0), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-124], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+215}:\\
\;\;\;\;\frac{c0 \cdot t\_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-124}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{t\_0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999907e214Initial program 50.1%
*-commutative50.1%
associate-/r*62.3%
sqrt-div35.6%
associate-*l/35.7%
Applied egg-rr35.7%
if -9.99999999999999907e214 < (*.f64 V l) < -5.0000000000000003e-124Initial program 90.1%
associate-/r*72.2%
clear-num72.2%
sqrt-div72.2%
metadata-eval72.2%
clear-num72.2%
associate-/r*90.0%
clear-num90.1%
associate-/l*76.8%
Applied egg-rr76.8%
inv-pow76.8%
sqrt-pow276.9%
associate-*r/90.1%
*-commutative90.1%
*-un-lft-identity90.1%
times-frac72.6%
/-rgt-identity72.6%
clear-num71.1%
div-inv72.2%
sqrt-pow272.2%
sqrt-undiv48.4%
inv-pow48.4%
un-div-inv48.4%
sqrt-undiv72.2%
div-inv71.1%
clear-num72.5%
Applied egg-rr72.5%
associate-*r/90.1%
Applied egg-rr90.1%
if -5.0000000000000003e-124 < (*.f64 V l) < -0.0Initial program 55.6%
associate-/r*81.3%
sqrt-div44.8%
associate-*r/42.2%
Applied egg-rr42.2%
associate-/l*44.8%
Simplified44.8%
if -0.0 < (*.f64 V l) Initial program 87.4%
sqrt-div95.8%
associate-*r/93.9%
Applied egg-rr93.9%
associate-/l*95.8%
Simplified95.8%
Final simplification74.6%
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)) (sqrt l)))))
(if (<= (* V l) -1e+215)
t_0
(if (<= (* V l) -5e-124)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0) t_0 (* c0 (/ (sqrt A) (sqrt (* V 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)) / sqrt(l));
double tmp;
if ((V * l) <= -1e+215) {
tmp = t_0;
} else if ((V * l) <= -5e-124) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = c0 * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-1d+215)) then
tmp = t_0
else if ((v * l) <= (-5d-124)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = t_0
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 t_0 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -1e+215) {
tmp = t_0;
} else if ((V * l) <= -5e-124) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} 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): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -1e+215: tmp = t_0 elif (V * l) <= -5e-124: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = t_0 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) t_0 = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -1e+215) tmp = t_0; elseif (Float64(V * l) <= -5e-124) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = t_0; 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)
t_0 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -1e+215)
tmp = t_0;
elseif ((V * l) <= -5e-124)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = t_0;
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_] := Block[{t$95$0 = N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+215], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-124], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, 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}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+215}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-124}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999907e214 or -5.0000000000000003e-124 < (*.f64 V l) < -0.0Initial program 53.4%
associate-/r*73.8%
sqrt-div41.2%
associate-*r/39.6%
Applied egg-rr39.6%
associate-/l*41.2%
Simplified41.2%
if -9.99999999999999907e214 < (*.f64 V l) < -5.0000000000000003e-124Initial program 90.1%
associate-/r*72.2%
clear-num72.2%
sqrt-div72.2%
metadata-eval72.2%
clear-num72.2%
associate-/r*90.0%
clear-num90.1%
associate-/l*76.8%
Applied egg-rr76.8%
inv-pow76.8%
sqrt-pow276.9%
associate-*r/90.1%
*-commutative90.1%
*-un-lft-identity90.1%
times-frac72.6%
/-rgt-identity72.6%
clear-num71.1%
div-inv72.2%
sqrt-pow272.2%
sqrt-undiv48.4%
inv-pow48.4%
un-div-inv48.4%
sqrt-undiv72.2%
div-inv71.1%
clear-num72.5%
Applied egg-rr72.5%
associate-*r/90.1%
Applied egg-rr90.1%
if -0.0 < (*.f64 V l) Initial program 87.4%
sqrt-div95.8%
associate-*r/93.9%
Applied egg-rr93.9%
associate-/l*95.8%
Simplified95.8%
Final simplification74.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -5e-120)
(* c0 (sqrt (* A (* (/ 1.0 V) (/ 1.0 l)))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* l (/ V A))))
(* c0 (/ (sqrt A) (sqrt (* V l)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-120) {
tmp = c0 * sqrt((A * ((1.0 / V) * (1.0 / l))));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt((l * (V / A)));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-5d-120)) then
tmp = c0 * sqrt((a * ((1.0d0 / v) * (1.0d0 / l))))
else if ((v * l) <= 0.0d0) then
tmp = c0 / sqrt((l * (v / a)))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-120) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) * (1.0 / l))));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e-120: tmp = c0 * math.sqrt((A * ((1.0 / V) * (1.0 / l)))) elif (V * l) <= 0.0: tmp = c0 / math.sqrt((l * (V / A))) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e-120) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) * Float64(1.0 / l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e-120)
tmp = c0 * sqrt((A * ((1.0 / V) * (1.0 / l))));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt((l * (V / A)));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e-120], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-120}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \left(\frac{1}{V} \cdot \frac{1}{\ell}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.00000000000000007e-120Initial program 74.5%
associate-/r*68.1%
div-inv68.1%
div-inv68.1%
associate-*l*75.7%
Applied egg-rr75.7%
if -5.00000000000000007e-120 < (*.f64 V l) < -0.0Initial program 56.3%
associate-/r*81.6%
clear-num81.6%
sqrt-div82.9%
metadata-eval82.9%
clear-num81.4%
associate-/r*56.2%
clear-num56.3%
associate-/l*79.5%
Applied egg-rr79.5%
inv-pow79.5%
sqrt-pow279.6%
associate-*r/56.3%
*-commutative56.3%
*-un-lft-identity56.3%
times-frac83.0%
/-rgt-identity83.0%
clear-num83.0%
div-inv83.0%
sqrt-pow282.9%
sqrt-undiv45.7%
inv-pow45.7%
un-div-inv45.8%
sqrt-undiv83.0%
div-inv83.0%
clear-num83.0%
Applied egg-rr83.0%
if -0.0 < (*.f64 V l) Initial program 87.4%
sqrt-div95.8%
associate-*r/93.9%
Applied egg-rr93.9%
associate-/l*95.8%
Simplified95.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 (/ A (* V l))))
(if (<= t_0 1e-318)
(* c0 (sqrt (* (/ 1.0 V) (/ A l))))
(if (<= t_0 5e+259)
(/ c0 (sqrt (/ (* V l) A)))
(/ 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 = A / (V * l);
double tmp;
if (t_0 <= 1e-318) {
tmp = c0 * sqrt(((1.0 / V) * (A / l)));
} else if (t_0 <= 5e+259) {
tmp = c0 / sqrt(((V * l) / 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) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 1d-318) then
tmp = c0 * sqrt(((1.0d0 / v) * (a / l)))
else if (t_0 <= 5d+259) then
tmp = c0 / sqrt(((v * l) / 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 t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-318) {
tmp = c0 * Math.sqrt(((1.0 / V) * (A / l)));
} else if (t_0 <= 5e+259) {
tmp = c0 / Math.sqrt(((V * l) / 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): t_0 = A / (V * l) tmp = 0 if t_0 <= 1e-318: tmp = c0 * math.sqrt(((1.0 / V) * (A / l))) elif t_0 <= 5e+259: tmp = c0 / math.sqrt(((V * l) / 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) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 1e-318) tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / V) * Float64(A / l)))); elseif (t_0 <= 5e+259) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / 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)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-318)
tmp = c0 * sqrt(((1.0 / V) * (A / l)));
elseif (t_0 <= 5e+259)
tmp = c0 / sqrt(((V * l) / 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_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-318], N[(c0 * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] * N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+259], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / 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}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 10^{-318}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+259}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.9999875e-319Initial program 36.0%
*-un-lft-identity36.0%
times-frac51.8%
Applied egg-rr51.8%
if 9.9999875e-319 < (/.f64 A (*.f64 V l)) < 5.00000000000000033e259Initial program 99.6%
associate-/r*89.2%
clear-num89.3%
sqrt-div89.2%
metadata-eval89.2%
clear-num89.2%
associate-/r*99.4%
clear-num99.5%
associate-/l*87.7%
Applied egg-rr87.7%
inv-pow87.7%
sqrt-pow287.8%
associate-*r/99.5%
*-commutative99.5%
*-un-lft-identity99.5%
times-frac88.9%
/-rgt-identity88.9%
clear-num88.3%
div-inv89.3%
sqrt-pow289.2%
sqrt-undiv39.5%
inv-pow39.5%
un-div-inv39.5%
sqrt-undiv89.3%
div-inv88.3%
clear-num88.9%
Applied egg-rr88.9%
associate-*r/99.6%
Applied egg-rr99.6%
if 5.00000000000000033e259 < (/.f64 A (*.f64 V l)) Initial program 43.7%
associate-/r*66.0%
clear-num66.0%
sqrt-div69.0%
metadata-eval69.0%
clear-num65.9%
associate-/r*43.7%
clear-num45.3%
associate-/l*70.6%
Applied egg-rr70.6%
inv-pow70.6%
sqrt-pow270.7%
associate-*r/45.3%
*-commutative45.3%
*-un-lft-identity45.3%
times-frac69.0%
/-rgt-identity69.0%
clear-num69.1%
div-inv69.1%
sqrt-pow269.0%
sqrt-undiv45.3%
inv-pow45.3%
un-div-inv45.3%
sqrt-undiv69.1%
div-inv69.0%
clear-num69.1%
Applied egg-rr69.1%
/-rgt-identity69.1%
clear-num69.0%
times-frac70.8%
*-un-lft-identity70.8%
*-commutative70.8%
un-div-inv70.8%
Applied egg-rr70.8%
Final simplification84.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 (/ A (* V l))))
(if (<= t_0 1e-318)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+259)
(/ c0 (sqrt (/ (* V l) A)))
(/ 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 = A / (V * l);
double tmp;
if (t_0 <= 1e-318) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 5e+259) {
tmp = c0 / sqrt(((V * l) / 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) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 1d-318) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 5d+259) then
tmp = c0 / sqrt(((v * l) / 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 t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-318) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+259) {
tmp = c0 / Math.sqrt(((V * l) / 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): t_0 = A / (V * l) tmp = 0 if t_0 <= 1e-318: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 5e+259: tmp = c0 / math.sqrt(((V * l) / 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) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 1e-318) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+259) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / 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)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-318)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 5e+259)
tmp = c0 / sqrt(((V * l) / 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_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-318], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+259], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / 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}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 10^{-318}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+259}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.9999875e-319Initial program 36.0%
Taylor expanded in c0 around 0 36.0%
*-commutative36.0%
associate-/r*51.8%
Simplified51.8%
if 9.9999875e-319 < (/.f64 A (*.f64 V l)) < 5.00000000000000033e259Initial program 99.6%
associate-/r*89.2%
clear-num89.3%
sqrt-div89.2%
metadata-eval89.2%
clear-num89.2%
associate-/r*99.4%
clear-num99.5%
associate-/l*87.7%
Applied egg-rr87.7%
inv-pow87.7%
sqrt-pow287.8%
associate-*r/99.5%
*-commutative99.5%
*-un-lft-identity99.5%
times-frac88.9%
/-rgt-identity88.9%
clear-num88.3%
div-inv89.3%
sqrt-pow289.2%
sqrt-undiv39.5%
inv-pow39.5%
un-div-inv39.5%
sqrt-undiv89.3%
div-inv88.3%
clear-num88.9%
Applied egg-rr88.9%
associate-*r/99.6%
Applied egg-rr99.6%
if 5.00000000000000033e259 < (/.f64 A (*.f64 V l)) Initial program 43.7%
associate-/r*66.0%
clear-num66.0%
sqrt-div69.0%
metadata-eval69.0%
clear-num65.9%
associate-/r*43.7%
clear-num45.3%
associate-/l*70.6%
Applied egg-rr70.6%
inv-pow70.6%
sqrt-pow270.7%
associate-*r/45.3%
*-commutative45.3%
*-un-lft-identity45.3%
times-frac69.0%
/-rgt-identity69.0%
clear-num69.1%
div-inv69.1%
sqrt-pow269.0%
sqrt-undiv45.3%
inv-pow45.3%
un-div-inv45.3%
sqrt-undiv69.1%
div-inv69.0%
clear-num69.1%
Applied egg-rr69.1%
/-rgt-identity69.1%
clear-num69.0%
times-frac70.8%
*-un-lft-identity70.8%
*-commutative70.8%
un-div-inv70.8%
Applied egg-rr70.8%
Final simplification84.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 (/ A (* V l))))
(if (<= t_0 1e-318)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+259) (* c0 (sqrt 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 = A / (V * l);
double tmp;
if (t_0 <= 1e-318) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 5e+259) {
tmp = c0 * sqrt(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 = a / (v * l)
if (t_0 <= 1d-318) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 5d+259) then
tmp = c0 * sqrt(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 = A / (V * l);
double tmp;
if (t_0 <= 1e-318) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+259) {
tmp = c0 * Math.sqrt(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 = A / (V * l) tmp = 0 if t_0 <= 1e-318: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 5e+259: tmp = c0 * math.sqrt(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(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 1e-318) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+259) tmp = Float64(c0 * sqrt(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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-318)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 5e+259)
tmp = c0 * sqrt(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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-318], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+259], N[(c0 * N[Sqrt[t$95$0], $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 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 10^{-318}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+259}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.9999875e-319Initial program 36.0%
Taylor expanded in c0 around 0 36.0%
*-commutative36.0%
associate-/r*51.8%
Simplified51.8%
if 9.9999875e-319 < (/.f64 A (*.f64 V l)) < 5.00000000000000033e259Initial program 99.6%
if 5.00000000000000033e259 < (/.f64 A (*.f64 V l)) Initial program 43.7%
associate-/r*66.0%
clear-num66.0%
sqrt-div69.0%
metadata-eval69.0%
clear-num65.9%
associate-/r*43.7%
clear-num45.3%
associate-/l*70.6%
Applied egg-rr70.6%
inv-pow70.6%
sqrt-pow270.7%
associate-*r/45.3%
*-commutative45.3%
*-un-lft-identity45.3%
times-frac69.0%
/-rgt-identity69.0%
clear-num69.1%
div-inv69.1%
sqrt-pow269.0%
sqrt-undiv45.3%
inv-pow45.3%
un-div-inv45.3%
sqrt-undiv69.1%
div-inv69.0%
clear-num69.1%
Applied egg-rr69.1%
/-rgt-identity69.1%
clear-num69.0%
times-frac70.8%
*-un-lft-identity70.8%
*-commutative70.8%
un-div-inv70.8%
Applied egg-rr70.8%
Final simplification84.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 75.7%
herbie shell --seed 2024123
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))