
(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 14 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: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -2e-281)
(/ c0 (/ (sqrt (* V (- l))) (sqrt (- A))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* V (/ l A))))
(* c0 (/ (sqrt A) (sqrt (* V l))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -2e-281) {
tmp = c0 / (sqrt((V * -l)) / sqrt(-A));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt((V * (l / A)));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -2e-281) {
tmp = c0 / (Math.sqrt((V * -l)) / Math.sqrt(-A));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -2e-281: tmp = c0 / (math.sqrt((V * -l)) / math.sqrt(-A)) elif (V * l) <= 0.0: tmp = c0 / math.sqrt((V * (l / A))) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -2e-281) tmp = Float64(c0 / Float64(sqrt(Float64(V * Float64(-l))) / sqrt(Float64(-A)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -2e-281)
tmp = c0 / (sqrt((V * -l)) / sqrt(-A));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt((V * (l / A)));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-281], N[(c0 / N[(N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-A)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-281}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \left(-\ell\right)}}{\sqrt{-A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 46.7%
associate-/r*76.0%
sqrt-div37.7%
Applied egg-rr37.7%
if -inf.0 < (*.f64 V l) < -2e-281Initial program 85.2%
*-un-lft-identity85.2%
times-frac74.9%
Applied egg-rr74.9%
expm1-log1p-u54.3%
expm1-udef21.5%
frac-times25.5%
*-un-lft-identity25.5%
associate-/r*24.5%
sqrt-undiv12.4%
clear-num12.4%
un-div-inv12.4%
sqrt-undiv24.5%
Applied egg-rr24.5%
expm1-def57.1%
expm1-log1p77.8%
associate-/r/75.5%
Simplified75.5%
associate-*l/84.5%
Applied egg-rr84.5%
frac-2neg84.5%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if -2e-281 < (*.f64 V l) < 0.0Initial program 53.8%
*-un-lft-identity53.8%
times-frac75.1%
Applied egg-rr75.1%
expm1-log1p-u48.1%
expm1-udef35.8%
frac-times32.9%
*-un-lft-identity32.9%
associate-/r*35.8%
sqrt-undiv18.8%
clear-num18.8%
un-div-inv18.8%
sqrt-undiv35.8%
Applied egg-rr35.8%
expm1-def48.2%
expm1-log1p75.2%
associate-/r/75.2%
Simplified75.2%
if 0.0 < (*.f64 V l) Initial program 77.6%
sqrt-div92.1%
associate-*r/84.7%
Applied egg-rr84.7%
*-commutative84.7%
associate-*l/92.1%
Simplified92.1%
Final simplification85.8%
NOTE: 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))))
(t_1 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_1 (- INFINITY))
t_0
(if (<= t_1 -4e-320)
t_1
(if (<= t_1 0.0)
t_0
(if (<= t_1 5e+304) t_1 (sqrt (* (/ (* A c0) l) (/ c0 V)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((A / V)) / sqrt(l));
double t_1 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_0;
} else if (t_1 <= -4e-320) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = t_0;
} else if (t_1 <= 5e+304) {
tmp = t_1;
} else {
tmp = sqrt((((A * c0) / l) * (c0 / V)));
}
return tmp;
}
assert 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 t_1 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if (t_1 <= -4e-320) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = t_0;
} else if (t_1 <= 5e+304) {
tmp = t_1;
} else {
tmp = Math.sqrt((((A * c0) / l) * (c0 / V)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) t_1 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_1 <= -math.inf: tmp = t_0 elif t_1 <= -4e-320: tmp = t_1 elif t_1 <= 0.0: tmp = t_0 elif t_1 <= 5e+304: tmp = t_1 else: tmp = math.sqrt((((A * c0) / l) * (c0 / V))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))) t_1 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_0; elseif (t_1 <= -4e-320) tmp = t_1; elseif (t_1 <= 0.0) tmp = t_0; elseif (t_1 <= 5e+304) tmp = t_1; else tmp = sqrt(Float64(Float64(Float64(A * c0) / l) * Float64(c0 / V))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * (sqrt((A / V)) / sqrt(l));
t_1 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_1 <= -Inf)
tmp = t_0;
elseif (t_1 <= -4e-320)
tmp = t_1;
elseif (t_1 <= 0.0)
tmp = t_0;
elseif (t_1 <= 5e+304)
tmp = t_1;
else
tmp = sqrt((((A * c0) / l) * (c0 / V)));
end
tmp_2 = tmp;
end
NOTE: 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]}, Block[{t$95$1 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$0, If[LessEqual[t$95$1, -4e-320], t$95$1, If[LessEqual[t$95$1, 0.0], t$95$0, If[LessEqual[t$95$1, 5e+304], t$95$1, N[Sqrt[N[(N[(N[(A * c0), $MachinePrecision] / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
t_1 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;t_0\\
\mathbf{elif}\;t_1 \leq -4 \cdot 10^{-320}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;t_0\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+304}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot c0}{\ell} \cdot \frac{c0}{V}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < -inf.0 or -3.99996e-320 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < -0.0Initial program 41.1%
associate-/r*59.3%
sqrt-div37.6%
Applied egg-rr37.6%
if -inf.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < -3.99996e-320 or -0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999997e304Initial program 99.2%
if 4.9999999999999997e304 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 46.9%
add-sqr-sqrt46.9%
sqrt-unprod46.9%
pow1/246.9%
*-commutative46.9%
*-commutative46.9%
swap-sqr45.9%
add-sqr-sqrt45.9%
Applied egg-rr45.9%
unpow1/245.9%
Simplified45.9%
associate-*l/62.6%
clear-num62.6%
Applied egg-rr62.6%
Applied egg-rr86.8%
Final simplification76.9%
NOTE: 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))) (t_1 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_1 (- INFINITY))
(* t_0 (/ c0 (sqrt l)))
(if (<= t_1 -4e-320)
t_1
(if (<= t_1 0.0)
(* c0 (/ t_0 (sqrt l)))
(if (<= t_1 5e+304) t_1 (sqrt (* (/ (* A c0) l) (/ c0 V)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double t_1 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_0 * (c0 / sqrt(l));
} else if (t_1 <= -4e-320) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = c0 * (t_0 / sqrt(l));
} else if (t_1 <= 5e+304) {
tmp = t_1;
} else {
tmp = sqrt((((A * c0) / l) * (c0 / V)));
}
return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double t_1 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_0 * (c0 / Math.sqrt(l));
} else if (t_1 <= -4e-320) {
tmp = t_1;
} else if (t_1 <= 0.0) {
tmp = c0 * (t_0 / Math.sqrt(l));
} else if (t_1 <= 5e+304) {
tmp = t_1;
} else {
tmp = Math.sqrt((((A * c0) / l) * (c0 / V)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) t_1 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_1 <= -math.inf: tmp = t_0 * (c0 / math.sqrt(l)) elif t_1 <= -4e-320: tmp = t_1 elif t_1 <= 0.0: tmp = c0 * (t_0 / math.sqrt(l)) elif t_1 <= 5e+304: tmp = t_1 else: tmp = math.sqrt((((A * c0) / l) * (c0 / V))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) t_1 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(t_0 * Float64(c0 / sqrt(l))); elseif (t_1 <= -4e-320) tmp = t_1; elseif (t_1 <= 0.0) tmp = Float64(c0 * Float64(t_0 / sqrt(l))); elseif (t_1 <= 5e+304) tmp = t_1; else tmp = sqrt(Float64(Float64(Float64(A * c0) / l) * Float64(c0 / V))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
t_1 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_1 <= -Inf)
tmp = t_0 * (c0 / sqrt(l));
elseif (t_1 <= -4e-320)
tmp = t_1;
elseif (t_1 <= 0.0)
tmp = c0 * (t_0 / sqrt(l));
elseif (t_1 <= 5e+304)
tmp = t_1;
else
tmp = sqrt((((A * c0) / l) * (c0 / V)));
end
tmp_2 = tmp;
end
NOTE: 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]}, Block[{t$95$1 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(t$95$0 * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -4e-320], t$95$1, If[LessEqual[t$95$1, 0.0], N[(c0 * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+304], t$95$1, N[Sqrt[N[(N[(N[(A * c0), $MachinePrecision] / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
t_1 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;t_0 \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{elif}\;t_1 \leq -4 \cdot 10^{-320}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;c0 \cdot \frac{t_0}{\sqrt{\ell}}\\
\mathbf{elif}\;t_1 \leq 5 \cdot 10^{+304}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot c0}{\ell} \cdot \frac{c0}{V}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < -inf.0Initial program 44.0%
*-un-lft-identity44.0%
times-frac56.7%
Applied egg-rr56.7%
frac-times44.0%
*-un-lft-identity44.0%
associate-/r*56.7%
sqrt-undiv41.6%
associate-*r/41.7%
clear-num41.7%
Applied egg-rr41.7%
associate-/r/41.7%
associate-*l/41.7%
*-commutative41.7%
associate-*l*41.7%
*-lft-identity41.7%
associate-*r/41.6%
Simplified41.6%
if -inf.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < -3.99996e-320 or -0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999997e304Initial program 99.2%
if -3.99996e-320 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < -0.0Initial program 40.0%
associate-/r*60.3%
sqrt-div36.3%
Applied egg-rr36.3%
if 4.9999999999999997e304 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 46.9%
add-sqr-sqrt46.9%
sqrt-unprod46.9%
pow1/246.9%
*-commutative46.9%
*-commutative46.9%
swap-sqr45.9%
add-sqr-sqrt45.9%
Applied egg-rr45.9%
unpow1/245.9%
Simplified45.9%
associate-*l/62.6%
clear-num62.6%
Applied egg-rr62.6%
Applied egg-rr86.8%
Final simplification76.9%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 -5e-292)
t_0
(if (<= t_0 4e-233)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+304) t_0 (sqrt (* (/ (* A c0) l) (/ c0 V))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= -5e-292) {
tmp = t_0;
} else if (t_0 <= 4e-233) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 5e+304) {
tmp = t_0;
} else {
tmp = sqrt((((A * c0) / l) * (c0 / V)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= (-5d-292)) then
tmp = t_0
else if (t_0 <= 4d-233) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 5d+304) then
tmp = t_0
else
tmp = sqrt((((a * c0) / l) * (c0 / v)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= -5e-292) {
tmp = t_0;
} else if (t_0 <= 4e-233) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+304) {
tmp = t_0;
} else {
tmp = Math.sqrt((((A * c0) / l) * (c0 / V)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= -5e-292: tmp = t_0 elif t_0 <= 4e-233: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 5e+304: tmp = t_0 else: tmp = math.sqrt((((A * c0) / l) * (c0 / V))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= -5e-292) tmp = t_0; elseif (t_0 <= 4e-233) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+304) tmp = t_0; else tmp = sqrt(Float64(Float64(Float64(A * c0) / l) * Float64(c0 / V))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= -5e-292)
tmp = t_0;
elseif (t_0 <= 4e-233)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 5e+304)
tmp = t_0;
else
tmp = sqrt((((A * c0) / l) * (c0 / V)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-292], t$95$0, If[LessEqual[t$95$0, 4e-233], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+304], t$95$0, N[Sqrt[N[(N[(N[(A * c0), $MachinePrecision] / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq -5 \cdot 10^{-292}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;t_0 \leq 4 \cdot 10^{-233}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+304}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot c0}{\ell} \cdot \frac{c0}{V}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < -4.99999999999999981e-292 or 3.99999999999999983e-233 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999997e304Initial program 91.3%
if -4.99999999999999981e-292 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999983e-233Initial program 47.3%
*-un-lft-identity47.3%
times-frac62.5%
Applied egg-rr62.5%
associate-*l/62.5%
*-un-lft-identity62.5%
Applied egg-rr62.5%
if 4.9999999999999997e304 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 46.9%
add-sqr-sqrt46.9%
sqrt-unprod46.9%
pow1/246.9%
*-commutative46.9%
*-commutative46.9%
swap-sqr45.9%
add-sqr-sqrt45.9%
Applied egg-rr45.9%
unpow1/245.9%
Simplified45.9%
associate-*l/62.6%
clear-num62.6%
Applied egg-rr62.6%
Applied egg-rr86.8%
Final simplification82.4%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 -5e-292)
t_0
(if (<= t_0 4e-233)
(* c0 (sqrt (* (/ 1.0 V) (/ A l))))
(if (<= t_0 5e+304) t_0 (sqrt (* (/ (* A c0) l) (/ c0 V))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= -5e-292) {
tmp = t_0;
} else if (t_0 <= 4e-233) {
tmp = c0 * sqrt(((1.0 / V) * (A / l)));
} else if (t_0 <= 5e+304) {
tmp = t_0;
} else {
tmp = sqrt((((A * c0) / l) * (c0 / V)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= (-5d-292)) then
tmp = t_0
else if (t_0 <= 4d-233) then
tmp = c0 * sqrt(((1.0d0 / v) * (a / l)))
else if (t_0 <= 5d+304) then
tmp = t_0
else
tmp = sqrt((((a * c0) / l) * (c0 / v)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= -5e-292) {
tmp = t_0;
} else if (t_0 <= 4e-233) {
tmp = c0 * Math.sqrt(((1.0 / V) * (A / l)));
} else if (t_0 <= 5e+304) {
tmp = t_0;
} else {
tmp = Math.sqrt((((A * c0) / l) * (c0 / V)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= -5e-292: tmp = t_0 elif t_0 <= 4e-233: tmp = c0 * math.sqrt(((1.0 / V) * (A / l))) elif t_0 <= 5e+304: tmp = t_0 else: tmp = math.sqrt((((A * c0) / l) * (c0 / V))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= -5e-292) tmp = t_0; elseif (t_0 <= 4e-233) tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / V) * Float64(A / l)))); elseif (t_0 <= 5e+304) tmp = t_0; else tmp = sqrt(Float64(Float64(Float64(A * c0) / l) * Float64(c0 / V))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= -5e-292)
tmp = t_0;
elseif (t_0 <= 4e-233)
tmp = c0 * sqrt(((1.0 / V) * (A / l)));
elseif (t_0 <= 5e+304)
tmp = t_0;
else
tmp = sqrt((((A * c0) / l) * (c0 / V)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e-292], t$95$0, If[LessEqual[t$95$0, 4e-233], N[(c0 * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] * N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+304], t$95$0, N[Sqrt[N[(N[(N[(A * c0), $MachinePrecision] / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq -5 \cdot 10^{-292}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;t_0 \leq 4 \cdot 10^{-233}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+304}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A \cdot c0}{\ell} \cdot \frac{c0}{V}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < -4.99999999999999981e-292 or 3.99999999999999983e-233 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999997e304Initial program 91.3%
if -4.99999999999999981e-292 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999983e-233Initial program 47.3%
*-un-lft-identity47.3%
times-frac62.5%
Applied egg-rr62.5%
if 4.9999999999999997e304 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 46.9%
add-sqr-sqrt46.9%
sqrt-unprod46.9%
pow1/246.9%
*-commutative46.9%
*-commutative46.9%
swap-sqr45.9%
add-sqr-sqrt45.9%
Applied egg-rr45.9%
unpow1/245.9%
Simplified45.9%
associate-*l/62.6%
clear-num62.6%
Applied egg-rr62.6%
Applied egg-rr86.8%
Final simplification82.4%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -2e-311) (* c0 (/ (/ (sqrt (- A)) (sqrt (- V))) (sqrt l))) (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -2e-311) {
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: 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 <= (-2d-311)) then
tmp = c0 * ((sqrt(-a) / sqrt(-v)) / sqrt(l))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -2e-311) {
tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -2e-311: tmp = c0 * ((math.sqrt(-A) / math.sqrt(-V)) / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -2e-311) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -2e-311)
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -2e-311], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2 \cdot 10^{-311}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -1.9999999999999e-311Initial program 73.0%
associate-/r*76.8%
sqrt-div41.3%
Applied egg-rr41.3%
frac-2neg41.3%
sqrt-div45.8%
Applied egg-rr45.8%
if -1.9999999999999e-311 < A Initial program 74.1%
sqrt-div86.7%
associate-*r/80.2%
Applied egg-rr80.2%
*-commutative80.2%
associate-*l/86.7%
Simplified86.7%
Final simplification64.8%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -2e-281)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* V (/ l A))))
(* c0 (/ (sqrt A) (sqrt (* V l))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -2e-281) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt((V * (l / A)));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -2e-281) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -2e-281: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 / math.sqrt((V * (l / A))) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -2e-281) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -2e-281)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt((V * (l / A)));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-281], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-281}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 46.7%
associate-/r*76.0%
sqrt-div37.7%
Applied egg-rr37.7%
if -inf.0 < (*.f64 V l) < -2e-281Initial program 85.2%
frac-2neg85.2%
sqrt-div99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Applied egg-rr99.3%
if -2e-281 < (*.f64 V l) < 0.0Initial program 53.8%
*-un-lft-identity53.8%
times-frac75.1%
Applied egg-rr75.1%
expm1-log1p-u48.1%
expm1-udef35.8%
frac-times32.9%
*-un-lft-identity32.9%
associate-/r*35.8%
sqrt-undiv18.8%
clear-num18.8%
un-div-inv18.8%
sqrt-undiv35.8%
Applied egg-rr35.8%
expm1-def48.2%
expm1-log1p75.2%
associate-/r/75.2%
Simplified75.2%
if 0.0 < (*.f64 V l) Initial program 77.6%
sqrt-div92.1%
associate-*r/84.7%
Applied egg-rr84.7%
*-commutative84.7%
associate-*l/92.1%
Simplified92.1%
Final simplification85.8%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -2e-311) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (* (sqrt A) (/ c0 (sqrt (* V l))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -2e-311) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
}
return tmp;
}
NOTE: 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 <= (-2d-311)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = sqrt(a) * (c0 / sqrt((v * l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -2e-311) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -2e-311: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -2e-311) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -2e-311)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = sqrt(A) * (c0 / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -2e-311], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2 \cdot 10^{-311}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -1.9999999999999e-311Initial program 73.0%
associate-/r*76.8%
sqrt-div41.3%
Applied egg-rr41.3%
if -1.9999999999999e-311 < A Initial program 74.1%
sqrt-div86.7%
associate-*r/80.2%
Applied egg-rr80.2%
associate-*l/82.9%
Simplified82.9%
Final simplification60.6%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -2e-311) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -2e-311) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: 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 <= (-2d-311)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -2e-311) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -2e-311: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -2e-311) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -2e-311)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -2e-311], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2 \cdot 10^{-311}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -1.9999999999999e-311Initial program 73.0%
associate-/r*76.8%
sqrt-div41.3%
Applied egg-rr41.3%
if -1.9999999999999e-311 < A Initial program 74.1%
sqrt-div86.7%
associate-*r/80.2%
Applied egg-rr80.2%
*-commutative80.2%
associate-*l/86.7%
Simplified86.7%
Final simplification62.4%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 2e-317)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+278)
(* c0 (pow (/ (* V l) A) -0.5))
(/ c0 (sqrt (* V (/ l A))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e-317) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 5e+278) {
tmp = c0 * pow(((V * l) / A), -0.5);
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 2d-317) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 5d+278) then
tmp = c0 * (((v * l) / a) ** (-0.5d0))
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e-317) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+278) {
tmp = c0 * Math.pow(((V * l) / A), -0.5);
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 2e-317: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 5e+278: tmp = c0 * math.pow(((V * l) / A), -0.5) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 2e-317) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+278) tmp = Float64(c0 * (Float64(Float64(V * l) / A) ^ -0.5)); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 2e-317)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 5e+278)
tmp = c0 * (((V * l) / A) ^ -0.5);
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-317], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+278], N[(c0 * N[Power[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-317}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+278}:\\
\;\;\;\;c0 \cdot {\left(\frac{V \cdot \ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 1.99999997e-317Initial program 39.4%
*-un-lft-identity39.4%
times-frac58.8%
Applied egg-rr58.8%
associate-*l/58.8%
*-un-lft-identity58.8%
Applied egg-rr58.8%
if 1.99999997e-317 < (/.f64 A (*.f64 V l)) < 5.00000000000000029e278Initial program 99.6%
pow1/299.6%
clear-num99.6%
inv-pow99.6%
pow-pow99.6%
associate-/l*85.3%
metadata-eval85.3%
Applied egg-rr85.3%
associate-/l*99.6%
Simplified99.6%
if 5.00000000000000029e278 < (/.f64 A (*.f64 V l)) Initial program 45.4%
*-un-lft-identity45.4%
times-frac54.8%
Applied egg-rr54.8%
expm1-log1p-u32.0%
expm1-udef24.6%
frac-times23.6%
*-un-lft-identity23.6%
associate-/r*25.4%
sqrt-undiv19.9%
clear-num19.9%
un-div-inv19.9%
sqrt-undiv26.8%
Applied egg-rr26.8%
expm1-def37.3%
expm1-log1p60.0%
associate-/r/56.3%
Simplified56.3%
Final simplification80.6%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 5e+278)))
(* c0 (sqrt (/ (/ A l) V)))
(* c0 (sqrt t_0)))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+278)) {
tmp = c0 * sqrt(((A / l) / V));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+278))) then
tmp = c0 * sqrt(((a / l) / v))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+278)) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+278): tmp = c0 * math.sqrt(((A / l) / V)) else: tmp = c0 * math.sqrt(t_0) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 5e+278)) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 5e+278)))
tmp = c0 * sqrt(((A / l) / V));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+278]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 5 \cdot 10^{+278}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 5.00000000000000029e278 < (/.f64 A (*.f64 V l)) Initial program 41.4%
*-un-lft-identity41.4%
times-frac57.1%
Applied egg-rr57.1%
associate-*l/57.1%
*-un-lft-identity57.1%
Applied egg-rr57.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000029e278Initial program 99.3%
Final simplification80.5%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+278) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 5e+278) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 5d+278) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+278) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 5e+278: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+278) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 5e+278)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+278], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+278}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 38.1%
*-un-lft-identity38.1%
times-frac59.0%
Applied egg-rr59.0%
associate-*l/59.0%
*-un-lft-identity59.0%
Applied egg-rr59.0%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.00000000000000029e278Initial program 99.3%
if 5.00000000000000029e278 < (/.f64 A (*.f64 V l)) Initial program 45.4%
*-un-lft-identity45.4%
times-frac54.8%
Applied egg-rr54.8%
expm1-log1p-u32.0%
expm1-udef24.6%
frac-times23.6%
*-un-lft-identity23.6%
associate-/r*25.4%
sqrt-undiv19.9%
clear-num19.9%
un-div-inv19.9%
sqrt-undiv26.8%
Applied egg-rr26.8%
expm1-def37.3%
expm1-log1p60.0%
associate-/r/56.3%
Simplified56.3%
Final simplification80.8%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 2e-317)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+278)
(/ c0 (sqrt (/ (* V l) A)))
(/ c0 (sqrt (* V (/ l A))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e-317) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 5e+278) {
tmp = c0 / sqrt(((V * l) / A));
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 2d-317) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 5d+278) then
tmp = c0 / sqrt(((v * l) / a))
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e-317) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+278) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 2e-317: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 5e+278: tmp = c0 / math.sqrt(((V * l) / A)) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 2e-317) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+278) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 2e-317)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 5e+278)
tmp = c0 / sqrt(((V * l) / A));
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-317], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+278], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-317}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+278}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 1.99999997e-317Initial program 39.4%
*-un-lft-identity39.4%
times-frac58.8%
Applied egg-rr58.8%
associate-*l/58.8%
*-un-lft-identity58.8%
Applied egg-rr58.8%
if 1.99999997e-317 < (/.f64 A (*.f64 V l)) < 5.00000000000000029e278Initial program 99.6%
*-un-lft-identity99.6%
times-frac85.3%
Applied egg-rr85.3%
expm1-log1p-u61.3%
expm1-udef23.7%
frac-times26.7%
*-un-lft-identity26.7%
associate-/r*24.9%
sqrt-undiv10.4%
clear-num10.4%
un-div-inv10.4%
sqrt-undiv24.9%
Applied egg-rr24.9%
expm1-def62.6%
expm1-log1p86.6%
associate-/r/85.7%
Simplified85.7%
associate-*l/99.6%
Applied egg-rr99.6%
if 5.00000000000000029e278 < (/.f64 A (*.f64 V l)) Initial program 45.4%
*-un-lft-identity45.4%
times-frac54.8%
Applied egg-rr54.8%
expm1-log1p-u32.0%
expm1-udef24.6%
frac-times23.6%
*-un-lft-identity23.6%
associate-/r*25.4%
sqrt-undiv19.9%
clear-num19.9%
un-div-inv19.9%
sqrt-undiv26.8%
Applied egg-rr26.8%
expm1-def37.3%
expm1-log1p60.0%
associate-/r/56.3%
Simplified56.3%
Final simplification80.6%
NOTE: 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(V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: 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 V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[V, l] = sort([V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
V, l = sort([V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
V, l = num2cell(sort([V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: 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}
[V, l] = \mathsf{sort}([V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 73.5%
Final simplification73.5%
herbie shell --seed 2023293
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))