
(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 V))) (sqrt l))
(if (<= (* V l) -5e-264)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- 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) <= -((double) INFINITY)) {
tmp = (c0 * sqrt((A / V))) / sqrt(l);
} else if ((V * l) <= -5e-264) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt((l * (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 / V))) / Math.sqrt(l);
} else if ((V * l) <= -5e-264) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -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) <= -math.inf: tmp = (c0 * math.sqrt((A / V))) / math.sqrt(l) elif (V * l) <= -5e-264: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -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) <= Float64(-Inf)) tmp = Float64(Float64(c0 * sqrt(Float64(A / V))) / sqrt(l)); elseif (Float64(V * l) <= -5e-264) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-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) <= -Inf)
tmp = (c0 * sqrt((A / V))) / sqrt(l);
elseif ((V * l) <= -5e-264)
tmp = c0 * (sqrt(-A) / sqrt((V * -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], (-Infinity)], N[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-264], 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[(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 -\infty:\\
\;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-264}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\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) < -inf.0Initial program 18.3%
*-commutative18.3%
associate-/r*70.1%
sqrt-div30.9%
associate-*l/31.0%
Applied egg-rr31.0%
if -inf.0 < (*.f64 V l) < -5.0000000000000001e-264Initial program 81.8%
frac-2neg81.8%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if -5.0000000000000001e-264 < (*.f64 V l) < -0.0Initial program 33.2%
associate-/r*68.1%
div-inv68.1%
Applied egg-rr68.1%
*-commutative68.1%
clear-num68.0%
un-div-inv68.1%
Applied egg-rr68.1%
associate-/l/68.1%
sqrt-div68.1%
metadata-eval68.1%
sqrt-unprod42.4%
div-inv42.4%
sqrt-unprod68.2%
Applied egg-rr68.2%
if -0.0 < (*.f64 V l) Initial program 78.2%
sqrt-div92.7%
div-inv92.7%
Applied egg-rr92.7%
associate-*r/92.7%
*-rgt-identity92.7%
Simplified92.7%
Final simplification89.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 5e+281)))
(* c0 (sqrt (/ (/ A V) l)))
t_0)))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+281)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+281))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+281)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+281): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 5e+281)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 5e+281)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+281]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+281}\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 5.00000000000000016e281 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 61.5%
associate-/r*67.8%
Simplified67.8%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.00000000000000016e281Initial program 97.0%
Final simplification75.9%
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 4e-268)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+281) t_0 (* c0 (sqrt (/ (/ A 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 * l)));
double tmp;
if (t_0 <= 4e-268) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 5e+281) {
tmp = t_0;
} else {
tmp = c0 * sqrt(((A / 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 * l)))
if (t_0 <= 4d-268) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 5d+281) then
tmp = t_0
else
tmp = c0 * sqrt(((a / 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 * l)));
double tmp;
if (t_0 <= 4e-268) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+281) {
tmp = t_0;
} else {
tmp = c0 * Math.sqrt(((A / 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 * l))) tmp = 0 if t_0 <= 4e-268: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 5e+281: tmp = t_0 else: tmp = c0 * math.sqrt(((A / V) / 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 <= 4e-268) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+281) tmp = t_0; else tmp = Float64(c0 * sqrt(Float64(Float64(A / 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 * l)));
tmp = 0.0;
if (t_0 <= 4e-268)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 5e+281)
tmp = t_0;
else
tmp = c0 * sqrt(((A / 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[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-268], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+281], t$95$0, N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $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 4 \cdot 10^{-268}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+281}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999983e-268Initial program 68.7%
associate-/r*72.0%
div-inv72.0%
Applied egg-rr72.0%
associate-*l/74.3%
div-inv74.3%
Applied egg-rr74.3%
if 3.99999999999999983e-268 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.00000000000000016e281Initial program 97.2%
if 5.00000000000000016e281 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 38.7%
associate-/r*54.7%
Simplified54.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -4e-310) (* c0 (/ (/ (sqrt (- A)) (sqrt (- V))) (sqrt l))) (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-4d-310)) then
tmp = c0 * ((sqrt(-a) / sqrt(-v)) / sqrt(l))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -4e-310: tmp = c0 * ((math.sqrt(-A) / math.sqrt(-V)) / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -4e-310) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -4e-310)
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -4e-310], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -3.999999999999988e-310Initial program 70.4%
associate-/r*71.0%
sqrt-div36.9%
div-inv36.9%
Applied egg-rr36.9%
associate-*r/36.9%
*-rgt-identity36.9%
Simplified36.9%
frac-2neg36.9%
sqrt-div45.0%
Applied egg-rr45.0%
if -3.999999999999988e-310 < A Initial program 72.4%
sqrt-div85.5%
div-inv85.5%
Applied egg-rr85.5%
associate-*r/85.5%
*-rgt-identity85.5%
Simplified85.5%
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+211)
(* c0 (/ 1.0 (pow (/ (/ A V) l) -0.5)))
(if (<= (* V l) -5e-182)
(* c0 (sqrt (/ A (* V 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) <= -1e+211) {
tmp = c0 * (1.0 / pow(((A / V) / l), -0.5));
} else if ((V * l) <= -5e-182) {
tmp = c0 * sqrt((A / (V * 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) <= (-1d+211)) then
tmp = c0 * (1.0d0 / (((a / v) / l) ** (-0.5d0)))
else if ((v * l) <= (-5d-182)) then
tmp = c0 * sqrt((a / (v * 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) <= -1e+211) {
tmp = c0 * (1.0 / Math.pow(((A / V) / l), -0.5));
} else if ((V * l) <= -5e-182) {
tmp = c0 * Math.sqrt((A / (V * 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) <= -1e+211: tmp = c0 * (1.0 / math.pow(((A / V) / l), -0.5)) elif (V * l) <= -5e-182: tmp = c0 * math.sqrt((A / (V * 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) <= -1e+211) tmp = Float64(c0 * Float64(1.0 / (Float64(Float64(A / V) / l) ^ -0.5))); elseif (Float64(V * l) <= -5e-182) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * 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) <= -1e+211)
tmp = c0 * (1.0 / (((A / V) / l) ^ -0.5));
elseif ((V * l) <= -5e-182)
tmp = c0 * sqrt((A / (V * 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], -1e+211], N[(c0 * N[(1.0 / N[Power[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-182], N[(c0 * N[Sqrt[N[(A / N[(V * l), $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 -1 \cdot 10^{+211}:\\
\;\;\;\;c0 \cdot \frac{1}{{\left(\frac{\frac{A}{V}}{\ell}\right)}^{-0.5}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-182}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\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) < -9.9999999999999996e210Initial program 35.3%
associate-/r*60.3%
clear-num57.4%
sqrt-div57.5%
metadata-eval57.5%
div-inv57.5%
clear-num57.4%
Applied egg-rr57.4%
sqrt-prod26.3%
clear-num26.4%
sqrt-div26.4%
metadata-eval26.4%
div-inv26.4%
clear-num26.4%
sqrt-undiv60.3%
associate-/l/35.5%
sqrt-div0.0%
*-commutative0.0%
sqrt-div35.5%
Applied egg-rr35.5%
associate-/r*60.3%
Simplified60.3%
inv-pow60.3%
sqrt-pow260.3%
associate-/l/35.5%
*-commutative35.5%
metadata-eval35.5%
Applied egg-rr35.5%
associate-/r*60.3%
Simplified60.3%
if -9.9999999999999996e210 < (*.f64 V l) < -5.00000000000000024e-182Initial program 89.3%
if -5.00000000000000024e-182 < (*.f64 V l) < -0.0Initial program 45.5%
associate-/r*69.4%
div-inv69.4%
Applied egg-rr69.4%
*-commutative69.4%
clear-num69.3%
un-div-inv69.4%
Applied egg-rr69.4%
associate-/l/69.3%
sqrt-div69.3%
metadata-eval69.3%
sqrt-unprod42.7%
div-inv42.7%
sqrt-unprod69.5%
Applied egg-rr69.5%
if -0.0 < (*.f64 V l) Initial program 78.2%
sqrt-div92.7%
div-inv92.7%
Applied egg-rr92.7%
associate-*r/92.7%
*-rgt-identity92.7%
Simplified92.7%
Final simplification84.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -4e-310) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-4d-310)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -4e-310: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -4e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -4e-310)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -4e-310], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -3.999999999999988e-310Initial program 70.4%
associate-/r*71.0%
sqrt-div36.9%
div-inv36.9%
Applied egg-rr36.9%
associate-*r/36.9%
*-rgt-identity36.9%
Simplified36.9%
if -3.999999999999988e-310 < A Initial program 72.4%
sqrt-div85.5%
div-inv85.5%
Applied egg-rr85.5%
associate-*r/85.5%
*-rgt-identity85.5%
Simplified85.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 5e-310)
(* c0 (/ 1.0 (pow (/ (/ A V) l) -0.5)))
(if (<= t_0 4e+287)
(/ c0 (sqrt (/ (* V l) A)))
(* c0 (/ 1.0 (sqrt (* l (/ V A)))))))))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 <= 5e-310) {
tmp = c0 * (1.0 / pow(((A / V) / l), -0.5));
} else if (t_0 <= 4e+287) {
tmp = c0 / sqrt(((V * l) / A));
} else {
tmp = c0 * (1.0 / 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 = a / (v * l)
if (t_0 <= 5d-310) then
tmp = c0 * (1.0d0 / (((a / v) / l) ** (-0.5d0)))
else if (t_0 <= 4d+287) then
tmp = c0 / sqrt(((v * l) / a))
else
tmp = c0 * (1.0d0 / 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 = A / (V * l);
double tmp;
if (t_0 <= 5e-310) {
tmp = c0 * (1.0 / Math.pow(((A / V) / l), -0.5));
} else if (t_0 <= 4e+287) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else {
tmp = c0 * (1.0 / Math.sqrt((l * (V / A))));
}
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 <= 5e-310: tmp = c0 * (1.0 / math.pow(((A / V) / l), -0.5)) elif t_0 <= 4e+287: tmp = c0 / math.sqrt(((V * l) / A)) else: tmp = c0 * (1.0 / 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(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 5e-310) tmp = Float64(c0 * Float64(1.0 / (Float64(Float64(A / V) / l) ^ -0.5))); elseif (t_0 <= 4e+287) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); else tmp = Float64(c0 * Float64(1.0 / 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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 5e-310)
tmp = c0 * (1.0 / (((A / V) / l) ^ -0.5));
elseif (t_0 <= 4e+287)
tmp = c0 / sqrt(((V * l) / A));
else
tmp = c0 * (1.0 / 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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-310], N[(c0 * N[(1.0 / N[Power[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+287], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(1.0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $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 5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{1}{{\left(\frac{\frac{A}{V}}{\ell}\right)}^{-0.5}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+287}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.999999999999985e-310Initial program 37.2%
associate-/r*53.8%
clear-num47.2%
sqrt-div47.2%
metadata-eval47.2%
div-inv47.2%
clear-num47.2%
Applied egg-rr47.2%
sqrt-prod31.3%
clear-num31.3%
sqrt-div31.3%
metadata-eval31.3%
div-inv31.3%
clear-num31.3%
sqrt-undiv53.8%
associate-/l/37.2%
sqrt-div34.8%
*-commutative34.8%
sqrt-div37.2%
Applied egg-rr37.2%
associate-/r*53.8%
Simplified53.8%
inv-pow53.8%
sqrt-pow253.8%
associate-/l/37.2%
*-commutative37.2%
metadata-eval37.2%
Applied egg-rr37.2%
associate-/r*53.8%
Simplified53.8%
if 4.999999999999985e-310 < (/.f64 A (*.f64 V l)) < 4.0000000000000003e287Initial program 98.8%
associate-/r*86.4%
div-inv86.3%
Applied egg-rr86.3%
*-commutative86.3%
clear-num85.7%
un-div-inv86.2%
Applied egg-rr86.2%
add-sqr-sqrt46.3%
sqrt-unprod29.9%
swap-sqr25.8%
add-sqr-sqrt25.9%
div-inv25.4%
clear-num25.7%
frac-2neg25.7%
times-frac30.4%
*-un-lft-identity30.4%
add-sqr-sqrt19.2%
add-sqr-sqrt19.2%
frac-times19.2%
swap-sqr21.9%
Applied egg-rr98.9%
if 4.0000000000000003e287 < (/.f64 A (*.f64 V l)) Initial program 39.3%
associate-/r*52.6%
clear-num52.5%
sqrt-div54.8%
metadata-eval54.8%
div-inv54.8%
clear-num54.8%
Applied egg-rr54.8%
Final simplification78.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 (/ A (* V l))))
(if (<= t_0 5e-310)
(* c0 (sqrt (* (/ A V) (/ 1.0 l))))
(if (<= t_0 4e+287)
(/ c0 (sqrt (/ (* V l) A)))
(* c0 (/ 1.0 (sqrt (* l (/ V A)))))))))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 <= 5e-310) {
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
} else if (t_0 <= 4e+287) {
tmp = c0 / sqrt(((V * l) / A));
} else {
tmp = c0 * (1.0 / 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 = a / (v * l)
if (t_0 <= 5d-310) then
tmp = c0 * sqrt(((a / v) * (1.0d0 / l)))
else if (t_0 <= 4d+287) then
tmp = c0 / sqrt(((v * l) / a))
else
tmp = c0 * (1.0d0 / 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 = A / (V * l);
double tmp;
if (t_0 <= 5e-310) {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
} else if (t_0 <= 4e+287) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else {
tmp = c0 * (1.0 / Math.sqrt((l * (V / A))));
}
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 <= 5e-310: tmp = c0 * math.sqrt(((A / V) * (1.0 / l))) elif t_0 <= 4e+287: tmp = c0 / math.sqrt(((V * l) / A)) else: tmp = c0 * (1.0 / 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(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 5e-310) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / l)))); elseif (t_0 <= 4e+287) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); else tmp = Float64(c0 * Float64(1.0 / 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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 5e-310)
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
elseif (t_0 <= 4e+287)
tmp = c0 / sqrt(((V * l) / A));
else
tmp = c0 * (1.0 / 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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-310], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+287], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(1.0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $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 5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+287}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.999999999999985e-310Initial program 37.2%
associate-/r*53.8%
div-inv53.8%
Applied egg-rr53.8%
if 4.999999999999985e-310 < (/.f64 A (*.f64 V l)) < 4.0000000000000003e287Initial program 98.8%
associate-/r*86.4%
div-inv86.3%
Applied egg-rr86.3%
*-commutative86.3%
clear-num85.7%
un-div-inv86.2%
Applied egg-rr86.2%
add-sqr-sqrt46.3%
sqrt-unprod29.9%
swap-sqr25.8%
add-sqr-sqrt25.9%
div-inv25.4%
clear-num25.7%
frac-2neg25.7%
times-frac30.4%
*-un-lft-identity30.4%
add-sqr-sqrt19.2%
add-sqr-sqrt19.2%
frac-times19.2%
swap-sqr21.9%
Applied egg-rr98.9%
if 4.0000000000000003e287 < (/.f64 A (*.f64 V l)) Initial program 39.3%
associate-/r*52.6%
clear-num52.5%
sqrt-div54.8%
metadata-eval54.8%
div-inv54.8%
clear-num54.8%
Applied egg-rr54.8%
Final simplification78.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 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 2e+295)))
(/ c0 (sqrt (* l (/ V A))))
(* c0 (sqrt t_0)))))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 <= 0.0) || !(t_0 <= 2e+295)) {
tmp = c0 / sqrt((l * (V / A)));
} else {
tmp = c0 * sqrt(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 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 2d+295))) then
tmp = c0 / sqrt((l * (v / a)))
else
tmp = c0 * sqrt(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 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 2e+295)) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else {
tmp = c0 * Math.sqrt(t_0);
}
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 <= 0.0) or not (t_0 <= 2e+295): tmp = c0 / math.sqrt((l * (V / A))) else: tmp = c0 * math.sqrt(t_0) 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 <= 0.0) || !(t_0 <= 2e+295)) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); else tmp = Float64(c0 * sqrt(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 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 2e+295)))
tmp = c0 / sqrt((l * (V / A)));
else
tmp = c0 * sqrt(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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 2e+295]], $MachinePrecision]], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $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 0 \lor \neg \left(t\_0 \leq 2 \cdot 10^{+295}\right):\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 2e295 < (/.f64 A (*.f64 V l)) Initial program 35.6%
associate-/r*52.3%
div-inv52.3%
Applied egg-rr52.3%
*-commutative52.3%
clear-num52.3%
un-div-inv52.3%
Applied egg-rr52.3%
associate-/l/52.3%
sqrt-div53.5%
metadata-eval53.5%
sqrt-unprod32.2%
div-inv32.2%
sqrt-unprod53.5%
Applied egg-rr53.5%
if 0.0 < (/.f64 A (*.f64 V l)) < 2e295Initial program 97.9%
Final simplification79.0%
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 5e-310)
(* c0 (sqrt (* (/ A V) (/ 1.0 l))))
(if (<= t_0 4e+287)
(/ c0 (sqrt (/ (* V l) A)))
(/ 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 = A / (V * l);
double tmp;
if (t_0 <= 5e-310) {
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
} else if (t_0 <= 4e+287) {
tmp = c0 / sqrt(((V * l) / A));
} 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 = a / (v * l)
if (t_0 <= 5d-310) then
tmp = c0 * sqrt(((a / v) * (1.0d0 / l)))
else if (t_0 <= 4d+287) then
tmp = c0 / sqrt(((v * l) / a))
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 = A / (V * l);
double tmp;
if (t_0 <= 5e-310) {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
} else if (t_0 <= 4e+287) {
tmp = c0 / Math.sqrt(((V * l) / A));
} 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 = A / (V * l) tmp = 0 if t_0 <= 5e-310: tmp = c0 * math.sqrt(((A / V) * (1.0 / l))) elif t_0 <= 4e+287: tmp = c0 / math.sqrt(((V * l) / A)) 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(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 5e-310) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / l)))); elseif (t_0 <= 4e+287) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); 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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 5e-310)
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
elseif (t_0 <= 4e+287)
tmp = c0 / sqrt(((V * l) / A));
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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-310], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+287], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+287}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.999999999999985e-310Initial program 37.2%
associate-/r*53.8%
div-inv53.8%
Applied egg-rr53.8%
if 4.999999999999985e-310 < (/.f64 A (*.f64 V l)) < 4.0000000000000003e287Initial program 98.8%
associate-/r*86.4%
div-inv86.3%
Applied egg-rr86.3%
*-commutative86.3%
clear-num85.7%
un-div-inv86.2%
Applied egg-rr86.2%
add-sqr-sqrt46.3%
sqrt-unprod29.9%
swap-sqr25.8%
add-sqr-sqrt25.9%
div-inv25.4%
clear-num25.7%
frac-2neg25.7%
times-frac30.4%
*-un-lft-identity30.4%
add-sqr-sqrt19.2%
add-sqr-sqrt19.2%
frac-times19.2%
swap-sqr21.9%
Applied egg-rr98.9%
if 4.0000000000000003e287 < (/.f64 A (*.f64 V l)) Initial program 39.3%
associate-/r*52.6%
div-inv52.5%
Applied egg-rr52.5%
*-commutative52.5%
clear-num52.5%
un-div-inv52.5%
Applied egg-rr52.5%
associate-/l/52.5%
sqrt-div54.8%
metadata-eval54.8%
sqrt-unprod37.7%
div-inv37.7%
sqrt-unprod54.8%
Applied egg-rr54.8%
Final simplification78.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 (/ A (* V l))))
(if (<= t_0 5e-310)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 4e+287)
(/ c0 (sqrt (/ (* V l) A)))
(/ 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 = A / (V * l);
double tmp;
if (t_0 <= 5e-310) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 4e+287) {
tmp = c0 / sqrt(((V * l) / A));
} 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 = a / (v * l)
if (t_0 <= 5d-310) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 4d+287) then
tmp = c0 / sqrt(((v * l) / a))
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 = A / (V * l);
double tmp;
if (t_0 <= 5e-310) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 4e+287) {
tmp = c0 / Math.sqrt(((V * l) / A));
} 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 = A / (V * l) tmp = 0 if t_0 <= 5e-310: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 4e+287: tmp = c0 / math.sqrt(((V * l) / A)) 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(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 5e-310) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 4e+287) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); 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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 5e-310)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 4e+287)
tmp = c0 / sqrt(((V * l) / A));
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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-310], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+287], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+287}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.999999999999985e-310Initial program 37.2%
associate-/r*53.8%
Simplified53.8%
if 4.999999999999985e-310 < (/.f64 A (*.f64 V l)) < 4.0000000000000003e287Initial program 98.8%
associate-/r*86.4%
div-inv86.3%
Applied egg-rr86.3%
*-commutative86.3%
clear-num85.7%
un-div-inv86.2%
Applied egg-rr86.2%
add-sqr-sqrt46.3%
sqrt-unprod29.9%
swap-sqr25.8%
add-sqr-sqrt25.9%
div-inv25.4%
clear-num25.7%
frac-2neg25.7%
times-frac30.4%
*-un-lft-identity30.4%
add-sqr-sqrt19.2%
add-sqr-sqrt19.2%
frac-times19.2%
swap-sqr21.9%
Applied egg-rr98.9%
if 4.0000000000000003e287 < (/.f64 A (*.f64 V l)) Initial program 39.3%
associate-/r*52.6%
div-inv52.5%
Applied egg-rr52.5%
*-commutative52.5%
clear-num52.5%
un-div-inv52.5%
Applied egg-rr52.5%
associate-/l/52.5%
sqrt-div54.8%
metadata-eval54.8%
sqrt-unprod37.7%
div-inv37.7%
sqrt-unprod54.8%
Applied egg-rr54.8%
Final simplification78.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 (/ A (* V l))))
(if (<= t_0 0.0)
(/ c0 (sqrt (* l (/ V A))))
(if (<= t_0 2e+299) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / sqrt((l * (V / A)));
} else if (t_0 <= 2e+299) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 / sqrt((l * (v / a)))
else if (t_0 <= 2d+299) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if (t_0 <= 2e+299) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 / math.sqrt((l * (V / A))) elif t_0 <= 2e+299: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (t_0 <= 2e+299) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 / sqrt((l * (V / A)));
elseif (t_0 <= 2e+299)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+299], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[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 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+299}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 32.6%
associate-/r*51.2%
div-inv51.2%
Applied egg-rr51.2%
*-commutative51.2%
clear-num51.2%
un-div-inv51.2%
Applied egg-rr51.2%
associate-/l/51.2%
sqrt-div51.2%
metadata-eval51.2%
sqrt-unprod25.4%
div-inv25.4%
sqrt-unprod51.2%
Applied egg-rr51.2%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e299Initial program 97.9%
if 2.0000000000000001e299 < (/.f64 A (*.f64 V l)) Initial program 36.0%
associate-/r*53.4%
div-inv53.3%
Applied egg-rr53.3%
pow153.3%
metadata-eval53.3%
sqrt-pow130.7%
sqrt-prod30.6%
unpow230.6%
clear-num30.6%
frac-times30.7%
*-commutative30.7%
add-sqr-sqrt30.7%
frac-times30.7%
swap-sqr35.2%
sqrt-unprod35.0%
add-sqr-sqrt55.8%
un-div-inv55.8%
sqrt-prod38.0%
clear-num36.8%
sqrt-div36.7%
metadata-eval36.7%
Applied egg-rr55.8%
Final simplification79.4%
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.3%
herbie shell --seed 2024101
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))