
(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 11 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 (<= (* l V) -4e-179)
(* c0 (/ (sqrt (- A)) (sqrt (* l (- V)))))
(if (<= (* l V) 4e-322)
(* c0 (* (sqrt (/ A V)) (sqrt (/ 1.0 l))))
(if (<= (* l V) 2e+282)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -4e-179) {
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
} else if ((l * V) <= 4e-322) {
tmp = c0 * (sqrt((A / V)) * sqrt((1.0 / l)));
} else if ((l * V) <= 2e+282) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} 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) :: tmp
if ((l * v) <= (-4d-179)) then
tmp = c0 * (sqrt(-a) / sqrt((l * -v)))
else if ((l * v) <= 4d-322) then
tmp = c0 * (sqrt((a / v)) * sqrt((1.0d0 / l)))
else if ((l * v) <= 2d+282) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
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 tmp;
if ((l * V) <= -4e-179) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((l * -V)));
} else if ((l * V) <= 4e-322) {
tmp = c0 * (Math.sqrt((A / V)) * Math.sqrt((1.0 / l)));
} else if ((l * V) <= 2e+282) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} 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): tmp = 0 if (l * V) <= -4e-179: tmp = c0 * (math.sqrt(-A) / math.sqrt((l * -V))) elif (l * V) <= 4e-322: tmp = c0 * (math.sqrt((A / V)) * math.sqrt((1.0 / l))) elif (l * V) <= 2e+282: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) 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) tmp = 0.0 if (Float64(l * V) <= -4e-179) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V))))); elseif (Float64(l * V) <= 4e-322) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) * sqrt(Float64(1.0 / l)))); elseif (Float64(l * V) <= 2e+282) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); 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)
tmp = 0.0;
if ((l * V) <= -4e-179)
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
elseif ((l * V) <= 4e-322)
tmp = c0 * (sqrt((A / V)) * sqrt((1.0 / l)));
elseif ((l * V) <= 2e+282)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
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_] := If[LessEqual[N[(l * V), $MachinePrecision], -4e-179], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 4e-322], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 2e+282], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;\ell \cdot V \leq -4 \cdot 10^{-179}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\
\mathbf{elif}\;\ell \cdot V \leq 4 \cdot 10^{-322}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot \sqrt{\frac{1}{\ell}}\right)\\
\mathbf{elif}\;\ell \cdot V \leq 2 \cdot 10^{+282}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.0000000000000001e-179Initial program 83.3%
frac-2neg83.3%
sqrt-div94.4%
distribute-rgt-neg-in94.4%
Applied egg-rr94.4%
distribute-rgt-neg-out94.4%
*-commutative94.4%
distribute-rgt-neg-in94.4%
Simplified94.4%
if -4.0000000000000001e-179 < (*.f64 V l) < 4.00193e-322Initial program 55.6%
pow1/255.6%
associate-/r*68.1%
div-inv68.1%
unpow-prod-down48.3%
pow1/248.3%
Applied egg-rr48.3%
unpow1/248.3%
Simplified48.3%
if 4.00193e-322 < (*.f64 V l) < 2.00000000000000007e282Initial program 78.7%
sqrt-div98.6%
div-inv98.5%
Applied egg-rr98.5%
associate-*r/98.6%
*-rgt-identity98.6%
Simplified98.6%
if 2.00000000000000007e282 < (*.f64 V l) Initial program 39.1%
*-commutative39.1%
sqrt-div39.0%
associate-*l/38.8%
Applied egg-rr38.8%
associate-*l/39.0%
sqrt-div39.1%
add-sqr-sqrt39.0%
associate-*l*39.0%
pow1/239.0%
sqrt-pow139.0%
metadata-eval39.0%
pow1/239.0%
sqrt-pow139.0%
metadata-eval39.0%
Applied egg-rr39.0%
associate-*r*39.0%
associate-/l/39.0%
associate-/l/64.8%
pow-prod-up65.0%
metadata-eval65.0%
pow1/265.0%
associate-/l/39.1%
sqrt-undiv39.0%
clear-num39.0%
associate-*l/39.0%
*-un-lft-identity39.0%
sqrt-undiv39.1%
associate-/l*65.1%
Applied egg-rr65.1%
Final simplification84.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* l V))))))
(if (<= t_0 1e-248)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 4e+264) t_0 (* c0 (/ 1.0 (sqrt (* V (/ l A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (l * V)));
double tmp;
if (t_0 <= 1e-248) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 4e+264) {
tmp = t_0;
} else {
tmp = c0 * (1.0 / sqrt((V * (l / A))));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (l * v)))
if (t_0 <= 1d-248) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 4d+264) then
tmp = t_0
else
tmp = c0 * (1.0d0 / sqrt((v * (l / a))))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (l * V)));
double tmp;
if (t_0 <= 1e-248) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 4e+264) {
tmp = t_0;
} else {
tmp = c0 * (1.0 / Math.sqrt((V * (l / A))));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (l * V))) tmp = 0 if t_0 <= 1e-248: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 4e+264: tmp = t_0 else: tmp = c0 * (1.0 / math.sqrt((V * (l / A)))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(l * V)))) tmp = 0.0 if (t_0 <= 1e-248) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 4e+264) tmp = t_0; else tmp = Float64(c0 * Float64(1.0 / sqrt(Float64(V * Float64(l / A))))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (l * V)));
tmp = 0.0;
if (t_0 <= 1e-248)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 4e+264)
tmp = t_0;
else
tmp = c0 * (1.0 / sqrt((V * (l / A))));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-248], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+264], t$95$0, N[(c0 * N[(1.0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 10^{-248}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+264}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999998e-249Initial program 68.3%
*-commutative68.3%
associate-/l/71.4%
Simplified71.4%
if 9.9999999999999998e-249 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.00000000000000018e264Initial program 99.0%
if 4.00000000000000018e264 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 39.4%
associate-/r*39.4%
clear-num39.4%
sqrt-div42.6%
metadata-eval42.6%
div-inv42.6%
clear-num42.6%
Applied egg-rr42.6%
*-commutative42.6%
associate-*l/42.6%
associate-/l*39.4%
Simplified39.4%
Final simplification74.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* l V))))))
(if (or (<= t_0 1e-248) (not (<= t_0 2e+232)))
(* 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 / (l * V)));
double tmp;
if ((t_0 <= 1e-248) || !(t_0 <= 2e+232)) {
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 / (l * v)))
if ((t_0 <= 1d-248) .or. (.not. (t_0 <= 2d+232))) 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 / (l * V)));
double tmp;
if ((t_0 <= 1e-248) || !(t_0 <= 2e+232)) {
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 / (l * V))) tmp = 0 if (t_0 <= 1e-248) or not (t_0 <= 2e+232): 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(l * V)))) tmp = 0.0 if ((t_0 <= 1e-248) || !(t_0 <= 2e+232)) 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 / (l * V)));
tmp = 0.0;
if ((t_0 <= 1e-248) || ~((t_0 <= 2e+232)))
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[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 1e-248], N[Not[LessEqual[t$95$0, 2e+232]], $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}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 10^{-248} \lor \neg \left(t\_0 \leq 2 \cdot 10^{+232}\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)))) < 9.9999999999999998e-249 or 2.00000000000000011e232 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 65.2%
*-commutative65.2%
associate-/l/67.3%
Simplified67.3%
if 9.9999999999999998e-249 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000011e232Initial program 98.9%
Final simplification74.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* l V))))))
(if (<= t_0 1e-248)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 4e+264) 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 = c0 * sqrt((A / (l * V)));
double tmp;
if (t_0 <= 1e-248) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 4e+264) {
tmp = 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 = c0 * sqrt((a / (l * v)))
if (t_0 <= 1d-248) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 4d+264) then
tmp = 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 = c0 * Math.sqrt((A / (l * V)));
double tmp;
if (t_0 <= 1e-248) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 4e+264) {
tmp = 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 = c0 * math.sqrt((A / (l * V))) tmp = 0 if t_0 <= 1e-248: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 4e+264: tmp = 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(c0 * sqrt(Float64(A / Float64(l * V)))) tmp = 0.0 if (t_0 <= 1e-248) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 4e+264) tmp = 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 = c0 * sqrt((A / (l * V)));
tmp = 0.0;
if (t_0 <= 1e-248)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 4e+264)
tmp = 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[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-248], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+264], t$95$0, 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 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 10^{-248}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+264}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999998e-249Initial program 68.3%
*-commutative68.3%
associate-/l/71.4%
Simplified71.4%
if 9.9999999999999998e-249 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.00000000000000018e264Initial program 99.0%
if 4.00000000000000018e264 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 39.4%
*-commutative39.4%
sqrt-div22.2%
associate-*l/22.1%
Applied egg-rr22.1%
associate-*l/22.2%
sqrt-div39.4%
add-sqr-sqrt39.4%
associate-*l*39.4%
pow1/239.4%
sqrt-pow139.4%
metadata-eval39.4%
pow1/239.4%
sqrt-pow139.4%
metadata-eval39.4%
Applied egg-rr39.4%
associate-*r*39.4%
associate-/l/39.4%
associate-/l/39.4%
pow-prod-up39.4%
metadata-eval39.4%
pow1/239.4%
associate-/l/39.4%
sqrt-undiv22.2%
clear-num22.2%
associate-*l/22.2%
*-un-lft-identity22.2%
sqrt-undiv42.6%
associate-/l*39.4%
Applied egg-rr39.4%
Final simplification74.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 -1e-309) (* c0 (* (pow l -0.5) (/ (sqrt (- A)) (sqrt (- V))))) (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-309) {
tmp = c0 * (pow(l, -0.5) * (sqrt(-A) / sqrt(-V)));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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 <= (-1d-309)) then
tmp = c0 * ((l ** (-0.5d0)) * (sqrt(-a) / sqrt(-v)))
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / 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 <= -1e-309) {
tmp = c0 * (Math.pow(l, -0.5) * (Math.sqrt(-A) / Math.sqrt(-V)));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -1e-309: tmp = c0 * (math.pow(l, -0.5) * (math.sqrt(-A) / math.sqrt(-V))) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -1e-309) tmp = Float64(c0 * Float64((l ^ -0.5) * Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / 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 <= -1e-309)
tmp = c0 * ((l ^ -0.5) * (sqrt(-A) / sqrt(-V)));
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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, -1e-309], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / 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 -1 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot \frac{\sqrt{-A}}{\sqrt{-V}}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if A < -1.000000000000002e-309Initial program 79.0%
*-un-lft-identity79.0%
times-frac76.3%
Applied egg-rr76.3%
pow1/276.3%
*-commutative76.3%
associate-*l/74.4%
associate-*r/78.7%
un-div-inv78.7%
associate-*r*74.3%
unpow-prod-down45.4%
div-inv45.4%
pow1/245.4%
inv-pow45.4%
sqrt-pow145.4%
metadata-eval45.4%
Applied egg-rr45.4%
unpow1/245.4%
*-commutative45.4%
Simplified45.4%
frac-2neg45.4%
sqrt-div52.4%
Applied egg-rr52.4%
if -1.000000000000002e-309 < A Initial program 66.2%
pow1/266.2%
div-inv65.4%
unpow-prod-down79.2%
pow1/279.2%
associate-/r*80.7%
Applied egg-rr80.7%
unpow1/280.7%
Simplified80.7%
Final simplification66.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 (<= (* l V) -2e-177)
(* c0 (sqrt (* A (/ (/ 1.0 l) V))))
(if (<= (* l V) 4e-322)
(* c0 (/ 1.0 (sqrt (* l (/ V A)))))
(if (<= (* l V) 2e+282)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -2e-177) {
tmp = c0 * sqrt((A * ((1.0 / l) / V)));
} else if ((l * V) <= 4e-322) {
tmp = c0 * (1.0 / sqrt((l * (V / A))));
} else if ((l * V) <= 2e+282) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} 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) :: tmp
if ((l * v) <= (-2d-177)) then
tmp = c0 * sqrt((a * ((1.0d0 / l) / v)))
else if ((l * v) <= 4d-322) then
tmp = c0 * (1.0d0 / sqrt((l * (v / a))))
else if ((l * v) <= 2d+282) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
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 tmp;
if ((l * V) <= -2e-177) {
tmp = c0 * Math.sqrt((A * ((1.0 / l) / V)));
} else if ((l * V) <= 4e-322) {
tmp = c0 * (1.0 / Math.sqrt((l * (V / A))));
} else if ((l * V) <= 2e+282) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} 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): tmp = 0 if (l * V) <= -2e-177: tmp = c0 * math.sqrt((A * ((1.0 / l) / V))) elif (l * V) <= 4e-322: tmp = c0 * (1.0 / math.sqrt((l * (V / A)))) elif (l * V) <= 2e+282: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) 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) tmp = 0.0 if (Float64(l * V) <= -2e-177) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / l) / V)))); elseif (Float64(l * V) <= 4e-322) tmp = Float64(c0 * Float64(1.0 / sqrt(Float64(l * Float64(V / A))))); elseif (Float64(l * V) <= 2e+282) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); 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)
tmp = 0.0;
if ((l * V) <= -2e-177)
tmp = c0 * sqrt((A * ((1.0 / l) / V)));
elseif ((l * V) <= 4e-322)
tmp = c0 * (1.0 / sqrt((l * (V / A))));
elseif ((l * V) <= 2e+282)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
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_] := If[LessEqual[N[(l * V), $MachinePrecision], -2e-177], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / l), $MachinePrecision] / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 4e-322], N[(c0 * N[(1.0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 2e+282], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;\ell \cdot V \leq -2 \cdot 10^{-177}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{\ell}}{V}}\\
\mathbf{elif}\;\ell \cdot V \leq 4 \cdot 10^{-322}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq 2 \cdot 10^{+282}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.9999999999999999e-177Initial program 84.2%
associate-/r*74.2%
div-inv74.1%
div-inv74.1%
associate-*l*84.1%
Applied egg-rr84.1%
associate-*l/84.1%
*-un-lft-identity84.1%
Applied egg-rr84.1%
if -1.9999999999999999e-177 < (*.f64 V l) < 4.00193e-322Initial program 54.5%
associate-/r*66.8%
clear-num66.7%
sqrt-div66.7%
metadata-eval66.7%
div-inv66.7%
clear-num66.7%
Applied egg-rr66.7%
if 4.00193e-322 < (*.f64 V l) < 2.00000000000000007e282Initial program 78.7%
sqrt-div98.6%
div-inv98.5%
Applied egg-rr98.5%
associate-*r/98.6%
*-rgt-identity98.6%
Simplified98.6%
if 2.00000000000000007e282 < (*.f64 V l) Initial program 39.1%
*-commutative39.1%
sqrt-div39.0%
associate-*l/38.8%
Applied egg-rr38.8%
associate-*l/39.0%
sqrt-div39.1%
add-sqr-sqrt39.0%
associate-*l*39.0%
pow1/239.0%
sqrt-pow139.0%
metadata-eval39.0%
pow1/239.0%
sqrt-pow139.0%
metadata-eval39.0%
Applied egg-rr39.0%
associate-*r*39.0%
associate-/l/39.0%
associate-/l/64.8%
pow-prod-up65.0%
metadata-eval65.0%
pow1/265.0%
associate-/l/39.1%
sqrt-undiv39.0%
clear-num39.0%
associate-*l/39.0%
*-un-lft-identity39.0%
sqrt-undiv39.1%
associate-/l*65.1%
Applied egg-rr65.1%
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 (<= l -5e-310) (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l)))) (* c0 (* (pow l -0.5) (sqrt (/ A V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
} else {
tmp = c0 * (pow(l, -0.5) * sqrt((A / V)));
}
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 (l <= (-5d-310)) then
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / v) / l)))
else
tmp = c0 * ((l ** (-0.5d0)) * sqrt((a / v)))
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 (l <= -5e-310) {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
} else {
tmp = c0 * (Math.pow(l, -0.5) * Math.sqrt((A / V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) else: tmp = c0 * (math.pow(l, -0.5) * math.sqrt((A / V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); else tmp = Float64(c0 * Float64((l ^ -0.5) * sqrt(Float64(A / V)))); 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 (l <= -5e-310)
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
else
tmp = c0 * ((l ^ -0.5) * sqrt((A / V)));
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[l, -5e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{A}{V}}\right)\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 74.4%
pow1/274.4%
div-inv74.4%
unpow-prod-down40.5%
pow1/240.5%
associate-/r*41.4%
Applied egg-rr41.4%
unpow1/241.4%
Simplified41.4%
if -4.999999999999985e-310 < l Initial program 71.2%
*-un-lft-identity71.2%
times-frac70.6%
Applied egg-rr70.6%
pow1/270.6%
*-commutative70.6%
associate-*l/71.7%
associate-*r/70.1%
un-div-inv70.1%
associate-*r*71.5%
unpow-prod-down81.8%
div-inv81.8%
pow1/281.8%
inv-pow81.8%
sqrt-pow181.8%
metadata-eval81.8%
Applied egg-rr81.8%
unpow1/281.8%
*-commutative81.8%
Simplified81.8%
Final simplification63.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -5e-310) (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l)))) (* c0 (* (sqrt (/ A V)) (sqrt (/ 1.0 l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
} else {
tmp = c0 * (sqrt((A / V)) * sqrt((1.0 / 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 (l <= (-5d-310)) then
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / v) / l)))
else
tmp = c0 * (sqrt((a / v)) * sqrt((1.0d0 / 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 (l <= -5e-310) {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
} else {
tmp = c0 * (Math.sqrt((A / V)) * Math.sqrt((1.0 / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) else: tmp = c0 * (math.sqrt((A / V)) * math.sqrt((1.0 / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) * sqrt(Float64(1.0 / 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 (l <= -5e-310)
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
else
tmp = c0 * (sqrt((A / V)) * sqrt((1.0 / 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[l, -5e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot \sqrt{\frac{1}{\ell}}\right)\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 74.4%
pow1/274.4%
div-inv74.4%
unpow-prod-down40.5%
pow1/240.5%
associate-/r*41.4%
Applied egg-rr41.4%
unpow1/241.4%
Simplified41.4%
if -4.999999999999985e-310 < l Initial program 71.2%
pow1/271.2%
associate-/r*71.7%
div-inv71.6%
unpow-prod-down81.8%
pow1/281.8%
Applied egg-rr81.8%
unpow1/281.8%
Simplified81.8%
Final simplification63.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -5e-310) (* c0 (/ (sqrt A) (sqrt (* l V)))) (* c0 (* (pow l -0.5) (sqrt (/ A V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 * (pow(l, -0.5) * sqrt((A / V)));
}
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 (l <= (-5d-310)) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
else
tmp = c0 * ((l ** (-0.5d0)) * sqrt((a / v)))
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 (l <= -5e-310) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = c0 * (Math.pow(l, -0.5) * Math.sqrt((A / V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = c0 * (math.pow(l, -0.5) * math.sqrt((A / V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = Float64(c0 * Float64((l ^ -0.5) * sqrt(Float64(A / V)))); 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 (l <= -5e-310)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = c0 * ((l ^ -0.5) * sqrt((A / V)));
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[l, -5e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{A}{V}}\right)\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 74.4%
sqrt-div40.8%
div-inv40.7%
Applied egg-rr40.7%
associate-*r/40.8%
*-rgt-identity40.8%
Simplified40.8%
if -4.999999999999985e-310 < l Initial program 71.2%
*-un-lft-identity71.2%
times-frac70.6%
Applied egg-rr70.6%
pow1/270.6%
*-commutative70.6%
associate-*l/71.7%
associate-*r/70.1%
un-div-inv70.1%
associate-*r*71.5%
unpow-prod-down81.8%
div-inv81.8%
pow1/281.8%
inv-pow81.8%
sqrt-pow181.8%
metadata-eval81.8%
Applied egg-rr81.8%
unpow1/281.8%
*-commutative81.8%
Simplified81.8%
Final simplification62.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 (<= l -5e-310) (* c0 (/ (sqrt A) (sqrt (* l V)))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(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 (l <= (-5d-310)) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
else
tmp = c0 * (sqrt((a / v)) / sqrt(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 (l <= -5e-310) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(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 (l <= -5e-310)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = c0 * (sqrt((A / V)) / sqrt(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[l, -5e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 74.4%
sqrt-div40.8%
div-inv40.7%
Applied egg-rr40.7%
associate-*r/40.8%
*-rgt-identity40.8%
Simplified40.8%
if -4.999999999999985e-310 < l Initial program 71.2%
associate-/r*71.7%
sqrt-div81.8%
div-inv81.8%
Applied egg-rr81.8%
associate-*r/81.8%
*-rgt-identity81.8%
Simplified81.8%
Final simplification62.7%
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 (* l V)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (l * V)));
}
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 / (l * v)))
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 / (l * V)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (l * V)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(l * V)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (l * V)));
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[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}
\end{array}
Initial program 72.7%
Final simplification72.7%
herbie shell --seed 2024115
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))