
(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 (<= (* V l) -4e-303)
(* c0 (/ (/ (sqrt (- A)) (sqrt (- V))) (sqrt l)))
(if (<= (* V l) 5e-296)
(* c0 (/ 1.0 (/ (sqrt l) (sqrt (/ 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) <= -4e-303) {
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
} else if ((V * l) <= 5e-296) {
tmp = c0 * (1.0 / (sqrt(l) / sqrt((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) <= (-4d-303)) then
tmp = c0 * ((sqrt(-a) / sqrt(-v)) / sqrt(l))
else if ((v * l) <= 5d-296) then
tmp = c0 * (1.0d0 / (sqrt(l) / sqrt((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) <= -4e-303) {
tmp = c0 * ((Math.sqrt(-A) / Math.sqrt(-V)) / Math.sqrt(l));
} else if ((V * l) <= 5e-296) {
tmp = c0 * (1.0 / (Math.sqrt(l) / Math.sqrt((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) <= -4e-303: tmp = c0 * ((math.sqrt(-A) / math.sqrt(-V)) / math.sqrt(l)) elif (V * l) <= 5e-296: tmp = c0 * (1.0 / (math.sqrt(l) / math.sqrt((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) <= -4e-303) tmp = Float64(c0 * Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) / sqrt(l))); elseif (Float64(V * l) <= 5e-296) tmp = Float64(c0 * Float64(1.0 / Float64(sqrt(l) / sqrt(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) <= -4e-303)
tmp = c0 * ((sqrt(-A) / sqrt(-V)) / sqrt(l));
elseif ((V * l) <= 5e-296)
tmp = c0 * (1.0 / (sqrt(l) / sqrt((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], -4e-303], N[(c0 * N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-296], N[(c0 * N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $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 -4 \cdot 10^{-303}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-296}:\\
\;\;\;\;c0 \cdot \frac{1}{\frac{\sqrt{\ell}}{\sqrt{\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) < -3.99999999999999972e-303Initial program 80.6%
associate-/r*77.4%
sqrt-div48.9%
div-inv48.9%
Applied egg-rr48.9%
associate-*r/48.9%
*-rgt-identity48.9%
Simplified48.9%
frac-2neg48.9%
sqrt-div58.4%
Applied egg-rr58.4%
if -3.99999999999999972e-303 < (*.f64 V l) < 5.0000000000000003e-296Initial program 34.6%
associate-/r*68.5%
sqrt-div54.5%
clear-num54.5%
Applied egg-rr54.5%
if 5.0000000000000003e-296 < (*.f64 V l) Initial program 77.9%
pow1/277.9%
div-inv77.9%
unpow-prod-down89.4%
pow1/289.4%
associate-/r*91.0%
Applied egg-rr91.0%
unpow1/291.0%
Simplified91.0%
Final simplification70.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 (* V l))))))
(if (<= t_0 0.0)
(sqrt (* (/ A V) (* c0 (/ c0 l))))
(if (<= t_0 1e+264) t_0 (/ 1.0 (/ (sqrt (* V (/ l A))) c0))))))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) {
tmp = sqrt(((A / V) * (c0 * (c0 / l))));
} else if (t_0 <= 1e+264) {
tmp = t_0;
} else {
tmp = 1.0 / (sqrt((V * (l / A))) / c0);
}
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) then
tmp = sqrt(((a / v) * (c0 * (c0 / l))))
else if (t_0 <= 1d+264) then
tmp = t_0
else
tmp = 1.0d0 / (sqrt((v * (l / a))) / c0)
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) {
tmp = Math.sqrt(((A / V) * (c0 * (c0 / l))));
} else if (t_0 <= 1e+264) {
tmp = t_0;
} else {
tmp = 1.0 / (Math.sqrt((V * (l / A))) / c0);
}
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: tmp = math.sqrt(((A / V) * (c0 * (c0 / l)))) elif t_0 <= 1e+264: tmp = t_0 else: tmp = 1.0 / (math.sqrt((V * (l / A))) / c0) 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) tmp = sqrt(Float64(Float64(A / V) * Float64(c0 * Float64(c0 / l)))); elseif (t_0 <= 1e+264) tmp = t_0; else tmp = Float64(1.0 / Float64(sqrt(Float64(V * Float64(l / A))) / c0)); 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)
tmp = sqrt(((A / V) * (c0 * (c0 / l))));
elseif (t_0 <= 1e+264)
tmp = t_0;
else
tmp = 1.0 / (sqrt((V * (l / A))) / c0);
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, 0.0], N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(c0 * N[(c0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 1e+264], t$95$0, N[(1.0 / N[(N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $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 0:\\
\;\;\;\;\sqrt{\frac{A}{V} \cdot \left(c0 \cdot \frac{c0}{\ell}\right)}\\
\mathbf{elif}\;t\_0 \leq 10^{+264}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{V \cdot \frac{\ell}{A}}}{c0}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 70.6%
associate-/r*74.2%
div-inv74.1%
Applied egg-rr74.1%
*-commutative74.1%
un-div-inv74.2%
associate-/r*70.6%
add-sqr-sqrt16.6%
sqrt-unprod17.8%
*-commutative17.8%
associate-/r*17.8%
un-div-inv17.8%
*-commutative17.8%
associate-/r*20.6%
un-div-inv20.5%
swap-sqr19.8%
Applied egg-rr17.6%
associate-*l/17.6%
times-frac20.5%
Simplified20.5%
unpow220.5%
associate-/l*23.4%
Applied egg-rr23.4%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.00000000000000004e264Initial program 99.6%
if 1.00000000000000004e264 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 48.0%
associate-/r*65.2%
div-inv65.2%
Applied egg-rr65.2%
un-div-inv65.2%
associate-/r*48.0%
clear-num48.0%
associate-*r/65.2%
sqrt-div67.0%
metadata-eval67.0%
un-div-inv67.0%
clear-num67.1%
Applied egg-rr67.1%
Final simplification44.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 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 1e-272)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 1e+264) t_0 (/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 1e-272) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 1e+264) {
tmp = t_0;
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 1d-272) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 1d+264) then
tmp = t_0
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 1e-272) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 1e+264) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 1e-272: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 1e+264: tmp = t_0 else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 1e-272) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 1e+264) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 1e-272)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 1e+264)
tmp = t_0;
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-272], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+264], t$95$0, N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 10^{-272}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t\_0 \leq 10^{+264}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 9.9999999999999993e-273Initial program 71.7%
associate-/r*75.2%
div-inv75.1%
Applied egg-rr75.1%
associate-*l/74.1%
div-inv74.2%
Applied egg-rr74.2%
if 9.9999999999999993e-273 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.00000000000000004e264Initial program 99.6%
if 1.00000000000000004e264 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 48.0%
associate-/r*65.2%
div-inv65.2%
Applied egg-rr65.2%
Taylor expanded in c0 around 0 48.0%
unpow1/248.0%
exp-to-pow47.7%
*-rgt-identity47.7%
*-commutative47.7%
associate-*l/47.7%
associate-/r/47.7%
associate-*r/63.3%
log-rec65.2%
distribute-lft-neg-in65.2%
rem-log-exp65.2%
exp-to-pow65.2%
unpow1/265.2%
rec-exp65.2%
rem-exp-log67.0%
associate-*l/67.0%
*-lft-identity67.0%
Simplified67.0%
Final simplification77.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 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 0.0)
(sqrt (* (/ A V) (* c0 (/ c0 l))))
(if (<= t_0 1e+264) t_0 (/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = sqrt(((A / V) * (c0 * (c0 / l))));
} else if (t_0 <= 1e+264) {
tmp = t_0;
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = sqrt(((a / v) * (c0 * (c0 / l))))
else if (t_0 <= 1d+264) then
tmp = t_0
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = Math.sqrt(((A / V) * (c0 * (c0 / l))));
} else if (t_0 <= 1e+264) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = math.sqrt(((A / V) * (c0 * (c0 / l)))) elif t_0 <= 1e+264: tmp = t_0 else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = sqrt(Float64(Float64(A / V) * Float64(c0 * Float64(c0 / l)))); elseif (t_0 <= 1e+264) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = sqrt(((A / V) * (c0 * (c0 / l))));
elseif (t_0 <= 1e+264)
tmp = t_0;
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(c0 * N[(c0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$0, 1e+264], t$95$0, N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;\sqrt{\frac{A}{V} \cdot \left(c0 \cdot \frac{c0}{\ell}\right)}\\
\mathbf{elif}\;t\_0 \leq 10^{+264}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 70.6%
associate-/r*74.2%
div-inv74.1%
Applied egg-rr74.1%
*-commutative74.1%
un-div-inv74.2%
associate-/r*70.6%
add-sqr-sqrt16.6%
sqrt-unprod17.8%
*-commutative17.8%
associate-/r*17.8%
un-div-inv17.8%
*-commutative17.8%
associate-/r*20.6%
un-div-inv20.5%
swap-sqr19.8%
Applied egg-rr17.6%
associate-*l/17.6%
times-frac20.5%
Simplified20.5%
unpow220.5%
associate-/l*23.4%
Applied egg-rr23.4%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.00000000000000004e264Initial program 99.6%
if 1.00000000000000004e264 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 48.0%
associate-/r*65.2%
div-inv65.2%
Applied egg-rr65.2%
Taylor expanded in c0 around 0 48.0%
unpow1/248.0%
exp-to-pow47.7%
*-rgt-identity47.7%
*-commutative47.7%
associate-*l/47.7%
associate-/r/47.7%
associate-*r/63.3%
log-rec65.2%
distribute-lft-neg-in65.2%
rem-log-exp65.2%
exp-to-pow65.2%
unpow1/265.2%
rec-exp65.2%
rem-exp-log67.0%
associate-*l/67.0%
*-lft-identity67.0%
Simplified67.0%
Final simplification44.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 (sqrt (* (/ A V) (* c0 (/ c0 l))))))
(if (<= (* V l) -2e+307)
t_0
(if (<= (* V l) -1e-139)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 0.0)
(/ 1.0 (/ (sqrt (* V (/ l A))) c0))
(if (<= (* V l) 1e+307) (* c0 (/ (sqrt A) (sqrt (* V l)))) t_0))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt(((A / V) * (c0 * (c0 / l))));
double tmp;
if ((V * l) <= -2e+307) {
tmp = t_0;
} else if ((V * l) <= -1e-139) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = 1.0 / (sqrt((V * (l / A))) / c0);
} else if ((V * l) <= 1e+307) {
tmp = c0 * (sqrt(A) / sqrt((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 = sqrt(((a / v) * (c0 * (c0 / l))))
if ((v * l) <= (-2d+307)) then
tmp = t_0
else if ((v * l) <= (-1d-139)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 0.0d0) then
tmp = 1.0d0 / (sqrt((v * (l / a))) / c0)
else if ((v * l) <= 1d+307) then
tmp = c0 * (sqrt(a) / sqrt((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 = Math.sqrt(((A / V) * (c0 * (c0 / l))));
double tmp;
if ((V * l) <= -2e+307) {
tmp = t_0;
} else if ((V * l) <= -1e-139) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 0.0) {
tmp = 1.0 / (Math.sqrt((V * (l / A))) / c0);
} else if ((V * l) <= 1e+307) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((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 = math.sqrt(((A / V) * (c0 * (c0 / l)))) tmp = 0 if (V * l) <= -2e+307: tmp = t_0 elif (V * l) <= -1e-139: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 0.0: tmp = 1.0 / (math.sqrt((V * (l / A))) / c0) elif (V * l) <= 1e+307: tmp = c0 * (math.sqrt(A) / math.sqrt((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 = sqrt(Float64(Float64(A / V) * Float64(c0 * Float64(c0 / l)))) tmp = 0.0 if (Float64(V * l) <= -2e+307) tmp = t_0; elseif (Float64(V * l) <= -1e-139) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 0.0) tmp = Float64(1.0 / Float64(sqrt(Float64(V * Float64(l / A))) / c0)); elseif (Float64(V * l) <= 1e+307) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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 = sqrt(((A / V) * (c0 * (c0 / l))));
tmp = 0.0;
if ((V * l) <= -2e+307)
tmp = t_0;
elseif ((V * l) <= -1e-139)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 0.0)
tmp = 1.0 / (sqrt((V * (l / A))) / c0);
elseif ((V * l) <= 1e+307)
tmp = c0 * (sqrt(A) / sqrt((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[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(c0 * N[(c0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -2e+307], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-139], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(1.0 / N[(N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+307], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $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 := \sqrt{\frac{A}{V} \cdot \left(c0 \cdot \frac{c0}{\ell}\right)}\\
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{+307}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-139}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{1}{\frac{\sqrt{V \cdot \frac{\ell}{A}}}{c0}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+307}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 V l) < -1.99999999999999997e307 or 9.99999999999999986e306 < (*.f64 V l) Initial program 36.9%
associate-/r*59.8%
div-inv59.9%
Applied egg-rr59.9%
*-commutative59.9%
un-div-inv59.8%
associate-/r*36.9%
add-sqr-sqrt37.0%
sqrt-unprod36.9%
*-commutative36.9%
associate-/r*36.9%
un-div-inv36.9%
*-commutative36.9%
associate-/r*49.6%
un-div-inv49.5%
swap-sqr46.3%
Applied egg-rr36.2%
associate-*l/33.4%
times-frac49.4%
Simplified49.4%
unpow249.4%
associate-/l*57.5%
Applied egg-rr57.5%
if -1.99999999999999997e307 < (*.f64 V l) < -1.00000000000000003e-139Initial program 95.0%
if -1.00000000000000003e-139 < (*.f64 V l) < 0.0Initial program 43.2%
associate-/r*66.3%
div-inv66.3%
Applied egg-rr66.3%
un-div-inv66.3%
associate-/r*43.2%
clear-num43.3%
associate-*r/66.3%
sqrt-div66.3%
metadata-eval66.3%
un-div-inv66.2%
clear-num66.3%
Applied egg-rr66.3%
if 0.0 < (*.f64 V l) < 9.99999999999999986e306Initial program 85.8%
sqrt-div98.5%
div-inv98.5%
Applied egg-rr98.5%
associate-*r/98.5%
*-rgt-identity98.5%
Simplified98.5%
Final simplification85.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
(if (<= (* V l) (- INFINITY))
t_0
(if (<= (* V l) -1e-139)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 5e-296)
t_0
(if (<= (* V l) 1e+307)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(sqrt (* (/ A V) (* c0 (/ c0 l))))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((V * l) <= -1e-139) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 5e-296) {
tmp = t_0;
} else if ((V * l) <= 1e+307) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = sqrt(((A / V) * (c0 * (c0 / l))));
}
return tmp;
}
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)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if ((V * l) <= -1e-139) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 5e-296) {
tmp = t_0;
} else if ((V * l) <= 1e+307) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = Math.sqrt(((A / V) * (c0 * (c0 / l))));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -math.inf: tmp = t_0 elif (V * l) <= -1e-139: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 5e-296: tmp = t_0 elif (V * l) <= 1e+307: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = math.sqrt(((A / V) * (c0 * (c0 / l)))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = t_0; elseif (Float64(V * l) <= -1e-139) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 5e-296) tmp = t_0; elseif (Float64(V * l) <= 1e+307) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = sqrt(Float64(Float64(A / V) * Float64(c0 * Float64(c0 / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = t_0;
elseif ((V * l) <= -1e-139)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 5e-296)
tmp = t_0;
elseif ((V * l) <= 1e+307)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = sqrt(((A / V) * (c0 * (c0 / l))));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-139], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-296], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 1e+307], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(N[(A / V), $MachinePrecision] * N[(c0 * N[(c0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-139}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-296}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+307}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{A}{V} \cdot \left(c0 \cdot \frac{c0}{\ell}\right)}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or -1.00000000000000003e-139 < (*.f64 V l) < 5.0000000000000003e-296Initial program 45.5%
associate-/r*66.1%
sqrt-div45.0%
div-inv44.9%
Applied egg-rr44.9%
associate-*r/45.0%
*-rgt-identity45.0%
Simplified45.0%
if -inf.0 < (*.f64 V l) < -1.00000000000000003e-139Initial program 95.0%
if 5.0000000000000003e-296 < (*.f64 V l) < 9.99999999999999986e306Initial program 86.3%
sqrt-div99.4%
div-inv99.4%
Applied egg-rr99.4%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
if 9.99999999999999986e306 < (*.f64 V l) Initial program 12.5%
associate-/r*47.4%
div-inv47.2%
Applied egg-rr47.2%
*-commutative47.2%
un-div-inv47.4%
associate-/r*12.5%
add-sqr-sqrt12.5%
sqrt-unprod12.5%
*-commutative12.5%
associate-/r*12.5%
un-div-inv12.5%
*-commutative12.5%
associate-/r*38.8%
un-div-inv38.2%
swap-sqr28.6%
Applied egg-rr11.2%
associate-*l/10.8%
times-frac29.2%
Simplified29.2%
unpow229.2%
associate-/l*47.4%
Applied egg-rr47.4%
Final simplification79.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
(if (<= (* V l) (- INFINITY))
t_0
(if (<= (* V l) -1e-139)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 5e-296)
t_0
(* 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 t_0 = c0 * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((V * l) <= -1e-139) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 5e-296) {
tmp = t_0;
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
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)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if ((V * l) <= -1e-139) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 5e-296) {
tmp = t_0;
} 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): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -math.inf: tmp = t_0 elif (V * l) <= -1e-139: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 5e-296: tmp = t_0 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) t_0 = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = t_0; elseif (Float64(V * l) <= -1e-139) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 5e-296) tmp = t_0; 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)
t_0 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = t_0;
elseif ((V * l) <= -1e-139)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 5e-296)
tmp = t_0;
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_] := Block[{t$95$0 = N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -1e-139], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-296], t$95$0, 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}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-139}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-296}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or -1.00000000000000003e-139 < (*.f64 V l) < 5.0000000000000003e-296Initial program 45.5%
associate-/r*66.1%
sqrt-div45.0%
div-inv44.9%
Applied egg-rr44.9%
associate-*r/45.0%
*-rgt-identity45.0%
Simplified45.0%
if -inf.0 < (*.f64 V l) < -1.00000000000000003e-139Initial program 95.0%
if 5.0000000000000003e-296 < (*.f64 V l) Initial program 77.9%
pow1/277.9%
div-inv77.9%
unpow-prod-down89.4%
pow1/289.4%
associate-/r*91.0%
Applied egg-rr91.0%
unpow1/291.0%
Simplified91.0%
Final simplification78.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (/ A V))))
(if (<= (* V l) (- INFINITY))
(* c0 (* t_0 (sqrt (/ 1.0 l))))
(if (<= (* V l) -1e-139)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 5e-296)
(* c0 (/ t_0 (sqrt 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 t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (t_0 * sqrt((1.0 / l)));
} else if ((V * l) <= -1e-139) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 5e-296) {
tmp = c0 * (t_0 / sqrt(l));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
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) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (t_0 * Math.sqrt((1.0 / l)));
} else if ((V * l) <= -1e-139) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 5e-296) {
tmp = c0 * (t_0 / Math.sqrt(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): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (t_0 * math.sqrt((1.0 / l))) elif (V * l) <= -1e-139: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 5e-296: tmp = c0 * (t_0 / math.sqrt(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) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(t_0 * sqrt(Float64(1.0 / l)))); elseif (Float64(V * l) <= -1e-139) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 5e-296) tmp = Float64(c0 * Float64(t_0 / sqrt(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)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (t_0 * sqrt((1.0 / l)));
elseif ((V * l) <= -1e-139)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 5e-296)
tmp = c0 * (t_0 / sqrt(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_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(t$95$0 * N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-139], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-296], N[(c0 * N[(t$95$0 / N[Sqrt[l], $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}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \left(t\_0 \cdot \sqrt{\frac{1}{\ell}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-139}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-296}:\\
\;\;\;\;c0 \cdot \frac{t\_0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 45.2%
pow1/245.2%
associate-/r*63.8%
div-inv63.9%
unpow-prod-down26.7%
pow1/226.7%
Applied egg-rr26.7%
unpow1/226.7%
Simplified26.7%
if -inf.0 < (*.f64 V l) < -1.00000000000000003e-139Initial program 95.0%
if -1.00000000000000003e-139 < (*.f64 V l) < 5.0000000000000003e-296Initial program 45.7%
associate-/r*67.3%
sqrt-div53.7%
div-inv53.7%
Applied egg-rr53.7%
associate-*r/53.7%
*-rgt-identity53.7%
Simplified53.7%
if 5.0000000000000003e-296 < (*.f64 V l) Initial program 77.9%
pow1/277.9%
div-inv77.9%
unpow-prod-down89.4%
pow1/289.4%
associate-/r*91.0%
Applied egg-rr91.0%
unpow1/291.0%
Simplified91.0%
Final simplification78.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (/ A V))))
(if (<= (* V l) (- INFINITY))
(* c0 (/ 1.0 (/ (sqrt l) t_0)))
(if (<= (* V l) -1e-139)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 5e-296)
(* c0 (/ t_0 (sqrt 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 t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (1.0 / (sqrt(l) / t_0));
} else if ((V * l) <= -1e-139) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 5e-296) {
tmp = c0 * (t_0 / sqrt(l));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
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) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (1.0 / (Math.sqrt(l) / t_0));
} else if ((V * l) <= -1e-139) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 5e-296) {
tmp = c0 * (t_0 / Math.sqrt(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): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (1.0 / (math.sqrt(l) / t_0)) elif (V * l) <= -1e-139: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 5e-296: tmp = c0 * (t_0 / math.sqrt(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) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(1.0 / Float64(sqrt(l) / t_0))); elseif (Float64(V * l) <= -1e-139) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 5e-296) tmp = Float64(c0 * Float64(t_0 / sqrt(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)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (1.0 / (sqrt(l) / t_0));
elseif ((V * l) <= -1e-139)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 5e-296)
tmp = c0 * (t_0 / sqrt(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_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -1e-139], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-296], N[(c0 * N[(t$95$0 / N[Sqrt[l], $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}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{1}{\frac{\sqrt{\ell}}{t\_0}}\\
\mathbf{elif}\;V \cdot \ell \leq -1 \cdot 10^{-139}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-296}:\\
\;\;\;\;c0 \cdot \frac{t\_0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 45.2%
associate-/r*63.8%
sqrt-div26.7%
clear-num26.8%
Applied egg-rr26.8%
if -inf.0 < (*.f64 V l) < -1.00000000000000003e-139Initial program 95.0%
if -1.00000000000000003e-139 < (*.f64 V l) < 5.0000000000000003e-296Initial program 45.7%
associate-/r*67.3%
sqrt-div53.7%
div-inv53.7%
Applied egg-rr53.7%
associate-*r/53.7%
*-rgt-identity53.7%
Simplified53.7%
if 5.0000000000000003e-296 < (*.f64 V l) Initial program 77.9%
pow1/277.9%
div-inv77.9%
unpow-prod-down89.4%
pow1/289.4%
associate-/r*91.0%
Applied egg-rr91.0%
unpow1/291.0%
Simplified91.0%
Final simplification78.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (/ 1.0 (/ (sqrt l) (sqrt (/ A V)))))))
(if (<= (* V l) (- INFINITY))
t_0
(if (<= (* V l) -4e-303)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 5e-296)
t_0
(* 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 t_0 = c0 * (1.0 / (sqrt(l) / sqrt((A / V))));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((V * l) <= -4e-303) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 5e-296) {
tmp = t_0;
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * (1.0 / (Math.sqrt(l) / Math.sqrt((A / V))));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if ((V * l) <= -4e-303) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 5e-296) {
tmp = t_0;
} 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): t_0 = c0 * (1.0 / (math.sqrt(l) / math.sqrt((A / V)))) tmp = 0 if (V * l) <= -math.inf: tmp = t_0 elif (V * l) <= -4e-303: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 5e-296: tmp = t_0 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) t_0 = Float64(c0 * Float64(1.0 / Float64(sqrt(l) / sqrt(Float64(A / V))))) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = t_0; elseif (Float64(V * l) <= -4e-303) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 5e-296) tmp = t_0; 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)
t_0 = c0 * (1.0 / (sqrt(l) / sqrt((A / V))));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = t_0;
elseif ((V * l) <= -4e-303)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 5e-296)
tmp = t_0;
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_] := Block[{t$95$0 = N[(c0 * N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -4e-303], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e-296], t$95$0, 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}
t_0 := c0 \cdot \frac{1}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-303}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{-296}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or -3.99999999999999972e-303 < (*.f64 V l) < 5.0000000000000003e-296Initial program 39.2%
associate-/r*66.5%
sqrt-div42.5%
clear-num42.6%
Applied egg-rr42.6%
if -inf.0 < (*.f64 V l) < -3.99999999999999972e-303Initial program 89.4%
frac-2neg89.4%
sqrt-div99.6%
distribute-rgt-neg-in99.6%
Applied egg-rr99.6%
distribute-rgt-neg-out99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
Simplified99.6%
if 5.0000000000000003e-296 < (*.f64 V l) Initial program 77.9%
pow1/277.9%
div-inv77.9%
unpow-prod-down89.4%
pow1/289.4%
associate-/r*91.0%
Applied egg-rr91.0%
unpow1/291.0%
Simplified91.0%
Final simplification83.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 5e+296)))
(* c0 (sqrt (/ (/ A V) l)))
(* c0 (sqrt t_0)))))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 <= 0.0) || !(t_0 <= 5e+296)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(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 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+296))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(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 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+296)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
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 <= 0.0) or not (t_0 <= 5e+296): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.sqrt(t_0) 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 <= 0.0) || !(t_0 <= 5e+296)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * sqrt(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 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 5e+296)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 * sqrt(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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+296]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[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 0 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+296}\right):\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 5.0000000000000001e296 < (/.f64 A (*.f64 V l)) Initial program 37.7%
associate-/r*55.5%
Simplified55.5%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.0000000000000001e296Initial program 99.1%
Final simplification81.1%
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 73.7%
Final simplification73.7%
herbie shell --seed 2024082
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))