
(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 18 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))) (t_1 (sqrt (- V))))
(if (<= (* V l) -5e+221)
(* (/ t_0 t_1) (/ c0 (sqrt l)))
(if (<= (* V l) -5e-253)
(* c0 (/ t_0 (sqrt (* V (- l)))))
(if (<= (* V l) 2e-313)
(* c0 (/ (sqrt (/ A (- l))) t_1))
(if (<= (* V l) INFINITY)
(* c0 (* (pow (* V l) -0.5) (sqrt A)))
(* (sqrt (/ c0 V)) (sqrt (* A (/ c0 l))))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt(-A);
double t_1 = sqrt(-V);
double tmp;
if ((V * l) <= -5e+221) {
tmp = (t_0 / t_1) * (c0 / sqrt(l));
} else if ((V * l) <= -5e-253) {
tmp = c0 * (t_0 / sqrt((V * -l)));
} else if ((V * l) <= 2e-313) {
tmp = c0 * (sqrt((A / -l)) / t_1);
} else if ((V * l) <= ((double) INFINITY)) {
tmp = c0 * (pow((V * l), -0.5) * sqrt(A));
} else {
tmp = sqrt((c0 / V)) * sqrt((A * (c0 / 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 = Math.sqrt(-A);
double t_1 = Math.sqrt(-V);
double tmp;
if ((V * l) <= -5e+221) {
tmp = (t_0 / t_1) * (c0 / Math.sqrt(l));
} else if ((V * l) <= -5e-253) {
tmp = c0 * (t_0 / Math.sqrt((V * -l)));
} else if ((V * l) <= 2e-313) {
tmp = c0 * (Math.sqrt((A / -l)) / t_1);
} else if ((V * l) <= Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.sqrt(A));
} else {
tmp = Math.sqrt((c0 / V)) * Math.sqrt((A * (c0 / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt(-A) t_1 = math.sqrt(-V) tmp = 0 if (V * l) <= -5e+221: tmp = (t_0 / t_1) * (c0 / math.sqrt(l)) elif (V * l) <= -5e-253: tmp = c0 * (t_0 / math.sqrt((V * -l))) elif (V * l) <= 2e-313: tmp = c0 * (math.sqrt((A / -l)) / t_1) elif (V * l) <= math.inf: tmp = c0 * (math.pow((V * l), -0.5) * math.sqrt(A)) else: tmp = math.sqrt((c0 / V)) * math.sqrt((A * (c0 / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(-A)) t_1 = sqrt(Float64(-V)) tmp = 0.0 if (Float64(V * l) <= -5e+221) tmp = Float64(Float64(t_0 / t_1) * Float64(c0 / sqrt(l))); elseif (Float64(V * l) <= -5e-253) tmp = Float64(c0 * Float64(t_0 / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 2e-313) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / t_1)); elseif (Float64(V * l) <= Inf) tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * sqrt(A))); else tmp = Float64(sqrt(Float64(c0 / V)) * sqrt(Float64(A * Float64(c0 / 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 = sqrt(-A);
t_1 = sqrt(-V);
tmp = 0.0;
if ((V * l) <= -5e+221)
tmp = (t_0 / t_1) * (c0 / sqrt(l));
elseif ((V * l) <= -5e-253)
tmp = c0 * (t_0 / sqrt((V * -l)));
elseif ((V * l) <= 2e-313)
tmp = c0 * (sqrt((A / -l)) / t_1);
elseif ((V * l) <= Inf)
tmp = c0 * (((V * l) ^ -0.5) * sqrt(A));
else
tmp = sqrt((c0 / V)) * sqrt((A * (c0 / 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[Sqrt[(-A)], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-V)], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e+221], N[(N[(t$95$0 / t$95$1), $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-253], N[(c0 * N[(t$95$0 / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-313], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], Infinity], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(c0 / V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(A * N[(c0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{-A}\\
t_1 := \sqrt{-V}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+221}:\\
\;\;\;\;\frac{t\_0}{t\_1} \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-253}:\\
\;\;\;\;c0 \cdot \frac{t\_0}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-313}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{t\_1}\\
\mathbf{elif}\;V \cdot \ell \leq \infty:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{c0}{V}} \cdot \sqrt{A \cdot \frac{c0}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.0000000000000002e221Initial program 40.8%
associate-/r*63.7%
sqrt-div45.3%
associate-*r/45.5%
Applied egg-rr45.5%
*-commutative45.5%
associate-/l*45.3%
Simplified45.3%
frac-2neg45.5%
sqrt-div57.0%
Applied egg-rr56.8%
if -5.0000000000000002e221 < (*.f64 V l) < -4.99999999999999971e-253Initial program 86.1%
frac-2neg86.1%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -4.99999999999999971e-253 < (*.f64 V l) < 1.99999999998e-313Initial program 39.1%
associate-/r*60.6%
div-inv60.5%
div-inv60.5%
associate-*l*34.5%
Applied egg-rr34.5%
associate-*r*60.5%
div-inv60.5%
associate-*l/60.6%
div-inv60.7%
frac-2neg60.7%
sqrt-div50.0%
distribute-neg-frac250.0%
Applied egg-rr50.0%
distribute-frac-neg250.0%
distribute-frac-neg50.0%
Simplified50.0%
if 1.99999999998e-313 < (*.f64 V l) < +inf.0Initial program 78.2%
associate-/r*73.5%
div-inv73.4%
div-inv73.4%
associate-*l*78.3%
Applied egg-rr78.3%
*-commutative78.3%
sqrt-prod89.3%
frac-times88.3%
metadata-eval88.3%
sqrt-div88.2%
metadata-eval88.2%
pow1/288.2%
pow-flip88.3%
metadata-eval88.3%
Applied egg-rr88.3%
if +inf.0 < (*.f64 V l) Initial program 74.1%
associate-/r*73.1%
div-inv73.1%
div-inv73.1%
associate-*l*74.0%
Applied egg-rr74.0%
sqrt-prod48.7%
associate-*r*46.2%
frac-times45.7%
metadata-eval45.7%
sqrt-div45.7%
metadata-eval45.7%
div-inv45.7%
associate-*r/48.5%
clear-num48.4%
un-div-inv48.5%
sqrt-undiv74.1%
Applied egg-rr74.1%
Applied egg-rr18.8%
*-commutative18.8%
unpow1/218.8%
associate-*l/19.6%
associate-/l*19.3%
Simplified19.3%
Final simplification85.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 4e-305)
(/ c0 (sqrt (* V (/ l A))))
(if (<= t_0 2e+276) 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 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-305) {
tmp = c0 / sqrt((V * (l / A)));
} else if (t_0 <= 2e+276) {
tmp = 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 = c0 * sqrt((a / (v * l)))
if (t_0 <= 4d-305) then
tmp = c0 / sqrt((v * (l / a)))
else if (t_0 <= 2d+276) then
tmp = 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 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-305) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if (t_0 <= 2e+276) {
tmp = 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 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 4e-305: tmp = c0 / math.sqrt((V * (l / A))) elif t_0 <= 2e+276: tmp = 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(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 4e-305) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (t_0 <= 2e+276) tmp = 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 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 4e-305)
tmp = c0 / sqrt((V * (l / A)));
elseif (t_0 <= 2e+276)
tmp = 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[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-305], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+276], t$95$0, 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 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-305}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+276}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999999e-305Initial program 68.0%
associate-/r*69.7%
div-inv69.6%
div-inv69.6%
associate-*l*68.5%
Applied egg-rr68.5%
sqrt-prod50.4%
associate-*r*48.2%
frac-times47.4%
metadata-eval47.4%
sqrt-div47.4%
metadata-eval47.4%
div-inv47.4%
associate-*r/49.6%
clear-num49.6%
un-div-inv49.6%
sqrt-undiv67.3%
Applied egg-rr67.3%
associate-*r/64.8%
Simplified64.8%
if 3.99999999999999999e-305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000001e276Initial program 98.1%
if 2.0000000000000001e276 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 53.8%
associate-/r*60.7%
div-inv60.7%
div-inv60.7%
associate-*l*53.8%
Applied egg-rr53.8%
sqrt-prod45.2%
associate-*r*45.0%
frac-times44.9%
metadata-eval44.9%
sqrt-div45.0%
metadata-eval45.0%
div-inv44.9%
associate-*r/45.2%
clear-num45.2%
un-div-inv45.2%
sqrt-undiv57.4%
Applied egg-rr57.4%
associate-*l/62.7%
*-commutative62.7%
Simplified62.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 (sqrt (- V))))
(if (<= (* V l) -5e-193)
(/ (/ (sqrt (- A)) t_0) (/ (sqrt l) c0))
(if (<= (* V l) 2e-313)
(* c0 (/ (sqrt (/ A (- l))) t_0))
(if (<= (* V l) INFINITY)
(* c0 (* (pow (* V l) -0.5) (sqrt A)))
(* (sqrt (/ c0 V)) (sqrt (* A (/ c0 l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt(-V);
double tmp;
if ((V * l) <= -5e-193) {
tmp = (sqrt(-A) / t_0) / (sqrt(l) / c0);
} else if ((V * l) <= 2e-313) {
tmp = c0 * (sqrt((A / -l)) / t_0);
} else if ((V * l) <= ((double) INFINITY)) {
tmp = c0 * (pow((V * l), -0.5) * sqrt(A));
} else {
tmp = sqrt((c0 / V)) * sqrt((A * (c0 / 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 = Math.sqrt(-V);
double tmp;
if ((V * l) <= -5e-193) {
tmp = (Math.sqrt(-A) / t_0) / (Math.sqrt(l) / c0);
} else if ((V * l) <= 2e-313) {
tmp = c0 * (Math.sqrt((A / -l)) / t_0);
} else if ((V * l) <= Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.sqrt(A));
} else {
tmp = Math.sqrt((c0 / V)) * Math.sqrt((A * (c0 / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt(-V) tmp = 0 if (V * l) <= -5e-193: tmp = (math.sqrt(-A) / t_0) / (math.sqrt(l) / c0) elif (V * l) <= 2e-313: tmp = c0 * (math.sqrt((A / -l)) / t_0) elif (V * l) <= math.inf: tmp = c0 * (math.pow((V * l), -0.5) * math.sqrt(A)) else: tmp = math.sqrt((c0 / V)) * math.sqrt((A * (c0 / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(-V)) tmp = 0.0 if (Float64(V * l) <= -5e-193) tmp = Float64(Float64(sqrt(Float64(-A)) / t_0) / Float64(sqrt(l) / c0)); elseif (Float64(V * l) <= 2e-313) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / t_0)); elseif (Float64(V * l) <= Inf) tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * sqrt(A))); else tmp = Float64(sqrt(Float64(c0 / V)) * sqrt(Float64(A * Float64(c0 / 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 = sqrt(-V);
tmp = 0.0;
if ((V * l) <= -5e-193)
tmp = (sqrt(-A) / t_0) / (sqrt(l) / c0);
elseif ((V * l) <= 2e-313)
tmp = c0 * (sqrt((A / -l)) / t_0);
elseif ((V * l) <= Inf)
tmp = c0 * (((V * l) ^ -0.5) * sqrt(A));
else
tmp = sqrt((c0 / V)) * sqrt((A * (c0 / 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[Sqrt[(-V)], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -5e-193], N[(N[(N[Sqrt[(-A)], $MachinePrecision] / t$95$0), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-313], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], Infinity], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(c0 / V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(A * N[(c0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{-V}\\
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{-193}:\\
\;\;\;\;\frac{\frac{\sqrt{-A}}{t\_0}}{\frac{\sqrt{\ell}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-313}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{t\_0}\\
\mathbf{elif}\;V \cdot \ell \leq \infty:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{c0}{V}} \cdot \sqrt{A \cdot \frac{c0}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -5.0000000000000005e-193Initial program 76.7%
associate-/r*75.6%
div-inv75.6%
div-inv75.7%
associate-*l*77.4%
Applied egg-rr77.4%
sqrt-prod0.0%
associate-*r*0.0%
frac-times0.0%
metadata-eval0.0%
sqrt-div0.0%
metadata-eval0.0%
div-inv0.0%
*-commutative0.0%
sqrt-prod0.0%
frac-times0.0%
sqrt-div45.0%
*-commutative45.0%
clear-num45.0%
un-div-inv45.9%
Applied egg-rr45.9%
frac-2neg45.9%
sqrt-div54.6%
Applied egg-rr54.6%
if -5.0000000000000005e-193 < (*.f64 V l) < 1.99999999998e-313Initial program 47.1%
associate-/r*63.4%
div-inv63.4%
div-inv63.4%
associate-*l*43.6%
Applied egg-rr43.6%
associate-*r*63.4%
div-inv63.4%
associate-*l/63.4%
div-inv63.4%
frac-2neg63.4%
sqrt-div48.1%
distribute-neg-frac248.1%
Applied egg-rr48.1%
distribute-frac-neg248.1%
distribute-frac-neg48.1%
Simplified48.1%
if 1.99999999998e-313 < (*.f64 V l) < +inf.0Initial program 78.2%
associate-/r*73.5%
div-inv73.4%
div-inv73.4%
associate-*l*78.3%
Applied egg-rr78.3%
*-commutative78.3%
sqrt-prod89.3%
frac-times88.3%
metadata-eval88.3%
sqrt-div88.2%
metadata-eval88.2%
pow1/288.2%
pow-flip88.3%
metadata-eval88.3%
Applied egg-rr88.3%
if +inf.0 < (*.f64 V l) Initial program 74.1%
associate-/r*73.1%
div-inv73.1%
div-inv73.1%
associate-*l*74.0%
Applied egg-rr74.0%
sqrt-prod48.7%
associate-*r*46.2%
frac-times45.7%
metadata-eval45.7%
sqrt-div45.7%
metadata-eval45.7%
div-inv45.7%
associate-*r/48.5%
clear-num48.4%
un-div-inv48.5%
sqrt-undiv74.1%
Applied egg-rr74.1%
Applied egg-rr18.8%
*-commutative18.8%
unpow1/218.8%
associate-*l/19.6%
associate-/l*19.3%
Simplified19.3%
Final simplification71.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (/ (sqrt (/ A (- l))) (sqrt (- V))))))
(if (<= (* V l) (- INFINITY))
t_0
(if (<= (* V l) -5e-253)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 2e-313)
t_0
(if (<= (* V l) INFINITY)
(* c0 (* (pow (* V l) -0.5) (sqrt A)))
(* (sqrt (/ c0 V)) (sqrt (* A (/ c0 l))))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((A / -l)) / sqrt(-V));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((V * l) <= -5e-253) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 2e-313) {
tmp = t_0;
} else if ((V * l) <= ((double) INFINITY)) {
tmp = c0 * (pow((V * l), -0.5) * sqrt(A));
} else {
tmp = sqrt((c0 / V)) * sqrt((A * (c0 / 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((A / -l)) / Math.sqrt(-V));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if ((V * l) <= -5e-253) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 2e-313) {
tmp = t_0;
} else if ((V * l) <= Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.sqrt(A));
} else {
tmp = Math.sqrt((c0 / V)) * Math.sqrt((A * (c0 / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) tmp = 0 if (V * l) <= -math.inf: tmp = t_0 elif (V * l) <= -5e-253: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 2e-313: tmp = t_0 elif (V * l) <= math.inf: tmp = c0 * (math.pow((V * l), -0.5) * math.sqrt(A)) else: tmp = math.sqrt((c0 / V)) * math.sqrt((A * (c0 / 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(A / Float64(-l))) / sqrt(Float64(-V)))) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = t_0; elseif (Float64(V * l) <= -5e-253) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 2e-313) tmp = t_0; elseif (Float64(V * l) <= Inf) tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * sqrt(A))); else tmp = Float64(sqrt(Float64(c0 / V)) * sqrt(Float64(A * Float64(c0 / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * (sqrt((A / -l)) / sqrt(-V));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = t_0;
elseif ((V * l) <= -5e-253)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 2e-313)
tmp = t_0;
elseif ((V * l) <= Inf)
tmp = c0 * (((V * l) ^ -0.5) * sqrt(A));
else
tmp = sqrt((c0 / V)) * sqrt((A * (c0 / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-253], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-313], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], Infinity], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(c0 / V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(A * N[(c0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-253}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-313}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq \infty:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{c0}{V}} \cdot \sqrt{A \cdot \frac{c0}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or -4.99999999999999971e-253 < (*.f64 V l) < 1.99999999998e-313Initial program 37.0%
associate-/r*60.3%
div-inv60.3%
div-inv60.3%
associate-*l*36.3%
Applied egg-rr36.3%
associate-*r*60.3%
div-inv60.3%
associate-*l/60.3%
div-inv60.3%
frac-2neg60.3%
sqrt-div51.2%
distribute-neg-frac251.2%
Applied egg-rr51.2%
distribute-frac-neg251.2%
distribute-frac-neg51.2%
Simplified51.2%
if -inf.0 < (*.f64 V l) < -4.99999999999999971e-253Initial program 86.4%
frac-2neg86.4%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if 1.99999999998e-313 < (*.f64 V l) < +inf.0Initial program 78.2%
associate-/r*73.5%
div-inv73.4%
div-inv73.4%
associate-*l*78.3%
Applied egg-rr78.3%
*-commutative78.3%
sqrt-prod89.3%
frac-times88.3%
metadata-eval88.3%
sqrt-div88.2%
metadata-eval88.2%
pow1/288.2%
pow-flip88.3%
metadata-eval88.3%
Applied egg-rr88.3%
if +inf.0 < (*.f64 V l) Initial program 74.1%
associate-/r*73.1%
div-inv73.1%
div-inv73.1%
associate-*l*74.0%
Applied egg-rr74.0%
sqrt-prod48.7%
associate-*r*46.2%
frac-times45.7%
metadata-eval45.7%
sqrt-div45.7%
metadata-eval45.7%
div-inv45.7%
associate-*r/48.5%
clear-num48.4%
un-div-inv48.5%
sqrt-undiv74.1%
Applied egg-rr74.1%
Applied egg-rr18.8%
*-commutative18.8%
unpow1/218.8%
associate-*l/19.6%
associate-/l*19.3%
Simplified19.3%
Final simplification85.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -5e+221)
(/ (sqrt (/ A V)) (/ (sqrt l) c0))
(if (<= (* V l) -1e-322)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (or (<= (* V l) 0.0) (not (<= (* V l) INFINITY)))
(sqrt (* (/ A l) (* c0 (/ c0 V))))
(* c0 (* (pow (* V l) -0.5) (sqrt A)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+221) {
tmp = sqrt((A / V)) / (sqrt(l) / c0);
} else if ((V * l) <= -1e-322) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if (((V * l) <= 0.0) || !((V * l) <= ((double) INFINITY))) {
tmp = sqrt(((A / l) * (c0 * (c0 / V))));
} else {
tmp = c0 * (pow((V * l), -0.5) * sqrt(A));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+221) {
tmp = Math.sqrt((A / V)) / (Math.sqrt(l) / c0);
} else if ((V * l) <= -1e-322) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if (((V * l) <= 0.0) || !((V * l) <= Double.POSITIVE_INFINITY)) {
tmp = Math.sqrt(((A / l) * (c0 * (c0 / V))));
} else {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.sqrt(A));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e+221: tmp = math.sqrt((A / V)) / (math.sqrt(l) / c0) elif (V * l) <= -1e-322: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif ((V * l) <= 0.0) or not ((V * l) <= math.inf): tmp = math.sqrt(((A / l) * (c0 * (c0 / V)))) else: tmp = c0 * (math.pow((V * l), -0.5) * math.sqrt(A)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e+221) tmp = Float64(sqrt(Float64(A / V)) / Float64(sqrt(l) / c0)); elseif (Float64(V * l) <= -1e-322) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= Inf)) tmp = sqrt(Float64(Float64(A / l) * Float64(c0 * Float64(c0 / V)))); else tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * sqrt(A))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e+221)
tmp = sqrt((A / V)) / (sqrt(l) / c0);
elseif ((V * l) <= -1e-322)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif (((V * l) <= 0.0) || ~(((V * l) <= Inf)))
tmp = sqrt(((A / l) * (c0 * (c0 / V))));
else
tmp = c0 * (((V * l) ^ -0.5) * sqrt(A));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e+221], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-322], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], Infinity]], $MachinePrecision]], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0 * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+221}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-322}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq \infty\right):\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0 \cdot \frac{c0}{V}\right)}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -5.0000000000000002e221Initial program 40.8%
associate-/r*63.7%
div-inv63.7%
div-inv63.7%
associate-*l*44.1%
Applied egg-rr44.1%
sqrt-prod0.0%
associate-*r*0.0%
frac-times0.0%
metadata-eval0.0%
sqrt-div0.0%
metadata-eval0.0%
div-inv0.0%
*-commutative0.0%
sqrt-prod0.0%
frac-times0.0%
sqrt-div45.3%
*-commutative45.3%
clear-num45.4%
un-div-inv45.5%
Applied egg-rr45.5%
if -5.0000000000000002e221 < (*.f64 V l) < -9.88131e-323Initial program 85.5%
frac-2neg85.5%
sqrt-div98.6%
*-commutative98.6%
distribute-rgt-neg-in98.6%
Applied egg-rr98.6%
if -9.88131e-323 < (*.f64 V l) < 0.0 or +inf.0 < (*.f64 V l) Initial program 34.4%
add-sqr-sqrt1.5%
sqrt-unprod1.7%
*-commutative1.7%
*-commutative1.7%
swap-sqr0.9%
add-sqr-sqrt0.9%
pow20.9%
Applied egg-rr0.9%
associate-*l/0.7%
*-commutative0.7%
times-frac6.8%
Simplified6.8%
div-inv6.9%
unpow26.9%
associate-*l*12.3%
Applied egg-rr12.3%
Taylor expanded in c0 around 0 12.3%
if 0.0 < (*.f64 V l) < +inf.0Initial program 78.2%
associate-/r*73.7%
div-inv73.6%
div-inv73.6%
associate-*l*77.7%
Applied egg-rr77.7%
*-commutative77.7%
sqrt-prod88.6%
frac-times87.7%
metadata-eval87.7%
sqrt-div88.1%
metadata-eval88.1%
pow1/288.1%
pow-flip88.2%
metadata-eval88.2%
Applied egg-rr88.2%
Final simplification82.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2e+160)
(/ (sqrt (/ A V)) (/ (sqrt l) c0))
(if (<= (* V l) -1e-322)
(* c0 (sqrt (/ A (* V l))))
(if (or (<= (* V l) 0.0) (not (<= (* V l) INFINITY)))
(sqrt (* (/ A l) (* c0 (/ c0 V))))
(* c0 (* (pow (* V l) -0.5) (sqrt A)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+160) {
tmp = sqrt((A / V)) / (sqrt(l) / c0);
} else if ((V * l) <= -1e-322) {
tmp = c0 * sqrt((A / (V * l)));
} else if (((V * l) <= 0.0) || !((V * l) <= ((double) INFINITY))) {
tmp = sqrt(((A / l) * (c0 * (c0 / V))));
} else {
tmp = c0 * (pow((V * l), -0.5) * sqrt(A));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+160) {
tmp = Math.sqrt((A / V)) / (Math.sqrt(l) / c0);
} else if ((V * l) <= -1e-322) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if (((V * l) <= 0.0) || !((V * l) <= Double.POSITIVE_INFINITY)) {
tmp = Math.sqrt(((A / l) * (c0 * (c0 / V))));
} else {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.sqrt(A));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -2e+160: tmp = math.sqrt((A / V)) / (math.sqrt(l) / c0) elif (V * l) <= -1e-322: tmp = c0 * math.sqrt((A / (V * l))) elif ((V * l) <= 0.0) or not ((V * l) <= math.inf): tmp = math.sqrt(((A / l) * (c0 * (c0 / V)))) else: tmp = c0 * (math.pow((V * l), -0.5) * math.sqrt(A)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e+160) tmp = Float64(sqrt(Float64(A / V)) / Float64(sqrt(l) / c0)); elseif (Float64(V * l) <= -1e-322) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= Inf)) tmp = sqrt(Float64(Float64(A / l) * Float64(c0 * Float64(c0 / V)))); else tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * sqrt(A))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -2e+160)
tmp = sqrt((A / V)) / (sqrt(l) / c0);
elseif ((V * l) <= -1e-322)
tmp = c0 * sqrt((A / (V * l)));
elseif (((V * l) <= 0.0) || ~(((V * l) <= Inf)))
tmp = sqrt(((A / l) * (c0 * (c0 / V))));
else
tmp = c0 * (((V * l) ^ -0.5) * sqrt(A));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e+160], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-322], 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], Infinity]], $MachinePrecision]], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0 * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+160}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-322}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq \infty\right):\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0 \cdot \frac{c0}{V}\right)}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000001e160Initial program 50.5%
associate-/r*66.1%
div-inv66.1%
div-inv66.1%
associate-*l*52.8%
Applied egg-rr52.8%
sqrt-prod0.0%
associate-*r*0.0%
frac-times0.0%
metadata-eval0.0%
sqrt-div0.0%
metadata-eval0.0%
div-inv0.0%
*-commutative0.0%
sqrt-prod0.0%
frac-times0.0%
sqrt-div44.2%
*-commutative44.2%
clear-num44.2%
un-div-inv44.3%
Applied egg-rr44.3%
if -2.00000000000000001e160 < (*.f64 V l) < -9.88131e-323Initial program 87.7%
if -9.88131e-323 < (*.f64 V l) < 0.0 or +inf.0 < (*.f64 V l) Initial program 34.4%
add-sqr-sqrt1.5%
sqrt-unprod1.7%
*-commutative1.7%
*-commutative1.7%
swap-sqr0.9%
add-sqr-sqrt0.9%
pow20.9%
Applied egg-rr0.9%
associate-*l/0.7%
*-commutative0.7%
times-frac6.8%
Simplified6.8%
div-inv6.9%
unpow26.9%
associate-*l*12.3%
Applied egg-rr12.3%
Taylor expanded in c0 around 0 12.3%
if 0.0 < (*.f64 V l) < +inf.0Initial program 78.2%
associate-/r*73.7%
div-inv73.6%
div-inv73.6%
associate-*l*77.7%
Applied egg-rr77.7%
*-commutative77.7%
sqrt-prod88.6%
frac-times87.7%
metadata-eval87.7%
sqrt-div88.1%
metadata-eval88.1%
pow1/288.1%
pow-flip88.2%
metadata-eval88.2%
Applied egg-rr88.2%
Final simplification77.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 (- l))) (sqrt (- V))))))
(if (<= (* V l) (- INFINITY))
t_0
(if (<= (* V l) -5e-253)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 2e-313)
t_0
(if (<= (* V l) INFINITY)
(* c0 (* (pow (* V l) -0.5) (sqrt A)))
(sqrt (* (/ A l) (* c0 (/ c0 V))))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((A / -l)) / sqrt(-V));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((V * l) <= -5e-253) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 2e-313) {
tmp = t_0;
} else if ((V * l) <= ((double) INFINITY)) {
tmp = c0 * (pow((V * l), -0.5) * sqrt(A));
} else {
tmp = sqrt(((A / l) * (c0 * (c0 / V))));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * (Math.sqrt((A / -l)) / Math.sqrt(-V));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if ((V * l) <= -5e-253) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 2e-313) {
tmp = t_0;
} else if ((V * l) <= Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.pow((V * l), -0.5) * Math.sqrt(A));
} else {
tmp = Math.sqrt(((A / l) * (c0 * (c0 / V))));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) tmp = 0 if (V * l) <= -math.inf: tmp = t_0 elif (V * l) <= -5e-253: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 2e-313: tmp = t_0 elif (V * l) <= math.inf: tmp = c0 * (math.pow((V * l), -0.5) * math.sqrt(A)) else: tmp = math.sqrt(((A / l) * (c0 * (c0 / V)))) 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 / Float64(-l))) / sqrt(Float64(-V)))) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = t_0; elseif (Float64(V * l) <= -5e-253) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 2e-313) tmp = t_0; elseif (Float64(V * l) <= Inf) tmp = Float64(c0 * Float64((Float64(V * l) ^ -0.5) * sqrt(A))); else tmp = sqrt(Float64(Float64(A / l) * Float64(c0 * Float64(c0 / V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * (sqrt((A / -l)) / sqrt(-V));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = t_0;
elseif ((V * l) <= -5e-253)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 2e-313)
tmp = t_0;
elseif ((V * l) <= Inf)
tmp = c0 * (((V * l) ^ -0.5) * sqrt(A));
else
tmp = sqrt(((A / l) * (c0 * (c0 / V))));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-253], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-313], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], Infinity], N[(c0 * N[(N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision] * N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0 * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-253}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-313}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq \infty:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \ell\right)}^{-0.5} \cdot \sqrt{A}\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0 \cdot \frac{c0}{V}\right)}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or -4.99999999999999971e-253 < (*.f64 V l) < 1.99999999998e-313Initial program 37.0%
associate-/r*60.3%
div-inv60.3%
div-inv60.3%
associate-*l*36.3%
Applied egg-rr36.3%
associate-*r*60.3%
div-inv60.3%
associate-*l/60.3%
div-inv60.3%
frac-2neg60.3%
sqrt-div51.2%
distribute-neg-frac251.2%
Applied egg-rr51.2%
distribute-frac-neg251.2%
distribute-frac-neg51.2%
Simplified51.2%
if -inf.0 < (*.f64 V l) < -4.99999999999999971e-253Initial program 86.4%
frac-2neg86.4%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if 1.99999999998e-313 < (*.f64 V l) < +inf.0Initial program 78.2%
associate-/r*73.5%
div-inv73.4%
div-inv73.4%
associate-*l*78.3%
Applied egg-rr78.3%
*-commutative78.3%
sqrt-prod89.3%
frac-times88.3%
metadata-eval88.3%
sqrt-div88.2%
metadata-eval88.2%
pow1/288.2%
pow-flip88.3%
metadata-eval88.3%
Applied egg-rr88.3%
if +inf.0 < (*.f64 V l) Initial program 74.1%
add-sqr-sqrt39.8%
sqrt-unprod30.1%
*-commutative30.1%
*-commutative30.1%
swap-sqr26.2%
add-sqr-sqrt26.3%
pow226.3%
Applied egg-rr26.3%
associate-*l/26.1%
*-commutative26.1%
times-frac25.8%
Simplified25.8%
div-inv25.8%
unpow225.8%
associate-*l*30.8%
Applied egg-rr30.8%
Taylor expanded in c0 around 0 30.8%
Final simplification85.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2e+160)
(/ (sqrt (/ A V)) (/ (sqrt l) c0))
(if (<= (* V l) -1e-322)
(* c0 (sqrt (/ A (* V l))))
(if (or (<= (* V l) 0.0) (not (<= (* V l) INFINITY)))
(sqrt (* (/ A l) (* c0 (/ c0 V))))
(* 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+160) {
tmp = sqrt((A / V)) / (sqrt(l) / c0);
} else if ((V * l) <= -1e-322) {
tmp = c0 * sqrt((A / (V * l)));
} else if (((V * l) <= 0.0) || !((V * l) <= ((double) INFINITY))) {
tmp = sqrt(((A / l) * (c0 * (c0 / V))));
} else {
tmp = c0 * (sqrt(A) / sqrt((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) <= -2e+160) {
tmp = Math.sqrt((A / V)) / (Math.sqrt(l) / c0);
} else if ((V * l) <= -1e-322) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if (((V * l) <= 0.0) || !((V * l) <= Double.POSITIVE_INFINITY)) {
tmp = Math.sqrt(((A / l) * (c0 * (c0 / V))));
} 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+160: tmp = math.sqrt((A / V)) / (math.sqrt(l) / c0) elif (V * l) <= -1e-322: tmp = c0 * math.sqrt((A / (V * l))) elif ((V * l) <= 0.0) or not ((V * l) <= math.inf): tmp = math.sqrt(((A / l) * (c0 * (c0 / V)))) 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+160) tmp = Float64(sqrt(Float64(A / V)) / Float64(sqrt(l) / c0)); elseif (Float64(V * l) <= -1e-322) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= Inf)) tmp = sqrt(Float64(Float64(A / l) * Float64(c0 * Float64(c0 / V)))); 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+160)
tmp = sqrt((A / V)) / (sqrt(l) / c0);
elseif ((V * l) <= -1e-322)
tmp = c0 * sqrt((A / (V * l)));
elseif (((V * l) <= 0.0) || ~(((V * l) <= Inf)))
tmp = sqrt(((A / l) * (c0 * (c0 / V))));
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+160], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-322], 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], Infinity]], $MachinePrecision]], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0 * N[(c0 / V), $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 -2 \cdot 10^{+160}:\\
\;\;\;\;\frac{\sqrt{\frac{A}{V}}}{\frac{\sqrt{\ell}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-322}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq \infty\right):\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0 \cdot \frac{c0}{V}\right)}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000001e160Initial program 50.5%
associate-/r*66.1%
div-inv66.1%
div-inv66.1%
associate-*l*52.8%
Applied egg-rr52.8%
sqrt-prod0.0%
associate-*r*0.0%
frac-times0.0%
metadata-eval0.0%
sqrt-div0.0%
metadata-eval0.0%
div-inv0.0%
*-commutative0.0%
sqrt-prod0.0%
frac-times0.0%
sqrt-div44.2%
*-commutative44.2%
clear-num44.2%
un-div-inv44.3%
Applied egg-rr44.3%
if -2.00000000000000001e160 < (*.f64 V l) < -9.88131e-323Initial program 87.7%
if -9.88131e-323 < (*.f64 V l) < 0.0 or +inf.0 < (*.f64 V l) Initial program 34.4%
add-sqr-sqrt1.5%
sqrt-unprod1.7%
*-commutative1.7%
*-commutative1.7%
swap-sqr0.9%
add-sqr-sqrt0.9%
pow20.9%
Applied egg-rr0.9%
associate-*l/0.7%
*-commutative0.7%
times-frac6.8%
Simplified6.8%
div-inv6.9%
unpow26.9%
associate-*l*12.3%
Applied egg-rr12.3%
Taylor expanded in c0 around 0 12.3%
if 0.0 < (*.f64 V l) < +inf.0Initial program 78.2%
sqrt-div88.2%
associate-*r/82.9%
Applied egg-rr82.9%
associate-/l*88.2%
Simplified88.2%
Final simplification77.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2e+160)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* V l) -1e-322)
(* c0 (sqrt (/ A (* V l))))
(if (or (<= (* V l) 0.0) (not (<= (* V l) INFINITY)))
(sqrt (* (/ A l) (* c0 (/ c0 V))))
(* 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+160) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((V * l) <= -1e-322) {
tmp = c0 * sqrt((A / (V * l)));
} else if (((V * l) <= 0.0) || !((V * l) <= ((double) INFINITY))) {
tmp = sqrt(((A / l) * (c0 * (c0 / V))));
} else {
tmp = c0 * (sqrt(A) / sqrt((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) <= -2e+160) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((V * l) <= -1e-322) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if (((V * l) <= 0.0) || !((V * l) <= Double.POSITIVE_INFINITY)) {
tmp = Math.sqrt(((A / l) * (c0 * (c0 / V))));
} 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+160: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) elif (V * l) <= -1e-322: tmp = c0 * math.sqrt((A / (V * l))) elif ((V * l) <= 0.0) or not ((V * l) <= math.inf): tmp = math.sqrt(((A / l) * (c0 * (c0 / V)))) 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+160) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(V * l) <= -1e-322) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= Inf)) tmp = sqrt(Float64(Float64(A / l) * Float64(c0 * Float64(c0 / V)))); 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+160)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
elseif ((V * l) <= -1e-322)
tmp = c0 * sqrt((A / (V * l)));
elseif (((V * l) <= 0.0) || ~(((V * l) <= Inf)))
tmp = sqrt(((A / l) * (c0 * (c0 / V))));
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+160], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-322], 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], Infinity]], $MachinePrecision]], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0 * N[(c0 / V), $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 -2 \cdot 10^{+160}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-322}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq \infty\right):\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0 \cdot \frac{c0}{V}\right)}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000001e160Initial program 50.5%
associate-/r*66.1%
sqrt-div44.2%
associate-*r/44.3%
Applied egg-rr44.3%
*-commutative44.3%
associate-/l*44.2%
Simplified44.2%
if -2.00000000000000001e160 < (*.f64 V l) < -9.88131e-323Initial program 87.7%
if -9.88131e-323 < (*.f64 V l) < 0.0 or +inf.0 < (*.f64 V l) Initial program 34.4%
add-sqr-sqrt1.5%
sqrt-unprod1.7%
*-commutative1.7%
*-commutative1.7%
swap-sqr0.9%
add-sqr-sqrt0.9%
pow20.9%
Applied egg-rr0.9%
associate-*l/0.7%
*-commutative0.7%
times-frac6.8%
Simplified6.8%
div-inv6.9%
unpow26.9%
associate-*l*12.3%
Applied egg-rr12.3%
Taylor expanded in c0 around 0 12.3%
if 0.0 < (*.f64 V l) < +inf.0Initial program 78.2%
sqrt-div88.2%
associate-*r/82.9%
Applied egg-rr82.9%
associate-/l*88.2%
Simplified88.2%
Final simplification77.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -1e+119)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -1e-322)
(* c0 (sqrt (/ A (* V l))))
(if (or (<= (* V l) 0.0) (not (<= (* V l) INFINITY)))
(sqrt (* (/ A l) (* c0 (/ c0 V))))
(* 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) <= -1e+119) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -1e-322) {
tmp = c0 * sqrt((A / (V * l)));
} else if (((V * l) <= 0.0) || !((V * l) <= ((double) INFINITY))) {
tmp = sqrt(((A / l) * (c0 * (c0 / V))));
} else {
tmp = c0 * (sqrt(A) / sqrt((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) <= -1e+119) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -1e-322) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if (((V * l) <= 0.0) || !((V * l) <= Double.POSITIVE_INFINITY)) {
tmp = Math.sqrt(((A / l) * (c0 * (c0 / V))));
} 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) <= -1e+119: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -1e-322: tmp = c0 * math.sqrt((A / (V * l))) elif ((V * l) <= 0.0) or not ((V * l) <= math.inf): tmp = math.sqrt(((A / l) * (c0 * (c0 / V)))) 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) <= -1e+119) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -1e-322) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= Inf)) tmp = sqrt(Float64(Float64(A / l) * Float64(c0 * Float64(c0 / V)))); 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) <= -1e+119)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -1e-322)
tmp = c0 * sqrt((A / (V * l)));
elseif (((V * l) <= 0.0) || ~(((V * l) <= Inf)))
tmp = sqrt(((A / l) * (c0 * (c0 / V))));
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], -1e+119], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-322], 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], Infinity]], $MachinePrecision]], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0 * N[(c0 / V), $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 -1 \cdot 10^{+119}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-322}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq \infty\right):\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0 \cdot \frac{c0}{V}\right)}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999944e118Initial program 56.2%
associate-/r*67.1%
sqrt-div44.8%
associate-*r/44.9%
Applied egg-rr44.9%
associate-/l*44.8%
Simplified44.8%
if -9.99999999999999944e118 < (*.f64 V l) < -9.88131e-323Initial program 86.9%
if -9.88131e-323 < (*.f64 V l) < 0.0 or +inf.0 < (*.f64 V l) Initial program 34.4%
add-sqr-sqrt1.5%
sqrt-unprod1.7%
*-commutative1.7%
*-commutative1.7%
swap-sqr0.9%
add-sqr-sqrt0.9%
pow20.9%
Applied egg-rr0.9%
associate-*l/0.7%
*-commutative0.7%
times-frac6.8%
Simplified6.8%
div-inv6.9%
unpow26.9%
associate-*l*12.3%
Applied egg-rr12.3%
Taylor expanded in c0 around 0 12.3%
if 0.0 < (*.f64 V l) < +inf.0Initial program 78.2%
sqrt-div88.2%
associate-*r/82.9%
Applied egg-rr82.9%
associate-/l*88.2%
Simplified88.2%
Final simplification76.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (* (/ A l) (* c0 (/ c0 V))))))
(if (<= (* V l) (- INFINITY))
t_0
(if (<= (* V l) -1e-322)
(/ c0 (sqrt (/ (* V l) A)))
(if (or (<= (* V l) 0.0) (not (<= (* V l) INFINITY)))
t_0
(* c0 (/ (sqrt A) (sqrt (* V l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt(((A / l) * (c0 * (c0 / V))));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((V * l) <= -1e-322) {
tmp = c0 / sqrt(((V * l) / A));
} else if (((V * l) <= 0.0) || !((V * l) <= ((double) INFINITY))) {
tmp = t_0;
} else {
tmp = c0 * (sqrt(A) / sqrt((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 = Math.sqrt(((A / l) * (c0 * (c0 / V))));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if ((V * l) <= -1e-322) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if (((V * l) <= 0.0) || !((V * l) <= Double.POSITIVE_INFINITY)) {
tmp = t_0;
} 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): t_0 = math.sqrt(((A / l) * (c0 * (c0 / V)))) tmp = 0 if (V * l) <= -math.inf: tmp = t_0 elif (V * l) <= -1e-322: tmp = c0 / math.sqrt(((V * l) / A)) elif ((V * l) <= 0.0) or not ((V * l) <= math.inf): tmp = t_0 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) t_0 = sqrt(Float64(Float64(A / l) * Float64(c0 * Float64(c0 / V)))) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = t_0; elseif (Float64(V * l) <= -1e-322) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= Inf)) tmp = t_0; 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)
t_0 = sqrt(((A / l) * (c0 * (c0 / V))));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = t_0;
elseif ((V * l) <= -1e-322)
tmp = c0 / sqrt(((V * l) / A));
elseif (((V * l) <= 0.0) || ~(((V * l) <= Inf)))
tmp = t_0;
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_] := Block[{t$95$0 = N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0 * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-322], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], Infinity]], $MachinePrecision]], t$95$0, 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}
t_0 := \sqrt{\frac{A}{\ell} \cdot \left(c0 \cdot \frac{c0}{V}\right)}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-322}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq \infty\right):\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or -9.88131e-323 < (*.f64 V l) < 0.0 or +inf.0 < (*.f64 V l) Initial program 34.6%
add-sqr-sqrt18.1%
sqrt-unprod18.2%
*-commutative18.2%
*-commutative18.2%
swap-sqr17.2%
add-sqr-sqrt17.2%
pow217.2%
Applied egg-rr17.2%
associate-*l/16.8%
*-commutative16.8%
times-frac25.3%
Simplified25.3%
div-inv25.4%
unpow225.4%
associate-*l*30.9%
Applied egg-rr30.9%
Taylor expanded in c0 around 0 30.9%
if -inf.0 < (*.f64 V l) < -9.88131e-323Initial program 85.9%
associate-/r*79.6%
div-inv79.6%
div-inv79.6%
associate-*l*85.5%
Applied egg-rr85.5%
sqrt-prod0.0%
associate-*r*0.0%
frac-times0.0%
metadata-eval0.0%
sqrt-div0.0%
metadata-eval0.0%
div-inv0.0%
associate-*r/0.0%
clear-num0.0%
un-div-inv0.0%
sqrt-undiv85.9%
Applied egg-rr85.9%
if 0.0 < (*.f64 V l) < +inf.0Initial program 78.2%
sqrt-div88.2%
associate-*r/82.9%
Applied egg-rr82.9%
associate-/l*88.2%
Simplified88.2%
Final simplification79.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (* c0 (sqrt (/ A (* V l)))))) (if (<= t_0 4e-305) (/ c0 (sqrt (* V (/ l A)))) t_0)))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-305) {
tmp = c0 / sqrt((V * (l / A)));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 4d-305) then
tmp = c0 / sqrt((v * (l / a)))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-305) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 4e-305: tmp = c0 / math.sqrt((V * (l / A))) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 4e-305) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 4e-305)
tmp = c0 / sqrt((V * (l / A)));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 4e-305], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-305}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999999e-305Initial program 68.0%
associate-/r*69.7%
div-inv69.6%
div-inv69.6%
associate-*l*68.5%
Applied egg-rr68.5%
sqrt-prod50.4%
associate-*r*48.2%
frac-times47.4%
metadata-eval47.4%
sqrt-div47.4%
metadata-eval47.4%
div-inv47.4%
associate-*r/49.6%
clear-num49.6%
un-div-inv49.6%
sqrt-undiv67.3%
Applied egg-rr67.3%
associate-*r/64.8%
Simplified64.8%
if 3.99999999999999999e-305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 85.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 (<= t_0 4e-305) (* c0 (sqrt (/ (/ A l) V))) t_0)))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-305) {
tmp = c0 * sqrt(((A / l) / V));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 4d-305) then
tmp = c0 * sqrt(((a / l) / v))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 4e-305) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 4e-305: tmp = c0 * math.sqrt(((A / l) / V)) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 4e-305) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 4e-305)
tmp = c0 * sqrt(((A / l) / V));
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[LessEqual[t$95$0, 4e-305], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 4 \cdot 10^{-305}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999999e-305Initial program 68.0%
Taylor expanded in c0 around 0 68.0%
*-commutative68.0%
associate-/r*65.3%
Simplified65.3%
if 3.99999999999999999e-305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 85.1%
Final simplification72.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 (* c0 (sqrt (/ A (* V l)))))) (if (<= t_0 4e-305) (* 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 <= 4e-305) {
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 <= 4d-305) 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 <= 4e-305) {
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 <= 4e-305: 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 <= 4e-305) 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 <= 4e-305)
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[LessEqual[t$95$0, 4e-305], 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 4 \cdot 10^{-305}:\\
\;\;\;\;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)))) < 3.99999999999999999e-305Initial program 68.0%
*-commutative68.0%
associate-/l/69.7%
Simplified69.7%
if 3.99999999999999999e-305 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 85.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 (/ A (* V l))))
(if (<= t_0 0.0)
(sqrt (* (/ A l) (* c0 (/ c0 V))))
(if (<= t_0 5e+295)
(* c0 (sqrt t_0))
(sqrt (* (/ A l) (* c0 (* c0 (/ 1.0 V)))))))))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 = sqrt(((A / l) * (c0 * (c0 / V))));
} else if (t_0 <= 5e+295) {
tmp = c0 * sqrt(t_0);
} else {
tmp = sqrt(((A / l) * (c0 * (c0 * (1.0 / V)))));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = sqrt(((a / l) * (c0 * (c0 / v))))
else if (t_0 <= 5d+295) then
tmp = c0 * sqrt(t_0)
else
tmp = sqrt(((a / l) * (c0 * (c0 * (1.0d0 / v)))))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = Math.sqrt(((A / l) * (c0 * (c0 / V))));
} else if (t_0 <= 5e+295) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = Math.sqrt(((A / l) * (c0 * (c0 * (1.0 / V)))));
}
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 = math.sqrt(((A / l) * (c0 * (c0 / V)))) elif t_0 <= 5e+295: tmp = c0 * math.sqrt(t_0) else: tmp = math.sqrt(((A / l) * (c0 * (c0 * (1.0 / V))))) 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 = sqrt(Float64(Float64(A / l) * Float64(c0 * Float64(c0 / V)))); elseif (t_0 <= 5e+295) tmp = Float64(c0 * sqrt(t_0)); else tmp = sqrt(Float64(Float64(A / l) * Float64(c0 * Float64(c0 * Float64(1.0 / V))))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = sqrt(((A / l) * (c0 * (c0 / V))));
elseif (t_0 <= 5e+295)
tmp = c0 * sqrt(t_0);
else
tmp = sqrt(((A / l) * (c0 * (c0 * (1.0 / V)))));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0 * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 5e+295], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0 * N[(c0 * N[(1.0 / V), $MachinePrecision]), $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:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0 \cdot \frac{c0}{V}\right)}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+295}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0 \cdot \left(c0 \cdot \frac{1}{V}\right)\right)}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 34.9%
add-sqr-sqrt34.9%
sqrt-unprod34.9%
*-commutative34.9%
*-commutative34.9%
swap-sqr33.8%
add-sqr-sqrt33.8%
pow233.8%
Applied egg-rr33.8%
associate-*l/35.2%
*-commutative35.2%
times-frac39.0%
Simplified39.0%
div-inv39.0%
unpow239.0%
associate-*l*44.6%
Applied egg-rr44.6%
Taylor expanded in c0 around 0 44.6%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.99999999999999991e295Initial program 98.6%
if 4.99999999999999991e295 < (/.f64 A (*.f64 V l)) Initial program 37.5%
add-sqr-sqrt17.5%
sqrt-unprod17.7%
*-commutative17.7%
*-commutative17.7%
swap-sqr17.1%
add-sqr-sqrt17.1%
pow217.1%
Applied egg-rr17.1%
associate-*l/20.9%
*-commutative20.9%
times-frac22.2%
Simplified22.2%
div-inv22.2%
unpow222.2%
associate-*l*31.3%
Applied egg-rr31.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 (or (<= t_0 0.0) (not (<= t_0 5e+295)))
(sqrt (* (/ A l) (* c0 (/ c0 V))))
(* c0 (sqrt t_0)))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+295)) {
tmp = sqrt(((A / l) * (c0 * (c0 / V))));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+295))) then
tmp = sqrt(((a / l) * (c0 * (c0 / v))))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+295)) {
tmp = Math.sqrt(((A / l) * (c0 * (c0 / V))));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+295): tmp = math.sqrt(((A / l) * (c0 * (c0 / V)))) else: tmp = c0 * math.sqrt(t_0) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 5e+295)) tmp = sqrt(Float64(Float64(A / l) * Float64(c0 * Float64(c0 / V)))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 5e+295)))
tmp = sqrt(((A / l) * (c0 * (c0 / V))));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+295]], $MachinePrecision]], N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(c0 * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+295}\right):\\
\;\;\;\;\sqrt{\frac{A}{\ell} \cdot \left(c0 \cdot \frac{c0}{V}\right)}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 4.99999999999999991e295 < (/.f64 A (*.f64 V l)) Initial program 36.0%
add-sqr-sqrt27.4%
sqrt-unprod27.5%
*-commutative27.5%
*-commutative27.5%
swap-sqr26.6%
add-sqr-sqrt26.6%
pow226.6%
Applied egg-rr26.6%
associate-*l/29.1%
*-commutative29.1%
times-frac31.8%
Simplified31.8%
div-inv31.8%
unpow231.8%
associate-*l*38.9%
Applied egg-rr38.9%
Taylor expanded in c0 around 0 38.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.99999999999999991e295Initial program 98.6%
Final simplification75.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= (/ A (* V l)) 5e-284) (* 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 ((A / (V * l)) <= 5e-284) {
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 ((a / (v * l)) <= 5d-284) 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 ((A / (V * l)) <= 5e-284) {
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 (A / (V * l)) <= 5e-284: 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(A / Float64(V * l)) <= 5e-284) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 / sqrt(Float64(Float64(V * 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 ((A / (V * l)) <= 5e-284)
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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision], 5e-284], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\frac{A}{V \cdot \ell} \leq 5 \cdot 10^{-284}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.99999999999999973e-284Initial program 39.1%
*-commutative39.1%
associate-/l/53.0%
Simplified53.0%
if 4.99999999999999973e-284 < (/.f64 A (*.f64 V l)) Initial program 85.3%
associate-/r*79.5%
div-inv79.5%
div-inv79.5%
associate-*l*84.7%
Applied egg-rr84.7%
sqrt-prod52.4%
associate-*r*49.1%
frac-times49.1%
metadata-eval49.1%
sqrt-div49.2%
metadata-eval49.2%
div-inv49.1%
associate-*r/52.8%
clear-num52.8%
un-div-inv52.8%
sqrt-undiv85.8%
Applied egg-rr85.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 74.1%
herbie shell --seed 2024163
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))