
(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 12 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 -2e-310) (* (/ (sqrt (/ (- A) l)) (sqrt (- V))) c0) (* c0 (/ (/ (sqrt A) (sqrt V)) (sqrt l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -2e-310) {
tmp = (sqrt((-A / l)) / sqrt(-V)) * c0;
} else {
tmp = c0 * ((sqrt(A) / sqrt(V)) / sqrt(l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (v <= (-2d-310)) then
tmp = (sqrt((-a / l)) / sqrt(-v)) * c0
else
tmp = c0 * ((sqrt(a) / sqrt(v)) / sqrt(l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -2e-310) {
tmp = (Math.sqrt((-A / l)) / Math.sqrt(-V)) * c0;
} else {
tmp = c0 * ((Math.sqrt(A) / Math.sqrt(V)) / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if V <= -2e-310: tmp = (math.sqrt((-A / l)) / math.sqrt(-V)) * c0 else: tmp = c0 * ((math.sqrt(A) / math.sqrt(V)) / math.sqrt(l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= -2e-310) tmp = Float64(Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V))) * c0); else tmp = Float64(c0 * Float64(Float64(sqrt(A) / sqrt(V)) / sqrt(l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (V <= -2e-310)
tmp = (sqrt((-A / l)) / sqrt(-V)) * c0;
else
tmp = c0 * ((sqrt(A) / sqrt(V)) / sqrt(l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[V, -2e-310], N[(N[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * c0), $MachinePrecision], N[(c0 * N[(N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}} \cdot c0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{A}}{\sqrt{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if V < -1.999999999999994e-310Initial program 64.3%
Taylor expanded in c0 around 0 64.3%
*-commutative64.3%
associate-/r*72.5%
Simplified72.5%
frac-2neg72.5%
sqrt-div88.5%
distribute-neg-frac288.5%
Applied egg-rr88.5%
if -1.999999999999994e-310 < V Initial program 74.6%
associate-/r*79.2%
sqrt-div47.0%
associate-*r/45.6%
Applied egg-rr45.6%
associate-/l*47.0%
Simplified47.0%
sqrt-div50.8%
div-inv50.9%
Applied egg-rr50.9%
associate-*r/50.8%
*-rgt-identity50.8%
Simplified50.8%
Final simplification69.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 0.0) (not (<= t_0 1e+180)))
(/ c0 (sqrt (* V (/ l A))))
t_0)))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 1e+180)) {
tmp = c0 / sqrt((V * (l / A)));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 1d+180))) then
tmp = c0 / sqrt((v * (l / a)))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 1e+180)) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 1e+180): tmp = c0 / math.sqrt((V * (l / A))) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 1e+180)) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 1e+180)))
tmp = c0 / sqrt((V * (l / A)));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 1e+180]], $MachinePrecision]], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 10^{+180}\right):\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 1e180 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 62.2%
associate-/r*71.7%
clear-num71.3%
sqrt-div72.4%
metadata-eval72.4%
clear-num71.2%
associate-/r*61.6%
clear-num62.1%
associate-/l*74.7%
Applied egg-rr74.7%
un-div-inv74.8%
*-commutative74.8%
sqrt-prod45.3%
sqrt-div26.7%
associate-/r/26.7%
sqrt-div44.8%
sqrt-undiv72.4%
div-inv72.4%
clear-num72.5%
Applied egg-rr72.5%
associate-*r/62.1%
*-commutative62.1%
associate-/l*74.8%
Simplified74.8%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1e180Initial program 99.2%
Final simplification79.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -4e+220)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -5e-314)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(sqrt (* A (* (/ c0 l) (/ c0 V))))
(if (<= (* V l) 5e+276)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(/ c0 (sqrt (* V (/ l A)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -4e+220) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -5e-314) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
} else if ((V * l) <= 5e+276) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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) :: tmp
if ((v * l) <= (-4d+220)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-5d-314)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = sqrt((a * ((c0 / l) * (c0 / v))))
else if ((v * l) <= 5d+276) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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 tmp;
if ((V * l) <= -4e+220) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -5e-314) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = Math.sqrt((A * ((c0 / l) * (c0 / V))));
} else if ((V * l) <= 5e+276) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} 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): tmp = 0 if (V * l) <= -4e+220: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -5e-314: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = math.sqrt((A * ((c0 / l) * (c0 / V)))) elif (V * l) <= 5e+276: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) 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) tmp = 0.0 if (Float64(V * l) <= -4e+220) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -5e-314) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = sqrt(Float64(A * Float64(Float64(c0 / l) * Float64(c0 / V)))); elseif (Float64(V * l) <= 5e+276) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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)
tmp = 0.0;
if ((V * l) <= -4e+220)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -5e-314)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
elseif ((V * l) <= 5e+276)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -4e+220], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-314], 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[Sqrt[N[(A * N[(N[(c0 / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+276], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $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}
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+220}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-314}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+276}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4e220Initial program 48.9%
associate-/r*84.5%
sqrt-div38.7%
associate-*r/38.7%
Applied egg-rr38.7%
associate-/l*38.7%
Simplified38.7%
if -4e220 < (*.f64 V l) < -4.99999999982e-314Initial program 90.8%
frac-2neg90.8%
sqrt-div99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
Applied egg-rr99.2%
if -4.99999999982e-314 < (*.f64 V l) < 0.0Initial program 33.0%
add-sqr-sqrt15.1%
sqrt-unprod15.3%
*-commutative15.3%
*-commutative15.3%
swap-sqr14.8%
add-sqr-sqrt14.8%
pow214.8%
Applied egg-rr14.8%
associate-/r*17.2%
Simplified17.2%
Taylor expanded in A around 0 14.7%
associate-/l*14.8%
*-commutative14.8%
associate-/r*15.6%
Simplified15.6%
associate-/r*14.8%
unpow214.8%
times-frac26.4%
Applied egg-rr26.4%
if 0.0 < (*.f64 V l) < 5.00000000000000001e276Initial program 80.9%
sqrt-div99.6%
associate-*r/97.2%
Applied egg-rr97.2%
associate-/l*99.6%
Simplified99.6%
if 5.00000000000000001e276 < (*.f64 V l) Initial program 54.8%
associate-/r*76.8%
clear-num76.8%
sqrt-div76.7%
metadata-eval76.7%
clear-num76.7%
associate-/r*54.7%
clear-num54.7%
associate-/l*76.8%
Applied egg-rr76.8%
un-div-inv76.9%
*-commutative76.9%
sqrt-prod58.0%
sqrt-div63.6%
associate-/r/63.4%
sqrt-div61.7%
sqrt-undiv76.8%
div-inv76.8%
clear-num76.9%
Applied egg-rr76.9%
associate-*r/54.8%
*-commutative54.8%
associate-/l*76.9%
Simplified76.9%
Final simplification77.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (/ (sqrt (/ (- A) V)) (sqrt (- l))))))
(if (<= l -4.5e+74)
t_0
(if (<= l -5.3e-244)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(if (<= l -5e-312) t_0 (* 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 = c0 * (sqrt((-A / V)) / sqrt(-l));
double tmp;
if (l <= -4.5e+74) {
tmp = t_0;
} else if (l <= -5.3e-244) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else if (l <= -5e-312) {
tmp = t_0;
} 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 = c0 * (sqrt((-a / v)) / sqrt(-l))
if (l <= (-4.5d+74)) then
tmp = t_0
else if (l <= (-5.3d-244)) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else if (l <= (-5d-312)) then
tmp = t_0
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 = c0 * (Math.sqrt((-A / V)) / Math.sqrt(-l));
double tmp;
if (l <= -4.5e+74) {
tmp = t_0;
} else if (l <= -5.3e-244) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else if (l <= -5e-312) {
tmp = t_0;
} 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 = c0 * (math.sqrt((-A / V)) / math.sqrt(-l)) tmp = 0 if l <= -4.5e+74: tmp = t_0 elif l <= -5.3e-244: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) elif l <= -5e-312: tmp = t_0 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(c0 * Float64(sqrt(Float64(Float64(-A) / V)) / sqrt(Float64(-l)))) tmp = 0.0 if (l <= -4.5e+74) tmp = t_0; elseif (l <= -5.3e-244) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); elseif (l <= -5e-312) tmp = t_0; 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 = c0 * (sqrt((-A / V)) / sqrt(-l));
tmp = 0.0;
if (l <= -4.5e+74)
tmp = t_0;
elseif (l <= -5.3e-244)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
elseif (l <= -5e-312)
tmp = t_0;
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[(c0 * N[(N[Sqrt[N[((-A) / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -4.5e+74], t$95$0, If[LessEqual[l, -5.3e-244], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-312], t$95$0, 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 := c0 \cdot \frac{\sqrt{\frac{-A}{V}}}{\sqrt{-\ell}}\\
\mathbf{if}\;\ell \leq -4.5 \cdot 10^{+74}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -5.3 \cdot 10^{-244}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-312}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.5e74 or -5.3000000000000001e-244 < l < -5.0000000000022e-312Initial program 62.7%
associate-/r*74.5%
frac-2neg74.5%
sqrt-div94.0%
distribute-neg-frac294.0%
Applied egg-rr94.0%
if -4.5e74 < l < -5.3000000000000001e-244Initial program 74.0%
sqrt-div41.3%
associate-*r/39.9%
Applied egg-rr39.9%
associate-/l*41.3%
Simplified41.3%
if -5.0000000000022e-312 < l Initial program 69.9%
associate-/r*75.1%
sqrt-div88.8%
associate-*r/85.5%
Applied egg-rr85.5%
associate-/l*88.8%
Simplified88.8%
Final simplification76.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 (or (<= (* V l) 0.0) (not (<= (* V l) 5e+276))) (/ c0 (sqrt (* V (/ l A)))) (* c0 (/ (sqrt A) (sqrt (* V 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) || !((V * l) <= 5e+276)) {
tmp = c0 / sqrt((V * (l / A)));
} 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) :: tmp
if (((v * l) <= 0.0d0) .or. (.not. ((v * l) <= 5d+276))) then
tmp = c0 / sqrt((v * (l / a)))
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 tmp;
if (((V * l) <= 0.0) || !((V * l) <= 5e+276)) {
tmp = c0 / Math.sqrt((V * (l / A)));
} 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): tmp = 0 if ((V * l) <= 0.0) or not ((V * l) <= 5e+276): tmp = c0 / math.sqrt((V * (l / A))) 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) tmp = 0.0 if ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 5e+276)) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); 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)
tmp = 0.0;
if (((V * l) <= 0.0) || ~(((V * l) <= 5e+276)))
tmp = c0 / sqrt((V * (l / A)));
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_] := If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 5e+276]], $MachinePrecision]], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 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}
\mathbf{if}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 5 \cdot 10^{+276}\right):\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0 or 5.00000000000000001e276 < (*.f64 V l) Initial program 64.3%
associate-/r*76.6%
clear-num76.5%
sqrt-div77.3%
metadata-eval77.3%
clear-num76.4%
associate-/r*64.2%
clear-num64.3%
associate-/l*76.9%
Applied egg-rr76.9%
un-div-inv77.0%
*-commutative77.0%
sqrt-prod45.7%
sqrt-div14.2%
associate-/r/14.2%
sqrt-div44.3%
sqrt-undiv77.4%
div-inv77.4%
clear-num77.4%
Applied egg-rr77.4%
associate-*r/64.3%
*-commutative64.3%
associate-/l*77.0%
Simplified77.0%
if 0.0 < (*.f64 V l) < 5.00000000000000001e276Initial program 80.9%
sqrt-div99.6%
associate-*r/97.2%
Applied egg-rr97.2%
associate-/l*99.6%
Simplified99.6%
Final simplification84.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= l -5e-239)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(if (<= l 1.4e-289)
(sqrt (* A (* (/ c0 l) (/ c0 V))))
(* c0 (/ (sqrt (/ A V)) (sqrt l))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-239) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else if (l <= 1.4e-289) {
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (l <= (-5d-239)) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else if (l <= 1.4d-289) then
tmp = sqrt((a * ((c0 / l) * (c0 / v))))
else
tmp = c0 * (sqrt((a / v)) / sqrt(l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-239) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else if (l <= 1.4e-289) {
tmp = Math.sqrt((A * ((c0 / l) * (c0 / V))));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-239: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) elif l <= 1.4e-289: tmp = math.sqrt((A * ((c0 / l) * (c0 / V)))) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-239) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); elseif (l <= 1.4e-289) tmp = sqrt(Float64(A * Float64(Float64(c0 / l) * Float64(c0 / V)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= -5e-239)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
elseif (l <= 1.4e-289)
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
else
tmp = c0 * (sqrt((A / V)) / sqrt(l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[l, -5e-239], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.4e-289], N[Sqrt[N[(A * N[(N[(c0 / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-239}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{elif}\;\ell \leq 1.4 \cdot 10^{-289}:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -5e-239Initial program 73.7%
sqrt-div37.6%
associate-*r/36.7%
Applied egg-rr36.7%
associate-/l*37.6%
Simplified37.6%
if -5e-239 < l < 1.39999999999999993e-289Initial program 49.5%
add-sqr-sqrt35.0%
sqrt-unprod27.2%
*-commutative27.2%
*-commutative27.2%
swap-sqr22.7%
add-sqr-sqrt22.7%
pow222.7%
Applied egg-rr22.7%
associate-/r*19.4%
Simplified19.4%
Taylor expanded in A around 0 19.2%
associate-/l*23.3%
*-commutative23.3%
associate-/r*23.8%
Simplified23.8%
associate-/r*23.3%
unpow223.3%
times-frac32.1%
Applied egg-rr32.1%
if 1.39999999999999993e-289 < l Initial program 69.7%
associate-/r*75.9%
sqrt-div89.3%
associate-*r/85.8%
Applied egg-rr85.8%
associate-/l*89.3%
Simplified89.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 -1.15e-293) (* (/ (sqrt (/ (- A) l)) (sqrt (- V))) c0) (/ c0 (* (sqrt l) (sqrt (/ V A))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -1.15e-293) {
tmp = (sqrt((-A / l)) / sqrt(-V)) * c0;
} else {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (v <= (-1.15d-293)) then
tmp = (sqrt((-a / l)) / sqrt(-v)) * c0
else
tmp = c0 / (sqrt(l) * sqrt((v / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -1.15e-293) {
tmp = (Math.sqrt((-A / l)) / Math.sqrt(-V)) * c0;
} else {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if V <= -1.15e-293: tmp = (math.sqrt((-A / l)) / math.sqrt(-V)) * c0 else: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= -1.15e-293) tmp = Float64(Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V))) * c0); else tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (V <= -1.15e-293)
tmp = (sqrt((-A / l)) / sqrt(-V)) * c0;
else
tmp = c0 / (sqrt(l) * sqrt((V / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[V, -1.15e-293], N[(N[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * c0), $MachinePrecision], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -1.15 \cdot 10^{-293}:\\
\;\;\;\;\frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}} \cdot c0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\end{array}
\end{array}
if V < -1.14999999999999998e-293Initial program 64.8%
Taylor expanded in c0 around 0 64.8%
*-commutative64.8%
associate-/r*73.0%
Simplified73.0%
frac-2neg73.0%
sqrt-div88.5%
distribute-neg-frac288.5%
Applied egg-rr88.5%
if -1.14999999999999998e-293 < V Initial program 74.0%
associate-/r*78.7%
clear-num78.6%
sqrt-div79.3%
metadata-eval79.3%
clear-num78.5%
associate-/r*73.3%
clear-num74.0%
associate-/l*77.8%
Applied egg-rr77.8%
un-div-inv77.9%
*-commutative77.9%
sqrt-prod87.1%
sqrt-div50.5%
associate-/r/50.5%
sqrt-div46.7%
sqrt-undiv79.3%
div-inv79.3%
clear-num79.4%
Applied egg-rr79.4%
associate-*r/74.0%
*-commutative74.0%
associate-/l*77.9%
Simplified77.9%
add-sqr-sqrt33.5%
associate-*r/33.5%
*-commutative33.5%
associate-*r/37.1%
sqrt-prod19.3%
times-frac19.3%
Applied egg-rr19.3%
associate-*l/18.6%
associate-*r/18.6%
rem-square-sqrt45.2%
associate-/r*46.7%
Simplified46.7%
Final simplification66.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 2e+297)))
(sqrt (* A (* (/ c0 l) (/ c0 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 <= 2e+297)) {
tmp = sqrt((A * ((c0 / l) * (c0 / 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 <= 2d+297))) then
tmp = sqrt((a * ((c0 / l) * (c0 / 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 <= 2e+297)) {
tmp = Math.sqrt((A * ((c0 / l) * (c0 / 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 <= 2e+297): tmp = math.sqrt((A * ((c0 / l) * (c0 / 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 <= 2e+297)) tmp = sqrt(Float64(A * Float64(Float64(c0 / l) * Float64(c0 / 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 <= 2e+297)))
tmp = sqrt((A * ((c0 / l) * (c0 / 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, 2e+297]], $MachinePrecision]], N[Sqrt[N[(A * N[(N[(c0 / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $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 2 \cdot 10^{+297}\right):\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 2e297 < (/.f64 A (*.f64 V l)) Initial program 39.5%
add-sqr-sqrt30.0%
sqrt-unprod30.0%
*-commutative30.0%
*-commutative30.0%
swap-sqr29.4%
add-sqr-sqrt29.4%
pow229.4%
Applied egg-rr29.4%
associate-/r*31.2%
Simplified31.2%
Taylor expanded in A around 0 32.6%
associate-/l*32.6%
*-commutative32.6%
associate-/r*33.1%
Simplified33.1%
associate-/r*32.6%
unpow232.6%
times-frac44.5%
Applied egg-rr44.5%
if 0.0 < (/.f64 A (*.f64 V l)) < 2e297Initial program 98.7%
Final simplification72.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 2e+297)))
(sqrt (* A (* c0 (/ (/ c0 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 <= 2e+297)) {
tmp = sqrt((A * (c0 * ((c0 / 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 <= 2d+297))) then
tmp = sqrt((a * (c0 * ((c0 / 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 <= 2e+297)) {
tmp = Math.sqrt((A * (c0 * ((c0 / 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 <= 2e+297): tmp = math.sqrt((A * (c0 * ((c0 / 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 <= 2e+297)) tmp = sqrt(Float64(A * Float64(c0 * Float64(Float64(c0 / 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 <= 2e+297)))
tmp = sqrt((A * (c0 * ((c0 / 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, 2e+297]], $MachinePrecision]], N[Sqrt[N[(A * N[(c0 * N[(N[(c0 / l), $MachinePrecision] / V), $MachinePrecision]), $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 2 \cdot 10^{+297}\right):\\
\;\;\;\;\sqrt{A \cdot \left(c0 \cdot \frac{\frac{c0}{\ell}}{V}\right)}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 2e297 < (/.f64 A (*.f64 V l)) Initial program 39.5%
add-sqr-sqrt30.0%
sqrt-unprod30.0%
*-commutative30.0%
*-commutative30.0%
swap-sqr29.4%
add-sqr-sqrt29.4%
pow229.4%
Applied egg-rr29.4%
associate-/r*31.2%
Simplified31.2%
Taylor expanded in A around 0 32.6%
associate-/l*32.6%
*-commutative32.6%
associate-/r*33.1%
Simplified33.1%
unpow233.1%
associate-/l*39.9%
Applied egg-rr39.9%
associate-/l*42.2%
Applied egg-rr42.2%
if 0.0 < (/.f64 A (*.f64 V l)) < 2e297Initial program 98.7%
Final simplification70.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 2e+297)))
(* 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 <= 2e+297)) {
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 <= 2d+297))) 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 <= 2e+297)) {
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 <= 2e+297): 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 <= 2e+297)) 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 <= 2e+297)))
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, 2e+297]], $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 2 \cdot 10^{+297}\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 2e297 < (/.f64 A (*.f64 V l)) Initial program 39.5%
*-commutative39.5%
associate-/l/60.4%
Simplified60.4%
if 0.0 < (/.f64 A (*.f64 V l)) < 2e297Initial program 98.7%
Final simplification79.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 l) V))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt(((A / l) / V));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt(((a / l) / v))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt(((A / l) / V));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt(((A / l) / V))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(Float64(A / l) / V))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt(((A / l) / V));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}
\end{array}
Initial program 69.6%
Taylor expanded in c0 around 0 69.6%
*-commutative69.6%
associate-/r*76.0%
Simplified76.0%
Final simplification76.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 69.6%
herbie shell --seed 2024166
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))