
(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 14 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 (<= (* V l) -1e+240)
(* c0 (/ (sqrt (/ (- A) l)) (sqrt (- V))))
(if (<= (* V l) -4e-262)
(* c0 (* (pow (* V (- l)) -0.5) (pow (/ -1.0 A) -0.5)))
(if (<= (* V l) 1e-292)
(* c0 (pow (/ V (/ A l)) -0.5))
(if (<= (* V l) 5e+300)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(/ c0 (sqrt (* l (/ V A)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+240) {
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
} else if ((V * l) <= -4e-262) {
tmp = c0 * (pow((V * -l), -0.5) * pow((-1.0 / A), -0.5));
} else if ((V * l) <= 1e-292) {
tmp = c0 * pow((V / (A / l)), -0.5);
} else if ((V * l) <= 5e+300) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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) :: tmp
if ((v * l) <= (-1d+240)) then
tmp = c0 * (sqrt((-a / l)) / sqrt(-v))
else if ((v * l) <= (-4d-262)) then
tmp = c0 * (((v * -l) ** (-0.5d0)) * (((-1.0d0) / a) ** (-0.5d0)))
else if ((v * l) <= 1d-292) then
tmp = c0 * ((v / (a / l)) ** (-0.5d0))
else if ((v * l) <= 5d+300) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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 tmp;
if ((V * l) <= -1e+240) {
tmp = c0 * (Math.sqrt((-A / l)) / Math.sqrt(-V));
} else if ((V * l) <= -4e-262) {
tmp = c0 * (Math.pow((V * -l), -0.5) * Math.pow((-1.0 / A), -0.5));
} else if ((V * l) <= 1e-292) {
tmp = c0 * Math.pow((V / (A / l)), -0.5);
} else if ((V * l) <= 5e+300) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+240: tmp = c0 * (math.sqrt((-A / l)) / math.sqrt(-V)) elif (V * l) <= -4e-262: tmp = c0 * (math.pow((V * -l), -0.5) * math.pow((-1.0 / A), -0.5)) elif (V * l) <= 1e-292: tmp = c0 * math.pow((V / (A / l)), -0.5) elif (V * l) <= 5e+300: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e+240) tmp = Float64(c0 * Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -4e-262) tmp = Float64(c0 * Float64((Float64(V * Float64(-l)) ^ -0.5) * (Float64(-1.0 / A) ^ -0.5))); elseif (Float64(V * l) <= 1e-292) tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5)); elseif (Float64(V * l) <= 5e+300) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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)
tmp = 0.0;
if ((V * l) <= -1e+240)
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
elseif ((V * l) <= -4e-262)
tmp = c0 * (((V * -l) ^ -0.5) * ((-1.0 / A) ^ -0.5));
elseif ((V * l) <= 1e-292)
tmp = c0 * ((V / (A / l)) ^ -0.5);
elseif ((V * l) <= 5e+300)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+240], N[(c0 * N[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-262], N[(c0 * N[(N[Power[N[(V * (-l)), $MachinePrecision], -0.5], $MachinePrecision] * N[Power[N[(-1.0 / A), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-292], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+300], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+240}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-262}:\\
\;\;\;\;c0 \cdot \left({\left(V \cdot \left(-\ell\right)\right)}^{-0.5} \cdot {\left(\frac{-1}{A}\right)}^{-0.5}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-292}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+300}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.00000000000000001e240Initial program 51.9%
associate-/r*80.5%
div-inv80.4%
Applied egg-rr80.4%
un-div-inv80.5%
Applied egg-rr80.5%
associate-/r*51.9%
associate-/l/80.4%
frac-2neg80.4%
sqrt-div19.9%
distribute-neg-frac19.9%
Applied egg-rr19.9%
if -1.00000000000000001e240 < (*.f64 V l) < -4.00000000000000005e-262Initial program 89.7%
pow1/289.7%
clear-num89.7%
inv-pow89.7%
pow-pow90.7%
associate-/l*77.3%
metadata-eval77.3%
Applied egg-rr77.3%
associate-/l*90.7%
*-lft-identity90.7%
times-frac78.3%
/-rgt-identity78.3%
Simplified78.3%
Taylor expanded in V around 0 90.7%
associate-*l/79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in A around -inf 92.7%
distribute-lft-in92.7%
exp-sum93.4%
*-commutative93.4%
mul-1-neg93.4%
*-commutative93.4%
exp-to-pow93.8%
*-commutative93.8%
distribute-rgt-neg-in93.8%
*-commutative93.8%
exp-to-pow99.5%
Simplified99.5%
if -4.00000000000000005e-262 < (*.f64 V l) < 1.0000000000000001e-292Initial program 48.0%
pow1/248.0%
clear-num48.0%
inv-pow48.0%
pow-pow48.0%
associate-/l*69.2%
metadata-eval69.2%
Applied egg-rr69.2%
if 1.0000000000000001e-292 < (*.f64 V l) < 5.00000000000000026e300Initial program 85.1%
sqrt-div99.5%
associate-*r/96.8%
Applied egg-rr96.8%
*-commutative96.8%
associate-*l/99.5%
Simplified99.5%
if 5.00000000000000026e300 < (*.f64 V l) Initial program 39.2%
associate-/r*82.2%
div-inv82.2%
Applied egg-rr82.2%
un-div-inv82.2%
Applied egg-rr82.2%
clear-num82.2%
associate-/r*82.1%
sqrt-div82.2%
metadata-eval82.2%
un-div-inv82.3%
associate-*l/39.2%
associate-/l*82.2%
div-inv82.1%
clear-num82.1%
Applied egg-rr82.1%
Taylor expanded in V around 0 39.2%
associate-*l/82.2%
*-commutative82.2%
Simplified82.3%
Final simplification88.2%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -3e+173)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -5e-48)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 1e-303)
(* c0 (pow (* V (/ l A)) -0.5))
(if (<= (* V l) 5e+203)
(* (sqrt A) (/ c0 (sqrt (* V l))))
(* c0 (pow (* l (/ V A)) -0.5)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -3e+173) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -5e-48) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 1e-303) {
tmp = c0 * pow((V * (l / A)), -0.5);
} else if ((V * l) <= 5e+203) {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
} else {
tmp = c0 * pow((l * (V / 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) :: tmp
if ((v * l) <= (-3d+173)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-5d-48)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 1d-303) then
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
else if ((v * l) <= 5d+203) then
tmp = sqrt(a) * (c0 / sqrt((v * l)))
else
tmp = c0 * ((l * (v / 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 tmp;
if ((V * l) <= -3e+173) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -5e-48) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 1e-303) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} else if ((V * l) <= 5e+203) {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.pow((l * (V / A)), -0.5);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -3e+173: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -5e-48: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 1e-303: tmp = c0 * math.pow((V * (l / A)), -0.5) elif (V * l) <= 5e+203: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) else: tmp = c0 * math.pow((l * (V / A)), -0.5) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -3e+173) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -5e-48) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 1e-303) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); elseif (Float64(V * l) <= 5e+203) tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); else tmp = Float64(c0 * (Float64(l * Float64(V / A)) ^ -0.5)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -3e+173)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -5e-48)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 1e-303)
tmp = c0 * ((V * (l / A)) ^ -0.5);
elseif ((V * l) <= 5e+203)
tmp = sqrt(A) * (c0 / sqrt((V * l)));
else
tmp = c0 * ((l * (V / 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_] := If[LessEqual[N[(V * l), $MachinePrecision], -3e+173], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-48], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-303], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+203], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -3 \cdot 10^{+173}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-48}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-303}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+203}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(\ell \cdot \frac{V}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.9999999999999998e173Initial program 61.4%
associate-/r*80.5%
sqrt-div39.9%
Applied egg-rr39.9%
if -2.9999999999999998e173 < (*.f64 V l) < -4.9999999999999999e-48Initial program 99.8%
if -4.9999999999999999e-48 < (*.f64 V l) < 9.99999999999999931e-304Initial program 57.9%
pow1/257.9%
clear-num57.9%
inv-pow57.9%
pow-pow59.3%
associate-/l*68.7%
metadata-eval68.7%
Applied egg-rr68.7%
associate-/l*59.3%
*-lft-identity59.3%
times-frac70.0%
/-rgt-identity70.0%
Simplified70.0%
if 9.99999999999999931e-304 < (*.f64 V l) < 4.99999999999999994e203Initial program 85.2%
sqrt-div99.5%
associate-*r/96.6%
Applied egg-rr96.6%
associate-*l/96.4%
Simplified96.4%
if 4.99999999999999994e203 < (*.f64 V l) Initial program 57.3%
pow1/257.3%
clear-num57.1%
inv-pow57.1%
pow-pow57.3%
associate-/l*84.9%
metadata-eval84.9%
Applied egg-rr84.9%
associate-/l*57.3%
*-lft-identity57.3%
times-frac84.8%
/-rgt-identity84.8%
Simplified84.8%
Taylor expanded in V around 0 57.3%
associate-*l/84.8%
*-commutative84.8%
Simplified84.8%
Final simplification83.3%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -3e+173)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -2e-59)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 1e-292)
(* c0 (pow (/ V (/ A l)) -0.5))
(if (<= (* V l) 5e+300)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(/ c0 (sqrt (* l (/ V A)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -3e+173) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -2e-59) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 1e-292) {
tmp = c0 * pow((V / (A / l)), -0.5);
} else if ((V * l) <= 5e+300) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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) :: tmp
if ((v * l) <= (-3d+173)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-2d-59)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 1d-292) then
tmp = c0 * ((v / (a / l)) ** (-0.5d0))
else if ((v * l) <= 5d+300) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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 tmp;
if ((V * l) <= -3e+173) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -2e-59) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 1e-292) {
tmp = c0 * Math.pow((V / (A / l)), -0.5);
} else if ((V * l) <= 5e+300) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -3e+173: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -2e-59: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 1e-292: tmp = c0 * math.pow((V / (A / l)), -0.5) elif (V * l) <= 5e+300: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -3e+173) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -2e-59) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 1e-292) tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5)); elseif (Float64(V * l) <= 5e+300) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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)
tmp = 0.0;
if ((V * l) <= -3e+173)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -2e-59)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 1e-292)
tmp = c0 * ((V / (A / l)) ^ -0.5);
elseif ((V * l) <= 5e+300)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -3e+173], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-59], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-292], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+300], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;V \cdot \ell \leq -3 \cdot 10^{+173}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-59}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-292}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+300}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.9999999999999998e173Initial program 61.4%
associate-/r*80.5%
sqrt-div39.9%
Applied egg-rr39.9%
if -2.9999999999999998e173 < (*.f64 V l) < -2.0000000000000001e-59Initial program 99.8%
if -2.0000000000000001e-59 < (*.f64 V l) < 1.0000000000000001e-292Initial program 59.3%
pow1/259.3%
clear-num59.3%
inv-pow59.3%
pow-pow60.6%
associate-/l*69.7%
metadata-eval69.7%
Applied egg-rr69.7%
if 1.0000000000000001e-292 < (*.f64 V l) < 5.00000000000000026e300Initial program 85.1%
sqrt-div99.5%
associate-*r/96.8%
Applied egg-rr96.8%
*-commutative96.8%
associate-*l/99.5%
Simplified99.5%
if 5.00000000000000026e300 < (*.f64 V l) Initial program 39.2%
associate-/r*82.2%
div-inv82.2%
Applied egg-rr82.2%
un-div-inv82.2%
Applied egg-rr82.2%
clear-num82.2%
associate-/r*82.1%
sqrt-div82.2%
metadata-eval82.2%
un-div-inv82.3%
associate-*l/39.2%
associate-/l*82.2%
div-inv82.1%
clear-num82.1%
Applied egg-rr82.1%
Taylor expanded in V around 0 39.2%
associate-*l/82.2%
*-commutative82.2%
Simplified82.3%
Final simplification84.5%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -3e+173)
(/ c0 (/ (sqrt l) (sqrt (/ A V))))
(if (<= (* V l) -2e-59)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 1e-292)
(* c0 (pow (/ V (/ A l)) -0.5))
(if (<= (* V l) 5e+300)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(/ c0 (sqrt (* l (/ V A)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -3e+173) {
tmp = c0 / (sqrt(l) / sqrt((A / V)));
} else if ((V * l) <= -2e-59) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 1e-292) {
tmp = c0 * pow((V / (A / l)), -0.5);
} else if ((V * l) <= 5e+300) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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) :: tmp
if ((v * l) <= (-3d+173)) then
tmp = c0 / (sqrt(l) / sqrt((a / v)))
else if ((v * l) <= (-2d-59)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 1d-292) then
tmp = c0 * ((v / (a / l)) ** (-0.5d0))
else if ((v * l) <= 5d+300) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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 tmp;
if ((V * l) <= -3e+173) {
tmp = c0 / (Math.sqrt(l) / Math.sqrt((A / V)));
} else if ((V * l) <= -2e-59) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 1e-292) {
tmp = c0 * Math.pow((V / (A / l)), -0.5);
} else if ((V * l) <= 5e+300) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -3e+173: tmp = c0 / (math.sqrt(l) / math.sqrt((A / V))) elif (V * l) <= -2e-59: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 1e-292: tmp = c0 * math.pow((V / (A / l)), -0.5) elif (V * l) <= 5e+300: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -3e+173) tmp = Float64(c0 / Float64(sqrt(l) / sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -2e-59) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 1e-292) tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5)); elseif (Float64(V * l) <= 5e+300) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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)
tmp = 0.0;
if ((V * l) <= -3e+173)
tmp = c0 / (sqrt(l) / sqrt((A / V)));
elseif ((V * l) <= -2e-59)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 1e-292)
tmp = c0 * ((V / (A / l)) ^ -0.5);
elseif ((V * l) <= 5e+300)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -3e+173], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-59], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-292], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+300], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;V \cdot \ell \leq -3 \cdot 10^{+173}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-59}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-292}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+300}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.9999999999999998e173Initial program 61.4%
associate-/r*80.5%
div-inv80.4%
Applied egg-rr80.4%
un-div-inv80.5%
Applied egg-rr80.5%
sqrt-div39.9%
associate-*r/39.7%
Applied egg-rr39.7%
associate-/l*39.8%
Simplified39.8%
if -2.9999999999999998e173 < (*.f64 V l) < -2.0000000000000001e-59Initial program 99.8%
if -2.0000000000000001e-59 < (*.f64 V l) < 1.0000000000000001e-292Initial program 59.3%
pow1/259.3%
clear-num59.3%
inv-pow59.3%
pow-pow60.6%
associate-/l*69.7%
metadata-eval69.7%
Applied egg-rr69.7%
if 1.0000000000000001e-292 < (*.f64 V l) < 5.00000000000000026e300Initial program 85.1%
sqrt-div99.5%
associate-*r/96.8%
Applied egg-rr96.8%
*-commutative96.8%
associate-*l/99.5%
Simplified99.5%
if 5.00000000000000026e300 < (*.f64 V l) Initial program 39.2%
associate-/r*82.2%
div-inv82.2%
Applied egg-rr82.2%
un-div-inv82.2%
Applied egg-rr82.2%
clear-num82.2%
associate-/r*82.1%
sqrt-div82.2%
metadata-eval82.2%
un-div-inv82.3%
associate-*l/39.2%
associate-/l*82.2%
div-inv82.1%
clear-num82.1%
Applied egg-rr82.1%
Taylor expanded in V around 0 39.2%
associate-*l/82.2%
*-commutative82.2%
Simplified82.3%
Final simplification84.5%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -4e+186)
(* (* c0 (sqrt (/ A V))) (pow l -0.5))
(if (<= (* V l) -2e-59)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 1e-292)
(* c0 (pow (/ V (/ A l)) -0.5))
(if (<= (* V l) 5e+300)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(/ c0 (sqrt (* l (/ V A)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -4e+186) {
tmp = (c0 * sqrt((A / V))) * pow(l, -0.5);
} else if ((V * l) <= -2e-59) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 1e-292) {
tmp = c0 * pow((V / (A / l)), -0.5);
} else if ((V * l) <= 5e+300) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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) :: tmp
if ((v * l) <= (-4d+186)) then
tmp = (c0 * sqrt((a / v))) * (l ** (-0.5d0))
else if ((v * l) <= (-2d-59)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 1d-292) then
tmp = c0 * ((v / (a / l)) ** (-0.5d0))
else if ((v * l) <= 5d+300) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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 tmp;
if ((V * l) <= -4e+186) {
tmp = (c0 * Math.sqrt((A / V))) * Math.pow(l, -0.5);
} else if ((V * l) <= -2e-59) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 1e-292) {
tmp = c0 * Math.pow((V / (A / l)), -0.5);
} else if ((V * l) <= 5e+300) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -4e+186: tmp = (c0 * math.sqrt((A / V))) * math.pow(l, -0.5) elif (V * l) <= -2e-59: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 1e-292: tmp = c0 * math.pow((V / (A / l)), -0.5) elif (V * l) <= 5e+300: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -4e+186) tmp = Float64(Float64(c0 * sqrt(Float64(A / V))) * (l ^ -0.5)); elseif (Float64(V * l) <= -2e-59) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 1e-292) tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5)); elseif (Float64(V * l) <= 5e+300) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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)
tmp = 0.0;
if ((V * l) <= -4e+186)
tmp = (c0 * sqrt((A / V))) * (l ^ -0.5);
elseif ((V * l) <= -2e-59)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 1e-292)
tmp = c0 * ((V / (A / l)) ^ -0.5);
elseif ((V * l) <= 5e+300)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -4e+186], N[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-59], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-292], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+300], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+186}:\\
\;\;\;\;\left(c0 \cdot \sqrt{\frac{A}{V}}\right) \cdot {\ell}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-59}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-292}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+300}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -3.99999999999999992e186Initial program 58.7%
add-sqr-sqrt40.9%
sqrt-unprod37.8%
pow1/237.8%
*-commutative37.8%
*-commutative37.8%
swap-sqr37.1%
add-sqr-sqrt37.1%
Applied egg-rr37.1%
unpow1/237.1%
Simplified37.1%
*-commutative37.1%
sqrt-prod37.1%
sqrt-prod18.7%
associate-/r*35.8%
un-div-inv35.8%
add-sqr-sqrt79.1%
sqrt-prod35.5%
associate-*r*35.7%
inv-pow35.7%
sqrt-pow135.7%
metadata-eval35.7%
Applied egg-rr35.7%
if -3.99999999999999992e186 < (*.f64 V l) < -2.0000000000000001e-59Initial program 99.8%
if -2.0000000000000001e-59 < (*.f64 V l) < 1.0000000000000001e-292Initial program 59.3%
pow1/259.3%
clear-num59.3%
inv-pow59.3%
pow-pow60.6%
associate-/l*69.7%
metadata-eval69.7%
Applied egg-rr69.7%
if 1.0000000000000001e-292 < (*.f64 V l) < 5.00000000000000026e300Initial program 85.1%
sqrt-div99.5%
associate-*r/96.8%
Applied egg-rr96.8%
*-commutative96.8%
associate-*l/99.5%
Simplified99.5%
if 5.00000000000000026e300 < (*.f64 V l) Initial program 39.2%
associate-/r*82.2%
div-inv82.2%
Applied egg-rr82.2%
un-div-inv82.2%
Applied egg-rr82.2%
clear-num82.2%
associate-/r*82.1%
sqrt-div82.2%
metadata-eval82.2%
un-div-inv82.3%
associate-*l/39.2%
associate-/l*82.2%
div-inv82.1%
clear-num82.1%
Applied egg-rr82.1%
Taylor expanded in V around 0 39.2%
associate-*l/82.2%
*-commutative82.2%
Simplified82.3%
Final simplification84.5%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -4e+186)
(* (* c0 (sqrt (/ A V))) (pow l -0.5))
(if (<= (* V l) -4e-262)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 1e-292)
(* c0 (pow (/ V (/ A l)) -0.5))
(if (<= (* V l) 5e+300)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(/ c0 (sqrt (* l (/ V A)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -4e+186) {
tmp = (c0 * sqrt((A / V))) * pow(l, -0.5);
} else if ((V * l) <= -4e-262) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 1e-292) {
tmp = c0 * pow((V / (A / l)), -0.5);
} else if ((V * l) <= 5e+300) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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) :: tmp
if ((v * l) <= (-4d+186)) then
tmp = (c0 * sqrt((a / v))) * (l ** (-0.5d0))
else if ((v * l) <= (-4d-262)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 1d-292) then
tmp = c0 * ((v / (a / l)) ** (-0.5d0))
else if ((v * l) <= 5d+300) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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 tmp;
if ((V * l) <= -4e+186) {
tmp = (c0 * Math.sqrt((A / V))) * Math.pow(l, -0.5);
} else if ((V * l) <= -4e-262) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 1e-292) {
tmp = c0 * Math.pow((V / (A / l)), -0.5);
} else if ((V * l) <= 5e+300) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -4e+186: tmp = (c0 * math.sqrt((A / V))) * math.pow(l, -0.5) elif (V * l) <= -4e-262: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 1e-292: tmp = c0 * math.pow((V / (A / l)), -0.5) elif (V * l) <= 5e+300: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -4e+186) tmp = Float64(Float64(c0 * sqrt(Float64(A / V))) * (l ^ -0.5)); elseif (Float64(V * l) <= -4e-262) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 1e-292) tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5)); elseif (Float64(V * l) <= 5e+300) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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)
tmp = 0.0;
if ((V * l) <= -4e+186)
tmp = (c0 * sqrt((A / V))) * (l ^ -0.5);
elseif ((V * l) <= -4e-262)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 1e-292)
tmp = c0 * ((V / (A / l)) ^ -0.5);
elseif ((V * l) <= 5e+300)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -4e+186], N[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-262], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-292], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+300], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+186}:\\
\;\;\;\;\left(c0 \cdot \sqrt{\frac{A}{V}}\right) \cdot {\ell}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-262}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-292}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+300}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -3.99999999999999992e186Initial program 58.7%
add-sqr-sqrt40.9%
sqrt-unprod37.8%
pow1/237.8%
*-commutative37.8%
*-commutative37.8%
swap-sqr37.1%
add-sqr-sqrt37.1%
Applied egg-rr37.1%
unpow1/237.1%
Simplified37.1%
*-commutative37.1%
sqrt-prod37.1%
sqrt-prod18.7%
associate-/r*35.8%
un-div-inv35.8%
add-sqr-sqrt79.1%
sqrt-prod35.5%
associate-*r*35.7%
inv-pow35.7%
sqrt-pow135.7%
metadata-eval35.7%
Applied egg-rr35.7%
if -3.99999999999999992e186 < (*.f64 V l) < -4.00000000000000005e-262Initial program 91.2%
frac-2neg91.2%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -4.00000000000000005e-262 < (*.f64 V l) < 1.0000000000000001e-292Initial program 48.0%
pow1/248.0%
clear-num48.0%
inv-pow48.0%
pow-pow48.0%
associate-/l*69.2%
metadata-eval69.2%
Applied egg-rr69.2%
if 1.0000000000000001e-292 < (*.f64 V l) < 5.00000000000000026e300Initial program 85.1%
sqrt-div99.5%
associate-*r/96.8%
Applied egg-rr96.8%
*-commutative96.8%
associate-*l/99.5%
Simplified99.5%
if 5.00000000000000026e300 < (*.f64 V l) Initial program 39.2%
associate-/r*82.2%
div-inv82.2%
Applied egg-rr82.2%
un-div-inv82.2%
Applied egg-rr82.2%
clear-num82.2%
associate-/r*82.1%
sqrt-div82.2%
metadata-eval82.2%
un-div-inv82.3%
associate-*l/39.2%
associate-/l*82.2%
div-inv82.1%
clear-num82.1%
Applied egg-rr82.1%
Taylor expanded in V around 0 39.2%
associate-*l/82.2%
*-commutative82.2%
Simplified82.3%
Final simplification87.4%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -1e+240)
(* c0 (/ (sqrt (/ (- A) l)) (sqrt (- V))))
(if (<= (* V l) -4e-262)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 1e-292)
(* c0 (pow (/ V (/ A l)) -0.5))
(if (<= (* V l) 5e+300)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(/ c0 (sqrt (* l (/ V A)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+240) {
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
} else if ((V * l) <= -4e-262) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 1e-292) {
tmp = c0 * pow((V / (A / l)), -0.5);
} else if ((V * l) <= 5e+300) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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) :: tmp
if ((v * l) <= (-1d+240)) then
tmp = c0 * (sqrt((-a / l)) / sqrt(-v))
else if ((v * l) <= (-4d-262)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 1d-292) then
tmp = c0 * ((v / (a / l)) ** (-0.5d0))
else if ((v * l) <= 5d+300) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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 tmp;
if ((V * l) <= -1e+240) {
tmp = c0 * (Math.sqrt((-A / l)) / Math.sqrt(-V));
} else if ((V * l) <= -4e-262) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 1e-292) {
tmp = c0 * Math.pow((V / (A / l)), -0.5);
} else if ((V * l) <= 5e+300) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+240: tmp = c0 * (math.sqrt((-A / l)) / math.sqrt(-V)) elif (V * l) <= -4e-262: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 1e-292: tmp = c0 * math.pow((V / (A / l)), -0.5) elif (V * l) <= 5e+300: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e+240) tmp = Float64(c0 * Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -4e-262) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 1e-292) tmp = Float64(c0 * (Float64(V / Float64(A / l)) ^ -0.5)); elseif (Float64(V * l) <= 5e+300) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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)
tmp = 0.0;
if ((V * l) <= -1e+240)
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
elseif ((V * l) <= -4e-262)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 1e-292)
tmp = c0 * ((V / (A / l)) ^ -0.5);
elseif ((V * l) <= 5e+300)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+240], N[(c0 * N[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-262], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e-292], N[(c0 * N[Power[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+300], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $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}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+240}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-262}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{-292}:\\
\;\;\;\;c0 \cdot {\left(\frac{V}{\frac{A}{\ell}}\right)}^{-0.5}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+300}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.00000000000000001e240Initial program 51.9%
associate-/r*80.5%
div-inv80.4%
Applied egg-rr80.4%
un-div-inv80.5%
Applied egg-rr80.5%
associate-/r*51.9%
associate-/l/80.4%
frac-2neg80.4%
sqrt-div19.9%
distribute-neg-frac19.9%
Applied egg-rr19.9%
if -1.00000000000000001e240 < (*.f64 V l) < -4.00000000000000005e-262Initial program 89.7%
frac-2neg89.7%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -4.00000000000000005e-262 < (*.f64 V l) < 1.0000000000000001e-292Initial program 48.0%
pow1/248.0%
clear-num48.0%
inv-pow48.0%
pow-pow48.0%
associate-/l*69.2%
metadata-eval69.2%
Applied egg-rr69.2%
if 1.0000000000000001e-292 < (*.f64 V l) < 5.00000000000000026e300Initial program 85.1%
sqrt-div99.5%
associate-*r/96.8%
Applied egg-rr96.8%
*-commutative96.8%
associate-*l/99.5%
Simplified99.5%
if 5.00000000000000026e300 < (*.f64 V l) Initial program 39.2%
associate-/r*82.2%
div-inv82.2%
Applied egg-rr82.2%
un-div-inv82.2%
Applied egg-rr82.2%
clear-num82.2%
associate-/r*82.1%
sqrt-div82.2%
metadata-eval82.2%
un-div-inv82.3%
associate-*l/39.2%
associate-/l*82.2%
div-inv82.1%
clear-num82.1%
Applied egg-rr82.1%
Taylor expanded in V around 0 39.2%
associate-*l/82.2%
*-commutative82.2%
Simplified82.3%
Final simplification88.2%
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 (* V l))))
(if (<= t_0 0.0)
(/ c0 (sqrt (* l (/ V A))))
(if (<= t_0 4e+292) (* 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 / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / sqrt((l * (V / A)));
} else if (t_0 <= 4e+292) {
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 / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 / sqrt((l * (v / a)))
else if (t_0 <= 4d+292) 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 / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if (t_0 <= 4e+292) {
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 / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 / math.sqrt((l * (V / A))) elif t_0 <= 4e+292: 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(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (t_0 <= 4e+292) 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 / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 / sqrt((l * (V / A)));
elseif (t_0 <= 4e+292)
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[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+292], 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}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;t_0 \leq 4 \cdot 10^{+292}:\\
\;\;\;\;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 46.7%
associate-/r*73.6%
div-inv73.5%
Applied egg-rr73.5%
un-div-inv73.6%
Applied egg-rr73.6%
clear-num73.6%
associate-/r*73.6%
sqrt-div73.5%
metadata-eval73.5%
un-div-inv73.7%
associate-*l/46.7%
associate-/l*73.6%
div-inv73.6%
clear-num73.6%
Applied egg-rr73.6%
Taylor expanded in V around 0 46.7%
associate-*l/73.6%
*-commutative73.6%
Simplified73.7%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.0000000000000001e292Initial program 99.3%
if 4.0000000000000001e292 < (/.f64 A (*.f64 V l)) Initial program 37.1%
pow1/237.1%
clear-num37.1%
inv-pow37.1%
pow-pow38.5%
associate-/l*49.6%
metadata-eval49.6%
Applied egg-rr49.6%
associate-/l*38.5%
*-lft-identity38.5%
times-frac51.0%
/-rgt-identity51.0%
Simplified51.0%
Final simplification84.2%
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 (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 2e+306)))
(* 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 / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 2e+306)) {
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 / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 2d+306))) 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 / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 2e+306)) {
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 / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 2e+306): 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(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 2e+306)) 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 / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 2e+306)))
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[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 2e+306]], $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}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 2 \cdot 10^{+306}\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 2.00000000000000003e306 < (/.f64 A (*.f64 V l)) Initial program 40.7%
associate-/r*59.9%
div-inv59.8%
Applied egg-rr59.8%
un-div-inv59.9%
Applied egg-rr59.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.00000000000000003e306Initial program 99.1%
Final simplification83.8%
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 (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 4e+292)))
(* c0 (sqrt (/ (/ A l) V)))
(* c0 (sqrt t_0)))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+292)) {
tmp = c0 * sqrt(((A / l) / V));
} 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 / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+292))) then
tmp = c0 * sqrt(((a / l) / v))
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 / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+292)) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 4e+292): tmp = c0 * math.sqrt(((A / l) / V)) 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(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 4e+292)) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); 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 / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 4e+292)))
tmp = c0 * sqrt(((A / l) / V));
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[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+292]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $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}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 4 \cdot 10^{+292}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 4.0000000000000001e292 < (/.f64 A (*.f64 V l)) Initial program 41.5%
associate-/r*59.7%
div-inv59.7%
Applied egg-rr59.7%
associate-*l/60.6%
div-inv60.6%
Applied egg-rr60.6%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.0000000000000001e292Initial program 99.3%
Final simplification83.9%
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 (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 4e+292)))
(/ c0 (sqrt (* V (/ l A))))
(* c0 (sqrt t_0)))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+292)) {
tmp = c0 / sqrt((V * (l / A)));
} 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 / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+292))) then
tmp = c0 / sqrt((v * (l / a)))
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 / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+292)) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 4e+292): tmp = c0 / math.sqrt((V * (l / A))) 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(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 4e+292)) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); 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 / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 4e+292)))
tmp = c0 / sqrt((V * (l / A)));
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[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+292]], $MachinePrecision]], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 4 \cdot 10^{+292}\right):\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 4.0000000000000001e292 < (/.f64 A (*.f64 V l)) Initial program 41.5%
associate-/r*59.7%
div-inv59.7%
Applied egg-rr59.7%
un-div-inv59.7%
Applied egg-rr59.7%
clear-num59.7%
associate-/r*59.7%
sqrt-div60.4%
metadata-eval60.4%
un-div-inv60.5%
associate-*l/42.3%
associate-/l*60.7%
div-inv60.6%
clear-num61.4%
Applied egg-rr61.4%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.0000000000000001e292Initial program 99.3%
Final simplification84.2%
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 (* V l))))
(if (<= t_0 0.0)
(/ c0 (sqrt (* l (/ V A))))
(if (<= t_0 4e+292) (* 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 / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / sqrt((l * (V / A)));
} else if (t_0 <= 4e+292) {
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 / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 / sqrt((l * (v / a)))
else if (t_0 <= 4d+292) 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 / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if (t_0 <= 4e+292) {
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 / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 / math.sqrt((l * (V / A))) elif t_0 <= 4e+292: 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(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (t_0 <= 4e+292) 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 / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 / sqrt((l * (V / A)));
elseif (t_0 <= 4e+292)
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[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+292], 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}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;t_0 \leq 4 \cdot 10^{+292}:\\
\;\;\;\;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 46.7%
associate-/r*73.6%
div-inv73.5%
Applied egg-rr73.5%
un-div-inv73.6%
Applied egg-rr73.6%
clear-num73.6%
associate-/r*73.6%
sqrt-div73.5%
metadata-eval73.5%
un-div-inv73.7%
associate-*l/46.7%
associate-/l*73.6%
div-inv73.6%
clear-num73.6%
Applied egg-rr73.6%
Taylor expanded in V around 0 46.7%
associate-*l/73.6%
*-commutative73.6%
Simplified73.7%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.0000000000000001e292Initial program 99.3%
if 4.0000000000000001e292 < (/.f64 A (*.f64 V l)) Initial program 37.1%
associate-/r*47.8%
div-inv47.8%
Applied egg-rr47.8%
un-div-inv47.8%
Applied egg-rr47.8%
clear-num47.8%
associate-/r*47.8%
sqrt-div49.3%
metadata-eval49.3%
un-div-inv49.3%
associate-*l/38.5%
associate-/l*49.6%
div-inv49.6%
clear-num51.0%
Applied egg-rr51.0%
Final simplification84.2%
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 (* V l))))
(if (<= t_0 0.0)
(/ c0 (sqrt (* l (/ V A))))
(if (<= t_0 4e+292) (* c0 (sqrt t_0)) (/ c0 (sqrt (/ V (/ A l))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / sqrt((l * (V / A)));
} else if (t_0 <= 4e+292) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V / (A / 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) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 / sqrt((l * (v / a)))
else if (t_0 <= 4d+292) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v / (a / l)))
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 / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if (t_0 <= 4e+292) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 / math.sqrt((l * (V / A))) elif t_0 <= 4e+292: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V / (A / l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (t_0 <= 4e+292) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 / sqrt((l * (V / A)));
elseif (t_0 <= 4e+292)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V / (A / 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_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+292], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;t_0 \leq 4 \cdot 10^{+292}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 46.7%
associate-/r*73.6%
div-inv73.5%
Applied egg-rr73.5%
un-div-inv73.6%
Applied egg-rr73.6%
clear-num73.6%
associate-/r*73.6%
sqrt-div73.5%
metadata-eval73.5%
un-div-inv73.7%
associate-*l/46.7%
associate-/l*73.6%
div-inv73.6%
clear-num73.6%
Applied egg-rr73.6%
Taylor expanded in V around 0 46.7%
associate-*l/73.6%
*-commutative73.6%
Simplified73.7%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.0000000000000001e292Initial program 99.3%
if 4.0000000000000001e292 < (/.f64 A (*.f64 V l)) Initial program 37.1%
associate-/r*47.8%
div-inv47.8%
Applied egg-rr47.8%
un-div-inv47.8%
Applied egg-rr47.8%
clear-num47.8%
associate-/r*47.8%
sqrt-div49.3%
metadata-eval49.3%
un-div-inv49.3%
associate-*l/38.5%
associate-/l*49.6%
div-inv49.6%
clear-num51.0%
Applied egg-rr51.0%
clear-num49.6%
div-inv49.5%
un-div-inv49.6%
div-inv49.6%
Applied egg-rr49.6%
Final simplification83.9%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
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 / (v * l)))
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[V, l] = sort([V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
V, l = sort([V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
V, l = num2cell(sort([V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
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[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 76.3%
Final simplification76.3%
herbie shell --seed 2023217
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))