
(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: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* l (/ V A))))
(if (<= (* V l) (- INFINITY))
(* c0 (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* V l) -5e-299)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 2e-302)
(* c0 (pow t_0 -0.5))
(if (<= (* V l) 1e+300)
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))
(* c0 (sqrt (pow t_0 -1.0)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = l * (V / A);
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= -5e-299) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 2e-302) {
tmp = c0 * pow(t_0, -0.5);
} else if ((V * l) <= 1e+300) {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
} else {
tmp = c0 * sqrt(pow(t_0, -1.0));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = l * (V / A);
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((V * l) <= -5e-299) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 2e-302) {
tmp = c0 * Math.pow(t_0, -0.5);
} else if ((V * l) <= 1e+300) {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
} else {
tmp = c0 * Math.sqrt(Math.pow(t_0, -1.0));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = l * (V / A) tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= -5e-299: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 2e-302: tmp = c0 * math.pow(t_0, -0.5) elif (V * l) <= 1e+300: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) else: tmp = c0 * math.sqrt(math.pow(t_0, -1.0)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(l * Float64(V / A)) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -5e-299) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 2e-302) tmp = Float64(c0 * (t_0 ^ -0.5)); elseif (Float64(V * l) <= 1e+300) tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); else tmp = Float64(c0 * sqrt((t_0 ^ -1.0))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = l * (V / A);
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= -5e-299)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 2e-302)
tmp = c0 * (t_0 ^ -0.5);
elseif ((V * l) <= 1e+300)
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
else
tmp = c0 * sqrt((t_0 ^ -1.0));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-299], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-302], N[(c0 * N[Power[t$95$0, -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+300], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[Power[t$95$0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \ell \cdot \frac{V}{A}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-299}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-302}:\\
\;\;\;\;c0 \cdot {t\_0}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+300}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{{t\_0}^{-1}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 30.1%
*-un-lft-identity30.1%
times-frac72.0%
Applied egg-rr72.0%
associate-*l/72.1%
*-un-lft-identity72.1%
Applied egg-rr72.1%
frac-2neg72.1%
sqrt-div55.2%
distribute-neg-frac55.2%
Applied egg-rr55.2%
if -inf.0 < (*.f64 V l) < -4.99999999999999956e-299Initial program 85.4%
frac-2neg85.4%
sqrt-div99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -4.99999999999999956e-299 < (*.f64 V l) < 1.9999999999999999e-302Initial program 38.5%
*-un-lft-identity38.5%
times-frac69.7%
Applied egg-rr69.7%
associate-*l/69.7%
*-un-lft-identity69.7%
Applied egg-rr69.7%
clear-num69.7%
sqrt-div69.5%
metadata-eval69.5%
div-inv69.6%
clear-num69.6%
pow1/269.6%
pow-flip69.7%
associate-*r/38.5%
*-commutative38.5%
associate-/l*69.8%
metadata-eval69.8%
Applied egg-rr69.8%
if 1.9999999999999999e-302 < (*.f64 V l) < 1.0000000000000001e300Initial program 85.8%
*-un-lft-identity85.8%
times-frac74.9%
Applied egg-rr74.9%
pow1/274.9%
associate-*l/75.0%
*-un-lft-identity75.0%
div-inv74.9%
associate-*l/74.5%
frac-times85.8%
associate-*r/85.7%
unpow-prod-down99.5%
pow1/299.5%
associate-/r*99.5%
Applied egg-rr99.5%
unpow1/299.5%
Simplified99.5%
if 1.0000000000000001e300 < (*.f64 V l) Initial program 22.6%
associate-/r*70.7%
div-inv70.6%
clear-num70.5%
frac-times70.6%
metadata-eval70.6%
inv-pow70.6%
Applied egg-rr70.6%
Final simplification90.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -2e-311) (* c0 (/ (/ (sqrt (- A)) (sqrt (- V))) (sqrt l))) (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -2e-311) {
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-2d-311)) then
tmp = c0 * ((sqrt(-a) / sqrt(-v)) / sqrt(l))
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / v) / l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -2e-311) {
tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -2e-311: tmp = c0 * ((math.sqrt(-A) / math.sqrt(-V)) / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -2e-311) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -2e-311)
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -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[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2 \cdot 10^{-311}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if A < -1.9999999999999e-311Initial program 71.0%
associate-/r*78.2%
sqrt-div46.4%
div-inv46.4%
Applied egg-rr46.4%
associate-*r/46.4%
*-rgt-identity46.4%
Simplified46.4%
frac-2neg46.4%
sqrt-div49.6%
Applied egg-rr49.6%
if -1.9999999999999e-311 < A Initial program 72.8%
*-un-lft-identity72.8%
times-frac72.5%
Applied egg-rr72.5%
pow1/272.5%
associate-*l/72.5%
*-un-lft-identity72.5%
div-inv72.5%
associate-*l/72.1%
frac-times72.8%
associate-*r/72.7%
unpow-prod-down83.1%
pow1/283.1%
associate-/r*83.1%
Applied egg-rr83.1%
unpow1/283.1%
Simplified83.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* l (/ V A))))
(if (<= (* V l) (- INFINITY))
(/ c0 (/ (sqrt l) (sqrt (/ A V))))
(if (<= (* V l) -5e-299)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 2e-302)
(* c0 (pow t_0 -0.5))
(if (<= (* V l) 1e+300)
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))
(* c0 (sqrt (pow t_0 -1.0)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = l * (V / A);
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 / (sqrt(l) / sqrt((A / V)));
} else if ((V * l) <= -5e-299) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 2e-302) {
tmp = c0 * pow(t_0, -0.5);
} else if ((V * l) <= 1e+300) {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
} else {
tmp = c0 * sqrt(pow(t_0, -1.0));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = l * (V / A);
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 / (Math.sqrt(l) / Math.sqrt((A / V)));
} else if ((V * l) <= -5e-299) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 2e-302) {
tmp = c0 * Math.pow(t_0, -0.5);
} else if ((V * l) <= 1e+300) {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
} else {
tmp = c0 * Math.sqrt(Math.pow(t_0, -1.0));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = l * (V / A) tmp = 0 if (V * l) <= -math.inf: tmp = c0 / (math.sqrt(l) / math.sqrt((A / V))) elif (V * l) <= -5e-299: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 2e-302: tmp = c0 * math.pow(t_0, -0.5) elif (V * l) <= 1e+300: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) else: tmp = c0 * math.sqrt(math.pow(t_0, -1.0)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(l * Float64(V / A)) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 / Float64(sqrt(l) / sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -5e-299) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 2e-302) tmp = Float64(c0 * (t_0 ^ -0.5)); elseif (Float64(V * l) <= 1e+300) tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); else tmp = Float64(c0 * sqrt((t_0 ^ -1.0))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = l * (V / A);
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 / (sqrt(l) / sqrt((A / V)));
elseif ((V * l) <= -5e-299)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 2e-302)
tmp = c0 * (t_0 ^ -0.5);
elseif ((V * l) <= 1e+300)
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
else
tmp = c0 * sqrt((t_0 ^ -1.0));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-299], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-302], N[(c0 * N[Power[t$95$0, -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+300], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[Power[t$95$0, -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \ell \cdot \frac{V}{A}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-299}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-302}:\\
\;\;\;\;c0 \cdot {t\_0}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+300}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{{t\_0}^{-1}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 30.1%
*-un-lft-identity30.1%
times-frac72.0%
Applied egg-rr72.0%
associate-*l/72.1%
*-un-lft-identity72.1%
div-inv72.1%
associate-*l/72.1%
un-div-inv72.1%
associate-/r*30.1%
sqrt-undiv0.0%
clear-num0.0%
un-div-inv0.0%
sqrt-undiv30.1%
associate-/l*72.0%
Applied egg-rr72.0%
*-commutative72.0%
sqrt-prod34.8%
sqrt-div0.0%
associate-/r/0.0%
sqrt-div53.9%
div-inv53.9%
Applied egg-rr53.9%
associate-*r/53.9%
*-rgt-identity53.9%
Simplified53.9%
if -inf.0 < (*.f64 V l) < -4.99999999999999956e-299Initial program 85.4%
frac-2neg85.4%
sqrt-div99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -4.99999999999999956e-299 < (*.f64 V l) < 1.9999999999999999e-302Initial program 38.5%
*-un-lft-identity38.5%
times-frac69.7%
Applied egg-rr69.7%
associate-*l/69.7%
*-un-lft-identity69.7%
Applied egg-rr69.7%
clear-num69.7%
sqrt-div69.5%
metadata-eval69.5%
div-inv69.6%
clear-num69.6%
pow1/269.6%
pow-flip69.7%
associate-*r/38.5%
*-commutative38.5%
associate-/l*69.8%
metadata-eval69.8%
Applied egg-rr69.8%
if 1.9999999999999999e-302 < (*.f64 V l) < 1.0000000000000001e300Initial program 85.8%
*-un-lft-identity85.8%
times-frac74.9%
Applied egg-rr74.9%
pow1/274.9%
associate-*l/75.0%
*-un-lft-identity75.0%
div-inv74.9%
associate-*l/74.5%
frac-times85.8%
associate-*r/85.7%
unpow-prod-down99.5%
pow1/299.5%
associate-/r*99.5%
Applied egg-rr99.5%
unpow1/299.5%
Simplified99.5%
if 1.0000000000000001e300 < (*.f64 V l) Initial program 22.6%
associate-/r*70.7%
div-inv70.6%
clear-num70.5%
frac-times70.6%
metadata-eval70.6%
inv-pow70.6%
Applied egg-rr70.6%
Final simplification90.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) 0.0)
(* c0 (* (sqrt (/ A V)) (pow l -0.5)))
(if (<= (* V l) 1e+300)
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))
(* c0 (sqrt (pow (* l (/ V A)) -1.0))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((A / V)) * pow(l, -0.5));
} else if ((V * l) <= 1e+300) {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
} else {
tmp = c0 * sqrt(pow((l * (V / A)), -1.0));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= 0.0d0) then
tmp = c0 * (sqrt((a / v)) * (l ** (-0.5d0)))
else if ((v * l) <= 1d+300) then
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / v) / l)))
else
tmp = c0 * sqrt(((l * (v / a)) ** (-1.0d0)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 * (Math.sqrt((A / V)) * Math.pow(l, -0.5));
} else if ((V * l) <= 1e+300) {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
} else {
tmp = c0 * Math.sqrt(Math.pow((l * (V / A)), -1.0));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 0.0: tmp = c0 * (math.sqrt((A / V)) * math.pow(l, -0.5)) elif (V * l) <= 1e+300: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) else: tmp = c0 * math.sqrt(math.pow((l * (V / A)), -1.0)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) * (l ^ -0.5))); elseif (Float64(V * l) <= 1e+300) tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); else tmp = Float64(c0 * sqrt((Float64(l * Float64(V / A)) ^ -1.0))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= 0.0)
tmp = c0 * (sqrt((A / V)) * (l ^ -0.5));
elseif ((V * l) <= 1e+300)
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
else
tmp = c0 * sqrt(((l * (V / A)) ^ -1.0));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+300], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot {\ell}^{-0.5}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+300}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{{\left(\ell \cdot \frac{V}{A}\right)}^{-1}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 67.2%
*-un-lft-identity67.2%
times-frac73.2%
Applied egg-rr73.2%
associate-*l/73.3%
*-un-lft-identity73.3%
div-inv73.3%
associate-*l/76.2%
sqrt-prod45.2%
*-commutative45.2%
inv-pow45.2%
sqrt-pow145.3%
metadata-eval45.3%
Applied egg-rr45.3%
if 0.0 < (*.f64 V l) < 1.0000000000000001e300Initial program 86.2%
*-un-lft-identity86.2%
times-frac75.5%
Applied egg-rr75.5%
pow1/275.5%
associate-*l/75.6%
*-un-lft-identity75.6%
div-inv75.5%
associate-*l/75.0%
frac-times86.2%
associate-*r/86.0%
unpow-prod-down99.4%
pow1/299.4%
associate-/r*99.5%
Applied egg-rr99.5%
unpow1/299.5%
Simplified99.5%
if 1.0000000000000001e300 < (*.f64 V l) Initial program 22.6%
associate-/r*70.7%
div-inv70.6%
clear-num70.5%
frac-times70.6%
metadata-eval70.6%
inv-pow70.6%
Applied egg-rr70.6%
Final simplification64.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) 0.0)
(* c0 (* (sqrt (/ A V)) (pow l -0.5)))
(if (<= (* V l) 5e+295)
(* c0 (* (sqrt A) (pow (* V l) -0.5)))
(/ c0 (sqrt (* V (/ l A)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((A / V)) * pow(l, -0.5));
} else if ((V * l) <= 5e+295) {
tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= 0.0d0) then
tmp = c0 * (sqrt((a / v)) * (l ** (-0.5d0)))
else if ((v * l) <= 5d+295) then
tmp = c0 * (sqrt(a) * ((v * l) ** (-0.5d0)))
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 * (Math.sqrt((A / V)) * Math.pow(l, -0.5));
} else if ((V * l) <= 5e+295) {
tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 0.0: tmp = c0 * (math.sqrt((A / V)) * math.pow(l, -0.5)) elif (V * l) <= 5e+295: tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5)) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) * (l ^ -0.5))); elseif (Float64(V * l) <= 5e+295) tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= 0.0)
tmp = c0 * (sqrt((A / V)) * (l ^ -0.5));
elseif ((V * l) <= 5e+295)
tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+295], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot {\ell}^{-0.5}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+295}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 67.2%
*-un-lft-identity67.2%
times-frac73.2%
Applied egg-rr73.2%
associate-*l/73.3%
*-un-lft-identity73.3%
div-inv73.3%
associate-*l/76.2%
sqrt-prod45.2%
*-commutative45.2%
inv-pow45.2%
sqrt-pow145.3%
metadata-eval45.3%
Applied egg-rr45.3%
if 0.0 < (*.f64 V l) < 4.99999999999999991e295Initial program 86.0%
*-un-lft-identity86.0%
times-frac75.2%
Applied egg-rr75.2%
sqrt-prod35.7%
sqrt-div35.7%
metadata-eval35.7%
sqrt-div42.6%
times-frac42.6%
sqrt-prod99.4%
*-commutative99.4%
associate-*r/99.3%
*-commutative99.3%
pow1/299.3%
pow-flip99.5%
metadata-eval99.5%
Applied egg-rr99.5%
if 4.99999999999999991e295 < (*.f64 V l) Initial program 29.5%
*-un-lft-identity29.5%
times-frac73.4%
Applied egg-rr73.4%
associate-*l/73.0%
*-un-lft-identity73.0%
div-inv73.0%
associate-*l/73.1%
un-div-inv73.2%
associate-/r*29.5%
sqrt-undiv29.6%
clear-num29.6%
un-div-inv29.6%
sqrt-undiv29.6%
associate-/l*73.4%
Applied egg-rr73.4%
Final simplification64.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) 0.0)
(* c0 (* (sqrt (/ A V)) (pow l -0.5)))
(if (<= (* V l) 1e+300)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (sqrt (pow (* l (/ V A)) -1.0))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((A / V)) * pow(l, -0.5));
} else if ((V * l) <= 1e+300) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * sqrt(pow((l * (V / A)), -1.0));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= 0.0d0) then
tmp = c0 * (sqrt((a / v)) * (l ** (-0.5d0)))
else if ((v * l) <= 1d+300) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = c0 * sqrt(((l * (v / a)) ** (-1.0d0)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 * (Math.sqrt((A / V)) * Math.pow(l, -0.5));
} else if ((V * l) <= 1e+300) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(Math.pow((l * (V / A)), -1.0));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 0.0: tmp = c0 * (math.sqrt((A / V)) * math.pow(l, -0.5)) elif (V * l) <= 1e+300: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(math.pow((l * (V / A)), -1.0)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) * (l ^ -0.5))); elseif (Float64(V * l) <= 1e+300) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 * sqrt((Float64(l * Float64(V / A)) ^ -1.0))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= 0.0)
tmp = c0 * (sqrt((A / V)) * (l ^ -0.5));
elseif ((V * l) <= 1e+300)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 * sqrt(((l * (V / A)) ^ -1.0));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+300], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot {\ell}^{-0.5}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+300}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{{\left(\ell \cdot \frac{V}{A}\right)}^{-1}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 67.2%
*-un-lft-identity67.2%
times-frac73.2%
Applied egg-rr73.2%
associate-*l/73.3%
*-un-lft-identity73.3%
div-inv73.3%
associate-*l/76.2%
sqrt-prod45.2%
*-commutative45.2%
inv-pow45.2%
sqrt-pow145.3%
metadata-eval45.3%
Applied egg-rr45.3%
if 0.0 < (*.f64 V l) < 1.0000000000000001e300Initial program 86.2%
*-un-lft-identity86.2%
times-frac75.5%
Applied egg-rr75.5%
associate-*l/75.6%
*-un-lft-identity75.6%
div-inv75.5%
associate-*l/75.0%
un-div-inv75.1%
associate-/r*86.2%
sqrt-undiv99.4%
clear-num99.3%
un-div-inv99.4%
sqrt-undiv86.1%
associate-/l*74.7%
Applied egg-rr74.7%
associate-*r/86.1%
sqrt-div99.4%
*-commutative99.4%
Applied egg-rr99.4%
if 1.0000000000000001e300 < (*.f64 V l) Initial program 22.6%
associate-/r*70.7%
div-inv70.6%
clear-num70.5%
frac-times70.6%
metadata-eval70.6%
inv-pow70.6%
Applied egg-rr70.6%
Final simplification64.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) 0.0)
(/ c0 (/ (sqrt l) (sqrt (/ A V))))
(if (<= (* V l) 1e+300)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (sqrt (pow (* l (/ V A)) -1.0))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) / sqrt((A / V)));
} else if ((V * l) <= 1e+300) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * sqrt(pow((l * (V / A)), -1.0));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt(l) / sqrt((a / v)))
else if ((v * l) <= 1d+300) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = c0 * sqrt(((l * (v / a)) ** (-1.0d0)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt(l) / Math.sqrt((A / V)));
} else if ((V * l) <= 1e+300) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(Math.pow((l * (V / A)), -1.0));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) / math.sqrt((A / V))) elif (V * l) <= 1e+300: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(math.pow((l * (V / A)), -1.0)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) / sqrt(Float64(A / V)))); elseif (Float64(V * l) <= 1e+300) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 * sqrt((Float64(l * Float64(V / A)) ^ -1.0))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= 0.0)
tmp = c0 / (sqrt(l) / sqrt((A / V)));
elseif ((V * l) <= 1e+300)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 * sqrt(((l * (V / A)) ^ -1.0));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+300], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+300}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{{\left(\ell \cdot \frac{V}{A}\right)}^{-1}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 67.2%
*-un-lft-identity67.2%
times-frac73.2%
Applied egg-rr73.2%
associate-*l/73.3%
*-un-lft-identity73.3%
div-inv73.3%
associate-*l/76.2%
un-div-inv76.2%
associate-/r*67.2%
sqrt-undiv2.9%
clear-num2.9%
un-div-inv2.9%
sqrt-undiv67.1%
associate-/l*72.5%
Applied egg-rr72.5%
*-commutative72.5%
sqrt-prod39.4%
sqrt-div3.1%
associate-/r/3.1%
sqrt-div45.3%
div-inv45.3%
Applied egg-rr45.3%
associate-*r/45.3%
*-rgt-identity45.3%
Simplified45.3%
if 0.0 < (*.f64 V l) < 1.0000000000000001e300Initial program 86.2%
*-un-lft-identity86.2%
times-frac75.5%
Applied egg-rr75.5%
associate-*l/75.6%
*-un-lft-identity75.6%
div-inv75.5%
associate-*l/75.0%
un-div-inv75.1%
associate-/r*86.2%
sqrt-undiv99.4%
clear-num99.3%
un-div-inv99.4%
sqrt-undiv86.1%
associate-/l*74.7%
Applied egg-rr74.7%
associate-*r/86.1%
sqrt-div99.4%
*-commutative99.4%
Applied egg-rr99.4%
if 1.0000000000000001e300 < (*.f64 V l) Initial program 22.6%
associate-/r*70.7%
div-inv70.6%
clear-num70.5%
frac-times70.6%
metadata-eval70.6%
inv-pow70.6%
Applied egg-rr70.6%
Final simplification64.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) 0.0)
(/ c0 (/ (sqrt l) (sqrt (/ A V))))
(if (<= (* V l) 1e+300)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (/ 1.0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) / sqrt((A / V)));
} else if ((V * l) <= 1e+300) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * (1.0 / sqrt((l * (V / A))));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt(l) / sqrt((a / v)))
else if ((v * l) <= 1d+300) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = c0 * (1.0d0 / sqrt((l * (v / a))))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt(l) / Math.sqrt((A / V)));
} else if ((V * l) <= 1e+300) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * (1.0 / Math.sqrt((l * (V / A))));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) / math.sqrt((A / V))) elif (V * l) <= 1e+300: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * (1.0 / math.sqrt((l * (V / A)))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) / sqrt(Float64(A / V)))); elseif (Float64(V * l) <= 1e+300) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 * Float64(1.0 / sqrt(Float64(l * Float64(V / A))))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= 0.0)
tmp = c0 / (sqrt(l) / sqrt((A / V)));
elseif ((V * l) <= 1e+300)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 * (1.0 / sqrt((l * (V / A))));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+300], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(1.0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+300}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 67.2%
*-un-lft-identity67.2%
times-frac73.2%
Applied egg-rr73.2%
associate-*l/73.3%
*-un-lft-identity73.3%
div-inv73.3%
associate-*l/76.2%
un-div-inv76.2%
associate-/r*67.2%
sqrt-undiv2.9%
clear-num2.9%
un-div-inv2.9%
sqrt-undiv67.1%
associate-/l*72.5%
Applied egg-rr72.5%
*-commutative72.5%
sqrt-prod39.4%
sqrt-div3.1%
associate-/r/3.1%
sqrt-div45.3%
div-inv45.3%
Applied egg-rr45.3%
associate-*r/45.3%
*-rgt-identity45.3%
Simplified45.3%
if 0.0 < (*.f64 V l) < 1.0000000000000001e300Initial program 86.2%
*-un-lft-identity86.2%
times-frac75.5%
Applied egg-rr75.5%
associate-*l/75.6%
*-un-lft-identity75.6%
div-inv75.5%
associate-*l/75.0%
un-div-inv75.1%
associate-/r*86.2%
sqrt-undiv99.4%
clear-num99.3%
un-div-inv99.4%
sqrt-undiv86.1%
associate-/l*74.7%
Applied egg-rr74.7%
associate-*r/86.1%
sqrt-div99.4%
*-commutative99.4%
Applied egg-rr99.4%
if 1.0000000000000001e300 < (*.f64 V l) Initial program 22.6%
associate-/r*70.7%
clear-num70.9%
sqrt-div70.7%
metadata-eval70.7%
div-inv70.7%
clear-num70.7%
Applied egg-rr70.7%
Final simplification64.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) 0.0)
(/ c0 (/ (sqrt l) (sqrt (/ A V))))
(if (<= (* V l) 1e+300)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (/ 1.0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) / sqrt((A / V)));
} else if ((V * l) <= 1e+300) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * (1.0 / sqrt((l * (V / A))));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt(l) / sqrt((a / v)))
else if ((v * l) <= 1d+300) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * (1.0d0 / sqrt((l * (v / a))))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt(l) / Math.sqrt((A / V)));
} else if ((V * l) <= 1e+300) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * (1.0 / Math.sqrt((l * (V / A))));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) / math.sqrt((A / V))) elif (V * l) <= 1e+300: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * (1.0 / math.sqrt((l * (V / A)))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) / sqrt(Float64(A / V)))); elseif (Float64(V * l) <= 1e+300) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * Float64(1.0 / sqrt(Float64(l * Float64(V / A))))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= 0.0)
tmp = c0 / (sqrt(l) / sqrt((A / V)));
elseif ((V * l) <= 1e+300)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * (1.0 / sqrt((l * (V / A))));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+300], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(1.0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+300}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 67.2%
*-un-lft-identity67.2%
times-frac73.2%
Applied egg-rr73.2%
associate-*l/73.3%
*-un-lft-identity73.3%
div-inv73.3%
associate-*l/76.2%
un-div-inv76.2%
associate-/r*67.2%
sqrt-undiv2.9%
clear-num2.9%
un-div-inv2.9%
sqrt-undiv67.1%
associate-/l*72.5%
Applied egg-rr72.5%
*-commutative72.5%
sqrt-prod39.4%
sqrt-div3.1%
associate-/r/3.1%
sqrt-div45.3%
div-inv45.3%
Applied egg-rr45.3%
associate-*r/45.3%
*-rgt-identity45.3%
Simplified45.3%
if 0.0 < (*.f64 V l) < 1.0000000000000001e300Initial program 86.2%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 1.0000000000000001e300 < (*.f64 V l) Initial program 22.6%
associate-/r*70.7%
clear-num70.9%
sqrt-div70.7%
metadata-eval70.7%
div-inv70.7%
clear-num70.7%
Applied egg-rr70.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) 0.0)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) 1e+300)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (/ 1.0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= 1e+300) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * (1.0 / sqrt((l * (V / A))));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= 0.0d0) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= 1d+300) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * (1.0d0 / sqrt((l * (v / a))))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= 1e+300) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * (1.0 / Math.sqrt((l * (V / A))));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 0.0: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= 1e+300: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * (1.0 / math.sqrt((l * (V / A)))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= 1e+300) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * Float64(1.0 / sqrt(Float64(l * Float64(V / A))))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= 0.0)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= 1e+300)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * (1.0 / sqrt((l * (V / A))));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+300], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(1.0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+300}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 67.2%
associate-/r*76.2%
sqrt-div45.2%
div-inv45.2%
Applied egg-rr45.2%
associate-*r/45.2%
*-rgt-identity45.2%
Simplified45.2%
if 0.0 < (*.f64 V l) < 1.0000000000000001e300Initial program 86.2%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 1.0000000000000001e300 < (*.f64 V l) Initial program 22.6%
associate-/r*70.7%
clear-num70.9%
sqrt-div70.7%
metadata-eval70.7%
div-inv70.7%
clear-num70.7%
Applied egg-rr70.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) 0.0)
(* c0 (sqrt (* (/ 1.0 V) (/ A l))))
(if (<= (* V l) 1e+300)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (/ 1.0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 * sqrt(((1.0 / V) * (A / l)));
} else if ((V * l) <= 1e+300) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * (1.0 / sqrt((l * (V / A))));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= 0.0d0) then
tmp = c0 * sqrt(((1.0d0 / v) * (a / l)))
else if ((v * l) <= 1d+300) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * (1.0d0 / sqrt((l * (v / a))))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 * Math.sqrt(((1.0 / V) * (A / l)));
} else if ((V * l) <= 1e+300) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * (1.0 / Math.sqrt((l * (V / A))));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 0.0: tmp = c0 * math.sqrt(((1.0 / V) * (A / l))) elif (V * l) <= 1e+300: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * (1.0 / math.sqrt((l * (V / A)))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / V) * Float64(A / l)))); elseif (Float64(V * l) <= 1e+300) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * Float64(1.0 / sqrt(Float64(l * Float64(V / A))))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= 0.0)
tmp = c0 * sqrt(((1.0 / V) * (A / l)));
elseif ((V * l) <= 1e+300)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * (1.0 / sqrt((l * (V / A))));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] * N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+300], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(1.0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{1}{V} \cdot \frac{A}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+300}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 67.2%
*-un-lft-identity67.2%
times-frac73.2%
Applied egg-rr73.2%
if 0.0 < (*.f64 V l) < 1.0000000000000001e300Initial program 86.2%
sqrt-div99.4%
div-inv99.3%
Applied egg-rr99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 1.0000000000000001e300 < (*.f64 V l) Initial program 22.6%
associate-/r*70.7%
clear-num70.9%
sqrt-div70.7%
metadata-eval70.7%
div-inv70.7%
clear-num70.7%
Applied egg-rr70.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 5e-315) (not (<= t_0 4e+304)))
(* c0 (sqrt (/ (/ A V) l)))
(* c0 (sqrt t_0)))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 5e-315) || !(t_0 <= 4e+304)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 5d-315) .or. (.not. (t_0 <= 4d+304))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 5e-315) || !(t_0 <= 4e+304)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 5e-315) or not (t_0 <= 4e+304): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.sqrt(t_0) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 5e-315) || !(t_0 <= 4e+304)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 5e-315) || ~((t_0 <= 4e+304)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 5e-315], N[Not[LessEqual[t$95$0, 4e+304]], $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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-315} \lor \neg \left(t\_0 \leq 4 \cdot 10^{+304}\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)) < 5.0000000023e-315 or 3.9999999999999998e304 < (/.f64 A (*.f64 V l)) Initial program 33.1%
*-commutative33.1%
associate-/l/56.8%
Simplified56.8%
if 5.0000000023e-315 < (/.f64 A (*.f64 V l)) < 3.9999999999999998e304Initial program 99.6%
Final simplification81.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(/ c0 (sqrt (* l (/ V A))))
(if (<= t_0 2e+290) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / sqrt((l * (V / A)));
} else if (t_0 <= 2e+290) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 / sqrt((l * (v / a)))
else if (t_0 <= 2d+290) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if (t_0 <= 2e+290) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 / math.sqrt((l * (V / A))) elif t_0 <= 2e+290: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (t_0 <= 2e+290) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 / sqrt((l * (V / A)));
elseif (t_0 <= 2e+290)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+290], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+290}:\\
\;\;\;\;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 24.9%
*-un-lft-identity24.9%
times-frac54.6%
Applied egg-rr54.6%
associate-*l/54.6%
*-un-lft-identity54.6%
div-inv54.6%
associate-*l/54.6%
un-div-inv54.6%
associate-/r*24.9%
sqrt-undiv15.4%
clear-num15.5%
un-div-inv15.4%
sqrt-undiv24.9%
associate-/l*54.5%
Applied egg-rr54.5%
associate-*r/24.9%
associate-*l/54.6%
*-commutative54.6%
Simplified54.6%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.00000000000000012e290Initial program 99.4%
if 2.00000000000000012e290 < (/.f64 A (*.f64 V l)) Initial program 42.7%
*-un-lft-identity42.7%
times-frac58.6%
Applied egg-rr58.6%
associate-*l/58.6%
*-un-lft-identity58.6%
div-inv58.6%
associate-*l/60.3%
un-div-inv60.3%
associate-/r*42.7%
sqrt-undiv32.0%
clear-num31.9%
un-div-inv32.0%
sqrt-undiv43.5%
associate-/l*58.5%
Applied egg-rr58.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 5e-315)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+290) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-315) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+290) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 5d-315) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+290) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-315) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+290) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 5e-315: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+290: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 5e-315) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+290) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 5e-315)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+290)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-315], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+290], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-315}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+290}:\\
\;\;\;\;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)) < 5.0000000023e-315Initial program 27.0%
*-commutative27.0%
associate-/l/55.7%
Simplified55.7%
if 5.0000000023e-315 < (/.f64 A (*.f64 V l)) < 2.00000000000000012e290Initial program 99.6%
if 2.00000000000000012e290 < (/.f64 A (*.f64 V l)) Initial program 42.7%
*-un-lft-identity42.7%
times-frac58.6%
Applied egg-rr58.6%
associate-*l/58.6%
*-un-lft-identity58.6%
div-inv58.6%
associate-*l/60.3%
un-div-inv60.3%
associate-/r*42.7%
sqrt-undiv32.0%
clear-num31.9%
un-div-inv32.0%
sqrt-undiv43.5%
associate-/l*58.5%
Applied egg-rr58.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 5e-315)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 4e+261) (* c0 (sqrt t_0)) (* c0 (sqrt (/ (/ A l) V)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-315) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 4e+261) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 5d-315) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 4d+261) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * sqrt(((a / l) / v))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-315) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 4e+261) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 5e-315: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 4e+261: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 5e-315) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 4e+261) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 5e-315)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 4e+261)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * sqrt(((A / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-315], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+261], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-315}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+261}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 5.0000000023e-315Initial program 27.0%
*-commutative27.0%
associate-/l/55.7%
Simplified55.7%
if 5.0000000023e-315 < (/.f64 A (*.f64 V l)) < 3.9999999999999997e261Initial program 99.6%
if 3.9999999999999997e261 < (/.f64 A (*.f64 V l)) Initial program 48.3%
*-un-lft-identity48.3%
times-frac61.1%
Applied egg-rr61.1%
associate-*l/61.1%
*-un-lft-identity61.1%
Applied egg-rr61.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 71.8%
herbie shell --seed 2024131
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))