
(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 10 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 -5e-310)
(* c0 (* (/ (sqrt (- A)) (sqrt (- V))) (/ 1.0 (sqrt l))))
(if (<= A 4.5e-146)
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))
(if (<= A 3.1e+187)
(* c0 (* (sqrt (/ (/ A V) (cbrt l))) (sqrt (pow (cbrt l) -2.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 tmp;
if (A <= -5e-310) {
tmp = c0 * ((sqrt(-A) / sqrt(-V)) * (1.0 / sqrt(l)));
} else if (A <= 4.5e-146) {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
} else if (A <= 3.1e+187) {
tmp = c0 * (sqrt(((A / V) / cbrt(l))) * sqrt(pow(cbrt(l), -2.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 tmp;
if (A <= -5e-310) {
tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) * (1.0 / Math.sqrt(l)));
} else if (A <= 4.5e-146) {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
} else if (A <= 3.1e+187) {
tmp = c0 * (Math.sqrt(((A / V) / Math.cbrt(l))) * Math.sqrt(Math.pow(Math.cbrt(l), -2.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) tmp = 0.0 if (A <= -5e-310) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * Float64(1.0 / sqrt(l)))); elseif (A <= 4.5e-146) tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); elseif (A <= 3.1e+187) tmp = Float64(c0 * Float64(sqrt(Float64(Float64(A / V) / cbrt(l))) * sqrt((cbrt(l) ^ -2.0)))); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); end return 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, -5e-310], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 4.5e-146], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[A, 3.1e+187], N[(c0 * N[(N[Sqrt[N[(N[(A / V), $MachinePrecision] / N[Power[l, 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Power[N[Power[l, 1/3], $MachinePrecision], -2.0], $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 -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \left(\frac{\sqrt{-A}}{\sqrt{-V}} \cdot \frac{1}{\sqrt{\ell}}\right)\\
\mathbf{elif}\;A \leq 4.5 \cdot 10^{-146}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\mathbf{elif}\;A \leq 3.1 \cdot 10^{+187}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{\frac{A}{V}}{\sqrt[3]{\ell}}} \cdot \sqrt{{\left(\sqrt[3]{\ell}\right)}^{-2}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 69.5%
associate-/r*70.9%
sqrt-div43.9%
div-inv43.8%
Applied egg-rr43.8%
frac-2neg43.8%
sqrt-div50.9%
Applied egg-rr50.9%
if -4.999999999999985e-310 < A < 4.5000000000000001e-146Initial program 66.4%
pow1/266.4%
div-inv66.4%
unpow-prod-down83.0%
pow1/283.0%
associate-/r*84.3%
Applied egg-rr84.3%
unpow1/284.4%
Simplified84.4%
if 4.5000000000000001e-146 < A < 3.10000000000000012e187Initial program 80.2%
associate-/r*83.1%
div-inv83.1%
add-cube-cbrt82.7%
times-frac88.5%
pow288.5%
Applied egg-rr88.5%
associate-*l/86.7%
associate-/l/85.1%
associate-*r/85.2%
*-rgt-identity85.2%
*-commutative85.2%
Simplified85.2%
pow1/285.2%
div-inv85.2%
unpow-prod-down90.5%
pow1/290.5%
associate-/r*89.6%
pow-flip89.6%
metadata-eval89.6%
Applied egg-rr89.6%
unpow1/289.6%
Simplified89.6%
if 3.10000000000000012e187 < A Initial program 73.9%
associate-/r*70.7%
div-inv70.8%
add-cube-cbrt70.6%
times-frac73.6%
pow273.6%
Applied egg-rr73.6%
associate-*l/76.4%
associate-/l/76.4%
associate-*r/76.5%
*-rgt-identity76.5%
*-commutative76.5%
Simplified76.5%
associate-/r*70.6%
associate-/l/70.5%
unpow270.5%
add-cube-cbrt70.7%
sqrt-undiv46.0%
clear-num46.0%
un-div-inv46.2%
sqrt-undiv73.4%
div-inv73.4%
clear-num74.5%
Applied egg-rr74.5%
*-commutative74.5%
associate-*l/76.6%
associate-*r/71.0%
Simplified71.0%
associate-*r/76.6%
sqrt-div90.8%
Applied egg-rr90.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -1e-159)
(* c0 (/ (/ (sqrt (- A)) (sqrt (- V))) (sqrt l)))
(if (<= (* V l) 1e-315)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) 1e+298)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* 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) <= -1e-159) {
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
} else if ((V * l) <= 1e-315) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((V * l) <= 1e+298) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} 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) <= (-1d-159)) then
tmp = c0 * ((sqrt(-a) / sqrt(-v)) / sqrt(l))
else if ((v * l) <= 1d-315) then
tmp = (c0 / sqrt(l)) * sqrt((a / v))
else if ((v * l) <= 1d+298) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
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) <= -1e-159) {
tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) / Math.sqrt(l));
} else if ((V * l) <= 1e-315) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((V * l) <= 1e+298) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} 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) <= -1e-159: tmp = c0 * ((math.sqrt(-A) / math.sqrt(-V)) / math.sqrt(l)) elif (V * l) <= 1e-315: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) elif (V * l) <= 1e+298: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) 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) <= -1e-159) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / sqrt(l))); elseif (Float64(V * l) <= 1e-315) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= 1e+298) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); 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) <= -1e-159)
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
elseif ((V * l) <= 1e-315)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
elseif ((V * l) <= 1e+298)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
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], -1e-159], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-315], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+298], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $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 -1 \cdot 10^{-159}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-315}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+298}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999989e-160Initial program 78.5%
associate-/r*74.7%
sqrt-div45.2%
div-inv45.1%
Applied egg-rr45.1%
associate-*r/45.2%
*-rgt-identity45.2%
Simplified45.2%
frac-2neg45.1%
sqrt-div54.5%
Applied egg-rr54.6%
if -9.99999999999999989e-160 < (*.f64 V l) < 9.999999985e-316Initial program 52.3%
associate-/r*66.3%
div-inv66.1%
add-cube-cbrt65.7%
times-frac63.9%
pow263.9%
Applied egg-rr63.9%
associate-*l/63.9%
associate-/l/64.0%
associate-*r/64.0%
*-rgt-identity64.0%
*-commutative64.0%
Simplified64.0%
associate-/r*65.9%
associate-/l/65.7%
unpow265.7%
add-cube-cbrt66.3%
sqrt-undiv47.3%
clear-num47.3%
un-div-inv47.3%
sqrt-undiv66.1%
div-inv66.1%
clear-num66.1%
Applied egg-rr66.1%
*-commutative66.1%
associate-*l/52.2%
associate-*r/66.1%
Simplified66.1%
clear-num66.1%
associate-*r/52.2%
*-commutative52.2%
associate-*r/66.1%
sqrt-prod47.2%
associate-/l*47.2%
clear-num47.2%
sqrt-div47.1%
metadata-eval47.1%
associate-/r*47.2%
*-commutative47.2%
div-inv47.2%
associate-/r*47.3%
associate-/r/47.3%
clear-num47.3%
Applied egg-rr47.3%
if 9.999999985e-316 < (*.f64 V l) < 9.9999999999999996e297Initial program 85.3%
associate-/r*73.0%
div-inv73.0%
add-cube-cbrt72.6%
times-frac81.1%
pow281.1%
Applied egg-rr81.1%
associate-*l/79.1%
associate-/l/79.1%
associate-*r/79.1%
*-rgt-identity79.1%
*-commutative79.1%
Simplified79.1%
associate-/r*72.6%
associate-/l/72.6%
unpow272.6%
add-cube-cbrt73.0%
sqrt-undiv38.1%
clear-num38.1%
un-div-inv38.1%
sqrt-undiv74.2%
div-inv73.2%
clear-num74.2%
Applied egg-rr74.2%
*-commutative74.2%
associate-*l/85.7%
associate-*r/79.1%
Simplified79.1%
associate-*r/85.7%
sqrt-div99.4%
Applied egg-rr99.4%
if 9.9999999999999996e297 < (*.f64 V l) Initial program 33.3%
*-un-lft-identity33.3%
times-frac61.6%
Applied egg-rr61.6%
associate-*l/61.6%
*-un-lft-identity61.6%
Applied egg-rr61.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* (/ c0 (sqrt l)) (sqrt (/ A V)))))
(if (<= (* V l) (- INFINITY))
t_0
(if (<= (* V l) -1e-159)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 1e-315)
t_0
(if (<= (* V l) 1e+298)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (sqrt (/ (/ A l) V)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = (c0 / sqrt(l)) * sqrt((A / V));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((V * l) <= -1e-159) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 1e-315) {
tmp = t_0;
} else if ((V * l) <= 1e+298) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if ((V * l) <= -1e-159) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 1e-315) {
tmp = t_0;
} else if ((V * l) <= 1e+298) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = (c0 / math.sqrt(l)) * math.sqrt((A / V)) tmp = 0 if (V * l) <= -math.inf: tmp = t_0 elif (V * l) <= -1e-159: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 1e-315: tmp = t_0 elif (V * l) <= 1e+298: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = t_0; elseif (Float64(V * l) <= -1e-159) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 1e-315) tmp = t_0; elseif (Float64(V * l) <= 1e+298) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = (c0 / sqrt(l)) * sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = t_0;
elseif ((V * l) <= -1e-159)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 1e-315)
tmp = t_0;
elseif ((V * l) <= 1e+298)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 * sqrt(((A / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-159], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-315], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 1e+298], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $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}
t_0 := \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-159}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-315}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+298}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or -9.99999999999999989e-160 < (*.f64 V l) < 9.999999985e-316Initial program 47.5%
associate-/r*65.1%
div-inv65.0%
add-cube-cbrt64.5%
times-frac61.3%
pow261.3%
Applied egg-rr61.3%
associate-*l/61.3%
associate-/l/60.6%
associate-*r/60.6%
*-rgt-identity60.6%
*-commutative60.6%
Simplified60.6%
associate-/r*64.7%
associate-/l/64.5%
unpow264.5%
add-cube-cbrt65.1%
sqrt-undiv47.9%
clear-num47.9%
un-div-inv47.9%
sqrt-undiv65.0%
div-inv65.0%
clear-num65.0%
Applied egg-rr65.0%
*-commutative65.0%
associate-*l/47.4%
associate-*r/65.0%
Simplified65.0%
clear-num64.9%
associate-*r/47.4%
*-commutative47.4%
associate-*r/64.9%
sqrt-prod47.8%
associate-/l*47.8%
clear-num47.8%
sqrt-div47.8%
metadata-eval47.8%
associate-/r*47.8%
*-commutative47.8%
div-inv47.8%
associate-/r*47.9%
associate-/r/47.9%
clear-num47.9%
Applied egg-rr47.9%
if -inf.0 < (*.f64 V l) < -9.99999999999999989e-160Initial program 89.8%
frac-2neg89.8%
sqrt-div99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
distribute-rgt-neg-out99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Simplified99.5%
if 9.999999985e-316 < (*.f64 V l) < 9.9999999999999996e297Initial program 85.3%
associate-/r*73.0%
div-inv73.0%
add-cube-cbrt72.6%
times-frac81.1%
pow281.1%
Applied egg-rr81.1%
associate-*l/79.1%
associate-/l/79.1%
associate-*r/79.1%
*-rgt-identity79.1%
*-commutative79.1%
Simplified79.1%
associate-/r*72.6%
associate-/l/72.6%
unpow272.6%
add-cube-cbrt73.0%
sqrt-undiv38.1%
clear-num38.1%
un-div-inv38.1%
sqrt-undiv74.2%
div-inv73.2%
clear-num74.2%
Applied egg-rr74.2%
*-commutative74.2%
associate-*l/85.7%
associate-*r/79.1%
Simplified79.1%
associate-*r/85.7%
sqrt-div99.4%
Applied egg-rr99.4%
if 9.9999999999999996e297 < (*.f64 V l) Initial program 33.3%
*-un-lft-identity33.3%
times-frac61.6%
Applied egg-rr61.6%
associate-*l/61.6%
*-un-lft-identity61.6%
Applied egg-rr61.6%
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 (sqrt (/ A V))))
(if (<= (* V l) -5e+193)
(* c0 (/ t_0 (sqrt l)))
(if (<= (* V l) -5e-154)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 1e-315)
(* (/ c0 (sqrt l)) t_0)
(if (<= (* V l) 1e+298)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* c0 (sqrt (/ (/ A l) V)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -5e+193) {
tmp = c0 * (t_0 / sqrt(l));
} else if ((V * l) <= -5e-154) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 1e-315) {
tmp = (c0 / sqrt(l)) * t_0;
} else if ((V * l) <= 1e+298) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-5d+193)) then
tmp = c0 * (t_0 / sqrt(l))
else if ((v * l) <= (-5d-154)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 1d-315) then
tmp = (c0 / sqrt(l)) * t_0
else if ((v * l) <= 1d+298) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = c0 * sqrt(((a / l) / v))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -5e+193) {
tmp = c0 * (t_0 / Math.sqrt(l));
} else if ((V * l) <= -5e-154) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 1e-315) {
tmp = (c0 / Math.sqrt(l)) * t_0;
} else if ((V * l) <= 1e+298) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -5e+193: tmp = c0 * (t_0 / math.sqrt(l)) elif (V * l) <= -5e-154: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 1e-315: tmp = (c0 / math.sqrt(l)) * t_0 elif (V * l) <= 1e+298: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -5e+193) tmp = Float64(c0 * Float64(t_0 / sqrt(l))); elseif (Float64(V * l) <= -5e-154) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 1e-315) tmp = Float64(Float64(c0 / sqrt(l)) * t_0); elseif (Float64(V * l) <= 1e+298) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -5e+193)
tmp = c0 * (t_0 / sqrt(l));
elseif ((V * l) <= -5e-154)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 1e-315)
tmp = (c0 / sqrt(l)) * t_0;
elseif ((V * l) <= 1e+298)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = c0 * sqrt(((A / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+193], N[(c0 * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-154], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-315], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+298], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $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}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+193}:\\
\;\;\;\;c0 \cdot \frac{t\_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-154}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-315}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+298}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.99999999999999972e193Initial program 42.9%
associate-/r*59.1%
sqrt-div41.6%
div-inv41.4%
Applied egg-rr41.4%
associate-*r/41.6%
*-rgt-identity41.6%
Simplified41.6%
if -4.99999999999999972e193 < (*.f64 V l) < -5.0000000000000002e-154Initial program 97.9%
associate-/r*82.9%
div-inv82.9%
add-cube-cbrt82.3%
times-frac91.5%
pow291.5%
Applied egg-rr91.5%
associate-*l/91.7%
associate-/l/91.7%
associate-*r/91.7%
*-rgt-identity91.7%
*-commutative91.7%
Simplified91.7%
associate-/r*82.2%
associate-/l/82.3%
unpow282.3%
add-cube-cbrt82.9%
sqrt-undiv46.2%
clear-num46.2%
un-div-inv46.1%
sqrt-undiv83.0%
div-inv81.6%
clear-num81.5%
Applied egg-rr81.5%
*-commutative81.5%
associate-*l/98.0%
associate-*r/87.6%
Simplified87.6%
Taylor expanded in V around 0 98.0%
if -5.0000000000000002e-154 < (*.f64 V l) < 9.999999985e-316Initial program 53.3%
associate-/r*66.9%
div-inv66.8%
add-cube-cbrt66.3%
times-frac64.6%
pow264.6%
Applied egg-rr64.6%
associate-*l/64.6%
associate-/l/64.6%
associate-*r/64.6%
*-rgt-identity64.6%
*-commutative64.6%
Simplified64.6%
associate-/r*66.5%
associate-/l/66.3%
unpow266.3%
add-cube-cbrt66.9%
sqrt-undiv48.3%
clear-num48.2%
un-div-inv48.3%
sqrt-undiv66.8%
div-inv66.7%
clear-num66.8%
Applied egg-rr66.8%
*-commutative66.8%
associate-*l/53.1%
associate-*r/66.8%
Simplified66.8%
clear-num66.7%
associate-*r/53.2%
*-commutative53.2%
associate-*r/66.7%
sqrt-prod48.2%
associate-/l*48.2%
clear-num48.2%
sqrt-div48.1%
metadata-eval48.1%
associate-/r*48.2%
*-commutative48.2%
div-inv48.2%
associate-/r*48.3%
associate-/r/48.2%
clear-num48.2%
Applied egg-rr48.2%
if 9.999999985e-316 < (*.f64 V l) < 9.9999999999999996e297Initial program 85.3%
associate-/r*73.0%
div-inv73.0%
add-cube-cbrt72.6%
times-frac81.1%
pow281.1%
Applied egg-rr81.1%
associate-*l/79.1%
associate-/l/79.1%
associate-*r/79.1%
*-rgt-identity79.1%
*-commutative79.1%
Simplified79.1%
associate-/r*72.6%
associate-/l/72.6%
unpow272.6%
add-cube-cbrt73.0%
sqrt-undiv38.1%
clear-num38.1%
un-div-inv38.1%
sqrt-undiv74.2%
div-inv73.2%
clear-num74.2%
Applied egg-rr74.2%
*-commutative74.2%
associate-*l/85.7%
associate-*r/79.1%
Simplified79.1%
associate-*r/85.7%
sqrt-div99.4%
Applied egg-rr99.4%
if 9.9999999999999996e297 < (*.f64 V l) Initial program 33.3%
*-un-lft-identity33.3%
times-frac61.6%
Applied egg-rr61.6%
associate-*l/61.6%
*-un-lft-identity61.6%
Applied egg-rr61.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 4e-309)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 1e+253)
(/ c0 (sqrt (/ (* V l) A)))
(* c0 (/ (sqrt (/ A V)) (sqrt l)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 4e-309) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 1e+253) {
tmp = c0 / sqrt(((V * l) / A));
} 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) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 4d-309) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 1d+253) then
tmp = c0 / sqrt(((v * l) / a))
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 t_0 = A / (V * l);
double tmp;
if (t_0 <= 4e-309) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 1e+253) {
tmp = c0 / Math.sqrt(((V * l) / A));
} 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): t_0 = A / (V * l) tmp = 0 if t_0 <= 4e-309: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 1e+253: tmp = c0 / math.sqrt(((V * l) / A)) 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) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 4e-309) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 1e+253) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); 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)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 4e-309)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 1e+253)
tmp = c0 / sqrt(((V * l) / A));
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_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-309], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+253], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $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}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 10^{+253}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 3.9999999999999977e-309Initial program 32.6%
*-un-lft-identity32.6%
times-frac51.2%
Applied egg-rr51.2%
associate-*l/51.2%
*-un-lft-identity51.2%
Applied egg-rr51.2%
if 3.9999999999999977e-309 < (/.f64 A (*.f64 V l)) < 9.9999999999999994e252Initial program 99.6%
associate-/r*86.6%
div-inv86.6%
add-cube-cbrt86.0%
times-frac94.1%
pow294.1%
Applied egg-rr94.1%
associate-*l/94.1%
associate-/l/94.1%
associate-*r/94.1%
*-rgt-identity94.1%
*-commutative94.1%
Simplified94.1%
associate-/r*85.9%
associate-/l/86.0%
unpow286.0%
add-cube-cbrt86.6%
sqrt-undiv42.7%
clear-num42.7%
un-div-inv42.7%
sqrt-undiv86.6%
div-inv85.4%
clear-num86.1%
Applied egg-rr86.1%
*-commutative86.1%
associate-*l/99.7%
associate-*r/91.7%
Simplified91.7%
Taylor expanded in V around 0 99.7%
if 9.9999999999999994e252 < (/.f64 A (*.f64 V l)) Initial program 44.7%
associate-/r*55.6%
sqrt-div52.2%
div-inv52.2%
Applied egg-rr52.2%
associate-*r/52.2%
*-rgt-identity52.2%
Simplified52.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 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 6e+260)))
(* c0 (sqrt (/ (/ A l) V)))
(* c0 (sqrt t_0)))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 6e+260)) {
tmp = c0 * sqrt(((A / l) / V));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 6d+260))) then
tmp = c0 * sqrt(((a / l) / v))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 6e+260)) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 6e+260): tmp = c0 * math.sqrt(((A / l) / V)) else: tmp = c0 * math.sqrt(t_0) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 6e+260)) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 6e+260)))
tmp = c0 * sqrt(((A / l) / V));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 6e+260]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 6 \cdot 10^{+260}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 5.9999999999999996e260 < (/.f64 A (*.f64 V l)) Initial program 36.3%
*-un-lft-identity36.3%
times-frac52.5%
Applied egg-rr52.5%
associate-*l/52.5%
*-un-lft-identity52.5%
Applied egg-rr52.5%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.9999999999999996e260Initial program 99.6%
Final simplification79.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 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 1e+253)))
(* c0 (sqrt (/ (/ A V) l)))
(* c0 (sqrt t_0)))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 1e+253)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 1d+253))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 1e+253)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 1e+253): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.sqrt(t_0) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 1e+253)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 1e+253)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 1e+253]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 10^{+253}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 9.9999999999999994e252 < (/.f64 A (*.f64 V l)) Initial program 37.9%
associate-/r*53.0%
Simplified53.0%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999994e252Initial program 99.6%
Final simplification78.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 4e-309)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 6e+260)
(/ 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 = A / (V * l);
double tmp;
if (t_0 <= 4e-309) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 6e+260) {
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 = a / (v * l)
if (t_0 <= 4d-309) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 6d+260) 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 = A / (V * l);
double tmp;
if (t_0 <= 4e-309) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 6e+260) {
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 = A / (V * l) tmp = 0 if t_0 <= 4e-309: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 6e+260: 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(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 4e-309) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 6e+260) 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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 4e-309)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 6e+260)
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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-309], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 6e+260], 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 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 6 \cdot 10^{+260}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 3.9999999999999977e-309Initial program 32.6%
*-un-lft-identity32.6%
times-frac51.2%
Applied egg-rr51.2%
associate-*l/51.2%
*-un-lft-identity51.2%
Applied egg-rr51.2%
if 3.9999999999999977e-309 < (/.f64 A (*.f64 V l)) < 5.9999999999999996e260Initial program 99.6%
associate-/r*86.2%
div-inv86.2%
add-cube-cbrt85.6%
times-frac94.2%
pow294.2%
Applied egg-rr94.2%
associate-*l/93.5%
associate-/l/93.5%
associate-*r/93.5%
*-rgt-identity93.5%
*-commutative93.5%
Simplified93.5%
associate-/r*85.5%
associate-/l/85.6%
unpow285.6%
add-cube-cbrt86.2%
sqrt-undiv43.2%
clear-num43.2%
un-div-inv43.2%
sqrt-undiv86.2%
div-inv85.0%
clear-num85.7%
Applied egg-rr85.7%
*-commutative85.7%
associate-*l/99.7%
associate-*r/91.9%
Simplified91.9%
Taylor expanded in V around 0 99.7%
if 5.9999999999999996e260 < (/.f64 A (*.f64 V l)) Initial program 41.6%
associate-/r*54.9%
div-inv54.8%
add-cube-cbrt54.7%
times-frac52.9%
pow252.9%
Applied egg-rr52.9%
associate-*l/53.0%
associate-/l/53.0%
associate-*r/53.0%
*-rgt-identity53.0%
*-commutative53.0%
Simplified53.0%
associate-/r*54.8%
associate-/l/54.7%
unpow254.7%
add-cube-cbrt54.9%
sqrt-undiv51.5%
clear-num51.4%
un-div-inv51.5%
sqrt-undiv57.2%
div-inv57.2%
clear-num57.2%
Applied egg-rr57.2%
*-commutative57.2%
associate-*l/43.9%
associate-*r/55.7%
Simplified55.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 1e+261) (* c0 (sqrt 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 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 1e+261) {
tmp = c0 * sqrt(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 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 1d+261) then
tmp = c0 * sqrt(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 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 1e+261) {
tmp = c0 * Math.sqrt(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 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 1e+261: tmp = c0 * math.sqrt(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(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 1e+261) tmp = Float64(c0 * sqrt(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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 1e+261)
tmp = c0 * sqrt(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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+261], N[(c0 * N[Sqrt[t$95$0], $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 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 10^{+261}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 31.5%
*-un-lft-identity31.5%
times-frac50.4%
Applied egg-rr50.4%
associate-*l/50.4%
*-un-lft-identity50.4%
Applied egg-rr50.4%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999993e260Initial program 99.6%
if 9.9999999999999993e260 < (/.f64 A (*.f64 V l)) Initial program 40.5%
associate-/r*54.1%
div-inv54.0%
add-cube-cbrt53.8%
times-frac52.0%
pow252.0%
Applied egg-rr52.0%
associate-*l/52.1%
associate-/l/52.1%
associate-*r/52.1%
*-rgt-identity52.1%
*-commutative52.1%
Simplified52.1%
associate-/r*54.0%
associate-/l/53.9%
unpow253.9%
add-cube-cbrt54.1%
sqrt-undiv52.4%
clear-num52.4%
un-div-inv52.5%
sqrt-undiv56.4%
div-inv56.4%
clear-num56.4%
Applied egg-rr56.4%
*-commutative56.4%
associate-*l/42.8%
associate-*r/54.8%
Simplified54.8%
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 71.9%
herbie shell --seed 2024090
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))