
(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 13 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: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) -1e+293)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* l V) -5e-313)
(* c0 (/ (sqrt (- A)) (sqrt (* l (- V)))))
(if (<= (* l V) 5e-313)
(* c0 (pow (/ V (/ A l)) -0.5))
(if (<= (* l V) 5e+306)
(/ c0 (/ (sqrt (* l V)) (sqrt A)))
(* c0 (/ (sqrt (/ (- A) V)) (sqrt (- l)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -1e+293) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((l * V) <= -5e-313) {
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
} else if ((l * V) <= 5e-313) {
tmp = c0 * pow((V / (A / l)), -0.5);
} else if ((l * V) <= 5e+306) {
tmp = c0 / (sqrt((l * V)) / sqrt(A));
} else {
tmp = c0 * (sqrt((-A / V)) / sqrt(-l));
}
return tmp;
}
NOTE: 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) <= (-1d+293)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((l * v) <= (-5d-313)) then
tmp = c0 * (sqrt(-a) / sqrt((l * -v)))
else if ((l * v) <= 5d-313) then
tmp = c0 * ((v / (a / l)) ** (-0.5d0))
else if ((l * v) <= 5d+306) then
tmp = c0 / (sqrt((l * v)) / sqrt(a))
else
tmp = c0 * (sqrt((-a / v)) / sqrt(-l))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -1e+293) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((l * V) <= -5e-313) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((l * -V)));
} else if ((l * V) <= 5e-313) {
tmp = c0 * Math.pow((V / (A / l)), -0.5);
} else if ((l * V) <= 5e+306) {
tmp = c0 / (Math.sqrt((l * V)) / Math.sqrt(A));
} else {
tmp = c0 * (Math.sqrt((-A / V)) / Math.sqrt(-l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -1e+293: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (l * V) <= -5e-313: tmp = c0 * (math.sqrt(-A) / math.sqrt((l * -V))) elif (l * V) <= 5e-313: tmp = c0 * math.pow((V / (A / l)), -0.5) elif (l * V) <= 5e+306: tmp = c0 / (math.sqrt((l * V)) / math.sqrt(A)) else: tmp = c0 * (math.sqrt((-A / V)) / math.sqrt(-l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= -1e+293) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(l * V) <= -5e-313) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V))))); elseif (Float64(l * V) <= 5e-313) tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5)); elseif (Float64(l * V) <= 5e+306) tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) / sqrt(A))); else tmp = Float64(c0 * Float64(sqrt(Float64(Float64(-A) / V)) / sqrt(Float64(-l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((l * V) <= -1e+293)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((l * V) <= -5e-313)
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
elseif ((l * V) <= 5e-313)
tmp = c0 * ((V / (A / l)) ^ -0.5);
elseif ((l * V) <= 5e+306)
tmp = c0 / (sqrt((l * V)) / sqrt(A));
else
tmp = c0 * (sqrt((-A / V)) / sqrt(-l));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(l * V), $MachinePrecision], -1e+293], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -5e-313], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 5e-313], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 5e+306], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[((-A) / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -1 \cdot 10^{+293}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;\ell \cdot V \leq -5 \cdot 10^{-313}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\
\mathbf{elif}\;\ell \cdot V \leq 5 \cdot 10^{-313}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\
\mathbf{elif}\;\ell \cdot V \leq 5 \cdot 10^{+306}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{V}}}{\sqrt{-\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.9999999999999992e292Initial program 27.4%
associate-/r*54.8%
sqrt-div46.1%
associate-*r/46.1%
Applied egg-rr46.1%
*-commutative46.1%
associate-/l*44.9%
associate-/r/46.1%
Simplified46.1%
if -9.9999999999999992e292 < (*.f64 V l) < -5.00000000002e-313Initial program 77.2%
frac-2neg77.2%
sqrt-div99.3%
associate-*r/97.2%
*-commutative97.2%
distribute-rgt-neg-in97.2%
Applied egg-rr97.2%
*-commutative97.2%
associate-/l*95.5%
associate-/r/99.3%
distribute-rgt-neg-out99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Simplified99.3%
if -5.00000000002e-313 < (*.f64 V l) < 5.00000000002e-313Initial program 36.0%
clear-num36.0%
sqrt-div36.0%
metadata-eval36.0%
associate-*r/36.0%
*-commutative36.0%
*-un-lft-identity36.0%
associate-/l*67.8%
associate-/r/67.8%
Applied egg-rr67.8%
Taylor expanded in c0 around 0 36.0%
associate-/r*66.6%
Simplified66.6%
clear-num66.6%
associate-/r/66.6%
sqrt-div67.8%
metadata-eval67.8%
pow1/267.8%
pow-flip67.9%
associate-*l/36.0%
*-commutative36.0%
associate-/l*67.9%
metadata-eval67.9%
Applied egg-rr67.9%
if 5.00000000002e-313 < (*.f64 V l) < 4.99999999999999993e306Initial program 85.6%
sqrt-div99.4%
associate-*r/96.4%
associate-/l*99.5%
Applied egg-rr99.5%
if 4.99999999999999993e306 < (*.f64 V l) Initial program 15.8%
clear-num15.8%
sqrt-div15.8%
metadata-eval15.8%
associate-*r/15.8%
*-commutative15.8%
*-un-lft-identity15.8%
associate-/l*49.1%
associate-/r/49.3%
Applied egg-rr49.3%
Taylor expanded in c0 around 0 15.8%
associate-/r*49.3%
Simplified49.3%
frac-2neg49.3%
sqrt-div54.2%
distribute-neg-frac54.2%
Applied egg-rr54.2%
Final simplification89.2%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -4e-310) (/ c0 (* (/ (sqrt l) (sqrt (- A))) (sqrt (- V)))) (/ c0 (/ (sqrt (* l V)) (sqrt A)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 / ((sqrt(l) / sqrt(-A)) * sqrt(-V));
} else {
tmp = c0 / (sqrt((l * V)) / sqrt(A));
}
return tmp;
}
NOTE: 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 <= (-4d-310)) then
tmp = c0 / ((sqrt(l) / sqrt(-a)) * sqrt(-v))
else
tmp = c0 / (sqrt((l * v)) / sqrt(a))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 / ((Math.sqrt(l) / Math.sqrt(-A)) * Math.sqrt(-V));
} else {
tmp = c0 / (Math.sqrt((l * V)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -4e-310: tmp = c0 / ((math.sqrt(l) / math.sqrt(-A)) * math.sqrt(-V)) else: tmp = c0 / (math.sqrt((l * V)) / math.sqrt(A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -4e-310) tmp = Float64(c0 / Float64(Float64(sqrt(l) / sqrt(Float64(-A))) * sqrt(Float64(-V)))); else tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) / sqrt(A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -4e-310)
tmp = c0 / ((sqrt(l) / sqrt(-A)) * sqrt(-V));
else
tmp = c0 / (sqrt((l * V)) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -4e-310], N[(c0 / N[(N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[(-A)], $MachinePrecision]), $MachinePrecision] * N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{-A}} \cdot \sqrt{-V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -3.999999999999988e-310Initial program 66.0%
pow1/266.0%
associate-/r*69.3%
Applied egg-rr69.3%
unpow1/269.3%
clear-num68.1%
metadata-eval68.1%
associate-/l/68.1%
*-commutative68.1%
sqrt-div69.0%
metadata-eval69.0%
metadata-eval69.0%
div-inv69.1%
*-commutative69.1%
clear-num69.0%
div-inv70.2%
associate-/r/66.4%
Applied egg-rr66.4%
sqrt-prod41.1%
sqrt-div0.0%
associate-/r/0.0%
sqrt-div41.3%
frac-2neg41.3%
sqrt-div47.1%
associate-/r/47.2%
Applied egg-rr47.2%
if -3.999999999999988e-310 < A Initial program 70.5%
sqrt-div80.9%
associate-*r/78.6%
associate-/l*81.0%
Applied egg-rr81.0%
Final simplification62.9%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) -1e+293)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* l V) -5e-313)
(* c0 (/ (sqrt (- A)) (sqrt (* l (- V)))))
(if (<= (* l V) 5e-313)
(* c0 (pow (/ V (/ A l)) -0.5))
(if (<= (* l V) 4e+255)
(/ c0 (/ (sqrt (* l V)) (sqrt A)))
(* c0 (sqrt (/ (/ A V) l))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -1e+293) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((l * V) <= -5e-313) {
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
} else if ((l * V) <= 5e-313) {
tmp = c0 * pow((V / (A / l)), -0.5);
} else if ((l * V) <= 4e+255) {
tmp = c0 / (sqrt((l * V)) / sqrt(A));
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
NOTE: 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) <= (-1d+293)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((l * v) <= (-5d-313)) then
tmp = c0 * (sqrt(-a) / sqrt((l * -v)))
else if ((l * v) <= 5d-313) then
tmp = c0 * ((v / (a / l)) ** (-0.5d0))
else if ((l * v) <= 4d+255) then
tmp = c0 / (sqrt((l * v)) / sqrt(a))
else
tmp = c0 * sqrt(((a / v) / l))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -1e+293) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((l * V) <= -5e-313) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((l * -V)));
} else if ((l * V) <= 5e-313) {
tmp = c0 * Math.pow((V / (A / l)), -0.5);
} else if ((l * V) <= 4e+255) {
tmp = c0 / (Math.sqrt((l * V)) / Math.sqrt(A));
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -1e+293: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (l * V) <= -5e-313: tmp = c0 * (math.sqrt(-A) / math.sqrt((l * -V))) elif (l * V) <= 5e-313: tmp = c0 * math.pow((V / (A / l)), -0.5) elif (l * V) <= 4e+255: tmp = c0 / (math.sqrt((l * V)) / math.sqrt(A)) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= -1e+293) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(l * V) <= -5e-313) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V))))); elseif (Float64(l * V) <= 5e-313) tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5)); elseif (Float64(l * V) <= 4e+255) tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) / sqrt(A))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((l * V) <= -1e+293)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((l * V) <= -5e-313)
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
elseif ((l * V) <= 5e-313)
tmp = c0 * ((V / (A / l)) ^ -0.5);
elseif ((l * V) <= 4e+255)
tmp = c0 / (sqrt((l * V)) / sqrt(A));
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(l * V), $MachinePrecision], -1e+293], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -5e-313], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 5e-313], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 4e+255], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -1 \cdot 10^{+293}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;\ell \cdot V \leq -5 \cdot 10^{-313}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\
\mathbf{elif}\;\ell \cdot V \leq 5 \cdot 10^{-313}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\
\mathbf{elif}\;\ell \cdot V \leq 4 \cdot 10^{+255}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.9999999999999992e292Initial program 27.4%
associate-/r*54.8%
sqrt-div46.1%
associate-*r/46.1%
Applied egg-rr46.1%
*-commutative46.1%
associate-/l*44.9%
associate-/r/46.1%
Simplified46.1%
if -9.9999999999999992e292 < (*.f64 V l) < -5.00000000002e-313Initial program 77.2%
frac-2neg77.2%
sqrt-div99.3%
associate-*r/97.2%
*-commutative97.2%
distribute-rgt-neg-in97.2%
Applied egg-rr97.2%
*-commutative97.2%
associate-/l*95.5%
associate-/r/99.3%
distribute-rgt-neg-out99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
Simplified99.3%
if -5.00000000002e-313 < (*.f64 V l) < 5.00000000002e-313Initial program 36.0%
clear-num36.0%
sqrt-div36.0%
metadata-eval36.0%
associate-*r/36.0%
*-commutative36.0%
*-un-lft-identity36.0%
associate-/l*67.8%
associate-/r/67.8%
Applied egg-rr67.8%
Taylor expanded in c0 around 0 36.0%
associate-/r*66.6%
Simplified66.6%
clear-num66.6%
associate-/r/66.6%
sqrt-div67.8%
metadata-eval67.8%
pow1/267.8%
pow-flip67.9%
associate-*l/36.0%
*-commutative36.0%
associate-/l*67.9%
metadata-eval67.9%
Applied egg-rr67.9%
if 5.00000000002e-313 < (*.f64 V l) < 3.99999999999999995e255Initial program 85.1%
sqrt-div99.4%
associate-*r/96.3%
associate-/l*99.5%
Applied egg-rr99.5%
if 3.99999999999999995e255 < (*.f64 V l) Initial program 29.8%
clear-num29.8%
sqrt-div29.8%
metadata-eval29.8%
associate-*r/29.8%
*-commutative29.8%
*-un-lft-identity29.8%
associate-/l*57.5%
associate-/r/57.7%
Applied egg-rr57.7%
Taylor expanded in c0 around 0 29.8%
associate-/r*57.7%
Simplified57.7%
Final simplification88.9%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l 8.8e-304) (/ c0 (sqrt (* V (/ l A)))) (* (sqrt (/ A V)) (/ c0 (sqrt l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= 8.8e-304) {
tmp = c0 / sqrt((V * (l / A)));
} else {
tmp = sqrt((A / V)) * (c0 / sqrt(l));
}
return tmp;
}
NOTE: 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 <= 8.8d-304) then
tmp = c0 / sqrt((v * (l / a)))
else
tmp = sqrt((a / v)) * (c0 / sqrt(l))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= 8.8e-304) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else {
tmp = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if l <= 8.8e-304: tmp = c0 / math.sqrt((V * (l / A))) else: tmp = math.sqrt((A / V)) * (c0 / math.sqrt(l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= 8.8e-304) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); else tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= 8.8e-304)
tmp = c0 / sqrt((V * (l / A)));
else
tmp = sqrt((A / V)) * (c0 / sqrt(l));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[l, 8.8e-304], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 8.8 \cdot 10^{-304}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < 8.799999999999999e-304Initial program 63.0%
pow1/263.0%
associate-/r*69.8%
Applied egg-rr69.8%
unpow1/269.8%
clear-num68.2%
metadata-eval68.2%
associate-/l/68.1%
*-commutative68.1%
sqrt-div68.4%
metadata-eval68.4%
metadata-eval68.4%
div-inv68.4%
*-commutative68.4%
clear-num68.4%
div-inv70.1%
associate-/r/65.2%
Applied egg-rr65.2%
if 8.799999999999999e-304 < l Initial program 73.5%
associate-/r*73.4%
sqrt-div83.9%
associate-*r/81.8%
Applied egg-rr81.8%
associate-/l*83.9%
associate-/r/82.5%
Simplified82.5%
Final simplification73.6%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -4e-310) (/ c0 (sqrt (* V (/ l A)))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -4e-310) {
tmp = c0 / sqrt((V * (l / A)));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
}
return tmp;
}
NOTE: 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 <= (-4d-310)) then
tmp = c0 / sqrt((v * (l / a)))
else
tmp = c0 * (sqrt((a / v)) / sqrt(l))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -4e-310) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if l <= -4e-310: tmp = c0 / math.sqrt((V * (l / A))) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -4e-310) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= -4e-310)
tmp = c0 / sqrt((V * (l / A)));
else
tmp = c0 * (sqrt((A / V)) / sqrt(l));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[l, -4e-310], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -3.999999999999988e-310Initial program 63.2%
pow1/263.2%
associate-/r*70.1%
Applied egg-rr70.1%
unpow1/270.1%
clear-num69.2%
metadata-eval69.2%
associate-/l/69.1%
*-commutative69.1%
sqrt-div69.4%
metadata-eval69.4%
metadata-eval69.4%
div-inv69.4%
*-commutative69.4%
clear-num69.4%
div-inv70.4%
associate-/r/65.4%
Applied egg-rr65.4%
if -3.999999999999988e-310 < l Initial program 73.2%
associate-/r*73.0%
sqrt-div84.1%
associate-*r/82.1%
Applied egg-rr82.1%
*-commutative82.1%
associate-/l*81.2%
associate-/r/84.1%
Simplified84.1%
Final simplification74.6%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -4e-310) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (/ c0 (/ (sqrt (* l V)) (sqrt A)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 / (sqrt((l * V)) / sqrt(A));
}
return tmp;
}
NOTE: 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 <= (-4d-310)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 / (sqrt((l * v)) / sqrt(a))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 / (Math.sqrt((l * V)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -4e-310: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 / (math.sqrt((l * V)) / math.sqrt(A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -4e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 / Float64(sqrt(Float64(l * V)) / sqrt(A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -4e-310)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 / (sqrt((l * V)) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -4e-310], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot V}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -3.999999999999988e-310Initial program 66.0%
associate-/r*69.3%
sqrt-div41.3%
associate-*r/39.4%
Applied egg-rr39.4%
*-commutative39.4%
associate-/l*40.5%
associate-/r/41.3%
Simplified41.3%
if -3.999999999999988e-310 < A Initial program 70.5%
sqrt-div80.9%
associate-*r/78.6%
associate-/l*81.0%
Applied egg-rr81.0%
Final simplification59.7%
NOTE: 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)))
(if (<= t_0 2e+263) (* c0 (sqrt t_0)) (* c0 (pow (* V (/ l A)) -0.5))))))assert(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 if (t_0 <= 2e+263) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
return tmp;
}
NOTE: 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 if (t_0 <= 2d+263) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
end if
code = tmp
end function
assert 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 if (t_0 <= 2e+263) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
return tmp;
}
[V, l] = sort([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)) elif t_0 <= 2e+263: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow((V * (l / A)), -0.5) return tmp
V, l = sort([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))); elseif (t_0 <= 2e+263) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); end return tmp end
V, l = num2cell(sort([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));
elseif (t_0 <= 2e+263)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * ((V * (l / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: 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], If[LessEqual[t$95$0, 2e+263], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([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{elif}\;t_0 \leq 2 \cdot 10^{+263}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 18.7%
clear-num18.7%
sqrt-div18.7%
metadata-eval18.7%
associate-*r/18.7%
*-commutative18.7%
*-un-lft-identity18.7%
associate-/l*39.8%
associate-/r/39.8%
Applied egg-rr39.8%
Taylor expanded in c0 around 0 18.7%
associate-/r*39.9%
Simplified39.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.00000000000000003e263Initial program 99.3%
if 2.00000000000000003e263 < (/.f64 A (*.f64 V l)) Initial program 35.6%
associate-/r*46.7%
sqrt-div33.6%
associate-*r/33.7%
Applied egg-rr33.7%
*-commutative33.7%
associate-/l*33.5%
associate-/r/33.6%
Simplified33.6%
clear-num33.6%
sqrt-undiv50.6%
div-inv50.6%
clear-num50.6%
*-commutative50.6%
pow1/250.6%
pow-flip50.7%
*-commutative50.7%
clear-num50.7%
div-inv50.7%
associate-/r/53.6%
metadata-eval53.6%
Applied egg-rr53.6%
Final simplification76.6%
NOTE: 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)))
(if (<= t_0 2e+263) (* c0 (sqrt t_0)) (* c0 (pow (/ V (/ A l)) -0.5))))))assert(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 if (t_0 <= 2e+263) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow((V / (A / l)), -0.5);
}
return tmp;
}
NOTE: 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 if (t_0 <= 2d+263) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * ((v / (a / l)) ** (-0.5d0))
end if
code = tmp
end function
assert 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 if (t_0 <= 2e+263) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow((V / (A / l)), -0.5);
}
return tmp;
}
[V, l] = sort([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)) elif t_0 <= 2e+263: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow((V / (A / l)), -0.5) return tmp
V, l = sort([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))); elseif (t_0 <= 2e+263) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5)); end return tmp end
V, l = num2cell(sort([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));
elseif (t_0 <= 2e+263)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * ((V / (A / l)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: 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], If[LessEqual[t$95$0, 2e+263], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([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{elif}\;t_0 \leq 2 \cdot 10^{+263}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 18.7%
clear-num18.7%
sqrt-div18.7%
metadata-eval18.7%
associate-*r/18.7%
*-commutative18.7%
*-un-lft-identity18.7%
associate-/l*39.8%
associate-/r/39.8%
Applied egg-rr39.8%
Taylor expanded in c0 around 0 18.7%
associate-/r*39.9%
Simplified39.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.00000000000000003e263Initial program 99.3%
if 2.00000000000000003e263 < (/.f64 A (*.f64 V l)) Initial program 35.6%
clear-num35.6%
sqrt-div39.0%
metadata-eval39.0%
associate-*r/39.0%
*-commutative39.0%
*-un-lft-identity39.0%
associate-/l*53.6%
associate-/r/50.6%
Applied egg-rr50.6%
Taylor expanded in c0 around 0 35.6%
associate-/r*46.7%
Simplified46.7%
clear-num46.7%
associate-/r/49.6%
sqrt-div53.6%
metadata-eval53.6%
pow1/253.6%
pow-flip53.6%
associate-*l/39.0%
*-commutative39.0%
associate-/l*53.6%
metadata-eval53.6%
Applied egg-rr53.6%
Final simplification76.6%
NOTE: 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) (/ 1.0 l))))
(if (<= t_0 2e+263) (* c0 (sqrt t_0)) (* c0 (pow (/ V (/ A l)) -0.5))))))assert(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) * (1.0 / l)));
} else if (t_0 <= 2e+263) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * pow((V / (A / l)), -0.5);
}
return tmp;
}
NOTE: 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) * (1.0d0 / l)))
else if (t_0 <= 2d+263) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * ((v / (a / l)) ** (-0.5d0))
end if
code = tmp
end function
assert 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) * (1.0 / l)));
} else if (t_0 <= 2e+263) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.pow((V / (A / l)), -0.5);
}
return tmp;
}
[V, l] = sort([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) * (1.0 / l))) elif t_0 <= 2e+263: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.pow((V / (A / l)), -0.5) return tmp
V, l = sort([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) * Float64(1.0 / l)))); elseif (t_0 <= 2e+263) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5)); end return tmp end
V, l = num2cell(sort([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) * (1.0 / l)));
elseif (t_0 <= 2e+263)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * ((V / (A / l)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: 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] * N[(1.0 / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+263], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+263}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 18.7%
associate-/r*39.9%
div-inv39.8%
Applied egg-rr39.8%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.00000000000000003e263Initial program 99.3%
if 2.00000000000000003e263 < (/.f64 A (*.f64 V l)) Initial program 35.6%
clear-num35.6%
sqrt-div39.0%
metadata-eval39.0%
associate-*r/39.0%
*-commutative39.0%
*-un-lft-identity39.0%
associate-/l*53.6%
associate-/r/50.6%
Applied egg-rr50.6%
Taylor expanded in c0 around 0 35.6%
associate-/r*46.7%
Simplified46.7%
clear-num46.7%
associate-/r/49.6%
sqrt-div53.6%
metadata-eval53.6%
pow1/253.6%
pow-flip53.6%
associate-*l/39.0%
*-commutative39.0%
associate-/l*53.6%
metadata-eval53.6%
Applied egg-rr53.6%
Final simplification76.6%
NOTE: 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 (or (<= t_0 0.0) (not (<= t_0 1e+299)))
(* c0 (sqrt (/ (/ A V) l)))
(* c0 (sqrt t_0)))))assert(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) || !(t_0 <= 1e+299)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: 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) .or. (.not. (t_0 <= 1d+299))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert 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) || !(t_0 <= 1e+299)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 1e+299): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.sqrt(t_0) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 1e+299)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 1e+299)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: 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[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 1e+299]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 10^{+299}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 1.0000000000000001e299 < (/.f64 A (*.f64 V l)) Initial program 23.9%
clear-num23.9%
sqrt-div26.0%
metadata-eval26.0%
associate-*r/26.0%
*-commutative26.0%
*-un-lft-identity26.0%
associate-/l*43.9%
associate-/r/43.9%
Applied egg-rr43.9%
Taylor expanded in c0 around 0 23.9%
associate-/r*41.4%
Simplified41.4%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.0000000000000001e299Initial program 98.8%
Final simplification75.3%
NOTE: 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)))
(if (<= t_0 1e+299) (* c0 (sqrt t_0)) (/ c0 (sqrt (* l (/ V A))))))))assert(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 if (t_0 <= 1e+299) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: 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 if (t_0 <= 1d+299) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert 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 if (t_0 <= 1e+299) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[V, l] = sort([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)) elif t_0 <= 1e+299: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
V, l = sort([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))); elseif (t_0 <= 1e+299) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
V, l = num2cell(sort([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));
elseif (t_0 <= 1e+299)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: 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], If[LessEqual[t$95$0, 1e+299], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([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{elif}\;t_0 \leq 10^{+299}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 18.7%
clear-num18.7%
sqrt-div18.7%
metadata-eval18.7%
associate-*r/18.7%
*-commutative18.7%
*-un-lft-identity18.7%
associate-/l*39.8%
associate-/r/39.8%
Applied egg-rr39.8%
Taylor expanded in c0 around 0 18.7%
associate-/r*39.9%
Simplified39.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.0000000000000001e299Initial program 98.8%
if 1.0000000000000001e299 < (/.f64 A (*.f64 V l)) Initial program 28.1%
clear-num28.1%
sqrt-div31.9%
metadata-eval31.9%
associate-*r/31.9%
*-commutative31.9%
*-un-lft-identity31.9%
associate-/l*47.2%
associate-/r/47.2%
Applied egg-rr47.2%
Final simplification76.3%
NOTE: 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)))
(if (<= t_0 2e+263) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A))))))))assert(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 if (t_0 <= 2e+263) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: 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 if (t_0 <= 2d+263) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert 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 if (t_0 <= 2e+263) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[V, l] = sort([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)) elif t_0 <= 2e+263: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
V, l = sort([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))); elseif (t_0 <= 2e+263) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
V, l = num2cell(sort([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));
elseif (t_0 <= 2e+263)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: 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], If[LessEqual[t$95$0, 2e+263], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([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{elif}\;t_0 \leq 2 \cdot 10^{+263}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 18.7%
clear-num18.7%
sqrt-div18.7%
metadata-eval18.7%
associate-*r/18.7%
*-commutative18.7%
*-un-lft-identity18.7%
associate-/l*39.8%
associate-/r/39.8%
Applied egg-rr39.8%
Taylor expanded in c0 around 0 18.7%
associate-/r*39.9%
Simplified39.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.00000000000000003e263Initial program 99.3%
if 2.00000000000000003e263 < (/.f64 A (*.f64 V l)) Initial program 35.6%
pow1/235.6%
associate-/r*46.7%
Applied egg-rr46.7%
unpow1/246.7%
clear-num46.7%
metadata-eval46.7%
associate-/l/46.7%
*-commutative46.7%
sqrt-div50.6%
metadata-eval50.6%
metadata-eval50.6%
div-inv50.6%
*-commutative50.6%
clear-num50.6%
div-inv50.6%
associate-/r/53.6%
Applied egg-rr53.6%
Final simplification76.6%
NOTE: 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(V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (l * V)));
}
NOTE: 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 V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (l * V)));
}
[V, l] = sort([V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (l * V)))
V, l = sort([V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(l * V)))) end
V, l = num2cell(sort([V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (l * V)));
end
NOTE: 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}
[V, l] = \mathsf{sort}([V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}
\end{array}
Initial program 68.1%
Final simplification68.1%
herbie shell --seed 2023301
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))