
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -5e-324)
(* c0 (/ (* (sqrt (- A)) (sqrt (/ 1.0 l))) (sqrt (- V))))
(if (<= (* V l) 1e-321)
(/ 1.0 (/ (sqrt (* l (/ V A))) c0))
(if (<= (* V l) 2e+288)
(* c0 (* (sqrt (/ 1.0 (* V l))) (sqrt A)))
(* c0 (sqrt (/ (/ A V) l)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-324) {
tmp = c0 * ((sqrt(-A) * sqrt((1.0 / l))) / sqrt(-V));
} else if ((V * l) <= 1e-321) {
tmp = 1.0 / (sqrt((l * (V / A))) / c0);
} else if ((V * l) <= 2e+288) {
tmp = c0 * (sqrt((1.0 / (V * l))) * sqrt(A));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-5d-324)) then
tmp = c0 * ((sqrt(-a) * sqrt((1.0d0 / l))) / sqrt(-v))
else if ((v * l) <= 1d-321) then
tmp = 1.0d0 / (sqrt((l * (v / a))) / c0)
else if ((v * l) <= 2d+288) then
tmp = c0 * (sqrt((1.0d0 / (v * l))) * sqrt(a))
else
tmp = c0 * sqrt(((a / v) / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-324) {
tmp = c0 * ((Math.sqrt(-A) * Math.sqrt((1.0 / l))) / Math.sqrt(-V));
} else if ((V * l) <= 1e-321) {
tmp = 1.0 / (Math.sqrt((l * (V / A))) / c0);
} else if ((V * l) <= 2e+288) {
tmp = c0 * (Math.sqrt((1.0 / (V * l))) * Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e-324: tmp = c0 * ((math.sqrt(-A) * math.sqrt((1.0 / l))) / math.sqrt(-V)) elif (V * l) <= 1e-321: tmp = 1.0 / (math.sqrt((l * (V / A))) / c0) elif (V * l) <= 2e+288: tmp = c0 * (math.sqrt((1.0 / (V * l))) * math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e-324) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) * sqrt(Float64(1.0 / l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= 1e-321) tmp = Float64(1.0 / Float64(sqrt(Float64(l * Float64(V / A))) / c0)); elseif (Float64(V * l) <= 2e+288) tmp = Float64(c0 * Float64(sqrt(Float64(1.0 / Float64(V * l))) * sqrt(A))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e-324)
tmp = c0 * ((sqrt(-A) * sqrt((1.0 / l))) / sqrt(-V));
elseif ((V * l) <= 1e-321)
tmp = 1.0 / (sqrt((l * (V / A))) / c0);
elseif ((V * l) <= 2e+288)
tmp = c0 * (sqrt((1.0 / (V * l))) * sqrt(A));
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e-324], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] * N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-321], N[(1.0 / N[(N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+288], N[(c0 * N[(N[Sqrt[N[(1.0 / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-324}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A} \cdot \sqrt{\frac{1}{\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-321}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\ell \cdot \frac{V}{A}}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+288}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{1}{V \cdot \ell}} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.94066e-324Initial program 73.1%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6469.9
Applied egg-rr69.9%
lift-/.f64N/A
div-invN/A
sqrt-prodN/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
pow1/2N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f6441.0
Applied egg-rr41.0%
if -4.94066e-324 < (*.f64 V l) < 9.98013e-322Initial program 48.9%
lift-*.f64N/A
sqrt-divN/A
associate-*r/N/A
clear-numN/A
*-commutativeN/A
lower-/.f64N/A
associate-/r*N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6448.9
Applied egg-rr48.9%
associate-*l/N/A
lower-*.f64N/A
lower-/.f6483.9
Applied egg-rr83.9%
if 9.98013e-322 < (*.f64 V l) < 2e288Initial program 84.2%
lift-*.f64N/A
clear-numN/A
associate-/r/N/A
sqrt-prodN/A
pow1/2N/A
lower-*.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6499.5
Applied egg-rr99.5%
if 2e288 < (*.f64 V l) Initial program 47.2%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6473.4
Applied egg-rr73.4%
Final simplification70.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -4e+257)
(* (sqrt (/ 1.0 l)) (* c0 (sqrt (/ A V))))
(if (<= (* V l) -2e-290)
(* c0 (* (sqrt (- A)) (/ 1.0 (sqrt (* V (- l))))))
(if (<= (* V l) 1e-321)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* V l) 2e+288)
(* c0 (* (sqrt (/ 1.0 (* V l))) (sqrt A)))
(* c0 (sqrt (/ (/ A V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -4e+257) {
tmp = sqrt((1.0 / l)) * (c0 * sqrt((A / V)));
} else if ((V * l) <= -2e-290) {
tmp = c0 * (sqrt(-A) * (1.0 / sqrt((V * -l))));
} else if ((V * l) <= 1e-321) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((V * l) <= 2e+288) {
tmp = c0 * (sqrt((1.0 / (V * l))) * sqrt(A));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-4d+257)) then
tmp = sqrt((1.0d0 / l)) * (c0 * sqrt((a / v)))
else if ((v * l) <= (-2d-290)) then
tmp = c0 * (sqrt(-a) * (1.0d0 / sqrt((v * -l))))
else if ((v * l) <= 1d-321) then
tmp = c0 / sqrt((l * (v / a)))
else if ((v * l) <= 2d+288) then
tmp = c0 * (sqrt((1.0d0 / (v * l))) * sqrt(a))
else
tmp = c0 * sqrt(((a / v) / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -4e+257) {
tmp = Math.sqrt((1.0 / l)) * (c0 * Math.sqrt((A / V)));
} else if ((V * l) <= -2e-290) {
tmp = c0 * (Math.sqrt(-A) * (1.0 / Math.sqrt((V * -l))));
} else if ((V * l) <= 1e-321) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 2e+288) {
tmp = c0 * (Math.sqrt((1.0 / (V * l))) * Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -4e+257: tmp = math.sqrt((1.0 / l)) * (c0 * math.sqrt((A / V))) elif (V * l) <= -2e-290: tmp = c0 * (math.sqrt(-A) * (1.0 / math.sqrt((V * -l)))) elif (V * l) <= 1e-321: tmp = c0 / math.sqrt((l * (V / A))) elif (V * l) <= 2e+288: tmp = c0 * (math.sqrt((1.0 / (V * l))) * math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -4e+257) tmp = Float64(sqrt(Float64(1.0 / l)) * Float64(c0 * sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -2e-290) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) * Float64(1.0 / sqrt(Float64(V * Float64(-l)))))); elseif (Float64(V * l) <= 1e-321) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(V * l) <= 2e+288) tmp = Float64(c0 * Float64(sqrt(Float64(1.0 / Float64(V * l))) * sqrt(A))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -4e+257)
tmp = sqrt((1.0 / l)) * (c0 * sqrt((A / V)));
elseif ((V * l) <= -2e-290)
tmp = c0 * (sqrt(-A) * (1.0 / sqrt((V * -l))));
elseif ((V * l) <= 1e-321)
tmp = c0 / sqrt((l * (V / A)));
elseif ((V * l) <= 2e+288)
tmp = c0 * (sqrt((1.0 / (V * l))) * sqrt(A));
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -4e+257], N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] * N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-290], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] * N[(1.0 / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-321], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+288], N[(c0 * N[(N[Sqrt[N[(1.0 / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+257}:\\
\;\;\;\;\sqrt{\frac{1}{\ell}} \cdot \left(c0 \cdot \sqrt{\frac{A}{V}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-290}:\\
\;\;\;\;c0 \cdot \left(\sqrt{-A} \cdot \frac{1}{\sqrt{V \cdot \left(-\ell\right)}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-321}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+288}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{1}{V \cdot \ell}} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.00000000000000012e257Initial program 41.5%
associate-/r*N/A
div-invN/A
sqrt-prodN/A
pow1/2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
lower-/.f6435.4
Applied egg-rr35.4%
if -4.00000000000000012e257 < (*.f64 V l) < -2.0000000000000001e-290Initial program 83.3%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6472.8
Applied egg-rr72.8%
associate-/r*N/A
lift-*.f64N/A
clear-numN/A
lift-/.f64N/A
sqrt-divN/A
metadata-evalN/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6499.4
Applied egg-rr99.4%
if -2.0000000000000001e-290 < (*.f64 V l) < 9.98013e-322Initial program 47.9%
lift-*.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6449.2
Applied egg-rr49.2%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6481.8
Applied egg-rr81.8%
if 9.98013e-322 < (*.f64 V l) < 2e288Initial program 84.2%
lift-*.f64N/A
clear-numN/A
associate-/r/N/A
sqrt-prodN/A
pow1/2N/A
lower-*.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6499.5
Applied egg-rr99.5%
if 2e288 < (*.f64 V l) Initial program 47.2%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6473.4
Applied egg-rr73.4%
Final simplification89.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -2e-290)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 1e-321)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* V l) 2e+288)
(* c0 (* (sqrt (/ 1.0 (* V l))) (sqrt A)))
(* c0 (sqrt (/ (/ A V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -2e-290) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 1e-321) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((V * l) <= 2e+288) {
tmp = c0 * (sqrt((1.0 / (V * l))) * sqrt(A));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -2e-290) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 1e-321) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 2e+288) {
tmp = c0 * (Math.sqrt((1.0 / (V * l))) * Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -2e-290: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 1e-321: tmp = c0 / math.sqrt((l * (V / A))) elif (V * l) <= 2e+288: tmp = c0 * (math.sqrt((1.0 / (V * l))) * math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -2e-290) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 1e-321) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(V * l) <= 2e+288) tmp = Float64(c0 * Float64(sqrt(Float64(1.0 / Float64(V * l))) * sqrt(A))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -2e-290)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 1e-321)
tmp = c0 / sqrt((l * (V / A)));
elseif ((V * l) <= 2e+288)
tmp = c0 * (sqrt((1.0 / (V * l))) * sqrt(A));
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-290], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-321], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+288], N[(c0 * N[(N[Sqrt[N[(1.0 / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-290}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-321}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+288}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{1}{V \cdot \ell}} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 26.6%
associate-/r*N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6436.1
Applied egg-rr36.1%
if -inf.0 < (*.f64 V l) < -2.0000000000000001e-290Initial program 83.3%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6473.5
Applied egg-rr73.5%
associate-/r*N/A
lift-*.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6499.4
Applied egg-rr99.4%
if -2.0000000000000001e-290 < (*.f64 V l) < 9.98013e-322Initial program 47.9%
lift-*.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6449.2
Applied egg-rr49.2%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6481.8
Applied egg-rr81.8%
if 9.98013e-322 < (*.f64 V l) < 2e288Initial program 84.2%
lift-*.f64N/A
clear-numN/A
associate-/r/N/A
sqrt-prodN/A
pow1/2N/A
lower-*.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6499.5
Applied egg-rr99.5%
if 2e288 < (*.f64 V l) Initial program 47.2%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6473.4
Applied egg-rr73.4%
Final simplification91.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* c0 (sqrt (/ (/ A l) V)))
(if (<= (* V l) -2e-290)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 1e-321)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* V l) 2e+288)
(* c0 (* (sqrt (/ 1.0 (* V l))) (sqrt A)))
(* c0 (sqrt (/ (/ A V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * sqrt(((A / l) / V));
} else if ((V * l) <= -2e-290) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 1e-321) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((V * l) <= 2e+288) {
tmp = c0 * (sqrt((1.0 / (V * l))) * sqrt(A));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if ((V * l) <= -2e-290) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 1e-321) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 2e+288) {
tmp = c0 * (Math.sqrt((1.0 / (V * l))) * Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * math.sqrt(((A / l) / V)) elif (V * l) <= -2e-290: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 1e-321: tmp = c0 / math.sqrt((l * (V / A))) elif (V * l) <= 2e+288: tmp = c0 * (math.sqrt((1.0 / (V * l))) * math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (Float64(V * l) <= -2e-290) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 1e-321) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(V * l) <= 2e+288) tmp = Float64(c0 * Float64(sqrt(Float64(1.0 / Float64(V * l))) * sqrt(A))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * sqrt(((A / l) / V));
elseif ((V * l) <= -2e-290)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 1e-321)
tmp = c0 / sqrt((l * (V / A)));
elseif ((V * l) <= 2e+288)
tmp = c0 * (sqrt((1.0 / (V * l))) * sqrt(A));
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-290], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-321], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+288], N[(c0 * N[(N[Sqrt[N[(1.0 / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-290}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-321}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+288}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{1}{V \cdot \ell}} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 26.6%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6454.6
Applied egg-rr54.6%
if -inf.0 < (*.f64 V l) < -2.0000000000000001e-290Initial program 83.3%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6473.5
Applied egg-rr73.5%
associate-/r*N/A
lift-*.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6499.4
Applied egg-rr99.4%
if -2.0000000000000001e-290 < (*.f64 V l) < 9.98013e-322Initial program 47.9%
lift-*.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6449.2
Applied egg-rr49.2%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6481.8
Applied egg-rr81.8%
if 9.98013e-322 < (*.f64 V l) < 2e288Initial program 84.2%
lift-*.f64N/A
clear-numN/A
associate-/r/N/A
sqrt-prodN/A
pow1/2N/A
lower-*.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6499.5
Applied egg-rr99.5%
if 2e288 < (*.f64 V l) Initial program 47.2%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6473.4
Applied egg-rr73.4%
Final simplification92.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) (- INFINITY))
(* c0 (sqrt (/ (/ A l) V)))
(if (<= (* V l) -2e-290)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 1e-321)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* V l) 2e+288)
(* (sqrt A) (/ c0 (sqrt (* V l))))
(* c0 (sqrt (/ (/ A V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * sqrt(((A / l) / V));
} else if ((V * l) <= -2e-290) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 1e-321) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((V * l) <= 2e+288) {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if ((V * l) <= -2e-290) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 1e-321) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 2e+288) {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * math.sqrt(((A / l) / V)) elif (V * l) <= -2e-290: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 1e-321: tmp = c0 / math.sqrt((l * (V / A))) elif (V * l) <= 2e+288: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (Float64(V * l) <= -2e-290) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 1e-321) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(V * l) <= 2e+288) tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * sqrt(((A / l) / V));
elseif ((V * l) <= -2e-290)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 1e-321)
tmp = c0 / sqrt((l * (V / A)));
elseif ((V * l) <= 2e+288)
tmp = sqrt(A) * (c0 / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-290], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-321], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+288], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-290}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-321}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+288}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 26.6%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6454.6
Applied egg-rr54.6%
if -inf.0 < (*.f64 V l) < -2.0000000000000001e-290Initial program 83.3%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6473.5
Applied egg-rr73.5%
associate-/r*N/A
lift-*.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6499.4
Applied egg-rr99.4%
if -2.0000000000000001e-290 < (*.f64 V l) < 9.98013e-322Initial program 47.9%
lift-*.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6449.2
Applied egg-rr49.2%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6481.8
Applied egg-rr81.8%
if 9.98013e-322 < (*.f64 V l) < 2e288Initial program 84.2%
lift-*.f64N/A
sqrt-divN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6496.4
Applied egg-rr96.4%
if 2e288 < (*.f64 V l) Initial program 47.2%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6473.4
Applied egg-rr73.4%
Final simplification91.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 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 1e+226)
(/ c0 (sqrt (/ (* V l) A)))
(/ c0 (sqrt (* l (/ V 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(((A / l) / V));
} else if (t_0 <= 1e+226) {
tmp = c0 / sqrt(((V * l) / A));
} else {
tmp = c0 / 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) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 1d+226) then
tmp = c0 / sqrt(((v * l) / a))
else
tmp = c0 / 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 t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 1e+226) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else {
tmp = c0 / Math.sqrt((l * (V / 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(((A / l) / V)) elif t_0 <= 1e+226: tmp = c0 / math.sqrt(((V * l) / A)) else: tmp = c0 / math.sqrt((l * (V / 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(Float64(A / l) / V))); elseif (t_0 <= 1e+226) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); else tmp = Float64(c0 / 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)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 1e+226)
tmp = c0 / sqrt(((V * l) / A));
else
tmp = c0 / 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_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+226], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / 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:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 10^{+226}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 32.6%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6449.9
Applied egg-rr49.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.99999999999999961e225Initial program 99.1%
lift-*.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6499.2
Applied egg-rr99.2%
if 9.99999999999999961e225 < (/.f64 A (*.f64 V l)) Initial program 49.0%
lift-*.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6452.0
Applied egg-rr52.0%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6467.7
Applied egg-rr67.7%
Final simplification80.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (/ A (* V l))) (t_1 (/ c0 (sqrt (* l (/ V A)))))) (if (<= t_0 2e-263) t_1 (if (<= t_0 1e+263) (* c0 (sqrt t_0)) t_1))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double t_1 = c0 / sqrt((l * (V / A)));
double tmp;
if (t_0 <= 2e-263) {
tmp = t_1;
} else if (t_0 <= 1e+263) {
tmp = c0 * sqrt(t_0);
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = a / (v * l)
t_1 = c0 / sqrt((l * (v / a)))
if (t_0 <= 2d-263) then
tmp = t_1
else if (t_0 <= 1d+263) then
tmp = c0 * sqrt(t_0)
else
tmp = t_1
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 t_1 = c0 / Math.sqrt((l * (V / A)));
double tmp;
if (t_0 <= 2e-263) {
tmp = t_1;
} else if (t_0 <= 1e+263) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = t_1;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) t_1 = c0 / math.sqrt((l * (V / A))) tmp = 0 if t_0 <= 2e-263: tmp = t_1 elif t_0 <= 1e+263: tmp = c0 * math.sqrt(t_0) else: tmp = t_1 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) t_1 = Float64(c0 / sqrt(Float64(l * Float64(V / A)))) tmp = 0.0 if (t_0 <= 2e-263) tmp = t_1; elseif (t_0 <= 1e+263) tmp = Float64(c0 * sqrt(t_0)); else tmp = t_1; 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);
t_1 = c0 / sqrt((l * (V / A)));
tmp = 0.0;
if (t_0 <= 2e-263)
tmp = t_1;
elseif (t_0 <= 1e+263)
tmp = c0 * sqrt(t_0);
else
tmp = t_1;
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]}, Block[{t$95$1 = N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-263], t$95$1, If[LessEqual[t$95$0, 1e+263], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
t_1 := \frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-263}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10^{+263}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2e-263 or 1.00000000000000002e263 < (/.f64 A (*.f64 V l)) Initial program 43.3%
lift-*.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6444.8
Applied egg-rr44.8%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6458.4
Applied egg-rr58.4%
if 2e-263 < (/.f64 A (*.f64 V l)) < 1.00000000000000002e263Initial program 99.2%
Final simplification79.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 (/ (/ A l) V)))
(if (<= t_0 1e+226) (* c0 (sqrt t_0)) (* c0 (sqrt (/ (/ A V) l)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 1e+226) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 1d+226) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * sqrt(((a / v) / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 1e+226) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 1e+226: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 1e+226) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 1e+226)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+226], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 10^{+226}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 32.6%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6449.9
Applied egg-rr49.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.99999999999999961e225Initial program 99.1%
if 9.99999999999999961e225 < (/.f64 A (*.f64 V l)) Initial program 49.0%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6463.5
Applied egg-rr63.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))) (t_1 (* c0 (sqrt (/ (/ A V) l))))) (if (<= t_0 0.0) t_1 (if (<= t_0 1e+226) (* c0 (sqrt t_0)) t_1))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double t_1 = c0 * sqrt(((A / V) / l));
double tmp;
if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 1e+226) {
tmp = c0 * sqrt(t_0);
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = a / (v * l)
t_1 = c0 * sqrt(((a / v) / l))
if (t_0 <= 0.0d0) then
tmp = t_1
else if (t_0 <= 1d+226) then
tmp = c0 * sqrt(t_0)
else
tmp = t_1
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 t_1 = c0 * Math.sqrt(((A / V) / l));
double tmp;
if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 1e+226) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = t_1;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) t_1 = c0 * math.sqrt(((A / V) / l)) tmp = 0 if t_0 <= 0.0: tmp = t_1 elif t_0 <= 1e+226: tmp = c0 * math.sqrt(t_0) else: tmp = t_1 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) t_1 = Float64(c0 * sqrt(Float64(Float64(A / V) / l))) tmp = 0.0 if (t_0 <= 0.0) tmp = t_1; elseif (t_0 <= 1e+226) tmp = Float64(c0 * sqrt(t_0)); else tmp = t_1; 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);
t_1 = c0 * sqrt(((A / V) / l));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = t_1;
elseif (t_0 <= 1e+226)
tmp = c0 * sqrt(t_0);
else
tmp = t_1;
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]}, Block[{t$95$1 = N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], t$95$1, If[LessEqual[t$95$0, 1e+226], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
t_1 := c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10^{+226}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 9.99999999999999961e225 < (/.f64 A (*.f64 V l)) Initial program 41.4%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6457.2
Applied egg-rr57.2%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.99999999999999961e225Initial program 99.1%
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) -5e-324)
(* c0 (/ (sqrt (- A)) (* (sqrt (- V)) (sqrt l))))
(if (<= (* V l) 1e-321)
(/ 1.0 (/ (sqrt (* l (/ V A))) c0))
(if (<= (* V l) 2e+288)
(* c0 (* (sqrt (/ 1.0 (* V l))) (sqrt A)))
(* c0 (sqrt (/ (/ A V) l)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-324) {
tmp = c0 * (sqrt(-A) / (sqrt(-V) * sqrt(l)));
} else if ((V * l) <= 1e-321) {
tmp = 1.0 / (sqrt((l * (V / A))) / c0);
} else if ((V * l) <= 2e+288) {
tmp = c0 * (sqrt((1.0 / (V * l))) * sqrt(A));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-5d-324)) then
tmp = c0 * (sqrt(-a) / (sqrt(-v) * sqrt(l)))
else if ((v * l) <= 1d-321) then
tmp = 1.0d0 / (sqrt((l * (v / a))) / c0)
else if ((v * l) <= 2d+288) then
tmp = c0 * (sqrt((1.0d0 / (v * l))) * sqrt(a))
else
tmp = c0 * sqrt(((a / v) / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e-324) {
tmp = c0 * (Math.sqrt(-A) / (Math.sqrt(-V) * Math.sqrt(l)));
} else if ((V * l) <= 1e-321) {
tmp = 1.0 / (Math.sqrt((l * (V / A))) / c0);
} else if ((V * l) <= 2e+288) {
tmp = c0 * (Math.sqrt((1.0 / (V * l))) * Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e-324: tmp = c0 * (math.sqrt(-A) / (math.sqrt(-V) * math.sqrt(l))) elif (V * l) <= 1e-321: tmp = 1.0 / (math.sqrt((l * (V / A))) / c0) elif (V * l) <= 2e+288: tmp = c0 * (math.sqrt((1.0 / (V * l))) * math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e-324) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / Float64(sqrt(Float64(-V)) * sqrt(l)))); elseif (Float64(V * l) <= 1e-321) tmp = Float64(1.0 / Float64(sqrt(Float64(l * Float64(V / A))) / c0)); elseif (Float64(V * l) <= 2e+288) tmp = Float64(c0 * Float64(sqrt(Float64(1.0 / Float64(V * l))) * sqrt(A))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e-324)
tmp = c0 * (sqrt(-A) / (sqrt(-V) * sqrt(l)));
elseif ((V * l) <= 1e-321)
tmp = 1.0 / (sqrt((l * (V / A))) / c0);
elseif ((V * l) <= 2e+288)
tmp = c0 * (sqrt((1.0 / (V * l))) * sqrt(A));
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e-324], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[(N[Sqrt[(-V)], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-321], N[(1.0 / N[(N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+288], N[(c0 * N[(N[Sqrt[N[(1.0 / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-324}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{-V} \cdot \sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-321}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\ell \cdot \frac{V}{A}}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+288}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{1}{V \cdot \ell}} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.94066e-324Initial program 73.1%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6471.1
Applied egg-rr71.1%
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
associate-*l/N/A
div-invN/A
lift-/.f64N/A
sqrt-divN/A
lift-/.f64N/A
frac-2negN/A
lift-neg.f64N/A
sqrt-divN/A
associate-/l/N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-neg.f6441.0
Applied egg-rr41.0%
if -4.94066e-324 < (*.f64 V l) < 9.98013e-322Initial program 48.9%
lift-*.f64N/A
sqrt-divN/A
associate-*r/N/A
clear-numN/A
*-commutativeN/A
lower-/.f64N/A
associate-/r*N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6448.9
Applied egg-rr48.9%
associate-*l/N/A
lower-*.f64N/A
lower-/.f6483.9
Applied egg-rr83.9%
if 9.98013e-322 < (*.f64 V l) < 2e288Initial program 84.2%
lift-*.f64N/A
clear-numN/A
associate-/r/N/A
sqrt-prodN/A
pow1/2N/A
lower-*.f64N/A
pow1/2N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-sqrt.f6499.5
Applied egg-rr99.5%
if 2e288 < (*.f64 V l) Initial program 47.2%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6473.4
Applied egg-rr73.4%
Final simplification70.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) 1e-321)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* V l) 2e+288)
(* (sqrt A) (/ c0 (sqrt (* V l))))
(* c0 (sqrt (/ (/ A V) l))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 1e-321) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((V * l) <= 2e+288) {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= 1d-321) then
tmp = c0 / sqrt((v * (l / a)))
else if ((v * l) <= 2d+288) then
tmp = sqrt(a) * (c0 / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / v) / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 1e-321) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if ((V * l) <= 2e+288) {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 1e-321: tmp = c0 / math.sqrt((V * (l / A))) elif (V * l) <= 2e+288: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 1e-321) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(V * l) <= 2e+288) tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= 1e-321)
tmp = c0 / sqrt((V * (l / A)));
elseif ((V * l) <= 2e+288)
tmp = sqrt(A) * (c0 / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], 1e-321], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+288], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 10^{-321}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+288}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < 9.98013e-322Initial program 67.8%
lift-*.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f6468.2
Applied egg-rr68.2%
lift-*.f64N/A
div-invN/A
inv-powN/A
sqr-powN/A
metadata-evalN/A
metadata-evalN/A
pow-flipN/A
sqr-powN/A
pow-prod-downN/A
remove-double-negN/A
lift-neg.f64N/A
remove-double-negN/A
lift-neg.f64N/A
sqr-negN/A
pow-prod-downN/A
sqr-powN/A
pow-flipN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-flipN/A
sqr-powN/A
pow-prod-downN/A
Applied egg-rr74.5%
if 9.98013e-322 < (*.f64 V l) < 2e288Initial program 84.2%
lift-*.f64N/A
sqrt-divN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6496.4
Applied egg-rr96.4%
if 2e288 < (*.f64 V l) Initial program 47.2%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6473.4
Applied egg-rr73.4%
Final simplification82.6%
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 72.5%
herbie shell --seed 2024211
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))