
(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 (<= (* V l) -1e-306)
(* (/ (/ (sqrt (- A)) (sqrt (- V))) (sqrt l)) c0)
(if (<= (* V l) 2e-307)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) 1e+275)
(* c0 (/ (sqrt A) (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-306) {
tmp = ((sqrt(-A) / sqrt(-V)) / sqrt(l)) * c0;
} else if ((V * l) <= 2e-307) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((V * l) <= 1e+275) {
tmp = c0 * (sqrt(A) / 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-306)) then
tmp = ((sqrt(-a) / sqrt(-v)) / sqrt(l)) * c0
else if ((v * l) <= 2d-307) then
tmp = (c0 / sqrt(l)) * sqrt((a / v))
else if ((v * l) <= 1d+275) then
tmp = c0 * (sqrt(a) / 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-306) {
tmp = ((Math.sqrt(-A) / Math.sqrt(-V)) / Math.sqrt(l)) * c0;
} else if ((V * l) <= 2e-307) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((V * l) <= 1e+275) {
tmp = c0 * (Math.sqrt(A) / 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-306: tmp = ((math.sqrt(-A) / math.sqrt(-V)) / math.sqrt(l)) * c0 elif (V * l) <= 2e-307: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) elif (V * l) <= 1e+275: tmp = c0 * (math.sqrt(A) / 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-306) tmp = Float64(Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / sqrt(l)) * c0); elseif (Float64(V * l) <= 2e-307) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= 1e+275) tmp = Float64(c0 * Float64(sqrt(A) / 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-306)
tmp = ((sqrt(-A) / sqrt(-V)) / sqrt(l)) * c0;
elseif ((V * l) <= 2e-307)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
elseif ((V * l) <= 1e+275)
tmp = c0 * (sqrt(A) / 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-306], N[(N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * c0), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-307], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+275], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / 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 -1 \cdot 10^{-306}:\\
\;\;\;\;\frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}} \cdot c0\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-307}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+275}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.00000000000000003e-306Initial program 73.0%
associate-/r*70.8%
sqrt-div42.2%
associate-*r/41.5%
Applied egg-rr41.5%
*-commutative41.5%
associate-/l*41.3%
associate-/r/42.2%
Simplified42.2%
frac-2neg42.2%
sqrt-div50.0%
Applied egg-rr50.0%
if -1.00000000000000003e-306 < (*.f64 V l) < 1.99999999999999982e-307Initial program 40.6%
associate-/r*74.5%
clear-num74.4%
sqrt-div74.4%
metadata-eval74.4%
div-inv74.3%
clear-num74.4%
Applied egg-rr74.4%
associate-*r/40.6%
*-commutative40.6%
*-lft-identity40.6%
times-frac74.4%
remove-double-div74.5%
associate-/r*74.5%
*-rgt-identity74.5%
remove-double-div74.4%
Simplified74.4%
*-commutative74.4%
metadata-eval74.4%
sqrt-div74.4%
associate-*r/40.6%
clear-num40.6%
add-sqr-sqrt24.7%
sqrt-prod24.7%
unpow224.7%
expm1-log1p-u24.7%
sqrt-prod24.7%
expm1-udef24.7%
Applied egg-rr33.8%
expm1-def43.2%
expm1-log1p74.3%
associate-/r/74.3%
Simplified74.3%
associate-/r/74.3%
sqrt-div56.8%
associate-/r/56.9%
Applied egg-rr56.9%
if 1.99999999999999982e-307 < (*.f64 V l) < 9.9999999999999996e274Initial program 80.8%
sqrt-div99.5%
associate-*r/97.8%
Applied egg-rr97.8%
*-commutative97.8%
associate-/l*94.8%
associate-/r/99.5%
Simplified99.5%
if 9.9999999999999996e274 < (*.f64 V l) Initial program 44.3%
*-commutative44.3%
associate-/l/77.8%
Simplified77.8%
Final simplification69.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 (* c0 (sqrt (/ A (* V l))))))
(if (or (<= t_0 0.0) (not (<= t_0 1e+295)))
(* c0 (sqrt (/ (/ A V) l)))
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 ((t_0 <= 0.0) || !(t_0 <= 1e+295)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 1d+295))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 1e+295)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} 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 (t_0 <= 0.0) or not (t_0 <= 1e+295): tmp = c0 * math.sqrt(((A / V) / l)) 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(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 1e+295)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); 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 ((t_0 <= 0.0) || ~((t_0 <= 1e+295)))
tmp = c0 * sqrt(((A / V) / l));
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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 1e+295]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $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{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 10^{+295}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 9.9999999999999998e294 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 59.1%
*-commutative59.1%
associate-/l/67.5%
Simplified67.5%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999998e294Initial program 99.5%
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 (* V l))))))
(if (or (<= t_0 2e-222) (not (<= t_0 5e+300)))
(* c0 (sqrt (/ (/ A 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 ((t_0 <= 2e-222) || !(t_0 <= 5e+300)) {
tmp = c0 * sqrt(((A / l) / V));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if ((t_0 <= 2d-222) .or. (.not. (t_0 <= 5d+300))) then
tmp = c0 * sqrt(((a / l) / v))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 2e-222) || !(t_0 <= 5e+300)) {
tmp = c0 * Math.sqrt(((A / 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 (t_0 <= 2e-222) or not (t_0 <= 5e+300): tmp = c0 * math.sqrt(((A / 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(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 2e-222) || !(t_0 <= 5e+300)) tmp = Float64(c0 * sqrt(Float64(Float64(A / 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 ((t_0 <= 2e-222) || ~((t_0 <= 5e+300)))
tmp = c0 * sqrt(((A / 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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 2e-222], N[Not[LessEqual[t$95$0, 5e+300]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $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{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-222} \lor \neg \left(t_0 \leq 5 \cdot 10^{+300}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000001e-222 or 5.00000000000000026e300 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 60.0%
*-un-lft-identity60.0%
times-frac65.4%
Applied egg-rr65.4%
associate-*l/65.4%
*-un-lft-identity65.4%
Applied egg-rr65.4%
if 2.0000000000000001e-222 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.00000000000000026e300Initial program 99.5%
Final simplification73.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 (* V l))))))
(if (<= t_0 2e-222)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 3.67e+300) t_0 (/ 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 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-222) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 3.67e+300) {
tmp = t_0;
} 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 = c0 * sqrt((a / (v * l)))
if (t_0 <= 2d-222) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 3.67d+300) then
tmp = t_0
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 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-222) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 3.67e+300) {
tmp = t_0;
} 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 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 2e-222: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 3.67e+300: tmp = t_0 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(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 2e-222) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 3.67e+300) tmp = t_0; 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 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 2e-222)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 3.67e+300)
tmp = t_0;
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[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-222], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 3.67e+300], t$95$0, 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 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-222}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 3.67 \cdot 10^{+300}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000001e-222Initial program 63.8%
*-un-lft-identity63.8%
times-frac68.0%
Applied egg-rr68.0%
associate-*l/68.0%
*-un-lft-identity68.0%
Applied egg-rr68.0%
if 2.0000000000000001e-222 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.67000000000000016e300Initial program 99.5%
if 3.67000000000000016e300 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 44.2%
*-un-lft-identity44.2%
times-frac54.8%
Applied egg-rr54.8%
associate-*l/54.8%
*-un-lft-identity54.8%
Applied egg-rr54.8%
associate-/l/44.2%
sqrt-div25.5%
clear-num25.5%
sqrt-div50.0%
*-commutative50.0%
associate-*l/58.4%
div-inv58.5%
associate-/r/56.2%
clear-num52.4%
associate-/r/56.3%
clear-num56.2%
*-commutative56.2%
Applied egg-rr56.2%
Final simplification74.0%
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 l)) (sqrt (/ A V)))))
(if (<= (* V l) -1e+211)
t_0
(if (<= (* V l) -1e-249)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 2e-307)
t_0
(if (<= (* V l) 1e+275)
(* c0 (/ (sqrt A) (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 t_0 = (c0 / sqrt(l)) * sqrt((A / V));
double tmp;
if ((V * l) <= -1e+211) {
tmp = t_0;
} else if ((V * l) <= -1e-249) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 2e-307) {
tmp = t_0;
} else if ((V * l) <= 1e+275) {
tmp = c0 * (sqrt(A) / 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) :: t_0
real(8) :: tmp
t_0 = (c0 / sqrt(l)) * sqrt((a / v))
if ((v * l) <= (-1d+211)) then
tmp = t_0
else if ((v * l) <= (-1d-249)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 2d-307) then
tmp = t_0
else if ((v * l) <= 1d+275) then
tmp = c0 * (sqrt(a) / 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 t_0 = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
double tmp;
if ((V * l) <= -1e+211) {
tmp = t_0;
} else if ((V * l) <= -1e-249) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 2e-307) {
tmp = t_0;
} else if ((V * l) <= 1e+275) {
tmp = c0 * (Math.sqrt(A) / 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): t_0 = (c0 / math.sqrt(l)) * math.sqrt((A / V)) tmp = 0 if (V * l) <= -1e+211: tmp = t_0 elif (V * l) <= -1e-249: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 2e-307: tmp = t_0 elif (V * l) <= 1e+275: tmp = c0 * (math.sqrt(A) / 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) t_0 = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))) tmp = 0.0 if (Float64(V * l) <= -1e+211) tmp = t_0; elseif (Float64(V * l) <= -1e-249) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 2e-307) tmp = t_0; elseif (Float64(V * l) <= 1e+275) tmp = Float64(c0 * Float64(sqrt(A) / 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)
t_0 = (c0 / sqrt(l)) * sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -1e+211)
tmp = t_0;
elseif ((V * l) <= -1e-249)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 2e-307)
tmp = t_0;
elseif ((V * l) <= 1e+275)
tmp = c0 * (sqrt(A) / 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_] := Block[{t$95$0 = N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+211], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-249], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-307], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 1e+275], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / 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}
t_0 := \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+211}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-249}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-307}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+275}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.9999999999999996e210 or -1.00000000000000005e-249 < (*.f64 V l) < 1.99999999999999982e-307Initial program 42.7%
associate-/r*68.4%
clear-num67.6%
sqrt-div67.7%
metadata-eval67.7%
div-inv67.6%
clear-num67.6%
Applied egg-rr67.6%
associate-*r/41.9%
*-commutative41.9%
*-lft-identity41.9%
times-frac67.6%
remove-double-div67.7%
associate-/r*67.7%
*-rgt-identity67.7%
remove-double-div67.6%
Simplified67.6%
*-commutative67.6%
metadata-eval67.6%
sqrt-div67.6%
associate-*r/41.9%
clear-num42.7%
add-sqr-sqrt27.1%
sqrt-prod23.1%
unpow223.1%
expm1-log1p-u22.9%
sqrt-prod20.1%
expm1-udef18.5%
Applied egg-rr30.7%
expm1-def43.6%
expm1-log1p67.6%
associate-/r/67.6%
Simplified67.6%
associate-/r/67.6%
sqrt-div48.3%
associate-/r/48.3%
Applied egg-rr48.3%
if -9.9999999999999996e210 < (*.f64 V l) < -1.00000000000000005e-249Initial program 83.2%
associate-/r*73.7%
clear-num72.8%
sqrt-div74.1%
metadata-eval74.1%
div-inv74.1%
clear-num74.1%
Applied egg-rr74.1%
associate-*r/84.5%
*-commutative84.5%
*-lft-identity84.5%
times-frac75.6%
remove-double-div75.6%
associate-/r*75.6%
*-rgt-identity75.6%
remove-double-div75.6%
Simplified75.6%
*-commutative75.6%
metadata-eval75.6%
sqrt-div73.5%
associate-*r/82.4%
clear-num83.2%
add-sqr-sqrt45.0%
sqrt-prod29.1%
unpow229.1%
expm1-log1p-u28.3%
sqrt-prod22.3%
expm1-udef18.8%
Applied egg-rr31.0%
expm1-def55.7%
expm1-log1p74.2%
associate-/r/75.8%
Simplified75.8%
associate-*l/84.7%
Applied egg-rr84.7%
if 1.99999999999999982e-307 < (*.f64 V l) < 9.9999999999999996e274Initial program 80.8%
sqrt-div99.5%
associate-*r/97.8%
Applied egg-rr97.8%
*-commutative97.8%
associate-/l*94.8%
associate-/r/99.5%
Simplified99.5%
if 9.9999999999999996e274 < (*.f64 V l) Initial program 44.3%
*-commutative44.3%
associate-/l/77.8%
Simplified77.8%
Final simplification80.3%
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 (sqrt (/ A V))))
(if (<= (* V l) -1e+211)
(* (/ c0 (sqrt l)) t_0)
(if (<= (* V l) -2e-248)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 2e-307)
(* c0 (/ t_0 (sqrt l)))
(if (<= (* V l) 1e+275)
(* c0 (/ (sqrt A) (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 t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -1e+211) {
tmp = (c0 / sqrt(l)) * t_0;
} else if ((V * l) <= -2e-248) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 2e-307) {
tmp = c0 * (t_0 / sqrt(l));
} else if ((V * l) <= 1e+275) {
tmp = c0 * (sqrt(A) / 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) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-1d+211)) then
tmp = (c0 / sqrt(l)) * t_0
else if ((v * l) <= (-2d-248)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 2d-307) then
tmp = c0 * (t_0 / sqrt(l))
else if ((v * l) <= 1d+275) then
tmp = c0 * (sqrt(a) / 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 t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -1e+211) {
tmp = (c0 / Math.sqrt(l)) * t_0;
} else if ((V * l) <= -2e-248) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 2e-307) {
tmp = c0 * (t_0 / Math.sqrt(l));
} else if ((V * l) <= 1e+275) {
tmp = c0 * (Math.sqrt(A) / 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): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -1e+211: tmp = (c0 / math.sqrt(l)) * t_0 elif (V * l) <= -2e-248: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 2e-307: tmp = c0 * (t_0 / math.sqrt(l)) elif (V * l) <= 1e+275: tmp = c0 * (math.sqrt(A) / 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) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -1e+211) tmp = Float64(Float64(c0 / sqrt(l)) * t_0); elseif (Float64(V * l) <= -2e-248) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 2e-307) tmp = Float64(c0 * Float64(t_0 / sqrt(l))); elseif (Float64(V * l) <= 1e+275) tmp = Float64(c0 * Float64(sqrt(A) / 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)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -1e+211)
tmp = (c0 / sqrt(l)) * t_0;
elseif ((V * l) <= -2e-248)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 2e-307)
tmp = c0 * (t_0 / sqrt(l));
elseif ((V * l) <= 1e+275)
tmp = c0 * (sqrt(A) / 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_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+211], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-248], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-307], N[(c0 * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+275], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / 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}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+211}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot t_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-248}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-307}:\\
\;\;\;\;c0 \cdot \frac{t_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+275}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.9999999999999996e210Initial program 38.1%
associate-/r*62.2%
clear-num60.2%
sqrt-div60.3%
metadata-eval60.3%
div-inv60.2%
clear-num60.2%
Applied egg-rr60.2%
associate-*r/36.1%
*-commutative36.1%
*-lft-identity36.1%
times-frac60.2%
remove-double-div60.2%
associate-/r*60.2%
*-rgt-identity60.2%
remove-double-div60.2%
Simplified60.2%
*-commutative60.2%
metadata-eval60.2%
sqrt-div60.1%
associate-*r/36.1%
clear-num38.1%
add-sqr-sqrt21.9%
sqrt-prod19.2%
unpow219.2%
expm1-log1p-u19.0%
sqrt-prod15.0%
expm1-udef15.1%
Applied egg-rr28.8%
expm1-def42.1%
expm1-log1p60.2%
associate-/r/60.2%
Simplified60.2%
associate-/r/60.2%
sqrt-div37.1%
associate-/r/37.2%
Applied egg-rr37.2%
if -9.9999999999999996e210 < (*.f64 V l) < -1.99999999999999996e-248Initial program 83.0%
associate-/r*73.4%
clear-num72.5%
sqrt-div73.8%
metadata-eval73.8%
div-inv73.8%
clear-num73.8%
Applied egg-rr73.8%
associate-*r/84.3%
*-commutative84.3%
*-lft-identity84.3%
times-frac75.3%
remove-double-div75.3%
associate-/r*75.3%
*-rgt-identity75.3%
remove-double-div75.3%
Simplified75.3%
*-commutative75.3%
metadata-eval75.3%
sqrt-div73.2%
associate-*r/82.2%
clear-num83.0%
add-sqr-sqrt44.4%
sqrt-prod28.4%
unpow228.4%
expm1-log1p-u27.6%
sqrt-prod22.5%
expm1-udef19.0%
Applied egg-rr30.3%
expm1-def55.3%
expm1-log1p73.9%
associate-/r/75.5%
Simplified75.5%
associate-*l/84.5%
Applied egg-rr84.5%
if -1.99999999999999996e-248 < (*.f64 V l) < 1.99999999999999982e-307Initial program 47.0%
associate-/r*73.1%
sqrt-div56.5%
associate-*r/56.5%
Applied egg-rr56.5%
*-commutative56.5%
associate-/l*56.3%
associate-/r/56.5%
Simplified56.5%
if 1.99999999999999982e-307 < (*.f64 V l) < 9.9999999999999996e274Initial program 80.8%
sqrt-div99.5%
associate-*r/97.8%
Applied egg-rr97.8%
*-commutative97.8%
associate-/l*94.8%
associate-/r/99.5%
Simplified99.5%
if 9.9999999999999996e274 < (*.f64 V l) Initial program 44.3%
*-commutative44.3%
associate-/l/77.8%
Simplified77.8%
Final simplification80.3%
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 l) (sqrt (/ V A))))))
(if (<= (* V l) -2e+212)
t_0
(if (<= (* V l) -5e-192)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 2e-307)
t_0
(if (<= (* V l) 1e+275)
(* c0 (/ (sqrt A) (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 t_0 = c0 / (sqrt(l) * sqrt((V / A)));
double tmp;
if ((V * l) <= -2e+212) {
tmp = t_0;
} else if ((V * l) <= -5e-192) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 2e-307) {
tmp = t_0;
} else if ((V * l) <= 1e+275) {
tmp = c0 * (sqrt(A) / 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) :: t_0
real(8) :: tmp
t_0 = c0 / (sqrt(l) * sqrt((v / a)))
if ((v * l) <= (-2d+212)) then
tmp = t_0
else if ((v * l) <= (-5d-192)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 2d-307) then
tmp = t_0
else if ((v * l) <= 1d+275) then
tmp = c0 * (sqrt(a) / 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 t_0 = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
double tmp;
if ((V * l) <= -2e+212) {
tmp = t_0;
} else if ((V * l) <= -5e-192) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 2e-307) {
tmp = t_0;
} else if ((V * l) <= 1e+275) {
tmp = c0 * (Math.sqrt(A) / 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): t_0 = c0 / (math.sqrt(l) * math.sqrt((V / A))) tmp = 0 if (V * l) <= -2e+212: tmp = t_0 elif (V * l) <= -5e-192: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 2e-307: tmp = t_0 elif (V * l) <= 1e+275: tmp = c0 * (math.sqrt(A) / 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) t_0 = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))) tmp = 0.0 if (Float64(V * l) <= -2e+212) tmp = t_0; elseif (Float64(V * l) <= -5e-192) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 2e-307) tmp = t_0; elseif (Float64(V * l) <= 1e+275) tmp = Float64(c0 * Float64(sqrt(A) / 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)
t_0 = c0 / (sqrt(l) * sqrt((V / A)));
tmp = 0.0;
if ((V * l) <= -2e+212)
tmp = t_0;
elseif ((V * l) <= -5e-192)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 2e-307)
tmp = t_0;
elseif ((V * l) <= 1e+275)
tmp = c0 * (sqrt(A) / 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_] := Block[{t$95$0 = N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+212], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-192], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-307], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 1e+275], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / 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}
t_0 := \frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+212}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-192}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-307}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+275}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.9999999999999998e212 or -5.0000000000000001e-192 < (*.f64 V l) < 1.99999999999999982e-307Initial program 45.3%
associate-/r*67.5%
clear-num66.8%
sqrt-div66.8%
metadata-eval66.8%
div-inv66.8%
clear-num66.8%
Applied egg-rr66.8%
associate-*r/44.7%
*-commutative44.7%
*-lft-identity44.7%
times-frac66.8%
remove-double-div66.8%
associate-/r*66.8%
*-rgt-identity66.8%
remove-double-div66.8%
Simplified66.8%
*-commutative66.8%
metadata-eval66.8%
sqrt-div66.8%
associate-*r/44.6%
clear-num45.3%
add-sqr-sqrt28.9%
sqrt-prod24.3%
unpow224.3%
expm1-log1p-u23.8%
sqrt-prod21.4%
expm1-udef20.1%
Applied egg-rr34.1%
expm1-def44.1%
expm1-log1p66.8%
associate-/r/66.8%
Simplified66.8%
pow1/266.8%
associate-/r/66.8%
div-inv66.8%
unpow-prod-down51.4%
pow1/251.4%
clear-num52.5%
Applied egg-rr52.5%
unpow1/252.5%
Simplified52.5%
if -1.9999999999999998e212 < (*.f64 V l) < -5.0000000000000001e-192Initial program 85.9%
associate-/r*75.2%
clear-num74.2%
sqrt-div75.7%
metadata-eval75.7%
div-inv75.7%
clear-num75.7%
Applied egg-rr75.7%
associate-*r/87.4%
*-commutative87.4%
*-lft-identity87.4%
times-frac77.4%
remove-double-div77.4%
associate-/r*77.4%
*-rgt-identity77.4%
remove-double-div77.4%
Simplified77.4%
*-commutative77.4%
metadata-eval77.4%
sqrt-div75.0%
associate-*r/85.0%
clear-num85.9%
add-sqr-sqrt45.6%
sqrt-prod28.8%
unpow228.8%
expm1-log1p-u28.2%
sqrt-prod21.3%
expm1-udef17.4%
Applied egg-rr28.0%
expm1-def56.8%
expm1-log1p75.8%
associate-/r/77.5%
Simplified77.5%
associate-*l/87.5%
Applied egg-rr87.5%
if 1.99999999999999982e-307 < (*.f64 V l) < 9.9999999999999996e274Initial program 80.8%
sqrt-div99.5%
associate-*r/97.8%
Applied egg-rr97.8%
*-commutative97.8%
associate-/l*94.8%
associate-/r/99.5%
Simplified99.5%
if 9.9999999999999996e274 < (*.f64 V l) Initial program 44.3%
*-commutative44.3%
associate-/l/77.8%
Simplified77.8%
Final simplification81.0%
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 (sqrt (/ V A))))
(if (<= (* V l) -1e+211)
(/ (/ c0 (sqrt l)) t_0)
(if (<= (* V l) -5e-192)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 2e-307)
(/ c0 (* (sqrt l) t_0))
(if (<= (* V l) 1e+275)
(* c0 (/ (sqrt A) (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 t_0 = sqrt((V / A));
double tmp;
if ((V * l) <= -1e+211) {
tmp = (c0 / sqrt(l)) / t_0;
} else if ((V * l) <= -5e-192) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 2e-307) {
tmp = c0 / (sqrt(l) * t_0);
} else if ((V * l) <= 1e+275) {
tmp = c0 * (sqrt(A) / 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) :: t_0
real(8) :: tmp
t_0 = sqrt((v / a))
if ((v * l) <= (-1d+211)) then
tmp = (c0 / sqrt(l)) / t_0
else if ((v * l) <= (-5d-192)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 2d-307) then
tmp = c0 / (sqrt(l) * t_0)
else if ((v * l) <= 1d+275) then
tmp = c0 * (sqrt(a) / 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 t_0 = Math.sqrt((V / A));
double tmp;
if ((V * l) <= -1e+211) {
tmp = (c0 / Math.sqrt(l)) / t_0;
} else if ((V * l) <= -5e-192) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 2e-307) {
tmp = c0 / (Math.sqrt(l) * t_0);
} else if ((V * l) <= 1e+275) {
tmp = c0 * (Math.sqrt(A) / 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): t_0 = math.sqrt((V / A)) tmp = 0 if (V * l) <= -1e+211: tmp = (c0 / math.sqrt(l)) / t_0 elif (V * l) <= -5e-192: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 2e-307: tmp = c0 / (math.sqrt(l) * t_0) elif (V * l) <= 1e+275: tmp = c0 * (math.sqrt(A) / 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) t_0 = sqrt(Float64(V / A)) tmp = 0.0 if (Float64(V * l) <= -1e+211) tmp = Float64(Float64(c0 / sqrt(l)) / t_0); elseif (Float64(V * l) <= -5e-192) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 2e-307) tmp = Float64(c0 / Float64(sqrt(l) * t_0)); elseif (Float64(V * l) <= 1e+275) tmp = Float64(c0 * Float64(sqrt(A) / 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)
t_0 = sqrt((V / A));
tmp = 0.0;
if ((V * l) <= -1e+211)
tmp = (c0 / sqrt(l)) / t_0;
elseif ((V * l) <= -5e-192)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 2e-307)
tmp = c0 / (sqrt(l) * t_0);
elseif ((V * l) <= 1e+275)
tmp = c0 * (sqrt(A) / 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_] := Block[{t$95$0 = N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+211], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-192], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-307], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+275], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / 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}
t_0 := \sqrt{\frac{V}{A}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+211}:\\
\;\;\;\;\frac{\frac{c0}{\sqrt{\ell}}}{t_0}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-192}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-307}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot t_0}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+275}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.9999999999999996e210Initial program 38.1%
*-un-lft-identity38.1%
times-frac60.3%
Applied egg-rr60.3%
associate-*l/60.2%
*-un-lft-identity60.2%
Applied egg-rr60.2%
associate-/l/38.1%
sqrt-div0.0%
clear-num0.0%
sqrt-div36.1%
*-commutative36.1%
associate-*l/60.2%
div-inv60.2%
associate-/r/60.2%
clear-num60.0%
associate-/r/60.1%
clear-num60.1%
*-commutative60.1%
Applied egg-rr60.1%
*-un-lft-identity60.1%
sqrt-prod37.2%
times-frac37.2%
Applied egg-rr37.2%
associate-*r/37.2%
associate-*l/37.3%
*-lft-identity37.3%
Simplified37.3%
if -9.9999999999999996e210 < (*.f64 V l) < -5.0000000000000001e-192Initial program 85.7%
associate-/r*74.9%
clear-num73.9%
sqrt-div75.3%
metadata-eval75.3%
div-inv75.3%
clear-num75.4%
Applied egg-rr75.4%
associate-*r/87.2%
*-commutative87.2%
*-lft-identity87.2%
times-frac77.1%
remove-double-div77.1%
associate-/r*77.1%
*-rgt-identity77.1%
remove-double-div77.1%
Simplified77.1%
*-commutative77.1%
metadata-eval77.1%
sqrt-div74.7%
associate-*r/84.8%
clear-num85.7%
add-sqr-sqrt44.9%
sqrt-prod27.9%
unpow227.9%
expm1-log1p-u27.2%
sqrt-prod21.5%
expm1-udef17.5%
Applied egg-rr28.2%
expm1-def56.3%
expm1-log1p75.5%
associate-/r/77.3%
Simplified77.3%
associate-*l/87.4%
Applied egg-rr87.4%
if -5.0000000000000001e-192 < (*.f64 V l) < 1.99999999999999982e-307Initial program 50.0%
associate-/r*70.7%
clear-num70.7%
sqrt-div70.7%
metadata-eval70.7%
div-inv70.6%
clear-num70.7%
Applied egg-rr70.7%
associate-*r/50.0%
*-commutative50.0%
*-lft-identity50.0%
times-frac70.7%
remove-double-div70.7%
associate-/r*70.7%
*-rgt-identity70.7%
remove-double-div70.7%
Simplified70.7%
*-commutative70.7%
metadata-eval70.7%
sqrt-div70.7%
associate-*r/49.9%
clear-num50.0%
add-sqr-sqrt33.8%
sqrt-prod28.4%
unpow228.4%
expm1-log1p-u27.7%
sqrt-prod24.3%
expm1-udef22.3%
Applied egg-rr36.1%
expm1-def46.2%
expm1-log1p70.6%
associate-/r/70.7%
Simplified70.7%
pow1/270.7%
associate-/r/70.6%
div-inv70.7%
unpow-prod-down57.3%
pow1/257.3%
clear-num58.9%
Applied egg-rr58.9%
unpow1/258.9%
Simplified58.9%
if 1.99999999999999982e-307 < (*.f64 V l) < 9.9999999999999996e274Initial program 80.8%
sqrt-div99.5%
associate-*r/97.8%
Applied egg-rr97.8%
*-commutative97.8%
associate-/l*94.8%
associate-/r/99.5%
Simplified99.5%
if 9.9999999999999996e274 < (*.f64 V l) Initial program 44.3%
*-commutative44.3%
associate-/l/77.8%
Simplified77.8%
Final simplification80.6%
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 l))))
(if (<= (* V l) -1e+274)
(/ t_0 (sqrt (/ V A)))
(if (<= (* V l) -1e-306)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 2e-307)
(* t_0 (sqrt (/ A V)))
(if (<= (* V l) 1e+275)
(* c0 (/ (sqrt A) (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 t_0 = c0 / sqrt(l);
double tmp;
if ((V * l) <= -1e+274) {
tmp = t_0 / sqrt((V / A));
} else if ((V * l) <= -1e-306) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 2e-307) {
tmp = t_0 * sqrt((A / V));
} else if ((V * l) <= 1e+275) {
tmp = c0 * (sqrt(A) / 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) :: t_0
real(8) :: tmp
t_0 = c0 / sqrt(l)
if ((v * l) <= (-1d+274)) then
tmp = t_0 / sqrt((v / a))
else if ((v * l) <= (-1d-306)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 2d-307) then
tmp = t_0 * sqrt((a / v))
else if ((v * l) <= 1d+275) then
tmp = c0 * (sqrt(a) / 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 t_0 = c0 / Math.sqrt(l);
double tmp;
if ((V * l) <= -1e+274) {
tmp = t_0 / Math.sqrt((V / A));
} else if ((V * l) <= -1e-306) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 2e-307) {
tmp = t_0 * Math.sqrt((A / V));
} else if ((V * l) <= 1e+275) {
tmp = c0 * (Math.sqrt(A) / 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): t_0 = c0 / math.sqrt(l) tmp = 0 if (V * l) <= -1e+274: tmp = t_0 / math.sqrt((V / A)) elif (V * l) <= -1e-306: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 2e-307: tmp = t_0 * math.sqrt((A / V)) elif (V * l) <= 1e+275: tmp = c0 * (math.sqrt(A) / 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) t_0 = Float64(c0 / sqrt(l)) tmp = 0.0 if (Float64(V * l) <= -1e+274) tmp = Float64(t_0 / sqrt(Float64(V / A))); elseif (Float64(V * l) <= -1e-306) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 2e-307) tmp = Float64(t_0 * sqrt(Float64(A / V))); elseif (Float64(V * l) <= 1e+275) tmp = Float64(c0 * Float64(sqrt(A) / 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)
t_0 = c0 / sqrt(l);
tmp = 0.0;
if ((V * l) <= -1e+274)
tmp = t_0 / sqrt((V / A));
elseif ((V * l) <= -1e-306)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 2e-307)
tmp = t_0 * sqrt((A / V));
elseif ((V * l) <= 1e+275)
tmp = c0 * (sqrt(A) / 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_] := Block[{t$95$0 = N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+274], N[(t$95$0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-306], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-307], N[(t$95$0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+275], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / 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}
t_0 := \frac{c0}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+274}:\\
\;\;\;\;\frac{t_0}{\sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-306}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-307}:\\
\;\;\;\;t_0 \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+275}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999921e273Initial program 16.9%
*-un-lft-identity16.9%
times-frac55.5%
Applied egg-rr55.5%
associate-*l/55.4%
*-un-lft-identity55.4%
Applied egg-rr55.4%
associate-/l/16.9%
sqrt-div0.0%
clear-num0.0%
sqrt-div16.9%
*-commutative16.9%
associate-*l/55.5%
div-inv55.4%
associate-/r/55.5%
clear-num55.3%
associate-/r/55.5%
clear-num55.5%
*-commutative55.5%
Applied egg-rr55.5%
*-un-lft-identity55.5%
sqrt-prod26.5%
times-frac26.7%
Applied egg-rr26.7%
associate-*r/26.7%
associate-*l/26.7%
*-lft-identity26.7%
Simplified26.7%
if -9.99999999999999921e273 < (*.f64 V l) < -1.00000000000000003e-306Initial program 80.9%
frac-2neg80.9%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if -1.00000000000000003e-306 < (*.f64 V l) < 1.99999999999999982e-307Initial program 40.6%
associate-/r*74.5%
clear-num74.4%
sqrt-div74.4%
metadata-eval74.4%
div-inv74.3%
clear-num74.4%
Applied egg-rr74.4%
associate-*r/40.6%
*-commutative40.6%
*-lft-identity40.6%
times-frac74.4%
remove-double-div74.5%
associate-/r*74.5%
*-rgt-identity74.5%
remove-double-div74.4%
Simplified74.4%
*-commutative74.4%
metadata-eval74.4%
sqrt-div74.4%
associate-*r/40.6%
clear-num40.6%
add-sqr-sqrt24.7%
sqrt-prod24.7%
unpow224.7%
expm1-log1p-u24.7%
sqrt-prod24.7%
expm1-udef24.7%
Applied egg-rr33.8%
expm1-def43.2%
expm1-log1p74.3%
associate-/r/74.3%
Simplified74.3%
associate-/r/74.3%
sqrt-div56.8%
associate-/r/56.9%
Applied egg-rr56.9%
if 1.99999999999999982e-307 < (*.f64 V l) < 9.9999999999999996e274Initial program 80.8%
sqrt-div99.5%
associate-*r/97.8%
Applied egg-rr97.8%
*-commutative97.8%
associate-/l*94.8%
associate-/r/99.5%
Simplified99.5%
if 9.9999999999999996e274 < (*.f64 V l) Initial program 44.3%
*-commutative44.3%
associate-/l/77.8%
Simplified77.8%
Final simplification88.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 (<= (* V l) -1e+274)
(* c0 (/ (sqrt (/ (- A) l)) (sqrt (- V))))
(if (<= (* V l) -1e-306)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 2e-307)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) 1e+275)
(* c0 (/ (sqrt A) (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+274) {
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
} else if ((V * l) <= -1e-306) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 2e-307) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((V * l) <= 1e+275) {
tmp = c0 * (sqrt(A) / 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+274)) then
tmp = c0 * (sqrt((-a / l)) / sqrt(-v))
else if ((v * l) <= (-1d-306)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 2d-307) then
tmp = (c0 / sqrt(l)) * sqrt((a / v))
else if ((v * l) <= 1d+275) then
tmp = c0 * (sqrt(a) / 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+274) {
tmp = c0 * (Math.sqrt((-A / l)) / Math.sqrt(-V));
} else if ((V * l) <= -1e-306) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 2e-307) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((V * l) <= 1e+275) {
tmp = c0 * (Math.sqrt(A) / 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+274: tmp = c0 * (math.sqrt((-A / l)) / math.sqrt(-V)) elif (V * l) <= -1e-306: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 2e-307: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) elif (V * l) <= 1e+275: tmp = c0 * (math.sqrt(A) / 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+274) tmp = Float64(c0 * Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -1e-306) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 2e-307) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= 1e+275) tmp = Float64(c0 * Float64(sqrt(A) / 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+274)
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
elseif ((V * l) <= -1e-306)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 2e-307)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
elseif ((V * l) <= 1e+275)
tmp = c0 * (sqrt(A) / 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+274], N[(c0 * N[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-306], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-307], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+275], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / 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 -1 \cdot 10^{+274}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-306}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-307}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+275}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999921e273Initial program 16.9%
*-un-lft-identity16.9%
times-frac55.5%
Applied egg-rr55.5%
associate-*l/55.4%
*-un-lft-identity55.4%
Applied egg-rr55.4%
frac-2neg55.4%
sqrt-div26.6%
distribute-neg-frac26.6%
Applied egg-rr26.6%
if -9.99999999999999921e273 < (*.f64 V l) < -1.00000000000000003e-306Initial program 80.9%
frac-2neg80.9%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if -1.00000000000000003e-306 < (*.f64 V l) < 1.99999999999999982e-307Initial program 40.6%
associate-/r*74.5%
clear-num74.4%
sqrt-div74.4%
metadata-eval74.4%
div-inv74.3%
clear-num74.4%
Applied egg-rr74.4%
associate-*r/40.6%
*-commutative40.6%
*-lft-identity40.6%
times-frac74.4%
remove-double-div74.5%
associate-/r*74.5%
*-rgt-identity74.5%
remove-double-div74.4%
Simplified74.4%
*-commutative74.4%
metadata-eval74.4%
sqrt-div74.4%
associate-*r/40.6%
clear-num40.6%
add-sqr-sqrt24.7%
sqrt-prod24.7%
unpow224.7%
expm1-log1p-u24.7%
sqrt-prod24.7%
expm1-udef24.7%
Applied egg-rr33.8%
expm1-def43.2%
expm1-log1p74.3%
associate-/r/74.3%
Simplified74.3%
associate-/r/74.3%
sqrt-div56.8%
associate-/r/56.9%
Applied egg-rr56.9%
if 1.99999999999999982e-307 < (*.f64 V l) < 9.9999999999999996e274Initial program 80.8%
sqrt-div99.5%
associate-*r/97.8%
Applied egg-rr97.8%
*-commutative97.8%
associate-/l*94.8%
associate-/r/99.5%
Simplified99.5%
if 9.9999999999999996e274 < (*.f64 V l) Initial program 44.3%
*-commutative44.3%
associate-/l/77.8%
Simplified77.8%
Final simplification88.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 2e-314) (not (<= t_0 5e+307)))
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(* c0 (sqrt t_0)))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 2e-314) || !(t_0 <= 5e+307)) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 2d-314) .or. (.not. (t_0 <= 5d+307))) then
tmp = (c0 / sqrt(l)) * sqrt((a / v))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 2e-314) || !(t_0 <= 5e+307)) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 2e-314) or not (t_0 <= 5e+307): tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) else: tmp = c0 * math.sqrt(t_0) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 2e-314) || !(t_0 <= 5e+307)) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 2e-314) || ~((t_0 <= 5e+307)))
tmp = (c0 / sqrt(l)) * sqrt((A / V));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 2e-314], N[Not[LessEqual[t$95$0, 5e+307]], $MachinePrecision]], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-314} \lor \neg \left(t_0 \leq 5 \cdot 10^{+307}\right):\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 1.9999999999e-314 or 5e307 < (/.f64 A (*.f64 V l)) Initial program 26.8%
associate-/r*47.6%
clear-num45.8%
sqrt-div47.8%
metadata-eval47.8%
div-inv47.8%
clear-num47.8%
Applied egg-rr47.8%
associate-*r/28.2%
*-commutative28.2%
*-lft-identity28.2%
times-frac47.7%
remove-double-div47.7%
associate-/r*47.7%
*-rgt-identity47.7%
remove-double-div47.7%
Simplified47.7%
*-commutative47.7%
metadata-eval47.7%
sqrt-div45.8%
associate-*r/25.6%
clear-num26.8%
add-sqr-sqrt13.4%
sqrt-prod19.3%
unpow219.3%
expm1-log1p-u19.3%
sqrt-prod19.3%
expm1-udef19.4%
Applied egg-rr27.7%
expm1-def35.4%
expm1-log1p47.7%
associate-/r/47.7%
Simplified47.7%
associate-/r/47.7%
sqrt-div39.6%
associate-/r/39.7%
Applied egg-rr39.7%
if 1.9999999999e-314 < (/.f64 A (*.f64 V l)) < 5e307Initial program 99.1%
Final simplification74.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 (<= V 1.2e-308) (/ c0 (sqrt (* V (/ l A)))) (* c0 (/ (sqrt (/ A l)) (sqrt V)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= 1.2e-308) {
tmp = c0 / sqrt((V * (l / A)));
} else {
tmp = c0 * (sqrt((A / 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 <= 1.2d-308) then
tmp = c0 / sqrt((v * (l / a)))
else
tmp = c0 * (sqrt((a / 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 <= 1.2e-308) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else {
tmp = c0 * (Math.sqrt((A / 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 <= 1.2e-308: tmp = c0 / math.sqrt((V * (l / A))) else: tmp = c0 * (math.sqrt((A / 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 <= 1.2e-308) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / 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 <= 1.2e-308)
tmp = c0 / sqrt((V * (l / A)));
else
tmp = c0 * (sqrt((A / 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, 1.2e-308], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[V], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq 1.2 \cdot 10^{-308}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{\ell}}}{\sqrt{V}}\\
\end{array}
\end{array}
if V < 1.1999999999999998e-308Initial program 72.5%
associate-/r*75.5%
clear-num73.8%
sqrt-div74.4%
metadata-eval74.4%
div-inv74.4%
clear-num74.4%
Applied egg-rr74.4%
associate-*r/71.9%
*-commutative71.9%
*-lft-identity71.9%
times-frac75.0%
remove-double-div75.0%
associate-/r*75.0%
*-rgt-identity75.0%
remove-double-div75.0%
Simplified75.0%
*-commutative75.0%
metadata-eval75.0%
sqrt-div74.5%
associate-*r/70.8%
clear-num72.5%
add-sqr-sqrt40.2%
sqrt-prod28.9%
unpow228.9%
expm1-log1p-u28.1%
sqrt-prod24.1%
expm1-udef19.2%
Applied egg-rr30.9%
expm1-def59.5%
expm1-log1p74.5%
associate-/r/75.1%
Simplified75.1%
if 1.1999999999999998e-308 < V Initial program 66.7%
*-un-lft-identity66.7%
times-frac69.1%
Applied egg-rr69.1%
associate-*l/69.1%
*-un-lft-identity69.1%
sqrt-div77.7%
Applied egg-rr77.7%
Final simplification76.4%
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 69.7%
Final simplification69.7%
herbie shell --seed 2024026
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))