
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -4e-310) (/ (* (/ (sqrt (- A)) (sqrt (- V))) c0) (sqrt l)) (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = ((sqrt(-A) / sqrt(-V)) * c0) / sqrt(l);
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-4d-310)) then
tmp = ((sqrt(-a) / sqrt(-v)) * c0) / sqrt(l)
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / v) / l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-310) {
tmp = ((Math.sqrt(-A) / Math.sqrt(-V)) * c0) / Math.sqrt(l);
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -4e-310: tmp = ((math.sqrt(-A) / math.sqrt(-V)) * c0) / math.sqrt(l) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -4e-310) tmp = Float64(Float64(Float64(sqrt(Float64(-A)) / sqrt(Float64(-V))) * c0) / sqrt(l)); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -4e-310)
tmp = ((sqrt(-A) / sqrt(-V)) * c0) / sqrt(l);
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -4e-310], N[(N[(N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision] * c0), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4 \cdot 10^{-310}:\\
\;\;\;\;\frac{\frac{\sqrt{-A}}{\sqrt{-V}} \cdot c0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if A < -3.999999999999988e-310Initial program 74.4%
*-commutative74.4%
associate-/r*72.9%
sqrt-div40.5%
associate-*l/38.5%
Applied egg-rr38.5%
frac-2neg38.5%
sqrt-div46.9%
Applied egg-rr46.9%
if -3.999999999999988e-310 < A Initial program 75.6%
pow1/275.6%
div-inv75.5%
unpow-prod-down85.3%
pow1/285.3%
Applied egg-rr85.3%
unpow1/285.3%
associate-/r*86.0%
Simplified86.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 5e+289)
(/ c0 (sqrt (/ (* V l) A)))
(/ c0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 5e+289) {
tmp = c0 / sqrt(((V * l) / A));
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 5d+289) then
tmp = c0 / sqrt(((v * l) / a))
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 5e+289) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 5e+289: tmp = c0 / math.sqrt(((V * l) / A)) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 5e+289) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 5e+289)
tmp = c0 / sqrt(((V * l) / A));
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+289], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\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^{+289}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 69.1%
*-commutative69.1%
associate-/l/70.1%
Simplified70.1%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.00000000000000031e289Initial program 99.5%
associate-/r*89.6%
clear-num89.6%
sqrt-div89.5%
metadata-eval89.5%
clear-num89.5%
associate-/r*99.5%
clear-num99.5%
associate-/l*90.4%
Applied egg-rr90.4%
un-div-inv90.6%
associate-*r/99.7%
*-commutative99.7%
associate-/l*88.7%
Applied egg-rr88.7%
Taylor expanded in l around 0 99.7%
if 5.00000000000000031e289 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 39.9%
associate-/r*49.3%
clear-num49.3%
sqrt-div49.3%
metadata-eval49.3%
clear-num49.3%
associate-/r*39.9%
clear-num39.9%
associate-/l*49.3%
Applied egg-rr49.3%
un-div-inv49.3%
associate-*r/39.9%
*-commutative39.9%
associate-/l*49.3%
Applied egg-rr49.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* c0 (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* V l) -2e-284)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(sqrt (* A (* (/ c0 l) (/ c0 V))))
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= -2e-284) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((V * l) <= -2e-284) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = Math.sqrt((A * ((c0 / l) * (c0 / V))));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= -2e-284: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = math.sqrt((A * ((c0 / l) * (c0 / V)))) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -2e-284) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = sqrt(Float64(A * Float64(Float64(c0 / l) * Float64(c0 / V)))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= -2e-284)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-284], 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[Sqrt[N[(A * N[(N[(c0 / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-284}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 17.9%
Taylor expanded in c0 around 0 17.9%
*-commutative17.9%
associate-/r*50.7%
Simplified50.7%
frac-2neg50.7%
sqrt-div29.9%
distribute-neg-frac29.9%
Applied egg-rr29.9%
if -inf.0 < (*.f64 V l) < -2.00000000000000007e-284Initial program 88.9%
frac-2neg88.9%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -2.00000000000000007e-284 < (*.f64 V l) < -0.0Initial program 25.1%
associate-/r*52.1%
clear-num52.1%
sqrt-div52.0%
metadata-eval52.0%
clear-num52.0%
associate-/r*25.1%
clear-num25.1%
associate-/l*52.0%
Applied egg-rr52.0%
un-div-inv52.1%
associate-*r/25.1%
*-commutative25.1%
associate-/l*52.1%
Applied egg-rr52.1%
associate-*r/25.1%
*-commutative25.1%
associate-/l*52.1%
Simplified52.1%
associate-*r/25.1%
*-commutative25.1%
associate-*r/52.1%
add-sqr-sqrt19.5%
sqrt-unprod9.6%
associate-*r/9.5%
*-commutative9.5%
associate-*r/9.6%
associate-*r/9.5%
*-commutative9.5%
associate-*r/9.6%
frac-times8.9%
pow28.9%
add-sqr-sqrt8.9%
Applied egg-rr8.9%
associate-/r*12.8%
associate-/r/13.2%
Simplified13.2%
associate-/l/8.8%
unpow28.8%
times-frac30.2%
Applied egg-rr30.2%
if -0.0 < (*.f64 V l) Initial program 82.2%
pow1/282.2%
div-inv82.2%
unpow-prod-down93.1%
pow1/293.1%
Applied egg-rr93.1%
unpow1/293.1%
associate-/r*93.9%
Simplified93.9%
Final simplification85.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (* A (* (/ c0 l) (/ c0 V))))))
(if (<= (* V l) (- INFINITY))
t_0
(if (<= (* V l) -2e-284)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0) t_0 (* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A * ((c0 / l) * (c0 / V))));
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((V * l) <= -2e-284) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A * ((c0 / l) * (c0 / V))));
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = t_0;
} else if ((V * l) <= -2e-284) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A * ((c0 / l) * (c0 / V)))) tmp = 0 if (V * l) <= -math.inf: tmp = t_0 elif (V * l) <= -2e-284: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = t_0 else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A * Float64(Float64(c0 / l) * Float64(c0 / V)))) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = t_0; elseif (Float64(V * l) <= -2e-284) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = t_0; else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A * ((c0 / l) * (c0 / V))));
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = t_0;
elseif ((V * l) <= -2e-284)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A * N[(N[(c0 / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -2e-284], 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, N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-284}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or -2.00000000000000007e-284 < (*.f64 V l) < -0.0Initial program 22.6%
associate-/r*51.6%
clear-num51.1%
sqrt-div51.1%
metadata-eval51.1%
clear-num51.1%
associate-/r*22.6%
clear-num22.6%
associate-/l*51.1%
Applied egg-rr51.1%
un-div-inv51.2%
associate-*r/22.6%
*-commutative22.6%
associate-/l*51.2%
Applied egg-rr51.2%
associate-*r/22.6%
*-commutative22.6%
associate-/l*51.2%
Simplified51.2%
associate-*r/22.6%
*-commutative22.6%
associate-*r/51.2%
add-sqr-sqrt23.0%
sqrt-unprod14.7%
associate-*r/12.5%
*-commutative12.5%
associate-*r/14.7%
associate-*r/12.5%
*-commutative12.5%
associate-*r/14.7%
frac-times11.7%
pow211.7%
add-sqr-sqrt11.7%
Applied egg-rr11.7%
associate-/r*18.8%
associate-/r/19.1%
Simplified19.1%
associate-/l/11.5%
unpow211.5%
times-frac37.0%
Applied egg-rr37.0%
if -inf.0 < (*.f64 V l) < -2.00000000000000007e-284Initial program 88.9%
frac-2neg88.9%
sqrt-div99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
if -0.0 < (*.f64 V l) Initial program 82.2%
pow1/282.2%
div-inv82.2%
unpow-prod-down93.1%
pow1/293.1%
Applied egg-rr93.1%
unpow1/293.1%
associate-/r*93.9%
Simplified93.9%
Final simplification86.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -4e+60)
(/ (* c0 (sqrt (/ A V))) (sqrt l))
(if (<= (* V l) -5e-243)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
(sqrt (* A (* (/ c0 l) (/ c0 V))))
(* c0 (* (sqrt A) (sqrt (/ (/ 1.0 V) l))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -4e+60) {
tmp = (c0 * sqrt((A / V))) / sqrt(l);
} else if ((V * l) <= -5e-243) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
} else {
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-4d+60)) then
tmp = (c0 * sqrt((a / v))) / sqrt(l)
else if ((v * l) <= (-5d-243)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = sqrt((a * ((c0 / l) * (c0 / v))))
else
tmp = c0 * (sqrt(a) * sqrt(((1.0d0 / v) / l)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -4e+60) {
tmp = (c0 * Math.sqrt((A / V))) / Math.sqrt(l);
} else if ((V * l) <= -5e-243) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = Math.sqrt((A * ((c0 / l) * (c0 / V))));
} else {
tmp = c0 * (Math.sqrt(A) * Math.sqrt(((1.0 / V) / l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -4e+60: tmp = (c0 * math.sqrt((A / V))) / math.sqrt(l) elif (V * l) <= -5e-243: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = math.sqrt((A * ((c0 / l) * (c0 / V)))) else: tmp = c0 * (math.sqrt(A) * math.sqrt(((1.0 / V) / l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -4e+60) tmp = Float64(Float64(c0 * sqrt(Float64(A / V))) / sqrt(l)); elseif (Float64(V * l) <= -5e-243) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = sqrt(Float64(A * Float64(Float64(c0 / l) * Float64(c0 / V)))); else tmp = Float64(c0 * Float64(sqrt(A) * sqrt(Float64(Float64(1.0 / V) / l)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -4e+60)
tmp = (c0 * sqrt((A / V))) / sqrt(l);
elseif ((V * l) <= -5e-243)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
else
tmp = c0 * (sqrt(A) * sqrt(((1.0 / V) / l)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -4e+60], N[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-243], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[Sqrt[N[(A * N[(N[(c0 / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] * N[Sqrt[N[(N[(1.0 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -4 \cdot 10^{+60}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-243}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\sqrt{A} \cdot \sqrt{\frac{\frac{1}{V}}{\ell}}\right)\\
\end{array}
\end{array}
if (*.f64 V l) < -3.9999999999999998e60Initial program 64.7%
*-commutative64.7%
associate-/r*68.6%
sqrt-div37.4%
associate-*l/35.8%
Applied egg-rr35.8%
if -3.9999999999999998e60 < (*.f64 V l) < -5e-243Initial program 98.3%
associate-/r*85.5%
clear-num85.5%
sqrt-div85.4%
metadata-eval85.4%
clear-num85.4%
associate-/r*98.2%
clear-num98.2%
associate-/l*86.9%
Applied egg-rr86.9%
un-div-inv87.0%
associate-*r/98.3%
*-commutative98.3%
associate-/l*84.4%
Applied egg-rr84.4%
Taylor expanded in l around 0 98.3%
if -5e-243 < (*.f64 V l) < -0.0Initial program 24.7%
associate-/r*47.6%
clear-num47.6%
sqrt-div47.5%
metadata-eval47.5%
clear-num47.5%
associate-/r*24.7%
clear-num24.7%
associate-/l*47.5%
Applied egg-rr47.5%
un-div-inv47.6%
associate-*r/24.7%
*-commutative24.7%
associate-/l*47.6%
Applied egg-rr47.6%
associate-*r/24.7%
*-commutative24.7%
associate-/l*47.6%
Simplified47.6%
associate-*r/24.7%
*-commutative24.7%
associate-*r/47.6%
add-sqr-sqrt19.8%
sqrt-unprod11.5%
associate-*r/11.4%
*-commutative11.4%
associate-*r/11.5%
associate-*r/11.4%
*-commutative11.4%
associate-*r/11.5%
frac-times10.8%
pow210.8%
add-sqr-sqrt10.8%
Applied egg-rr10.8%
associate-/r*13.4%
associate-/r/16.7%
Simplified16.7%
associate-/l/13.0%
unpow213.0%
times-frac32.0%
Applied egg-rr32.0%
if -0.0 < (*.f64 V l) Initial program 82.2%
pow1/282.2%
div-inv82.2%
unpow-prod-down93.1%
pow1/293.1%
Applied egg-rr93.1%
unpow1/293.1%
associate-/r*93.9%
Simplified93.9%
Final simplification74.7%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 5e+298)))
(sqrt (* A (* (/ c0 l) (/ c0 V))))
(/ c0 (sqrt (/ (* V l) A))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+298)) {
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
} else {
tmp = c0 / sqrt(((V * l) / A));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 5d+298))) then
tmp = sqrt((a * ((c0 / l) * (c0 / v))))
else
tmp = c0 / sqrt(((v * l) / a))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 5e+298)) {
tmp = Math.sqrt((A * ((c0 / l) * (c0 / V))));
} else {
tmp = c0 / Math.sqrt(((V * l) / A));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 5e+298): tmp = math.sqrt((A * ((c0 / l) * (c0 / V)))) else: tmp = c0 / math.sqrt(((V * l) / A)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 5e+298)) tmp = sqrt(Float64(A * Float64(Float64(c0 / l) * Float64(c0 / V)))); else tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 5e+298)))
tmp = sqrt((A * ((c0 / l) * (c0 / V))));
else
tmp = c0 / sqrt(((V * l) / A));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 5e+298]], $MachinePrecision]], N[Sqrt[N[(A * N[(N[(c0 / l), $MachinePrecision] * N[(c0 / V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 0 \lor \neg \left(t\_0 \leq 5 \cdot 10^{+298}\right):\\
\;\;\;\;\sqrt{A \cdot \left(\frac{c0}{\ell} \cdot \frac{c0}{V}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 5.0000000000000003e298 < (/.f64 A (*.f64 V l)) Initial program 32.5%
associate-/r*47.8%
clear-num47.5%
sqrt-div48.0%
metadata-eval48.0%
clear-num47.5%
associate-/r*32.5%
clear-num32.9%
associate-/l*47.9%
Applied egg-rr47.9%
un-div-inv48.0%
associate-*r/32.9%
*-commutative32.9%
associate-/l*48.0%
Applied egg-rr48.0%
associate-*r/32.9%
*-commutative32.9%
associate-/l*48.0%
Simplified48.0%
associate-*r/32.9%
*-commutative32.9%
associate-*r/48.0%
add-sqr-sqrt31.2%
sqrt-unprod27.6%
associate-*r/25.5%
*-commutative25.5%
associate-*r/27.6%
associate-*r/25.5%
*-commutative25.5%
associate-*r/27.6%
frac-times25.0%
pow225.0%
add-sqr-sqrt25.0%
Applied egg-rr25.0%
associate-/r*30.1%
associate-/r/31.3%
Simplified31.3%
associate-/l/27.9%
unpow227.9%
times-frac41.9%
Applied egg-rr41.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.0000000000000003e298Initial program 99.6%
associate-/r*88.6%
clear-num88.6%
sqrt-div88.4%
metadata-eval88.4%
clear-num88.4%
associate-/r*99.4%
clear-num99.4%
associate-/l*92.6%
Applied egg-rr92.6%
un-div-inv92.7%
associate-*r/99.6%
*-commutative99.6%
associate-/l*88.6%
Applied egg-rr88.6%
Taylor expanded in l around 0 99.6%
Final simplification78.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+297)
(/ c0 (sqrt (/ (* V l) A)))
(* c0 (pow (* V (/ l A)) -0.5))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 1e+297) {
tmp = c0 / sqrt(((V * l) / A));
} else {
tmp = c0 * pow((V * (l / A)), -0.5);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 1d+297) then
tmp = c0 / sqrt(((v * l) / a))
else
tmp = c0 * ((v * (l / a)) ** (-0.5d0))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+297) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else {
tmp = c0 * Math.pow((V * (l / A)), -0.5);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 1e+297: tmp = c0 / math.sqrt(((V * l) / A)) else: tmp = c0 * math.pow((V * (l / A)), -0.5) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+297) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); else tmp = Float64(c0 * (Float64(V * Float64(l / A)) ^ -0.5)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 1e+297)
tmp = c0 / sqrt(((V * l) / A));
else
tmp = c0 * ((V * (l / A)) ^ -0.5);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+297], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Power[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 10^{+297}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot {\left(V \cdot \frac{\ell}{A}\right)}^{-0.5}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 35.3%
*-commutative35.3%
associate-/l/49.5%
Simplified49.5%
if 0.0 < (/.f64 A (*.f64 V l)) < 1e297Initial program 99.6%
associate-/r*88.5%
clear-num88.5%
sqrt-div88.4%
metadata-eval88.4%
clear-num88.4%
associate-/r*99.4%
clear-num99.5%
associate-/l*93.2%
Applied egg-rr93.2%
un-div-inv93.3%
associate-*r/99.7%
*-commutative99.7%
associate-/l*88.5%
Applied egg-rr88.5%
Taylor expanded in l around 0 99.7%
if 1e297 < (/.f64 A (*.f64 V l)) Initial program 31.0%
associate-/r*47.1%
clear-num47.1%
sqrt-div47.9%
metadata-eval47.9%
clear-num47.0%
associate-/r*31.0%
clear-num31.9%
associate-/l*45.8%
Applied egg-rr45.8%
inv-pow45.8%
sqrt-pow245.9%
associate-*r/31.9%
*-commutative31.9%
associate-/l*47.9%
metadata-eval47.9%
Applied egg-rr47.9%
associate-*r/31.9%
*-commutative31.9%
associate-/l*45.9%
Simplified45.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 5e-303) (not (<= t_0 5e+298)))
(* c0 (sqrt (/ (/ A V) l)))
(* c0 (sqrt t_0)))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 5e-303) || !(t_0 <= 5e+298)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 5d-303) .or. (.not. (t_0 <= 5d+298))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 5e-303) || !(t_0 <= 5e+298)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 5e-303) or not (t_0 <= 5e+298): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.sqrt(t_0) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 5e-303) || !(t_0 <= 5e+298)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 5e-303) || ~((t_0 <= 5e+298)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 5e-303], N[Not[LessEqual[t$95$0, 5e+298]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-303} \lor \neg \left(t\_0 \leq 5 \cdot 10^{+298}\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)) < 4.9999999999999998e-303 or 5.0000000000000003e298 < (/.f64 A (*.f64 V l)) Initial program 34.5%
*-commutative34.5%
associate-/l/49.4%
Simplified49.4%
if 4.9999999999999998e-303 < (/.f64 A (*.f64 V l)) < 5.0000000000000003e298Initial program 99.6%
Final simplification80.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 5e-303)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+256) (* c0 (sqrt t_0)) (/ c0 (sqrt (* V (/ l A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-303) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+256) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((V * (l / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 5d-303) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+256) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((v * (l / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-303) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+256) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((V * (l / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 5e-303: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+256: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((V * (l / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 5e-303) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+256) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 5e-303)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+256)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((V * (l / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-303], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+256], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-303}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+256}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.9999999999999998e-303Initial program 39.0%
*-commutative39.0%
associate-/l/52.5%
Simplified52.5%
if 4.9999999999999998e-303 < (/.f64 A (*.f64 V l)) < 2.0000000000000001e256Initial program 99.6%
if 2.0000000000000001e256 < (/.f64 A (*.f64 V l)) Initial program 36.4%
associate-/r*45.6%
clear-num45.6%
sqrt-div46.3%
metadata-eval46.3%
clear-num45.5%
associate-/r*36.4%
clear-num37.1%
associate-/l*48.2%
Applied egg-rr48.2%
un-div-inv48.3%
associate-*r/37.2%
*-commutative37.2%
associate-/l*46.3%
Applied egg-rr46.3%
associate-*r/37.2%
*-commutative37.2%
associate-/l*48.3%
Simplified48.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 5e-303)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 5e+238) (* c0 (sqrt t_0)) (* c0 (sqrt (/ (/ A l) V)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-303) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 5e+238) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 5d-303) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 5d+238) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * sqrt(((a / l) / v))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 5e-303) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 5e+238) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 5e-303: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 5e+238: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 5e-303) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 5e+238) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 5e-303)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 5e+238)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * sqrt(((A / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-303], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+238], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t\_0 \leq 5 \cdot 10^{-303}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+238}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 4.9999999999999998e-303Initial program 39.0%
*-commutative39.0%
associate-/l/52.5%
Simplified52.5%
if 4.9999999999999998e-303 < (/.f64 A (*.f64 V l)) < 4.99999999999999995e238Initial program 99.6%
if 4.99999999999999995e238 < (/.f64 A (*.f64 V l)) Initial program 38.8%
Taylor expanded in c0 around 0 38.8%
*-commutative38.8%
associate-/r*49.4%
Simplified49.4%
Final simplification79.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 74.9%
herbie shell --seed 2024188
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))