
(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) (- INFINITY))
(* c0 (* (sqrt (/ A V)) (pow l -0.5)))
(if (<= (* V l) -2e-287)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(/ c0 (* (sqrt (/ V A)) (sqrt l)))
(if (<= (* V l) 1e+305)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* (sqrt A) (/ (/ c0 (sqrt l)) (sqrt V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / V)) * pow(l, -0.5));
} else if ((V * l) <= -2e-287) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (sqrt((V / A)) * sqrt(l));
} else if ((V * l) <= 1e+305) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt(A) * ((c0 / sqrt(l)) / sqrt(V));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / V)) * Math.pow(l, -0.5));
} else if ((V * l) <= -2e-287) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
} else if ((V * l) <= 1e+305) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(A) * ((c0 / Math.sqrt(l)) / Math.sqrt(V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (math.sqrt((A / V)) * math.pow(l, -0.5)) elif (V * l) <= -2e-287: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 / (math.sqrt((V / A)) * math.sqrt(l)) elif (V * l) <= 1e+305: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt(A) * ((c0 / math.sqrt(l)) / math.sqrt(V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) * (l ^ -0.5))); elseif (Float64(V * l) <= -2e-287) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l))); elseif (Float64(V * l) <= 1e+305) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(sqrt(A) * Float64(Float64(c0 / sqrt(l)) / sqrt(V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / V)) * (l ^ -0.5));
elseif ((V * l) <= -2e-287)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 / (sqrt((V / A)) * sqrt(l));
elseif ((V * l) <= 1e+305)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt(A) * ((c0 / sqrt(l)) / sqrt(V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-287], 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[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+305], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[A], $MachinePrecision] * N[(N[(c0 / N[Sqrt[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 \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot {\ell}^{-0.5}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-287}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+305}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{\frac{c0}{\sqrt{\ell}}}{\sqrt{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 43.2%
associate-/r*84.6%
div-inv84.6%
div-inv84.6%
associate-*l*45.6%
Applied egg-rr45.6%
associate-*r*84.6%
div-inv84.6%
sqrt-prod66.7%
inv-pow66.7%
sqrt-pow166.7%
metadata-eval66.7%
Applied egg-rr66.7%
if -inf.0 < (*.f64 V l) < -2.00000000000000004e-287Initial program 77.9%
frac-2neg77.9%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -2.00000000000000004e-287 < (*.f64 V l) < -0.0Initial program 39.1%
associate-/r*66.5%
div-inv66.5%
div-inv66.5%
associate-*l*38.3%
Applied egg-rr38.3%
frac-times38.3%
metadata-eval38.3%
div-inv39.1%
sqrt-undiv10.3%
clear-num10.3%
un-div-inv10.3%
sqrt-undiv39.1%
Applied egg-rr39.1%
*-commutative39.1%
associate-/l*66.5%
Simplified66.5%
*-commutative66.5%
sqrt-prod50.1%
Applied egg-rr50.1%
if -0.0 < (*.f64 V l) < 9.9999999999999994e304Initial program 87.6%
sqrt-div99.0%
associate-*r/96.9%
Applied egg-rr96.9%
associate-/l*99.0%
Simplified99.0%
if 9.9999999999999994e304 < (*.f64 V l) Initial program 15.9%
frac-2neg15.9%
sqrt-div0.0%
*-commutative0.0%
distribute-rgt-neg-in0.0%
Applied egg-rr0.0%
associate-*r/0.0%
sqrt-prod0.0%
times-frac0.0%
sqrt-div75.2%
frac-2neg75.2%
*-commutative75.2%
sqrt-div87.0%
associate-*l/86.7%
Applied egg-rr86.7%
associate-/l*87.3%
Simplified87.3%
Final simplification91.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 (or (<= t_0 5e-171) (not (<= t_0 5e+266)))
(* 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 <= 5e-171) || !(t_0 <= 5e+266)) {
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 <= 5d-171) .or. (.not. (t_0 <= 5d+266))) 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 <= 5e-171) || !(t_0 <= 5e+266)) {
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 <= 5e-171) or not (t_0 <= 5e+266): 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 <= 5e-171) || !(t_0 <= 5e+266)) 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 <= 5e-171) || ~((t_0 <= 5e+266)))
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, 5e-171], N[Not[LessEqual[t$95$0, 5e+266]], $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 5 \cdot 10^{-171} \lor \neg \left(t\_0 \leq 5 \cdot 10^{+266}\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)))) < 4.99999999999999992e-171 or 4.9999999999999999e266 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 65.1%
*-commutative65.1%
associate-/l/69.8%
Simplified69.8%
if 4.99999999999999992e-171 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999999e266Initial program 98.5%
Final simplification77.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 (<= t_0 5e-235)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 1e+285)
(/ c0 (sqrt (/ (* V l) A)))
(/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 5e-235) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 1e+285) {
tmp = c0 / sqrt(((V * l) / A));
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 5d-235) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 1d+285) then
tmp = c0 / sqrt(((v * l) / a))
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 5e-235) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 1e+285) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 5e-235: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 1e+285: tmp = c0 / math.sqrt(((V * l) / A)) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 5e-235) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 1e+285) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 5e-235)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 1e+285)
tmp = c0 / sqrt(((V * l) / A));
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-235], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+285], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-235}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 10^{+285}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999998e-235Initial program 67.3%
Taylor expanded in c0 around 0 67.3%
*-commutative67.3%
associate-/r*73.1%
Simplified73.1%
if 4.9999999999999998e-235 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999998e284Initial program 98.6%
associate-/r*85.3%
div-inv85.3%
div-inv85.2%
associate-*l*98.1%
Applied egg-rr98.1%
frac-times98.1%
metadata-eval98.1%
div-inv98.6%
sqrt-undiv44.3%
clear-num44.3%
un-div-inv44.2%
sqrt-undiv98.6%
Applied egg-rr98.6%
if 9.9999999999999998e284 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 47.3%
associate-/r*55.3%
div-inv55.3%
div-inv55.3%
associate-*l*47.3%
Applied egg-rr47.3%
frac-times47.3%
metadata-eval47.3%
div-inv47.3%
sqrt-undiv33.7%
clear-num33.7%
un-div-inv33.7%
sqrt-undiv53.3%
Applied egg-rr53.3%
associate-*r/57.3%
Simplified57.3%
Final simplification78.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 l))))))
(if (<= t_0 5e-261)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 4e+260) t_0 (/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 5e-261) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 4e+260) {
tmp = t_0;
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 5d-261) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 4d+260) then
tmp = t_0
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 5e-261) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 4e+260) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 5e-261: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 4e+260: tmp = t_0 else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 5e-261) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 4e+260) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 5e-261)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 4e+260)
tmp = t_0;
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-261], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+260], t$95$0, N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-261}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+260}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.99999999999999981e-261Initial program 67.3%
Taylor expanded in c0 around 0 67.3%
*-commutative67.3%
associate-/r*73.1%
Simplified73.1%
if 4.99999999999999981e-261 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.00000000000000026e260Initial program 98.6%
if 4.00000000000000026e260 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 51.3%
associate-/r*54.0%
div-inv54.0%
div-inv54.0%
associate-*l*51.3%
Applied egg-rr51.3%
frac-times51.3%
metadata-eval51.3%
div-inv51.3%
sqrt-undiv38.8%
clear-num38.8%
un-div-inv38.8%
sqrt-undiv56.9%
Applied egg-rr56.9%
associate-*r/60.6%
Simplified60.6%
Final simplification78.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 l))))))
(if (<= t_0 5e-261)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 5e+266) t_0 (* c0 (sqrt (/ (/ A V) l)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 5e-261) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 5e+266) {
tmp = t_0;
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 5d-261) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 5d+266) then
tmp = t_0
else
tmp = c0 * sqrt(((a / v) / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 5e-261) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 5e+266) {
tmp = t_0;
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 5e-261: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 5e+266: tmp = t_0 else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 5e-261) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 5e+266) tmp = t_0; else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 5e-261)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 5e+266)
tmp = t_0;
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-261], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+266], t$95$0, 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 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-261}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+266}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.99999999999999981e-261Initial program 67.3%
Taylor expanded in c0 around 0 67.3%
*-commutative67.3%
associate-/r*73.1%
Simplified73.1%
if 4.99999999999999981e-261 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999999e266Initial program 98.6%
if 4.9999999999999999e266 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 48.7%
*-commutative48.7%
associate-/l/56.5%
Simplified56.5%
Final simplification78.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) (- INFINITY))
(* c0 (* (sqrt (/ A V)) (pow l -0.5)))
(if (<= (* V l) -2e-287)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(/ c0 (* t_0 (sqrt l)))
(if (<= (* V l) 1e+305)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(/ (* c0 (pow l -0.5)) t_0)))))))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) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / V)) * pow(l, -0.5));
} else if ((V * l) <= -2e-287) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (t_0 * sqrt(l));
} else if ((V * l) <= 1e+305) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = (c0 * pow(l, -0.5)) / t_0;
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((V / A));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / V)) * Math.pow(l, -0.5));
} else if ((V * l) <= -2e-287) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (t_0 * Math.sqrt(l));
} else if ((V * l) <= 1e+305) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = (c0 * Math.pow(l, -0.5)) / t_0;
}
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) <= -math.inf: tmp = c0 * (math.sqrt((A / V)) * math.pow(l, -0.5)) elif (V * l) <= -2e-287: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 / (t_0 * math.sqrt(l)) elif (V * l) <= 1e+305: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = (c0 * math.pow(l, -0.5)) / t_0 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) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) * (l ^ -0.5))); elseif (Float64(V * l) <= -2e-287) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(t_0 * sqrt(l))); elseif (Float64(V * l) <= 1e+305) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(Float64(c0 * (l ^ -0.5)) / 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 = sqrt((V / A));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / V)) * (l ^ -0.5));
elseif ((V * l) <= -2e-287)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 / (t_0 * sqrt(l));
elseif ((V * l) <= 1e+305)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = (c0 * (l ^ -0.5)) / 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[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-287], 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[(t$95$0 * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+305], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision] / t$95$0), $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 -\infty:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot {\ell}^{-0.5}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-287}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{t\_0 \cdot \sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+305}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot {\ell}^{-0.5}}{t\_0}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 43.2%
associate-/r*84.6%
div-inv84.6%
div-inv84.6%
associate-*l*45.6%
Applied egg-rr45.6%
associate-*r*84.6%
div-inv84.6%
sqrt-prod66.7%
inv-pow66.7%
sqrt-pow166.7%
metadata-eval66.7%
Applied egg-rr66.7%
if -inf.0 < (*.f64 V l) < -2.00000000000000004e-287Initial program 77.9%
frac-2neg77.9%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -2.00000000000000004e-287 < (*.f64 V l) < -0.0Initial program 39.1%
associate-/r*66.5%
div-inv66.5%
div-inv66.5%
associate-*l*38.3%
Applied egg-rr38.3%
frac-times38.3%
metadata-eval38.3%
div-inv39.1%
sqrt-undiv10.3%
clear-num10.3%
un-div-inv10.3%
sqrt-undiv39.1%
Applied egg-rr39.1%
*-commutative39.1%
associate-/l*66.5%
Simplified66.5%
*-commutative66.5%
sqrt-prod50.1%
Applied egg-rr50.1%
if -0.0 < (*.f64 V l) < 9.9999999999999994e304Initial program 87.6%
sqrt-div99.0%
associate-*r/96.9%
Applied egg-rr96.9%
associate-/l*99.0%
Simplified99.0%
if 9.9999999999999994e304 < (*.f64 V l) Initial program 15.9%
associate-/r*68.5%
div-inv68.5%
div-inv68.5%
associate-*l*27.5%
Applied egg-rr27.5%
frac-times15.9%
metadata-eval15.9%
div-inv15.9%
sqrt-undiv15.9%
clear-num15.9%
un-div-inv15.9%
sqrt-undiv15.9%
Applied egg-rr15.9%
*-commutative15.9%
associate-/l*64.0%
Simplified64.0%
*-un-lft-identity64.0%
sqrt-prod75.3%
times-frac74.9%
add-sqr-sqrt74.9%
sqrt-unprod27.0%
sqr-neg27.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow1/20.0%
pow-flip0.0%
add-sqr-sqrt0.0%
sqrt-unprod27.0%
sqr-neg27.0%
sqrt-unprod75.1%
add-sqr-sqrt75.3%
metadata-eval75.3%
Applied egg-rr75.3%
associate-*r/75.5%
*-commutative75.5%
Simplified75.5%
Final simplification90.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 (* (sqrt (/ A V)) (/ c0 (sqrt l)))))
(if (<= (* V l) -5e+177)
t_0
(if (<= (* V l) -5e-121)
(/ c0 (sqrt (/ (* V l) A)))
(if (or (<= (* V l) 0.0) (not (<= (* V l) 1e+305)))
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 = sqrt((A / V)) * (c0 / sqrt(l));
double tmp;
if ((V * l) <= -5e+177) {
tmp = t_0;
} else if ((V * l) <= -5e-121) {
tmp = c0 / sqrt(((V * l) / A));
} else if (((V * l) <= 0.0) || !((V * l) <= 1e+305)) {
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 = sqrt((a / v)) * (c0 / sqrt(l))
if ((v * l) <= (-5d+177)) then
tmp = t_0
else if ((v * l) <= (-5d-121)) then
tmp = c0 / sqrt(((v * l) / a))
else if (((v * l) <= 0.0d0) .or. (.not. ((v * l) <= 1d+305))) 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 = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
double tmp;
if ((V * l) <= -5e+177) {
tmp = t_0;
} else if ((V * l) <= -5e-121) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if (((V * l) <= 0.0) || !((V * l) <= 1e+305)) {
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 = math.sqrt((A / V)) * (c0 / math.sqrt(l)) tmp = 0 if (V * l) <= -5e+177: tmp = t_0 elif (V * l) <= -5e-121: tmp = c0 / math.sqrt(((V * l) / A)) elif ((V * l) <= 0.0) or not ((V * l) <= 1e+305): 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(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -5e+177) tmp = t_0; elseif (Float64(V * l) <= -5e-121) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 1e+305)) 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 = sqrt((A / V)) * (c0 / sqrt(l));
tmp = 0.0;
if ((V * l) <= -5e+177)
tmp = t_0;
elseif ((V * l) <= -5e-121)
tmp = c0 / sqrt(((V * l) / A));
elseif (((V * l) <= 0.0) || ~(((V * l) <= 1e+305)))
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[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+177], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-121], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 1e+305]], $MachinePrecision]], 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 := \sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+177}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-121}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 10^{+305}\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.0000000000000003e177 or -4.99999999999999989e-121 < (*.f64 V l) < -0.0 or 9.9999999999999994e304 < (*.f64 V l) Initial program 47.6%
associate-/r*66.0%
sqrt-div52.7%
associate-*r/52.4%
Applied egg-rr52.4%
*-commutative52.4%
associate-/l*50.1%
Simplified50.1%
if -5.0000000000000003e177 < (*.f64 V l) < -4.99999999999999989e-121Initial program 89.8%
associate-/r*78.2%
div-inv78.1%
div-inv78.2%
associate-*l*89.8%
Applied egg-rr89.8%
frac-times89.6%
metadata-eval89.6%
div-inv89.8%
sqrt-undiv0.0%
clear-num0.0%
un-div-inv0.0%
sqrt-undiv91.2%
Applied egg-rr91.2%
if -0.0 < (*.f64 V l) < 9.9999999999999994e304Initial program 87.6%
sqrt-div99.0%
associate-*r/96.9%
Applied egg-rr96.9%
associate-/l*99.0%
Simplified99.0%
Final simplification79.5%
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) -2e-253)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 4e-319)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= (* V l) 1e+305)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* 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 * l) <= -2e-253) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 4e-319) {
tmp = c0 * sqrt(((A / V) / l));
} else if ((V * l) <= 1e+305) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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 * l) <= (-2d-253)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 4d-319) then
tmp = c0 * sqrt(((a / v) / l))
else if ((v * l) <= 1d+305) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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 * l) <= -2e-253) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 4e-319) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if ((V * l) <= 1e+305) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} 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 * l) <= -2e-253: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 4e-319: tmp = c0 * math.sqrt(((A / V) / l)) elif (V * l) <= 1e+305: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) 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 (Float64(V * l) <= -2e-253) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 4e-319) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (Float64(V * l) <= 1e+305) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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 * l) <= -2e-253)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 4e-319)
tmp = c0 * sqrt(((A / V) / l));
elseif ((V * l) <= 1e+305)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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[N[(V * l), $MachinePrecision], -2e-253], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-319], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+305], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $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 \cdot \ell \leq -2 \cdot 10^{-253}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-319}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+305}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{\ell}}}{\sqrt{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.0000000000000001e-253Initial program 74.1%
associate-/r*71.0%
div-inv71.0%
div-inv71.1%
associate-*l*74.3%
Applied egg-rr74.3%
frac-times74.0%
metadata-eval74.0%
div-inv74.1%
sqrt-undiv0.0%
clear-num0.0%
un-div-inv0.0%
sqrt-undiv75.7%
Applied egg-rr75.7%
if -2.0000000000000001e-253 < (*.f64 V l) < 4.0000049e-319Initial program 45.6%
*-commutative45.6%
associate-/l/70.8%
Simplified70.8%
if 4.0000049e-319 < (*.f64 V l) < 9.9999999999999994e304Initial program 87.9%
sqrt-div99.5%
associate-*r/97.7%
Applied egg-rr97.7%
associate-/l*99.5%
Simplified99.5%
if 9.9999999999999994e304 < (*.f64 V l) Initial program 15.9%
associate-/r*68.5%
div-inv68.5%
div-inv68.5%
associate-*l*27.5%
Applied egg-rr27.5%
*-commutative27.5%
associate-*r*68.5%
div-inv68.5%
div-inv68.5%
sqrt-div75.5%
associate-*r/75.1%
Applied egg-rr75.1%
associate-/l*75.5%
Simplified75.5%
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) -2e-253)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 4e-319)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= (* V l) 1e+298)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A l) V)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e-253) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 4e-319) {
tmp = c0 * sqrt(((A / V) / l));
} else if ((V * l) <= 1e+298) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-2d-253)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 4d-319) then
tmp = c0 * sqrt(((a / v) / l))
else if ((v * l) <= 1d+298) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / l) / v))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e-253) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 4e-319) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if ((V * l) <= 1e+298) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -2e-253: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 4e-319: tmp = c0 * math.sqrt(((A / V) / l)) elif (V * l) <= 1e+298: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e-253) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 4e-319) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (Float64(V * l) <= 1e+298) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -2e-253)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 4e-319)
tmp = c0 * sqrt(((A / V) / l));
elseif ((V * l) <= 1e+298)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e-253], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-319], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+298], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{-253}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-319}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+298}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.0000000000000001e-253Initial program 74.1%
associate-/r*71.0%
div-inv71.0%
div-inv71.1%
associate-*l*74.3%
Applied egg-rr74.3%
frac-times74.0%
metadata-eval74.0%
div-inv74.1%
sqrt-undiv0.0%
clear-num0.0%
un-div-inv0.0%
sqrt-undiv75.7%
Applied egg-rr75.7%
if -2.0000000000000001e-253 < (*.f64 V l) < 4.0000049e-319Initial program 45.6%
*-commutative45.6%
associate-/l/70.8%
Simplified70.8%
if 4.0000049e-319 < (*.f64 V l) < 9.9999999999999996e297Initial program 87.8%
sqrt-div99.5%
associate-*r/97.7%
Applied egg-rr97.7%
associate-/l*99.5%
Simplified99.5%
if 9.9999999999999996e297 < (*.f64 V l) Initial program 25.2%
Taylor expanded in c0 around 0 25.2%
*-commutative25.2%
associate-/r*72.0%
Simplified72.0%
Final simplification84.4%
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) 0.0)
(/ c0 (* t_0 (sqrt l)))
(if (<= (* V l) 1e+305)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(/ (* c0 (pow l -0.5)) t_0)))))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) <= 0.0) {
tmp = c0 / (t_0 * sqrt(l));
} else if ((V * l) <= 1e+305) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = (c0 * pow(l, -0.5)) / 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 = sqrt((v / a))
if ((v * l) <= 0.0d0) then
tmp = c0 / (t_0 * sqrt(l))
else if ((v * l) <= 1d+305) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = (c0 * (l ** (-0.5d0))) / 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 = Math.sqrt((V / A));
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 / (t_0 * Math.sqrt(l));
} else if ((V * l) <= 1e+305) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = (c0 * Math.pow(l, -0.5)) / t_0;
}
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) <= 0.0: tmp = c0 / (t_0 * math.sqrt(l)) elif (V * l) <= 1e+305: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = (c0 * math.pow(l, -0.5)) / t_0 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) <= 0.0) tmp = Float64(c0 / Float64(t_0 * sqrt(l))); elseif (Float64(V * l) <= 1e+305) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(Float64(c0 * (l ^ -0.5)) / 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 = sqrt((V / A));
tmp = 0.0;
if ((V * l) <= 0.0)
tmp = c0 / (t_0 * sqrt(l));
elseif ((V * l) <= 1e+305)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = (c0 * (l ^ -0.5)) / 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[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(t$95$0 * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+305], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision] / t$95$0), $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 0:\\
\;\;\;\;\frac{c0}{t\_0 \cdot \sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+305}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot {\ell}^{-0.5}}{t\_0}\\
\end{array}
\end{array}
if (*.f64 V l) < -0.0Initial program 66.5%
associate-/r*70.8%
div-inv70.8%
div-inv70.8%
associate-*l*66.4%
Applied egg-rr66.4%
frac-times66.2%
metadata-eval66.2%
div-inv66.5%
sqrt-undiv2.5%
clear-num2.5%
un-div-inv2.5%
sqrt-undiv67.7%
Applied egg-rr67.7%
*-commutative67.7%
associate-/l*71.7%
Simplified71.7%
*-commutative71.7%
sqrt-prod49.0%
Applied egg-rr49.0%
if -0.0 < (*.f64 V l) < 9.9999999999999994e304Initial program 87.6%
sqrt-div99.0%
associate-*r/96.9%
Applied egg-rr96.9%
associate-/l*99.0%
Simplified99.0%
if 9.9999999999999994e304 < (*.f64 V l) Initial program 15.9%
associate-/r*68.5%
div-inv68.5%
div-inv68.5%
associate-*l*27.5%
Applied egg-rr27.5%
frac-times15.9%
metadata-eval15.9%
div-inv15.9%
sqrt-undiv15.9%
clear-num15.9%
un-div-inv15.9%
sqrt-undiv15.9%
Applied egg-rr15.9%
*-commutative15.9%
associate-/l*64.0%
Simplified64.0%
*-un-lft-identity64.0%
sqrt-prod75.3%
times-frac74.9%
add-sqr-sqrt74.9%
sqrt-unprod27.0%
sqr-neg27.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow1/20.0%
pow-flip0.0%
add-sqr-sqrt0.0%
sqrt-unprod27.0%
sqr-neg27.0%
sqrt-unprod75.1%
add-sqr-sqrt75.3%
metadata-eval75.3%
Applied egg-rr75.3%
associate-*r/75.5%
*-commutative75.5%
Simplified75.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) 0.0)
(/ c0 (* (sqrt (/ V A)) (sqrt l)))
(if (<= (* V l) 1e+305)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(/ c0 (* (sqrt V) (sqrt (/ l A)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 / (sqrt((V / A)) * sqrt(l));
} else if ((V * l) <= 1e+305) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 / (sqrt(V) * sqrt((l / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt((v / a)) * sqrt(l))
else if ((v * l) <= 1d+305) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 / (sqrt(v) * sqrt((l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
} else if ((V * l) <= 1e+305) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 / (Math.sqrt(V) * Math.sqrt((l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 0.0: tmp = c0 / (math.sqrt((V / A)) * math.sqrt(l)) elif (V * l) <= 1e+305: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 / (math.sqrt(V) * math.sqrt((l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l))); elseif (Float64(V * l) <= 1e+305) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 / Float64(sqrt(V) * sqrt(Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= 0.0)
tmp = c0 / (sqrt((V / A)) * sqrt(l));
elseif ((V * l) <= 1e+305)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 / (sqrt(V) * sqrt((l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+305], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[V], $MachinePrecision] * N[Sqrt[N[(l / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+305}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V} \cdot \sqrt{\frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -0.0Initial program 66.5%
associate-/r*70.8%
div-inv70.8%
div-inv70.8%
associate-*l*66.4%
Applied egg-rr66.4%
frac-times66.2%
metadata-eval66.2%
div-inv66.5%
sqrt-undiv2.5%
clear-num2.5%
un-div-inv2.5%
sqrt-undiv67.7%
Applied egg-rr67.7%
*-commutative67.7%
associate-/l*71.7%
Simplified71.7%
*-commutative71.7%
sqrt-prod49.0%
Applied egg-rr49.0%
if -0.0 < (*.f64 V l) < 9.9999999999999994e304Initial program 87.6%
sqrt-div99.0%
associate-*r/96.9%
Applied egg-rr96.9%
associate-/l*99.0%
Simplified99.0%
if 9.9999999999999994e304 < (*.f64 V l) Initial program 15.9%
associate-/r*68.5%
div-inv68.5%
div-inv68.5%
associate-*l*27.5%
Applied egg-rr27.5%
frac-times15.9%
metadata-eval15.9%
div-inv15.9%
sqrt-undiv15.9%
clear-num15.9%
un-div-inv15.9%
sqrt-undiv15.9%
Applied egg-rr15.9%
associate-*r/63.8%
*-commutative63.8%
sqrt-prod75.3%
Applied egg-rr75.3%
Final simplification70.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) 0.0)
(/ c0 (* (sqrt (/ V A)) (sqrt l)))
(if (<= (* V l) 1e+305)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* (sqrt (/ A V)) (/ c0 (sqrt l))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 / (sqrt((V / A)) * sqrt(l));
} else if ((V * l) <= 1e+305) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt((A / V)) * (c0 / 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 ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt((v / a)) * sqrt(l))
else if ((v * l) <= 1d+305) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = sqrt((a / v)) * (c0 / 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 ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt((V / A)) * Math.sqrt(l));
} else if ((V * l) <= 1e+305) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 0.0: tmp = c0 / (math.sqrt((V / A)) * math.sqrt(l)) elif (V * l) <= 1e+305: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt((A / V)) * (c0 / math.sqrt(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) <= 0.0) tmp = Float64(c0 / Float64(sqrt(Float64(V / A)) * sqrt(l))); elseif (Float64(V * l) <= 1e+305) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 / 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 ((V * l) <= 0.0)
tmp = c0 / (sqrt((V / A)) * sqrt(l));
elseif ((V * l) <= 1e+305)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt((A / V)) * (c0 / 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[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+305], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[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 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{A}} \cdot \sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+305}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -0.0Initial program 66.5%
associate-/r*70.8%
div-inv70.8%
div-inv70.8%
associate-*l*66.4%
Applied egg-rr66.4%
frac-times66.2%
metadata-eval66.2%
div-inv66.5%
sqrt-undiv2.5%
clear-num2.5%
un-div-inv2.5%
sqrt-undiv67.7%
Applied egg-rr67.7%
*-commutative67.7%
associate-/l*71.7%
Simplified71.7%
*-commutative71.7%
sqrt-prod49.0%
Applied egg-rr49.0%
if -0.0 < (*.f64 V l) < 9.9999999999999994e304Initial program 87.6%
sqrt-div99.0%
associate-*r/96.9%
Applied egg-rr96.9%
associate-/l*99.0%
Simplified99.0%
if 9.9999999999999994e304 < (*.f64 V l) Initial program 15.9%
associate-/r*68.5%
sqrt-div75.3%
associate-*r/74.7%
Applied egg-rr74.7%
*-commutative74.7%
associate-/l*75.2%
Simplified75.2%
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.5%
herbie shell --seed 2024156
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))