
(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 16 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 (<= (* l V) (- INFINITY))
(* c0 (/ (sqrt (/ (- A) l)) (sqrt (- V))))
(if (<= (* l V) -2e-311)
(* c0 (/ (sqrt (- A)) (sqrt (* l (- V)))))
(if (<= (* l V) 1e-312)
(* c0 (pow (/ (cbrt (/ A l)) (cbrt V)) 1.5))
(/ c0 (/ (sqrt (* l V)) (sqrt A)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
} else if ((l * V) <= -2e-311) {
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
} else if ((l * V) <= 1e-312) {
tmp = c0 * pow((cbrt((A / l)) / cbrt(V)), 1.5);
} else {
tmp = c0 / (sqrt((l * V)) / sqrt(A));
}
return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((-A / l)) / Math.sqrt(-V));
} else if ((l * V) <= -2e-311) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((l * -V)));
} else if ((l * V) <= 1e-312) {
tmp = c0 * Math.pow((Math.cbrt((A / l)) / Math.cbrt(V)), 1.5);
} else {
tmp = c0 / (Math.sqrt((l * V)) / Math.sqrt(A));
}
return tmp;
}
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V)))); elseif (Float64(l * V) <= -2e-311) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V))))); elseif (Float64(l * V) <= 1e-312) tmp = Float64(c0 * (Float64(cbrt(Float64(A / l)) / cbrt(V)) ^ 1.5)); else tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) / sqrt(A))); end return tmp end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(l * V), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -2e-311], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 1e-312], N[(c0 * N[Power[N[(N[Power[N[(A / l), $MachinePrecision], 1/3], $MachinePrecision] / N[Power[V, 1/3], $MachinePrecision]), $MachinePrecision], 1.5], $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;\ell \cdot V \leq -2 \cdot 10^{-311}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\
\mathbf{elif}\;\ell \cdot V \leq 10^{-312}:\\
\;\;\;\;c0 \cdot {\left(\frac{\sqrt[3]{\frac{A}{\ell}}}{\sqrt[3]{V}}\right)}^{1.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 63.3%
pow1/263.3%
clear-num63.3%
inv-pow63.3%
pow-pow63.3%
associate-/l*79.1%
metadata-eval79.1%
Applied egg-rr79.1%
associate-/l*63.3%
*-lft-identity63.3%
times-frac79.0%
/-rgt-identity79.0%
Simplified79.0%
Taylor expanded in c0 around 0 63.3%
associate-/l/79.1%
Simplified79.1%
frac-2neg79.1%
sqrt-div39.2%
Applied egg-rr39.2%
distribute-neg-frac39.2%
Simplified39.2%
if -inf.0 < (*.f64 V l) < -1.9999999999999e-311Initial program 83.6%
frac-2neg83.6%
sqrt-div99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Applied egg-rr99.3%
if -1.9999999999999e-311 < (*.f64 V l) < 9.9999999999847e-313Initial program 33.4%
pow1/233.4%
add-cube-cbrt33.4%
pow333.4%
pow-pow33.4%
metadata-eval33.4%
Applied egg-rr33.4%
associate-/r*63.3%
div-inv63.3%
frac-times33.4%
*-commutative33.4%
frac-times63.3%
cbrt-prod83.5%
cbrt-div83.5%
metadata-eval83.5%
Applied egg-rr83.5%
associate-*r/83.5%
*-rgt-identity83.5%
Simplified83.5%
if 9.9999999999847e-313 < (*.f64 V l) Initial program 76.4%
sqrt-div94.5%
associate-*r/92.5%
Applied egg-rr92.5%
associate-/l*94.5%
Simplified94.5%
Final simplification90.6%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -4e-310) (/ c0 (* (sqrt l) (/ (sqrt (- V)) (sqrt (- A))))) (/ c0 (/ (sqrt (* l V)) (sqrt A)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 / (sqrt(l) * (sqrt(-V) / sqrt(-A)));
} else {
tmp = c0 / (sqrt((l * V)) / sqrt(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) :: tmp
if (a <= (-4d-310)) then
tmp = c0 / (sqrt(l) * (sqrt(-v) / sqrt(-a)))
else
tmp = c0 / (sqrt((l * v)) / sqrt(a))
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 <= -4e-310) {
tmp = c0 / (Math.sqrt(l) * (Math.sqrt(-V) / Math.sqrt(-A)));
} else {
tmp = c0 / (Math.sqrt((l * V)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -4e-310: tmp = c0 / (math.sqrt(l) * (math.sqrt(-V) / math.sqrt(-A))) else: tmp = c0 / (math.sqrt((l * V)) / math.sqrt(A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -4e-310) tmp = Float64(c0 / Float64(sqrt(l) * Float64(sqrt(Float64(-V)) / sqrt(Float64(-A))))); else tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) / sqrt(A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -4e-310)
tmp = c0 / (sqrt(l) * (sqrt(-V) / sqrt(-A)));
else
tmp = c0 / (sqrt((l * V)) / sqrt(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_] := If[LessEqual[A, -4e-310], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[(N[Sqrt[(-V)], $MachinePrecision] / N[Sqrt[(-A)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \frac{\sqrt{-V}}{\sqrt{-A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -3.999999999999988e-310Initial program 68.7%
sqrt-div0.0%
associate-*r/0.0%
Applied egg-rr0.0%
associate-*l/0.0%
Simplified0.0%
associate-*l/0.0%
sqrt-prod0.0%
associate-/r*0.0%
Applied egg-rr0.0%
add-sqr-sqrt0.0%
*-un-lft-identity0.0%
times-frac0.0%
associate-/l*0.0%
sqrt-undiv0.0%
associate-/l*0.0%
sqrt-undiv19.9%
Applied egg-rr19.9%
/-rgt-identity19.9%
associate-*r/19.9%
rem-square-sqrt30.6%
associate-/l/32.0%
Simplified32.0%
frac-2neg32.0%
sqrt-div41.7%
Applied egg-rr41.7%
if -3.999999999999988e-310 < A Initial program 74.8%
sqrt-div91.2%
associate-*r/89.4%
Applied egg-rr89.4%
associate-/l*91.3%
Simplified91.3%
Final simplification66.3%
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) l)) (sqrt (- V))))))
(if (<= (* l V) (- INFINITY))
t_0
(if (<= (* l V) -2e-311)
(* c0 (/ (sqrt (- A)) (sqrt (* l (- V)))))
(if (<= (* l V) 1e-312) t_0 (/ c0 (/ (sqrt (* l V)) (sqrt A))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((-A / l)) / sqrt(-V));
double tmp;
if ((l * V) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((l * V) <= -2e-311) {
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
} else if ((l * V) <= 1e-312) {
tmp = t_0;
} else {
tmp = c0 / (sqrt((l * V)) / sqrt(A));
}
return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * (Math.sqrt((-A / l)) / Math.sqrt(-V));
double tmp;
if ((l * V) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if ((l * V) <= -2e-311) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((l * -V)));
} else if ((l * V) <= 1e-312) {
tmp = t_0;
} else {
tmp = c0 / (Math.sqrt((l * V)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((-A / l)) / math.sqrt(-V)) tmp = 0 if (l * V) <= -math.inf: tmp = t_0 elif (l * V) <= -2e-311: tmp = c0 * (math.sqrt(-A) / math.sqrt((l * -V))) elif (l * V) <= 1e-312: tmp = t_0 else: tmp = c0 / (math.sqrt((l * V)) / math.sqrt(A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V)))) tmp = 0.0 if (Float64(l * V) <= Float64(-Inf)) tmp = t_0; elseif (Float64(l * V) <= -2e-311) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V))))); elseif (Float64(l * V) <= 1e-312) tmp = t_0; else tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) / sqrt(A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * (sqrt((-A / l)) / sqrt(-V));
tmp = 0.0;
if ((l * V) <= -Inf)
tmp = t_0;
elseif ((l * V) <= -2e-311)
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
elseif ((l * V) <= 1e-312)
tmp = t_0;
else
tmp = c0 / (sqrt((l * V)) / sqrt(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[(c0 * N[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(l * V), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(l * V), $MachinePrecision], -2e-311], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 1e-312], t$95$0, N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\
\mathbf{if}\;\ell \cdot V \leq -\infty:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \cdot V \leq -2 \cdot 10^{-311}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\
\mathbf{elif}\;\ell \cdot V \leq 10^{-312}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or -1.9999999999999e-311 < (*.f64 V l) < 9.9999999999847e-313Initial program 43.2%
pow1/243.2%
clear-num43.2%
inv-pow43.2%
pow-pow43.2%
associate-/l*69.6%
metadata-eval69.6%
Applied egg-rr69.6%
associate-/l*43.2%
*-lft-identity43.2%
times-frac69.6%
/-rgt-identity69.6%
Simplified69.6%
Taylor expanded in c0 around 0 43.2%
associate-/l/68.7%
Simplified68.7%
frac-2neg68.7%
sqrt-div52.8%
Applied egg-rr52.8%
distribute-neg-frac52.8%
Simplified52.8%
if -inf.0 < (*.f64 V l) < -1.9999999999999e-311Initial program 83.6%
frac-2neg83.6%
sqrt-div99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Applied egg-rr99.3%
if 9.9999999999847e-313 < (*.f64 V l) Initial program 76.4%
sqrt-div94.5%
associate-*r/92.5%
Applied egg-rr92.5%
associate-/l*94.5%
Simplified94.5%
Final simplification87.2%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) (- INFINITY))
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* l V) -2e-311)
(* c0 (/ (sqrt (- A)) (sqrt (* l (- V)))))
(if (<= (* l V) 1e-312)
(/ c0 (sqrt (* V (/ l A))))
(/ c0 (/ (sqrt (* l V)) (sqrt A)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -((double) INFINITY)) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((l * V) <= -2e-311) {
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
} else if ((l * V) <= 1e-312) {
tmp = c0 / sqrt((V * (l / A)));
} else {
tmp = c0 / (sqrt((l * V)) / sqrt(A));
}
return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -Double.POSITIVE_INFINITY) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((l * V) <= -2e-311) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((l * -V)));
} else if ((l * V) <= 1e-312) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else {
tmp = c0 / (Math.sqrt((l * V)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -math.inf: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) elif (l * V) <= -2e-311: tmp = c0 * (math.sqrt(-A) / math.sqrt((l * -V))) elif (l * V) <= 1e-312: tmp = c0 / math.sqrt((V * (l / A))) else: tmp = c0 / (math.sqrt((l * V)) / math.sqrt(A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= Float64(-Inf)) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(l * V) <= -2e-311) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V))))); elseif (Float64(l * V) <= 1e-312) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); else tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) / sqrt(A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((l * V) <= -Inf)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
elseif ((l * V) <= -2e-311)
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
elseif ((l * V) <= 1e-312)
tmp = c0 / sqrt((V * (l / A)));
else
tmp = c0 / (sqrt((l * V)) / sqrt(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_] := If[LessEqual[N[(l * V), $MachinePrecision], (-Infinity)], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -2e-311], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 1e-312], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -\infty:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq -2 \cdot 10^{-311}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\
\mathbf{elif}\;\ell \cdot V \leq 10^{-312}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 63.3%
sqrt-div0.0%
associate-*r/0.0%
Applied egg-rr0.0%
associate-*l/0.0%
Simplified0.0%
associate-*l/0.0%
sqrt-prod0.0%
associate-/r*0.0%
Applied egg-rr0.0%
add-sqr-sqrt0.0%
*-un-lft-identity0.0%
times-frac0.0%
associate-/l*0.0%
sqrt-undiv0.0%
associate-/l*0.0%
sqrt-undiv28.7%
Applied egg-rr28.7%
/-rgt-identity28.7%
associate-*r/28.7%
rem-square-sqrt34.3%
associate-/l/34.3%
Simplified34.3%
if -inf.0 < (*.f64 V l) < -1.9999999999999e-311Initial program 83.6%
frac-2neg83.6%
sqrt-div99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Applied egg-rr99.3%
if -1.9999999999999e-311 < (*.f64 V l) < 9.9999999999847e-313Initial program 33.4%
sqrt-div19.5%
associate-*r/19.5%
Applied egg-rr19.5%
associate-*l/17.6%
Simplified17.6%
expm1-log1p-u12.0%
expm1-udef9.2%
associate-*l/11.1%
associate-/l*11.1%
sqrt-div17.4%
associate-*r/24.8%
Applied egg-rr24.8%
expm1-def33.8%
expm1-log1p65.0%
Simplified65.0%
if 9.9999999999847e-313 < (*.f64 V l) Initial program 76.4%
sqrt-div94.5%
associate-*r/92.5%
Applied egg-rr92.5%
associate-/l*94.5%
Simplified94.5%
Final simplification87.6%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -4e-310) (* c0 (* (pow (/ V A) -0.5) (pow l -0.5))) (/ c0 (/ (sqrt (* l V)) (sqrt A)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 * (pow((V / A), -0.5) * pow(l, -0.5));
} else {
tmp = c0 / (sqrt((l * V)) / sqrt(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) :: tmp
if (a <= (-4d-310)) then
tmp = c0 * (((v / a) ** (-0.5d0)) * (l ** (-0.5d0)))
else
tmp = c0 / (sqrt((l * v)) / sqrt(a))
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 <= -4e-310) {
tmp = c0 * (Math.pow((V / A), -0.5) * Math.pow(l, -0.5));
} else {
tmp = c0 / (Math.sqrt((l * V)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -4e-310: tmp = c0 * (math.pow((V / A), -0.5) * math.pow(l, -0.5)) else: tmp = c0 / (math.sqrt((l * V)) / math.sqrt(A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -4e-310) tmp = Float64(c0 * Float64((Float64(V / A) ^ -0.5) * (l ^ -0.5))); else tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) / sqrt(A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -4e-310)
tmp = c0 * (((V / A) ^ -0.5) * (l ^ -0.5));
else
tmp = c0 / (sqrt((l * V)) / sqrt(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_] := If[LessEqual[A, -4e-310], N[(c0 * N[(N[Power[N[(V / A), $MachinePrecision], -0.5], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \left({\left(\frac{V}{A}\right)}^{-0.5} \cdot {\ell}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -3.999999999999988e-310Initial program 68.7%
pow1/268.7%
clear-num67.7%
inv-pow67.7%
pow-pow67.7%
associate-/l*70.6%
metadata-eval70.6%
Applied egg-rr70.6%
associate-/l*67.7%
*-lft-identity67.7%
times-frac70.8%
/-rgt-identity70.8%
Simplified70.8%
clear-num70.4%
div-inv70.6%
associate-/r/68.1%
unpow-prod-down32.1%
Applied egg-rr32.1%
if -3.999999999999988e-310 < A Initial program 74.8%
sqrt-div91.2%
associate-*r/89.4%
Applied egg-rr89.4%
associate-/l*91.3%
Simplified91.3%
Final simplification61.4%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l 5e-309) (/ c0 (sqrt (* V (/ l A)))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= 5e-309) {
tmp = c0 / sqrt((V * (l / A)));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(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 (l <= 5d-309) then
tmp = c0 / sqrt((v * (l / a)))
else
tmp = c0 * (sqrt((a / v)) / sqrt(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 (l <= 5e-309) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if l <= 5e-309: tmp = c0 / math.sqrt((V * (l / A))) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= 5e-309) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= 5e-309)
tmp = c0 / sqrt((V * (l / A)));
else
tmp = c0 * (sqrt((A / V)) / sqrt(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[l, 5e-309], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 5 \cdot 10^{-309}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 4.9999999999999995e-309Initial program 74.6%
sqrt-div43.4%
associate-*r/42.5%
Applied egg-rr42.5%
associate-*l/41.6%
Simplified41.6%
expm1-log1p-u30.6%
expm1-udef14.1%
associate-*l/14.0%
associate-/l*14.6%
sqrt-div28.1%
associate-*r/28.1%
Applied egg-rr28.1%
expm1-def56.3%
expm1-log1p76.9%
Simplified76.9%
if 4.9999999999999995e-309 < l Initial program 68.1%
associate-/r*67.1%
sqrt-div74.4%
Applied egg-rr74.4%
Final simplification75.8%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -4e-310) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (* (sqrt A) (/ c0 (sqrt (* l V))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = sqrt(A) * (c0 / sqrt((l * 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) :: tmp
if (a <= (-4d-310)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = sqrt(a) * (c0 / sqrt((l * v)))
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 <= -4e-310) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((l * V)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -4e-310: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = math.sqrt(A) * (c0 / math.sqrt((l * V))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -4e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(l * V)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -4e-310)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = sqrt(A) * (c0 / sqrt((l * 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_] := If[LessEqual[A, -4e-310], 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[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -3.999999999999988e-310Initial program 68.7%
associate-/r*67.9%
sqrt-div31.6%
Applied egg-rr31.6%
if -3.999999999999988e-310 < A Initial program 74.8%
sqrt-div91.2%
associate-*r/89.4%
Applied egg-rr89.4%
associate-*l/87.1%
Simplified87.1%
Final simplification59.1%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -4e-310) (/ c0 (* (sqrt l) (sqrt (/ V A)))) (* (sqrt A) (/ c0 (sqrt (* l V))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else {
tmp = sqrt(A) * (c0 / sqrt((l * 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) :: tmp
if (a <= (-4d-310)) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else
tmp = sqrt(a) * (c0 / sqrt((l * v)))
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 <= -4e-310) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((l * V)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -4e-310: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) else: tmp = math.sqrt(A) * (c0 / math.sqrt((l * V))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -4e-310) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); else tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(l * V)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -4e-310)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
else
tmp = sqrt(A) * (c0 / sqrt((l * 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_] := If[LessEqual[A, -4e-310], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -3.999999999999988e-310Initial program 68.7%
sqrt-div0.0%
associate-*r/0.0%
Applied egg-rr0.0%
associate-*l/0.0%
Simplified0.0%
associate-*l/0.0%
sqrt-prod0.0%
associate-/r*0.0%
Applied egg-rr0.0%
add-sqr-sqrt0.0%
*-un-lft-identity0.0%
times-frac0.0%
associate-/l*0.0%
sqrt-undiv0.0%
associate-/l*0.0%
sqrt-undiv19.9%
Applied egg-rr19.9%
/-rgt-identity19.9%
associate-*r/19.9%
rem-square-sqrt30.6%
associate-/l/32.0%
Simplified32.0%
if -3.999999999999988e-310 < A Initial program 74.8%
sqrt-div91.2%
associate-*r/89.4%
Applied egg-rr89.4%
associate-*l/87.1%
Simplified87.1%
Final simplification59.3%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -4e-310) (/ c0 (* (sqrt l) (sqrt (/ V A)))) (/ c0 (/ (sqrt (* l V)) (sqrt A)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else {
tmp = c0 / (sqrt((l * V)) / sqrt(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) :: tmp
if (a <= (-4d-310)) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else
tmp = c0 / (sqrt((l * v)) / sqrt(a))
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 <= -4e-310) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else {
tmp = c0 / (Math.sqrt((l * V)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -4e-310: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) else: tmp = c0 / (math.sqrt((l * V)) / math.sqrt(A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -4e-310) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); else tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) / sqrt(A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -4e-310)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
else
tmp = c0 / (sqrt((l * V)) / sqrt(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_] := If[LessEqual[A, -4e-310], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -3.999999999999988e-310Initial program 68.7%
sqrt-div0.0%
associate-*r/0.0%
Applied egg-rr0.0%
associate-*l/0.0%
Simplified0.0%
associate-*l/0.0%
sqrt-prod0.0%
associate-/r*0.0%
Applied egg-rr0.0%
add-sqr-sqrt0.0%
*-un-lft-identity0.0%
times-frac0.0%
associate-/l*0.0%
sqrt-undiv0.0%
associate-/l*0.0%
sqrt-undiv19.9%
Applied egg-rr19.9%
/-rgt-identity19.9%
associate-*r/19.9%
rem-square-sqrt30.6%
associate-/l/32.0%
Simplified32.0%
if -3.999999999999988e-310 < A Initial program 74.8%
sqrt-div91.2%
associate-*r/89.4%
Applied egg-rr89.4%
associate-/l*91.3%
Simplified91.3%
Final simplification61.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 (* l V))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 5e+302) (* c0 (sqrt t_0)) (* c0 (pow (* V (/ l A)) -0.5))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 5e+302) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
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 / (l * v)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 5d+302) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
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 / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 5e+302) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 5e+302: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow((V * (l / A)), -0.5) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 5e+302) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 5e+302)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * ((V * (l / A)) ^ -0.5);
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[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+302], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 48.1%
associate-/r*57.1%
div-inv57.1%
Applied egg-rr57.1%
un-div-inv57.1%
Applied egg-rr57.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 5e302Initial program 98.0%
if 5e302 < (/.f64 A (*.f64 V l)) Initial program 32.1%
pow1/232.1%
clear-num32.1%
inv-pow32.1%
pow-pow33.3%
associate-/l*49.3%
metadata-eval49.3%
Applied egg-rr49.3%
associate-/l*33.3%
*-lft-identity33.3%
times-frac49.3%
/-rgt-identity49.3%
Simplified49.3%
Final simplification77.7%
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 (* l V))))
(if (<= t_0 2e-318)
(sqrt (* A (* (/ c0 V) (/ c0 l))))
(if (<= t_0 5e+302) (* c0 (sqrt t_0)) (* c0 (pow (* V (/ l A)) -0.5))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 2e-318) {
tmp = sqrt((A * ((c0 / V) * (c0 / l))));
} else if (t_0 <= 5e+302) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
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 / (l * v)
if (t_0 <= 2d-318) then
tmp = sqrt((a * ((c0 / v) * (c0 / l))))
else if (t_0 <= 5d+302) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
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 / (l * V);
double tmp;
if (t_0 <= 2e-318) {
tmp = Math.sqrt((A * ((c0 / V) * (c0 / l))));
} else if (t_0 <= 5e+302) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if t_0 <= 2e-318: tmp = math.sqrt((A * ((c0 / V) * (c0 / l)))) elif t_0 <= 5e+302: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow((V * (l / A)), -0.5) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 2e-318) tmp = sqrt(Float64(A * Float64(Float64(c0 / V) * Float64(c0 / l)))); elseif (t_0 <= 5e+302) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if (t_0 <= 2e-318)
tmp = sqrt((A * ((c0 / V) * (c0 / l))));
elseif (t_0 <= 5e+302)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * ((V * (l / A)) ^ -0.5);
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[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-318], N[Sqrt[N[(A * N[(N[(c0 / V), $MachinePrecision] * N[(c0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 5e+302], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-318}:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0}{V} \cdot \frac{c0}{\ell}\right)}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2.0000024e-318Initial program 48.2%
pow1/248.2%
clear-num47.3%
inv-pow47.3%
pow-pow47.3%
associate-/l*56.2%
metadata-eval56.2%
Applied egg-rr56.2%
associate-/l*47.3%
*-lft-identity47.3%
times-frac56.1%
/-rgt-identity56.1%
Simplified56.1%
add-sqr-sqrt52.4%
sqrt-unprod49.0%
*-commutative49.0%
*-commutative49.0%
swap-sqr48.6%
pow-prod-up48.6%
metadata-eval48.6%
Applied egg-rr48.6%
unpow-148.6%
associate-*r/46.8%
associate-/r/47.7%
associate-*l/47.7%
metadata-eval47.7%
distribute-lft-neg-in47.7%
neg-mul-147.7%
remove-double-neg47.7%
associate-*l/54.0%
associate-*r/54.0%
times-frac59.5%
Simplified59.5%
if 2.0000024e-318 < (/.f64 A (*.f64 V l)) < 5e302Initial program 98.3%
if 5e302 < (/.f64 A (*.f64 V l)) Initial program 32.1%
pow1/232.1%
clear-num32.1%
inv-pow32.1%
pow-pow33.3%
associate-/l*49.3%
metadata-eval49.3%
Applied egg-rr49.3%
associate-/l*33.3%
*-lft-identity33.3%
times-frac49.3%
/-rgt-identity49.3%
Simplified49.3%
Final simplification78.3%
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 (* l V))))
(if (<= t_0 2e-318)
(sqrt (* (/ c0 V) (* A (/ c0 l))))
(if (<= t_0 5e+302) (* c0 (sqrt t_0)) (* c0 (pow (* V (/ l A)) -0.5))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 2e-318) {
tmp = sqrt(((c0 / V) * (A * (c0 / l))));
} else if (t_0 <= 5e+302) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
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 / (l * v)
if (t_0 <= 2d-318) then
tmp = sqrt(((c0 / v) * (a * (c0 / l))))
else if (t_0 <= 5d+302) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
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 / (l * V);
double tmp;
if (t_0 <= 2e-318) {
tmp = Math.sqrt(((c0 / V) * (A * (c0 / l))));
} else if (t_0 <= 5e+302) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if t_0 <= 2e-318: tmp = math.sqrt(((c0 / V) * (A * (c0 / l)))) elif t_0 <= 5e+302: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow((V * (l / A)), -0.5) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 2e-318) tmp = sqrt(Float64(Float64(c0 / V) * Float64(A * Float64(c0 / l)))); elseif (t_0 <= 5e+302) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if (t_0 <= 2e-318)
tmp = sqrt(((c0 / V) * (A * (c0 / l))));
elseif (t_0 <= 5e+302)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * ((V * (l / A)) ^ -0.5);
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[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-318], N[Sqrt[N[(N[(c0 / V), $MachinePrecision] * N[(A * N[(c0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 5e+302], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-318}:\\
\;\;\;\;\sqrt{\frac{c0}{V} \cdot \left(A \cdot \frac{c0}{\ell}\right)}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2.0000024e-318Initial program 48.2%
sqrt-div37.3%
associate-*r/37.2%
Applied egg-rr37.2%
associate-*l/37.4%
Simplified37.4%
expm1-log1p-u37.2%
expm1-udef25.1%
associate-*l/25.0%
associate-/l*25.1%
sqrt-div47.3%
associate-*r/48.9%
Applied egg-rr48.9%
expm1-def54.2%
expm1-log1p56.1%
Simplified56.1%
add-sqr-sqrt52.4%
sqrt-unprod49.0%
frac-times48.6%
add-sqr-sqrt48.6%
Applied egg-rr48.6%
times-frac63.1%
associate-/r/63.0%
Simplified63.0%
if 2.0000024e-318 < (/.f64 A (*.f64 V l)) < 5e302Initial program 98.3%
if 5e302 < (/.f64 A (*.f64 V l)) Initial program 32.1%
pow1/232.1%
clear-num32.1%
inv-pow32.1%
pow-pow33.3%
associate-/l*49.3%
metadata-eval49.3%
Applied egg-rr49.3%
associate-/l*33.3%
*-lft-identity33.3%
times-frac49.3%
/-rgt-identity49.3%
Simplified49.3%
Final simplification79.0%
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 (* l V))))
(if (<= t_0 2e-318)
(sqrt (* (/ c0 V) (/ (* A c0) l)))
(if (<= t_0 5e+302) (* c0 (sqrt t_0)) (* c0 (pow (* V (/ l A)) -0.5))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 2e-318) {
tmp = sqrt(((c0 / V) * ((A * c0) / l)));
} else if (t_0 <= 5e+302) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
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 / (l * v)
if (t_0 <= 2d-318) then
tmp = sqrt(((c0 / v) * ((a * c0) / l)))
else if (t_0 <= 5d+302) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
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 / (l * V);
double tmp;
if (t_0 <= 2e-318) {
tmp = Math.sqrt(((c0 / V) * ((A * c0) / l)));
} else if (t_0 <= 5e+302) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if t_0 <= 2e-318: tmp = math.sqrt(((c0 / V) * ((A * c0) / l))) elif t_0 <= 5e+302: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow((V * (l / A)), -0.5) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 2e-318) tmp = sqrt(Float64(Float64(c0 / V) * Float64(Float64(A * c0) / l))); elseif (t_0 <= 5e+302) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if (t_0 <= 2e-318)
tmp = sqrt(((c0 / V) * ((A * c0) / l)));
elseif (t_0 <= 5e+302)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * ((V * (l / A)) ^ -0.5);
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[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-318], N[Sqrt[N[(N[(c0 / V), $MachinePrecision] * N[(N[(A * c0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 5e+302], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-318}:\\
\;\;\;\;\sqrt{\frac{c0}{V} \cdot \frac{A \cdot c0}{\ell}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2.0000024e-318Initial program 48.2%
sqrt-div37.3%
associate-*r/37.2%
Applied egg-rr37.2%
associate-*l/37.4%
Simplified37.4%
expm1-log1p-u37.2%
expm1-udef25.1%
associate-*l/25.0%
associate-/l*25.1%
sqrt-div47.3%
associate-*r/48.9%
Applied egg-rr48.9%
expm1-def54.2%
expm1-log1p56.1%
Simplified56.1%
add-sqr-sqrt52.4%
sqrt-unprod49.0%
frac-times48.6%
add-sqr-sqrt48.6%
Applied egg-rr48.6%
times-frac63.1%
Simplified63.1%
Taylor expanded in c0 around 0 63.1%
if 2.0000024e-318 < (/.f64 A (*.f64 V l)) < 5e302Initial program 98.3%
if 5e302 < (/.f64 A (*.f64 V l)) Initial program 32.1%
pow1/232.1%
clear-num32.1%
inv-pow32.1%
pow-pow33.3%
associate-/l*49.3%
metadata-eval49.3%
Applied egg-rr49.3%
associate-/l*33.3%
*-lft-identity33.3%
times-frac49.3%
/-rgt-identity49.3%
Simplified49.3%
Final simplification79.0%
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 (* l V))))
(if (or (<= t_0 0.0) (not (<= t_0 5e+272)))
(* c0 (sqrt (/ (/ A V) l)))
(* c0 (sqrt t_0)))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+272)) {
tmp = c0 * sqrt(((A / V) / l));
} 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 / (l * v)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+272))) then
tmp = c0 * sqrt(((a / v) / l))
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 / (l * V);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+272)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+272): tmp = c0 * math.sqrt(((A / V) / l)) 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(l * V)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 5e+272)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); 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 / (l * V);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 5e+272)))
tmp = c0 * sqrt(((A / V) / l));
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[(l * V), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+272]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $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}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 5 \cdot 10^{+272}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 4.99999999999999973e272 < (/.f64 A (*.f64 V l)) Initial program 40.0%
associate-/r*52.3%
div-inv52.3%
Applied egg-rr52.3%
un-div-inv52.3%
Applied egg-rr52.3%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.99999999999999973e272Initial program 98.0%
Final simplification77.3%
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 (* l V))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 5e+302) (* 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 / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 5e+302) {
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 / (l * v)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 5d+302) 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 / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 5e+302) {
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 / (l * V) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 5e+302: 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(l * V)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 5e+302) 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 / (l * V);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 5e+302)
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[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+302], 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}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;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 48.1%
associate-/r*57.1%
div-inv57.1%
Applied egg-rr57.1%
un-div-inv57.1%
Applied egg-rr57.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 5e302Initial program 98.0%
if 5e302 < (/.f64 A (*.f64 V l)) Initial program 32.1%
sqrt-div42.3%
associate-*r/42.2%
Applied egg-rr42.2%
associate-*l/42.4%
Simplified42.4%
expm1-log1p-u25.6%
expm1-udef18.6%
associate-*l/18.6%
associate-/l*18.6%
sqrt-div17.8%
associate-*r/22.1%
Applied egg-rr22.1%
expm1-def26.5%
expm1-log1p49.3%
Simplified49.3%
Final simplification77.7%
NOTE: 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(V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (l * V)));
}
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 / (l * v)))
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (l * V)));
}
[V, l] = sort([V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (l * V)))
V, l = sort([V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(l * V)))) end
V, l = num2cell(sort([V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (l * V)));
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[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}
\end{array}
Initial program 71.7%
Final simplification71.7%
herbie shell --seed 2023242
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))