
(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 (<= A -2e-310) (* c0 (/ (/ 1.0 (/ (sqrt (- V)) (sqrt (- A)))) (sqrt l))) (/ c0 (/ (sqrt (* V l)) (sqrt A)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -2e-310) {
tmp = c0 * ((1.0 / (sqrt(-V) / sqrt(-A))) / sqrt(l));
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(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 (a <= (-2d-310)) then
tmp = c0 * ((1.0d0 / (sqrt(-v) / sqrt(-a))) / sqrt(l))
else
tmp = c0 / (sqrt((v * l)) / sqrt(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 (A <= -2e-310) {
tmp = c0 * ((1.0 / (Math.sqrt(-V) / Math.sqrt(-A))) / Math.sqrt(l));
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -2e-310: tmp = c0 * ((1.0 / (math.sqrt(-V) / math.sqrt(-A))) / math.sqrt(l)) else: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -2e-310) tmp = Float64(c0 * Float64(Float64(1.0 / Float64(sqrt(Float64(-V)) / sqrt(Float64(-A)))) / sqrt(l))); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(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 (A <= -2e-310)
tmp = c0 * ((1.0 / (sqrt(-V) / sqrt(-A))) / sqrt(l));
else
tmp = c0 / (sqrt((V * l)) / sqrt(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[A, -2e-310], N[(c0 * N[(N[(1.0 / N[(N[Sqrt[(-V)], $MachinePrecision] / N[Sqrt[(-A)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\frac{1}{\frac{\sqrt{-V}}{\sqrt{-A}}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -1.999999999999994e-310Initial program 78.6%
associate-/r*78.4%
sqrt-div49.2%
clear-num49.1%
sqrt-div49.3%
metadata-eval49.3%
associate-/l/49.2%
Applied egg-rr49.2%
associate-/l/49.3%
Simplified49.3%
frac-2neg49.3%
sqrt-div53.5%
Applied egg-rr53.5%
if -1.999999999999994e-310 < A Initial program 68.5%
sqrt-div86.6%
associate-*r/83.6%
Applied egg-rr83.6%
associate-/l*86.7%
Simplified86.7%
Final simplification69.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 (/ A (* V l))))))
(if (<= t_0 2e-290)
(/ c0 (sqrt (* V (/ l A))))
(if (<= t_0 4e+292) t_0 (* c0 (/ 1.0 (sqrt (* l (/ V A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-290) {
tmp = c0 / sqrt((V * (l / A)));
} else if (t_0 <= 4e+292) {
tmp = t_0;
} else {
tmp = c0 * (1.0 / sqrt((l * (V / A))));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 2d-290) then
tmp = c0 / sqrt((v * (l / a)))
else if (t_0 <= 4d+292) then
tmp = t_0
else
tmp = c0 * (1.0d0 / sqrt((l * (v / a))))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-290) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if (t_0 <= 4e+292) {
tmp = t_0;
} else {
tmp = c0 * (1.0 / Math.sqrt((l * (V / A))));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 2e-290: tmp = c0 / math.sqrt((V * (l / A))) elif t_0 <= 4e+292: tmp = t_0 else: tmp = c0 * (1.0 / math.sqrt((l * (V / A)))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 2e-290) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (t_0 <= 4e+292) tmp = t_0; else tmp = Float64(c0 * Float64(1.0 / sqrt(Float64(l * Float64(V / A))))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 2e-290)
tmp = c0 / sqrt((V * (l / A)));
elseif (t_0 <= 4e+292)
tmp = t_0;
else
tmp = c0 * (1.0 / sqrt((l * (V / A))));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-290], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+292], t$95$0, N[(c0 * N[(1.0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-290}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;t_0 \leq 4 \cdot 10^{+292}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000001e-290Initial program 68.5%
associate-/r*69.2%
div-inv69.2%
div-inv69.1%
associate-*l*68.7%
Applied egg-rr68.7%
frac-times68.5%
metadata-eval68.5%
div-inv68.5%
sqrt-div41.6%
clear-num41.5%
div-inv41.6%
sqrt-undiv67.9%
*-un-lft-identity67.9%
times-frac70.3%
/-rgt-identity70.3%
Applied egg-rr70.3%
if 2.0000000000000001e-290 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.0000000000000001e292Initial program 99.4%
if 4.0000000000000001e292 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 45.1%
clear-num45.1%
sqrt-div49.1%
metadata-eval49.1%
*-commutative49.1%
associate-/l*55.3%
div-inv55.2%
clear-num55.4%
Applied egg-rr55.4%
Final simplification76.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (or (<= t_0 2e-290) (not (<= t_0 2e+265)))
(/ c0 (sqrt (* V (/ l A))))
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-290) || !(t_0 <= 2e+265)) {
tmp = c0 / sqrt((V * (l / A)));
} 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-290) .or. (.not. (t_0 <= 2d+265))) then
tmp = c0 / sqrt((v * (l / a)))
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-290) || !(t_0 <= 2e+265)) {
tmp = c0 / Math.sqrt((V * (l / A)));
} 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-290) or not (t_0 <= 2e+265): tmp = c0 / math.sqrt((V * (l / A))) 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-290) || !(t_0 <= 2e+265)) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); 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-290) || ~((t_0 <= 2e+265)))
tmp = c0 / sqrt((V * (l / A)));
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-290], N[Not[LessEqual[t$95$0, 2e+265]], $MachinePrecision]], N[(c0 / N[Sqrt[N[(V * N[(l / A), $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{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-290} \lor \neg \left(t_0 \leq 2 \cdot 10^{+265}\right):\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000001e-290 or 2.00000000000000013e265 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 65.4%
associate-/r*67.0%
div-inv66.9%
div-inv66.9%
associate-*l*65.5%
Applied egg-rr65.5%
frac-times65.4%
metadata-eval65.4%
div-inv65.4%
sqrt-div39.7%
clear-num39.7%
div-inv39.7%
sqrt-undiv65.5%
*-un-lft-identity65.5%
times-frac67.4%
/-rgt-identity67.4%
Applied egg-rr67.4%
if 2.0000000000000001e-290 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000013e265Initial program 99.4%
Final simplification75.2%
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-290)
(/ c0 (sqrt (* V (/ l A))))
(if (<= t_0 2e+265) t_0 (/ c0 (sqrt (/ V (/ A l))))))))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-290) {
tmp = c0 / sqrt((V * (l / A)));
} else if (t_0 <= 2e+265) {
tmp = t_0;
} else {
tmp = c0 / sqrt((V / (A / 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((a / (v * l)))
if (t_0 <= 2d-290) then
tmp = c0 / sqrt((v * (l / a)))
else if (t_0 <= 2d+265) then
tmp = t_0
else
tmp = c0 / sqrt((v / (a / 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((A / (V * l)));
double tmp;
if (t_0 <= 2e-290) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if (t_0 <= 2e+265) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
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-290: tmp = c0 / math.sqrt((V * (l / A))) elif t_0 <= 2e+265: tmp = t_0 else: tmp = c0 / math.sqrt((V / (A / l))) 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-290) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (t_0 <= 2e+265) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / 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((A / (V * l)));
tmp = 0.0;
if (t_0 <= 2e-290)
tmp = c0 / sqrt((V * (l / A)));
elseif (t_0 <= 2e+265)
tmp = t_0;
else
tmp = c0 / sqrt((V / (A / 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[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-290], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+265], t$95$0, N[(c0 / N[Sqrt[N[(V / N[(A / l), $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^{-290}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+265}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000001e-290Initial program 68.5%
associate-/r*69.2%
div-inv69.2%
div-inv69.1%
associate-*l*68.7%
Applied egg-rr68.7%
frac-times68.5%
metadata-eval68.5%
div-inv68.5%
sqrt-div41.6%
clear-num41.5%
div-inv41.6%
sqrt-undiv67.9%
*-un-lft-identity67.9%
times-frac70.3%
/-rgt-identity70.3%
Applied egg-rr70.3%
if 2.0000000000000001e-290 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000013e265Initial program 99.4%
if 2.00000000000000013e265 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 51.3%
associate-/r*56.9%
div-inv56.8%
div-inv56.8%
associate-*l*51.3%
Applied egg-rr51.3%
frac-times51.3%
metadata-eval51.3%
div-inv51.3%
sqrt-div31.2%
clear-num31.2%
div-inv31.3%
clear-num31.3%
sqrt-undiv54.8%
*-commutative54.8%
associate-*r/60.3%
associate-*r/54.8%
*-commutative54.8%
*-un-lft-identity54.8%
times-frac54.1%
/-rgt-identity54.1%
Applied egg-rr54.1%
associate-/r/54.3%
associate-*l/54.3%
*-lft-identity54.3%
associate-*r/54.9%
associate-/l*54.3%
Simplified54.3%
Final simplification75.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -2e-310) (* c0 (/ (sqrt (- A)) (* (sqrt (- V)) (sqrt l)))) (/ c0 (/ (sqrt (* V l)) (sqrt A)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -2e-310) {
tmp = c0 * (sqrt(-A) / (sqrt(-V) * sqrt(l)));
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(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 (a <= (-2d-310)) then
tmp = c0 * (sqrt(-a) / (sqrt(-v) * sqrt(l)))
else
tmp = c0 / (sqrt((v * l)) / sqrt(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 (A <= -2e-310) {
tmp = c0 * (Math.sqrt(-A) / (Math.sqrt(-V) * Math.sqrt(l)));
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -2e-310: tmp = c0 * (math.sqrt(-A) / (math.sqrt(-V) * math.sqrt(l))) else: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -2e-310) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / Float64(sqrt(Float64(-V)) * sqrt(l)))); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(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 (A <= -2e-310)
tmp = c0 * (sqrt(-A) / (sqrt(-V) * sqrt(l)));
else
tmp = c0 / (sqrt((V * l)) / sqrt(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[A, -2e-310], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[(N[Sqrt[(-V)], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -2 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{-V} \cdot \sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -1.999999999999994e-310Initial program 78.6%
associate-/r*78.4%
sqrt-div49.2%
frac-2neg49.2%
sqrt-div53.5%
associate-/l/53.5%
Applied egg-rr53.5%
if -1.999999999999994e-310 < A Initial program 68.5%
sqrt-div86.6%
associate-*r/83.6%
Applied egg-rr83.6%
associate-/l*86.7%
Simplified86.7%
Final simplification69.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 (/ A V)) (sqrt l)))))
(if (<= (* V l) -2e+215)
t_0
(if (<= (* V l) -4e-132)
(* c0 (sqrt (* A (* (/ 1.0 V) (/ 1.0 l)))))
(if (<= (* V l) 0.0) t_0 (* (sqrt A) (/ c0 (sqrt (* V l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -2e+215) {
tmp = t_0;
} else if ((V * l) <= -4e-132) {
tmp = c0 * sqrt((A * ((1.0 / V) * (1.0 / l))));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = sqrt(A) * (c0 / sqrt((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((a / v)) / sqrt(l))
if ((v * l) <= (-2d+215)) then
tmp = t_0
else if ((v * l) <= (-4d-132)) then
tmp = c0 * sqrt((a * ((1.0d0 / v) * (1.0d0 / l))))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else
tmp = sqrt(a) * (c0 / sqrt((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((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -2e+215) {
tmp = t_0;
} else if ((V * l) <= -4e-132) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) * (1.0 / l))));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -2e+215: tmp = t_0 elif (V * l) <= -4e-132: tmp = c0 * math.sqrt((A * ((1.0 / V) * (1.0 / l)))) elif (V * l) <= 0.0: tmp = t_0 else: tmp = math.sqrt(A) * (c0 / math.sqrt((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(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -2e+215) tmp = t_0; elseif (Float64(V * l) <= -4e-132) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) * Float64(1.0 / l))))); elseif (Float64(V * l) <= 0.0) tmp = t_0; else tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(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((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -2e+215)
tmp = t_0;
elseif ((V * l) <= -4e-132)
tmp = c0 * sqrt((A * ((1.0 / V) * (1.0 / l))));
elseif ((V * l) <= 0.0)
tmp = t_0;
else
tmp = sqrt(A) * (c0 / sqrt((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[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+215], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -4e-132], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+215}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-132}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \left(\frac{1}{V} \cdot \frac{1}{\ell}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.99999999999999981e215 or -3.9999999999999999e-132 < (*.f64 V l) < 0.0Initial program 59.0%
associate-/r*75.5%
div-inv75.4%
div-inv75.4%
associate-*l*58.9%
Applied egg-rr58.9%
frac-times59.0%
metadata-eval59.0%
div-inv59.0%
clear-num59.0%
*-commutative59.0%
associate-*r/75.5%
sqrt-div76.0%
metadata-eval76.0%
sqrt-prod50.4%
associate-/l/50.5%
add-sqr-sqrt50.2%
*-un-lft-identity50.2%
times-frac50.3%
Applied egg-rr50.2%
associate-*r/50.2%
/-rgt-identity50.2%
rem-square-sqrt50.4%
Simplified50.4%
if -1.99999999999999981e215 < (*.f64 V l) < -3.9999999999999999e-132Initial program 95.1%
associate-/r*79.6%
div-inv79.6%
div-inv79.6%
associate-*l*95.2%
Applied egg-rr95.2%
if 0.0 < (*.f64 V l) Initial program 71.4%
sqrt-div91.2%
associate-*r/87.9%
Applied egg-rr87.9%
associate-/l*91.3%
Simplified91.3%
associate-/r/89.6%
Applied egg-rr89.6%
Final simplification79.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 (/ A V)) (sqrt l)))))
(if (<= (* V l) -2e+215)
t_0
(if (<= (* V l) -4e-132)
(* c0 (sqrt (* A (* (/ 1.0 V) (/ 1.0 l)))))
(if (<= (* V l) 0.0) t_0 (* c0 (/ (sqrt A) (sqrt (* V l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -2e+215) {
tmp = t_0;
} else if ((V * l) <= -4e-132) {
tmp = c0 * sqrt((A * ((1.0 / V) * (1.0 / l))));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = c0 * (sqrt(A) / sqrt((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((a / v)) / sqrt(l))
if ((v * l) <= (-2d+215)) then
tmp = t_0
else if ((v * l) <= (-4d-132)) then
tmp = c0 * sqrt((a * ((1.0d0 / v) * (1.0d0 / l))))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else
tmp = c0 * (sqrt(a) / sqrt((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((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -2e+215) {
tmp = t_0;
} else if ((V * l) <= -4e-132) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) * (1.0 / l))));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -2e+215: tmp = t_0 elif (V * l) <= -4e-132: tmp = c0 * math.sqrt((A * ((1.0 / V) * (1.0 / l)))) elif (V * l) <= 0.0: tmp = t_0 else: tmp = c0 * (math.sqrt(A) / math.sqrt((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(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -2e+215) tmp = t_0; elseif (Float64(V * l) <= -4e-132) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) * Float64(1.0 / l))))); elseif (Float64(V * l) <= 0.0) tmp = t_0; else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -2e+215)
tmp = t_0;
elseif ((V * l) <= -4e-132)
tmp = c0 * sqrt((A * ((1.0 / V) * (1.0 / l))));
elseif ((V * l) <= 0.0)
tmp = t_0;
else
tmp = c0 * (sqrt(A) / sqrt((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[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+215], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -4e-132], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+215}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-132}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \left(\frac{1}{V} \cdot \frac{1}{\ell}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.99999999999999981e215 or -3.9999999999999999e-132 < (*.f64 V l) < 0.0Initial program 59.0%
associate-/r*75.5%
div-inv75.4%
div-inv75.4%
associate-*l*58.9%
Applied egg-rr58.9%
frac-times59.0%
metadata-eval59.0%
div-inv59.0%
clear-num59.0%
*-commutative59.0%
associate-*r/75.5%
sqrt-div76.0%
metadata-eval76.0%
sqrt-prod50.4%
associate-/l/50.5%
add-sqr-sqrt50.2%
*-un-lft-identity50.2%
times-frac50.3%
Applied egg-rr50.2%
associate-*r/50.2%
/-rgt-identity50.2%
rem-square-sqrt50.4%
Simplified50.4%
if -1.99999999999999981e215 < (*.f64 V l) < -3.9999999999999999e-132Initial program 95.1%
associate-/r*79.6%
div-inv79.6%
div-inv79.6%
associate-*l*95.2%
Applied egg-rr95.2%
if 0.0 < (*.f64 V l) Initial program 71.4%
sqrt-div91.2%
associate-*r/87.9%
Applied egg-rr87.9%
*-commutative87.9%
associate-/l*89.6%
associate-/r/91.2%
Simplified91.2%
Final simplification79.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 l) (sqrt (/ A V))))))
(if (<= (* V l) -2e+278)
t_0
(if (<= (* V l) -4e-128)
(* c0 (sqrt (* A (* (/ 1.0 V) (/ 1.0 l)))))
(if (<= (* V l) 0.0) t_0 (* c0 (/ (sqrt A) (sqrt (* 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) <= -2e+278) {
tmp = t_0;
} else if ((V * l) <= -4e-128) {
tmp = c0 * sqrt((A * ((1.0 / V) * (1.0 / l))));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = c0 * (sqrt(A) / sqrt((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) <= (-2d+278)) then
tmp = t_0
else if ((v * l) <= (-4d-128)) then
tmp = c0 * sqrt((a * ((1.0d0 / v) * (1.0d0 / l))))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else
tmp = c0 * (sqrt(a) / sqrt((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) <= -2e+278) {
tmp = t_0;
} else if ((V * l) <= -4e-128) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) * (1.0 / l))));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((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) <= -2e+278: tmp = t_0 elif (V * l) <= -4e-128: tmp = c0 * math.sqrt((A * ((1.0 / V) * (1.0 / l)))) elif (V * l) <= 0.0: tmp = t_0 else: tmp = c0 * (math.sqrt(A) / math.sqrt((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(A / V)))) tmp = 0.0 if (Float64(V * l) <= -2e+278) tmp = t_0; elseif (Float64(V * l) <= -4e-128) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) * Float64(1.0 / l))))); elseif (Float64(V * l) <= 0.0) tmp = t_0; else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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) <= -2e+278)
tmp = t_0;
elseif ((V * l) <= -4e-128)
tmp = c0 * sqrt((A * ((1.0 / V) * (1.0 / l))));
elseif ((V * l) <= 0.0)
tmp = t_0;
else
tmp = c0 * (sqrt(A) / sqrt((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[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+278], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -4e-128], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+278}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-128}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \left(\frac{1}{V} \cdot \frac{1}{\ell}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.99999999999999993e278 or -4.00000000000000022e-128 < (*.f64 V l) < 0.0Initial program 57.2%
associate-/r*74.0%
sqrt-div48.5%
associate-*r/46.2%
Applied egg-rr46.2%
associate-/l*48.6%
Simplified48.6%
if -1.99999999999999993e278 < (*.f64 V l) < -4.00000000000000022e-128Initial program 96.5%
associate-/r*81.3%
div-inv81.2%
div-inv81.2%
associate-*l*96.6%
Applied egg-rr96.6%
if 0.0 < (*.f64 V l) Initial program 71.4%
sqrt-div91.2%
associate-*r/87.9%
Applied egg-rr87.9%
*-commutative87.9%
associate-/l*89.6%
associate-/r/91.2%
Simplified91.2%
Final simplification79.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 l) (sqrt (/ A V))))))
(if (<= (* V l) -2e+278)
t_0
(if (<= (* V l) -4e-128)
(* c0 (sqrt (* A (* (/ 1.0 V) (/ 1.0 l)))))
(if (<= (* V l) 0.0) t_0 (/ c0 (/ (sqrt (* V l)) (sqrt A))))))))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) <= -2e+278) {
tmp = t_0;
} else if ((V * l) <= -4e-128) {
tmp = c0 * sqrt((A * ((1.0 / V) * (1.0 / l))));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(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(l) / sqrt((a / v)))
if ((v * l) <= (-2d+278)) then
tmp = t_0
else if ((v * l) <= (-4d-128)) then
tmp = c0 * sqrt((a * ((1.0d0 / v) * (1.0d0 / l))))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else
tmp = c0 / (sqrt((v * l)) / sqrt(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(l) / Math.sqrt((A / V)));
double tmp;
if ((V * l) <= -2e+278) {
tmp = t_0;
} else if ((V * l) <= -4e-128) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) * (1.0 / l))));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
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) <= -2e+278: tmp = t_0 elif (V * l) <= -4e-128: tmp = c0 * math.sqrt((A * ((1.0 / V) * (1.0 / l)))) elif (V * l) <= 0.0: tmp = t_0 else: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) 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(A / V)))) tmp = 0.0 if (Float64(V * l) <= -2e+278) tmp = t_0; elseif (Float64(V * l) <= -4e-128) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) * Float64(1.0 / l))))); elseif (Float64(V * l) <= 0.0) tmp = t_0; else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(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(l) / sqrt((A / V)));
tmp = 0.0;
if ((V * l) <= -2e+278)
tmp = t_0;
elseif ((V * l) <= -4e-128)
tmp = c0 * sqrt((A * ((1.0 / V) * (1.0 / l))));
elseif ((V * l) <= 0.0)
tmp = t_0;
else
tmp = c0 / (sqrt((V * l)) / sqrt(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[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+278], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -4e-128], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+278}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-128}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \left(\frac{1}{V} \cdot \frac{1}{\ell}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.99999999999999993e278 or -4.00000000000000022e-128 < (*.f64 V l) < 0.0Initial program 57.2%
associate-/r*74.0%
sqrt-div48.5%
associate-*r/46.2%
Applied egg-rr46.2%
associate-/l*48.6%
Simplified48.6%
if -1.99999999999999993e278 < (*.f64 V l) < -4.00000000000000022e-128Initial program 96.5%
associate-/r*81.3%
div-inv81.2%
div-inv81.2%
associate-*l*96.6%
Applied egg-rr96.6%
if 0.0 < (*.f64 V l) Initial program 71.4%
sqrt-div91.2%
associate-*r/87.9%
Applied egg-rr87.9%
associate-/l*91.3%
Simplified91.3%
Final simplification80.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 (/ A V))))
(if (<= (* V l) (- INFINITY))
(/ (* c0 t_0) (sqrt l))
(if (<= (* V l) -1e-131)
(* c0 (/ (sqrt (- A)) (sqrt (* (- V) l))))
(if (<= (* V l) 0.0)
(/ c0 (/ (sqrt l) t_0))
(/ c0 (/ (sqrt (* V l)) (sqrt A))))))))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) <= -((double) INFINITY)) {
tmp = (c0 * t_0) / sqrt(l);
} else if ((V * l) <= -1e-131) {
tmp = c0 * (sqrt(-A) / sqrt((-V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) / t_0);
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
}
return tmp;
}
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) <= -Double.POSITIVE_INFINITY) {
tmp = (c0 * t_0) / Math.sqrt(l);
} else if ((V * l) <= -1e-131) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((-V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt(l) / t_0);
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
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) <= -math.inf: tmp = (c0 * t_0) / math.sqrt(l) elif (V * l) <= -1e-131: tmp = c0 * (math.sqrt(-A) / math.sqrt((-V * l))) elif (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) / t_0) else: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) 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) <= Float64(-Inf)) tmp = Float64(Float64(c0 * t_0) / sqrt(l)); elseif (Float64(V * l) <= -1e-131) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(Float64(-V) * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) / t_0)); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(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 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (c0 * t_0) / sqrt(l);
elseif ((V * l) <= -1e-131)
tmp = c0 * (sqrt(-A) / sqrt((-V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 / (sqrt(l) / t_0);
else
tmp = c0 / (sqrt((V * l)) / sqrt(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[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0 * t$95$0), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-131], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[((-V) * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $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 -\infty:\\
\;\;\;\;\frac{c0 \cdot t_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-131}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\left(-V\right) \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{t_0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 28.9%
*-commutative28.9%
associate-/r*84.5%
sqrt-div37.0%
associate-*l/37.3%
Applied egg-rr37.3%
if -inf.0 < (*.f64 V l) < -9.9999999999999999e-132Initial program 93.2%
frac-2neg93.2%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -9.9999999999999999e-132 < (*.f64 V l) < 0.0Initial program 64.2%
associate-/r*71.7%
sqrt-div52.7%
associate-*r/51.0%
Applied egg-rr51.0%
associate-/l*52.7%
Simplified52.7%
if 0.0 < (*.f64 V l) Initial program 71.4%
sqrt-div91.2%
associate-*r/87.9%
Applied egg-rr87.9%
associate-/l*91.3%
Simplified91.3%
Final simplification82.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (* c0 (sqrt (/ A (* V l)))))) (if (<= t_0 0.0) (* 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) {
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) 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) {
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: 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) 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)
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[LessEqual[t$95$0, 0.0], 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:\\
\;\;\;\;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.0Initial program 68.3%
associate-/r*69.0%
Simplified69.0%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 82.4%
Final simplification74.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 1.18e-279) (* c0 (sqrt (* A (* (/ 1.0 V) (/ 1.0 l))))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= 1.18e-279) {
tmp = c0 * sqrt((A * ((1.0 / V) * (1.0 / l))));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(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 <= 1.18d-279) then
tmp = c0 * sqrt((a * ((1.0d0 / v) * (1.0d0 / l))))
else
tmp = c0 * (sqrt((a / v)) / sqrt(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 <= 1.18e-279) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) * (1.0 / l))));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= 1.18e-279: tmp = c0 * math.sqrt((A * ((1.0 / V) * (1.0 / l)))) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= 1.18e-279) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) * Float64(1.0 / l))))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(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 <= 1.18e-279)
tmp = c0 * sqrt((A * ((1.0 / V) * (1.0 / l))));
else
tmp = c0 * (sqrt((A / V)) / sqrt(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[l, 1.18e-279], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.18 \cdot 10^{-279}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \left(\frac{1}{V} \cdot \frac{1}{\ell}\right)}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 1.1800000000000001e-279Initial program 75.9%
associate-/r*70.9%
div-inv70.9%
div-inv70.9%
associate-*l*76.1%
Applied egg-rr76.1%
if 1.1800000000000001e-279 < l Initial program 71.1%
associate-/r*74.0%
div-inv74.0%
div-inv73.9%
associate-*l*71.1%
Applied egg-rr71.1%
frac-times71.1%
metadata-eval71.1%
div-inv71.1%
clear-num70.6%
*-commutative70.6%
associate-*r/73.5%
sqrt-div73.7%
metadata-eval73.7%
sqrt-prod90.5%
associate-/l/90.7%
add-sqr-sqrt90.4%
*-un-lft-identity90.4%
times-frac90.5%
Applied egg-rr90.3%
associate-*r/90.1%
/-rgt-identity90.1%
rem-square-sqrt90.4%
Simplified90.4%
Final simplification82.5%
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 73.7%
Final simplification73.7%
herbie shell --seed 2023336
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))