
(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 12 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
(let* ((t_0 (sqrt (- A))))
(if (<= (* V l) -5e+195)
(/ (* c0 (/ t_0 (sqrt (- V)))) (sqrt l))
(if (<= (* V l) -2e-315)
(* c0 (/ t_0 (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0 (* (/ 1.0 (sqrt l)) (sqrt (/ A V))))
(if (<= (* V l) 5e+296)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* 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 = sqrt(-A);
double tmp;
if ((V * l) <= -5e+195) {
tmp = (c0 * (t_0 / sqrt(-V))) / sqrt(l);
} else if ((V * l) <= -2e-315) {
tmp = c0 * (t_0 / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * ((1.0 / sqrt(l)) * sqrt((A / V)));
} else if ((V * l) <= 5e+296) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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 = sqrt(-a)
if ((v * l) <= (-5d+195)) then
tmp = (c0 * (t_0 / sqrt(-v))) / sqrt(l)
else if ((v * l) <= (-2d-315)) then
tmp = c0 * (t_0 / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 * ((1.0d0 / sqrt(l)) * sqrt((a / v)))
else if ((v * l) <= 5d+296) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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 = Math.sqrt(-A);
double tmp;
if ((V * l) <= -5e+195) {
tmp = (c0 * (t_0 / Math.sqrt(-V))) / Math.sqrt(l);
} else if ((V * l) <= -2e-315) {
tmp = c0 * (t_0 / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * ((1.0 / Math.sqrt(l)) * Math.sqrt((A / V)));
} else if ((V * l) <= 5e+296) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} 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 = math.sqrt(-A) tmp = 0 if (V * l) <= -5e+195: tmp = (c0 * (t_0 / math.sqrt(-V))) / math.sqrt(l) elif (V * l) <= -2e-315: tmp = c0 * (t_0 / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 * ((1.0 / math.sqrt(l)) * math.sqrt((A / V))) elif (V * l) <= 5e+296: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) 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 = sqrt(Float64(-A)) tmp = 0.0 if (Float64(V * l) <= -5e+195) tmp = Float64(Float64(c0 * Float64(t_0 / sqrt(Float64(-V)))) / sqrt(l)); elseif (Float64(V * l) <= -2e-315) tmp = Float64(c0 * Float64(t_0 / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(Float64(1.0 / sqrt(l)) * sqrt(Float64(A / V)))); elseif (Float64(V * l) <= 5e+296) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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 = sqrt(-A);
tmp = 0.0;
if ((V * l) <= -5e+195)
tmp = (c0 * (t_0 / sqrt(-V))) / sqrt(l);
elseif ((V * l) <= -2e-315)
tmp = c0 * (t_0 / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 * ((1.0 / sqrt(l)) * sqrt((A / V)));
elseif ((V * l) <= 5e+296)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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[Sqrt[(-A)], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+195], N[(N[(c0 * N[(t$95$0 / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-315], N[(c0 * N[(t$95$0 / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+296], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 := \sqrt{-A}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+195}:\\
\;\;\;\;\frac{c0 \cdot \frac{t_0}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-315}:\\
\;\;\;\;c0 \cdot \frac{t_0}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \left(\frac{1}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+296}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999998e195Initial program 51.7%
*-commutative51.7%
associate-/r*74.3%
sqrt-div31.7%
associate-*l/31.8%
Applied egg-rr31.8%
frac-2neg31.8%
sqrt-div41.1%
Applied egg-rr41.1%
if -4.9999999999999998e195 < (*.f64 V l) < -2.0000000019e-315Initial program 86.7%
frac-2neg86.7%
sqrt-div98.4%
distribute-rgt-neg-in98.4%
Applied egg-rr98.4%
distribute-rgt-neg-out98.4%
*-commutative98.4%
distribute-rgt-neg-in98.4%
Simplified98.4%
if -2.0000000019e-315 < (*.f64 V l) < 0.0Initial program 31.1%
associate-/r*55.1%
sqrt-div46.7%
div-inv46.8%
Applied egg-rr46.8%
if 0.0 < (*.f64 V l) < 5.0000000000000001e296Initial program 89.7%
sqrt-div99.4%
associate-*r/95.2%
Applied egg-rr95.2%
*-commutative95.2%
associate-/l*96.7%
associate-/r/99.4%
Simplified99.4%
if 5.0000000000000001e296 < (*.f64 V l) Initial program 41.4%
*-commutative41.4%
associate-/l/69.9%
Simplified69.9%
Final simplification84.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 (* c0 (sqrt (/ A (* V l))))))
(if (or (<= t_0 0.0) (not (<= t_0 2e+296)))
(* c0 (sqrt (/ (/ A V) l)))
t_0)))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 2e+296)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 2d+296))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 2e+296)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 2e+296): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 2e+296)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 2e+296)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 2e+296]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 2 \cdot 10^{+296}\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 1.99999999999999996e296 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 66.7%
*-commutative66.7%
associate-/l/75.1%
Simplified75.1%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999996e296Initial program 98.4%
Final simplification80.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 1e-259) (not (<= t_0 2e+285)))
(/ c0 (sqrt (* V (/ l A))))
t_0)))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 1e-259) || !(t_0 <= 2e+285)) {
tmp = c0 / sqrt((V * (l / A)));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if ((t_0 <= 1d-259) .or. (.not. (t_0 <= 2d+285))) then
tmp = c0 / sqrt((v * (l / a)))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 1e-259) || !(t_0 <= 2e+285)) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 1e-259) or not (t_0 <= 2e+285): tmp = c0 / math.sqrt((V * (l / A))) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 1e-259) || !(t_0 <= 2e+285)) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 1e-259) || ~((t_0 <= 2e+285)))
tmp = c0 / sqrt((V * (l / A)));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 1e-259], N[Not[LessEqual[t$95$0, 2e+285]], $MachinePrecision]], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq 10^{-259} \lor \neg \left(t_0 \leq 2 \cdot 10^{+285}\right):\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.0000000000000001e-259 or 2e285 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 67.3%
associate-/r*75.5%
clear-num75.2%
sqrt-div75.5%
metadata-eval75.5%
div-inv75.4%
clear-num75.5%
Applied egg-rr75.5%
un-div-inv75.7%
associate-*r/67.0%
Applied egg-rr67.0%
associate-*l/71.9%
Simplified71.9%
if 1.0000000000000001e-259 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2e285Initial program 98.3%
Final simplification77.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (or (<= t_0 1e-259) (not (<= t_0 2e+285)))
(/ c0 (sqrt (/ V (/ A 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 <= 1e-259) || !(t_0 <= 2e+285)) {
tmp = c0 / sqrt((V / (A / 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 <= 1d-259) .or. (.not. (t_0 <= 2d+285))) then
tmp = c0 / sqrt((v / (a / 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 <= 1e-259) || !(t_0 <= 2e+285)) {
tmp = c0 / Math.sqrt((V / (A / 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 <= 1e-259) or not (t_0 <= 2e+285): tmp = c0 / math.sqrt((V / (A / 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 <= 1e-259) || !(t_0 <= 2e+285)) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / 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 <= 1e-259) || ~((t_0 <= 2e+285)))
tmp = c0 / sqrt((V / (A / 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, 1e-259], N[Not[LessEqual[t$95$0, 2e+285]], $MachinePrecision]], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq 10^{-259} \lor \neg \left(t_0 \leq 2 \cdot 10^{+285}\right):\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.0000000000000001e-259 or 2e285 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 67.3%
associate-/r*75.5%
clear-num75.2%
sqrt-div75.5%
metadata-eval75.5%
div-inv75.4%
clear-num75.5%
Applied egg-rr75.5%
un-div-inv75.7%
associate-*r/67.0%
Applied egg-rr67.0%
associate-*l/71.9%
Simplified71.9%
*-commutative71.9%
clear-num71.0%
un-div-inv71.2%
Applied egg-rr71.2%
if 1.0000000000000001e-259 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2e285Initial program 98.3%
Final simplification76.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-271)
(* c0 (pow (* V (/ l A)) -0.5))
(if (<= t_0 2e+285) t_0 (/ c0 (sqrt (/ V (/ A l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-271) {
tmp = c0 * pow((V * (l / A)), -0.5);
} else if (t_0 <= 2e+285) {
tmp = t_0;
} else {
tmp = c0 / sqrt((V / (A / l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 4d-271) then
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
else if (t_0 <= 2d+285) then
tmp = t_0
else
tmp = c0 / sqrt((v / (a / l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-271) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} else if (t_0 <= 2e+285) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 4e-271: tmp = c0 * math.pow((V * (l / A)), -0.5) elif t_0 <= 2e+285: tmp = t_0 else: tmp = c0 / math.sqrt((V / (A / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 4e-271) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); elseif (t_0 <= 2e+285) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 4e-271)
tmp = c0 * ((V * (l / A)) ^ -0.5);
elseif (t_0 <= 2e+285)
tmp = t_0;
else
tmp = c0 / sqrt((V / (A / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-271], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+285], t$95$0, N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq 4 \cdot 10^{-271}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+285}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999985e-271Initial program 69.4%
associate-/r*78.4%
clear-num77.9%
sqrt-div78.3%
metadata-eval78.3%
div-inv78.3%
clear-num78.3%
Applied egg-rr78.3%
inv-pow78.3%
sqrt-pow278.4%
associate-*r/69.0%
metadata-eval69.0%
Applied egg-rr69.0%
associate-*l/74.2%
Simplified74.2%
if 3.99999999999999985e-271 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2e285Initial program 98.3%
if 2e285 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 51.9%
associate-/r*55.7%
clear-num55.8%
sqrt-div55.7%
metadata-eval55.7%
div-inv55.7%
clear-num55.7%
Applied egg-rr55.7%
un-div-inv55.8%
associate-*r/52.0%
Applied egg-rr52.0%
associate-*l/55.8%
Simplified55.8%
*-commutative55.8%
clear-num55.8%
un-div-inv55.8%
Applied egg-rr55.8%
Final simplification77.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 (<= A -5e-311) (* c0 (* (/ (sqrt (- A)) (sqrt (- V))) (/ 1.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 tmp;
if (A <= -5e-311) {
tmp = c0 * ((sqrt(-A) / sqrt(-V)) * (1.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) :: tmp
if (a <= (-5d-311)) then
tmp = c0 * ((sqrt(-a) / sqrt(-v)) * (1.0d0 / sqrt(l)))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-311) {
tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) * (1.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): tmp = 0 if A <= -5e-311: tmp = c0 * ((math.sqrt(-A) / math.sqrt(-V)) * (1.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) tmp = 0.0 if (A <= -5e-311) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * Float64(1.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)
tmp = 0.0;
if (A <= -5e-311)
tmp = c0 * ((sqrt(-A) / sqrt(-V)) * (1.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_] := If[LessEqual[A, -5e-311], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-311}:\\
\;\;\;\;c0 \cdot \left(\frac{\sqrt{-A}}{\sqrt{-V}} \cdot \frac{1}{\sqrt{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -5.00000000000023e-311Initial program 72.5%
associate-/r*76.1%
sqrt-div43.3%
div-inv43.4%
Applied egg-rr43.4%
frac-2neg40.3%
sqrt-div45.1%
Applied egg-rr48.9%
if -5.00000000000023e-311 < A Initial program 75.0%
sqrt-div82.0%
associate-*r/79.0%
Applied egg-rr79.0%
*-commutative79.0%
associate-/l*80.1%
associate-/r/82.0%
Simplified82.0%
Final simplification66.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 (<= (* V l) (- INFINITY))
t_0
(if (<= (* V l) -2e-121)
(* c0 (sqrt (* A (/ (/ 1.0 V) l))))
(if (<= (* V l) 2e-299)
(* c0 (pow (* V (/ l A)) -0.5))
(if (<= (* V l) 5e+296) (* c0 (/ (sqrt A) (sqrt (* 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 ((V * l) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((V * l) <= -2e-121) {
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 2e-299) {
tmp = c0 * pow((V * (l / A)), -0.5);
} else if ((V * l) <= 5e+296) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = t_0;
}
return tmp;
}
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 ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if ((V * l) <= -2e-121) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 2e-299) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} else if ((V * l) <= 5e+296) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((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 (V * l) <= -math.inf: tmp = t_0 elif (V * l) <= -2e-121: tmp = c0 * math.sqrt((A * ((1.0 / V) / l))) elif (V * l) <= 2e-299: tmp = c0 * math.pow((V * (l / A)), -0.5) elif (V * l) <= 5e+296: tmp = c0 * (math.sqrt(A) / math.sqrt((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(Float64(A / V) / l))) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = t_0; elseif (Float64(V * l) <= -2e-121) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); elseif (Float64(V * l) <= 2e-299) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); elseif (Float64(V * l) <= 5e+296) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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 ((V * l) <= -Inf)
tmp = t_0;
elseif ((V * l) <= -2e-121)
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
elseif ((V * l) <= 2e-299)
tmp = c0 * ((V * (l / A)) ^ -0.5);
elseif ((V * l) <= 5e+296)
tmp = c0 * (sqrt(A) / sqrt((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[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-121], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-299], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+296], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-121}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-299}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+296}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or 5.0000000000000001e296 < (*.f64 V l) Initial program 38.1%
*-commutative38.1%
associate-/l/68.8%
Simplified68.8%
if -inf.0 < (*.f64 V l) < -2e-121Initial program 90.7%
clear-num90.0%
associate-/r/90.8%
associate-/r*90.8%
Applied egg-rr90.8%
if -2e-121 < (*.f64 V l) < 1.99999999999999998e-299Initial program 55.4%
associate-/r*66.0%
clear-num66.0%
sqrt-div67.4%
metadata-eval67.4%
div-inv67.3%
clear-num67.4%
Applied egg-rr67.4%
inv-pow67.4%
sqrt-pow267.5%
associate-*r/55.4%
metadata-eval55.4%
Applied egg-rr55.4%
associate-*l/69.1%
Simplified69.1%
if 1.99999999999999998e-299 < (*.f64 V l) < 5.0000000000000001e296Initial program 89.4%
sqrt-div99.4%
associate-*r/96.8%
Applied egg-rr96.8%
*-commutative96.8%
associate-/l*96.6%
associate-/r/99.4%
Simplified99.4%
Final simplification85.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) -3e+151)
t_0
(if (<= (* V l) -1e-305)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 5e+296)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* 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)) / sqrt(l));
double tmp;
if ((V * l) <= -3e+151) {
tmp = t_0;
} else if ((V * l) <= -1e-305) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 5e+296) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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)) / sqrt(l))
if ((v * l) <= (-3d+151)) then
tmp = t_0
else if ((v * l) <= (-1d-305)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 5d+296) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -3e+151) {
tmp = t_0;
} else if ((V * l) <= -1e-305) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 5e+296) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} 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)) / math.sqrt(l)) tmp = 0 if (V * l) <= -3e+151: tmp = t_0 elif (V * l) <= -1e-305: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 5e+296: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) 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 * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -3e+151) tmp = t_0; elseif (Float64(V * l) <= -1e-305) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 5e+296) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -3e+151)
tmp = t_0;
elseif ((V * l) <= -1e-305)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 5e+296)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -3e+151], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-305], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 5e+296], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -3 \cdot 10^{+151}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-305}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+296}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.9999999999999999e151 or -9.99999999999999996e-306 < (*.f64 V l) < 0.0Initial program 45.1%
associate-/r*63.4%
sqrt-div36.1%
associate-*r/34.8%
Applied egg-rr34.8%
*-commutative34.8%
associate-/l*34.2%
associate-/r/36.1%
Simplified36.1%
if -2.9999999999999999e151 < (*.f64 V l) < -9.99999999999999996e-306Initial program 90.2%
if 0.0 < (*.f64 V l) < 5.0000000000000001e296Initial program 89.7%
sqrt-div99.4%
associate-*r/95.2%
Applied egg-rr95.2%
*-commutative95.2%
associate-/l*96.7%
associate-/r/99.4%
Simplified99.4%
if 5.0000000000000001e296 < (*.f64 V l) Initial program 41.4%
*-commutative41.4%
associate-/l/69.9%
Simplified69.9%
Final simplification77.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 (sqrt (/ A V))))
(if (<= (* V l) -3e+151)
(/ (* c0 t_0) (sqrt l))
(if (<= (* V l) -1e-305)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(* c0 (/ t_0 (sqrt l)))
(if (<= (* V l) 5e+296)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* 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 = sqrt((A / V));
double tmp;
if ((V * l) <= -3e+151) {
tmp = (c0 * t_0) / sqrt(l);
} else if ((V * l) <= -1e-305) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (t_0 / sqrt(l));
} else if ((V * l) <= 5e+296) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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 = sqrt((a / v))
if ((v * l) <= (-3d+151)) then
tmp = (c0 * t_0) / sqrt(l)
else if ((v * l) <= (-1d-305)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 * (t_0 / sqrt(l))
else if ((v * l) <= 5d+296) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -3e+151) {
tmp = (c0 * t_0) / Math.sqrt(l);
} else if ((V * l) <= -1e-305) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (t_0 / Math.sqrt(l));
} else if ((V * l) <= 5e+296) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} 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 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -3e+151: tmp = (c0 * t_0) / math.sqrt(l) elif (V * l) <= -1e-305: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = c0 * (t_0 / math.sqrt(l)) elif (V * l) <= 5e+296: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) 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 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -3e+151) tmp = Float64(Float64(c0 * t_0) / sqrt(l)); elseif (Float64(V * l) <= -1e-305) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(t_0 / sqrt(l))); elseif (Float64(V * l) <= 5e+296) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -3e+151)
tmp = (c0 * t_0) / sqrt(l);
elseif ((V * l) <= -1e-305)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 * (t_0 / sqrt(l));
elseif ((V * l) <= 5e+296)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -3e+151], N[(N[(c0 * t$95$0), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-305], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+296], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -3 \cdot 10^{+151}:\\
\;\;\;\;\frac{c0 \cdot t_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-305}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{t_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+296}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.9999999999999999e151Initial program 58.4%
*-commutative58.4%
associate-/r*73.9%
sqrt-div28.3%
associate-*l/28.4%
Applied egg-rr28.4%
if -2.9999999999999999e151 < (*.f64 V l) < -9.99999999999999996e-306Initial program 90.2%
if -9.99999999999999996e-306 < (*.f64 V l) < 0.0Initial program 31.1%
associate-/r*52.3%
sqrt-div44.4%
associate-*r/41.7%
Applied egg-rr41.7%
*-commutative41.7%
associate-/l*43.2%
associate-/r/44.4%
Simplified44.4%
if 0.0 < (*.f64 V l) < 5.0000000000000001e296Initial program 89.7%
sqrt-div99.4%
associate-*r/95.2%
Applied egg-rr95.2%
*-commutative95.2%
associate-/l*96.7%
associate-/r/99.4%
Simplified99.4%
if 5.0000000000000001e296 < (*.f64 V l) Initial program 41.4%
*-commutative41.4%
associate-/l/69.9%
Simplified69.9%
Final simplification77.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 (sqrt (/ A V))))
(if (<= (* V l) -3e+151)
(/ (* c0 t_0) (sqrt l))
(if (<= (* V l) -1e-305)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(* c0 (* (/ 1.0 (sqrt l)) t_0))
(if (<= (* V l) 5e+296)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* 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 = sqrt((A / V));
double tmp;
if ((V * l) <= -3e+151) {
tmp = (c0 * t_0) / sqrt(l);
} else if ((V * l) <= -1e-305) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * ((1.0 / sqrt(l)) * t_0);
} else if ((V * l) <= 5e+296) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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 = sqrt((a / v))
if ((v * l) <= (-3d+151)) then
tmp = (c0 * t_0) / sqrt(l)
else if ((v * l) <= (-1d-305)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 * ((1.0d0 / sqrt(l)) * t_0)
else if ((v * l) <= 5d+296) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -3e+151) {
tmp = (c0 * t_0) / Math.sqrt(l);
} else if ((V * l) <= -1e-305) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * ((1.0 / Math.sqrt(l)) * t_0);
} else if ((V * l) <= 5e+296) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} 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 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -3e+151: tmp = (c0 * t_0) / math.sqrt(l) elif (V * l) <= -1e-305: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = c0 * ((1.0 / math.sqrt(l)) * t_0) elif (V * l) <= 5e+296: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) 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 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -3e+151) tmp = Float64(Float64(c0 * t_0) / sqrt(l)); elseif (Float64(V * l) <= -1e-305) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(Float64(1.0 / sqrt(l)) * t_0)); elseif (Float64(V * l) <= 5e+296) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -3e+151)
tmp = (c0 * t_0) / sqrt(l);
elseif ((V * l) <= -1e-305)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 * ((1.0 / sqrt(l)) * t_0);
elseif ((V * l) <= 5e+296)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -3e+151], N[(N[(c0 * t$95$0), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-305], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+296], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -3 \cdot 10^{+151}:\\
\;\;\;\;\frac{c0 \cdot t_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-305}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \left(\frac{1}{\sqrt{\ell}} \cdot t_0\right)\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+296}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.9999999999999999e151Initial program 58.4%
*-commutative58.4%
associate-/r*73.9%
sqrt-div28.3%
associate-*l/28.4%
Applied egg-rr28.4%
if -2.9999999999999999e151 < (*.f64 V l) < -9.99999999999999996e-306Initial program 90.2%
if -9.99999999999999996e-306 < (*.f64 V l) < 0.0Initial program 31.1%
associate-/r*52.3%
sqrt-div44.4%
div-inv44.5%
Applied egg-rr44.5%
if 0.0 < (*.f64 V l) < 5.0000000000000001e296Initial program 89.7%
sqrt-div99.4%
associate-*r/95.2%
Applied egg-rr95.2%
*-commutative95.2%
associate-/l*96.7%
associate-/r/99.4%
Simplified99.4%
if 5.0000000000000001e296 < (*.f64 V l) Initial program 41.4%
*-commutative41.4%
associate-/l/69.9%
Simplified69.9%
Final simplification77.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -1e+307)
(/ (/ c0 (sqrt l)) (sqrt (/ V A)))
(if (<= (* V l) -2e-315)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0 (* (/ 1.0 (sqrt l)) (sqrt (/ A V))))
(if (<= (* V l) 5e+296)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A 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+307) {
tmp = (c0 / sqrt(l)) / sqrt((V / A));
} else if ((V * l) <= -2e-315) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * ((1.0 / sqrt(l)) * sqrt((A / V)));
} else if ((V * l) <= 5e+296) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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) :: tmp
if ((v * l) <= (-1d+307)) then
tmp = (c0 / sqrt(l)) / sqrt((v / a))
else if ((v * l) <= (-2d-315)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 * ((1.0d0 / sqrt(l)) * sqrt((a / v)))
else if ((v * l) <= 5d+296) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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 tmp;
if ((V * l) <= -1e+307) {
tmp = (c0 / Math.sqrt(l)) / Math.sqrt((V / A));
} else if ((V * l) <= -2e-315) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * ((1.0 / Math.sqrt(l)) * Math.sqrt((A / V)));
} else if ((V * l) <= 5e+296) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} 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): tmp = 0 if (V * l) <= -1e+307: tmp = (c0 / math.sqrt(l)) / math.sqrt((V / A)) elif (V * l) <= -2e-315: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 * ((1.0 / math.sqrt(l)) * math.sqrt((A / V))) elif (V * l) <= 5e+296: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) 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) tmp = 0.0 if (Float64(V * l) <= -1e+307) tmp = Float64(Float64(c0 / sqrt(l)) / sqrt(Float64(V / A))); elseif (Float64(V * l) <= -2e-315) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(Float64(1.0 / sqrt(l)) * sqrt(Float64(A / V)))); elseif (Float64(V * l) <= 5e+296) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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)
tmp = 0.0;
if ((V * l) <= -1e+307)
tmp = (c0 / sqrt(l)) / sqrt((V / A));
elseif ((V * l) <= -2e-315)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 * ((1.0 / sqrt(l)) * sqrt((A / V)));
elseif ((V * l) <= 5e+296)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+307], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-315], 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[(N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+296], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+307}:\\
\;\;\;\;\frac{\frac{c0}{\sqrt{\ell}}}{\sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-315}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \left(\frac{1}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+296}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999986e306Initial program 38.0%
associate-/r*69.3%
clear-num69.2%
sqrt-div69.1%
metadata-eval69.1%
div-inv69.1%
clear-num69.0%
Applied egg-rr69.0%
un-div-inv69.3%
sqrt-prod29.8%
associate-/r*29.7%
Applied egg-rr29.7%
if -9.99999999999999986e306 < (*.f64 V l) < -2.0000000019e-315Initial program 86.8%
frac-2neg86.8%
sqrt-div98.5%
distribute-rgt-neg-in98.5%
Applied egg-rr98.5%
distribute-rgt-neg-out98.5%
*-commutative98.5%
distribute-rgt-neg-in98.5%
Simplified98.5%
if -2.0000000019e-315 < (*.f64 V l) < 0.0Initial program 31.1%
associate-/r*55.1%
sqrt-div46.7%
div-inv46.8%
Applied egg-rr46.8%
if 0.0 < (*.f64 V l) < 5.0000000000000001e296Initial program 89.7%
sqrt-div99.4%
associate-*r/95.2%
Applied egg-rr95.2%
*-commutative95.2%
associate-/l*96.7%
associate-/r/99.4%
Simplified99.4%
if 5.0000000000000001e296 < (*.f64 V l) Initial program 41.4%
*-commutative41.4%
associate-/l/69.9%
Simplified69.9%
Final simplification84.9%
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 73.9%
Final simplification73.9%
herbie shell --seed 2024011
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))