
(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 15 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 -1e-309) (* c0 (* (/ (sqrt (- A)) (sqrt (- V))) (sqrt (/ 1.0 l)))) (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-309) {
tmp = c0 * ((sqrt(-A) / sqrt(-V)) * sqrt((1.0 / l)));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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 (a <= (-1d-309)) then
tmp = c0 * ((sqrt(-a) / sqrt(-v)) * sqrt((1.0d0 / l)))
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / 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 (A <= -1e-309) {
tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) * Math.sqrt((1.0 / l)));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -1e-309: tmp = c0 * ((math.sqrt(-A) / math.sqrt(-V)) * math.sqrt((1.0 / l))) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -1e-309) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * sqrt(Float64(1.0 / l)))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / 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 (A <= -1e-309)
tmp = c0 * ((sqrt(-A) / sqrt(-V)) * sqrt((1.0 / l)));
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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[A, -1e-309], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \left(\frac{\sqrt{-A}}{\sqrt{-V}} \cdot \sqrt{\frac{1}{\ell}}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if A < -1.000000000000002e-309Initial program 73.4%
pow1/273.4%
associate-/r*71.8%
div-inv71.9%
unpow-prod-down43.6%
pow1/243.6%
Applied egg-rr43.6%
unpow1/243.6%
Simplified43.6%
frac-2neg43.6%
sqrt-div52.9%
Applied egg-rr52.9%
if -1.000000000000002e-309 < A Initial program 75.1%
pow1/275.1%
div-inv75.0%
unpow-prod-down86.2%
pow1/286.2%
associate-/r*87.3%
Applied egg-rr87.3%
unpow1/287.3%
Simplified87.3%
Final simplification70.4%
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 -1e-309) (* c0 (/ (/ (sqrt (- A)) (sqrt (- V))) (sqrt l))) (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -1e-309) {
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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 (a <= (-1d-309)) then
tmp = c0 * ((sqrt(-a) / sqrt(-v)) / sqrt(l))
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / 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 (A <= -1e-309) {
tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -1e-309: tmp = c0 * ((math.sqrt(-A) / math.sqrt(-V)) / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -1e-309) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / 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 (A <= -1e-309)
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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[A, -1e-309], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -1 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if A < -1.000000000000002e-309Initial program 73.4%
associate-/r*71.8%
sqrt-div43.5%
div-inv43.5%
Applied egg-rr43.5%
associate-*r/43.5%
*-rgt-identity43.5%
Simplified43.5%
frac-2neg43.6%
sqrt-div52.9%
Applied egg-rr52.9%
if -1.000000000000002e-309 < A Initial program 75.1%
pow1/275.1%
div-inv75.0%
unpow-prod-down86.2%
pow1/286.2%
associate-/r*87.3%
Applied egg-rr87.3%
unpow1/287.3%
Simplified87.3%
Final simplification70.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ (/ 1.0 V) l)))
(if (<= (* V l) -5e+123)
(/ (sqrt (/ A V)) (/ (sqrt l) c0))
(if (<= (* V l) -1e-103)
(* c0 (sqrt (* A t_0)))
(if (<= (* V l) 1e-289)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(* c0 (* (sqrt A) (sqrt t_0))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = (1.0 / V) / l;
double tmp;
if ((V * l) <= -5e+123) {
tmp = sqrt((A / V)) / (sqrt(l) / c0);
} else if ((V * l) <= -1e-103) {
tmp = c0 * sqrt((A * t_0));
} else if ((V * l) <= 1e-289) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else {
tmp = c0 * (sqrt(A) * 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 = (1.0d0 / v) / l
if ((v * l) <= (-5d+123)) then
tmp = sqrt((a / v)) / (sqrt(l) / c0)
else if ((v * l) <= (-1d-103)) then
tmp = c0 * sqrt((a * t_0))
else if ((v * l) <= 1d-289) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else
tmp = c0 * (sqrt(a) * 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 = (1.0 / V) / l;
double tmp;
if ((V * l) <= -5e+123) {
tmp = Math.sqrt((A / V)) / (Math.sqrt(l) / c0);
} else if ((V * l) <= -1e-103) {
tmp = c0 * Math.sqrt((A * t_0));
} else if ((V * l) <= 1e-289) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(t_0));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = (1.0 / V) / l tmp = 0 if (V * l) <= -5e+123: tmp = math.sqrt((A / V)) / (math.sqrt(l) / c0) elif (V * l) <= -1e-103: tmp = c0 * math.sqrt((A * t_0)) elif (V * l) <= 1e-289: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) else: tmp = c0 * (math.sqrt(A) * math.sqrt(t_0)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(Float64(1.0 / V) / l) tmp = 0.0 if (Float64(V * l) <= -5e+123) tmp = Float64(sqrt(Float64(A / V)) / Float64(sqrt(l) / c0)); elseif (Float64(V * l) <= -1e-103) tmp = Float64(c0 * sqrt(Float64(A * t_0))); elseif (Float64(V * l) <= 1e-289) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); else tmp = Float64(c0 * Float64(sqrt(A) * 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 = (1.0 / V) / l;
tmp = 0.0;
if ((V * l) <= -5e+123)
tmp = sqrt((A / V)) / (sqrt(l) / c0);
elseif ((V * l) <= -1e-103)
tmp = c0 * sqrt((A * t_0));
elseif ((V * l) <= 1e-289)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
else
tmp = c0 * (sqrt(A) * 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[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+123], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-103], N[(c0 * N[Sqrt[N[(A * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-289], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{1}{V}}{\ell}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+123}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-103}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot t\_0}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-289}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{t\_0}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -4.99999999999999974e123Initial program 53.9%
*-un-lft-identity53.9%
times-frac62.9%
Applied egg-rr62.9%
frac-times53.9%
*-un-lft-identity53.9%
sqrt-undiv0.0%
clear-num0.0%
un-div-inv0.0%
sqrt-undiv51.7%
associate-/l*60.3%
Applied egg-rr60.3%
associate-*r/51.7%
associate-*l/63.0%
*-commutative63.0%
Simplified63.0%
associate-*r/51.7%
frac-2neg51.7%
distribute-rgt-neg-out51.7%
sqrt-undiv62.9%
un-div-inv62.9%
clear-num62.9%
associate-*r/60.0%
sqrt-prod49.8%
times-frac52.6%
sqrt-div45.8%
frac-2neg45.8%
Applied egg-rr45.8%
*-commutative45.8%
clear-num45.9%
un-div-inv46.0%
Applied egg-rr46.0%
if -4.99999999999999974e123 < (*.f64 V l) < -9.99999999999999958e-104Initial program 95.3%
clear-num93.4%
associate-/r/95.4%
associate-/r*95.4%
Applied egg-rr95.4%
if -9.99999999999999958e-104 < (*.f64 V l) < 1e-289Initial program 59.0%
*-un-lft-identity59.0%
times-frac70.6%
Applied egg-rr70.6%
frac-times59.0%
*-un-lft-identity59.0%
sqrt-undiv11.4%
clear-num11.4%
un-div-inv11.4%
sqrt-undiv59.0%
associate-/l*70.7%
Applied egg-rr70.7%
associate-*r/59.0%
associate-*l/72.3%
*-commutative72.3%
Simplified72.3%
*-commutative72.3%
sqrt-prod42.2%
Applied egg-rr42.2%
if 1e-289 < (*.f64 V l) Initial program 79.6%
pow1/279.6%
div-inv79.6%
unpow-prod-down91.1%
pow1/291.1%
associate-/r*92.4%
Applied egg-rr92.4%
unpow1/292.4%
Simplified92.4%
Final simplification75.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ (/ 1.0 V) l)))
(if (<= (* V l) -2e+116)
(* c0 (* (sqrt (/ 1.0 l)) (sqrt (/ A V))))
(if (<= (* V l) -1e-103)
(* c0 (sqrt (* A t_0)))
(if (<= (* V l) 1e-289)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(* c0 (* (sqrt A) (sqrt t_0))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = (1.0 / V) / l;
double tmp;
if ((V * l) <= -2e+116) {
tmp = c0 * (sqrt((1.0 / l)) * sqrt((A / V)));
} else if ((V * l) <= -1e-103) {
tmp = c0 * sqrt((A * t_0));
} else if ((V * l) <= 1e-289) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else {
tmp = c0 * (sqrt(A) * 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 = (1.0d0 / v) / l
if ((v * l) <= (-2d+116)) then
tmp = c0 * (sqrt((1.0d0 / l)) * sqrt((a / v)))
else if ((v * l) <= (-1d-103)) then
tmp = c0 * sqrt((a * t_0))
else if ((v * l) <= 1d-289) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else
tmp = c0 * (sqrt(a) * 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 = (1.0 / V) / l;
double tmp;
if ((V * l) <= -2e+116) {
tmp = c0 * (Math.sqrt((1.0 / l)) * Math.sqrt((A / V)));
} else if ((V * l) <= -1e-103) {
tmp = c0 * Math.sqrt((A * t_0));
} else if ((V * l) <= 1e-289) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(t_0));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = (1.0 / V) / l tmp = 0 if (V * l) <= -2e+116: tmp = c0 * (math.sqrt((1.0 / l)) * math.sqrt((A / V))) elif (V * l) <= -1e-103: tmp = c0 * math.sqrt((A * t_0)) elif (V * l) <= 1e-289: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) else: tmp = c0 * (math.sqrt(A) * math.sqrt(t_0)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(Float64(1.0 / V) / l) tmp = 0.0 if (Float64(V * l) <= -2e+116) tmp = Float64(c0 * Float64(sqrt(Float64(1.0 / l)) * sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -1e-103) tmp = Float64(c0 * sqrt(Float64(A * t_0))); elseif (Float64(V * l) <= 1e-289) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); else tmp = Float64(c0 * Float64(sqrt(A) * 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 = (1.0 / V) / l;
tmp = 0.0;
if ((V * l) <= -2e+116)
tmp = c0 * (sqrt((1.0 / l)) * sqrt((A / V)));
elseif ((V * l) <= -1e-103)
tmp = c0 * sqrt((A * t_0));
elseif ((V * l) <= 1e-289)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
else
tmp = c0 * (sqrt(A) * 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[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+116], N[(c0 * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-103], N[(c0 * N[Sqrt[N[(A * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-289], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{\frac{1}{V}}{\ell}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+116}:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{1}{\ell}} \cdot \sqrt{\frac{A}{V}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-103}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot t\_0}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-289}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{t\_0}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000003e116Initial program 55.2%
pow1/255.2%
associate-/r*66.1%
div-inv66.1%
unpow-prod-down47.4%
pow1/247.4%
Applied egg-rr47.4%
unpow1/247.4%
Simplified47.4%
if -2.00000000000000003e116 < (*.f64 V l) < -9.99999999999999958e-104Initial program 95.2%
clear-num93.2%
associate-/r/95.3%
associate-/r*95.3%
Applied egg-rr95.3%
if -9.99999999999999958e-104 < (*.f64 V l) < 1e-289Initial program 59.0%
*-un-lft-identity59.0%
times-frac70.6%
Applied egg-rr70.6%
frac-times59.0%
*-un-lft-identity59.0%
sqrt-undiv11.4%
clear-num11.4%
un-div-inv11.4%
sqrt-undiv59.0%
associate-/l*70.7%
Applied egg-rr70.7%
associate-*r/59.0%
associate-*l/72.3%
*-commutative72.3%
Simplified72.3%
*-commutative72.3%
sqrt-prod42.2%
Applied egg-rr42.2%
if 1e-289 < (*.f64 V l) Initial program 79.6%
pow1/279.6%
div-inv79.6%
unpow-prod-down91.1%
pow1/291.1%
associate-/r*92.4%
Applied egg-rr92.4%
unpow1/292.4%
Simplified92.4%
Final simplification75.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* c0 (* (sqrt (/ 1.0 l)) (sqrt (/ A V))))
(if (<= (* V l) -1e-215)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* l (/ V A))))
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((1.0 / l)) * sqrt((A / V)));
} else if ((V * l) <= -1e-215) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt((l * (V / A)));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((1.0 / l)) * Math.sqrt((A / V)));
} else if ((V * l) <= -1e-215) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (math.sqrt((1.0 / l)) * math.sqrt((A / V))) elif (V * l) <= -1e-215: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 / math.sqrt((l * (V / A))) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / 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) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(1.0 / l)) * sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -1e-215) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / 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) <= -Inf)
tmp = c0 * (sqrt((1.0 / l)) * sqrt((A / V)));
elseif ((V * l) <= -1e-215)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt((l * (V / A)));
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-215], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / 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 -\infty:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{1}{\ell}} \cdot \sqrt{\frac{A}{V}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-215}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 21.6%
pow1/221.6%
associate-/r*45.4%
div-inv45.4%
unpow-prod-down35.2%
pow1/235.2%
Applied egg-rr35.2%
unpow1/235.2%
Simplified35.2%
if -inf.0 < (*.f64 V l) < -1.00000000000000004e-215Initial program 87.8%
frac-2neg87.8%
sqrt-div99.3%
distribute-rgt-neg-in99.3%
Applied egg-rr99.3%
distribute-rgt-neg-out99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Simplified99.3%
if -1.00000000000000004e-215 < (*.f64 V l) < -0.0Initial program 54.4%
*-un-lft-identity54.4%
times-frac78.8%
Applied egg-rr78.8%
frac-times54.4%
*-un-lft-identity54.4%
sqrt-undiv12.0%
clear-num12.0%
un-div-inv12.0%
sqrt-undiv54.4%
associate-/l*78.9%
Applied egg-rr78.9%
associate-*r/54.4%
associate-*l/78.9%
*-commutative78.9%
Simplified78.9%
if -0.0 < (*.f64 V l) Initial program 77.8%
pow1/277.8%
div-inv77.7%
unpow-prod-down89.8%
pow1/289.8%
associate-/r*91.0%
Applied egg-rr91.0%
unpow1/291.0%
Simplified91.0%
Final simplification88.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 (- V)) (sqrt (/ A (- l)))))))
(if (<= (* V l) (- INFINITY))
t_0
(if (<= (* V l) -2e-213)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0) t_0 (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 / (sqrt(-V) / sqrt((A / -l)));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((V * l) <= -2e-213) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
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(-V) / Math.sqrt((A / -l)));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if ((V * l) <= -2e-213) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 / (math.sqrt(-V) / math.sqrt((A / -l))) tmp = 0 if (V * l) <= -math.inf: tmp = t_0 elif (V * l) <= -2e-213: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = t_0 else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 / Float64(sqrt(Float64(-V)) / sqrt(Float64(A / Float64(-l))))) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = t_0; elseif (Float64(V * l) <= -2e-213) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = t_0; else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 / (sqrt(-V) / sqrt((A / -l)));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = t_0;
elseif ((V * l) <= -2e-213)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 / N[(N[Sqrt[(-V)], $MachinePrecision] / N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-213], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0}{\frac{\sqrt{-V}}{\sqrt{\frac{A}{-\ell}}}}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-213}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or -1.9999999999999999e-213 < (*.f64 V l) < -0.0Initial program 43.5%
*-un-lft-identity43.5%
times-frac67.3%
Applied egg-rr67.3%
frac-times43.5%
*-un-lft-identity43.5%
sqrt-undiv8.1%
clear-num8.1%
un-div-inv8.1%
sqrt-undiv43.5%
associate-/l*67.4%
Applied egg-rr67.4%
associate-*r/43.5%
associate-*l/67.4%
*-commutative67.4%
Simplified67.4%
associate-*r/43.5%
frac-2neg43.5%
distribute-rgt-neg-out43.5%
*-commutative43.5%
distribute-lft-neg-out43.5%
frac-2neg43.5%
associate-*r/67.4%
clear-num67.3%
un-div-inv67.4%
Applied egg-rr67.4%
frac-2neg67.4%
sqrt-div41.7%
distribute-neg-frac241.7%
Applied egg-rr41.7%
if -inf.0 < (*.f64 V l) < -1.9999999999999999e-213Initial program 88.8%
frac-2neg88.8%
sqrt-div99.3%
distribute-rgt-neg-in99.3%
Applied egg-rr99.3%
distribute-rgt-neg-out99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Simplified99.3%
if -0.0 < (*.f64 V l) Initial program 77.8%
pow1/277.8%
div-inv77.7%
unpow-prod-down89.8%
pow1/289.8%
associate-/r*91.0%
Applied egg-rr91.0%
unpow1/291.0%
Simplified91.0%
Final simplification83.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -5e+123)
(/ (sqrt (/ A V)) (/ (sqrt l) c0))
(if (<= (* V l) -1e-103)
(* c0 (sqrt (* A (/ (/ 1.0 V) l))))
(if (<= (* V l) 0.0)
(/ c0 (* (sqrt l) (sqrt (/ V 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) <= -5e+123) {
tmp = sqrt((A / V)) / (sqrt(l) / c0);
} else if ((V * l) <= -1e-103) {
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) * sqrt((V / 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) <= (-5d+123)) then
tmp = sqrt((a / v)) / (sqrt(l) / c0)
else if ((v * l) <= (-1d-103)) then
tmp = c0 * sqrt((a * ((1.0d0 / v) / l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt(l) * sqrt((v / 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) <= -5e+123) {
tmp = Math.sqrt((A / V)) / (Math.sqrt(l) / c0);
} else if ((V * l) <= -1e-103) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / 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) <= -5e+123: tmp = math.sqrt((A / V)) / (math.sqrt(l) / c0) elif (V * l) <= -1e-103: tmp = c0 * math.sqrt((A * ((1.0 / V) / l))) elif (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) * math.sqrt((V / 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) <= -5e+123) tmp = Float64(sqrt(Float64(A / V)) / Float64(sqrt(l) / c0)); elseif (Float64(V * l) <= -1e-103) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / 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) <= -5e+123)
tmp = sqrt((A / V)) / (sqrt(l) / c0);
elseif ((V * l) <= -1e-103)
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
elseif ((V * l) <= 0.0)
tmp = c0 / (sqrt(l) * sqrt((V / 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], -5e+123], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-103], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / 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 -5 \cdot 10^{+123}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-103}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.99999999999999974e123Initial program 53.9%
*-un-lft-identity53.9%
times-frac62.9%
Applied egg-rr62.9%
frac-times53.9%
*-un-lft-identity53.9%
sqrt-undiv0.0%
clear-num0.0%
un-div-inv0.0%
sqrt-undiv51.7%
associate-/l*60.3%
Applied egg-rr60.3%
associate-*r/51.7%
associate-*l/63.0%
*-commutative63.0%
Simplified63.0%
associate-*r/51.7%
frac-2neg51.7%
distribute-rgt-neg-out51.7%
sqrt-undiv62.9%
un-div-inv62.9%
clear-num62.9%
associate-*r/60.0%
sqrt-prod49.8%
times-frac52.6%
sqrt-div45.8%
frac-2neg45.8%
Applied egg-rr45.8%
*-commutative45.8%
clear-num45.9%
un-div-inv46.0%
Applied egg-rr46.0%
if -4.99999999999999974e123 < (*.f64 V l) < -9.99999999999999958e-104Initial program 95.3%
clear-num93.4%
associate-/r/95.4%
associate-/r*95.4%
Applied egg-rr95.4%
if -9.99999999999999958e-104 < (*.f64 V l) < -0.0Initial program 61.9%
*-un-lft-identity61.9%
times-frac74.2%
Applied egg-rr74.2%
frac-times61.9%
*-un-lft-identity61.9%
sqrt-undiv7.7%
clear-num7.7%
un-div-inv7.7%
sqrt-undiv61.9%
associate-/l*74.3%
Applied egg-rr74.3%
associate-*r/61.9%
associate-*l/75.9%
*-commutative75.9%
Simplified75.9%
*-commutative75.9%
sqrt-prod39.2%
Applied egg-rr39.2%
if -0.0 < (*.f64 V l) Initial program 77.8%
sqrt-div91.0%
div-inv90.8%
Applied egg-rr90.8%
associate-*r/91.0%
*-rgt-identity91.0%
Simplified91.0%
Final simplification74.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -4e-101)
(* c0 (sqrt (* A (/ (/ 1.0 V) l))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (* l (/ V 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-101) {
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt((l * (V / 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-101)) then
tmp = c0 * sqrt((a * ((1.0d0 / v) / l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / sqrt((l * (v / 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-101) {
tmp = c0 * Math.sqrt((A * ((1.0 / V) / l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt((l * (V / 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-101: tmp = c0 * math.sqrt((A * ((1.0 / V) / l))) elif (V * l) <= 0.0: tmp = c0 / math.sqrt((l * (V / 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-101) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / V) / l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / 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-101)
tmp = c0 * sqrt((A * ((1.0 / V) / l)));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt((l * (V / 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-101], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(l * N[(V / 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^{-101}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.00000000000000021e-101Initial program 77.4%
clear-num75.4%
associate-/r/77.5%
associate-/r*78.2%
Applied egg-rr78.2%
if -4.00000000000000021e-101 < (*.f64 V l) < -0.0Initial program 62.6%
*-un-lft-identity62.6%
times-frac72.9%
Applied egg-rr72.9%
frac-times62.6%
*-un-lft-identity62.6%
sqrt-undiv7.6%
clear-num7.6%
un-div-inv7.6%
sqrt-undiv62.6%
associate-/l*73.0%
Applied egg-rr73.0%
associate-*r/62.6%
associate-*l/76.4%
*-commutative76.4%
Simplified76.4%
if -0.0 < (*.f64 V l) Initial program 77.8%
sqrt-div91.0%
div-inv90.8%
Applied egg-rr90.8%
associate-*r/91.0%
*-rgt-identity91.0%
Simplified91.0%
Final simplification83.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 (<= A -1e-309) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (* 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 (A <= -1e-309) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} 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 (a <= (-1d-309)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
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 (A <= -1e-309) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} 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 A <= -1e-309: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) 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 (A <= -1e-309) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); 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 (A <= -1e-309)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
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[A, -1e-309], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $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}\;A \leq -1 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -1.000000000000002e-309Initial program 73.4%
associate-/r*71.8%
sqrt-div43.5%
div-inv43.5%
Applied egg-rr43.5%
associate-*r/43.5%
*-rgt-identity43.5%
Simplified43.5%
if -1.000000000000002e-309 < A Initial program 75.1%
sqrt-div87.3%
div-inv87.1%
Applied egg-rr87.1%
associate-*r/87.3%
*-rgt-identity87.3%
Simplified87.3%
Final simplification65.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 (<= A -1e-309) (/ c0 (* (sqrt l) (sqrt (/ V 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 (A <= -1e-309) {
tmp = c0 / (sqrt(l) * sqrt((V / 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 (a <= (-1d-309)) then
tmp = c0 / (sqrt(l) * sqrt((v / 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 (A <= -1e-309) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / 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 A <= -1e-309: tmp = c0 / (math.sqrt(l) * math.sqrt((V / 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 (A <= -1e-309) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / 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 (A <= -1e-309)
tmp = c0 / (sqrt(l) * sqrt((V / 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[A, -1e-309], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / 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}\;A \leq -1 \cdot 10^{-309}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -1.000000000000002e-309Initial program 73.4%
*-un-lft-identity73.4%
times-frac71.5%
Applied egg-rr71.5%
frac-times73.4%
*-un-lft-identity73.4%
sqrt-undiv0.0%
clear-num0.0%
un-div-inv0.0%
sqrt-undiv72.7%
associate-/l*70.1%
Applied egg-rr70.1%
associate-*r/72.7%
associate-*l/71.3%
*-commutative71.3%
Simplified71.3%
*-commutative71.3%
sqrt-prod43.8%
Applied egg-rr43.8%
if -1.000000000000002e-309 < A Initial program 75.1%
sqrt-div87.3%
div-inv87.1%
Applied egg-rr87.1%
associate-*r/87.3%
*-rgt-identity87.3%
Simplified87.3%
Final simplification65.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 1e-313) (not (<= t_0 5e+296)))
(* 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 <= 1e-313) || !(t_0 <= 5e+296)) {
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 <= 1d-313) .or. (.not. (t_0 <= 5d+296))) 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 <= 1e-313) || !(t_0 <= 5e+296)) {
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 <= 1e-313) or not (t_0 <= 5e+296): 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 <= 1e-313) || !(t_0 <= 5e+296)) 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 <= 1e-313) || ~((t_0 <= 5e+296)))
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, 1e-313], N[Not[LessEqual[t$95$0, 5e+296]], $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 10^{-313} \lor \neg \left(t\_0 \leq 5 \cdot 10^{+296}\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)) < 1.00000000001e-313 or 5.0000000000000001e296 < (/.f64 A (*.f64 V l)) Initial program 38.5%
*-commutative38.5%
associate-/l/53.0%
Simplified53.0%
if 1.00000000001e-313 < (/.f64 A (*.f64 V l)) < 5.0000000000000001e296Initial program 99.2%
Final simplification80.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 2e+292)))
(/ c0 (sqrt (* V (/ l A))))
(* 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+292)) {
tmp = c0 / sqrt((V * (l / A)));
} 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+292))) then
tmp = c0 / sqrt((v * (l / a)))
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+292)) {
tmp = c0 / Math.sqrt((V * (l / A)));
} 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+292): tmp = c0 / math.sqrt((V * (l / A))) 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+292)) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); 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+292)))
tmp = c0 / sqrt((V * (l / A)));
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+292]], $MachinePrecision]], N[(c0 / N[Sqrt[N[(V * N[(l / A), $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^{+292}\right):\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 2e292 < (/.f64 A (*.f64 V l)) Initial program 39.1%
*-un-lft-identity39.1%
times-frac53.7%
Applied egg-rr53.7%
frac-times39.1%
*-un-lft-identity39.1%
sqrt-undiv35.8%
clear-num35.8%
un-div-inv35.8%
sqrt-undiv39.6%
associate-/l*53.7%
Applied egg-rr53.7%
if 0.0 < (/.f64 A (*.f64 V l)) < 2e292Initial program 99.2%
Final simplification80.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 5e+296) (* 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 <= 5e+296) {
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 <= 5d+296) 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 <= 5e+296) {
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 <= 5e+296: 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 <= 5e+296) 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 <= 5e+296)
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, 5e+296], 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 5 \cdot 10^{+296}:\\
\;\;\;\;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 37.3%
*-un-lft-identity37.3%
times-frac49.7%
Applied egg-rr49.7%
frac-times37.3%
*-un-lft-identity37.3%
sqrt-undiv37.5%
clear-num37.5%
un-div-inv37.5%
sqrt-undiv37.3%
associate-/l*49.7%
Applied egg-rr49.7%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.0000000000000001e296Initial program 99.0%
if 5.0000000000000001e296 < (/.f64 A (*.f64 V l)) Initial program 38.9%
*-un-lft-identity38.9%
times-frac56.1%
Applied egg-rr56.1%
frac-times38.9%
*-un-lft-identity38.9%
sqrt-undiv35.4%
clear-num35.3%
un-div-inv35.3%
sqrt-undiv40.1%
associate-/l*56.1%
Applied egg-rr56.1%
associate-*r/40.1%
associate-*l/57.3%
*-commutative57.3%
Simplified57.3%
Final simplification80.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 (<= t_0 0.0)
(* c0 (pow (/ l (/ A V)) -0.5))
(if (<= t_0 5e+296) (* 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 * pow((l / (A / V)), -0.5);
} else if (t_0 <= 5e+296) {
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 * ((l / (a / v)) ** (-0.5d0))
else if (t_0 <= 5d+296) 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.pow((l / (A / V)), -0.5);
} else if (t_0 <= 5e+296) {
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.pow((l / (A / V)), -0.5) elif t_0 <= 5e+296: 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 * (Float64(l / Float64(A / V)) ^ -0.5)); elseif (t_0 <= 5e+296) 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 * ((l / (A / V)) ^ -0.5);
elseif (t_0 <= 5e+296)
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[Power[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+296], 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:\\
\;\;\;\;c0 \cdot {\left(\frac{\ell}{\frac{A}{V}}\right)}^{-0.5}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+296}:\\
\;\;\;\;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 37.3%
associate-/r*49.6%
sqrt-div36.9%
div-inv37.0%
Applied egg-rr37.0%
associate-*r/36.9%
*-rgt-identity36.9%
Simplified36.9%
clear-num37.0%
sqrt-undiv49.7%
un-div-inv49.6%
clear-num49.7%
pow1/249.7%
pow-flip49.7%
clear-num49.7%
un-div-inv49.7%
metadata-eval49.7%
Applied egg-rr49.7%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.0000000000000001e296Initial program 99.0%
if 5.0000000000000001e296 < (/.f64 A (*.f64 V l)) Initial program 38.9%
*-un-lft-identity38.9%
times-frac56.1%
Applied egg-rr56.1%
frac-times38.9%
*-un-lft-identity38.9%
sqrt-undiv35.4%
clear-num35.3%
un-div-inv35.3%
sqrt-undiv40.1%
associate-/l*56.1%
Applied egg-rr56.1%
associate-*r/40.1%
associate-*l/57.3%
*-commutative57.3%
Simplified57.3%
Final simplification80.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 74.3%
Final simplification74.3%
herbie shell --seed 2024112
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))