
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= V -5e-310) (* c0 (/ 1.0 (/ (sqrt (- V)) (sqrt (/ (- A) l))))) (* c0 (/ (/ (sqrt A) (sqrt l)) (sqrt V)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -5e-310) {
tmp = c0 * (1.0 / (sqrt(-V) / sqrt((-A / l))));
} else {
tmp = c0 * ((sqrt(A) / sqrt(l)) / sqrt(V));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (v <= (-5d-310)) then
tmp = c0 * (1.0d0 / (sqrt(-v) / sqrt((-a / l))))
else
tmp = c0 * ((sqrt(a) / sqrt(l)) / sqrt(v))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -5e-310) {
tmp = c0 * (1.0 / (Math.sqrt(-V) / Math.sqrt((-A / l))));
} else {
tmp = c0 * ((Math.sqrt(A) / Math.sqrt(l)) / Math.sqrt(V));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if V <= -5e-310: tmp = c0 * (1.0 / (math.sqrt(-V) / math.sqrt((-A / l)))) else: tmp = c0 * ((math.sqrt(A) / math.sqrt(l)) / math.sqrt(V)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= -5e-310) tmp = Float64(c0 * Float64(1.0 / Float64(sqrt(Float64(-V)) / sqrt(Float64(Float64(-A) / l))))); else tmp = Float64(c0 * Float64(Float64(sqrt(A) / sqrt(l)) / sqrt(V))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (V <= -5e-310)
tmp = c0 * (1.0 / (sqrt(-V) / sqrt((-A / l))));
else
tmp = c0 * ((sqrt(A) / sqrt(l)) / sqrt(V));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[V, -5e-310], N[(c0 * N[(1.0 / N[(N[Sqrt[(-V)], $MachinePrecision] / N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[V], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{1}{\frac{\sqrt{-V}}{\sqrt{\frac{-A}{\ell}}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{A}}{\sqrt{\ell}}}{\sqrt{V}}\\
\end{array}
\end{array}
if V < -4.999999999999985e-310Initial program 76.3%
clear-num76.3%
sqrt-div77.1%
metadata-eval77.1%
*-commutative77.1%
associate-/l*77.1%
Applied egg-rr77.1%
associate-/r/79.5%
Simplified79.5%
*-commutative79.5%
clear-num79.2%
un-div-inv79.2%
Applied egg-rr79.2%
frac-2neg79.2%
sqrt-div88.4%
distribute-neg-frac88.4%
Applied egg-rr88.4%
if -4.999999999999985e-310 < V Initial program 67.4%
pow1/267.4%
clear-num67.3%
inv-pow67.3%
pow-pow67.4%
*-commutative67.4%
associate-/l*66.2%
metadata-eval66.2%
Applied egg-rr66.2%
associate-/r/65.5%
Simplified65.5%
metadata-eval65.5%
pow-flip65.4%
pow1/265.4%
associate-*l/67.2%
*-commutative67.2%
sqrt-undiv43.1%
associate-/l*43.1%
sqrt-prod53.6%
times-frac53.6%
Applied egg-rr53.6%
associate-*l/53.7%
*-lft-identity53.7%
Simplified53.7%
Final simplification71.3%
NOTE: 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 l) (sqrt (/ V A))))))
(if (<= (* V l) (- INFINITY))
t_0
(if (<= (* V l) -5e-221)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
t_0
(if (<= (* V l) 5e+299)
(* c0 (* (sqrt A) (pow (* V l) -0.5)))
(/ (* c0 (sqrt (/ A l))) (sqrt V))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 / (sqrt(l) * sqrt((V / A)));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((V * l) <= -5e-221) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 5e+299) {
tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
} else {
tmp = (c0 * sqrt((A / l))) / sqrt(V);
}
return tmp;
}
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if ((V * l) <= -5e-221) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else if ((V * l) <= 5e+299) {
tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
} else {
tmp = (c0 * Math.sqrt((A / l))) / Math.sqrt(V);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = c0 / (math.sqrt(l) * math.sqrt((V / A))) tmp = 0 if (V * l) <= -math.inf: tmp = t_0 elif (V * l) <= -5e-221: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = t_0 elif (V * l) <= 5e+299: tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5)) else: tmp = (c0 * math.sqrt((A / l))) / math.sqrt(V) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = t_0; elseif (Float64(V * l) <= -5e-221) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = t_0; elseif (Float64(V * l) <= 5e+299) tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); else tmp = Float64(Float64(c0 * sqrt(Float64(A / l))) / sqrt(V)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 / (sqrt(l) * sqrt((V / A)));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = t_0;
elseif ((V * l) <= -5e-221)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
elseif ((V * l) <= 5e+299)
tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
else
tmp = (c0 * sqrt((A / l))) / sqrt(V);
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-221], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], 5e+299], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 * N[Sqrt[N[(A / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[V], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-221}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t_0\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+299}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{\ell}}}{\sqrt{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or -4.99999999999999996e-221 < (*.f64 V l) < -0.0Initial program 41.7%
pow1/241.7%
clear-num41.7%
inv-pow41.7%
pow-pow41.7%
*-commutative41.7%
associate-/l*60.4%
metadata-eval60.4%
Applied egg-rr60.4%
associate-/r/60.3%
Simplified60.3%
metadata-eval60.3%
pow-flip60.3%
pow1/260.3%
un-div-inv60.4%
associate-/r/60.4%
clear-num59.3%
associate-/r/60.4%
clear-num60.4%
*-commutative60.4%
Applied egg-rr60.4%
*-commutative60.4%
sqrt-prod46.2%
Applied egg-rr46.2%
if -inf.0 < (*.f64 V l) < -4.99999999999999996e-221Initial program 87.8%
frac-2neg87.8%
sqrt-div99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -0.0 < (*.f64 V l) < 5.0000000000000003e299Initial program 87.1%
pow1/287.1%
div-inv86.6%
unpow-prod-down98.7%
pow1/298.7%
inv-pow98.7%
pow-pow99.1%
metadata-eval99.1%
Applied egg-rr99.1%
if 5.0000000000000003e299 < (*.f64 V l) Initial program 28.9%
pow1/228.9%
clear-num28.9%
inv-pow28.9%
pow-pow28.9%
*-commutative28.9%
associate-/l*52.1%
metadata-eval52.1%
Applied egg-rr52.1%
associate-/r/52.2%
Simplified52.2%
metadata-eval52.2%
pow-flip52.2%
pow1/252.2%
un-div-inv52.4%
associate-*l/28.9%
*-commutative28.9%
sqrt-undiv28.9%
div-inv28.9%
associate-/r*28.9%
*-commutative28.9%
pow1/228.9%
pow-flip28.9%
metadata-eval28.9%
Applied egg-rr28.9%
associate-/r*28.9%
Simplified28.9%
sqrt-prod64.7%
associate-*l*64.7%
add-sqr-sqrt64.5%
sqrt-unprod64.7%
pow-prod-up64.7%
metadata-eval64.7%
inv-pow64.7%
sqrt-prod55.5%
div-inv55.6%
sqrt-prod52.4%
*-commutative52.4%
associate-/r/52.4%
un-div-inv52.2%
sqrt-div55.6%
associate-/r/55.7%
sqrt-div69.4%
times-frac69.4%
*-un-lft-identity69.4%
sqrt-prod28.9%
Applied egg-rr55.6%
*-commutative55.6%
associate-*l/55.7%
Simplified55.7%
Final simplification83.2%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) 0.0)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) 5e+299)
(* c0 (* (sqrt A) (pow (* V l) -0.5)))
(/ (* c0 (sqrt (/ A l))) (sqrt V)))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= 5e+299) {
tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
} else {
tmp = (c0 * sqrt((A / l))) / sqrt(V);
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= 0.0d0) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= 5d+299) then
tmp = c0 * (sqrt(a) * ((v * l) ** (-0.5d0)))
else
tmp = (c0 * sqrt((a / l))) / sqrt(v)
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= 5e+299) {
tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
} else {
tmp = (c0 * Math.sqrt((A / l))) / Math.sqrt(V);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 0.0: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= 5e+299: tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5)) else: tmp = (c0 * math.sqrt((A / l))) / math.sqrt(V) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= 5e+299) tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); else tmp = Float64(Float64(c0 * sqrt(Float64(A / l))) / sqrt(V)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= 0.0)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= 5e+299)
tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
else
tmp = (c0 * sqrt((A / l))) / sqrt(V);
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+299], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 * N[Sqrt[N[(A / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[V], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+299}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{\ell}}}{\sqrt{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -0.0Initial program 66.8%
associate-/r*70.0%
sqrt-div44.3%
Applied egg-rr44.3%
if -0.0 < (*.f64 V l) < 5.0000000000000003e299Initial program 87.1%
pow1/287.1%
div-inv86.6%
unpow-prod-down98.7%
pow1/298.7%
inv-pow98.7%
pow-pow99.1%
metadata-eval99.1%
Applied egg-rr99.1%
if 5.0000000000000003e299 < (*.f64 V l) Initial program 28.9%
pow1/228.9%
clear-num28.9%
inv-pow28.9%
pow-pow28.9%
*-commutative28.9%
associate-/l*52.1%
metadata-eval52.1%
Applied egg-rr52.1%
associate-/r/52.2%
Simplified52.2%
metadata-eval52.2%
pow-flip52.2%
pow1/252.2%
un-div-inv52.4%
associate-*l/28.9%
*-commutative28.9%
sqrt-undiv28.9%
div-inv28.9%
associate-/r*28.9%
*-commutative28.9%
pow1/228.9%
pow-flip28.9%
metadata-eval28.9%
Applied egg-rr28.9%
associate-/r*28.9%
Simplified28.9%
sqrt-prod64.7%
associate-*l*64.7%
add-sqr-sqrt64.5%
sqrt-unprod64.7%
pow-prod-up64.7%
metadata-eval64.7%
inv-pow64.7%
sqrt-prod55.5%
div-inv55.6%
sqrt-prod52.4%
*-commutative52.4%
associate-/r/52.4%
un-div-inv52.2%
sqrt-div55.6%
associate-/r/55.7%
sqrt-div69.4%
times-frac69.4%
*-un-lft-identity69.4%
sqrt-prod28.9%
Applied egg-rr55.6%
*-commutative55.6%
associate-*l/55.7%
Simplified55.7%
Final simplification67.0%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) 0.0)
(* c0 (* (sqrt (/ A V)) (sqrt (/ 1.0 l))))
(if (<= (* V l) 5e+299)
(* c0 (* (sqrt A) (pow (* V l) -0.5)))
(/ (* c0 (sqrt (/ A l))) (sqrt V)))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((A / V)) * sqrt((1.0 / l)));
} else if ((V * l) <= 5e+299) {
tmp = c0 * (sqrt(A) * pow((V * l), -0.5));
} else {
tmp = (c0 * sqrt((A / l))) / sqrt(V);
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= 0.0d0) then
tmp = c0 * (sqrt((a / v)) * sqrt((1.0d0 / l)))
else if ((v * l) <= 5d+299) then
tmp = c0 * (sqrt(a) * ((v * l) ** (-0.5d0)))
else
tmp = (c0 * sqrt((a / l))) / sqrt(v)
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 * (Math.sqrt((A / V)) * Math.sqrt((1.0 / l)));
} else if ((V * l) <= 5e+299) {
tmp = c0 * (Math.sqrt(A) * Math.pow((V * l), -0.5));
} else {
tmp = (c0 * Math.sqrt((A / l))) / Math.sqrt(V);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 0.0: tmp = c0 * (math.sqrt((A / V)) * math.sqrt((1.0 / l))) elif (V * l) <= 5e+299: tmp = c0 * (math.sqrt(A) * math.pow((V * l), -0.5)) else: tmp = (c0 * math.sqrt((A / l))) / math.sqrt(V) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) * sqrt(Float64(1.0 / l)))); elseif (Float64(V * l) <= 5e+299) tmp = Float64(c0 * Float64(sqrt(A) * (Float64(V * l) ^ -0.5))); else tmp = Float64(Float64(c0 * sqrt(Float64(A / l))) / sqrt(V)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= 0.0)
tmp = c0 * (sqrt((A / V)) * sqrt((1.0 / l)));
elseif ((V * l) <= 5e+299)
tmp = c0 * (sqrt(A) * ((V * l) ^ -0.5));
else
tmp = (c0 * sqrt((A / l))) / sqrt(V);
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[(1.0 / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 5e+299], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Power[N[(V * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 * N[Sqrt[N[(A / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[V], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \left(\sqrt{\frac{A}{V}} \cdot \sqrt{\frac{1}{\ell}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq 5 \cdot 10^{+299}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot {\left(V \cdot \ell\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{\ell}}}{\sqrt{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -0.0Initial program 66.8%
pow1/266.8%
clear-num66.7%
inv-pow66.7%
pow-pow66.8%
*-commutative66.8%
associate-/l*70.5%
metadata-eval70.5%
Applied egg-rr70.5%
associate-/r/73.5%
Simplified73.5%
metadata-eval73.5%
pow-flip73.3%
pow1/273.3%
metadata-eval73.3%
sqrt-div73.0%
associate-/r/70.0%
clear-num70.0%
div-inv70.0%
sqrt-prod44.3%
Applied egg-rr44.3%
if -0.0 < (*.f64 V l) < 5.0000000000000003e299Initial program 87.1%
pow1/287.1%
div-inv86.6%
unpow-prod-down98.7%
pow1/298.7%
inv-pow98.7%
pow-pow99.1%
metadata-eval99.1%
Applied egg-rr99.1%
if 5.0000000000000003e299 < (*.f64 V l) Initial program 28.9%
pow1/228.9%
clear-num28.9%
inv-pow28.9%
pow-pow28.9%
*-commutative28.9%
associate-/l*52.1%
metadata-eval52.1%
Applied egg-rr52.1%
associate-/r/52.2%
Simplified52.2%
metadata-eval52.2%
pow-flip52.2%
pow1/252.2%
un-div-inv52.4%
associate-*l/28.9%
*-commutative28.9%
sqrt-undiv28.9%
div-inv28.9%
associate-/r*28.9%
*-commutative28.9%
pow1/228.9%
pow-flip28.9%
metadata-eval28.9%
Applied egg-rr28.9%
associate-/r*28.9%
Simplified28.9%
sqrt-prod64.7%
associate-*l*64.7%
add-sqr-sqrt64.5%
sqrt-unprod64.7%
pow-prod-up64.7%
metadata-eval64.7%
inv-pow64.7%
sqrt-prod55.5%
div-inv55.6%
sqrt-prod52.4%
*-commutative52.4%
associate-/r/52.4%
un-div-inv52.2%
sqrt-div55.6%
associate-/r/55.7%
sqrt-div69.4%
times-frac69.4%
*-un-lft-identity69.4%
sqrt-prod28.9%
Applied egg-rr55.6%
*-commutative55.6%
associate-*l/55.7%
Simplified55.7%
Final simplification67.0%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (or (<= (* V l) 0.0) (not (<= (* V l) 1e+287))) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (((V * l) <= 0.0) || !((V * l) <= 1e+287)) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (((v * l) <= 0.0d0) .or. (.not. ((v * l) <= 1d+287))) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 * (sqrt(a) / sqrt((v * l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (((V * l) <= 0.0) || !((V * l) <= 1e+287)) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if ((V * l) <= 0.0) or not ((V * l) <= 1e+287): tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 1e+287)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (((V * l) <= 0.0) || ~(((V * l) <= 1e+287)))
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 * (sqrt(A) / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 1e+287]], $MachinePrecision]], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 10^{+287}\right):\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -0.0 or 1.0000000000000001e287 < (*.f64 V l) Initial program 61.8%
associate-/r*67.5%
sqrt-div45.8%
Applied egg-rr45.8%
if -0.0 < (*.f64 V l) < 1.0000000000000001e287Initial program 87.8%
sqrt-div98.9%
associate-*r/90.6%
Applied egg-rr90.6%
*-commutative90.6%
associate-/l*97.1%
associate-/r/98.9%
Simplified98.9%
Final simplification66.6%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (or (<= (* V l) 0.0) (not (<= (* V l) 1e+287))) (* c0 (/ (sqrt (/ A V)) (sqrt l))) (/ c0 (/ (sqrt (* V l)) (sqrt A)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (((V * l) <= 0.0) || !((V * l) <= 1e+287)) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (((v * l) <= 0.0d0) .or. (.not. ((v * l) <= 1d+287))) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 / (sqrt((v * l)) / sqrt(a))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (((V * l) <= 0.0) || !((V * l) <= 1e+287)) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if ((V * l) <= 0.0) or not ((V * l) <= 1e+287): tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if ((Float64(V * l) <= 0.0) || !(Float64(V * l) <= 1e+287)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (((V * l) <= 0.0) || ~(((V * l) <= 1e+287)))
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 / (sqrt((V * l)) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[Or[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Not[LessEqual[N[(V * l), $MachinePrecision], 1e+287]], $MachinePrecision]], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 0 \lor \neg \left(V \cdot \ell \leq 10^{+287}\right):\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -0.0 or 1.0000000000000001e287 < (*.f64 V l) Initial program 61.8%
associate-/r*67.5%
sqrt-div45.8%
Applied egg-rr45.8%
if -0.0 < (*.f64 V l) < 1.0000000000000001e287Initial program 87.8%
sqrt-div98.9%
associate-*r/90.6%
Applied egg-rr90.6%
associate-/l*99.0%
Simplified99.0%
Final simplification66.6%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= V -5e-310)
(* c0 (/ 1.0 (/ (sqrt (- V)) (sqrt (/ (- A) l)))))
(if (<= V 2.8e-8)
(/ c0 (/ (sqrt (* V l)) (sqrt A)))
(* (pow l -0.5) (/ c0 (sqrt (/ V A)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -5e-310) {
tmp = c0 * (1.0 / (sqrt(-V) / sqrt((-A / l))));
} else if (V <= 2.8e-8) {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
} else {
tmp = pow(l, -0.5) * (c0 / sqrt((V / A)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (v <= (-5d-310)) then
tmp = c0 * (1.0d0 / (sqrt(-v) / sqrt((-a / l))))
else if (v <= 2.8d-8) then
tmp = c0 / (sqrt((v * l)) / sqrt(a))
else
tmp = (l ** (-0.5d0)) * (c0 / sqrt((v / a)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -5e-310) {
tmp = c0 * (1.0 / (Math.sqrt(-V) / Math.sqrt((-A / l))));
} else if (V <= 2.8e-8) {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
} else {
tmp = Math.pow(l, -0.5) * (c0 / Math.sqrt((V / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if V <= -5e-310: tmp = c0 * (1.0 / (math.sqrt(-V) / math.sqrt((-A / l)))) elif V <= 2.8e-8: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) else: tmp = math.pow(l, -0.5) * (c0 / math.sqrt((V / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= -5e-310) tmp = Float64(c0 * Float64(1.0 / Float64(sqrt(Float64(-V)) / sqrt(Float64(Float64(-A) / l))))); elseif (V <= 2.8e-8) tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); else tmp = Float64((l ^ -0.5) * Float64(c0 / sqrt(Float64(V / A)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (V <= -5e-310)
tmp = c0 * (1.0 / (sqrt(-V) / sqrt((-A / l))));
elseif (V <= 2.8e-8)
tmp = c0 / (sqrt((V * l)) / sqrt(A));
else
tmp = (l ^ -0.5) * (c0 / sqrt((V / A)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[V, -5e-310], N[(c0 * N[(1.0 / N[(N[Sqrt[(-V)], $MachinePrecision] / N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[V, 2.8e-8], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[l, -0.5], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{1}{\frac{\sqrt{-V}}{\sqrt{\frac{-A}{\ell}}}}\\
\mathbf{elif}\;V \leq 2.8 \cdot 10^{-8}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\mathbf{else}:\\
\;\;\;\;{\ell}^{-0.5} \cdot \frac{c0}{\sqrt{\frac{V}{A}}}\\
\end{array}
\end{array}
if V < -4.999999999999985e-310Initial program 76.3%
clear-num76.3%
sqrt-div77.1%
metadata-eval77.1%
*-commutative77.1%
associate-/l*77.1%
Applied egg-rr77.1%
associate-/r/79.5%
Simplified79.5%
*-commutative79.5%
clear-num79.2%
un-div-inv79.2%
Applied egg-rr79.2%
frac-2neg79.2%
sqrt-div88.4%
distribute-neg-frac88.4%
Applied egg-rr88.4%
if -4.999999999999985e-310 < V < 2.7999999999999999e-8Initial program 74.8%
sqrt-div48.5%
associate-*r/45.2%
Applied egg-rr45.2%
associate-/l*48.5%
Simplified48.5%
if 2.7999999999999999e-8 < V Initial program 60.6%
pow1/260.6%
clear-num60.5%
inv-pow60.5%
pow-pow60.5%
*-commutative60.5%
associate-/l*63.5%
metadata-eval63.5%
Applied egg-rr63.5%
associate-/r/60.9%
Simplified60.9%
metadata-eval60.9%
pow-flip60.8%
pow1/260.8%
un-div-inv60.9%
associate-/r/63.5%
clear-num63.6%
associate-/r/63.6%
clear-num63.6%
*-commutative63.6%
Applied egg-rr63.6%
*-un-lft-identity63.6%
sqrt-prod44.2%
times-frac42.9%
pow1/242.9%
pow-flip43.0%
metadata-eval43.0%
Applied egg-rr43.0%
Final simplification67.3%
NOTE: 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 (pow (* V (/ l A)) -0.5)) (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 * pow((V * (l / A)), -0.5);
} else {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (l <= (-5d-310)) then
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
else
tmp = c0 * (sqrt((a / v)) / sqrt(l))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (l <= -5e-310) {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
} else {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if l <= -5e-310: tmp = c0 * math.pow((V * (l / A)), -0.5) else: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (l <= -5e-310) tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); else tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (l <= -5e-310)
tmp = c0 * ((V * (l / A)) ^ -0.5);
else
tmp = c0 * (sqrt((A / V)) / sqrt(l));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[l, -5e-310], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if l < -4.999999999999985e-310Initial program 70.7%
pow1/270.7%
clear-num70.7%
inv-pow70.7%
pow-pow71.7%
*-commutative71.7%
associate-/l*70.9%
metadata-eval70.9%
Applied egg-rr70.9%
associate-/r/73.1%
Simplified73.1%
if -4.999999999999985e-310 < l Initial program 73.1%
associate-/r*72.2%
sqrt-div84.0%
Applied egg-rr84.0%
Final simplification78.5%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))) (t_1 (* V (/ l A))))
(if (<= t_0 5e-308)
(/ c0 (sqrt t_1))
(if (<= t_0 4e+273) (/ c0 (sqrt (/ (* V l) A))) (* c0 (pow t_1 -0.5))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double t_1 = V * (l / A);
double tmp;
if (t_0 <= 5e-308) {
tmp = c0 / sqrt(t_1);
} else if (t_0 <= 4e+273) {
tmp = c0 / sqrt(((V * l) / A));
} else {
tmp = c0 * pow(t_1, -0.5);
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = a / (v * l)
t_1 = v * (l / a)
if (t_0 <= 5d-308) then
tmp = c0 / sqrt(t_1)
else if (t_0 <= 4d+273) then
tmp = c0 / sqrt(((v * l) / a))
else
tmp = c0 * (t_1 ** (-0.5d0))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double t_1 = V * (l / A);
double tmp;
if (t_0 <= 5e-308) {
tmp = c0 / Math.sqrt(t_1);
} else if (t_0 <= 4e+273) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else {
tmp = c0 * Math.pow(t_1, -0.5);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) t_1 = V * (l / A) tmp = 0 if t_0 <= 5e-308: tmp = c0 / math.sqrt(t_1) elif t_0 <= 4e+273: tmp = c0 / math.sqrt(((V * l) / A)) else: tmp = c0 * math.pow(t_1, -0.5) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) t_1 = Float64(V * Float64(l / A)) tmp = 0.0 if (t_0 <= 5e-308) tmp = Float64(c0 / sqrt(t_1)); elseif (t_0 <= 4e+273) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); else tmp = Float64(c0 * (t_1 ^ -0.5)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
t_1 = V * (l / A);
tmp = 0.0;
if (t_0 <= 5e-308)
tmp = c0 / sqrt(t_1);
elseif (t_0 <= 4e+273)
tmp = c0 / sqrt(((V * l) / A));
else
tmp = c0 * (t_1 ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-308], N[(c0 / N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+273], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[t$95$1, -0.5], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
t_1 := V \cdot \frac{\ell}{A}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{-308}:\\
\;\;\;\;\frac{c0}{\sqrt{t_1}}\\
\mathbf{elif}\;t_0 \leq 4 \cdot 10^{+273}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {t_1}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.99999999999999955e-308Initial program 29.0%
clear-num29.0%
sqrt-div28.9%
metadata-eval28.9%
*-commutative28.9%
associate-/l*45.0%
Applied egg-rr45.0%
associate-/r/46.6%
Simplified46.6%
*-commutative46.6%
clear-num46.6%
un-div-inv46.6%
Applied egg-rr46.6%
un-div-inv46.7%
pow1/246.7%
associate-/r/45.1%
*-commutative45.1%
metadata-eval45.1%
pow-prod-up44.9%
expm1-log1p-u41.3%
associate-/l/41.3%
expm1-udef31.9%
associate-/l/31.9%
pow-sqr31.9%
metadata-eval31.9%
pow1/231.9%
Applied egg-rr31.9%
expm1-def41.4%
expm1-log1p45.1%
*-commutative45.1%
associate-*l/28.9%
associate-*r/46.7%
Simplified46.7%
if 4.99999999999999955e-308 < (/.f64 A (*.f64 V l)) < 3.99999999999999978e273Initial program 98.5%
clear-num98.5%
sqrt-div98.3%
metadata-eval98.3%
*-commutative98.3%
associate-/l*88.1%
Applied egg-rr88.1%
associate-/r/89.1%
Simplified89.1%
*-commutative89.1%
clear-num88.8%
un-div-inv88.9%
Applied egg-rr88.9%
un-div-inv89.1%
pow1/289.1%
associate-/r/88.1%
*-commutative88.1%
metadata-eval88.1%
pow-prod-up87.9%
expm1-log1p-u60.6%
associate-/l/60.7%
expm1-udef27.8%
associate-/l/27.8%
pow-sqr27.8%
metadata-eval27.8%
pow1/227.8%
Applied egg-rr27.8%
expm1-def60.8%
expm1-log1p88.1%
*-commutative88.1%
associate-*l/98.6%
associate-*r/89.2%
Simplified89.2%
Taylor expanded in V around 0 98.6%
if 3.99999999999999978e273 < (/.f64 A (*.f64 V l)) Initial program 38.3%
pow1/238.3%
clear-num38.3%
inv-pow38.3%
pow-pow40.9%
*-commutative40.9%
associate-/l*50.9%
metadata-eval50.9%
Applied egg-rr50.9%
associate-/r/50.9%
Simplified50.9%
Final simplification78.3%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 4e+290)))
(/ c0 (sqrt (* V (/ l A))))
(* c0 (sqrt t_0)))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+290)) {
tmp = c0 / sqrt((V * (l / A)));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 4d+290))) then
tmp = c0 / sqrt((v * (l / a)))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 4e+290)) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 4e+290): tmp = c0 / math.sqrt((V * (l / A))) else: tmp = c0 * math.sqrt(t_0) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 4e+290)) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 4e+290)))
tmp = c0 / sqrt((V * (l / A)));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 4e+290]], $MachinePrecision]], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 4 \cdot 10^{+290}\right):\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 4.00000000000000025e290 < (/.f64 A (*.f64 V l)) Initial program 30.3%
clear-num30.3%
sqrt-div31.5%
metadata-eval31.5%
*-commutative31.5%
associate-/l*46.4%
Applied egg-rr46.4%
associate-/r/46.4%
Simplified46.4%
*-commutative46.4%
clear-num46.4%
un-div-inv46.4%
Applied egg-rr46.4%
un-div-inv46.5%
pow1/246.5%
associate-/r/46.4%
*-commutative46.4%
metadata-eval46.4%
pow-prod-up46.3%
expm1-log1p-u37.4%
associate-/l/37.5%
expm1-udef30.9%
associate-/l/30.9%
pow-sqr30.9%
metadata-eval30.9%
pow1/230.9%
Applied egg-rr30.9%
expm1-def37.5%
expm1-log1p46.4%
*-commutative46.4%
associate-*l/31.5%
associate-*r/46.5%
Simplified46.5%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.00000000000000025e290Initial program 98.6%
Final simplification78.2%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(/ c0 (sqrt (* V (/ l A))))
(if (<= t_0 1e+270) (* c0 (sqrt t_0)) (/ c0 (sqrt (* l (/ V A))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / sqrt((V * (l / A)));
} else if (t_0 <= 1e+270) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 / sqrt((v * (l / a)))
else if (t_0 <= 1d+270) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if (t_0 <= 1e+270) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 / math.sqrt((V * (l / A))) elif t_0 <= 1e+270: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (t_0 <= 1e+270) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 / sqrt((V * (l / A)));
elseif (t_0 <= 1e+270)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+270], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;t_0 \leq 10^{+270}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 25.2%
clear-num25.2%
sqrt-div25.2%
metadata-eval25.2%
*-commutative25.2%
associate-/l*43.7%
Applied egg-rr43.7%
associate-/r/43.8%
Simplified43.8%
*-commutative43.8%
clear-num43.8%
un-div-inv43.7%
Applied egg-rr43.7%
un-div-inv43.9%
pow1/243.9%
associate-/r/43.8%
*-commutative43.8%
metadata-eval43.8%
pow-prod-up43.7%
expm1-log1p-u39.9%
associate-/l/39.9%
expm1-udef29.9%
associate-/l/29.9%
pow-sqr29.9%
metadata-eval29.9%
pow1/229.9%
Applied egg-rr29.9%
expm1-def40.0%
expm1-log1p43.8%
*-commutative43.8%
associate-*l/25.2%
associate-*r/43.9%
Simplified43.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 1e270Initial program 98.6%
if 1e270 < (/.f64 A (*.f64 V l)) Initial program 39.6%
pow1/239.6%
clear-num39.6%
inv-pow39.6%
pow-pow42.2%
*-commutative42.2%
associate-/l*52.0%
metadata-eval52.0%
Applied egg-rr52.0%
associate-/r/49.9%
Simplified49.9%
metadata-eval49.9%
pow-flip49.8%
pow1/249.8%
un-div-inv49.8%
associate-/r/51.9%
clear-num48.0%
associate-/r/51.9%
clear-num51.9%
*-commutative51.9%
Applied egg-rr51.9%
Final simplification78.2%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(/ c0 (sqrt (* V (/ l A))))
(if (<= t_0 1e+270) (* c0 (sqrt t_0)) (/ c0 (sqrt (/ l (/ A V))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / sqrt((V * (l / A)));
} else if (t_0 <= 1e+270) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((l / (A / V)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 / sqrt((v * (l / a)))
else if (t_0 <= 1d+270) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((l / (a / v)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if (t_0 <= 1e+270) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((l / (A / V)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 / math.sqrt((V * (l / A))) elif t_0 <= 1e+270: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((l / (A / V))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (t_0 <= 1e+270) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(l / Float64(A / V)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 / sqrt((V * (l / A)));
elseif (t_0 <= 1e+270)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((l / (A / V)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+270], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;t_0 \leq 10^{+270}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 25.2%
clear-num25.2%
sqrt-div25.2%
metadata-eval25.2%
*-commutative25.2%
associate-/l*43.7%
Applied egg-rr43.7%
associate-/r/43.8%
Simplified43.8%
*-commutative43.8%
clear-num43.8%
un-div-inv43.7%
Applied egg-rr43.7%
un-div-inv43.9%
pow1/243.9%
associate-/r/43.8%
*-commutative43.8%
metadata-eval43.8%
pow-prod-up43.7%
expm1-log1p-u39.9%
associate-/l/39.9%
expm1-udef29.9%
associate-/l/29.9%
pow-sqr29.9%
metadata-eval29.9%
pow1/229.9%
Applied egg-rr29.9%
expm1-def40.0%
expm1-log1p43.8%
*-commutative43.8%
associate-*l/25.2%
associate-*r/43.9%
Simplified43.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 1e270Initial program 98.6%
if 1e270 < (/.f64 A (*.f64 V l)) Initial program 39.6%
associate-/r*48.0%
sqrt-div30.8%
Applied egg-rr30.8%
frac-2neg30.8%
clear-num30.8%
frac-2neg30.8%
sqrt-undiv51.9%
un-div-inv51.9%
clear-num51.9%
div-inv51.9%
clear-num51.9%
un-div-inv51.9%
Applied egg-rr51.9%
Final simplification78.2%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 5e-308)
(/ c0 (sqrt (* V (/ l A))))
(if (<= t_0 1e+270)
(/ c0 (sqrt (/ (* V l) A)))
(/ c0 (sqrt (/ l (/ A V))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-308) {
tmp = c0 / sqrt((V * (l / A)));
} else if (t_0 <= 1e+270) {
tmp = c0 / sqrt(((V * l) / A));
} else {
tmp = c0 / sqrt((l / (A / V)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 5d-308) then
tmp = c0 / sqrt((v * (l / a)))
else if (t_0 <= 1d+270) then
tmp = c0 / sqrt(((v * l) / a))
else
tmp = c0 / sqrt((l / (a / v)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-308) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else if (t_0 <= 1e+270) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else {
tmp = c0 / Math.sqrt((l / (A / V)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 5e-308: tmp = c0 / math.sqrt((V * (l / A))) elif t_0 <= 1e+270: tmp = c0 / math.sqrt(((V * l) / A)) else: tmp = c0 / math.sqrt((l / (A / V))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 5e-308) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); elseif (t_0 <= 1e+270) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); else tmp = Float64(c0 / sqrt(Float64(l / Float64(A / V)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 5e-308)
tmp = c0 / sqrt((V * (l / A)));
elseif (t_0 <= 1e+270)
tmp = c0 / sqrt(((V * l) / A));
else
tmp = c0 / sqrt((l / (A / V)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-308], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+270], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 5 \cdot 10^{-308}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{elif}\;t_0 \leq 10^{+270}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.99999999999999955e-308Initial program 29.0%
clear-num29.0%
sqrt-div28.9%
metadata-eval28.9%
*-commutative28.9%
associate-/l*45.0%
Applied egg-rr45.0%
associate-/r/46.6%
Simplified46.6%
*-commutative46.6%
clear-num46.6%
un-div-inv46.6%
Applied egg-rr46.6%
un-div-inv46.7%
pow1/246.7%
associate-/r/45.1%
*-commutative45.1%
metadata-eval45.1%
pow-prod-up44.9%
expm1-log1p-u41.3%
associate-/l/41.3%
expm1-udef31.9%
associate-/l/31.9%
pow-sqr31.9%
metadata-eval31.9%
pow1/231.9%
Applied egg-rr31.9%
expm1-def41.4%
expm1-log1p45.1%
*-commutative45.1%
associate-*l/28.9%
associate-*r/46.7%
Simplified46.7%
if 4.99999999999999955e-308 < (/.f64 A (*.f64 V l)) < 1e270Initial program 98.5%
clear-num98.5%
sqrt-div98.3%
metadata-eval98.3%
*-commutative98.3%
associate-/l*88.0%
Applied egg-rr88.0%
associate-/r/89.7%
Simplified89.7%
*-commutative89.7%
clear-num89.4%
un-div-inv89.5%
Applied egg-rr89.5%
un-div-inv89.6%
pow1/289.6%
associate-/r/88.0%
*-commutative88.0%
metadata-eval88.0%
pow-prod-up87.8%
expm1-log1p-u60.4%
associate-/l/60.4%
expm1-udef27.9%
associate-/l/27.9%
pow-sqr27.9%
metadata-eval27.9%
pow1/227.9%
Applied egg-rr27.9%
expm1-def60.5%
expm1-log1p88.0%
*-commutative88.0%
associate-*l/98.6%
associate-*r/89.8%
Simplified89.8%
Taylor expanded in V around 0 98.6%
if 1e270 < (/.f64 A (*.f64 V l)) Initial program 39.6%
associate-/r*48.0%
sqrt-div30.8%
Applied egg-rr30.8%
frac-2neg30.8%
clear-num30.8%
frac-2neg30.8%
sqrt-undiv51.9%
un-div-inv51.9%
clear-num51.9%
div-inv51.9%
clear-num51.9%
un-div-inv51.9%
Applied egg-rr51.9%
Final simplification78.2%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (/ A (* V l)))) (if (<= t_0 0.0) (* c0 (sqrt (/ (/ A V) l))) (* c0 (sqrt t_0)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.sqrt(t_0) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;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.0Initial program 25.2%
sqrt-div26.3%
associate-*r/26.3%
Applied egg-rr26.3%
associate-/l*26.3%
Simplified26.3%
div-inv26.3%
sqrt-undiv25.2%
*-commutative25.2%
associate-*l/43.8%
*-commutative43.8%
metadata-eval43.8%
sqrt-div43.8%
associate-/r/43.8%
clear-num43.8%
Applied egg-rr43.8%
if 0.0 < (/.f64 A (*.f64 V l)) Initial program 85.0%
Final simplification76.0%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[V, l] = sort([V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
V, l = sort([V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
V, l = num2cell(sort([V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 71.9%
Final simplification71.9%
herbie shell --seed 2023318
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))