
(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 11 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 (<= (* V l) -5e+210)
(* (sqrt (/ A V)) (* c0 (pow l -0.5)))
(if (<= (* V l) -5e-308)
(/ c0 (/ (sqrt (* l (- V))) (sqrt (- A))))
(if (<= (* V l) 2e-314)
(/ c0 (sqrt (/ V (/ A l))))
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+210) {
tmp = sqrt((A / V)) * (c0 * pow(l, -0.5));
} else if ((V * l) <= -5e-308) {
tmp = c0 / (sqrt((l * -V)) / sqrt(-A));
} else if ((V * l) <= 2e-314) {
tmp = c0 / sqrt((V / (A / l)));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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) :: tmp
if ((v * l) <= (-5d+210)) then
tmp = sqrt((a / v)) * (c0 * (l ** (-0.5d0)))
else if ((v * l) <= (-5d-308)) then
tmp = c0 / (sqrt((l * -v)) / sqrt(-a))
else if ((v * l) <= 2d-314) then
tmp = c0 / sqrt((v / (a / l)))
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / 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 tmp;
if ((V * l) <= -5e+210) {
tmp = Math.sqrt((A / V)) * (c0 * Math.pow(l, -0.5));
} else if ((V * l) <= -5e-308) {
tmp = c0 / (Math.sqrt((l * -V)) / Math.sqrt(-A));
} else if ((V * l) <= 2e-314) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e+210: tmp = math.sqrt((A / V)) * (c0 * math.pow(l, -0.5)) elif (V * l) <= -5e-308: tmp = c0 / (math.sqrt((l * -V)) / math.sqrt(-A)) elif (V * l) <= 2e-314: tmp = c0 / math.sqrt((V / (A / l))) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e+210) tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 * (l ^ -0.5))); elseif (Float64(V * l) <= -5e-308) tmp = Float64(c0 / Float64(sqrt(Float64(l * Float64(-V))) / sqrt(Float64(-A)))); elseif (Float64(V * l) <= 2e-314) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e+210)
tmp = sqrt((A / V)) * (c0 * (l ^ -0.5));
elseif ((V * l) <= -5e-308)
tmp = c0 / (sqrt((l * -V)) / sqrt(-A));
elseif ((V * l) <= 2e-314)
tmp = c0 / sqrt((V / (A / l)));
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e+210], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-308], N[(c0 / N[(N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-A)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-314], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+210}:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \left(c0 \cdot {\ell}^{-0.5}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-308}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell \cdot \left(-V\right)}}{\sqrt{-A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-314}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999998e210Initial program 66.4%
associate-/r*85.7%
sqrt-div41.3%
associate-*r/37.5%
Applied egg-rr37.5%
associate-/l*41.2%
Simplified41.2%
div-inv41.3%
clear-num41.3%
sqrt-div85.7%
un-div-inv85.7%
sqrt-prod41.2%
associate-*r*37.5%
inv-pow37.5%
sqrt-pow137.5%
metadata-eval37.5%
Applied egg-rr37.5%
*-commutative37.5%
associate-*l*41.3%
Simplified41.3%
if -4.9999999999999998e210 < (*.f64 V l) < -4.99999999999999955e-308Initial program 87.8%
associate-/r*74.7%
div-inv74.8%
add-cube-cbrt74.2%
times-frac82.5%
pow282.5%
Applied egg-rr82.5%
associate-*l/77.8%
associate-/l/77.8%
associate-*r/77.8%
*-rgt-identity77.8%
*-commutative77.8%
Simplified77.8%
associate-/l/87.1%
*-commutative87.1%
associate-*r*87.2%
unpow287.2%
add-cube-cbrt87.8%
*-commutative87.8%
associate-/r*74.7%
sqrt-div53.2%
clear-num53.1%
div-inv53.2%
sqrt-undiv74.9%
div-inv74.8%
clear-num75.2%
Applied egg-rr75.2%
associate-*r/88.0%
*-commutative88.0%
frac-2neg88.0%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -4.99999999999999955e-308 < (*.f64 V l) < 1.9999999999e-314Initial program 41.7%
associate-/r*75.4%
div-inv75.3%
add-cube-cbrt75.0%
times-frac68.9%
pow268.9%
Applied egg-rr68.9%
associate-*l/68.9%
associate-/l/68.8%
associate-*r/71.7%
*-rgt-identity71.7%
*-commutative71.7%
Simplified71.7%
associate-/l/41.7%
*-commutative41.7%
associate-*r*41.7%
unpow241.7%
add-cube-cbrt41.7%
*-commutative41.7%
associate-/r*75.4%
sqrt-div35.6%
clear-num35.7%
div-inv35.6%
sqrt-undiv78.5%
div-inv78.5%
clear-num78.5%
Applied egg-rr78.5%
*-commutative78.5%
associate-/r/78.5%
Applied egg-rr78.5%
if 1.9999999999e-314 < (*.f64 V l) Initial program 79.2%
div-inv79.1%
sqrt-prod84.4%
associate-/r*87.2%
Applied egg-rr87.2%
Final simplification85.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (or (<= t_0 0.0) (not (<= t_0 5e+263)))
(* c0 (sqrt (/ (/ A V) l)))
t_0)))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+263)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+263))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+263)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+263): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 5e+263)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 5e+263)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+263]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 5 \cdot 10^{+263}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0 or 5.00000000000000022e263 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 68.6%
*-commutative68.6%
associate-/l/72.6%
Simplified72.6%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.00000000000000022e263Initial program 97.7%
Final simplification79.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (or (<= t_0 2e-268) (not (<= t_0 1e+239)))
(/ c0 (sqrt (* l (/ V A))))
t_0)))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 2e-268) || !(t_0 <= 1e+239)) {
tmp = c0 / sqrt((l * (V / A)));
} else {
tmp = t_0;
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if ((t_0 <= 2d-268) .or. (.not. (t_0 <= 1d+239))) then
tmp = c0 / sqrt((l * (v / a)))
else
tmp = t_0
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if ((t_0 <= 2e-268) || !(t_0 <= 1e+239)) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else {
tmp = t_0;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if (t_0 <= 2e-268) or not (t_0 <= 1e+239): tmp = c0 / math.sqrt((l * (V / A))) else: tmp = t_0 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if ((t_0 <= 2e-268) || !(t_0 <= 1e+239)) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); else tmp = t_0; end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if ((t_0 <= 2e-268) || ~((t_0 <= 1e+239)))
tmp = c0 / sqrt((l * (V / A)));
else
tmp = t_0;
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 2e-268], N[Not[LessEqual[t$95$0, 1e+239]], $MachinePrecision]], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-268} \lor \neg \left(t_0 \leq 10^{+239}\right):\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999992e-268 or 9.99999999999999991e238 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 69.7%
associate-/r*73.6%
div-inv73.6%
add-cube-cbrt73.2%
times-frac76.1%
pow276.1%
Applied egg-rr76.1%
associate-*l/73.7%
associate-/l/73.7%
associate-*r/74.2%
*-rgt-identity74.2%
*-commutative74.2%
Simplified74.2%
associate-/l/69.3%
*-commutative69.3%
associate-*r*69.4%
unpow269.4%
add-cube-cbrt69.7%
*-commutative69.7%
associate-/r*73.6%
sqrt-div43.4%
clear-num43.4%
div-inv43.4%
sqrt-undiv74.6%
div-inv74.6%
clear-num74.6%
Applied egg-rr74.6%
if 1.99999999999999992e-268 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.99999999999999991e238Initial program 97.5%
Final simplification79.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 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 2e-230)
(/ c0 (sqrt (/ V (/ A l))))
(if (<= t_0 1e+239) t_0 (/ c0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-230) {
tmp = c0 / sqrt((V / (A / l)));
} else if (t_0 <= 1e+239) {
tmp = t_0;
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 2d-230) then
tmp = c0 / sqrt((v / (a / l)))
else if (t_0 <= 1d+239) then
tmp = t_0
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-230) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else if (t_0 <= 1e+239) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 2e-230: tmp = c0 / math.sqrt((V / (A / l))) elif t_0 <= 1e+239: tmp = t_0 else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 2e-230) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); elseif (t_0 <= 1e+239) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 2e-230)
tmp = c0 / sqrt((V / (A / l)));
elseif (t_0 <= 1e+239)
tmp = t_0;
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-230], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+239], t$95$0, N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-230}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{elif}\;t_0 \leq 10^{+239}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000009e-230Initial program 71.4%
associate-/r*73.0%
div-inv73.0%
add-cube-cbrt72.6%
times-frac76.6%
pow276.6%
Applied egg-rr76.6%
associate-*l/73.8%
associate-/l/73.8%
associate-*r/74.1%
*-rgt-identity74.1%
*-commutative74.1%
Simplified74.1%
associate-/l/71.0%
*-commutative71.0%
associate-*r*71.0%
unpow271.0%
add-cube-cbrt71.4%
*-commutative71.4%
associate-/r*73.0%
sqrt-div42.8%
clear-num42.7%
div-inv42.7%
sqrt-undiv74.2%
div-inv74.2%
clear-num74.2%
Applied egg-rr74.2%
*-commutative74.2%
associate-/r/78.2%
Applied egg-rr78.2%
if 2.00000000000000009e-230 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.99999999999999991e238Initial program 97.5%
if 9.99999999999999991e238 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 59.7%
associate-/r*78.0%
div-inv77.9%
add-cube-cbrt77.7%
times-frac70.5%
pow270.5%
Applied egg-rr70.5%
associate-*l/74.0%
associate-/l/73.8%
associate-*r/75.2%
*-rgt-identity75.2%
*-commutative75.2%
Simplified75.2%
associate-/l/59.5%
*-commutative59.5%
associate-*r*59.5%
unpow259.5%
add-cube-cbrt59.7%
*-commutative59.7%
associate-/r*78.0%
sqrt-div46.0%
clear-num46.0%
div-inv46.1%
sqrt-undiv78.2%
div-inv78.2%
clear-num78.1%
Applied egg-rr78.1%
Final simplification82.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 2e-230)
(/ c0 (sqrt (/ V (/ A l))))
(if (<= t_0 4e+257) t_0 (/ c0 (sqrt (/ l (/ A V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-230) {
tmp = c0 / sqrt((V / (A / l)));
} else if (t_0 <= 4e+257) {
tmp = t_0;
} else {
tmp = c0 / sqrt((l / (A / V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 2d-230) then
tmp = c0 / sqrt((v / (a / l)))
else if (t_0 <= 4d+257) then
tmp = t_0
else
tmp = c0 / sqrt((l / (a / v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 2e-230) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else if (t_0 <= 4e+257) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((l / (A / V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 2e-230: tmp = c0 / math.sqrt((V / (A / l))) elif t_0 <= 4e+257: tmp = t_0 else: tmp = c0 / math.sqrt((l / (A / V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 2e-230) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); elseif (t_0 <= 4e+257) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(l / Float64(A / V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 2e-230)
tmp = c0 / sqrt((V / (A / l)));
elseif (t_0 <= 4e+257)
tmp = t_0;
else
tmp = c0 / sqrt((l / (A / V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-230], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+257], t$95$0, N[(c0 / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-230}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{elif}\;t_0 \leq 4 \cdot 10^{+257}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000009e-230Initial program 71.4%
associate-/r*73.0%
div-inv73.0%
add-cube-cbrt72.6%
times-frac76.6%
pow276.6%
Applied egg-rr76.6%
associate-*l/73.8%
associate-/l/73.8%
associate-*r/74.1%
*-rgt-identity74.1%
*-commutative74.1%
Simplified74.1%
associate-/l/71.0%
*-commutative71.0%
associate-*r*71.0%
unpow271.0%
add-cube-cbrt71.4%
*-commutative71.4%
associate-/r*73.0%
sqrt-div42.8%
clear-num42.7%
div-inv42.7%
sqrt-undiv74.2%
div-inv74.2%
clear-num74.2%
Applied egg-rr74.2%
*-commutative74.2%
associate-/r/78.2%
Applied egg-rr78.2%
if 2.00000000000000009e-230 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 4.00000000000000012e257Initial program 97.6%
if 4.00000000000000012e257 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 56.4%
associate-/r*76.2%
div-inv76.1%
add-cube-cbrt76.0%
times-frac68.2%
pow268.2%
Applied egg-rr68.2%
associate-*l/72.0%
associate-/l/71.8%
associate-*r/73.3%
*-rgt-identity73.3%
*-commutative73.3%
Simplified73.3%
associate-/l/56.3%
*-commutative56.3%
associate-*r*56.3%
unpow256.3%
add-cube-cbrt56.4%
*-commutative56.4%
associate-/r*76.2%
sqrt-div41.6%
clear-num41.6%
div-inv41.6%
sqrt-undiv76.3%
div-inv76.3%
clear-num76.3%
Applied egg-rr76.3%
clear-num76.3%
un-div-inv76.3%
Applied egg-rr76.3%
Final simplification82.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* (sqrt (/ A V)) (/ c0 (sqrt l)))))
(if (<= (* V l) -1e+118)
t_0
(if (<= (* V l) -1e-205)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 2e+267)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(/ 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 = sqrt((A / V)) * (c0 / sqrt(l));
double tmp;
if ((V * l) <= -1e+118) {
tmp = t_0;
} else if ((V * l) <= -1e-205) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 2e+267) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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 = sqrt((a / v)) * (c0 / sqrt(l))
if ((v * l) <= (-1d+118)) then
tmp = t_0
else if ((v * l) <= (-1d-205)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = t_0
else if ((v * l) <= 2d+267) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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 = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
double tmp;
if ((V * l) <= -1e+118) {
tmp = t_0;
} else if ((V * l) <= -1e-205) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 2e+267) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} 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 = math.sqrt((A / V)) * (c0 / math.sqrt(l)) tmp = 0 if (V * l) <= -1e+118: tmp = t_0 elif (V * l) <= -1e-205: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 2e+267: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) 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(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -1e+118) tmp = t_0; elseif (Float64(V * l) <= -1e-205) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 2e+267) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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 = sqrt((A / V)) * (c0 / sqrt(l));
tmp = 0.0;
if ((V * l) <= -1e+118)
tmp = t_0;
elseif ((V * l) <= -1e-205)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 2e+267)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+118], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-205], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 2e+267], 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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+118}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-205}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+267}:\\
\;\;\;\;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) < -9.99999999999999967e117 or -1e-205 < (*.f64 V l) < -0.0Initial program 57.0%
associate-/r*75.5%
sqrt-div46.2%
associate-*r/44.9%
Applied egg-rr44.9%
associate-/l*46.2%
Simplified46.2%
associate-/r/45.1%
Applied egg-rr45.1%
if -9.99999999999999967e117 < (*.f64 V l) < -1e-205Initial program 97.8%
associate-/r*78.5%
div-inv78.5%
add-cube-cbrt78.0%
times-frac90.2%
pow290.2%
Applied egg-rr90.2%
associate-*l/83.2%
associate-/l/83.2%
associate-*r/83.2%
*-rgt-identity83.2%
*-commutative83.2%
Simplified83.2%
associate-/l/97.0%
*-commutative97.0%
associate-*r*97.1%
unpow297.1%
add-cube-cbrt97.8%
*-commutative97.8%
associate-/r*78.5%
sqrt-div49.1%
clear-num49.1%
div-inv49.1%
sqrt-undiv78.7%
div-inv78.6%
clear-num79.2%
Applied egg-rr79.2%
*-commutative79.2%
associate-*l/98.0%
Simplified98.0%
if -0.0 < (*.f64 V l) < 1.9999999999999999e267Initial program 92.3%
sqrt-div99.3%
associate-*r/93.6%
Applied egg-rr93.6%
*-commutative93.6%
associate-/l*95.8%
associate-/r/99.3%
Simplified99.3%
if 1.9999999999999999e267 < (*.f64 V l) Initial program 35.6%
associate-/r*56.1%
div-inv56.1%
add-cube-cbrt55.9%
times-frac52.7%
pow252.7%
Applied egg-rr52.7%
associate-*l/52.8%
associate-/l/52.7%
associate-*r/52.7%
*-rgt-identity52.7%
*-commutative52.7%
Simplified52.7%
associate-/l/35.6%
*-commutative35.6%
associate-*r*35.6%
unpow235.6%
add-cube-cbrt35.6%
*-commutative35.6%
associate-/r*56.1%
sqrt-div32.5%
clear-num32.4%
div-inv32.5%
sqrt-undiv56.2%
div-inv56.3%
clear-num56.3%
Applied egg-rr56.3%
Final simplification77.1%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (/ A V))))
(if (<= (* V l) -1e+118)
(* t_0 (/ c0 (sqrt l)))
(if (<= (* V l) -1e-205)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
(* c0 (/ t_0 (sqrt l)))
(if (<= (* V l) 2e+267)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(/ 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 = sqrt((A / V));
double tmp;
if ((V * l) <= -1e+118) {
tmp = t_0 * (c0 / sqrt(l));
} else if ((V * l) <= -1e-205) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = c0 * (t_0 / sqrt(l));
} else if ((V * l) <= 2e+267) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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 = sqrt((a / v))
if ((v * l) <= (-1d+118)) then
tmp = t_0 * (c0 / sqrt(l))
else if ((v * l) <= (-1d-205)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = c0 * (t_0 / sqrt(l))
else if ((v * l) <= 2d+267) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -1e+118) {
tmp = t_0 * (c0 / Math.sqrt(l));
} else if ((V * l) <= -1e-205) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = c0 * (t_0 / Math.sqrt(l));
} else if ((V * l) <= 2e+267) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} 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 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -1e+118: tmp = t_0 * (c0 / math.sqrt(l)) elif (V * l) <= -1e-205: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = c0 * (t_0 / math.sqrt(l)) elif (V * l) <= 2e+267: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) 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 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -1e+118) tmp = Float64(t_0 * Float64(c0 / sqrt(l))); elseif (Float64(V * l) <= -1e-205) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(t_0 / sqrt(l))); elseif (Float64(V * l) <= 2e+267) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -1e+118)
tmp = t_0 * (c0 / sqrt(l));
elseif ((V * l) <= -1e-205)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = c0 * (t_0 / sqrt(l));
elseif ((V * l) <= 2e+267)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+118], N[(t$95$0 * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-205], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e+267], 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}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+118}:\\
\;\;\;\;t_0 \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-205}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{t_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{+267}:\\
\;\;\;\;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) < -9.99999999999999967e117Initial program 65.5%
associate-/r*77.2%
sqrt-div47.3%
associate-*r/45.0%
Applied egg-rr45.0%
associate-/l*47.3%
Simplified47.3%
associate-/r/47.4%
Applied egg-rr47.4%
if -9.99999999999999967e117 < (*.f64 V l) < -1e-205Initial program 97.8%
associate-/r*78.5%
div-inv78.5%
add-cube-cbrt78.0%
times-frac90.2%
pow290.2%
Applied egg-rr90.2%
associate-*l/83.2%
associate-/l/83.2%
associate-*r/83.2%
*-rgt-identity83.2%
*-commutative83.2%
Simplified83.2%
associate-/l/97.0%
*-commutative97.0%
associate-*r*97.1%
unpow297.1%
add-cube-cbrt97.8%
*-commutative97.8%
associate-/r*78.5%
sqrt-div49.1%
clear-num49.1%
div-inv49.1%
sqrt-undiv78.7%
div-inv78.6%
clear-num79.2%
Applied egg-rr79.2%
*-commutative79.2%
associate-*l/98.0%
Simplified98.0%
if -1e-205 < (*.f64 V l) < -0.0Initial program 48.2%
associate-/r*73.6%
sqrt-div45.0%
associate-*r/44.9%
Applied egg-rr44.9%
*-commutative44.9%
associate-/l*44.7%
associate-/r/45.0%
Simplified45.0%
if -0.0 < (*.f64 V l) < 1.9999999999999999e267Initial program 92.3%
sqrt-div99.3%
associate-*r/93.6%
Applied egg-rr93.6%
*-commutative93.6%
associate-/l*95.8%
associate-/r/99.3%
Simplified99.3%
if 1.9999999999999999e267 < (*.f64 V l) Initial program 35.6%
associate-/r*56.1%
div-inv56.1%
add-cube-cbrt55.9%
times-frac52.7%
pow252.7%
Applied egg-rr52.7%
associate-*l/52.8%
associate-/l/52.7%
associate-*r/52.7%
*-rgt-identity52.7%
*-commutative52.7%
Simplified52.7%
associate-/l/35.6%
*-commutative35.6%
associate-*r*35.6%
unpow235.6%
add-cube-cbrt35.6%
*-commutative35.6%
associate-/r*56.1%
sqrt-div32.5%
clear-num32.4%
div-inv32.5%
sqrt-undiv56.2%
div-inv56.3%
clear-num56.3%
Applied egg-rr56.3%
Final simplification77.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -1e+118)
(* (sqrt (/ A V)) (/ c0 (sqrt l)))
(if (<= (* V l) -1e-205)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 2e-314)
(/ c0 (sqrt (/ l (/ A V))))
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -1e+118) {
tmp = sqrt((A / V)) * (c0 / sqrt(l));
} else if ((V * l) <= -1e-205) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 2e-314) {
tmp = c0 / sqrt((l / (A / V)));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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) :: tmp
if ((v * l) <= (-1d+118)) then
tmp = sqrt((a / v)) * (c0 / sqrt(l))
else if ((v * l) <= (-1d-205)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 2d-314) then
tmp = c0 / sqrt((l / (a / v)))
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / 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 tmp;
if ((V * l) <= -1e+118) {
tmp = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
} else if ((V * l) <= -1e-205) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 2e-314) {
tmp = c0 / Math.sqrt((l / (A / V)));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -1e+118: tmp = math.sqrt((A / V)) * (c0 / math.sqrt(l)) elif (V * l) <= -1e-205: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 2e-314: tmp = c0 / math.sqrt((l / (A / V))) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -1e+118) tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l))); elseif (Float64(V * l) <= -1e-205) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 2e-314) tmp = Float64(c0 / sqrt(Float64(l / Float64(A / V)))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -1e+118)
tmp = sqrt((A / V)) * (c0 / sqrt(l));
elseif ((V * l) <= -1e-205)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 2e-314)
tmp = c0 / sqrt((l / (A / V)));
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -1e+118], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-205], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-314], N[(c0 / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+118}:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-205}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-314}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -9.99999999999999967e117Initial program 65.5%
associate-/r*77.2%
sqrt-div47.3%
associate-*r/45.0%
Applied egg-rr45.0%
associate-/l*47.3%
Simplified47.3%
associate-/r/47.4%
Applied egg-rr47.4%
if -9.99999999999999967e117 < (*.f64 V l) < -1e-205Initial program 97.8%
associate-/r*78.5%
div-inv78.5%
add-cube-cbrt78.0%
times-frac90.2%
pow290.2%
Applied egg-rr90.2%
associate-*l/83.2%
associate-/l/83.2%
associate-*r/83.2%
*-rgt-identity83.2%
*-commutative83.2%
Simplified83.2%
associate-/l/97.0%
*-commutative97.0%
associate-*r*97.1%
unpow297.1%
add-cube-cbrt97.8%
*-commutative97.8%
associate-/r*78.5%
sqrt-div49.1%
clear-num49.1%
div-inv49.1%
sqrt-undiv78.7%
div-inv78.6%
clear-num79.2%
Applied egg-rr79.2%
*-commutative79.2%
associate-*l/98.0%
Simplified98.0%
if -1e-205 < (*.f64 V l) < 1.9999999999e-314Initial program 48.8%
associate-/r*74.3%
div-inv74.2%
add-cube-cbrt73.9%
times-frac69.2%
pow269.2%
Applied egg-rr69.2%
associate-*l/69.2%
associate-/l/69.2%
associate-*r/71.4%
*-rgt-identity71.4%
*-commutative71.4%
Simplified71.4%
associate-/l/48.6%
*-commutative48.6%
associate-*r*48.6%
unpow248.6%
add-cube-cbrt48.8%
*-commutative48.8%
associate-/r*74.3%
sqrt-div43.9%
clear-num43.9%
div-inv43.8%
sqrt-undiv76.6%
div-inv76.7%
clear-num76.6%
Applied egg-rr76.6%
clear-num76.7%
un-div-inv76.6%
Applied egg-rr76.6%
if 1.9999999999e-314 < (*.f64 V l) Initial program 79.2%
div-inv79.1%
sqrt-prod84.4%
associate-/r*87.2%
Applied egg-rr87.2%
Final simplification81.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 (<= (* V l) -5e+210)
(* (sqrt (/ A V)) (* c0 (pow l -0.5)))
(if (<= (* V l) -5e-308)
(* c0 (/ (sqrt (- A)) (sqrt (* l (- V)))))
(if (<= (* V l) 2e-314)
(/ c0 (sqrt (/ V (/ A l))))
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+210) {
tmp = sqrt((A / V)) * (c0 * pow(l, -0.5));
} else if ((V * l) <= -5e-308) {
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
} else if ((V * l) <= 2e-314) {
tmp = c0 / sqrt((V / (A / l)));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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) :: tmp
if ((v * l) <= (-5d+210)) then
tmp = sqrt((a / v)) * (c0 * (l ** (-0.5d0)))
else if ((v * l) <= (-5d-308)) then
tmp = c0 * (sqrt(-a) / sqrt((l * -v)))
else if ((v * l) <= 2d-314) then
tmp = c0 / sqrt((v / (a / l)))
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / 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 tmp;
if ((V * l) <= -5e+210) {
tmp = Math.sqrt((A / V)) * (c0 * Math.pow(l, -0.5));
} else if ((V * l) <= -5e-308) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((l * -V)));
} else if ((V * l) <= 2e-314) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -5e+210: tmp = math.sqrt((A / V)) * (c0 * math.pow(l, -0.5)) elif (V * l) <= -5e-308: tmp = c0 * (math.sqrt(-A) / math.sqrt((l * -V))) elif (V * l) <= 2e-314: tmp = c0 / math.sqrt((V / (A / l))) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -5e+210) tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 * (l ^ -0.5))); elseif (Float64(V * l) <= -5e-308) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(l * Float64(-V))))); elseif (Float64(V * l) <= 2e-314) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -5e+210)
tmp = sqrt((A / V)) * (c0 * (l ^ -0.5));
elseif ((V * l) <= -5e-308)
tmp = c0 * (sqrt(-A) / sqrt((l * -V)));
elseif ((V * l) <= 2e-314)
tmp = c0 / sqrt((V / (A / l)));
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e+210], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-308], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(l * (-V)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-314], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -5 \cdot 10^{+210}:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \left(c0 \cdot {\ell}^{-0.5}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-308}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{\ell \cdot \left(-V\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-314}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -4.9999999999999998e210Initial program 66.4%
associate-/r*85.7%
sqrt-div41.3%
associate-*r/37.5%
Applied egg-rr37.5%
associate-/l*41.2%
Simplified41.2%
div-inv41.3%
clear-num41.3%
sqrt-div85.7%
un-div-inv85.7%
sqrt-prod41.2%
associate-*r*37.5%
inv-pow37.5%
sqrt-pow137.5%
metadata-eval37.5%
Applied egg-rr37.5%
*-commutative37.5%
associate-*l*41.3%
Simplified41.3%
if -4.9999999999999998e210 < (*.f64 V l) < -4.99999999999999955e-308Initial program 87.8%
frac-2neg87.8%
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 -4.99999999999999955e-308 < (*.f64 V l) < 1.9999999999e-314Initial program 41.7%
associate-/r*75.4%
div-inv75.3%
add-cube-cbrt75.0%
times-frac68.9%
pow268.9%
Applied egg-rr68.9%
associate-*l/68.9%
associate-/l/68.8%
associate-*r/71.7%
*-rgt-identity71.7%
*-commutative71.7%
Simplified71.7%
associate-/l/41.7%
*-commutative41.7%
associate-*r*41.7%
unpow241.7%
add-cube-cbrt41.7%
*-commutative41.7%
associate-/r*75.4%
sqrt-div35.6%
clear-num35.7%
div-inv35.6%
sqrt-undiv78.5%
div-inv78.5%
clear-num78.5%
Applied egg-rr78.5%
*-commutative78.5%
associate-/r/78.5%
Applied egg-rr78.5%
if 1.9999999999e-314 < (*.f64 V l) Initial program 79.2%
div-inv79.1%
sqrt-prod84.4%
associate-/r*87.2%
Applied egg-rr87.2%
Final simplification85.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 1e-312)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+300)
(/ c0 (sqrt (/ (* V l) A)))
(/ c0 (sqrt (/ l (/ A V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-312) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 1e+300) {
tmp = c0 / sqrt(((V * l) / A));
} else {
tmp = c0 / sqrt((l / (A / V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 1d-312) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 1d+300) then
tmp = c0 / sqrt(((v * l) / a))
else
tmp = c0 / sqrt((l / (a / v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 1e-312) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+300) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else {
tmp = c0 / Math.sqrt((l / (A / V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 1e-312: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 1e+300: tmp = c0 / math.sqrt(((V * l) / A)) else: tmp = c0 / math.sqrt((l / (A / V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 1e-312) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+300) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); else tmp = Float64(c0 / sqrt(Float64(l / Float64(A / V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 1e-312)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 1e+300)
tmp = c0 / sqrt(((V * l) / A));
else
tmp = c0 / sqrt((l / (A / V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-312], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+300], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 10^{-312}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 10^{+300}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.9999999999847e-313Initial program 42.3%
*-commutative42.3%
associate-/l/58.6%
Simplified58.6%
if 9.9999999999847e-313 < (/.f64 A (*.f64 V l)) < 1.0000000000000001e300Initial program 98.8%
associate-/r*85.5%
div-inv85.5%
add-cube-cbrt84.8%
times-frac93.3%
pow293.3%
Applied egg-rr93.3%
associate-*l/89.4%
associate-/l/89.4%
associate-*r/89.3%
*-rgt-identity89.3%
*-commutative89.3%
Simplified89.3%
associate-/l/98.0%
*-commutative98.0%
associate-*r*98.0%
unpow298.0%
add-cube-cbrt98.8%
*-commutative98.8%
associate-/r*85.5%
sqrt-div45.9%
clear-num45.9%
div-inv45.9%
sqrt-undiv85.6%
div-inv85.3%
clear-num85.5%
Applied egg-rr85.5%
*-commutative85.5%
associate-*l/99.0%
Simplified99.0%
if 1.0000000000000001e300 < (/.f64 A (*.f64 V l)) Initial program 48.3%
associate-/r*68.1%
div-inv68.0%
add-cube-cbrt67.9%
times-frac63.9%
pow263.9%
Applied egg-rr63.9%
associate-*l/63.9%
associate-/l/63.9%
associate-*r/65.8%
*-rgt-identity65.8%
*-commutative65.8%
Simplified65.8%
associate-/l/48.3%
*-commutative48.3%
associate-*r*48.3%
unpow248.3%
add-cube-cbrt48.3%
*-commutative48.3%
associate-/r*68.1%
sqrt-div43.8%
clear-num43.8%
div-inv43.8%
sqrt-undiv72.1%
div-inv72.1%
clear-num72.1%
Applied egg-rr72.1%
clear-num72.1%
un-div-inv72.1%
Applied egg-rr72.1%
Final simplification84.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 76.1%
Final simplification76.1%
herbie shell --seed 2024014
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))