
(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 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) -5e+274)
(* (sqrt (/ A (- l))) (/ c0 (sqrt (- V))))
(if (<= (* l V) -1e-314)
(* c0 (/ (sqrt (- A)) (sqrt (- (* l V)))))
(if (<= (* l V) 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= (* l V) 5e+287)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(* c0 (sqrt (/ (/ 1.0 l) (/ V A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -5e+274) {
tmp = sqrt((A / -l)) * (c0 / sqrt(-V));
} else if ((l * V) <= -1e-314) {
tmp = c0 * (sqrt(-A) / sqrt(-(l * V)));
} else if ((l * V) <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if ((l * V) <= 5e+287) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 * sqrt(((1.0 / 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 ((l * v) <= (-5d+274)) then
tmp = sqrt((a / -l)) * (c0 / sqrt(-v))
else if ((l * v) <= (-1d-314)) then
tmp = c0 * (sqrt(-a) / sqrt(-(l * v)))
else if ((l * v) <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if ((l * v) <= 5d+287) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
else
tmp = c0 * sqrt(((1.0d0 / 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 ((l * V) <= -5e+274) {
tmp = Math.sqrt((A / -l)) * (c0 / Math.sqrt(-V));
} else if ((l * V) <= -1e-314) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt(-(l * V)));
} else if ((l * V) <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if ((l * V) <= 5e+287) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = c0 * Math.sqrt(((1.0 / l) / (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -5e+274: tmp = math.sqrt((A / -l)) * (c0 / math.sqrt(-V)) elif (l * V) <= -1e-314: tmp = c0 * (math.sqrt(-A) / math.sqrt(-(l * V))) elif (l * V) <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif (l * V) <= 5e+287: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = c0 * math.sqrt(((1.0 / 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(l * V) <= -5e+274) tmp = Float64(sqrt(Float64(A / Float64(-l))) * Float64(c0 / sqrt(Float64(-V)))); elseif (Float64(l * V) <= -1e-314) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(-Float64(l * V))))); elseif (Float64(l * V) <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (Float64(l * V) <= 5e+287) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / 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 ((l * V) <= -5e+274)
tmp = sqrt((A / -l)) * (c0 / sqrt(-V));
elseif ((l * V) <= -1e-314)
tmp = c0 * (sqrt(-A) / sqrt(-(l * V)));
elseif ((l * V) <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif ((l * V) <= 5e+287)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = c0 * sqrt(((1.0 / 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[(l * V), $MachinePrecision], -5e+274], N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -1e-314], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-N[(l * V), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 5e+287], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -5 \cdot 10^{+274}:\\
\;\;\;\;\sqrt{\frac{A}{-\ell}} \cdot \frac{c0}{\sqrt{-V}}\\
\mathbf{elif}\;\ell \cdot V \leq -1 \cdot 10^{-314}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{-\ell \cdot V}}\\
\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;\ell \cdot V \leq 5 \cdot 10^{+287}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999998e274Initial program 38.1%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6471.1
Applied egg-rr71.1%
associate-/r*N/A
associate-/l/N/A
lift-/.f64N/A
sqrt-undivN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
frac-timesN/A
*-commutativeN/A
*-rgt-identityN/A
lift-sqrt.f64N/A
sqrt-prodN/A
associate-/r/N/A
lift-/.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
Applied egg-rr38.0%
associate-/l*N/A
/-rgt-identityN/A
clear-numN/A
associate-/r/N/A
clear-numN/A
associate-/l/N/A
inv-powN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-prod-upN/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
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
*-commutativeN/A
div-invN/A
lift-/.f64N/A
Applied egg-rr71.1%
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-neg.f6465.1
Applied egg-rr65.1%
if -4.9999999999999998e274 < (*.f64 V l) < -9.9999999996e-315Initial program 84.5%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6475.6
Applied egg-rr75.6%
associate-/l/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
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6499.2
Applied egg-rr99.2%
if -9.9999999996e-315 < (*.f64 V l) < 0.0Initial program 42.9%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6465.0
Applied egg-rr65.0%
if 0.0 < (*.f64 V l) < 5e287Initial program 86.7%
lift-*.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6498.5
Applied egg-rr98.5%
if 5e287 < (*.f64 V l) Initial program 48.6%
lift-*.f64N/A
div-invN/A
inv-powN/A
metadata-evalN/A
metadata-evalN/A
pow-powN/A
pow2N/A
remove-double-negN/A
remove-double-negN/A
sqr-negN/A
pow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
div-invN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-/r*N/A
Applied egg-rr71.1%
Final simplification89.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* l V))))))
(if (<= t_0 1e-231)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+246) t_0 (/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (l * V)));
double tmp;
if (t_0 <= 1e-231) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+246) {
tmp = t_0;
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (l * v)))
if (t_0 <= 1d-231) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+246) then
tmp = t_0
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (l * V)));
double tmp;
if (t_0 <= 1e-231) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+246) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (l * V))) tmp = 0 if t_0 <= 1e-231: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+246: tmp = t_0 else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(l * V)))) tmp = 0.0 if (t_0 <= 1e-231) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+246) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (l * V)));
tmp = 0.0;
if (t_0 <= 1e-231)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+246)
tmp = t_0;
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-231], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+246], t$95$0, N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 10^{-231}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+246}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999999e-232Initial program 70.6%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6472.1
Applied egg-rr72.1%
if 9.9999999999999999e-232 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000014e246Initial program 98.4%
if 2.00000000000000014e246 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 47.1%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6457.1
Applied egg-rr57.1%
associate-/r*N/A
associate-/l/N/A
lift-/.f64N/A
sqrt-undivN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
frac-timesN/A
*-commutativeN/A
*-rgt-identityN/A
lift-sqrt.f64N/A
sqrt-prodN/A
associate-/r/N/A
lift-/.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
Applied egg-rr48.4%
associate-*l/N/A
lower-*.f64N/A
lower-/.f6457.0
Applied egg-rr57.0%
Final simplification75.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 (* c0 (sqrt (/ A (* l V))))))
(if (<= t_0 1e-231)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+192) 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 = c0 * sqrt((A / (l * V)));
double tmp;
if (t_0 <= 1e-231) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+192) {
tmp = 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 = c0 * sqrt((a / (l * v)))
if (t_0 <= 1d-231) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+192) then
tmp = 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 = c0 * Math.sqrt((A / (l * V)));
double tmp;
if (t_0 <= 1e-231) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+192) {
tmp = 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 = c0 * math.sqrt((A / (l * V))) tmp = 0 if t_0 <= 1e-231: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+192: tmp = 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(c0 * sqrt(Float64(A / Float64(l * V)))) tmp = 0.0 if (t_0 <= 1e-231) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+192) tmp = 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 = c0 * sqrt((A / (l * V)));
tmp = 0.0;
if (t_0 <= 1e-231)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+192)
tmp = 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[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-231], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+192], t$95$0, 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 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 10^{-231}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+192}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999999e-232Initial program 70.6%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6472.1
Applied egg-rr72.1%
if 9.9999999999999999e-232 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000008e192Initial program 98.4%
if 2.00000000000000008e192 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 50.5%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6459.9
Applied egg-rr59.9%
Final simplification75.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (* c0 (sqrt (/ A (* l V))))) (t_1 (* c0 (sqrt (/ (/ A V) l))))) (if (<= t_0 1e-231) t_1 (if (<= t_0 5e+277) t_0 t_1))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (l * V)));
double t_1 = c0 * sqrt(((A / V) / l));
double tmp;
if (t_0 <= 1e-231) {
tmp = t_1;
} else if (t_0 <= 5e+277) {
tmp = 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 = c0 * sqrt((a / (l * v)))
t_1 = c0 * sqrt(((a / v) / l))
if (t_0 <= 1d-231) then
tmp = t_1
else if (t_0 <= 5d+277) then
tmp = 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 = c0 * Math.sqrt((A / (l * V)));
double t_1 = c0 * Math.sqrt(((A / V) / l));
double tmp;
if (t_0 <= 1e-231) {
tmp = t_1;
} else if (t_0 <= 5e+277) {
tmp = 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 = c0 * math.sqrt((A / (l * V))) t_1 = c0 * math.sqrt(((A / V) / l)) tmp = 0 if t_0 <= 1e-231: tmp = t_1 elif t_0 <= 5e+277: tmp = 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(c0 * sqrt(Float64(A / Float64(l * V)))) t_1 = Float64(c0 * sqrt(Float64(Float64(A / V) / l))) tmp = 0.0 if (t_0 <= 1e-231) tmp = t_1; elseif (t_0 <= 5e+277) tmp = 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 = c0 * sqrt((A / (l * V)));
t_1 = c0 * sqrt(((A / V) / l));
tmp = 0.0;
if (t_0 <= 1e-231)
tmp = t_1;
elseif (t_0 <= 5e+277)
tmp = 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[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-231], t$95$1, If[LessEqual[t$95$0, 5e+277], t$95$0, t$95$1]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
t_1 := c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{if}\;t\_0 \leq 10^{-231}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+277}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999999e-232 or 4.99999999999999982e277 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 67.1%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6470.3
Applied egg-rr70.3%
if 9.9999999999999999e-232 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.99999999999999982e277Initial program 98.5%
Final simplification76.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 (<= (* l V) -5e+274)
(* c0 (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* l V) -1e-314)
(* c0 (/ (sqrt (- A)) (sqrt (- (* l V)))))
(if (<= (* l V) 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= (* l V) 5e+287)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(* c0 (sqrt (/ (/ 1.0 l) (/ V A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -5e+274) {
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
} else if ((l * V) <= -1e-314) {
tmp = c0 * (sqrt(-A) / sqrt(-(l * V)));
} else if ((l * V) <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if ((l * V) <= 5e+287) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 * sqrt(((1.0 / 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 ((l * v) <= (-5d+274)) then
tmp = c0 * (sqrt((a / -l)) / sqrt(-v))
else if ((l * v) <= (-1d-314)) then
tmp = c0 * (sqrt(-a) / sqrt(-(l * v)))
else if ((l * v) <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if ((l * v) <= 5d+287) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
else
tmp = c0 * sqrt(((1.0d0 / 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 ((l * V) <= -5e+274) {
tmp = c0 * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((l * V) <= -1e-314) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt(-(l * V)));
} else if ((l * V) <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if ((l * V) <= 5e+287) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = c0 * Math.sqrt(((1.0 / l) / (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -5e+274: tmp = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (l * V) <= -1e-314: tmp = c0 * (math.sqrt(-A) / math.sqrt(-(l * V))) elif (l * V) <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif (l * V) <= 5e+287: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = c0 * math.sqrt(((1.0 / 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(l * V) <= -5e+274) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(l * V) <= -1e-314) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(-Float64(l * V))))); elseif (Float64(l * V) <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (Float64(l * V) <= 5e+287) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / 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 ((l * V) <= -5e+274)
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
elseif ((l * V) <= -1e-314)
tmp = c0 * (sqrt(-A) / sqrt(-(l * V)));
elseif ((l * V) <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif ((l * V) <= 5e+287)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = c0 * sqrt(((1.0 / 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[(l * V), $MachinePrecision], -5e+274], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -1e-314], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-N[(l * V), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 5e+287], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -5 \cdot 10^{+274}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;\ell \cdot V \leq -1 \cdot 10^{-314}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{-\ell \cdot V}}\\
\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;\ell \cdot V \leq 5 \cdot 10^{+287}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999998e274Initial program 38.1%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6471.1
Applied egg-rr71.1%
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6465.0
Applied egg-rr65.0%
if -4.9999999999999998e274 < (*.f64 V l) < -9.9999999996e-315Initial program 84.5%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6475.6
Applied egg-rr75.6%
associate-/l/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
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6499.2
Applied egg-rr99.2%
if -9.9999999996e-315 < (*.f64 V l) < 0.0Initial program 42.9%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6465.0
Applied egg-rr65.0%
if 0.0 < (*.f64 V l) < 5e287Initial program 86.7%
lift-*.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6498.5
Applied egg-rr98.5%
if 5e287 < (*.f64 V l) Initial program 48.6%
lift-*.f64N/A
div-invN/A
inv-powN/A
metadata-evalN/A
metadata-evalN/A
pow-powN/A
pow2N/A
remove-double-negN/A
remove-double-negN/A
sqr-negN/A
pow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
div-invN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-/r*N/A
Applied egg-rr71.1%
Final simplification89.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) (- INFINITY))
(* c0 (sqrt (/ (/ A V) l)))
(if (<= (* l V) -1e-314)
(* c0 (/ (sqrt (- A)) (sqrt (- (* l V)))))
(if (<= (* l V) 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= (* l V) 5e+287)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(* c0 (sqrt (/ (/ 1.0 l) (/ V A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -((double) INFINITY)) {
tmp = c0 * sqrt(((A / V) / l));
} else if ((l * V) <= -1e-314) {
tmp = c0 * (sqrt(-A) / sqrt(-(l * V)));
} else if ((l * V) <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if ((l * V) <= 5e+287) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 * sqrt(((1.0 / l) / (V / A)));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if ((l * V) <= -1e-314) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt(-(l * V)));
} else if ((l * V) <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if ((l * V) <= 5e+287) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = c0 * Math.sqrt(((1.0 / l) / (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -math.inf: tmp = c0 * math.sqrt(((A / V) / l)) elif (l * V) <= -1e-314: tmp = c0 * (math.sqrt(-A) / math.sqrt(-(l * V))) elif (l * V) <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif (l * V) <= 5e+287: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = c0 * math.sqrt(((1.0 / 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(l * V) <= Float64(-Inf)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (Float64(l * V) <= -1e-314) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(-Float64(l * V))))); elseif (Float64(l * V) <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (Float64(l * V) <= 5e+287) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = Float64(c0 * sqrt(Float64(Float64(1.0 / 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 ((l * V) <= -Inf)
tmp = c0 * sqrt(((A / V) / l));
elseif ((l * V) <= -1e-314)
tmp = c0 * (sqrt(-A) / sqrt(-(l * V)));
elseif ((l * V) <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif ((l * V) <= 5e+287)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = c0 * sqrt(((1.0 / 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[(l * V), $MachinePrecision], (-Infinity)], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -1e-314], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-N[(l * V), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 5e+287], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -\infty:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;\ell \cdot V \leq -1 \cdot 10^{-314}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{-\ell \cdot V}}\\
\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;\ell \cdot V \leq 5 \cdot 10^{+287}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{1}{\ell}}{\frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 28.5%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6470.0
Applied egg-rr70.0%
if -inf.0 < (*.f64 V l) < -9.9999999996e-315Initial program 84.2%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6475.7
Applied egg-rr75.7%
associate-/l/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
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6499.2
Applied egg-rr99.2%
if -9.9999999996e-315 < (*.f64 V l) < 0.0Initial program 42.9%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6465.0
Applied egg-rr65.0%
if 0.0 < (*.f64 V l) < 5e287Initial program 86.7%
lift-*.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6498.5
Applied egg-rr98.5%
if 5e287 < (*.f64 V l) Initial program 48.6%
lift-*.f64N/A
div-invN/A
inv-powN/A
metadata-evalN/A
metadata-evalN/A
pow-powN/A
pow2N/A
remove-double-negN/A
remove-double-negN/A
sqr-negN/A
pow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
div-invN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-/r*N/A
Applied egg-rr71.1%
Final simplification90.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ (/ A V) l)))))
(if (<= (* l V) (- INFINITY))
t_0
(if (<= (* l V) -1e-314)
(* c0 (/ (sqrt (- A)) (sqrt (- (* l V)))))
(if (<= (* l V) 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= (* l V) 5e+287) (* c0 (/ (sqrt A) (sqrt (* l V)))) t_0))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt(((A / V) / l));
double tmp;
if ((l * V) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((l * V) <= -1e-314) {
tmp = c0 * (sqrt(-A) / sqrt(-(l * V)));
} else if ((l * V) <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if ((l * V) <= 5e+287) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = t_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 = c0 * Math.sqrt(((A / V) / l));
double tmp;
if ((l * V) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if ((l * V) <= -1e-314) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt(-(l * V)));
} else if ((l * V) <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if ((l * V) <= 5e+287) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt(((A / V) / l)) tmp = 0 if (l * V) <= -math.inf: tmp = t_0 elif (l * V) <= -1e-314: tmp = c0 * (math.sqrt(-A) / math.sqrt(-(l * V))) elif (l * V) <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif (l * V) <= 5e+287: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(Float64(A / V) / l))) tmp = 0.0 if (Float64(l * V) <= Float64(-Inf)) tmp = t_0; elseif (Float64(l * V) <= -1e-314) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(-Float64(l * V))))); elseif (Float64(l * V) <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (Float64(l * V) <= 5e+287) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt(((A / V) / l));
tmp = 0.0;
if ((l * V) <= -Inf)
tmp = t_0;
elseif ((l * V) <= -1e-314)
tmp = c0 * (sqrt(-A) / sqrt(-(l * V)));
elseif ((l * V) <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif ((l * V) <= 5e+287)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(l * V), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(l * V), $MachinePrecision], -1e-314], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-N[(l * V), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 5e+287], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{if}\;\ell \cdot V \leq -\infty:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \cdot V \leq -1 \cdot 10^{-314}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{-\ell \cdot V}}\\
\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;\ell \cdot V \leq 5 \cdot 10^{+287}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or 5e287 < (*.f64 V l) Initial program 40.1%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6470.6
Applied egg-rr70.6%
if -inf.0 < (*.f64 V l) < -9.9999999996e-315Initial program 84.2%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6475.7
Applied egg-rr75.7%
associate-/l/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
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6499.2
Applied egg-rr99.2%
if -9.9999999996e-315 < (*.f64 V l) < 0.0Initial program 42.9%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6465.0
Applied egg-rr65.0%
if 0.0 < (*.f64 V l) < 5e287Initial program 86.7%
lift-*.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6498.5
Applied egg-rr98.5%
Final simplification90.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -1e-309) (/ (* (sqrt (- A)) (/ c0 (sqrt l))) (sqrt (- V))) (* c0 (/ (sqrt A) (sqrt (* l V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-309) {
tmp = (sqrt(-A) * (c0 / sqrt(l))) / sqrt(-V);
} else {
tmp = c0 * (sqrt(A) / sqrt((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) :: tmp
if (a <= (-1d-309)) then
tmp = (sqrt(-a) * (c0 / sqrt(l))) / sqrt(-v)
else
tmp = c0 * (sqrt(a) / sqrt((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 tmp;
if (A <= -1e-309) {
tmp = (Math.sqrt(-A) * (c0 / Math.sqrt(l))) / Math.sqrt(-V);
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -1e-309: tmp = (math.sqrt(-A) * (c0 / math.sqrt(l))) / math.sqrt(-V) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -1e-309) tmp = Float64(Float64(sqrt(Float64(-A)) * Float64(c0 / sqrt(l))) / sqrt(Float64(-V))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -1e-309)
tmp = (sqrt(-A) * (c0 / sqrt(l))) / sqrt(-V);
else
tmp = c0 * (sqrt(A) / sqrt((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_] := If[LessEqual[A, -1e-309], N[(N[(N[Sqrt[(-A)], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{\sqrt{-A} \cdot \frac{c0}{\sqrt{\ell}}}{\sqrt{-V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -1.000000000000002e-309Initial program 74.3%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6474.4
Applied egg-rr74.4%
associate-/r*N/A
associate-/l/N/A
lift-/.f64N/A
sqrt-undivN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lift-sqrt.f64N/A
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-neg.f6442.8
Applied egg-rr42.8%
if -1.000000000000002e-309 < A Initial program 73.1%
lift-*.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6481.3
Applied egg-rr81.3%
Final simplification62.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) 0.0)
(/ c0 (sqrt (/ V (/ A l))))
(if (<= (* l V) 5e+287)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(* 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 ((l * V) <= 0.0) {
tmp = c0 / sqrt((V / (A / l)));
} else if ((l * V) <= 5e+287) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} 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 ((l * v) <= 0.0d0) then
tmp = c0 / sqrt((v / (a / l)))
else if ((l * v) <= 5d+287) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
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 ((l * V) <= 0.0) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else if ((l * V) <= 5e+287) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} 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 (l * V) <= 0.0: tmp = c0 / math.sqrt((V / (A / l))) elif (l * V) <= 5e+287: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) 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(l * V) <= 0.0) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); elseif (Float64(l * V) <= 5e+287) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); 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 ((l * V) <= 0.0)
tmp = c0 / sqrt((V / (A / l)));
elseif ((l * V) <= 5e+287)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
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[(l * V), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 5e+287], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $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}\;\ell \cdot V \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{elif}\;\ell \cdot V \leq 5 \cdot 10^{+287}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 69.5%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6472.8
Applied egg-rr72.8%
associate-/r*N/A
associate-/l/N/A
lift-/.f64N/A
sqrt-undivN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
frac-timesN/A
*-commutativeN/A
*-rgt-identityN/A
lift-sqrt.f64N/A
sqrt-prodN/A
associate-/r/N/A
lift-/.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
Applied egg-rr69.7%
associate-/l*N/A
/-rgt-identityN/A
clear-numN/A
associate-/r/N/A
clear-numN/A
associate-/l/N/A
inv-powN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-prod-upN/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
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
*-commutativeN/A
div-invN/A
lift-/.f64N/A
Applied egg-rr72.9%
if 0.0 < (*.f64 V l) < 5e287Initial program 86.7%
lift-*.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6498.5
Applied egg-rr98.5%
if 5e287 < (*.f64 V l) Initial program 48.6%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6471.0
Applied egg-rr71.0%
Final simplification81.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) 0.0)
(/ c0 (sqrt (* V (/ l A))))
(if (<= (* l V) 5e+287)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(* 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 ((l * V) <= 0.0) {
tmp = c0 / sqrt((V * (l / A)));
} else if ((l * V) <= 5e+287) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} 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 ((l * v) <= 0.0d0) then
tmp = c0 / sqrt((v * (l / a)))
else if ((l * v) <= 5d+287) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
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 ((l * V) <= 0.0) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if ((l * V) <= 5e+287) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} 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 (l * V) <= 0.0: tmp = c0 / math.sqrt((V * (l / A))) elif (l * V) <= 5e+287: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) 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(l * V) <= 0.0) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (Float64(l * V) <= 5e+287) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); 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 ((l * V) <= 0.0)
tmp = c0 / sqrt((V * (l / A)));
elseif ((l * V) <= 5e+287)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
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[(l * V), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 5e+287], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $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}\;\ell \cdot V \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq 5 \cdot 10^{+287}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 69.5%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6472.8
Applied egg-rr72.8%
associate-/r*N/A
associate-/l/N/A
lift-/.f64N/A
sqrt-undivN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
frac-timesN/A
*-commutativeN/A
*-rgt-identityN/A
lift-sqrt.f64N/A
sqrt-prodN/A
associate-/r/N/A
lift-/.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
Applied egg-rr69.7%
associate-*l/N/A
lower-*.f64N/A
lower-/.f6472.3
Applied egg-rr72.3%
if 0.0 < (*.f64 V l) < 5e287Initial program 86.7%
lift-*.f64N/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6498.5
Applied egg-rr98.5%
if 5e287 < (*.f64 V l) Initial program 48.6%
associate-/r*N/A
lower-/.f64N/A
lower-/.f6471.0
Applied egg-rr71.0%
Final simplification81.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 -5e-310) (/ c0 (* (sqrt (- V)) (sqrt (/ l (- A))))) (* (sqrt A) (/ c0 (* (sqrt l) (sqrt V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -5e-310) {
tmp = c0 / (sqrt(-V) * sqrt((l / -A)));
} else {
tmp = sqrt(A) * (c0 / (sqrt(l) * sqrt(V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (v <= (-5d-310)) then
tmp = c0 / (sqrt(-v) * sqrt((l / -a)))
else
tmp = sqrt(a) * (c0 / (sqrt(l) * sqrt(v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -5e-310) {
tmp = c0 / (Math.sqrt(-V) * Math.sqrt((l / -A)));
} else {
tmp = Math.sqrt(A) * (c0 / (Math.sqrt(l) * Math.sqrt(V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if V <= -5e-310: tmp = c0 / (math.sqrt(-V) * math.sqrt((l / -A))) else: tmp = math.sqrt(A) * (c0 / (math.sqrt(l) * math.sqrt(V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= -5e-310) tmp = Float64(c0 / Float64(sqrt(Float64(-V)) * sqrt(Float64(l / Float64(-A))))); else tmp = Float64(sqrt(A) * Float64(c0 / Float64(sqrt(l) * sqrt(V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (V <= -5e-310)
tmp = c0 / (sqrt(-V) * sqrt((l / -A)));
else
tmp = sqrt(A) * (c0 / (sqrt(l) * sqrt(V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[V, -5e-310], N[(c0 / N[(N[Sqrt[(-V)], $MachinePrecision] * N[Sqrt[N[(l / (-A)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[V], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\sqrt{-V} \cdot \sqrt{\frac{\ell}{-A}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{\ell} \cdot \sqrt{V}}\\
\end{array}
\end{array}
if V < -4.999999999999985e-310Initial program 71.3%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6475.0
Applied egg-rr75.0%
associate-/r*N/A
associate-/l/N/A
lift-/.f64N/A
sqrt-undivN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
associate-/l*N/A
*-commutativeN/A
associate-/l*N/A
lift-sqrt.f64N/A
lift-/.f64N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
frac-timesN/A
*-commutativeN/A
*-rgt-identityN/A
lift-sqrt.f64N/A
sqrt-prodN/A
associate-/r/N/A
lift-/.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
Applied egg-rr71.4%
associate-/l*N/A
/-rgt-identityN/A
clear-numN/A
associate-/r/N/A
clear-numN/A
associate-/l/N/A
inv-powN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
pow-prod-upN/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
pow-prod-upN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
inv-powN/A
*-commutativeN/A
div-invN/A
lift-/.f64N/A
Applied egg-rr75.1%
lift-/.f64N/A
frac-2negN/A
div-invN/A
sqrt-prodN/A
distribute-frac-neg2N/A
lift-/.f64N/A
clear-numN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-neg.f64N/A
clear-numN/A
lift-/.f64N/A
distribute-frac-neg2N/A
lower-sqrt.f64N/A
distribute-frac-neg2N/A
lift-/.f64N/A
clear-numN/A
distribute-neg-fracN/A
lower-/.f64N/A
lower-neg.f6487.4
Applied egg-rr87.4%
if -4.999999999999985e-310 < V Initial program 75.9%
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.f6437.3
Applied egg-rr37.3%
sqrt-prodN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lower-*.f6444.1
Applied egg-rr44.1%
Final simplification65.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 -5e-310) (* c0 (/ (sqrt (/ A (- l))) (sqrt (- V)))) (* (sqrt A) (/ c0 (* (sqrt l) (sqrt V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -5e-310) {
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
} else {
tmp = sqrt(A) * (c0 / (sqrt(l) * sqrt(V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (v <= (-5d-310)) then
tmp = c0 * (sqrt((a / -l)) / sqrt(-v))
else
tmp = sqrt(a) * (c0 / (sqrt(l) * sqrt(v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -5e-310) {
tmp = c0 * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else {
tmp = Math.sqrt(A) * (c0 / (Math.sqrt(l) * Math.sqrt(V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if V <= -5e-310: tmp = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) else: tmp = math.sqrt(A) * (c0 / (math.sqrt(l) * math.sqrt(V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= -5e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); else tmp = Float64(sqrt(A) * Float64(c0 / Float64(sqrt(l) * sqrt(V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (V <= -5e-310)
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
else
tmp = sqrt(A) * (c0 / (sqrt(l) * sqrt(V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[V, -5e-310], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[V], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{\ell} \cdot \sqrt{V}}\\
\end{array}
\end{array}
if V < -4.999999999999985e-310Initial program 71.3%
associate-/l/N/A
lower-/.f64N/A
lower-/.f6475.0
Applied egg-rr75.0%
lift-/.f64N/A
frac-2negN/A
sqrt-divN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-neg.f64N/A
lower-sqrt.f64N/A
lower-neg.f6487.0
Applied egg-rr87.0%
if -4.999999999999985e-310 < V Initial program 75.9%
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.f6437.3
Applied egg-rr37.3%
sqrt-prodN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
*-commutativeN/A
lower-*.f6444.1
Applied egg-rr44.1%
Final simplification65.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* l V)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (l * V)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (l * v)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (l * V)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (l * V)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(l * V)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (l * V)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}
\end{array}
Initial program 73.7%
Final simplification73.7%
herbie shell --seed 2024200
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))