
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (- V))) (t_1 (sqrt (- A))))
(if (<= (* V l) (- INFINITY))
(/ (* c0 (/ 1.0 (sqrt l))) (/ t_0 t_1))
(if (<= (* V l) -5e-130)
(* c0 (/ t_1 (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0 (/ (sqrt (- (/ A l))) t_0))
(if (<= (* V l) 1e+290)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* 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 = sqrt(-V);
double t_1 = sqrt(-A);
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = (c0 * (1.0 / sqrt(l))) / (t_0 / t_1);
} else if ((V * l) <= -5e-130) {
tmp = c0 * (t_1 / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (sqrt(-(A / l)) / t_0);
} else if ((V * l) <= 1e+290) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / l) / V));
}
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(-V);
double t_1 = Math.sqrt(-A);
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = (c0 * (1.0 / Math.sqrt(l))) / (t_0 / t_1);
} else if ((V * l) <= -5e-130) {
tmp = c0 * (t_1 / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.sqrt(-(A / l)) / t_0);
} else if ((V * l) <= 1e+290) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} 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 = math.sqrt(-V) t_1 = math.sqrt(-A) tmp = 0 if (V * l) <= -math.inf: tmp = (c0 * (1.0 / math.sqrt(l))) / (t_0 / t_1) elif (V * l) <= -5e-130: tmp = c0 * (t_1 / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 * (math.sqrt(-(A / l)) / t_0) elif (V * l) <= 1e+290: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) 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 = sqrt(Float64(-V)) t_1 = sqrt(Float64(-A)) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(Float64(c0 * Float64(1.0 / sqrt(l))) / Float64(t_0 / t_1)); elseif (Float64(V * l) <= -5e-130) tmp = Float64(c0 * Float64(t_1 / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(-Float64(A / l))) / t_0)); elseif (Float64(V * l) <= 1e+290) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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 = sqrt(-V);
t_1 = sqrt(-A);
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = (c0 * (1.0 / sqrt(l))) / (t_0 / t_1);
elseif ((V * l) <= -5e-130)
tmp = c0 * (t_1 / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 * (sqrt(-(A / l)) / t_0);
elseif ((V * l) <= 1e+290)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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[Sqrt[(-V)], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-A)], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(N[(c0 * N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-130], N[(c0 * N[(t$95$1 / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[(-N[(A / l), $MachinePrecision])], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+290], 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] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{-V}\\
t_1 := \sqrt{-A}\\
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;\frac{c0 \cdot \frac{1}{\sqrt{\ell}}}{\frac{t_0}{t_1}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-130}:\\
\;\;\;\;c0 \cdot \frac{t_1}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-\frac{A}{\ell}}}{t_0}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 43.1%
*-commutative43.1%
associate-/r*90.4%
sqrt-div30.0%
associate-*l/30.0%
Applied egg-rr30.0%
clear-num30.0%
inv-pow30.0%
*-un-lft-identity30.0%
times-frac30.0%
metadata-eval30.0%
sqrt-div30.0%
clear-num30.0%
Applied egg-rr30.0%
unpow-130.0%
*-commutative30.0%
associate-/r*29.8%
associate-/r/30.0%
*-commutative30.0%
Simplified30.0%
frac-2neg30.0%
sqrt-div29.8%
Applied egg-rr29.8%
if -inf.0 < (*.f64 V l) < -4.9999999999999996e-130Initial program 92.2%
frac-2neg92.2%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if -4.9999999999999996e-130 < (*.f64 V l) < 0.0Initial program 55.6%
*-un-lft-identity55.6%
times-frac69.1%
Applied egg-rr69.1%
associate-*l/69.1%
*-un-lft-identity69.1%
Applied egg-rr69.1%
frac-2neg69.1%
sqrt-div52.5%
distribute-neg-frac52.5%
Applied egg-rr52.5%
if 0.0 < (*.f64 V l) < 1.00000000000000006e290Initial program 84.6%
sqrt-div99.5%
associate-*r/96.0%
Applied egg-rr96.0%
*-commutative96.0%
associate-/l*96.9%
associate-/r/99.5%
Simplified99.5%
if 1.00000000000000006e290 < (*.f64 V l) Initial program 37.7%
*-un-lft-identity37.7%
times-frac71.2%
Applied egg-rr71.2%
associate-*l/71.4%
*-un-lft-identity71.4%
Applied egg-rr71.4%
Final simplification86.1%
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) -5e+223)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= (* V l) -2e-88)
(* c0 (sqrt (* A (/ (/ 1.0 l) V))))
(if (<= (* V l) 2e-308)
(/ c0 (sqrt (* l (/ V A))))
(if (<= (* V l) 1e+290)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A l) V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -5e+223) {
tmp = c0 * sqrt(((A / V) / l));
} else if ((V * l) <= -2e-88) {
tmp = c0 * sqrt((A * ((1.0 / l) / V)));
} else if ((V * l) <= 2e-308) {
tmp = c0 / sqrt((l * (V / A)));
} else if ((V * l) <= 1e+290) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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) :: tmp
if ((v * l) <= (-5d+223)) then
tmp = c0 * sqrt(((a / v) / l))
else if ((v * l) <= (-2d-88)) then
tmp = c0 * sqrt((a * ((1.0d0 / l) / v)))
else if ((v * l) <= 2d-308) then
tmp = c0 / sqrt((l * (v / a)))
else if ((v * l) <= 1d+290) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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 tmp;
if ((V * l) <= -5e+223) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if ((V * l) <= -2e-88) {
tmp = c0 * Math.sqrt((A * ((1.0 / l) / V)));
} else if ((V * l) <= 2e-308) {
tmp = c0 / Math.sqrt((l * (V / A)));
} else if ((V * l) <= 1e+290) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} 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): tmp = 0 if (V * l) <= -5e+223: tmp = c0 * math.sqrt(((A / V) / l)) elif (V * l) <= -2e-88: tmp = c0 * math.sqrt((A * ((1.0 / l) / V))) elif (V * l) <= 2e-308: tmp = c0 / math.sqrt((l * (V / A))) elif (V * l) <= 1e+290: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) 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) tmp = 0.0 if (Float64(V * l) <= -5e+223) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (Float64(V * l) <= -2e-88) tmp = Float64(c0 * sqrt(Float64(A * Float64(Float64(1.0 / l) / V)))); elseif (Float64(V * l) <= 2e-308) tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); elseif (Float64(V * l) <= 1e+290) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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)
tmp = 0.0;
if ((V * l) <= -5e+223)
tmp = c0 * sqrt(((A / V) / l));
elseif ((V * l) <= -2e-88)
tmp = c0 * sqrt((A * ((1.0 / l) / V)));
elseif ((V * l) <= 2e-308)
tmp = c0 / sqrt((l * (V / A)));
elseif ((V * l) <= 1e+290)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -5e+223], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-88], N[(c0 * N[Sqrt[N[(A * N[(N[(1.0 / l), $MachinePrecision] / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-308], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+290], 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] / V), $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 -5 \cdot 10^{+223}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-88}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{\frac{1}{\ell}}{V}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-308}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.99999999999999985e223Initial program 58.3%
associate-/r*87.9%
Simplified87.9%
if -4.99999999999999985e223 < (*.f64 V l) < -1.99999999999999987e-88Initial program 93.4%
*-un-lft-identity93.4%
times-frac81.2%
Applied egg-rr81.2%
associate-*l/81.2%
*-un-lft-identity81.2%
Applied egg-rr81.2%
div-inv81.1%
*-un-lft-identity81.1%
times-frac93.5%
Applied egg-rr93.5%
if -1.99999999999999987e-88 < (*.f64 V l) < 1.9999999999999998e-308Initial program 61.8%
associate-/r*71.0%
clear-num71.0%
sqrt-div71.3%
metadata-eval71.3%
div-inv71.3%
clear-num71.3%
Applied egg-rr71.3%
clear-num71.3%
associate-*r/61.6%
*-commutative61.6%
sqrt-undiv6.1%
clear-num6.1%
clear-num6.1%
sqrt-div61.8%
*-un-lft-identity61.8%
frac-times71.1%
expm1-log1p-u51.0%
expm1-udef30.7%
Applied egg-rr30.7%
expm1-def51.1%
expm1-log1p71.5%
Simplified71.5%
Taylor expanded in V around 0 61.8%
associate-*l/71.4%
*-commutative71.4%
Simplified71.4%
if 1.9999999999999998e-308 < (*.f64 V l) < 1.00000000000000006e290Initial program 84.4%
sqrt-div99.5%
associate-*r/96.8%
Applied egg-rr96.8%
*-commutative96.8%
associate-/l*96.8%
associate-/r/99.5%
Simplified99.5%
if 1.00000000000000006e290 < (*.f64 V l) Initial program 37.7%
*-un-lft-identity37.7%
times-frac71.2%
Applied egg-rr71.2%
associate-*l/71.4%
*-un-lft-identity71.4%
Applied egg-rr71.4%
Final simplification89.0%
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) -2e+88)
(/ c0 (/ (sqrt l) (sqrt (/ A V))))
(if (<= (* V l) -2e-88)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 2e-308)
(/ (/ c0 (sqrt l)) (sqrt (/ V A)))
(if (<= (* V l) 1e+290)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A l) V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+88) {
tmp = c0 / (sqrt(l) / sqrt((A / V)));
} else if ((V * l) <= -2e-88) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 2e-308) {
tmp = (c0 / sqrt(l)) / sqrt((V / A));
} else if ((V * l) <= 1e+290) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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) :: tmp
if ((v * l) <= (-2d+88)) then
tmp = c0 / (sqrt(l) / sqrt((a / v)))
else if ((v * l) <= (-2d-88)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 2d-308) then
tmp = (c0 / sqrt(l)) / sqrt((v / a))
else if ((v * l) <= 1d+290) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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 tmp;
if ((V * l) <= -2e+88) {
tmp = c0 / (Math.sqrt(l) / Math.sqrt((A / V)));
} else if ((V * l) <= -2e-88) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 2e-308) {
tmp = (c0 / Math.sqrt(l)) / Math.sqrt((V / A));
} else if ((V * l) <= 1e+290) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} 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): tmp = 0 if (V * l) <= -2e+88: tmp = c0 / (math.sqrt(l) / math.sqrt((A / V))) elif (V * l) <= -2e-88: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 2e-308: tmp = (c0 / math.sqrt(l)) / math.sqrt((V / A)) elif (V * l) <= 1e+290: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) 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) tmp = 0.0 if (Float64(V * l) <= -2e+88) tmp = Float64(c0 / Float64(sqrt(l) / sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -2e-88) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 2e-308) tmp = Float64(Float64(c0 / sqrt(l)) / sqrt(Float64(V / A))); elseif (Float64(V * l) <= 1e+290) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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)
tmp = 0.0;
if ((V * l) <= -2e+88)
tmp = c0 / (sqrt(l) / sqrt((A / V)));
elseif ((V * l) <= -2e-88)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 2e-308)
tmp = (c0 / sqrt(l)) / sqrt((V / A));
elseif ((V * l) <= 1e+290)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e+88], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-88], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-308], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+290], 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] / V), $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 -2 \cdot 10^{+88}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-88}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-308}:\\
\;\;\;\;\frac{\frac{c0}{\sqrt{\ell}}}{\sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.99999999999999992e88Initial program 73.9%
associate-/r*84.7%
sqrt-div41.5%
associate-*r/41.5%
Applied egg-rr41.5%
associate-/l*41.5%
Simplified41.5%
if -1.99999999999999992e88 < (*.f64 V l) < -1.99999999999999987e-88Initial program 96.9%
if -1.99999999999999987e-88 < (*.f64 V l) < 1.9999999999999998e-308Initial program 61.8%
associate-/r*71.0%
sqrt-div41.0%
associate-*r/39.4%
Applied egg-rr39.4%
associate-/l*41.1%
Simplified41.1%
associate-/r/41.1%
clear-num41.1%
sqrt-div42.2%
metadata-eval42.2%
un-div-inv42.2%
div-inv42.2%
associate-/l*42.2%
div-inv42.2%
div-inv42.3%
clear-num42.3%
/-rgt-identity42.3%
Applied egg-rr42.3%
associate-*r/42.4%
*-rgt-identity42.4%
associate-/l/42.3%
Simplified42.3%
if 1.9999999999999998e-308 < (*.f64 V l) < 1.00000000000000006e290Initial program 84.4%
sqrt-div99.5%
associate-*r/96.8%
Applied egg-rr96.8%
*-commutative96.8%
associate-/l*96.8%
associate-/r/99.5%
Simplified99.5%
if 1.00000000000000006e290 < (*.f64 V l) Initial program 37.7%
*-un-lft-identity37.7%
times-frac71.2%
Applied egg-rr71.2%
associate-*l/71.4%
*-un-lft-identity71.4%
Applied egg-rr71.4%
Final simplification76.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2e+88)
(* (pow l -0.5) (* c0 (sqrt (/ A V))))
(if (<= (* V l) -2e-88)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 2e-308)
(/ (/ c0 (sqrt l)) (sqrt (/ V A)))
(if (<= (* V l) 1e+290)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A l) V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+88) {
tmp = pow(l, -0.5) * (c0 * sqrt((A / V)));
} else if ((V * l) <= -2e-88) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 2e-308) {
tmp = (c0 / sqrt(l)) / sqrt((V / A));
} else if ((V * l) <= 1e+290) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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) :: tmp
if ((v * l) <= (-2d+88)) then
tmp = (l ** (-0.5d0)) * (c0 * sqrt((a / v)))
else if ((v * l) <= (-2d-88)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 2d-308) then
tmp = (c0 / sqrt(l)) / sqrt((v / a))
else if ((v * l) <= 1d+290) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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 tmp;
if ((V * l) <= -2e+88) {
tmp = Math.pow(l, -0.5) * (c0 * Math.sqrt((A / V)));
} else if ((V * l) <= -2e-88) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 2e-308) {
tmp = (c0 / Math.sqrt(l)) / Math.sqrt((V / A));
} else if ((V * l) <= 1e+290) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} 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): tmp = 0 if (V * l) <= -2e+88: tmp = math.pow(l, -0.5) * (c0 * math.sqrt((A / V))) elif (V * l) <= -2e-88: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 2e-308: tmp = (c0 / math.sqrt(l)) / math.sqrt((V / A)) elif (V * l) <= 1e+290: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) 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) tmp = 0.0 if (Float64(V * l) <= -2e+88) tmp = Float64((l ^ -0.5) * Float64(c0 * sqrt(Float64(A / V)))); elseif (Float64(V * l) <= -2e-88) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 2e-308) tmp = Float64(Float64(c0 / sqrt(l)) / sqrt(Float64(V / A))); elseif (Float64(V * l) <= 1e+290) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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)
tmp = 0.0;
if ((V * l) <= -2e+88)
tmp = (l ^ -0.5) * (c0 * sqrt((A / V)));
elseif ((V * l) <= -2e-88)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 2e-308)
tmp = (c0 / sqrt(l)) / sqrt((V / A));
elseif ((V * l) <= 1e+290)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e+88], N[(N[Power[l, -0.5], $MachinePrecision] * N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-88], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-308], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+290], 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] / V), $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 -2 \cdot 10^{+88}:\\
\;\;\;\;{\ell}^{-0.5} \cdot \left(c0 \cdot \sqrt{\frac{A}{V}}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-88}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-308}:\\
\;\;\;\;\frac{\frac{c0}{\sqrt{\ell}}}{\sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.99999999999999992e88Initial program 73.9%
*-commutative73.9%
associate-/r*84.7%
sqrt-div41.5%
associate-*l/41.5%
Applied egg-rr41.5%
div-inv41.5%
*-commutative41.5%
pow1/241.5%
pow-flip41.5%
metadata-eval41.5%
Applied egg-rr41.5%
if -1.99999999999999992e88 < (*.f64 V l) < -1.99999999999999987e-88Initial program 96.9%
if -1.99999999999999987e-88 < (*.f64 V l) < 1.9999999999999998e-308Initial program 61.8%
associate-/r*71.0%
sqrt-div41.0%
associate-*r/39.4%
Applied egg-rr39.4%
associate-/l*41.1%
Simplified41.1%
associate-/r/41.1%
clear-num41.1%
sqrt-div42.2%
metadata-eval42.2%
un-div-inv42.2%
div-inv42.2%
associate-/l*42.2%
div-inv42.2%
div-inv42.3%
clear-num42.3%
/-rgt-identity42.3%
Applied egg-rr42.3%
associate-*r/42.4%
*-rgt-identity42.4%
associate-/l/42.3%
Simplified42.3%
if 1.9999999999999998e-308 < (*.f64 V l) < 1.00000000000000006e290Initial program 84.4%
sqrt-div99.5%
associate-*r/96.8%
Applied egg-rr96.8%
*-commutative96.8%
associate-/l*96.8%
associate-/r/99.5%
Simplified99.5%
if 1.00000000000000006e290 < (*.f64 V l) Initial program 37.7%
*-un-lft-identity37.7%
times-frac71.2%
Applied egg-rr71.2%
associate-*l/71.4%
*-un-lft-identity71.4%
Applied egg-rr71.4%
Final simplification76.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -2e+88)
(* c0 (/ 1.0 (/ (sqrt l) (sqrt (/ A V)))))
(if (<= (* V l) -2e-88)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 2e-308)
(/ (/ c0 (sqrt l)) (sqrt (/ V A)))
(if (<= (* V l) 1e+290)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A l) V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -2e+88) {
tmp = c0 * (1.0 / (sqrt(l) / sqrt((A / V))));
} else if ((V * l) <= -2e-88) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 2e-308) {
tmp = (c0 / sqrt(l)) / sqrt((V / A));
} else if ((V * l) <= 1e+290) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} 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) :: tmp
if ((v * l) <= (-2d+88)) then
tmp = c0 * (1.0d0 / (sqrt(l) / sqrt((a / v))))
else if ((v * l) <= (-2d-88)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 2d-308) then
tmp = (c0 / sqrt(l)) / sqrt((v / a))
else if ((v * l) <= 1d+290) then
tmp = c0 * (sqrt(a) / sqrt((v * l)))
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 tmp;
if ((V * l) <= -2e+88) {
tmp = c0 * (1.0 / (Math.sqrt(l) / Math.sqrt((A / V))));
} else if ((V * l) <= -2e-88) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 2e-308) {
tmp = (c0 / Math.sqrt(l)) / Math.sqrt((V / A));
} else if ((V * l) <= 1e+290) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} 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): tmp = 0 if (V * l) <= -2e+88: tmp = c0 * (1.0 / (math.sqrt(l) / math.sqrt((A / V)))) elif (V * l) <= -2e-88: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 2e-308: tmp = (c0 / math.sqrt(l)) / math.sqrt((V / A)) elif (V * l) <= 1e+290: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) 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) tmp = 0.0 if (Float64(V * l) <= -2e+88) tmp = Float64(c0 * Float64(1.0 / Float64(sqrt(l) / sqrt(Float64(A / V))))); elseif (Float64(V * l) <= -2e-88) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 2e-308) tmp = Float64(Float64(c0 / sqrt(l)) / sqrt(Float64(V / A))); elseif (Float64(V * l) <= 1e+290) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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)
tmp = 0.0;
if ((V * l) <= -2e+88)
tmp = c0 * (1.0 / (sqrt(l) / sqrt((A / V))));
elseif ((V * l) <= -2e-88)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 2e-308)
tmp = (c0 / sqrt(l)) / sqrt((V / A));
elseif ((V * l) <= 1e+290)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], -2e+88], N[(c0 * N[(1.0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -2e-88], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-308], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+290], 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] / V), $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 -2 \cdot 10^{+88}:\\
\;\;\;\;c0 \cdot \frac{1}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{elif}\;V \cdot \ell \leq -2 \cdot 10^{-88}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-308}:\\
\;\;\;\;\frac{\frac{c0}{\sqrt{\ell}}}{\sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.99999999999999992e88Initial program 73.9%
associate-/r*84.7%
sqrt-div41.5%
clear-num41.5%
Applied egg-rr41.5%
if -1.99999999999999992e88 < (*.f64 V l) < -1.99999999999999987e-88Initial program 96.9%
if -1.99999999999999987e-88 < (*.f64 V l) < 1.9999999999999998e-308Initial program 61.8%
associate-/r*71.0%
sqrt-div41.0%
associate-*r/39.4%
Applied egg-rr39.4%
associate-/l*41.1%
Simplified41.1%
associate-/r/41.1%
clear-num41.1%
sqrt-div42.2%
metadata-eval42.2%
un-div-inv42.2%
div-inv42.2%
associate-/l*42.2%
div-inv42.2%
div-inv42.3%
clear-num42.3%
/-rgt-identity42.3%
Applied egg-rr42.3%
associate-*r/42.4%
*-rgt-identity42.4%
associate-/l/42.3%
Simplified42.3%
if 1.9999999999999998e-308 < (*.f64 V l) < 1.00000000000000006e290Initial program 84.4%
sqrt-div99.5%
associate-*r/96.8%
Applied egg-rr96.8%
*-commutative96.8%
associate-/l*96.8%
associate-/r/99.5%
Simplified99.5%
if 1.00000000000000006e290 < (*.f64 V l) Initial program 37.7%
*-un-lft-identity37.7%
times-frac71.2%
Applied egg-rr71.2%
associate-*l/71.4%
*-un-lft-identity71.4%
Applied egg-rr71.4%
Final simplification76.2%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) (- INFINITY))
(* c0 (sqrt (/ (/ A V) l)))
(if (<= (* V l) -5e-265)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 2e-308)
(/ (* c0 (pow l -0.5)) (sqrt (/ V A)))
(if (<= (* V l) 1e+290)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A l) V))))))))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 / V) / l));
} else if ((V * l) <= -5e-265) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 2e-308) {
tmp = (c0 * pow(l, -0.5)) / sqrt((V / A));
} else if ((V * l) <= 1e+290) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / l) / V));
}
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 / V) / l));
} else if ((V * l) <= -5e-265) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 2e-308) {
tmp = (c0 * Math.pow(l, -0.5)) / Math.sqrt((V / A));
} else if ((V * l) <= 1e+290) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} 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): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * math.sqrt(((A / V) / l)) elif (V * l) <= -5e-265: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 2e-308: tmp = (c0 * math.pow(l, -0.5)) / math.sqrt((V / A)) elif (V * l) <= 1e+290: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) 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) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (Float64(V * l) <= -5e-265) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 2e-308) tmp = Float64(Float64(c0 * (l ^ -0.5)) / sqrt(Float64(V / A))); elseif (Float64(V * l) <= 1e+290) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * sqrt(((A / V) / l));
elseif ((V * l) <= -5e-265)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 2e-308)
tmp = (c0 * (l ^ -0.5)) / sqrt((V / A));
elseif ((V * l) <= 1e+290)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-265], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 2e-308], N[(N[(c0 * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+290], 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] / V), $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 \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-265}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 2 \cdot 10^{-308}:\\
\;\;\;\;\frac{c0 \cdot {\ell}^{-0.5}}{\sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 43.1%
associate-/r*90.4%
Simplified90.4%
if -inf.0 < (*.f64 V l) < -5.0000000000000001e-265Initial program 92.2%
frac-2neg92.2%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if -5.0000000000000001e-265 < (*.f64 V l) < 1.9999999999999998e-308Initial program 41.2%
associate-/r*59.8%
sqrt-div36.5%
associate-*r/33.5%
Applied egg-rr33.5%
associate-/l*36.4%
Simplified36.4%
associate-/r/36.4%
clear-num36.5%
sqrt-div38.5%
metadata-eval38.5%
frac-times38.5%
*-rgt-identity38.5%
*-un-lft-identity38.5%
times-frac35.6%
pow1/235.6%
pow-flip35.7%
metadata-eval35.7%
Applied egg-rr35.7%
associate-*r/38.5%
Simplified38.5%
if 1.9999999999999998e-308 < (*.f64 V l) < 1.00000000000000006e290Initial program 84.4%
sqrt-div99.5%
associate-*r/96.8%
Applied egg-rr96.8%
*-commutative96.8%
associate-/l*96.8%
associate-/r/99.5%
Simplified99.5%
if 1.00000000000000006e290 < (*.f64 V l) Initial program 37.7%
*-un-lft-identity37.7%
times-frac71.2%
Applied egg-rr71.2%
associate-*l/71.4%
*-un-lft-identity71.4%
Applied egg-rr71.4%
Final simplification89.0%
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 V) l)))
(if (<= (* V l) -5e-130)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(* c0 (/ (sqrt (- (/ A l))) (sqrt (- V))))
(if (<= (* V l) 1e+290)
(* c0 (/ (sqrt A) (sqrt (* V l))))
(* c0 (sqrt (/ (/ A l) V))))))))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 / V) / l));
} else if ((V * l) <= -5e-130) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (sqrt(-(A / l)) / sqrt(-V));
} else if ((V * l) <= 1e+290) {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
} else {
tmp = c0 * sqrt(((A / l) / V));
}
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 / V) / l));
} else if ((V * l) <= -5e-130) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.sqrt(-(A / l)) / Math.sqrt(-V));
} else if ((V * l) <= 1e+290) {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
} 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): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * math.sqrt(((A / V) / l)) elif (V * l) <= -5e-130: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 * (math.sqrt(-(A / l)) / math.sqrt(-V)) elif (V * l) <= 1e+290: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) 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) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (Float64(V * l) <= -5e-130) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(-Float64(A / l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= 1e+290) tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(V * l)))); 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)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * sqrt(((A / V) / l));
elseif ((V * l) <= -5e-130)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 * (sqrt(-(A / l)) / sqrt(-V));
elseif ((V * l) <= 1e+290)
tmp = c0 * (sqrt(A) / sqrt((V * l)));
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_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-130], 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[(N[Sqrt[(-N[(A / l), $MachinePrecision])], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 1e+290], 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] / V), $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 \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-130}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-\frac{A}{\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq 10^{+290}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 43.1%
associate-/r*90.4%
Simplified90.4%
if -inf.0 < (*.f64 V l) < -4.9999999999999996e-130Initial program 92.2%
frac-2neg92.2%
sqrt-div99.4%
distribute-rgt-neg-in99.4%
Applied egg-rr99.4%
distribute-rgt-neg-out99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
Simplified99.4%
if -4.9999999999999996e-130 < (*.f64 V l) < 0.0Initial program 55.6%
*-un-lft-identity55.6%
times-frac69.1%
Applied egg-rr69.1%
associate-*l/69.1%
*-un-lft-identity69.1%
Applied egg-rr69.1%
frac-2neg69.1%
sqrt-div52.5%
distribute-neg-frac52.5%
Applied egg-rr52.5%
if 0.0 < (*.f64 V l) < 1.00000000000000006e290Initial program 84.6%
sqrt-div99.5%
associate-*r/96.0%
Applied egg-rr96.0%
*-commutative96.0%
associate-/l*96.9%
associate-/r/99.5%
Simplified99.5%
if 1.00000000000000006e290 < (*.f64 V l) Initial program 37.7%
*-un-lft-identity37.7%
times-frac71.2%
Applied egg-rr71.2%
associate-*l/71.4%
*-un-lft-identity71.4%
Applied egg-rr71.4%
Final simplification88.5%
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 7.5e-302) (/ c0 (/ (sqrt l) (sqrt (/ A V)))) (* c0 (/ (sqrt A) (sqrt (* V l))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= 7.5e-302) {
tmp = c0 / (sqrt(l) / sqrt((A / V)));
} else {
tmp = c0 * (sqrt(A) / sqrt((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 <= 7.5d-302) then
tmp = c0 / (sqrt(l) / sqrt((a / v)))
else
tmp = c0 * (sqrt(a) / sqrt((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 <= 7.5e-302) {
tmp = c0 / (Math.sqrt(l) / Math.sqrt((A / V)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= 7.5e-302: tmp = c0 / (math.sqrt(l) / math.sqrt((A / V))) else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= 7.5e-302) tmp = Float64(c0 / Float64(sqrt(l) / sqrt(Float64(A / V)))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(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 <= 7.5e-302)
tmp = c0 / (sqrt(l) / sqrt((A / V)));
else
tmp = c0 * (sqrt(A) / sqrt((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, 7.5e-302], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] / N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * 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 7.5 \cdot 10^{-302}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{\ell}}{\sqrt{\frac{A}{V}}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < 7.49999999999999998e-302Initial program 80.7%
associate-/r*82.6%
sqrt-div41.7%
associate-*r/41.0%
Applied egg-rr41.0%
associate-/l*41.8%
Simplified41.8%
if 7.49999999999999998e-302 < A Initial program 72.3%
sqrt-div83.9%
associate-*r/81.8%
Applied egg-rr81.8%
*-commutative81.8%
associate-/l*81.2%
associate-/r/83.9%
Simplified83.9%
Final simplification63.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 1e+290)))
(* c0 (sqrt (/ (/ A V) l)))
(* c0 (sqrt t_0)))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 1e+290)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 1d+290))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 1e+290)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 1e+290): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.sqrt(t_0) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 1e+290)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 1e+290)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 1e+290]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 10^{+290}\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 1.00000000000000006e290 < (/.f64 A (*.f64 V l)) Initial program 36.7%
associate-/r*54.4%
Simplified54.4%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.00000000000000006e290Initial program 98.6%
Final simplification82.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 (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 1e+290) (* c0 (sqrt t_0)) (* c0 (sqrt (/ (/ A V) l)))))))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 / l) / V));
} else if (t_0 <= 1e+290) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * sqrt(((A / 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) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 1d+290) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * sqrt(((a / 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 t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 1e+290) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.sqrt(((A / V) / l));
}
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 / l) / V)) elif t_0 <= 1e+290: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.sqrt(((A / V) / l)) 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 / l) / V))); elseif (t_0 <= 1e+290) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * sqrt(Float64(Float64(A / 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 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 1e+290)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * sqrt(((A / 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[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+290], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $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:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 10^{+290}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 40.3%
*-un-lft-identity40.3%
times-frac68.8%
Applied egg-rr68.8%
associate-*l/68.9%
*-un-lft-identity68.9%
Applied egg-rr68.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.00000000000000006e290Initial program 98.6%
if 1.00000000000000006e290 < (/.f64 A (*.f64 V l)) Initial program 34.0%
associate-/r*43.3%
Simplified43.3%
Final simplification82.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 (<= t_0 0.0)
(* c0 (sqrt (/ (/ A l) V)))
(if (<= t_0 2e+293) (* 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 <= 0.0) {
tmp = c0 * sqrt(((A / l) / V));
} else if (t_0 <= 2e+293) {
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 <= 0.0d0) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 2d+293) 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 <= 0.0) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 2e+293) {
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 <= 0.0: tmp = c0 * math.sqrt(((A / l) / V)) elif t_0 <= 2e+293: 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 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); elseif (t_0 <= 2e+293) 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 <= 0.0)
tmp = c0 * sqrt(((A / l) / V));
elseif (t_0 <= 2e+293)
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, 0.0], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+293], 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 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{elif}\;t_0 \leq 2 \cdot 10^{+293}:\\
\;\;\;\;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)) < 0.0Initial program 40.3%
*-un-lft-identity40.3%
times-frac68.8%
Applied egg-rr68.8%
associate-*l/68.9%
*-un-lft-identity68.9%
Applied egg-rr68.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 1.9999999999999998e293Initial program 98.6%
if 1.9999999999999998e293 < (/.f64 A (*.f64 V l)) Initial program 31.4%
associate-/r*42.9%
clear-num42.9%
sqrt-div44.6%
metadata-eval44.6%
div-inv44.6%
clear-num44.6%
Applied egg-rr44.6%
clear-num44.6%
associate-*r/32.6%
*-commutative32.6%
sqrt-undiv36.7%
clear-num36.7%
clear-num36.7%
sqrt-div31.4%
*-un-lft-identity31.4%
frac-times42.9%
expm1-log1p-u26.8%
expm1-udef23.0%
Applied egg-rr23.1%
expm1-def28.1%
expm1-log1p44.6%
Simplified44.6%
Final simplification83.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* 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 76.3%
Final simplification76.3%
herbie shell --seed 2023319
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))