
(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 14 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 -1e-310) (/ c0 (/ (sqrt (- V)) (sqrt (/ (- A) l)))) (/ (* c0 (sqrt A)) (/ (sqrt l) (pow V -0.5)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -1e-310) {
tmp = c0 / (sqrt(-V) / sqrt((-A / l)));
} else {
tmp = (c0 * sqrt(A)) / (sqrt(l) / pow(V, -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) :: tmp
if (v <= (-1d-310)) then
tmp = c0 / (sqrt(-v) / sqrt((-a / l)))
else
tmp = (c0 * sqrt(a)) / (sqrt(l) / (v ** (-0.5d0)))
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 <= -1e-310) {
tmp = c0 / (Math.sqrt(-V) / Math.sqrt((-A / l)));
} else {
tmp = (c0 * Math.sqrt(A)) / (Math.sqrt(l) / Math.pow(V, -0.5));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if V <= -1e-310: tmp = c0 / (math.sqrt(-V) / math.sqrt((-A / l))) else: tmp = (c0 * math.sqrt(A)) / (math.sqrt(l) / math.pow(V, -0.5)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= -1e-310) tmp = Float64(c0 / Float64(sqrt(Float64(-V)) / sqrt(Float64(Float64(-A) / l)))); else tmp = Float64(Float64(c0 * sqrt(A)) / Float64(sqrt(l) / (V ^ -0.5))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (V <= -1e-310)
tmp = c0 / (sqrt(-V) / sqrt((-A / l)));
else
tmp = (c0 * sqrt(A)) / (sqrt(l) / (V ^ -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_] := If[LessEqual[V, -1e-310], N[(c0 / N[(N[Sqrt[(-V)], $MachinePrecision] / N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c0 * N[Sqrt[A], $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[l], $MachinePrecision] / N[Power[V, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{-V}}{\sqrt{\frac{-A}{\ell}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{A}}{\frac{\sqrt{\ell}}{{V}^{-0.5}}}\\
\end{array}
\end{array}
if V < -9.999999999999969e-311Initial program 71.6%
associate-/r*72.5%
sqrt-div32.9%
Applied egg-rr32.9%
clear-num32.9%
un-div-inv32.9%
sqrt-undiv74.6%
un-div-inv74.5%
clear-num74.6%
div-inv74.6%
associate-*r*71.7%
div-inv71.7%
associate-*l/74.4%
*-commutative74.4%
Applied egg-rr74.4%
associate-*r/71.7%
associate-*l/74.6%
Simplified74.6%
associate-/r/74.2%
frac-2neg74.2%
sqrt-div86.9%
distribute-neg-frac86.9%
Applied egg-rr86.9%
if -9.999999999999969e-311 < V Initial program 73.1%
pow1/273.1%
clear-num72.4%
inv-pow72.4%
pow-pow72.7%
*-commutative72.7%
associate-/l*73.5%
metadata-eval73.5%
Applied egg-rr73.5%
associate-/l*72.7%
*-commutative72.7%
associate-/l*71.3%
associate-/r/72.6%
Simplified72.6%
*-commutative72.6%
div-inv72.6%
associate-*r*72.6%
div-inv72.7%
clear-num72.3%
add-sqr-sqrt39.8%
sqrt-unprod32.7%
sqr-neg32.7%
sqrt-unprod7.2%
add-sqr-sqrt18.7%
add-sqr-sqrt11.5%
sqrt-unprod37.0%
sqr-neg37.0%
sqrt-unprod32.5%
add-sqr-sqrt72.3%
*-commutative72.3%
clear-num72.4%
distribute-rgt-neg-out72.4%
frac-2neg72.4%
associate-*l/71.2%
*-commutative71.2%
clear-num71.2%
un-div-inv72.2%
clear-num72.2%
Applied egg-rr72.2%
associate-/r/72.6%
*-commutative72.6%
associate-/r/72.6%
Simplified72.6%
add-sqr-sqrt72.4%
sqrt-unprod71.3%
pow-prod-up71.2%
associate-*l/71.2%
*-un-lft-identity71.2%
clear-num71.2%
div-inv72.2%
metadata-eval72.2%
inv-pow72.2%
clear-num72.9%
sqrt-div45.9%
div-inv45.9%
sqrt-prod53.5%
associate-*r/53.5%
sqrt-div46.4%
*-commutative46.4%
Applied egg-rr51.4%
associate-/l*54.1%
Simplified54.1%
Final simplification70.3%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= V -1e-310) (/ c0 (/ (sqrt (- V)) (sqrt (/ (- A) l)))) (* c0 (/ (/ (sqrt A) (sqrt V)) (sqrt l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -1e-310) {
tmp = c0 / (sqrt(-V) / sqrt((-A / l)));
} else {
tmp = c0 * ((sqrt(A) / sqrt(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 (v <= (-1d-310)) then
tmp = c0 / (sqrt(-v) / sqrt((-a / l)))
else
tmp = c0 * ((sqrt(a) / sqrt(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 (V <= -1e-310) {
tmp = c0 / (Math.sqrt(-V) / Math.sqrt((-A / l)));
} else {
tmp = c0 * ((Math.sqrt(A) / Math.sqrt(V)) / Math.sqrt(l));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if V <= -1e-310: tmp = c0 / (math.sqrt(-V) / math.sqrt((-A / l))) else: tmp = c0 * ((math.sqrt(A) / math.sqrt(V)) / math.sqrt(l)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (V <= -1e-310) tmp = Float64(c0 / Float64(sqrt(Float64(-V)) / sqrt(Float64(Float64(-A) / l)))); else tmp = Float64(c0 * Float64(Float64(sqrt(A) / sqrt(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 (V <= -1e-310)
tmp = c0 / (sqrt(-V) / sqrt((-A / l)));
else
tmp = c0 * ((sqrt(A) / sqrt(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[V, -1e-310], N[(c0 / N[(N[Sqrt[(-V)], $MachinePrecision] / N[Sqrt[N[((-A) / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[V], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{-V}}{\sqrt{\frac{-A}{\ell}}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\frac{\sqrt{A}}{\sqrt{V}}}{\sqrt{\ell}}\\
\end{array}
\end{array}
if V < -9.999999999999969e-311Initial program 71.6%
associate-/r*72.5%
sqrt-div32.9%
Applied egg-rr32.9%
clear-num32.9%
un-div-inv32.9%
sqrt-undiv74.6%
un-div-inv74.5%
clear-num74.6%
div-inv74.6%
associate-*r*71.7%
div-inv71.7%
associate-*l/74.4%
*-commutative74.4%
Applied egg-rr74.4%
associate-*r/71.7%
associate-*l/74.6%
Simplified74.6%
associate-/r/74.2%
frac-2neg74.2%
sqrt-div86.9%
distribute-neg-frac86.9%
Applied egg-rr86.9%
if -9.999999999999969e-311 < V Initial program 73.1%
associate-/r*72.9%
sqrt-div45.9%
Applied egg-rr45.9%
sqrt-div53.5%
div-inv53.5%
Applied egg-rr53.5%
associate-*r/53.5%
*-rgt-identity53.5%
Simplified53.5%
Final simplification70.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) -2e-204)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) 2e-267)
(/ c0 (sqrt (/ V (/ A l))))
(if (<= (* V l) 4e+299)
(* (sqrt A) (/ c0 (sqrt (* V l))))
(* c0 (sqrt (* (/ A l) (/ 1.0 V))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e-204) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= 2e-267) {
tmp = c0 / sqrt((V / (A / l)));
} else if ((V * l) <= 4e+299) {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / l) * (1.0 / 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) <= (-2d-204)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= 2d-267) then
tmp = c0 / sqrt((v / (a / l)))
else if ((v * l) <= 4d+299) then
tmp = sqrt(a) * (c0 / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / l) * (1.0d0 / 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) <= -2e-204) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= 2e-267) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else if ((V * l) <= 4e+299) {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / l) * (1.0 / V)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -2e-204: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= 2e-267: tmp = c0 / math.sqrt((V / (A / l))) elif (V * l) <= 4e+299: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / l) * (1.0 / V))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e-204) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= 2e-267) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); elseif (Float64(V * l) <= 4e+299) tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) * Float64(1.0 / 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) <= -2e-204)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= 2e-267)
tmp = c0 / sqrt((V / (A / l)));
elseif ((V * l) <= 4e+299)
tmp = sqrt(A) * (c0 / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / l) * (1.0 / 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], -2e-204], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-267], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+299], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{-204}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-267}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+299}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell} \cdot \frac{1}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2e-204Initial program 79.4%
associate-/r*74.4%
sqrt-div37.0%
Applied egg-rr37.0%
if -2e-204 < (*.f64 V l) < 2e-267Initial program 53.9%
associate-/r*67.4%
sqrt-div40.1%
Applied egg-rr40.1%
clear-num40.1%
un-div-inv40.2%
sqrt-undiv75.1%
un-div-inv75.1%
clear-num75.1%
div-inv75.0%
associate-*r*54.0%
div-inv54.0%
associate-*l/75.1%
*-commutative75.1%
Applied egg-rr75.1%
associate-*r/54.0%
associate-/l*75.1%
Simplified75.1%
if 2e-267 < (*.f64 V l) < 4.0000000000000002e299Initial program 83.9%
associate-/r*76.6%
sqrt-div43.6%
Applied egg-rr43.6%
sqrt-undiv76.6%
clear-num76.5%
un-div-inv75.3%
clear-num75.3%
*-commutative75.3%
associate-*l/83.3%
frac-2neg83.3%
distribute-rgt-neg-out83.3%
clear-num83.9%
sqrt-undiv0.0%
add-sqr-sqrt0.0%
add-sqr-sqrt0.0%
associate-*r/0.0%
clear-num0.0%
Applied egg-rr96.1%
*-commutative96.1%
associate-/r*98.5%
associate-/l*99.4%
*-lft-identity99.4%
associate-/r/96.5%
Simplified96.5%
if 4.0000000000000002e299 < (*.f64 V l) Initial program 41.5%
*-un-lft-identity41.5%
times-frac63.1%
Applied egg-rr63.1%
Final simplification68.6%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2e-308)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (/ V (/ A l))))
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e-308) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt((V / (A / l)));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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) <= (-2d-308)) then
tmp = c0 * (sqrt(-a) / sqrt((v * -l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / sqrt((v / (a / l)))
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / 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) <= -2e-308) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -2e-308: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 / math.sqrt((V / (A / l))) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -2e-308) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -2e-308)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt((V / (A / l)));
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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[LessEqual[N[(V * l), $MachinePrecision], -2e-308], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -2 \cdot 10^{-308}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -1.9999999999999998e-308Initial program 79.9%
frac-2neg79.9%
sqrt-div93.0%
distribute-rgt-neg-in93.0%
Applied egg-rr93.0%
if -1.9999999999999998e-308 < (*.f64 V l) < 0.0Initial program 38.9%
associate-/r*57.5%
sqrt-div39.2%
Applied egg-rr39.2%
clear-num39.2%
un-div-inv39.2%
sqrt-undiv68.1%
un-div-inv68.1%
clear-num68.1%
div-inv68.1%
associate-*r*38.9%
div-inv38.9%
associate-*l/68.2%
*-commutative68.2%
Applied egg-rr68.2%
associate-*r/38.9%
associate-/l*68.2%
Simplified68.2%
if 0.0 < (*.f64 V l) Initial program 76.3%
div-inv76.3%
sqrt-prod87.9%
associate-/r*89.3%
Applied egg-rr89.3%
Final simplification87.7%
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) 4e+299)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (* (/ A l) (/ 1.0 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) <= 4e+299) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / l) * (1.0 / 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) <= 4d+299) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / l) * (1.0d0 / 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) <= 4e+299) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / l) * (1.0 / 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) <= 4e+299: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / l) * (1.0 / 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) <= 4e+299) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) * Float64(1.0 / 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) <= 4e+299)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / l) * (1.0 / 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], 4e+299], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]], $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 4 \cdot 10^{+299}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell} \cdot \frac{1}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 68.6%
associate-/r*70.4%
sqrt-div37.9%
Applied egg-rr37.9%
if 0.0 < (*.f64 V l) < 4.0000000000000002e299Initial program 85.0%
sqrt-div99.5%
associate-*r/97.3%
Applied egg-rr97.3%
*-commutative97.3%
associate-/l*95.7%
associate-/r/99.5%
Simplified99.5%
if 4.0000000000000002e299 < (*.f64 V l) Initial program 41.5%
*-un-lft-identity41.5%
times-frac63.1%
Applied egg-rr63.1%
Final simplification64.4%
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 l) (sqrt (/ V A))))
(if (<= (* V l) 4e+299)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (* (/ A l) (/ 1.0 V)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= 4e+299) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / l) * (1.0 / 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(l) * sqrt((v / a)))
else if ((v * l) <= 4d+299) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
else
tmp = c0 * sqrt(((a / l) * (1.0d0 / 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(l) * Math.sqrt((V / A)));
} else if ((V * l) <= 4e+299) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} else {
tmp = c0 * Math.sqrt(((A / l) * (1.0 / 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(l) * math.sqrt((V / A))) elif (V * l) <= 4e+299: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) else: tmp = c0 * math.sqrt(((A / l) * (1.0 / 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(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= 4e+299) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) * Float64(1.0 / 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(l) * sqrt((V / A)));
elseif ((V * l) <= 4e+299)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
else
tmp = c0 * sqrt(((A / l) * (1.0 / 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[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e+299], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{+299}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell} \cdot \frac{1}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 68.6%
associate-/r*70.4%
sqrt-div37.9%
Applied egg-rr37.9%
clear-num37.9%
un-div-inv37.9%
sqrt-undiv73.1%
un-div-inv73.0%
clear-num73.0%
div-inv73.1%
associate-*r*68.4%
div-inv68.4%
associate-*l/73.3%
*-commutative73.3%
Applied egg-rr73.3%
associate-*r/68.4%
associate-*l/73.0%
Simplified73.0%
sqrt-prod37.7%
Applied egg-rr37.7%
if 0.0 < (*.f64 V l) < 4.0000000000000002e299Initial program 85.0%
sqrt-div99.5%
associate-*r/97.3%
Applied egg-rr97.3%
*-commutative97.3%
associate-/l*95.7%
associate-/r/99.5%
Simplified99.5%
if 4.0000000000000002e299 < (*.f64 V l) Initial program 41.5%
*-un-lft-identity41.5%
times-frac63.1%
Applied egg-rr63.1%
Final simplification64.3%
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 l) (sqrt (/ V A)))) (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / 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) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) 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(l) * sqrt(Float64(V / A)))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / 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)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / 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[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < 0.0Initial program 68.6%
associate-/r*70.4%
sqrt-div37.9%
Applied egg-rr37.9%
clear-num37.9%
un-div-inv37.9%
sqrt-undiv73.1%
un-div-inv73.0%
clear-num73.0%
div-inv73.1%
associate-*r*68.4%
div-inv68.4%
associate-*l/73.3%
*-commutative73.3%
Applied egg-rr73.3%
associate-*r/68.4%
associate-*l/73.0%
Simplified73.0%
sqrt-prod37.7%
Applied egg-rr37.7%
if 0.0 < (*.f64 V l) Initial program 76.3%
div-inv76.3%
sqrt-prod87.9%
associate-/r*89.3%
Applied egg-rr89.3%
Final simplification62.9%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= V -1e-310) (/ c0 (/ (sqrt (- V)) (sqrt (/ (- A) l)))) (/ c0 (/ (sqrt (* V l)) (sqrt A)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (V <= -1e-310) {
tmp = c0 / (sqrt(-V) / sqrt((-A / 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 <= (-1d-310)) then
tmp = c0 / (sqrt(-v) / sqrt((-a / 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 <= -1e-310) {
tmp = c0 / (Math.sqrt(-V) / Math.sqrt((-A / 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 <= -1e-310: tmp = c0 / (math.sqrt(-V) / math.sqrt((-A / 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 (V <= -1e-310) tmp = Float64(c0 / Float64(sqrt(Float64(-V)) / sqrt(Float64(Float64(-A) / 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 <= -1e-310)
tmp = c0 / (sqrt(-V) / sqrt((-A / 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[LessEqual[V, -1e-310], N[(c0 / N[(N[Sqrt[(-V)], $MachinePrecision] / N[Sqrt[N[((-A) / l), $MachinePrecision]], $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 \leq -1 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{-V}}{\sqrt{\frac{-A}{\ell}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if V < -9.999999999999969e-311Initial program 71.6%
associate-/r*72.5%
sqrt-div32.9%
Applied egg-rr32.9%
clear-num32.9%
un-div-inv32.9%
sqrt-undiv74.6%
un-div-inv74.5%
clear-num74.6%
div-inv74.6%
associate-*r*71.7%
div-inv71.7%
associate-*l/74.4%
*-commutative74.4%
Applied egg-rr74.4%
associate-*r/71.7%
associate-*l/74.6%
Simplified74.6%
associate-/r/74.2%
frac-2neg74.2%
sqrt-div86.9%
distribute-neg-frac86.9%
Applied egg-rr86.9%
if -9.999999999999969e-311 < V Initial program 73.1%
sqrt-div46.4%
associate-*r/46.2%
Applied egg-rr46.2%
associate-/l*46.4%
Simplified46.4%
Final simplification66.4%
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 (* l (* V (/ 1.0 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((l * (V * (1.0 / 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 * ((l * (v * (1.0d0 / 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((l * (V * (1.0 / 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((l * (V * (1.0 / 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(l * Float64(V * Float64(1.0 / 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 * ((l * (V * (1.0 / 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[(l * N[(V * N[(1.0 / A), $MachinePrecision]), $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(\ell \cdot \left(V \cdot \frac{1}{A}\right)\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.2%
pow1/270.2%
clear-num70.0%
inv-pow70.0%
pow-pow70.0%
*-commutative70.0%
associate-/l*75.7%
metadata-eval75.7%
Applied egg-rr75.7%
associate-/l*70.0%
*-commutative70.0%
associate-/l*75.0%
associate-/r/75.7%
Simplified75.7%
*-commutative75.7%
div-inv75.7%
associate-*r*70.0%
div-inv70.0%
clear-num70.0%
add-sqr-sqrt38.2%
sqrt-unprod37.4%
sqr-neg37.4%
sqrt-unprod7.1%
add-sqr-sqrt19.0%
add-sqr-sqrt0.0%
sqrt-unprod50.4%
sqr-neg50.4%
sqrt-unprod69.9%
add-sqr-sqrt70.0%
*-commutative70.0%
clear-num70.0%
distribute-rgt-neg-out70.0%
frac-2neg70.0%
associate-*l/73.9%
*-commutative73.9%
clear-num73.8%
un-div-inv73.9%
clear-num73.9%
Applied egg-rr73.9%
associate-/r/75.7%
*-commutative75.7%
associate-/r/75.7%
Simplified75.7%
if -4.999999999999985e-310 < l Initial program 74.6%
associate-/r*71.2%
sqrt-div82.2%
Applied egg-rr82.2%
Final simplification78.8%
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 5e+303)))
(* 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) || !(t_0 <= 5e+303)) {
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) .or. (.not. (t_0 <= 5d+303))) 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) || !(t_0 <= 5e+303)) {
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) or not (t_0 <= 5e+303): 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) || !(t_0 <= 5e+303)) 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) || ~((t_0 <= 5e+303)))
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[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+303]], $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}
[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 5 \cdot 10^{+303}\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 4.9999999999999997e303 < (/.f64 A (*.f64 V l)) Initial program 40.4%
pow140.4%
metadata-eval40.4%
pow-prod-up31.3%
pow-prod-down31.3%
*-commutative31.3%
*-commutative31.3%
swap-sqr30.6%
add-sqr-sqrt30.6%
associate-/r*32.5%
pow232.5%
Applied egg-rr32.5%
unpow1/232.5%
associate-*l/35.9%
Simplified35.9%
sqrt-div18.7%
*-commutative18.7%
sqrt-prod18.7%
unpow218.7%
sqrt-prod16.7%
add-sqr-sqrt33.6%
associate-*r/34.5%
*-commutative34.5%
sqrt-undiv53.0%
Applied egg-rr53.0%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.9999999999999997e303Initial program 98.4%
Final simplification78.0%
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)))
(if (<= t_0 5e+303) (* 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(((A / V) / l));
} else if (t_0 <= 5e+303) {
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(((a / v) / l))
else if (t_0 <= 5d+303) 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(((A / V) / l));
} else if (t_0 <= 5e+303) {
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(((A / V) / l)) elif t_0 <= 5e+303: 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(Float64(A / V) / l))); elseif (t_0 <= 5e+303) 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(((A / V) / l));
elseif (t_0 <= 5e+303)
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[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+303], 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:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 5 \cdot 10^{+303}:\\
\;\;\;\;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 40.3%
pow140.3%
metadata-eval40.3%
pow-prod-up40.3%
pow-prod-down40.3%
*-commutative40.3%
*-commutative40.3%
swap-sqr39.3%
add-sqr-sqrt39.3%
associate-/r*41.0%
pow241.0%
Applied egg-rr41.0%
unpow1/241.0%
associate-*l/40.3%
Simplified40.3%
sqrt-div18.1%
*-commutative18.1%
sqrt-prod18.1%
unpow218.1%
sqrt-prod13.1%
add-sqr-sqrt28.3%
associate-*r/29.7%
*-commutative29.7%
sqrt-undiv52.6%
Applied egg-rr52.6%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.9999999999999997e303Initial program 98.4%
if 4.9999999999999997e303 < (/.f64 A (*.f64 V l)) Initial program 40.7%
associate-/r*53.3%
sqrt-div40.0%
Applied egg-rr40.0%
clear-num40.0%
un-div-inv40.1%
sqrt-undiv61.9%
un-div-inv61.9%
clear-num61.9%
div-inv61.9%
associate-*r*42.1%
div-inv42.1%
associate-*l/60.6%
*-commutative60.6%
Applied egg-rr60.6%
associate-*r/42.1%
associate-*l/61.9%
Simplified61.9%
Final simplification79.8%
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)))
(if (<= t_0 2e+302) (* c0 (sqrt t_0)) (/ c0 (sqrt (/ V (/ A l))))))))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 if (t_0 <= 2e+302) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V / (A / 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) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+302) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v / (a / l)))
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 if (t_0 <= 2e+302) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
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)) elif t_0 <= 2e+302: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V / (A / l))) 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))); elseif (t_0 <= 2e+302) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); 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));
elseif (t_0 <= 2e+302)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V / (A / 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_] := 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], If[LessEqual[t$95$0, 2e+302], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[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{elif}\;t_0 \leq 2 \cdot 10^{+302}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 40.3%
pow140.3%
metadata-eval40.3%
pow-prod-up40.3%
pow-prod-down40.3%
*-commutative40.3%
*-commutative40.3%
swap-sqr39.3%
add-sqr-sqrt39.3%
associate-/r*41.0%
pow241.0%
Applied egg-rr41.0%
unpow1/241.0%
associate-*l/40.3%
Simplified40.3%
sqrt-div18.1%
*-commutative18.1%
sqrt-prod18.1%
unpow218.1%
sqrt-prod13.1%
add-sqr-sqrt28.3%
associate-*r/29.7%
*-commutative29.7%
sqrt-undiv52.6%
Applied egg-rr52.6%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000002e302Initial program 98.4%
if 2.0000000000000002e302 < (/.f64 A (*.f64 V l)) Initial program 41.7%
associate-/r*54.2%
sqrt-div41.1%
Applied egg-rr41.1%
clear-num41.1%
un-div-inv41.2%
sqrt-undiv62.6%
un-div-inv62.6%
clear-num62.6%
div-inv62.6%
associate-*r*43.1%
div-inv43.1%
associate-*l/59.6%
*-commutative59.6%
Applied egg-rr59.6%
associate-*r/43.1%
associate-/l*59.6%
Simplified59.6%
Final simplification79.1%
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 l) (/ 1.0 V))))
(if (<= t_0 2e+302) (* c0 (sqrt t_0)) (/ c0 (sqrt (/ V (/ A l))))))))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 / l) * (1.0 / V)));
} else if (t_0 <= 2e+302) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V / (A / 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) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) * (1.0d0 / v)))
else if (t_0 <= 2d+302) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v / (a / l)))
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 / l) * (1.0 / V)));
} else if (t_0 <= 2e+302) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V / (A / l)));
}
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 / l) * (1.0 / V))) elif t_0 <= 2e+302: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V / (A / l))) 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 / l) * Float64(1.0 / V)))); elseif (t_0 <= 2e+302) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); 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 / l) * (1.0 / V)));
elseif (t_0 <= 2e+302)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V / (A / 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_] := 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 / l), $MachinePrecision] * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+302], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[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{A}{\ell} \cdot \frac{1}{V}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+302}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 40.3%
*-un-lft-identity40.3%
times-frac52.6%
Applied egg-rr52.6%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.0000000000000002e302Initial program 98.4%
if 2.0000000000000002e302 < (/.f64 A (*.f64 V l)) Initial program 41.7%
associate-/r*54.2%
sqrt-div41.1%
Applied egg-rr41.1%
clear-num41.1%
un-div-inv41.2%
sqrt-undiv62.6%
un-div-inv62.6%
clear-num62.6%
div-inv62.6%
associate-*r*43.1%
div-inv43.1%
associate-*l/59.6%
*-commutative59.6%
Applied egg-rr59.6%
associate-*r/43.1%
associate-/l*59.6%
Simplified59.6%
Final simplification79.1%
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 72.4%
Final simplification72.4%
herbie shell --seed 2023309
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))