
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) (- INFINITY))
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* l V) -4e-318)
(/ c0 (/ (sqrt (/ l (/ -1.0 V))) (pow (- 0.0 A) 0.5)))
(if (<= (* l V) 2e-302)
(/ c0 (pow (/ (/ A l) V) -0.5))
(if (<= (* l V) 2e+271)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(/ 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 ((l * V) <= -((double) INFINITY)) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((l * V) <= -4e-318) {
tmp = c0 / (sqrt((l / (-1.0 / V))) / pow((0.0 - A), 0.5));
} else if ((l * V) <= 2e-302) {
tmp = c0 / pow(((A / l) / V), -0.5);
} else if ((l * V) <= 2e+271) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 / sqrt((V * (l / 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 ((l * V) <= -Double.POSITIVE_INFINITY) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((l * V) <= -4e-318) {
tmp = c0 / (Math.sqrt((l / (-1.0 / V))) / Math.pow((0.0 - A), 0.5));
} else if ((l * V) <= 2e-302) {
tmp = c0 / Math.pow(((A / l) / V), -0.5);
} else if ((l * V) <= 2e+271) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} 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 (l * V) <= -math.inf: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) elif (l * V) <= -4e-318: tmp = c0 / (math.sqrt((l / (-1.0 / V))) / math.pow((0.0 - A), 0.5)) elif (l * V) <= 2e-302: tmp = c0 / math.pow(((A / l) / V), -0.5) elif (l * V) <= 2e+271: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) 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(l * V) <= Float64(-Inf)) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(l * V) <= -4e-318) tmp = Float64(c0 / Float64(sqrt(Float64(l / Float64(-1.0 / V))) / (Float64(0.0 - A) ^ 0.5))); elseif (Float64(l * V) <= 2e-302) tmp = Float64(c0 / (Float64(Float64(A / l) / V) ^ -0.5)); elseif (Float64(l * V) <= 2e+271) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); 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 ((l * V) <= -Inf)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
elseif ((l * V) <= -4e-318)
tmp = c0 / (sqrt((l / (-1.0 / V))) / ((0.0 - A) ^ 0.5));
elseif ((l * V) <= 2e-302)
tmp = c0 / (((A / l) / V) ^ -0.5);
elseif ((l * V) <= 2e+271)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
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[(l * V), $MachinePrecision], (-Infinity)], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -4e-318], N[(c0 / N[(N[Sqrt[N[(l / N[(-1.0 / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Power[N[(0.0 - A), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 2e-302], N[(c0 / N[Power[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 2e+271], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $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}\;\ell \cdot V \leq -\infty:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;\ell \cdot V \leq -4 \cdot 10^{-318}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\frac{\ell}{\frac{-1}{V}}}}{{\left(0 - A\right)}^{0.5}}}\\
\mathbf{elif}\;\ell \cdot V \leq 2 \cdot 10^{-302}:\\
\;\;\;\;\frac{c0}{{\left(\frac{\frac{A}{\ell}}{V}\right)}^{-0.5}}\\
\mathbf{elif}\;\ell \cdot V \leq 2 \cdot 10^{+271}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 33.4%
*-commutativeN/A
associate-/r*N/A
sqrt-divN/A
associate-*l/N/A
associate-*r/N/A
*-lowering-*.f64N/A
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6439.3%
Applied egg-rr39.3%
metadata-evalN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6439.3%
Applied egg-rr39.3%
if -inf.0 < (*.f64 V l) < -3.9999999e-318Initial program 84.0%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6476.2%
Applied egg-rr76.2%
associate-/r/N/A
*-commutativeN/A
/-rgt-identityN/A
associate-/r/N/A
frac-2negN/A
associate-/r/N/A
associate-/r*N/A
sqrt-divN/A
pow1/2N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
frac-2negN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
neg-sub0N/A
--lowering--.f6498.9%
Applied egg-rr98.9%
if -3.9999999e-318 < (*.f64 V l) < 1.9999999999999999e-302Initial program 77.1%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6484.6%
Applied egg-rr84.6%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6484.6%
Applied egg-rr84.6%
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
div-invN/A
/-lowering-/.f6484.6%
Applied egg-rr84.6%
if 1.9999999999999999e-302 < (*.f64 V l) < 1.99999999999999991e271Initial program 76.6%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6499.5%
Applied egg-rr99.5%
if 1.99999999999999991e271 < (*.f64 V l) Initial program 62.4%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6483.2%
Applied egg-rr83.2%
clear-numN/A
associate-/r/N/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f6483.4%
Applied egg-rr83.4%
Final simplification91.0%
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 -5e-310) (* (* (/ c0 (sqrt l)) (pow (- 0.0 A) 0.5)) (sqrt (/ -1.0 V))) (* c0 (/ (sqrt A) (sqrt (* l V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = ((c0 / sqrt(l)) * pow((0.0 - A), 0.5)) * sqrt((-1.0 / V));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * 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) :: tmp
if (a <= (-5d-310)) then
tmp = ((c0 / sqrt(l)) * ((0.0d0 - a) ** 0.5d0)) * sqrt(((-1.0d0) / v))
else
tmp = c0 * (sqrt(a) / sqrt((l * 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 tmp;
if (A <= -5e-310) {
tmp = ((c0 / Math.sqrt(l)) * Math.pow((0.0 - A), 0.5)) * Math.sqrt((-1.0 / V));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = ((c0 / math.sqrt(l)) * math.pow((0.0 - A), 0.5)) * math.sqrt((-1.0 / V)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(Float64(Float64(c0 / sqrt(l)) * (Float64(0.0 - A) ^ 0.5)) * sqrt(Float64(-1.0 / V))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); 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 <= -5e-310)
tmp = ((c0 / sqrt(l)) * ((0.0 - A) ^ 0.5)) * sqrt((-1.0 / V));
else
tmp = c0 * (sqrt(A) / sqrt((l * 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_] := If[LessEqual[A, -5e-310], N[(N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Power[N[(0.0 - A), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(-1.0 / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\left(\frac{c0}{\sqrt{\ell}} \cdot {\left(0 - A\right)}^{0.5}\right) \cdot \sqrt{\frac{-1}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 73.0%
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
associate-*l/N/A
frac-2negN/A
sqrt-divN/A
pow1/2N/A
associate-*r/N/A
div-invN/A
pow-flipN/A
metadata-evalN/A
metadata-evalN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
pow1/2N/A
pow-lowering-pow.f64N/A
neg-sub0N/A
--lowering--.f64N/A
Applied egg-rr45.6%
if -4.999999999999985e-310 < A Initial program 75.1%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6491.0%
Applied egg-rr91.0%
Final simplification69.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) (- INFINITY))
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(if (<= (* l V) -4e-318)
(/ c0 (/ (sqrt (- 0.0 (* l V))) (sqrt (- 0.0 A))))
(if (<= (* l V) 2e-302)
(/ c0 (pow (/ (/ A l) V) -0.5))
(if (<= (* l V) 2e+271)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(/ 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 ((l * V) <= -((double) INFINITY)) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else if ((l * V) <= -4e-318) {
tmp = c0 / (sqrt((0.0 - (l * V))) / sqrt((0.0 - A)));
} else if ((l * V) <= 2e-302) {
tmp = c0 / pow(((A / l) / V), -0.5);
} else if ((l * V) <= 2e+271) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 / sqrt((V * (l / 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 ((l * V) <= -Double.POSITIVE_INFINITY) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else if ((l * V) <= -4e-318) {
tmp = c0 / (Math.sqrt((0.0 - (l * V))) / Math.sqrt((0.0 - A)));
} else if ((l * V) <= 2e-302) {
tmp = c0 / Math.pow(((A / l) / V), -0.5);
} else if ((l * V) <= 2e+271) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} 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 (l * V) <= -math.inf: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) elif (l * V) <= -4e-318: tmp = c0 / (math.sqrt((0.0 - (l * V))) / math.sqrt((0.0 - A))) elif (l * V) <= 2e-302: tmp = c0 / math.pow(((A / l) / V), -0.5) elif (l * V) <= 2e+271: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) 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(l * V) <= Float64(-Inf)) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); elseif (Float64(l * V) <= -4e-318) tmp = Float64(c0 / Float64(sqrt(Float64(0.0 - Float64(l * V))) / sqrt(Float64(0.0 - A)))); elseif (Float64(l * V) <= 2e-302) tmp = Float64(c0 / (Float64(Float64(A / l) / V) ^ -0.5)); elseif (Float64(l * V) <= 2e+271) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); 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 ((l * V) <= -Inf)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
elseif ((l * V) <= -4e-318)
tmp = c0 / (sqrt((0.0 - (l * V))) / sqrt((0.0 - A)));
elseif ((l * V) <= 2e-302)
tmp = c0 / (((A / l) / V) ^ -0.5);
elseif ((l * V) <= 2e+271)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
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[(l * V), $MachinePrecision], (-Infinity)], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -4e-318], N[(c0 / N[(N[Sqrt[N[(0.0 - N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 2e-302], N[(c0 / N[Power[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 2e+271], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $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}\;\ell \cdot V \leq -\infty:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{elif}\;\ell \cdot V \leq -4 \cdot 10^{-318}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{0 - \ell \cdot V}}{\sqrt{0 - A}}}\\
\mathbf{elif}\;\ell \cdot V \leq 2 \cdot 10^{-302}:\\
\;\;\;\;\frac{c0}{{\left(\frac{\frac{A}{\ell}}{V}\right)}^{-0.5}}\\
\mathbf{elif}\;\ell \cdot V \leq 2 \cdot 10^{+271}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 33.4%
*-commutativeN/A
associate-/r*N/A
sqrt-divN/A
associate-*l/N/A
associate-*r/N/A
*-lowering-*.f64N/A
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6439.3%
Applied egg-rr39.3%
metadata-evalN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6439.3%
Applied egg-rr39.3%
if -inf.0 < (*.f64 V l) < -3.9999999e-318Initial program 84.0%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6476.2%
Applied egg-rr76.2%
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6479.6%
Applied egg-rr79.6%
associate-/r/N/A
div-invN/A
associate-/l/N/A
frac-2negN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f6498.9%
Applied egg-rr98.9%
sub0-negN/A
neg-lowering-neg.f64N/A
*-lowering-*.f6498.9%
Applied egg-rr98.9%
if -3.9999999e-318 < (*.f64 V l) < 1.9999999999999999e-302Initial program 77.1%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6484.6%
Applied egg-rr84.6%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6484.6%
Applied egg-rr84.6%
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
div-invN/A
/-lowering-/.f6484.6%
Applied egg-rr84.6%
if 1.9999999999999999e-302 < (*.f64 V l) < 1.99999999999999991e271Initial program 76.6%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6499.5%
Applied egg-rr99.5%
if 1.99999999999999991e271 < (*.f64 V l) Initial program 62.4%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6483.2%
Applied egg-rr83.2%
clear-numN/A
associate-/r/N/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f6483.4%
Applied egg-rr83.4%
Final simplification91.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) 2e-302)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= (* l V) 2e+271)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(/ 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 ((l * V) <= 2e-302) {
tmp = c0 * sqrt(((A / V) / l));
} else if ((l * V) <= 2e+271) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} 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 ((l * v) <= 2d-302) then
tmp = c0 * sqrt(((a / v) / l))
else if ((l * v) <= 2d+271) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
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 ((l * V) <= 2e-302) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if ((l * V) <= 2e+271) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} 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 (l * V) <= 2e-302: tmp = c0 * math.sqrt(((A / V) / l)) elif (l * V) <= 2e+271: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) 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(l * V) <= 2e-302) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (Float64(l * V) <= 2e+271) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); 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 ((l * V) <= 2e-302)
tmp = c0 * sqrt(((A / V) / l));
elseif ((l * V) <= 2e+271)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
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[(l * V), $MachinePrecision], 2e-302], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 2e+271], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $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}\;\ell \cdot V \leq 2 \cdot 10^{-302}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;\ell \cdot V \leq 2 \cdot 10^{+271}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < 1.9999999999999999e-302Initial program 74.4%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6478.5%
Applied egg-rr78.5%
if 1.9999999999999999e-302 < (*.f64 V l) < 1.99999999999999991e271Initial program 76.6%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6499.5%
Applied egg-rr99.5%
if 1.99999999999999991e271 < (*.f64 V l) Initial program 62.4%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6483.2%
Applied egg-rr83.2%
clear-numN/A
associate-/r/N/A
clear-numN/A
*-lowering-*.f64N/A
/-lowering-/.f6483.4%
Applied egg-rr83.4%
Final simplification86.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 (<= A -5e-310) (/ c0 (/ (sqrt l) (pow (/ A V) 0.5))) (* c0 (/ (sqrt A) (sqrt (* l V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 / (sqrt(l) / pow((A / V), 0.5));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * 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) :: tmp
if (a <= (-5d-310)) then
tmp = c0 / (sqrt(l) / ((a / v) ** 0.5d0))
else
tmp = c0 * (sqrt(a) / sqrt((l * 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 tmp;
if (A <= -5e-310) {
tmp = c0 / (Math.sqrt(l) / Math.pow((A / V), 0.5));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = c0 / (math.sqrt(l) / math.pow((A / V), 0.5)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(c0 / Float64(sqrt(l) / (Float64(A / V) ^ 0.5))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); 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 <= -5e-310)
tmp = c0 / (sqrt(l) / ((A / V) ^ 0.5));
else
tmp = c0 * (sqrt(A) / sqrt((l * 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_] := If[LessEqual[A, -5e-310], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[Power[N[(A / V), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{{\left(\frac{A}{V}\right)}^{0.5}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 73.0%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6475.7%
Applied egg-rr75.7%
clear-numN/A
associate-/r/N/A
clear-numN/A
associate-/r/N/A
sqrt-divN/A
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
clear-numN/A
inv-powN/A
pow-powN/A
metadata-evalN/A
pow-lowering-pow.f64N/A
/-lowering-/.f6442.6%
Applied egg-rr42.6%
if -4.999999999999985e-310 < A Initial program 75.1%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6491.0%
Applied egg-rr91.0%
Final simplification68.0%
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 -5e-310) (* c0 (/ (pow l -0.5) (sqrt (/ V A)))) (* c0 (/ (sqrt A) (sqrt (* l V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * (pow(l, -0.5) / sqrt((V / A)));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * 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) :: tmp
if (a <= (-5d-310)) then
tmp = c0 * ((l ** (-0.5d0)) / sqrt((v / a)))
else
tmp = c0 * (sqrt(a) / sqrt((l * 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 tmp;
if (A <= -5e-310) {
tmp = c0 * (Math.pow(l, -0.5) / Math.sqrt((V / A)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = c0 * (math.pow(l, -0.5) / math.sqrt((V / A))) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(c0 * Float64((l ^ -0.5) / sqrt(Float64(V / A)))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); 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 <= -5e-310)
tmp = c0 * ((l ^ -0.5) / sqrt((V / A)));
else
tmp = c0 * (sqrt(A) / sqrt((l * 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_] := If[LessEqual[A, -5e-310], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{{\ell}^{-0.5}}{\sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 73.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6477.6%
Applied egg-rr77.6%
associate-/r*N/A
associate-/l/N/A
clear-numN/A
sqrt-divN/A
metadata-evalN/A
inv-powN/A
pow-to-expN/A
rem-log-expN/A
pow-to-expN/A
inv-powN/A
exp-lowering-exp.f64N/A
inv-powN/A
sqrt-pow2N/A
metadata-evalN/A
log-powN/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6472.2%
Applied egg-rr72.2%
*-commutativeN/A
associate-/r/N/A
exp-to-powN/A
metadata-evalN/A
pow-flipN/A
unpow-prod-downN/A
associate-/r*N/A
associate-/l/N/A
associate-/r*N/A
pow-flipN/A
metadata-evalN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6442.6%
Applied egg-rr42.6%
if -4.999999999999985e-310 < A Initial program 75.1%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6491.0%
Applied egg-rr91.0%
Final simplification67.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 (<= A -5e-310) (/ (* c0 (sqrt (/ A V))) (sqrt l)) (* c0 (/ (sqrt A) (sqrt (* l V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = (c0 * sqrt((A / V))) / sqrt(l);
} else {
tmp = c0 * (sqrt(A) / sqrt((l * 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) :: tmp
if (a <= (-5d-310)) then
tmp = (c0 * sqrt((a / v))) / sqrt(l)
else
tmp = c0 * (sqrt(a) / sqrt((l * 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 tmp;
if (A <= -5e-310) {
tmp = (c0 * Math.sqrt((A / V))) / Math.sqrt(l);
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = (c0 * math.sqrt((A / V))) / math.sqrt(l) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(Float64(c0 * sqrt(Float64(A / V))) / sqrt(l)); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); 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 <= -5e-310)
tmp = (c0 * sqrt((A / V))) / sqrt(l);
else
tmp = c0 * (sqrt(A) / sqrt((l * 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_] := If[LessEqual[A, -5e-310], N[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 73.0%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6475.7%
Applied egg-rr75.7%
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6478.3%
Applied egg-rr78.3%
pow1/2N/A
unpow-prod-downN/A
associate-/r*N/A
associate-/l/N/A
*-rgt-identityN/A
times-fracN/A
metadata-evalN/A
pow1/2N/A
sqrt-divN/A
clear-numN/A
*-commutativeN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f6441.1%
Applied egg-rr41.1%
if -4.999999999999985e-310 < A Initial program 75.1%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6491.0%
Applied egg-rr91.0%
Final simplification67.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -5e-310) (* (/ c0 (sqrt l)) (sqrt (/ A V))) (* c0 (/ (sqrt A) (sqrt (* l V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * 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) :: tmp
if (a <= (-5d-310)) then
tmp = (c0 / sqrt(l)) * sqrt((a / v))
else
tmp = c0 * (sqrt(a) / sqrt((l * 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 tmp;
if (A <= -5e-310) {
tmp = (c0 / Math.sqrt(l)) * Math.sqrt((A / V));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = (c0 / math.sqrt(l)) * math.sqrt((A / V)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); 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 <= -5e-310)
tmp = (c0 / sqrt(l)) * sqrt((A / V));
else
tmp = c0 * (sqrt(A) / sqrt((l * 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_] := If[LessEqual[A, -5e-310], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 73.0%
*-commutativeN/A
associate-/r*N/A
sqrt-divN/A
associate-*l/N/A
associate-*r/N/A
*-lowering-*.f64N/A
pow1/2N/A
clear-numN/A
inv-powN/A
pow-powN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
metadata-evalN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6440.4%
Applied egg-rr40.4%
metadata-evalN/A
sqrt-pow1N/A
inv-powN/A
clear-numN/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6440.4%
Applied egg-rr40.4%
if -4.999999999999985e-310 < A Initial program 75.1%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6491.0%
Applied egg-rr91.0%
Final simplification66.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= (/ A (* l V)) 4e-322) (/ c0 (pow (/ (/ A l) V) -0.5)) (/ c0 (sqrt (/ (/ V (/ 1.0 l)) A)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((A / (l * V)) <= 4e-322) {
tmp = c0 / pow(((A / l) / V), -0.5);
} else {
tmp = c0 / sqrt(((V / (1.0 / 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 / (l * v)) <= 4d-322) then
tmp = c0 / (((a / l) / v) ** (-0.5d0))
else
tmp = c0 / sqrt(((v / (1.0d0 / 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 / (l * V)) <= 4e-322) {
tmp = c0 / Math.pow(((A / l) / V), -0.5);
} else {
tmp = c0 / Math.sqrt(((V / (1.0 / l)) / A));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (A / (l * V)) <= 4e-322: tmp = c0 / math.pow(((A / l) / V), -0.5) else: tmp = c0 / math.sqrt(((V / (1.0 / 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(l * V)) <= 4e-322) tmp = Float64(c0 / (Float64(Float64(A / l) / V) ^ -0.5)); else tmp = Float64(c0 / sqrt(Float64(Float64(V / Float64(1.0 / 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 / (l * V)) <= 4e-322)
tmp = c0 / (((A / l) / V) ^ -0.5);
else
tmp = c0 / sqrt(((V / (1.0 / 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[(l * V), $MachinePrecision]), $MachinePrecision], 4e-322], N[(c0 / N[Power[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(N[(V / N[(1.0 / l), $MachinePrecision]), $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}{\ell \cdot V} \leq 4 \cdot 10^{-322}:\\
\;\;\;\;\frac{c0}{{\left(\frac{\frac{A}{\ell}}{V}\right)}^{-0.5}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\frac{V}{\frac{1}{\ell}}}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.00193e-322Initial program 44.7%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6464.5%
Applied egg-rr64.5%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6464.6%
Applied egg-rr64.6%
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
div-invN/A
/-lowering-/.f6466.7%
Applied egg-rr66.7%
if 4.00193e-322 < (/.f64 A (*.f64 V l)) Initial program 84.2%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6478.5%
Applied egg-rr78.5%
clear-numN/A
associate-/r/N/A
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6484.6%
Applied egg-rr84.6%
Final simplification80.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (/ A (* l V)))) (if (<= t_0 5e-289) (/ c0 (pow (/ (/ A l) V) -0.5)) (* 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 / (l * V);
double tmp;
if (t_0 <= 5e-289) {
tmp = c0 / pow(((A / l) / V), -0.5);
} 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 / (l * v)
if (t_0 <= 5d-289) then
tmp = c0 / (((a / l) / v) ** (-0.5d0))
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 / (l * V);
double tmp;
if (t_0 <= 5e-289) {
tmp = c0 / Math.pow(((A / l) / V), -0.5);
} 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 / (l * V) tmp = 0 if t_0 <= 5e-289: tmp = c0 / math.pow(((A / l) / V), -0.5) 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(l * V)) tmp = 0.0 if (t_0 <= 5e-289) tmp = Float64(c0 / (Float64(Float64(A / l) / V) ^ -0.5)); 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 / (l * V);
tmp = 0.0;
if (t_0 <= 5e-289)
tmp = c0 / (((A / l) / V) ^ -0.5);
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[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-289], N[(c0 / N[Power[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision], -0.5], $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}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-289}:\\
\;\;\;\;\frac{c0}{{\left(\frac{\frac{A}{\ell}}{V}\right)}^{-0.5}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 5.00000000000000029e-289Initial program 49.3%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6467.5%
Applied egg-rr67.5%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f6467.6%
Applied egg-rr67.6%
clear-numN/A
inv-powN/A
sqrt-pow1N/A
metadata-evalN/A
pow-lowering-pow.f64N/A
/-lowering-/.f64N/A
*-commutativeN/A
div-invN/A
/-lowering-/.f6469.5%
Applied egg-rr69.5%
if 5.00000000000000029e-289 < (/.f64 A (*.f64 V l)) Initial program 83.7%
Final simplification79.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 (/ A (* l V)))) (if (<= t_0 0.0) (* c0 (sqrt (/ (/ A V) l))) (* c0 (sqrt t_0)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (l * v)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.sqrt(t_0) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 45.2%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6467.8%
Applied egg-rr67.8%
if 0.0 < (/.f64 A (*.f64 V l)) Initial program 83.6%
Final simplification79.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* l V)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (l * V)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (l * v)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (l * V)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (l * V)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(l * V)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (l * V)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}
\end{array}
Initial program 74.1%
Final simplification74.1%
herbie shell --seed 2024164
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))