
(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 11 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) -5e-315)
(* c0 (* (pow l -0.5) (/ (sqrt (- A)) (sqrt (- V)))))
(if (<= (* V l) 5e-311)
(* c0 (sqrt (/ (pow (/ l A) -1.0) V)))
(if (<= (* V l) 5e+298)
(* 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) <= -5e-315) {
tmp = c0 * (pow(l, -0.5) * (sqrt(-A) / sqrt(-V)));
} else if ((V * l) <= 5e-311) {
tmp = c0 * sqrt((pow((l / A), -1.0) / V));
} else if ((V * l) <= 5e+298) {
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) <= (-5d-315)) then
tmp = c0 * ((l ** (-0.5d0)) * (sqrt(-a) / sqrt(-v)))
else if ((v * l) <= 5d-311) then
tmp = c0 * sqrt((((l / a) ** (-1.0d0)) / v))
else if ((v * l) <= 5d+298) 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) <= -5e-315) {
tmp = c0 * (Math.pow(l, -0.5) * (Math.sqrt(-A) / Math.sqrt(-V)));
} else if ((V * l) <= 5e-311) {
tmp = c0 * Math.sqrt((Math.pow((l / A), -1.0) / V));
} else if ((V * l) <= 5e+298) {
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) <= -5e-315: tmp = c0 * (math.pow(l, -0.5) * (math.sqrt(-A) / math.sqrt(-V))) elif (V * l) <= 5e-311: tmp = c0 * math.sqrt((math.pow((l / A), -1.0) / V)) elif (V * l) <= 5e+298: 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) <= -5e-315) tmp = Float64(c0 * Float64((l ^ -0.5) * Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))))); elseif (Float64(V * l) <= 5e-311) tmp = Float64(c0 * sqrt(Float64((Float64(l / A) ^ -1.0) / V))); elseif (Float64(V * l) <= 5e+298) 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) <= -5e-315)
tmp = c0 * ((l ^ -0.5) * (sqrt(-A) / sqrt(-V)));
elseif ((V * l) <= 5e-311)
tmp = c0 * sqrt((((l / A) ^ -1.0) / V));
elseif ((V * l) <= 5e+298)
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], -5e-315], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-311], N[(c0 * N[Sqrt[N[(N[Power[N[(l / A), $MachinePrecision], -1.0], $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+298], 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 -5 \cdot 10^{-315}:\\
\;\;\;\;c0 \cdot \left({\ell}^{-0.5} \cdot \frac{\sqrt{-A}}{\sqrt{-V}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-311}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{{\left(\frac{\ell}{A}\right)}^{-1}}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+298}:\\
\;\;\;\;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) < -5.0000000023e-315Initial program 79.7%
associate-/r*78.0%
div-inv77.9%
Applied egg-rr77.9%
*-commutative77.9%
sqrt-prod49.5%
inv-pow49.5%
sqrt-pow149.5%
metadata-eval49.5%
Applied egg-rr49.5%
frac-2neg49.5%
sqrt-div53.6%
Applied egg-rr53.6%
if -5.0000000023e-315 < (*.f64 V l) < 5.00000000000023e-311Initial program 58.7%
Taylor expanded in c0 around 0 58.7%
*-commutative58.7%
associate-/r*78.6%
Simplified78.6%
clear-num78.7%
inv-pow78.7%
Applied egg-rr78.7%
if 5.00000000000023e-311 < (*.f64 V l) < 5.0000000000000003e298Initial program 88.9%
*-commutative88.9%
associate-/l/84.9%
Simplified84.9%
clear-num84.9%
associate-/r/84.9%
Applied egg-rr84.9%
*-commutative84.9%
sqrt-div45.5%
associate-*l/45.6%
*-un-lft-identity45.6%
associate-*l/43.6%
Applied egg-rr97.6%
associate-/r/99.4%
Simplified99.4%
if 5.0000000000000003e298 < (*.f64 V l) Initial program 34.9%
*-commutative34.9%
associate-/l/84.5%
Simplified84.5%
clear-num84.5%
associate-/r/84.4%
Applied egg-rr84.4%
sqrt-div68.0%
associate-*l/68.2%
*-un-lft-identity68.2%
clear-num68.1%
sqrt-div84.4%
un-div-inv84.7%
associate-/r/84.7%
*-commutative84.7%
Applied egg-rr84.7%
Final simplification75.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (or (<= t_0 4e-222) (not (<= t_0 5e+302)))
(/ 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 <= 4e-222) || !(t_0 <= 5e+302)) {
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 <= 4d-222) .or. (.not. (t_0 <= 5d+302))) 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 <= 4e-222) || !(t_0 <= 5e+302)) {
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 <= 4e-222) or not (t_0 <= 5e+302): 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 <= 4e-222) || !(t_0 <= 5e+302)) 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 <= 4e-222) || ~((t_0 <= 5e+302)))
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, 4e-222], N[Not[LessEqual[t$95$0, 5e+302]], $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 4 \cdot 10^{-222} \lor \neg \left(t\_0 \leq 5 \cdot 10^{+302}\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)))) < 4.00000000000000019e-222 or 5e302 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 71.3%
*-commutative71.3%
associate-/l/78.0%
Simplified78.0%
clear-num78.0%
associate-/r/78.0%
Applied egg-rr78.0%
sqrt-div48.2%
associate-*l/48.3%
*-un-lft-identity48.3%
clear-num48.2%
sqrt-div78.2%
un-div-inv78.3%
associate-/r/76.1%
*-commutative76.1%
Applied egg-rr76.1%
if 4.00000000000000019e-222 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5e302Initial program 97.1%
Final simplification81.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) -5e-302)
(/ (* c0 (/ (sqrt (- A)) (sqrt (- V)))) (sqrt l))
(if (<= (* V l) 5e-311)
(* c0 (sqrt (/ (pow (/ l A) -1.0) V)))
(if (<= (* V l) 5e+298)
(* 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) <= -5e-302) {
tmp = (c0 * (sqrt(-A) / sqrt(-V))) / sqrt(l);
} else if ((V * l) <= 5e-311) {
tmp = c0 * sqrt((pow((l / A), -1.0) / V));
} else if ((V * l) <= 5e+298) {
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) <= (-5d-302)) then
tmp = (c0 * (sqrt(-a) / sqrt(-v))) / sqrt(l)
else if ((v * l) <= 5d-311) then
tmp = c0 * sqrt((((l / a) ** (-1.0d0)) / v))
else if ((v * l) <= 5d+298) 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) <= -5e-302) {
tmp = (c0 * (Math.sqrt(-A) / Math.sqrt(-V))) / Math.sqrt(l);
} else if ((V * l) <= 5e-311) {
tmp = c0 * Math.sqrt((Math.pow((l / A), -1.0) / V));
} else if ((V * l) <= 5e+298) {
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) <= -5e-302: tmp = (c0 * (math.sqrt(-A) / math.sqrt(-V))) / math.sqrt(l) elif (V * l) <= 5e-311: tmp = c0 * math.sqrt((math.pow((l / A), -1.0) / V)) elif (V * l) <= 5e+298: 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) <= -5e-302) tmp = Float64(Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(-V)))) / sqrt(l)); elseif (Float64(V * l) <= 5e-311) tmp = Float64(c0 * sqrt(Float64((Float64(l / A) ^ -1.0) / V))); elseif (Float64(V * l) <= 5e+298) 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) <= -5e-302)
tmp = (c0 * (sqrt(-A) / sqrt(-V))) / sqrt(l);
elseif ((V * l) <= 5e-311)
tmp = c0 * sqrt((((l / A) ^ -1.0) / V));
elseif ((V * l) <= 5e+298)
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], -5e-302], N[(N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-311], N[(c0 * N[Sqrt[N[(N[Power[N[(l / A), $MachinePrecision], -1.0], $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+298], 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 -5 \cdot 10^{-302}:\\
\;\;\;\;\frac{c0 \cdot \frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-311}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{{\left(\frac{\ell}{A}\right)}^{-1}}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+298}:\\
\;\;\;\;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) < -5.00000000000000033e-302Initial program 79.4%
*-commutative79.4%
associate-/r*77.4%
sqrt-div50.0%
associate-*l/49.2%
Applied egg-rr49.2%
frac-2neg50.0%
sqrt-div54.1%
Applied egg-rr54.2%
if -5.00000000000000033e-302 < (*.f64 V l) < 5.00000000000023e-311Initial program 61.7%
Taylor expanded in c0 around 0 61.7%
*-commutative61.7%
associate-/r*80.7%
Simplified80.7%
clear-num80.7%
inv-pow80.7%
Applied egg-rr80.7%
if 5.00000000000023e-311 < (*.f64 V l) < 5.0000000000000003e298Initial program 88.9%
*-commutative88.9%
associate-/l/84.9%
Simplified84.9%
clear-num84.9%
associate-/r/84.9%
Applied egg-rr84.9%
*-commutative84.9%
sqrt-div45.5%
associate-*l/45.6%
*-un-lft-identity45.6%
associate-*l/43.6%
Applied egg-rr97.6%
associate-/r/99.4%
Simplified99.4%
if 5.0000000000000003e298 < (*.f64 V l) Initial program 34.9%
*-commutative34.9%
associate-/l/84.5%
Simplified84.5%
clear-num84.5%
associate-/r/84.4%
Applied egg-rr84.4%
sqrt-div68.0%
associate-*l/68.2%
*-un-lft-identity68.2%
clear-num68.1%
sqrt-div84.4%
un-div-inv84.7%
associate-/r/84.7%
*-commutative84.7%
Applied egg-rr84.7%
Final simplification76.7%
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-290)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (or (<= (* V l) 5e-311) (not (<= (* V l) 5e+298)))
(/ 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) <= -4e-290) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if (((V * l) <= 5e-311) || !((V * l) <= 5e+298)) {
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) <= (-4d-290)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if (((v * l) <= 5d-311) .or. (.not. ((v * l) <= 5d+298))) 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) <= -4e-290) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if (((V * l) <= 5e-311) || !((V * l) <= 5e+298)) {
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) <= -4e-290: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif ((V * l) <= 5e-311) or not ((V * l) <= 5e+298): 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) <= -4e-290) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif ((Float64(V * l) <= 5e-311) || !(Float64(V * l) <= 5e+298)) 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) <= -4e-290)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif (((V * l) <= 5e-311) || ~(((V * l) <= 5e+298)))
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[LessEqual[N[(V * l), $MachinePrecision], -4e-290], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 5e-311], N[Not[LessEqual[N[(V * l), $MachinePrecision], 5e+298]], $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 -4 \cdot 10^{-290}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-311} \lor \neg \left(V \cdot \ell \leq 5 \cdot 10^{+298}\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) < -4.0000000000000003e-290Initial program 80.1%
associate-/r*78.1%
sqrt-div50.4%
associate-*r/49.6%
Applied egg-rr49.6%
associate-/l*50.4%
Simplified50.4%
if -4.0000000000000003e-290 < (*.f64 V l) < 5.00000000000023e-311 or 5.0000000000000003e298 < (*.f64 V l) Initial program 50.4%
*-commutative50.4%
associate-/l/80.7%
Simplified80.7%
clear-num80.7%
associate-/r/80.6%
Applied egg-rr80.6%
sqrt-div47.8%
associate-*l/47.8%
*-un-lft-identity47.8%
clear-num47.8%
sqrt-div80.6%
un-div-inv80.8%
associate-/r/80.8%
*-commutative80.8%
Applied egg-rr80.8%
if 5.00000000000023e-311 < (*.f64 V l) < 5.0000000000000003e298Initial program 88.9%
*-commutative88.9%
associate-/l/84.9%
Simplified84.9%
clear-num84.9%
associate-/r/84.9%
Applied egg-rr84.9%
*-commutative84.9%
sqrt-div45.5%
associate-*l/45.6%
*-un-lft-identity45.6%
associate-*l/43.6%
Applied egg-rr97.6%
associate-/r/99.4%
Simplified99.4%
Final simplification74.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -5e-302)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-311)
(* c0 (sqrt (/ (pow (/ l A) -1.0) V)))
(if (<= (* V l) 5e+298)
(* 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) <= -5e-302) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-311) {
tmp = c0 * sqrt((pow((l / A), -1.0) / V));
} else if ((V * l) <= 5e+298) {
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) <= (-5d-302)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 5d-311) then
tmp = c0 * sqrt((((l / a) ** (-1.0d0)) / v))
else if ((v * l) <= 5d+298) 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) <= -5e-302) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-311) {
tmp = c0 * Math.sqrt((Math.pow((l / A), -1.0) / V));
} else if ((V * l) <= 5e+298) {
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) <= -5e-302: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-311: tmp = c0 * math.sqrt((math.pow((l / A), -1.0) / V)) elif (V * l) <= 5e+298: 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) <= -5e-302) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-311) tmp = Float64(c0 * sqrt(Float64((Float64(l / A) ^ -1.0) / V))); elseif (Float64(V * l) <= 5e+298) 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) <= -5e-302)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-311)
tmp = c0 * sqrt((((l / A) ^ -1.0) / V));
elseif ((V * l) <= 5e+298)
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], -5e-302], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-311], N[(c0 * N[Sqrt[N[(N[Power[N[(l / A), $MachinePrecision], -1.0], $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+298], 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 -5 \cdot 10^{-302}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-311}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{{\left(\frac{\ell}{A}\right)}^{-1}}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+298}:\\
\;\;\;\;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) < -5.00000000000000033e-302Initial program 79.4%
frac-2neg79.4%
sqrt-div94.3%
*-commutative94.3%
distribute-rgt-neg-in94.3%
Applied egg-rr94.3%
if -5.00000000000000033e-302 < (*.f64 V l) < 5.00000000000023e-311Initial program 61.7%
Taylor expanded in c0 around 0 61.7%
*-commutative61.7%
associate-/r*80.7%
Simplified80.7%
clear-num80.7%
inv-pow80.7%
Applied egg-rr80.7%
if 5.00000000000023e-311 < (*.f64 V l) < 5.0000000000000003e298Initial program 88.9%
*-commutative88.9%
associate-/l/84.9%
Simplified84.9%
clear-num84.9%
associate-/r/84.9%
Applied egg-rr84.9%
*-commutative84.9%
sqrt-div45.5%
associate-*l/45.6%
*-un-lft-identity45.6%
associate-*l/43.6%
Applied egg-rr97.6%
associate-/r/99.4%
Simplified99.4%
if 5.0000000000000003e298 < (*.f64 V l) Initial program 34.9%
*-commutative34.9%
associate-/l/84.5%
Simplified84.5%
clear-num84.5%
associate-/r/84.4%
Applied egg-rr84.4%
sqrt-div68.0%
associate-*l/68.2%
*-un-lft-identity68.2%
clear-num68.1%
sqrt-div84.4%
un-div-inv84.7%
associate-/r/84.7%
*-commutative84.7%
Applied egg-rr84.7%
Final simplification93.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -5e-310) (/ c0 (sqrt (* l (/ V 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 tmp;
if (l <= -5e-310) {
tmp = c0 / sqrt((l * (V / 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) :: tmp
if (l <= (-5d-310)) then
tmp = c0 / sqrt((l * (v / 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 tmp;
if (l <= -5e-310) {
tmp = c0 / Math.sqrt((l * (V / 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): tmp = 0 if l <= -5e-310: tmp = c0 / math.sqrt((l * (V / 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) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / 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)
tmp = 0.0;
if (l <= -5e-310)
tmp = c0 / sqrt((l * (V / 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_] := If[LessEqual[l, -5e-310], N[(c0 / N[Sqrt[N[(l * N[(V / A), $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^{-310}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 76.0%
*-commutative76.0%
associate-/l/80.1%
Simplified80.1%
clear-num80.0%
associate-/r/80.0%
Applied egg-rr80.0%
sqrt-div0.0%
associate-*l/0.0%
*-un-lft-identity0.0%
clear-num0.0%
sqrt-div80.2%
un-div-inv80.2%
associate-/r/80.6%
*-commutative80.6%
Applied egg-rr80.6%
Taylor expanded in V around 0 75.9%
*-commutative75.9%
associate-/l*81.2%
Simplified81.2%
if -4.999999999999985e-310 < l Initial program 79.1%
associate-/r*82.2%
sqrt-div90.5%
associate-*r/88.5%
Applied egg-rr88.5%
associate-/l*90.5%
Simplified90.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 1e+258)))
(* 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+258)) {
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+258))) 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+258)) {
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+258): 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+258)) 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+258)))
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+258]], $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^{+258}\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 1.00000000000000006e258 < (/.f64 A (*.f64 V l)) Initial program 45.9%
*-commutative45.9%
associate-/l/64.1%
Simplified64.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.00000000000000006e258Initial program 98.3%
Final simplification84.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 (/ A (* V l))))
(if (<= t_0 2e-306)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+258)
(/ c0 (sqrt (/ (* V l) A)))
(/ c0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e-306) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 1e+258) {
tmp = c0 / sqrt(((V * l) / A));
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 2d-306) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 1d+258) then
tmp = c0 / sqrt(((v * l) / a))
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e-306) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+258) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 2e-306: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 1e+258: tmp = c0 / math.sqrt(((V * l) / A)) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 2e-306) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+258) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 2e-306)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 1e+258)
tmp = c0 / sqrt(((V * l) / A));
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-306], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+258], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-306}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 10^{+258}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2.00000000000000006e-306Initial program 39.6%
*-commutative39.6%
associate-/l/67.5%
Simplified67.5%
if 2.00000000000000006e-306 < (/.f64 A (*.f64 V l)) < 1.00000000000000006e258Initial program 99.1%
*-commutative99.1%
associate-/l/93.2%
Simplified93.2%
clear-num93.2%
associate-/r/93.3%
Applied egg-rr93.3%
sqrt-div49.1%
associate-*l/49.1%
*-un-lft-identity49.1%
clear-num49.1%
sqrt-div93.1%
un-div-inv93.2%
associate-/r/90.9%
*-commutative90.9%
Applied egg-rr90.9%
Taylor expanded in V around 0 99.2%
if 1.00000000000000006e258 < (/.f64 A (*.f64 V l)) Initial program 51.6%
*-commutative51.6%
associate-/l/60.4%
Simplified60.4%
clear-num60.4%
associate-/r/60.4%
Applied egg-rr60.4%
sqrt-div45.2%
associate-*l/45.2%
*-un-lft-identity45.2%
clear-num45.2%
sqrt-div61.2%
un-div-inv61.3%
associate-/r/60.6%
*-commutative60.6%
Applied egg-rr60.6%
Taylor expanded in V around 0 52.4%
*-commutative52.4%
associate-/l*61.3%
Simplified61.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 (/ A (* V l))))
(if (<= t_0 0.0)
(/ c0 (sqrt (* V (/ l A))))
(if (<= t_0 1e+258) (* c0 (sqrt t_0)) (/ c0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / sqrt((V * (l / A)));
} else if (t_0 <= 1e+258) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 / sqrt((v * (l / a)))
else if (t_0 <= 1d+258) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if (t_0 <= 1e+258) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 / math.sqrt((V * (l / A))) elif t_0 <= 1e+258: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (t_0 <= 1e+258) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 / sqrt((V * (l / A)));
elseif (t_0 <= 1e+258)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+258], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;t\_0 \leq 10^{+258}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 38.2%
*-commutative38.2%
associate-/l/69.1%
Simplified69.1%
clear-num69.1%
associate-/r/69.0%
Applied egg-rr69.0%
sqrt-div49.1%
associate-*l/49.2%
*-un-lft-identity49.2%
clear-num49.2%
sqrt-div69.0%
un-div-inv69.1%
associate-/r/69.1%
*-commutative69.1%
Applied egg-rr69.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.00000000000000006e258Initial program 98.3%
if 1.00000000000000006e258 < (/.f64 A (*.f64 V l)) Initial program 51.6%
*-commutative51.6%
associate-/l/60.4%
Simplified60.4%
clear-num60.4%
associate-/r/60.4%
Applied egg-rr60.4%
sqrt-div45.2%
associate-*l/45.2%
*-un-lft-identity45.2%
clear-num45.2%
sqrt-div61.2%
un-div-inv61.3%
associate-/r/60.6%
*-commutative60.6%
Applied egg-rr60.6%
Taylor expanded in V around 0 52.4%
*-commutative52.4%
associate-/l*61.3%
Simplified61.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 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 1e+258) (* c0 (sqrt 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 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 1e+258) {
tmp = c0 * sqrt(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 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 1d+258) then
tmp = c0 * sqrt(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 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 1e+258) {
tmp = c0 * Math.sqrt(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 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 1e+258: tmp = c0 * math.sqrt(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(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+258) tmp = Float64(c0 * sqrt(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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 1e+258)
tmp = c0 * sqrt(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[(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+258], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 10^{+258}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 38.2%
Taylor expanded in c0 around 0 38.2%
*-commutative38.2%
associate-/r*69.1%
Simplified69.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.00000000000000006e258Initial program 98.3%
if 1.00000000000000006e258 < (/.f64 A (*.f64 V l)) Initial program 51.6%
*-commutative51.6%
associate-/l/60.4%
Simplified60.4%
Final simplification84.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 77.6%
herbie shell --seed 2024149
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))