
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= l -5.5e-121)
(* c0 (/ (sqrt (/ (- A) l)) (sqrt (- V))))
(if (<= l -5e-310)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(/ c0 (* (sqrt l) (sqrt (/ V A)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5.5e-121) {
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
} else if (l <= -5e-310) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 / (sqrt(l) * sqrt((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) :: tmp
if (l <= (-5.5d-121)) then
tmp = c0 * (sqrt((-a / l)) / sqrt(-v))
else if (l <= (-5d-310)) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
else
tmp = c0 / (sqrt(l) * sqrt((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 tmp;
if (l <= -5.5e-121) {
tmp = c0 * (Math.sqrt((-A / l)) / Math.sqrt(-V));
} else if (l <= -5e-310) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5.5e-121: tmp = c0 * (math.sqrt((-A / l)) / math.sqrt(-V)) elif l <= -5e-310: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5.5e-121) tmp = Float64(c0 * Float64(sqrt(Float64(Float64(-A) / l)) / sqrt(Float64(-V)))); elseif (l <= -5e-310) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = Float64(c0 / Float64(sqrt(l) * sqrt(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)
tmp = 0.0;
if (l <= -5.5e-121)
tmp = c0 * (sqrt((-A / l)) / sqrt(-V));
elseif (l <= -5e-310)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = c0 / (sqrt(l) * sqrt((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_] := If[LessEqual[l, -5.5e-121], N[(c0 * N[(N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.5 \cdot 10^{-121}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{-A}{\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\end{array}
\end{array}
if l < -5.50000000000000031e-121Initial program 77.3%
clear-num77.3%
associate-/r/77.3%
associate-/r*77.8%
Applied egg-rr77.8%
*-commutative77.8%
associate-*r/74.4%
div-inv74.5%
associate-/l/77.3%
associate-/r*75.8%
Applied egg-rr75.8%
frac-2neg75.8%
sqrt-div38.0%
distribute-neg-frac238.0%
Applied egg-rr38.0%
distribute-frac-neg238.0%
distribute-neg-frac38.0%
Simplified38.0%
if -5.50000000000000031e-121 < l < -4.999999999999985e-310Initial program 90.0%
sqrt-div59.8%
div-inv59.8%
Applied egg-rr59.8%
associate-*r/59.8%
*-rgt-identity59.8%
Simplified59.8%
if -4.999999999999985e-310 < l Initial program 69.9%
clear-num69.4%
associate-/r/69.9%
associate-/r*69.9%
Applied egg-rr69.9%
sqrt-prod39.7%
associate-/r*39.4%
sqrt-div39.4%
metadata-eval39.4%
associate-/r/39.4%
un-div-inv39.4%
sqrt-undiv70.2%
associate-*r/70.0%
clear-num69.8%
clear-num69.8%
un-div-inv70.4%
Applied egg-rr70.4%
associate-/r/70.5%
associate-*l/70.6%
*-lft-identity70.6%
associate-/r/76.6%
*-commutative76.6%
associate-/l*70.2%
associate-*l/70.0%
associate-/r/75.5%
Simplified75.5%
pow1/275.5%
div-inv75.5%
unpow-prod-down89.9%
pow1/289.9%
clear-num91.0%
Applied egg-rr91.0%
unpow1/291.0%
Simplified91.0%
Final simplification67.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 (* l V))))))
(if (<= t_0 2e-258)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 2e+240)
(* c0 (sqrt (* A (/ (/ 1.0 l) V))))
(/ 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 / (l * V)));
double tmp;
if (t_0 <= 2e-258) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 2e+240) {
tmp = c0 * sqrt((A * ((1.0 / l) / V)));
} 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 / (l * v)))
if (t_0 <= 2d-258) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 2d+240) then
tmp = c0 * sqrt((a * ((1.0d0 / l) / v)))
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 / (l * V)));
double tmp;
if (t_0 <= 2e-258) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 2e+240) {
tmp = c0 * Math.sqrt((A * ((1.0 / l) / V)));
} 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 / (l * V))) tmp = 0 if t_0 <= 2e-258: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 2e+240: tmp = c0 * math.sqrt((A * ((1.0 / l) / V))) 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(l * V)))) tmp = 0.0 if (t_0 <= 2e-258) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 2e+240) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / l) / V)))); 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 / (l * V)));
tmp = 0.0;
if (t_0 <= 2e-258)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 2e+240)
tmp = c0 * sqrt((A * ((1.0 / l) / V)));
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[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-258], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+240], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / l), $MachinePrecision] / V), $MachinePrecision]), $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 := c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-258}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+240}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999991e-258Initial program 70.4%
clear-num70.3%
associate-/r/70.4%
associate-/r*70.7%
Applied egg-rr70.7%
*-commutative70.7%
associate-*r/75.7%
div-inv75.7%
associate-/l/70.4%
associate-/r*73.5%
Applied egg-rr73.5%
if 1.99999999999999991e-258 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000003e240Initial program 98.8%
clear-num97.9%
associate-/r/98.8%
associate-/r*98.9%
Applied egg-rr98.9%
*-commutative98.9%
associate-*r/81.3%
div-inv81.5%
associate-/l/98.8%
associate-/r*82.4%
Applied egg-rr82.4%
div-inv82.4%
associate-/l*99.0%
Applied egg-rr99.0%
if 2.00000000000000003e240 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 53.3%
clear-num53.3%
associate-/r/53.3%
associate-/r*53.3%
Applied egg-rr53.3%
sqrt-prod48.2%
associate-/r*48.3%
sqrt-div48.3%
metadata-eval48.3%
associate-/r/48.4%
un-div-inv48.4%
sqrt-undiv55.9%
associate-*r/61.4%
clear-num61.3%
clear-num61.3%
un-div-inv61.3%
Applied egg-rr61.3%
associate-/r/61.3%
associate-*l/61.3%
*-lft-identity61.3%
associate-/r/62.5%
*-commutative62.5%
associate-/l*55.9%
associate-*l/61.4%
associate-/r/62.5%
Simplified62.5%
Final simplification78.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))) (t_1 (* c0 (sqrt t_0))))
(if (<= t_1 2e-253)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_1 2e+257) (/ c0 (pow t_0 -0.5)) (/ 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 / (l * V);
double t_1 = c0 * sqrt(t_0);
double tmp;
if (t_1 <= 2e-253) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_1 <= 2e+257) {
tmp = c0 / pow(t_0, -0.5);
} 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) :: t_1
real(8) :: tmp
t_0 = a / (l * v)
t_1 = c0 * sqrt(t_0)
if (t_1 <= 2d-253) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_1 <= 2d+257) then
tmp = c0 / (t_0 ** (-0.5d0))
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 / (l * V);
double t_1 = c0 * Math.sqrt(t_0);
double tmp;
if (t_1 <= 2e-253) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_1 <= 2e+257) {
tmp = c0 / Math.pow(t_0, -0.5);
} 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 / (l * V) t_1 = c0 * math.sqrt(t_0) tmp = 0 if t_1 <= 2e-253: tmp = c0 * math.sqrt(((A / l) / V)) elif t_1 <= 2e+257: tmp = c0 / math.pow(t_0, -0.5) 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(l * V)) t_1 = Float64(c0 * sqrt(t_0)) tmp = 0.0 if (t_1 <= 2e-253) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_1 <= 2e+257) tmp = Float64(c0 / (t_0 ^ -0.5)); 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 / (l * V);
t_1 = c0 * sqrt(t_0);
tmp = 0.0;
if (t_1 <= 2e-253)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_1 <= 2e+257)
tmp = c0 / (t_0 ^ -0.5);
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[(l * V), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e-253], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+257], N[(c0 / N[Power[t$95$0, -0.5], $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}{\ell \cdot V}\\
t_1 := c0 \cdot \sqrt{t\_0}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-253}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+257}:\\
\;\;\;\;\frac{c0}{{t\_0}^{-0.5}}\\
\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.0000000000000001e-253Initial program 70.7%
clear-num70.7%
associate-/r/70.7%
associate-/r*71.1%
Applied egg-rr71.1%
*-commutative71.1%
associate-*r/76.0%
div-inv76.0%
associate-/l/70.7%
associate-/r*73.8%
Applied egg-rr73.8%
if 2.0000000000000001e-253 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000006e257Initial program 98.8%
clear-num97.9%
associate-/r/98.8%
associate-/r*98.9%
Applied egg-rr98.9%
sqrt-prod43.1%
associate-/r*43.1%
sqrt-div43.1%
metadata-eval43.1%
associate-/r/43.1%
un-div-inv43.0%
sqrt-undiv98.0%
associate-*r/82.8%
clear-num82.8%
clear-num82.0%
un-div-inv82.1%
Applied egg-rr82.1%
associate-/r/82.1%
associate-*l/82.1%
*-lft-identity82.1%
associate-/r/81.6%
*-commutative81.6%
associate-/l*98.0%
associate-*l/82.8%
associate-/r/80.3%
Simplified80.3%
clear-num80.3%
inv-pow80.3%
metadata-eval80.3%
pow-prod-up80.3%
sqrt-unprod80.9%
add-sqr-sqrt81.1%
associate-/l/98.8%
Applied egg-rr98.8%
if 2.00000000000000006e257 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 51.7%
clear-num51.7%
associate-/r/51.7%
associate-/r*51.7%
Applied egg-rr51.7%
sqrt-prod46.6%
associate-/r*46.6%
sqrt-div46.6%
metadata-eval46.6%
associate-/r/46.7%
un-div-inv46.7%
sqrt-undiv54.4%
associate-*r/60.1%
clear-num60.0%
clear-num60.0%
un-div-inv60.0%
Applied egg-rr60.0%
associate-/r/60.0%
associate-*l/60.0%
*-lft-identity60.0%
associate-/r/61.2%
*-commutative61.2%
associate-/l*54.4%
associate-*l/60.1%
associate-/r/61.2%
Simplified61.2%
Final simplification78.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 (or (<= t_0 0.0) (not (<= t_0 4e+210)))
(* 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 / (l * V)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+210)) {
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 / (l * v)))
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+210))) 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 / (l * V)));
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+210)) {
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 / (l * V))) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 4e+210): 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(l * V)))) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 4e+210)) 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 / (l * V)));
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 4e+210)))
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[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+210]], $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}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 4 \cdot 10^{+210}\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 3.99999999999999971e210 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 66.6%
associate-/r*72.3%
Simplified72.3%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 3.99999999999999971e210Initial program 98.9%
Final simplification79.3%
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 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+240) 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 / (l * V)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+240) {
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 / (l * v)))
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+240) 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 / (l * V)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+240) {
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 / (l * V))) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+240: 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(l * V)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+240) 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 / (l * V)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+240)
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[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+240], 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}{\ell \cdot V}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+240}:\\
\;\;\;\;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)))) < 0.0Initial program 68.6%
associate-/r*74.3%
Simplified74.3%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.00000000000000003e240Initial program 99.0%
if 2.00000000000000003e240 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 53.3%
clear-num53.3%
associate-/r/53.3%
associate-/r*53.3%
Applied egg-rr53.3%
sqrt-prod48.2%
associate-/r*48.3%
sqrt-div48.3%
metadata-eval48.3%
associate-/r/48.4%
un-div-inv48.4%
sqrt-undiv55.9%
associate-*r/61.4%
clear-num61.3%
clear-num61.3%
un-div-inv61.3%
Applied egg-rr61.3%
associate-/r/61.3%
associate-*l/61.3%
*-lft-identity61.3%
associate-/r/62.5%
*-commutative62.5%
associate-/l*55.9%
associate-*l/61.4%
associate-/r/62.5%
Simplified62.5%
Final simplification79.6%
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 -5e+111)
(* c0 (/ (sqrt (/ A (- V))) (sqrt (- l))))
(if (<= l -5e-310)
(* c0 (/ (sqrt A) (sqrt (* l V))))
(/ c0 (* (sqrt l) (sqrt (/ V A)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e+111) {
tmp = c0 * (sqrt((A / -V)) / sqrt(-l));
} else if (l <= -5e-310) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 / (sqrt(l) * sqrt((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) :: tmp
if (l <= (-5d+111)) then
tmp = c0 * (sqrt((a / -v)) / sqrt(-l))
else if (l <= (-5d-310)) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
else
tmp = c0 / (sqrt(l) * sqrt((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 tmp;
if (l <= -5e+111) {
tmp = c0 * (Math.sqrt((A / -V)) / Math.sqrt(-l));
} else if (l <= -5e-310) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e+111: tmp = c0 * (math.sqrt((A / -V)) / math.sqrt(-l)) elif l <= -5e-310: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e+111) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-V))) / sqrt(Float64(-l)))); elseif (l <= -5e-310) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = Float64(c0 / Float64(sqrt(l) * sqrt(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)
tmp = 0.0;
if (l <= -5e+111)
tmp = c0 * (sqrt((A / -V)) / sqrt(-l));
elseif (l <= -5e-310)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = c0 / (sqrt(l) * sqrt((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_] := If[LessEqual[l, -5e+111], N[(c0 * N[(N[Sqrt[N[(A / (-V)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{+111}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-V}}}{\sqrt{-\ell}}\\
\mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\end{array}
\end{array}
if l < -4.9999999999999997e111Initial program 70.7%
associate-/r*69.2%
frac-2neg69.2%
sqrt-div80.1%
distribute-neg-frac280.1%
Applied egg-rr80.1%
distribute-frac-neg280.1%
distribute-frac-neg80.1%
Simplified80.1%
if -4.9999999999999997e111 < l < -4.999999999999985e-310Initial program 88.5%
sqrt-div49.0%
div-inv49.0%
Applied egg-rr49.0%
associate-*r/49.0%
*-rgt-identity49.0%
Simplified49.0%
if -4.999999999999985e-310 < l Initial program 69.9%
clear-num69.4%
associate-/r/69.9%
associate-/r*69.9%
Applied egg-rr69.9%
sqrt-prod39.7%
associate-/r*39.4%
sqrt-div39.4%
metadata-eval39.4%
associate-/r/39.4%
un-div-inv39.4%
sqrt-undiv70.2%
associate-*r/70.0%
clear-num69.8%
clear-num69.8%
un-div-inv70.4%
Applied egg-rr70.4%
associate-/r/70.5%
associate-*l/70.6%
*-lft-identity70.6%
associate-/r/76.6%
*-commutative76.6%
associate-/l*70.2%
associate-*l/70.0%
associate-/r/75.5%
Simplified75.5%
pow1/275.5%
div-inv75.5%
unpow-prod-down89.9%
pow1/289.9%
clear-num91.0%
Applied egg-rr91.0%
unpow1/291.0%
Simplified91.0%
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 (if (<= A 4.9e-242) (* c0 (sqrt (* (/ A V) (/ 1.0 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 <= 4.9e-242) {
tmp = c0 * sqrt(((A / V) * (1.0 / 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 <= 4.9d-242) then
tmp = c0 * sqrt(((a / v) * (1.0d0 / 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 <= 4.9e-242) {
tmp = c0 * Math.sqrt(((A / V) * (1.0 / 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 <= 4.9e-242: tmp = c0 * math.sqrt(((A / V) * (1.0 / 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 <= 4.9e-242) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) * Float64(1.0 / 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 <= 4.9e-242)
tmp = c0 * sqrt(((A / V) * (1.0 / 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, 4.9e-242], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(1.0 / 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}\;A \leq 4.9 \cdot 10^{-242}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V} \cdot \frac{1}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < 4.90000000000000002e-242Initial program 73.7%
associate-/r*76.5%
div-inv76.5%
Applied egg-rr76.5%
if 4.90000000000000002e-242 < A Initial program 76.7%
sqrt-div85.3%
div-inv85.3%
Applied egg-rr85.3%
associate-*r/85.3%
*-rgt-identity85.3%
Simplified85.3%
Final simplification80.6%
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 -5e-310) (* c0 (/ (sqrt A) (sqrt (* l V)))) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(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 (l <= (-5d-310)) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
else
tmp = c0 * (sqrt((a / v)) / sqrt(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 (l <= -5e-310) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(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 (l <= -5e-310)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = c0 * (sqrt((A / V)) / sqrt(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[l, -5e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 80.3%
sqrt-div44.6%
div-inv44.6%
Applied egg-rr44.6%
associate-*r/44.6%
*-rgt-identity44.6%
Simplified44.6%
if -4.999999999999985e-310 < l Initial program 69.9%
associate-/r*75.2%
sqrt-div89.9%
div-inv89.8%
Applied egg-rr89.8%
associate-*r/89.9%
*-rgt-identity89.9%
Simplified89.9%
Final simplification67.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= l -5e-310) (* c0 (/ (sqrt A) (sqrt (* l V)))) (/ c0 (* (sqrt l) (sqrt (/ V A))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
} else {
tmp = c0 / (sqrt(l) * sqrt((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) :: tmp
if (l <= (-5d-310)) then
tmp = c0 * (sqrt(a) / sqrt((l * v)))
else
tmp = c0 / (sqrt(l) * sqrt((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 tmp;
if (l <= -5e-310) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
} else {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) else: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); else tmp = Float64(c0 / Float64(sqrt(l) * sqrt(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)
tmp = 0.0;
if (l <= -5e-310)
tmp = c0 * (sqrt(A) / sqrt((l * V)));
else
tmp = c0 / (sqrt(l) * sqrt((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_] := If[LessEqual[l, -5e-310], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 80.3%
sqrt-div44.6%
div-inv44.6%
Applied egg-rr44.6%
associate-*r/44.6%
*-rgt-identity44.6%
Simplified44.6%
if -4.999999999999985e-310 < l Initial program 69.9%
clear-num69.4%
associate-/r/69.9%
associate-/r*69.9%
Applied egg-rr69.9%
sqrt-prod39.7%
associate-/r*39.4%
sqrt-div39.4%
metadata-eval39.4%
associate-/r/39.4%
un-div-inv39.4%
sqrt-undiv70.2%
associate-*r/70.0%
clear-num69.8%
clear-num69.8%
un-div-inv70.4%
Applied egg-rr70.4%
associate-/r/70.5%
associate-*l/70.6%
*-lft-identity70.6%
associate-/r/76.6%
*-commutative76.6%
associate-/l*70.2%
associate-*l/70.0%
associate-/r/75.5%
Simplified75.5%
pow1/275.5%
div-inv75.5%
unpow-prod-down89.9%
pow1/289.9%
clear-num91.0%
Applied egg-rr91.0%
unpow1/291.0%
Simplified91.0%
Final simplification67.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* l V))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 5e+251) (* c0 (sqrt 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 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 5e+251) {
tmp = c0 * sqrt(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 = a / (l * v)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 5d+251) then
tmp = c0 * sqrt(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 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 5e+251) {
tmp = c0 * Math.sqrt(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 = A / (l * V) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 5e+251: tmp = c0 * math.sqrt(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(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 5e+251) tmp = Float64(c0 * sqrt(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 = A / (l * V);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 5e+251)
tmp = c0 * sqrt(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[(A / N[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+251], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+251}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 37.6%
associate-/r*57.8%
Simplified57.8%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.0000000000000005e251Initial program 99.3%
if 5.0000000000000005e251 < (/.f64 A (*.f64 V l)) Initial program 45.9%
clear-num45.9%
associate-/r/45.9%
associate-/r*45.9%
Applied egg-rr45.9%
sqrt-prod35.1%
associate-/r*35.1%
sqrt-div35.0%
metadata-eval35.0%
associate-/r/35.1%
un-div-inv35.1%
sqrt-undiv47.4%
associate-*r/52.1%
clear-num52.1%
un-div-inv52.1%
Applied egg-rr52.1%
Final simplification80.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 (/ A (* l V))))
(if (<= t_0 2e-318)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+292)
(/ c0 (sqrt (/ (* l V) 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 / (l * V);
double tmp;
if (t_0 <= 2e-318) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+292) {
tmp = c0 / sqrt(((l * V) / 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 / (l * v)
if (t_0 <= 2d-318) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+292) then
tmp = c0 / sqrt(((l * v) / 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 / (l * V);
double tmp;
if (t_0 <= 2e-318) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+292) {
tmp = c0 / Math.sqrt(((l * V) / 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 / (l * V) tmp = 0 if t_0 <= 2e-318: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+292: tmp = c0 / math.sqrt(((l * V) / 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(l * V)) tmp = 0.0 if (t_0 <= 2e-318) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+292) tmp = Float64(c0 / sqrt(Float64(Float64(l * V) / 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 / (l * V);
tmp = 0.0;
if (t_0 <= 2e-318)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+292)
tmp = c0 / sqrt(((l * V) / 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[(l * V), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-318], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+292], N[(c0 / N[Sqrt[N[(N[(l * V), $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}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-318}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+292}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell \cdot V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2.0000024e-318Initial program 38.0%
associate-/r*57.7%
Simplified57.7%
if 2.0000024e-318 < (/.f64 A (*.f64 V l)) < 2e292Initial program 99.6%
clear-num99.5%
associate-/r/99.6%
associate-/r*99.7%
Applied egg-rr99.7%
sqrt-prod50.4%
associate-/r*50.3%
sqrt-div50.3%
metadata-eval50.3%
associate-/r/50.3%
un-div-inv50.3%
sqrt-undiv99.7%
associate-*r/86.4%
clear-num86.2%
clear-num85.9%
un-div-inv87.2%
Applied egg-rr87.2%
associate-/r/87.3%
associate-*l/87.4%
*-lft-identity87.4%
associate-/r/90.5%
*-commutative90.5%
associate-/l*99.7%
associate-*l/86.4%
associate-/r/89.1%
Simplified89.1%
Taylor expanded in l around 0 99.7%
if 2e292 < (/.f64 A (*.f64 V l)) Initial program 38.1%
clear-num38.1%
associate-/r/38.1%
associate-/r*38.1%
Applied egg-rr38.1%
sqrt-prod34.0%
associate-/r*34.0%
sqrt-div34.0%
metadata-eval34.0%
associate-/r/34.0%
un-div-inv34.0%
sqrt-undiv39.8%
associate-*r/51.1%
clear-num51.2%
clear-num51.2%
un-div-inv51.2%
Applied egg-rr51.2%
associate-/r/51.1%
associate-*l/51.1%
*-lft-identity51.1%
associate-/r/51.8%
*-commutative51.8%
associate-/l*39.8%
associate-*l/51.1%
associate-/r/51.8%
Simplified51.8%
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 (* 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.1%
Final simplification75.1%
herbie shell --seed 2024073
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))