
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (- A))))
(if (<= (* V l) -2e+233)
(/ (* (/ t_0 (sqrt (- V))) c0) (sqrt l))
(if (<= (* V l) -1e-318)
(* c0 (/ t_0 (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0 (/ 1.0 (sqrt (* V (/ l A)))))
(if (<= (* V l) 5e+307)
(* c0 (* (pow (* V l) -0.5) (sqrt A)))
(* c0 (pow (* l (/ V A)) -0.5))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt(-A);
double tmp;
if ((V * l) <= -2e+233) {
tmp = ((t_0 / sqrt(-V)) * c0) / sqrt(l);
} else if ((V * l) <= -1e-318) {
tmp = c0 * (t_0 / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (1.0 / sqrt((V * (l / A))));
} else if ((V * l) <= 5e+307) {
tmp = c0 * (pow((V * l), -0.5) * sqrt(A));
} else {
tmp = c0 * pow((l * (V / A)), -0.5);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt(-a)
if ((v * l) <= (-2d+233)) then
tmp = ((t_0 / sqrt(-v)) * c0) / sqrt(l)
else if ((v * l) <= (-1d-318)) then
tmp = c0 * (t_0 / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 * (1.0d0 / sqrt((v * (l / a))))
else if ((v * l) <= 5d+307) then
tmp = c0 * (((v * l) ** (-0.5d0)) * sqrt(a))
else
tmp = c0 * ((l * (v / a)) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt(-A);
double tmp;
if ((V * l) <= -2e+233) {
tmp = ((t_0 / Math.sqrt(-V)) * c0) / Math.sqrt(l);
} else if ((V * l) <= -1e-318) {
tmp = c0 * (t_0 / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (1.0 / Math.sqrt((V * (l / A))));
} else if ((V * l) <= 5e+307) {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.sqrt(A));
} else {
tmp = c0 * Math.pow((l * (V / A)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt(-A) tmp = 0 if (V * l) <= -2e+233: tmp = ((t_0 / math.sqrt(-V)) * c0) / math.sqrt(l) elif (V * l) <= -1e-318: tmp = c0 * (t_0 / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 * (1.0 / math.sqrt((V * (l / A)))) elif (V * l) <= 5e+307: tmp = c0 * (math.pow((V * l), -0.5) * math.sqrt(A)) else: tmp = c0 * math.pow((l * (V / A)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(-A)) tmp = 0.0 if (Float64(V * l) <= -2e+233) tmp = Float64(Float64(Float64(t_0 / sqrt(Float64(-V))) * c0) / sqrt(l)); elseif (Float64(V * l) <= -1e-318) tmp = Float64(c0 * Float64(t_0 / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(1.0 / sqrt(Float64(V * Float64(l / A))))); elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * sqrt(A))); else tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt(-A);
tmp = 0.0;
if ((V * l) <= -2e+233)
tmp = ((t_0 / sqrt(-V)) * c0) / sqrt(l);
elseif ((V * l) <= -1e-318)
tmp = c0 * (t_0 / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 * (1.0 / sqrt((V * (l / A))));
elseif ((V * l) <= 5e+307)
tmp = c0 * (((V * l) ^ -0.5) * sqrt(A));
else
tmp = c0 * ((l * (V / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[(-A)], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+233], N[(N[(N[(t$95$0 / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * c0), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-318], N[(c0 * N[(t$95$0 / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(1.0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{-A}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+233}:\\
\;\;\;\;\frac{\frac{t\_0}{\sqrt{-V}} \cdot c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-318}:\\
\;\;\;\;c0 \cdot \frac{t\_0}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.99999999999999995e233Initial program 52.5%
*-commutative52.5%
associate-/r*52.5%
sqrt-div43.8%
associate-*l/44.0%
Applied egg-rr44.0%
frac-2neg44.0%
sqrt-div49.9%
Applied egg-rr49.9%
if -1.99999999999999995e233 < (*.f64 V l) < -9.9999875e-319Initial program 83.9%
frac-2neg83.9%
sqrt-div98.9%
distribute-rgt-neg-in98.9%
Applied egg-rr98.9%
distribute-rgt-neg-out98.9%
*-commutative98.9%
distribute-rgt-neg-in98.9%
Simplified98.9%
if -9.9999875e-319 < (*.f64 V l) < 0.0Initial program 50.8%
associate-/r*68.1%
clear-num68.1%
sqrt-div71.1%
metadata-eval71.1%
div-inv71.1%
clear-num71.1%
Applied egg-rr71.1%
*-commutative71.1%
associate-*l/50.8%
associate-/l*71.1%
Simplified71.1%
if 0.0 < (*.f64 V l) < 5e307Initial program 82.2%
associate-/r*77.5%
clear-num77.3%
sqrt-div77.8%
metadata-eval77.8%
div-inv77.8%
clear-num77.8%
Applied egg-rr77.8%
*-commutative77.8%
associate-*l/82.6%
associate-/l*75.3%
Simplified75.3%
associate-*r/82.6%
sqrt-div98.9%
associate-/r/98.9%
pow1/298.9%
pow-flip99.0%
metadata-eval99.0%
Applied egg-rr99.0%
if 5e307 < (*.f64 V l) Initial program 31.9%
associate-/r*79.1%
clear-num79.3%
sqrt-div79.3%
metadata-eval79.3%
div-inv79.1%
clear-num79.1%
Applied egg-rr79.1%
*-commutative79.1%
associate-*l/31.9%
associate-/l*79.2%
Simplified79.2%
pow1/279.2%
pow-flip79.2%
clear-num79.2%
un-div-inv79.1%
metadata-eval79.1%
Applied egg-rr79.1%
associate-/r/79.1%
Simplified79.1%
Final simplification91.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (or (<= t_0 0.0) (not (<= t_0 4e+290)))
(* c0 (sqrt (/ (/ A V) l)))
t_0)))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+290)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+290))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+290)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 4e+290): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 4e+290)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 4e+290)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+290]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 4 \cdot 10^{+290}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 4.00000000000000025e290 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 65.2%
associate-/r*71.4%
Simplified71.4%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.00000000000000025e290Initial program 98.2%
Final simplification77.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ (* c0 (sqrt (/ A V))) (sqrt l))))
(if (<= (* V l) -1e+227)
t_0
(if (<= (* V l) -1e-25)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 5e+307)
(* c0 (* (pow (* V l) -0.5) (sqrt A)))
(* c0 (pow (* l (/ V A)) -0.5))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = (c0 * sqrt((A / V))) / sqrt(l);
double tmp;
if ((V * l) <= -1e+227) {
tmp = t_0;
} else if ((V * l) <= -1e-25) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 5e+307) {
tmp = c0 * (pow((V * l), -0.5) * sqrt(A));
} else {
tmp = c0 * pow((l * (V / A)), -0.5);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = (c0 * sqrt((a / v))) / sqrt(l)
if ((v * l) <= (-1d+227)) then
tmp = t_0
else if ((v * l) <= (-1d-25)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 5d+307) then
tmp = c0 * (((v * l) ** (-0.5d0)) * sqrt(a))
else
tmp = c0 * ((l * (v / a)) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = (c0 * Math.sqrt((A / V))) / Math.sqrt(l);
double tmp;
if ((V * l) <= -1e+227) {
tmp = t_0;
} else if ((V * l) <= -1e-25) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 5e+307) {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.sqrt(A));
} else {
tmp = c0 * Math.pow((l * (V / A)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = (c0 * math.sqrt((A / V))) / math.sqrt(l) tmp = 0 if (V * l) <= -1e+227: tmp = t_0 elif (V * l) <= -1e-25: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 5e+307: tmp = c0 * (math.pow((V * l), -0.5) * math.sqrt(A)) else: tmp = c0 * math.pow((l * (V / A)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(Float64(c0 * sqrt(Float64(A / V))) / sqrt(l)) tmp = 0.0 if (Float64(V * l) <= -1e+227) tmp = t_0; elseif (Float64(V * l) <= -1e-25) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * sqrt(A))); else tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = (c0 * sqrt((A / V))) / sqrt(l);
tmp = 0.0;
if ((V * l) <= -1e+227)
tmp = t_0;
elseif ((V * l) <= -1e-25)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 5e+307)
tmp = c0 * (((V * l) ^ -0.5) * sqrt(A));
else
tmp = c0 * ((l * (V / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+227], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-25], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+227}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-25}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.0000000000000001e227 or -1.00000000000000004e-25 < (*.f64 V l) < 0.0Initial program 68.5%
*-commutative68.5%
associate-/r*73.6%
sqrt-div45.1%
associate-*l/45.2%
Applied egg-rr45.2%
if -1.0000000000000001e227 < (*.f64 V l) < -1.00000000000000004e-25Initial program 84.0%
if 0.0 < (*.f64 V l) < 5e307Initial program 82.2%
associate-/r*77.5%
clear-num77.3%
sqrt-div77.8%
metadata-eval77.8%
div-inv77.8%
clear-num77.8%
Applied egg-rr77.8%
*-commutative77.8%
associate-*l/82.6%
associate-/l*75.3%
Simplified75.3%
associate-*r/82.6%
sqrt-div98.9%
associate-/r/98.9%
pow1/298.9%
pow-flip99.0%
metadata-eval99.0%
Applied egg-rr99.0%
if 5e307 < (*.f64 V l) Initial program 31.9%
associate-/r*79.1%
clear-num79.3%
sqrt-div79.3%
metadata-eval79.3%
div-inv79.1%
clear-num79.1%
Applied egg-rr79.1%
*-commutative79.1%
associate-*l/31.9%
associate-/l*79.2%
Simplified79.2%
pow1/279.2%
pow-flip79.2%
clear-num79.2%
un-div-inv79.1%
metadata-eval79.1%
Applied egg-rr79.1%
associate-/r/79.1%
Simplified79.1%
Final simplification75.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 (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
(if (<= (* V l) -4e+241)
t_0
(if (<= (* V l) -1e-37)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 5e+307)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (pow (* l (/ V A)) -0.5))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -4e+241) {
tmp = t_0;
} else if ((V * l) <= -1e-37) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 5e+307) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * pow((l * (V / A)), -0.5);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-4d+241)) then
tmp = t_0
else if ((v * l) <= (-1d-37)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 5d+307) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * ((l * (v / a)) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -4e+241) {
tmp = t_0;
} else if ((V * l) <= -1e-37) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 5e+307) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.pow((l * (V / A)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -4e+241: tmp = t_0 elif (V * l) <= -1e-37: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 5e+307: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.pow((l * (V / A)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -4e+241) tmp = t_0; elseif (Float64(V * l) <= -1e-37) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -4e+241)
tmp = t_0;
elseif ((V * l) <= -1e-37)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 5e+307)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * ((l * (V / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -4e+241], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-37], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+241}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-37}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.0000000000000002e241 or -1.00000000000000007e-37 < (*.f64 V l) < 0.0Initial program 66.7%
associate-/r*72.1%
sqrt-div43.1%
div-inv43.1%
Applied egg-rr43.1%
associate-*r/43.1%
*-rgt-identity43.1%
Simplified43.1%
if -4.0000000000000002e241 < (*.f64 V l) < -1.00000000000000007e-37Initial program 85.6%
if 0.0 < (*.f64 V l) < 5e307Initial program 82.2%
sqrt-div98.9%
div-inv98.9%
Applied egg-rr98.9%
associate-*r/98.9%
*-rgt-identity98.9%
Simplified98.9%
if 5e307 < (*.f64 V l) Initial program 31.9%
associate-/r*79.1%
clear-num79.3%
sqrt-div79.3%
metadata-eval79.3%
div-inv79.1%
clear-num79.1%
Applied egg-rr79.1%
*-commutative79.1%
associate-*l/31.9%
associate-/l*79.2%
Simplified79.2%
pow1/279.2%
pow-flip79.2%
clear-num79.2%
un-div-inv79.1%
metadata-eval79.1%
Applied egg-rr79.1%
associate-/r/79.1%
Simplified79.1%
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 (sqrt (/ A V))))
(if (<= (* V l) -4e+241)
(* t_0 (/ c0 (sqrt l)))
(if (<= (* V l) -1e-37)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(* c0 (/ t_0 (sqrt l)))
(if (<= (* V l) 5e+307)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (pow (* l (/ V A)) -0.5))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -4e+241) {
tmp = t_0 * (c0 / sqrt(l));
} else if ((V * l) <= -1e-37) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (t_0 / sqrt(l));
} else if ((V * l) <= 5e+307) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * pow((l * (V / A)), -0.5);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-4d+241)) then
tmp = t_0 * (c0 / sqrt(l))
else if ((v * l) <= (-1d-37)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 * (t_0 / sqrt(l))
else if ((v * l) <= 5d+307) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * ((l * (v / a)) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -4e+241) {
tmp = t_0 * (c0 / Math.sqrt(l));
} else if ((V * l) <= -1e-37) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (t_0 / Math.sqrt(l));
} else if ((V * l) <= 5e+307) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.pow((l * (V / A)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -4e+241: tmp = t_0 * (c0 / math.sqrt(l)) elif (V * l) <= -1e-37: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = c0 * (t_0 / math.sqrt(l)) elif (V * l) <= 5e+307: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.pow((l * (V / A)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -4e+241) tmp = Float64(t_0 * Float64(c0 / sqrt(l))); elseif (Float64(V * l) <= -1e-37) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(t_0 / sqrt(l))); elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -4e+241)
tmp = t_0 * (c0 / sqrt(l));
elseif ((V * l) <= -1e-37)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 * (t_0 / sqrt(l));
elseif ((V * l) <= 5e+307)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * ((l * (V / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -4e+241], N[(t$95$0 * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-37], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+241}:\\
\;\;\;\;t\_0 \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-37}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{t\_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.0000000000000002e241Initial program 49.4%
associate-/r*49.4%
sqrt-div40.1%
associate-*r/40.3%
Applied egg-rr40.3%
*-commutative40.3%
associate-/l*40.2%
Simplified40.2%
if -4.0000000000000002e241 < (*.f64 V l) < -1.00000000000000007e-37Initial program 85.6%
if -1.00000000000000007e-37 < (*.f64 V l) < 0.0Initial program 70.4%
associate-/r*76.9%
sqrt-div43.8%
div-inv43.7%
Applied egg-rr43.7%
associate-*r/43.8%
*-rgt-identity43.8%
Simplified43.8%
if 0.0 < (*.f64 V l) < 5e307Initial program 82.2%
sqrt-div98.9%
div-inv98.9%
Applied egg-rr98.9%
associate-*r/98.9%
*-rgt-identity98.9%
Simplified98.9%
if 5e307 < (*.f64 V l) Initial program 31.9%
associate-/r*79.1%
clear-num79.3%
sqrt-div79.3%
metadata-eval79.3%
div-inv79.1%
clear-num79.1%
Applied egg-rr79.1%
*-commutative79.1%
associate-*l/31.9%
associate-/l*79.2%
Simplified79.2%
pow1/279.2%
pow-flip79.2%
clear-num79.2%
un-div-inv79.1%
metadata-eval79.1%
Applied egg-rr79.1%
associate-/r/79.1%
Simplified79.1%
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))) (sqrt l))))
(if (<= (* V l) -1e+227)
t_0
(if (<= (* V l) -1e-25)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 5e+307)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (pow (* l (/ V A)) -0.5))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = (c0 * sqrt((A / V))) / sqrt(l);
double tmp;
if ((V * l) <= -1e+227) {
tmp = t_0;
} else if ((V * l) <= -1e-25) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 5e+307) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * pow((l * (V / A)), -0.5);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = (c0 * sqrt((a / v))) / sqrt(l)
if ((v * l) <= (-1d+227)) then
tmp = t_0
else if ((v * l) <= (-1d-25)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 5d+307) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * ((l * (v / a)) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = (c0 * Math.sqrt((A / V))) / Math.sqrt(l);
double tmp;
if ((V * l) <= -1e+227) {
tmp = t_0;
} else if ((V * l) <= -1e-25) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 5e+307) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.pow((l * (V / A)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = (c0 * math.sqrt((A / V))) / math.sqrt(l) tmp = 0 if (V * l) <= -1e+227: tmp = t_0 elif (V * l) <= -1e-25: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 5e+307: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.pow((l * (V / A)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(Float64(c0 * sqrt(Float64(A / V))) / sqrt(l)) tmp = 0.0 if (Float64(V * l) <= -1e+227) tmp = t_0; elseif (Float64(V * l) <= -1e-25) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = (c0 * sqrt((A / V))) / sqrt(l);
tmp = 0.0;
if ((V * l) <= -1e+227)
tmp = t_0;
elseif ((V * l) <= -1e-25)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 5e+307)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * ((l * (V / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+227], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-25], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+227}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-25}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.0000000000000001e227 or -1.00000000000000004e-25 < (*.f64 V l) < 0.0Initial program 68.5%
*-commutative68.5%
associate-/r*73.6%
sqrt-div45.1%
associate-*l/45.2%
Applied egg-rr45.2%
if -1.0000000000000001e227 < (*.f64 V l) < -1.00000000000000004e-25Initial program 84.0%
if 0.0 < (*.f64 V l) < 5e307Initial program 82.2%
sqrt-div98.9%
div-inv98.9%
Applied egg-rr98.9%
associate-*r/98.9%
*-rgt-identity98.9%
Simplified98.9%
if 5e307 < (*.f64 V l) Initial program 31.9%
associate-/r*79.1%
clear-num79.3%
sqrt-div79.3%
metadata-eval79.3%
div-inv79.1%
clear-num79.1%
Applied egg-rr79.1%
*-commutative79.1%
associate-*l/31.9%
associate-/l*79.2%
Simplified79.2%
pow1/279.2%
pow-flip79.2%
clear-num79.2%
un-div-inv79.1%
metadata-eval79.1%
Applied egg-rr79.1%
associate-/r/79.1%
Simplified79.1%
Final simplification75.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) -1e-318)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0 (/ 1.0 (sqrt (* V (/ l A)))))
(if (<= (* V l) 5e+307)
(* c0 (* (pow (* V l) -0.5) (sqrt A)))
(* c0 (pow (* l (/ V A)) -0.5))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e-318) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (1.0 / sqrt((V * (l / A))));
} else if ((V * l) <= 5e+307) {
tmp = c0 * (pow((V * l), -0.5) * sqrt(A));
} else {
tmp = c0 * pow((l * (V / A)), -0.5);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-1d-318)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 * (1.0d0 / sqrt((v * (l / a))))
else if ((v * l) <= 5d+307) then
tmp = c0 * (((v * l) ** (-0.5d0)) * sqrt(a))
else
tmp = c0 * ((l * (v / a)) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e-318) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (1.0 / Math.sqrt((V * (l / A))));
} else if ((V * l) <= 5e+307) {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.sqrt(A));
} else {
tmp = c0 * Math.pow((l * (V / A)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e-318: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 * (1.0 / math.sqrt((V * (l / A)))) elif (V * l) <= 5e+307: tmp = c0 * (math.pow((V * l), -0.5) * math.sqrt(A)) else: tmp = c0 * math.pow((l * (V / A)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e-318) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(1.0 / sqrt(Float64(V * Float64(l / A))))); elseif (Float64(V * l) <= 5e+307) tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * sqrt(A))); else tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -1e-318)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 * (1.0 / sqrt((V * (l / A))));
elseif ((V * l) <= 5e+307)
tmp = c0 * (((V * l) ^ -0.5) * sqrt(A));
else
tmp = c0 * ((l * (V / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e-318], 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[(1.0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+307], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{-318}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+307}:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.9999875e-319Initial program 79.2%
frac-2neg79.2%
sqrt-div92.8%
distribute-rgt-neg-in92.8%
Applied egg-rr92.8%
distribute-rgt-neg-out92.8%
*-commutative92.8%
distribute-rgt-neg-in92.8%
Simplified92.8%
if -9.9999875e-319 < (*.f64 V l) < 0.0Initial program 50.8%
associate-/r*68.1%
clear-num68.1%
sqrt-div71.1%
metadata-eval71.1%
div-inv71.1%
clear-num71.1%
Applied egg-rr71.1%
*-commutative71.1%
associate-*l/50.8%
associate-/l*71.1%
Simplified71.1%
if 0.0 < (*.f64 V l) < 5e307Initial program 82.2%
associate-/r*77.5%
clear-num77.3%
sqrt-div77.8%
metadata-eval77.8%
div-inv77.8%
clear-num77.8%
Applied egg-rr77.8%
*-commutative77.8%
associate-*l/82.6%
associate-/l*75.3%
Simplified75.3%
associate-*r/82.6%
sqrt-div98.9%
associate-/r/98.9%
pow1/298.9%
pow-flip99.0%
metadata-eval99.0%
Applied egg-rr99.0%
if 5e307 < (*.f64 V l) Initial program 31.9%
associate-/r*79.1%
clear-num79.3%
sqrt-div79.3%
metadata-eval79.3%
div-inv79.1%
clear-num79.1%
Applied egg-rr79.1%
*-commutative79.1%
associate-*l/31.9%
associate-/l*79.2%
Simplified79.2%
pow1/279.2%
pow-flip79.2%
clear-num79.2%
un-div-inv79.1%
metadata-eval79.1%
Applied egg-rr79.1%
associate-/r/79.1%
Simplified79.1%
Final simplification91.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2e-105)
(* c0 (sqrt (/ A (* V l))))
(if (or (<= (* V l) 0.0) (not (<= (* V l) 5e+307)))
(* c0 (pow (* l (/ V A)) -0.5))
(* 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) <= -2e-105) {
tmp = c0 * sqrt((A / (V * l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 5e+307)) {
tmp = c0 * pow((l * (V / A)), -0.5);
} 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) <= (-2d-105)) then
tmp = c0 * sqrt((a / (v * l)))
else if (((v * l) <= 0.0d0) .or. (.not. ((v * l) <= 5d+307))) then
tmp = c0 * ((l * (v / a)) ** (-0.5d0))
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) <= -2e-105) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if (((V * l) <= 0.0) || !((V * l) <= 5e+307)) {
tmp = c0 * Math.pow((l * (V / A)), -0.5);
} 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) <= -2e-105: tmp = c0 * math.sqrt((A / (V * l))) elif ((V * l) <= 0.0) or not ((V * l) <= 5e+307): tmp = c0 * math.pow((l * (V / A)), -0.5) 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) <= -2e-105) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 5e+307)) tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5)); 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) <= -2e-105)
tmp = c0 * sqrt((A / (V * l)));
elseif (((V * l) <= 0.0) || ~(((V * l) <= 5e+307)))
tmp = c0 * ((l * (V / A)) ^ -0.5);
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], -2e-105], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 5e+307]], $MachinePrecision]], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $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 -2 \cdot 10^{-105}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 5 \cdot 10^{+307}\right):\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.99999999999999993e-105Initial program 80.3%
if -1.99999999999999993e-105 < (*.f64 V l) < 0.0 or 5e307 < (*.f64 V l) Initial program 54.0%
associate-/r*74.3%
clear-num74.3%
sqrt-div75.3%
metadata-eval75.3%
div-inv75.3%
clear-num75.3%
Applied egg-rr75.3%
*-commutative75.3%
associate-*l/54.0%
associate-/l*74.1%
Simplified74.1%
pow1/274.1%
pow-flip74.1%
clear-num74.1%
un-div-inv74.1%
metadata-eval74.1%
Applied egg-rr74.1%
associate-/r/75.3%
Simplified75.3%
if 0.0 < (*.f64 V l) < 5e307Initial program 82.2%
sqrt-div98.9%
div-inv98.9%
Applied egg-rr98.9%
associate-*r/98.9%
*-rgt-identity98.9%
Simplified98.9%
Final simplification85.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 (<= (* c0 (sqrt (/ A (* V l)))) 1e+54) (* c0 (sqrt (* (/ A V) (/ 1.0 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 ((c0 * sqrt((A / (V * l)))) <= 1e+54) {
tmp = c0 * sqrt(((A / V) * (1.0 / 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 ((c0 * sqrt((a / (v * l)))) <= 1d+54) then
tmp = c0 * sqrt(((a / v) * (1.0d0 / 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 ((c0 * Math.sqrt((A / (V * l)))) <= 1e+54) {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / 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 (c0 * math.sqrt((A / (V * l)))) <= 1e+54: tmp = c0 * math.sqrt(((A / V) * (1.0 / 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(c0 * sqrt(Float64(A / Float64(V * l)))) <= 1e+54) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / 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 ((c0 * sqrt((A / (V * l)))) <= 1e+54)
tmp = c0 * sqrt(((A / V) * (1.0 / 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[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1e+54], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / 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}\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 10^{+54}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.0000000000000001e54Initial program 72.7%
associate-/r*76.5%
div-inv76.5%
Applied egg-rr76.5%
if 1.0000000000000001e54 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 73.4%
associate-/r*73.4%
clear-num73.4%
sqrt-div76.6%
metadata-eval76.6%
div-inv76.6%
clear-num76.6%
Applied egg-rr76.6%
*-commutative76.6%
associate-*l/75.4%
associate-/l*77.6%
Simplified77.6%
un-div-inv77.6%
clear-num77.5%
clear-num76.1%
un-div-inv76.0%
Applied egg-rr76.0%
associate-/r/76.2%
associate-*l/76.1%
*-lft-identity76.1%
associate-/r/76.6%
associate-*l/75.4%
associate-/l*77.6%
Simplified77.6%
Final simplification76.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 (<= (* c0 (sqrt (/ A (* V l)))) 1e+54) (* c0 (sqrt (* (/ A V) (/ 1.0 l)))) (* c0 (/ 1.0 (sqrt (* V (/ l A)))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((c0 * sqrt((A / (V * l)))) <= 1e+54) {
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
} else {
tmp = c0 * (1.0 / 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 ((c0 * sqrt((a / (v * l)))) <= 1d+54) then
tmp = c0 * sqrt(((a / v) * (1.0d0 / l)))
else
tmp = c0 * (1.0d0 / 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 ((c0 * Math.sqrt((A / (V * l)))) <= 1e+54) {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / l)));
} else {
tmp = c0 * (1.0 / 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 (c0 * math.sqrt((A / (V * l)))) <= 1e+54: tmp = c0 * math.sqrt(((A / V) * (1.0 / l))) else: tmp = c0 * (1.0 / 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(c0 * sqrt(Float64(A / Float64(V * l)))) <= 1e+54) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / l)))); else tmp = Float64(c0 * Float64(1.0 / 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 ((c0 * sqrt((A / (V * l)))) <= 1e+54)
tmp = c0 * sqrt(((A / V) * (1.0 / l)));
else
tmp = c0 * (1.0 / 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[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1e+54], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(1.0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 10^{+54}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{1}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.0000000000000001e54Initial program 72.7%
associate-/r*76.5%
div-inv76.5%
Applied egg-rr76.5%
if 1.0000000000000001e54 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 73.4%
associate-/r*73.4%
clear-num73.4%
sqrt-div76.6%
metadata-eval76.6%
div-inv76.6%
clear-num76.6%
Applied egg-rr76.6%
*-commutative76.6%
associate-*l/75.4%
associate-/l*77.6%
Simplified77.6%
Final simplification76.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 (<= (* c0 (sqrt (/ A (* V l)))) 1e+54) (* c0 (sqrt (/ (/ A 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 ((c0 * sqrt((A / (V * l)))) <= 1e+54) {
tmp = c0 * sqrt(((A / 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 ((c0 * sqrt((a / (v * l)))) <= 1d+54) then
tmp = c0 * sqrt(((a / 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 ((c0 * Math.sqrt((A / (V * l)))) <= 1e+54) {
tmp = c0 * Math.sqrt(((A / 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 (c0 * math.sqrt((A / (V * l)))) <= 1e+54: tmp = c0 * math.sqrt(((A / 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(c0 * sqrt(Float64(A / Float64(V * l)))) <= 1e+54) tmp = Float64(c0 * sqrt(Float64(Float64(A / 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 ((c0 * sqrt((A / (V * l)))) <= 1e+54)
tmp = c0 * sqrt(((A / 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[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1e+54], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $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}\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}} \leq 10^{+54}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.0000000000000001e54Initial program 72.7%
associate-/r*76.5%
Simplified76.5%
if 1.0000000000000001e54 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 73.4%
associate-/r*73.4%
clear-num73.4%
sqrt-div76.6%
metadata-eval76.6%
div-inv76.6%
clear-num76.6%
Applied egg-rr76.6%
*-commutative76.6%
associate-*l/75.4%
associate-/l*77.6%
Simplified77.6%
un-div-inv77.6%
clear-num77.5%
clear-num76.1%
un-div-inv76.0%
Applied egg-rr76.0%
associate-/r/76.2%
associate-*l/76.1%
*-lft-identity76.1%
associate-/r/76.6%
associate-*l/75.4%
associate-/l*77.6%
Simplified77.6%
Final simplification76.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 72.9%
Final simplification72.9%
herbie shell --seed 2024040
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))