
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -5e-310) (/ c0 (/ (sqrt l) (/ (sqrt (- A)) (sqrt (- V))))) (* c0 (/ (sqrt A) (sqrt (* l V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 / (sqrt(l) / (sqrt(-A) / sqrt(-V)));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-5d-310)) then
tmp = c0 / (sqrt(l) / (sqrt(-a) / sqrt(-v)))
else
tmp = c0 * (sqrt(a) / sqrt((l * v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 / (Math.sqrt(l) / (Math.sqrt(-A) / Math.sqrt(-V)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = c0 / (math.sqrt(l) / (math.sqrt(-A) / math.sqrt(-V))) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(c0 / Float64(sqrt(l) / Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -5e-310)
tmp = c0 / (sqrt(l) / (sqrt(-A) / sqrt(-V)));
else
tmp = c0 * (sqrt(A) / sqrt((l * V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -5e-310], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\frac{\sqrt{-A}}{\sqrt{-V}}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 79.2%
associate-/r*78.4%
sqrt-div42.9%
associate-*r/42.1%
Applied egg-rr42.1%
associate-/l*42.9%
Simplified42.9%
frac-2neg42.9%
sqrt-div48.6%
Applied egg-rr48.6%
if -4.999999999999985e-310 < A Initial program 70.3%
sqrt-div86.2%
associate-*r/84.7%
Applied egg-rr84.7%
*-commutative84.7%
associate-/l*83.2%
associate-/r/86.2%
Simplified86.2%
Final simplification66.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) -1e+215)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* l V) -1e-314)
(* c0 (/ (sqrt (- A)) (sqrt (* l (- V)))))
(if (<= (* l V) 0.0)
(/ (pow l -0.5) (/ (sqrt (/ V A)) c0))
(* c0 (/ (sqrt A) (sqrt (* l V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -1e+215) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((l * V) <= -1e-314) {
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
} else if ((l * V) <= 0.0) {
tmp = pow(l, -0.5) / (sqrt((V / A)) / c0);
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((l * v) <= (-1d+215)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((l * v) <= (-1d-314)) then
tmp = c0 * (sqrt(-a) / sqrt((l * -v)))
else if ((l * v) <= 0.0d0) then
tmp = (l ** (-0.5d0)) / (sqrt((v / a)) / c0)
else
tmp = c0 * (sqrt(a) / sqrt((l * v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -1e+215) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((l * V) <= -1e-314) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((l * -V)));
} else if ((l * V) <= 0.0) {
tmp = Math.pow(l, -0.5) / (Math.sqrt((V / A)) / c0);
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -1e+215: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (l * V) <= -1e-314: tmp = c0 * (math.sqrt(-A) / math.sqrt((l * -V))) elif (l * V) <= 0.0: tmp = math.pow(l, -0.5) / (math.sqrt((V / A)) / c0) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= -1e+215) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(l * V) <= -1e-314) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V))))); elseif (Float64(l * V) <= 0.0) tmp = Float64((l ^ -0.5) / Float64(sqrt(Float64(V / A)) / c0)); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((l * V) <= -1e+215)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((l * V) <= -1e-314)
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
elseif ((l * V) <= 0.0)
tmp = (l ^ -0.5) / (sqrt((V / A)) / c0);
else
tmp = c0 * (sqrt(A) / sqrt((l * V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(l * V), $MachinePrecision], -1e+215], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -1e-314], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 0.0], N[(N[Power[l, -0.5], $MachinePrecision] / N[(N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -1 \cdot 10^{+215}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;\ell \cdot V \leq -1 \cdot 10^{-314}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\
\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;\frac{{\ell}^{-0.5}}{\frac{\sqrt{\frac{V}{A}}}{c0}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999907e214Initial program 69.3%
associate-/r*73.1%
sqrt-div36.0%
associate-*r/32.2%
Applied egg-rr32.2%
*-commutative32.2%
associate-/l*35.9%
associate-/r/36.0%
Simplified36.0%
if -9.99999999999999907e214 < (*.f64 V l) < -9.9999999996e-315Initial program 90.0%
frac-2neg90.0%
sqrt-div99.2%
distribute-rgt-neg-in99.2%
Applied egg-rr99.2%
distribute-rgt-neg-out99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
Simplified99.2%
if -9.9999999996e-315 < (*.f64 V l) < -0.0Initial program 46.1%
associate-/r*65.0%
clear-num65.0%
sqrt-div68.6%
metadata-eval68.6%
div-inv68.5%
clear-num68.5%
Applied egg-rr68.5%
associate-*r/46.1%
Applied egg-rr46.1%
un-div-inv46.1%
sqrt-div17.5%
sqrt-prod16.6%
associate-*r/16.6%
sqrt-div39.8%
associate-/l/39.8%
div-inv39.8%
clear-num39.8%
associate-*l/39.8%
*-un-lft-identity39.8%
pow1/239.8%
pow-flip39.9%
metadata-eval39.9%
Applied egg-rr39.9%
if -0.0 < (*.f64 V l) Initial program 71.9%
sqrt-div89.3%
associate-*r/87.6%
Applied egg-rr87.6%
*-commutative87.6%
associate-/l*86.0%
associate-/r/89.3%
Simplified89.3%
Final simplification81.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) -1e-230)
(/ c0 (sqrt (/ (* l V) A)))
(if (<= (* l V) 0.0)
(/ c0 (sqrt (/ V (/ A l))))
(* (sqrt A) (/ c0 (sqrt (* l V)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -1e-230) {
tmp = c0 / sqrt(((l * V) / A));
} else if ((l * V) <= 0.0) {
tmp = c0 / sqrt((V / (A / l)));
} else {
tmp = sqrt(A) * (c0 / sqrt((l * V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((l * v) <= (-1d-230)) then
tmp = c0 / sqrt(((l * v) / a))
else if ((l * v) <= 0.0d0) then
tmp = c0 / sqrt((v / (a / l)))
else
tmp = sqrt(a) * (c0 / sqrt((l * v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -1e-230) {
tmp = c0 / Math.sqrt(((l * V) / A));
} else if ((l * V) <= 0.0) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -1e-230: tmp = c0 / math.sqrt(((l * V) / A)) elif (l * V) <= 0.0: tmp = c0 / math.sqrt((V / (A / l))) else: tmp = math.sqrt(A) * (c0 / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= -1e-230) tmp = Float64(c0 / sqrt(Float64(Float64(l * V) / A))); elseif (Float64(l * V) <= 0.0) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); else tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(l * V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((l * V) <= -1e-230)
tmp = c0 / sqrt(((l * V) / A));
elseif ((l * V) <= 0.0)
tmp = c0 / sqrt((V / (A / l)));
else
tmp = sqrt(A) * (c0 / sqrt((l * V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(l * V), $MachinePrecision], -1e-230], N[(c0 / N[Sqrt[N[(N[(l * V), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -1 \cdot 10^{-230}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell \cdot V}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.00000000000000005e-230Initial program 87.2%
associate-/r*80.8%
clear-num80.8%
sqrt-div80.7%
metadata-eval80.7%
div-inv80.7%
clear-num80.7%
Applied egg-rr80.7%
associate-*r/87.1%
*-commutative87.1%
*-lft-identity87.1%
times-frac77.3%
remove-double-div77.3%
associate-/r*77.3%
*-rgt-identity77.3%
remove-double-div77.3%
Simplified77.3%
expm1-log1p-u62.2%
expm1-udef44.3%
un-div-inv44.3%
clear-num43.5%
un-div-inv43.5%
Applied egg-rr43.5%
expm1-def61.4%
expm1-log1p76.5%
associate-/l*87.2%
*-commutative87.2%
associate-*l/77.3%
Simplified77.3%
associate-*l/87.2%
Applied egg-rr87.2%
if -1.00000000000000005e-230 < (*.f64 V l) < -0.0Initial program 49.8%
associate-/r*64.8%
clear-num64.7%
sqrt-div67.5%
metadata-eval67.5%
div-inv67.5%
clear-num67.5%
Applied egg-rr67.5%
associate-*r/49.8%
*-commutative49.8%
*-lft-identity49.8%
times-frac67.5%
remove-double-div67.5%
associate-/r*67.5%
*-rgt-identity67.5%
remove-double-div67.5%
Simplified67.5%
un-div-inv67.5%
clear-num67.4%
un-div-inv67.5%
Applied egg-rr67.5%
if -0.0 < (*.f64 V l) Initial program 71.9%
associate-/r*63.4%
clear-num63.4%
sqrt-div64.0%
metadata-eval64.0%
div-inv64.0%
clear-num64.2%
Applied egg-rr64.2%
associate-*r/71.2%
*-commutative71.2%
*-lft-identity71.2%
times-frac63.7%
remove-double-div63.7%
associate-/r*63.7%
*-rgt-identity63.7%
remove-double-div63.7%
Simplified63.7%
expm1-log1p-u44.7%
expm1-udef25.2%
un-div-inv25.2%
clear-num25.2%
un-div-inv25.2%
Applied egg-rr25.2%
expm1-def44.8%
expm1-log1p63.8%
associate-/l*71.2%
*-commutative71.2%
associate-*l/63.8%
Simplified63.8%
associate-*l/71.2%
sqrt-div89.3%
*-commutative89.3%
associate-/r/86.1%
*-commutative86.1%
Applied egg-rr86.1%
Final simplification83.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) -1e-230)
(/ c0 (sqrt (/ (* l V) A)))
(if (<= (* l V) 0.0)
(/ c0 (sqrt (/ V (/ A l))))
(* c0 (/ (sqrt A) (sqrt (* l V)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -1e-230) {
tmp = c0 / sqrt(((l * V) / A));
} else if ((l * V) <= 0.0) {
tmp = c0 / sqrt((V / (A / l)));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((l * v) <= (-1d-230)) then
tmp = c0 / sqrt(((l * v) / a))
else if ((l * v) <= 0.0d0) then
tmp = c0 / sqrt((v / (a / l)))
else
tmp = c0 * (sqrt(a) / sqrt((l * v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -1e-230) {
tmp = c0 / Math.sqrt(((l * V) / A));
} else if ((l * V) <= 0.0) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -1e-230: tmp = c0 / math.sqrt(((l * V) / A)) elif (l * V) <= 0.0: tmp = c0 / math.sqrt((V / (A / l))) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= -1e-230) tmp = Float64(c0 / sqrt(Float64(Float64(l * V) / A))); elseif (Float64(l * V) <= 0.0) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((l * V) <= -1e-230)
tmp = c0 / sqrt(((l * V) / A));
elseif ((l * V) <= 0.0)
tmp = c0 / sqrt((V / (A / l)));
else
tmp = c0 * (sqrt(A) / sqrt((l * V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(l * V), $MachinePrecision], -1e-230], N[(c0 / N[Sqrt[N[(N[(l * V), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -1 \cdot 10^{-230}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell \cdot V}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.00000000000000005e-230Initial program 87.2%
associate-/r*80.8%
clear-num80.8%
sqrt-div80.7%
metadata-eval80.7%
div-inv80.7%
clear-num80.7%
Applied egg-rr80.7%
associate-*r/87.1%
*-commutative87.1%
*-lft-identity87.1%
times-frac77.3%
remove-double-div77.3%
associate-/r*77.3%
*-rgt-identity77.3%
remove-double-div77.3%
Simplified77.3%
expm1-log1p-u62.2%
expm1-udef44.3%
un-div-inv44.3%
clear-num43.5%
un-div-inv43.5%
Applied egg-rr43.5%
expm1-def61.4%
expm1-log1p76.5%
associate-/l*87.2%
*-commutative87.2%
associate-*l/77.3%
Simplified77.3%
associate-*l/87.2%
Applied egg-rr87.2%
if -1.00000000000000005e-230 < (*.f64 V l) < -0.0Initial program 49.8%
associate-/r*64.8%
clear-num64.7%
sqrt-div67.5%
metadata-eval67.5%
div-inv67.5%
clear-num67.5%
Applied egg-rr67.5%
associate-*r/49.8%
*-commutative49.8%
*-lft-identity49.8%
times-frac67.5%
remove-double-div67.5%
associate-/r*67.5%
*-rgt-identity67.5%
remove-double-div67.5%
Simplified67.5%
un-div-inv67.5%
clear-num67.4%
un-div-inv67.5%
Applied egg-rr67.5%
if -0.0 < (*.f64 V l) Initial program 71.9%
sqrt-div89.3%
associate-*r/87.6%
Applied egg-rr87.6%
*-commutative87.6%
associate-/l*86.0%
associate-/r/89.3%
Simplified89.3%
Final simplification85.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (* c0 (sqrt (/ A (* l V)))))) (if (<= t_0 5e+274) t_0 (/ c0 (sqrt (/ V (/ A l)))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (l * V)));
double tmp;
if (t_0 <= 5e+274) {
tmp = t_0;
} else {
tmp = c0 / sqrt((V / (A / l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (l * v)))
if (t_0 <= 5d+274) then
tmp = t_0
else
tmp = c0 / sqrt((v / (a / l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (l * V)));
double tmp;
if (t_0 <= 5e+274) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (l * V))) tmp = 0 if t_0 <= 5e+274: tmp = t_0 else: tmp = c0 / math.sqrt((V / (A / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(l * V)))) tmp = 0.0 if (t_0 <= 5e+274) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (l * V)));
tmp = 0.0;
if (t_0 <= 5e+274)
tmp = t_0;
else
tmp = c0 / sqrt((V / (A / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e+274], t$95$0, N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{+274}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.9999999999999998e274Initial program 78.8%
if 4.9999999999999998e274 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 50.9%
associate-/r*61.6%
clear-num61.6%
sqrt-div63.4%
metadata-eval63.4%
div-inv63.4%
clear-num63.4%
Applied egg-rr63.4%
associate-*r/50.9%
*-commutative50.9%
*-lft-identity50.9%
times-frac63.5%
remove-double-div63.4%
associate-/r*63.4%
*-rgt-identity63.4%
remove-double-div63.5%
Simplified63.5%
un-div-inv63.4%
clear-num63.3%
un-div-inv63.4%
Applied egg-rr63.4%
Final simplification76.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -5e-310) (* c0 (/ (pow l -0.5) (sqrt (/ V A)))) (* c0 (/ (sqrt A) (sqrt (* l V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * (pow(l, -0.5) / sqrt((V / A)));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-5d-310)) then
tmp = c0 * ((l ** (-0.5d0)) / sqrt((v / a)))
else
tmp = c0 * (sqrt(a) / sqrt((l * v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * (Math.pow(l, -0.5) / Math.sqrt((V / A)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = c0 * (math.pow(l, -0.5) / math.sqrt((V / A))) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(c0 * Float64((l ^ -0.5) / sqrt(Float64(V / A)))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -5e-310)
tmp = c0 * ((l ^ -0.5) / sqrt((V / A)));
else
tmp = c0 * (sqrt(A) / sqrt((l * V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -5e-310], N[(c0 * N[(N[Power[l, -0.5], $MachinePrecision] / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{{\ell}^{-0.5}}{\sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 79.2%
associate-/r*78.4%
clear-num78.3%
sqrt-div79.1%
metadata-eval79.1%
div-inv79.1%
clear-num79.1%
Applied egg-rr79.1%
inv-pow79.1%
sqrt-prod42.9%
unpow-prod-down42.9%
inv-pow42.9%
pow1/242.9%
pow-flip42.9%
metadata-eval42.9%
Applied egg-rr42.9%
unpow-142.9%
associate-*r/43.0%
*-rgt-identity43.0%
Simplified43.0%
if -4.999999999999985e-310 < A Initial program 70.3%
sqrt-div86.2%
associate-*r/84.7%
Applied egg-rr84.7%
*-commutative84.7%
associate-/l*83.2%
associate-/r/86.2%
Simplified86.2%
Final simplification63.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -5e-310) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (* c0 (/ (sqrt A) (sqrt (* l V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-5d-310)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 * (sqrt(a) / sqrt((l * v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -5e-310)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 * (sqrt(A) / sqrt((l * V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -5e-310], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 79.2%
associate-/r*78.4%
sqrt-div42.9%
associate-*r/42.1%
Applied egg-rr42.1%
*-commutative42.1%
associate-/l*40.2%
associate-/r/42.9%
Simplified42.9%
if -4.999999999999985e-310 < A Initial program 70.3%
sqrt-div86.2%
associate-*r/84.7%
Applied egg-rr84.7%
*-commutative84.7%
associate-/l*83.2%
associate-/r/86.2%
Simplified86.2%
Final simplification63.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -5e-310) (/ c0 (* (sqrt l) (sqrt (/ V A)))) (* c0 (/ (sqrt A) (sqrt (* l V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-5d-310)) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else
tmp = c0 * (sqrt(a) / sqrt((l * v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -5e-310) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -5e-310)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
else
tmp = c0 * (sqrt(A) / sqrt((l * V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -5e-310], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 79.2%
associate-/r*78.4%
clear-num78.3%
sqrt-div79.1%
metadata-eval79.1%
div-inv79.1%
clear-num79.1%
Applied egg-rr79.1%
associate-*r/79.2%
Applied egg-rr79.2%
un-div-inv79.2%
sqrt-div0.0%
sqrt-prod0.0%
associate-*r/0.0%
sqrt-div43.0%
associate-/l/42.1%
div-inv42.1%
clear-num40.8%
frac-times40.5%
metadata-eval40.5%
Applied egg-rr40.5%
associate-/r*40.8%
associate-/l*42.1%
*-lft-identity42.1%
associate-/r*43.0%
Simplified43.0%
if -4.999999999999985e-310 < A Initial program 70.3%
sqrt-div86.2%
associate-*r/84.7%
Applied egg-rr84.7%
*-commutative84.7%
associate-/l*83.2%
associate-/r/86.2%
Simplified86.2%
Final simplification63.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (/ A (* l V)))) (if (<= t_0 1e+295) (* c0 (sqrt t_0)) (* c0 (sqrt (/ (/ A V) l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 1e+295) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * sqrt(((A / V) / l));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (l * v)
if (t_0 <= 1d+295) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * sqrt(((a / v) / l))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 1e+295) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if t_0 <= 1e+295: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.sqrt(((A / V) / l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 1e+295) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if (t_0 <= 1e+295)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * sqrt(((A / V) / l));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e+295], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 10^{+295}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.9999999999999998e294Initial program 86.3%
if 9.9999999999999998e294 < (/.f64 A (*.f64 V l)) Initial program 38.8%
*-commutative38.8%
associate-/l/48.1%
Simplified48.1%
Final simplification77.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (/ A (* l V)))) (if (<= t_0 1e+295) (* c0 (sqrt t_0)) (/ c0 (sqrt (* l (/ V A)))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 1e+295) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (l * v)
if (t_0 <= 1d+295) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 1e+295) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if t_0 <= 1e+295: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 1e+295) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if (t_0 <= 1e+295)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e+295], 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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 10^{+295}:\\
\;\;\;\;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)) < 9.9999999999999998e294Initial program 86.3%
if 9.9999999999999998e294 < (/.f64 A (*.f64 V l)) Initial program 38.8%
associate-/r*48.1%
clear-num48.1%
sqrt-div50.9%
metadata-eval50.9%
div-inv50.8%
clear-num50.8%
Applied egg-rr50.8%
associate-*r/39.8%
Applied egg-rr39.8%
un-div-inv39.8%
associate-/l*50.8%
div-inv50.8%
clear-num50.8%
Applied egg-rr50.8%
Final simplification77.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (/ A (* l V)))) (if (<= t_0 1e+269) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A)))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 1e+269) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (l * v)
if (t_0 <= 1d+269) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 1e+269) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if t_0 <= 1e+269: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 1e+269) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if (t_0 <= 1e+269)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e+269], 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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 10^{+269}:\\
\;\;\;\;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)) < 1e269Initial program 86.1%
if 1e269 < (/.f64 A (*.f64 V l)) Initial program 41.6%
associate-/r*47.5%
clear-num47.5%
sqrt-div50.2%
metadata-eval50.2%
div-inv50.1%
clear-num50.1%
Applied egg-rr50.1%
associate-*r/42.6%
*-commutative42.6%
*-lft-identity42.6%
times-frac52.2%
remove-double-div52.1%
associate-/r*52.1%
*-rgt-identity52.1%
remove-double-div52.2%
Simplified52.2%
expm1-log1p-u25.8%
expm1-udef25.8%
un-div-inv25.8%
clear-num25.8%
un-div-inv25.8%
Applied egg-rr25.8%
expm1-def25.8%
expm1-log1p52.2%
associate-/l*42.6%
*-commutative42.6%
associate-*l/52.2%
Simplified52.2%
Final simplification77.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* l V)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (l * V)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (l * v)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (l * V)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (l * V)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(l * V)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (l * V)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}
\end{array}
Initial program 75.0%
Final simplification75.0%
herbie shell --seed 2024027
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))