
(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: 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)) (sqrt l)))
(if (<= (* V l) -4e-307)
(* c0 (/ (sqrt (- A)) (sqrt (* V (- l)))))
(if (<= (* V l) 0.0)
(/ c0 (sqrt (/ V (/ A l))))
(/ c0 (/ (sqrt (* V l)) (sqrt A)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -4e-307) {
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / sqrt((V / (A / l)));
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
}
return tmp;
}
assert 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)) / Math.sqrt(l));
} else if ((V * l) <= -4e-307) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt((V * -l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / Math.sqrt((V / (A / l)));
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -math.inf: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -4e-307: tmp = c0 * (math.sqrt(-A) / math.sqrt((V * -l))) elif (V * l) <= 0.0: tmp = c0 / math.sqrt((V / (A / l))) else: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -4e-307) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(V * Float64(-l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / sqrt(Float64(V / Float64(A / l)))); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -4e-307)
tmp = c0 * (sqrt(-A) / sqrt((V * -l)));
elseif ((V * l) <= 0.0)
tmp = c0 / sqrt((V / (A / l)));
else
tmp = c0 / (sqrt((V * l)) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -4e-307], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[N[(V * (-l)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 / N[Sqrt[N[(V / N[(A / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -4 \cdot 10^{-307}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{V \cdot \left(-\ell\right)}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V}{\frac{A}{\ell}}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 39.3%
associate-/r*77.5%
sqrt-div35.7%
Applied egg-rr35.7%
if -inf.0 < (*.f64 V l) < -3.99999999999999964e-307Initial program 86.9%
frac-2neg86.9%
sqrt-div99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
Applied egg-rr99.5%
if -3.99999999999999964e-307 < (*.f64 V l) < -0.0Initial program 32.8%
add-cube-cbrt32.8%
*-commutative32.8%
times-frac70.9%
pow270.9%
Applied egg-rr70.9%
frac-times32.8%
unpow232.8%
add-cube-cbrt32.8%
*-commutative32.8%
associate-/r*71.1%
sqrt-undiv44.0%
clear-num44.0%
un-div-inv44.0%
sqrt-undiv71.3%
Applied egg-rr71.3%
associate-/r/71.3%
Simplified71.3%
*-commutative71.3%
clear-num71.3%
div-inv71.2%
un-div-inv71.3%
div-inv71.3%
Applied egg-rr71.3%
if -0.0 < (*.f64 V l) Initial program 72.4%
sqrt-div90.5%
associate-*r/88.6%
Applied egg-rr88.6%
associate-/l*90.4%
Simplified90.4%
Final simplification88.6%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -4e-311) (/ (* c0 (/ (sqrt (- A)) (sqrt (- V)))) (sqrt l)) (/ c0 (/ (sqrt (* V l)) (sqrt A)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-311) {
tmp = (c0 * (sqrt(-A) / sqrt(-V))) / sqrt(l);
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-4d-311)) then
tmp = (c0 * (sqrt(-a) / sqrt(-v))) / sqrt(l)
else
tmp = c0 / (sqrt((v * l)) / sqrt(a))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -4e-311) {
tmp = (c0 * (Math.sqrt(-A) / Math.sqrt(-V))) / Math.sqrt(l);
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if A <= -4e-311: tmp = (c0 * (math.sqrt(-A) / math.sqrt(-V))) / math.sqrt(l) else: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (A <= -4e-311) tmp = Float64(Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(-V)))) / sqrt(l)); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -4e-311)
tmp = (c0 * (sqrt(-A) / sqrt(-V))) / sqrt(l);
else
tmp = c0 / (sqrt((V * l)) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -4e-311], N[(N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -4 \cdot 10^{-311}:\\
\;\;\;\;\frac{c0 \cdot \frac{\sqrt{-A}}{\sqrt{-V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if A < -3.99999999999979e-311Initial program 75.3%
add-cube-cbrt74.9%
*-commutative74.9%
times-frac80.4%
pow280.4%
Applied egg-rr80.4%
frac-times74.9%
unpow274.9%
add-cube-cbrt75.3%
*-commutative75.3%
associate-/r*77.5%
sqrt-undiv43.3%
associate-*r/42.7%
Applied egg-rr42.7%
frac-2neg42.7%
sqrt-div49.0%
Applied egg-rr49.0%
if -3.99999999999979e-311 < A Initial program 67.4%
sqrt-div83.5%
associate-*r/81.8%
Applied egg-rr81.8%
associate-/l*83.4%
Simplified83.4%
Final simplification63.2%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (/ A V))))
(if (<= (* V l) -9.5e+57)
(* c0 (/ t_0 (sqrt l)))
(if (<= (* V l) -5e-151)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 4e-300)
(* t_0 (/ c0 (sqrt l)))
(* (sqrt A) (/ c0 (sqrt (* V l)))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -9.5e+57) {
tmp = c0 * (t_0 / sqrt(l));
} else if ((V * l) <= -5e-151) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 4e-300) {
tmp = t_0 * (c0 / sqrt(l));
} else {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-9.5d+57)) then
tmp = c0 * (t_0 / sqrt(l))
else if ((v * l) <= (-5d-151)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 4d-300) then
tmp = t_0 * (c0 / sqrt(l))
else
tmp = sqrt(a) * (c0 / sqrt((v * l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -9.5e+57) {
tmp = c0 * (t_0 / Math.sqrt(l));
} else if ((V * l) <= -5e-151) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 4e-300) {
tmp = t_0 * (c0 / Math.sqrt(l));
} else {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -9.5e+57: tmp = c0 * (t_0 / math.sqrt(l)) elif (V * l) <= -5e-151: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 4e-300: tmp = t_0 * (c0 / math.sqrt(l)) else: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -9.5e+57) tmp = Float64(c0 * Float64(t_0 / sqrt(l))); elseif (Float64(V * l) <= -5e-151) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 4e-300) tmp = Float64(t_0 * Float64(c0 / sqrt(l))); else tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -9.5e+57)
tmp = c0 * (t_0 / sqrt(l));
elseif ((V * l) <= -5e-151)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 4e-300)
tmp = t_0 * (c0 / sqrt(l));
else
tmp = sqrt(A) * (c0 / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -9.5e+57], N[(c0 * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-151], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-300], N[(t$95$0 * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -9.5 \cdot 10^{+57}:\\
\;\;\;\;c0 \cdot \frac{t_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-151}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-300}:\\
\;\;\;\;t_0 \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.4999999999999997e57Initial program 70.7%
associate-/r*80.9%
sqrt-div41.4%
Applied egg-rr41.4%
if -9.4999999999999997e57 < (*.f64 V l) < -5.00000000000000003e-151Initial program 96.6%
if -5.00000000000000003e-151 < (*.f64 V l) < 4.0000000000000001e-300Initial program 48.5%
add-cube-cbrt48.4%
*-commutative48.4%
times-frac69.5%
pow269.5%
Applied egg-rr69.5%
frac-times48.4%
unpow248.4%
add-cube-cbrt48.5%
*-commutative48.5%
associate-/r*67.6%
sqrt-undiv51.6%
associate-*r/51.7%
clear-num51.6%
Applied egg-rr51.6%
associate-/r/51.5%
associate-*l/51.7%
*-commutative51.7%
associate-*l*51.7%
*-lft-identity51.7%
associate-*r/51.7%
Simplified51.7%
if 4.0000000000000001e-300 < (*.f64 V l) Initial program 73.1%
sqrt-div90.4%
associate-*r/88.5%
Applied egg-rr88.5%
associate-*l/84.2%
Simplified84.2%
Final simplification70.1%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -9.5e+57)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) -5e-151)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 4e-300)
(* (sqrt (/ A V)) (/ c0 (sqrt l)))
(* (sqrt A) (/ c0 (sqrt (* V l))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -9.5e+57) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= -5e-151) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 4e-300) {
tmp = sqrt((A / V)) * (c0 / sqrt(l));
} else {
tmp = sqrt(A) * (c0 / sqrt((V * l)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-9.5d+57)) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= (-5d-151)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 4d-300) then
tmp = sqrt((a / v)) * (c0 / sqrt(l))
else
tmp = sqrt(a) * (c0 / sqrt((v * l)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -9.5e+57) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= -5e-151) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 4e-300) {
tmp = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
} else {
tmp = Math.sqrt(A) * (c0 / Math.sqrt((V * l)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -9.5e+57: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= -5e-151: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 4e-300: tmp = math.sqrt((A / V)) * (c0 / math.sqrt(l)) else: tmp = math.sqrt(A) * (c0 / math.sqrt((V * l))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -9.5e+57) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= -5e-151) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 4e-300) tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l))); else tmp = Float64(sqrt(A) * Float64(c0 / sqrt(Float64(V * l)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -9.5e+57)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= -5e-151)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 4e-300)
tmp = sqrt((A / V)) * (c0 / sqrt(l));
else
tmp = sqrt(A) * (c0 / sqrt((V * l)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -9.5e+57], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-151], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-300], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[A], $MachinePrecision] * N[(c0 / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -9.5 \cdot 10^{+57}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-151}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-300}:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{A} \cdot \frac{c0}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.4999999999999997e57Initial program 70.7%
add-cube-cbrt70.3%
*-commutative70.3%
times-frac81.4%
pow281.4%
Applied egg-rr81.4%
frac-times70.3%
unpow270.3%
add-cube-cbrt70.7%
*-commutative70.7%
associate-/r*80.9%
sqrt-undiv41.4%
clear-num41.3%
un-div-inv41.3%
sqrt-undiv79.8%
Applied egg-rr79.8%
associate-/r/78.4%
Simplified78.4%
Taylor expanded in l around 0 68.8%
associate-*l/79.9%
*-commutative79.9%
Simplified79.9%
*-commutative79.9%
sqrt-prod41.3%
Applied egg-rr41.3%
if -9.4999999999999997e57 < (*.f64 V l) < -5.00000000000000003e-151Initial program 96.6%
if -5.00000000000000003e-151 < (*.f64 V l) < 4.0000000000000001e-300Initial program 48.5%
add-cube-cbrt48.4%
*-commutative48.4%
times-frac69.5%
pow269.5%
Applied egg-rr69.5%
frac-times48.4%
unpow248.4%
add-cube-cbrt48.5%
*-commutative48.5%
associate-/r*67.6%
sqrt-undiv51.6%
associate-*r/51.7%
clear-num51.6%
Applied egg-rr51.6%
associate-/r/51.5%
associate-*l/51.7%
*-commutative51.7%
associate-*l*51.7%
*-lft-identity51.7%
associate-*r/51.7%
Simplified51.7%
if 4.0000000000000001e-300 < (*.f64 V l) Initial program 73.1%
sqrt-div90.4%
associate-*r/88.5%
Applied egg-rr88.5%
associate-*l/84.2%
Simplified84.2%
Final simplification70.1%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* V l) -9.5e+57)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* V l) -5e-151)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 4e-300)
(* (sqrt (/ A V)) (/ c0 (sqrt l)))
(/ c0 (/ (sqrt (* V l)) (sqrt A)))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -9.5e+57) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((V * l) <= -5e-151) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 4e-300) {
tmp = sqrt((A / V)) * (c0 / sqrt(l));
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((v * l) <= (-9.5d+57)) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
else if ((v * l) <= (-5d-151)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 4d-300) then
tmp = sqrt((a / v)) * (c0 / sqrt(l))
else
tmp = c0 / (sqrt((v * l)) / sqrt(a))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -9.5e+57) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} else if ((V * l) <= -5e-151) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 4e-300) {
tmp = Math.sqrt((A / V)) * (c0 / Math.sqrt(l));
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): tmp = 0 if (V * l) <= -9.5e+57: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) elif (V * l) <= -5e-151: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 4e-300: tmp = math.sqrt((A / V)) * (c0 / math.sqrt(l)) else: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(V * l) <= -9.5e+57) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(V * l) <= -5e-151) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 4e-300) tmp = Float64(sqrt(Float64(A / V)) * Float64(c0 / sqrt(l))); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((V * l) <= -9.5e+57)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
elseif ((V * l) <= -5e-151)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 4e-300)
tmp = sqrt((A / V)) * (c0 / sqrt(l));
else
tmp = c0 / (sqrt((V * l)) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(V * l), $MachinePrecision], -9.5e+57], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-151], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-300], N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;V \cdot \ell \leq -9.5 \cdot 10^{+57}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-151}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-300}:\\
\;\;\;\;\sqrt{\frac{A}{V}} \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.4999999999999997e57Initial program 70.7%
add-cube-cbrt70.3%
*-commutative70.3%
times-frac81.4%
pow281.4%
Applied egg-rr81.4%
frac-times70.3%
unpow270.3%
add-cube-cbrt70.7%
*-commutative70.7%
associate-/r*80.9%
sqrt-undiv41.4%
clear-num41.3%
un-div-inv41.3%
sqrt-undiv79.8%
Applied egg-rr79.8%
associate-/r/78.4%
Simplified78.4%
Taylor expanded in l around 0 68.8%
associate-*l/79.9%
*-commutative79.9%
Simplified79.9%
*-commutative79.9%
sqrt-prod41.3%
Applied egg-rr41.3%
if -9.4999999999999997e57 < (*.f64 V l) < -5.00000000000000003e-151Initial program 96.6%
if -5.00000000000000003e-151 < (*.f64 V l) < 4.0000000000000001e-300Initial program 48.5%
add-cube-cbrt48.4%
*-commutative48.4%
times-frac69.5%
pow269.5%
Applied egg-rr69.5%
frac-times48.4%
unpow248.4%
add-cube-cbrt48.5%
*-commutative48.5%
associate-/r*67.6%
sqrt-undiv51.6%
associate-*r/51.7%
clear-num51.6%
Applied egg-rr51.6%
associate-/r/51.5%
associate-*l/51.7%
*-commutative51.7%
associate-*l*51.7%
*-lft-identity51.7%
associate-*r/51.7%
Simplified51.7%
if 4.0000000000000001e-300 < (*.f64 V l) Initial program 73.1%
sqrt-div90.4%
associate-*r/88.5%
Applied egg-rr88.5%
associate-/l*90.3%
Simplified90.3%
Final simplification72.3%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (/ A V))))
(if (<= (* V l) -9.5e+57)
(* c0 (* t_0 (pow l -0.5)))
(if (<= (* V l) -5e-151)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 4e-300)
(* t_0 (/ c0 (sqrt l)))
(/ c0 (/ (sqrt (* V l)) (sqrt A))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -9.5e+57) {
tmp = c0 * (t_0 * pow(l, -0.5));
} else if ((V * l) <= -5e-151) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 4e-300) {
tmp = t_0 * (c0 / sqrt(l));
} else {
tmp = c0 / (sqrt((V * l)) / sqrt(A));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-9.5d+57)) then
tmp = c0 * (t_0 * (l ** (-0.5d0)))
else if ((v * l) <= (-5d-151)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 4d-300) then
tmp = t_0 * (c0 / sqrt(l))
else
tmp = c0 / (sqrt((v * l)) / sqrt(a))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -9.5e+57) {
tmp = c0 * (t_0 * Math.pow(l, -0.5));
} else if ((V * l) <= -5e-151) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 4e-300) {
tmp = t_0 * (c0 / Math.sqrt(l));
} else {
tmp = c0 / (Math.sqrt((V * l)) / Math.sqrt(A));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -9.5e+57: tmp = c0 * (t_0 * math.pow(l, -0.5)) elif (V * l) <= -5e-151: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 4e-300: tmp = t_0 * (c0 / math.sqrt(l)) else: tmp = c0 / (math.sqrt((V * l)) / math.sqrt(A)) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -9.5e+57) tmp = Float64(c0 * Float64(t_0 * (l ^ -0.5))); elseif (Float64(V * l) <= -5e-151) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 4e-300) tmp = Float64(t_0 * Float64(c0 / sqrt(l))); else tmp = Float64(c0 / Float64(sqrt(Float64(V * l)) / sqrt(A))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -9.5e+57)
tmp = c0 * (t_0 * (l ^ -0.5));
elseif ((V * l) <= -5e-151)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 4e-300)
tmp = t_0 * (c0 / sqrt(l));
else
tmp = c0 / (sqrt((V * l)) / sqrt(A));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -9.5e+57], N[(c0 * N[(t$95$0 * N[Power[l, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-151], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-300], N[(t$95$0 * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 / N[(N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision] / N[Sqrt[A], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -9.5 \cdot 10^{+57}:\\
\;\;\;\;c0 \cdot \left(t_0 \cdot {\ell}^{-0.5}\right)\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-151}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-300}:\\
\;\;\;\;t_0 \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{V \cdot \ell}}{\sqrt{A}}}\\
\end{array}
\end{array}
if (*.f64 V l) < -9.4999999999999997e57Initial program 70.7%
add-cube-cbrt70.3%
*-commutative70.3%
times-frac81.4%
pow281.4%
Applied egg-rr81.4%
frac-times70.3%
unpow270.3%
add-cube-cbrt70.7%
*-commutative70.7%
associate-/r*80.9%
sqrt-undiv41.4%
div-inv41.3%
pow1/241.3%
pow-flip41.3%
metadata-eval41.3%
Applied egg-rr41.3%
if -9.4999999999999997e57 < (*.f64 V l) < -5.00000000000000003e-151Initial program 96.6%
if -5.00000000000000003e-151 < (*.f64 V l) < 4.0000000000000001e-300Initial program 48.5%
add-cube-cbrt48.4%
*-commutative48.4%
times-frac69.5%
pow269.5%
Applied egg-rr69.5%
frac-times48.4%
unpow248.4%
add-cube-cbrt48.5%
*-commutative48.5%
associate-/r*67.6%
sqrt-undiv51.6%
associate-*r/51.7%
clear-num51.6%
Applied egg-rr51.6%
associate-/r/51.5%
associate-*l/51.7%
*-commutative51.7%
associate-*l*51.7%
*-lft-identity51.7%
associate-*r/51.7%
Simplified51.7%
if 4.0000000000000001e-300 < (*.f64 V l) Initial program 73.1%
sqrt-div90.4%
associate-*r/88.5%
Applied egg-rr88.5%
associate-/l*90.3%
Simplified90.3%
Final simplification72.3%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 1e-321) (not (<= t_0 1e+303)))
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(* c0 (sqrt t_0)))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 1e-321) || !(t_0 <= 1e+303)) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 1d-321) .or. (.not. (t_0 <= 1d+303))) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 1e-321) || !(t_0 <= 1e+303)) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 1e-321) or not (t_0 <= 1e+303): tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) else: tmp = c0 * math.sqrt(t_0) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 1e-321) || !(t_0 <= 1e+303)) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 1e-321) || ~((t_0 <= 1e+303)))
tmp = c0 * (sqrt((A / V)) / sqrt(l));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 1e-321], N[Not[LessEqual[t$95$0, 1e+303]], $MachinePrecision]], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 10^{-321} \lor \neg \left(t_0 \leq 10^{+303}\right):\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 9.98013e-322 or 1e303 < (/.f64 A (*.f64 V l)) Initial program 33.5%
associate-/r*53.5%
sqrt-div35.6%
Applied egg-rr35.6%
if 9.98013e-322 < (/.f64 A (*.f64 V l)) < 1e303Initial program 98.5%
Final simplification72.9%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (or (<= t_0 0.0) (not (<= t_0 1e+295)))
(* c0 (sqrt (/ (/ A V) l)))
(* c0 (sqrt t_0)))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 1e+295)) {
tmp = c0 * sqrt(((A / V) / l));
} else {
tmp = c0 * sqrt(t_0);
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if ((t_0 <= 0.0d0) .or. (.not. (t_0 <= 1d+295))) then
tmp = c0 * sqrt(((a / v) / l))
else
tmp = c0 * sqrt(t_0)
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if ((t_0 <= 0.0) || !(t_0 <= 1e+295)) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else {
tmp = c0 * Math.sqrt(t_0);
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if (t_0 <= 0.0) or not (t_0 <= 1e+295): tmp = c0 * math.sqrt(((A / V) / l)) else: tmp = c0 * math.sqrt(t_0) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if ((t_0 <= 0.0) || !(t_0 <= 1e+295)) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); else tmp = Float64(c0 * sqrt(t_0)); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if ((t_0 <= 0.0) || ~((t_0 <= 1e+295)))
tmp = c0 * sqrt(((A / V) / l));
else
tmp = c0 * sqrt(t_0);
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, 0.0], N[Not[LessEqual[t$95$0, 1e+295]], $MachinePrecision]], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0 \lor \neg \left(t_0 \leq 10^{+295}\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 9.9999999999999998e294 < (/.f64 A (*.f64 V l)) Initial program 34.0%
add-cube-cbrt34.0%
*-commutative34.0%
times-frac53.9%
pow253.9%
Applied egg-rr53.9%
frac-times34.0%
unpow234.0%
add-cube-cbrt34.0%
*-commutative34.0%
associate-/r*54.0%
Applied egg-rr54.0%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999998e294Initial program 98.1%
Final simplification80.2%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+295) (* c0 (sqrt t_0)) (/ c0 (sqrt (* l (/ V A))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 1e+295) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 1d+295) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+295) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 1e+295: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+295) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 1e+295)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+295], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 10^{+295}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 38.2%
add-cube-cbrt38.2%
*-commutative38.2%
times-frac57.7%
pow257.7%
Applied egg-rr57.7%
frac-times38.2%
unpow238.2%
add-cube-cbrt38.2%
*-commutative38.2%
associate-/r*57.9%
Applied egg-rr57.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999998e294Initial program 98.1%
if 9.9999999999999998e294 < (/.f64 A (*.f64 V l)) Initial program 29.9%
add-cube-cbrt29.9%
*-commutative29.9%
times-frac50.0%
pow250.0%
Applied egg-rr50.0%
frac-times29.9%
unpow229.9%
add-cube-cbrt29.9%
*-commutative29.9%
associate-/r*50.1%
sqrt-undiv40.9%
clear-num41.0%
un-div-inv40.9%
sqrt-undiv50.7%
Applied egg-rr50.7%
associate-/r/51.4%
Simplified51.4%
Taylor expanded in l around 0 31.0%
associate-*l/50.7%
*-commutative50.7%
Simplified50.7%
Final simplification80.3%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 1e+295) (* c0 (sqrt t_0)) (/ c0 (sqrt (/ l (/ A V))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 1e+295) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((l / (A / V)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 1d+295) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((l / (a / v)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 1e+295) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((l / (A / V)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 1e+295: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((l / (A / V))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 1e+295) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(l / Float64(A / V)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 1e+295)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((l / (A / V)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+295], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t_0 \leq 10^{+295}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 38.2%
add-cube-cbrt38.2%
*-commutative38.2%
times-frac57.7%
pow257.7%
Applied egg-rr57.7%
frac-times38.2%
unpow238.2%
add-cube-cbrt38.2%
*-commutative38.2%
associate-/r*57.9%
Applied egg-rr57.9%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999998e294Initial program 98.1%
if 9.9999999999999998e294 < (/.f64 A (*.f64 V l)) Initial program 29.9%
add-cube-cbrt29.9%
*-commutative29.9%
times-frac50.0%
pow250.0%
Applied egg-rr50.0%
frac-times29.9%
unpow229.9%
add-cube-cbrt29.9%
*-commutative29.9%
associate-/r*50.1%
sqrt-undiv40.9%
clear-num41.0%
un-div-inv40.9%
sqrt-undiv50.7%
Applied egg-rr50.7%
Final simplification80.3%
NOTE: V and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 2e-318)
(* c0 (sqrt (* (* A (/ 1.0 l)) (/ 1.0 V))))
(if (<= t_0 1e+295) (* c0 (sqrt t_0)) (/ c0 (sqrt (/ l (/ A V))))))))assert(V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e-318) {
tmp = c0 * sqrt(((A * (1.0 / l)) * (1.0 / V)));
} else if (t_0 <= 1e+295) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 / sqrt((l / (A / V)));
}
return tmp;
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (v * l)
if (t_0 <= 2d-318) then
tmp = c0 * sqrt(((a * (1.0d0 / l)) * (1.0d0 / v)))
else if (t_0 <= 1d+295) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 / sqrt((l / (a / v)))
end if
code = tmp
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double tmp;
if (t_0 <= 2e-318) {
tmp = c0 * Math.sqrt(((A * (1.0 / l)) * (1.0 / V)));
} else if (t_0 <= 1e+295) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 / Math.sqrt((l / (A / V)));
}
return tmp;
}
[V, l] = sort([V, l]) def code(c0, A, V, l): t_0 = A / (V * l) tmp = 0 if t_0 <= 2e-318: tmp = c0 * math.sqrt(((A * (1.0 / l)) * (1.0 / V))) elif t_0 <= 1e+295: tmp = c0 * math.sqrt(t_0) else: tmp = c0 / math.sqrt((l / (A / V))) return tmp
V, l = sort([V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) tmp = 0.0 if (t_0 <= 2e-318) tmp = Float64(c0 * sqrt(Float64(Float64(A * Float64(1.0 / l)) * Float64(1.0 / V)))); elseif (t_0 <= 1e+295) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 / sqrt(Float64(l / Float64(A / V)))); end return tmp end
V, l = num2cell(sort([V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (V * l);
tmp = 0.0;
if (t_0 <= 2e-318)
tmp = c0 * sqrt(((A * (1.0 / l)) * (1.0 / V)));
elseif (t_0 <= 1e+295)
tmp = c0 * sqrt(t_0);
else
tmp = c0 / sqrt((l / (A / V)));
end
tmp_2 = tmp;
end
NOTE: V and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-318], N[(c0 * N[Sqrt[N[(N[(A * N[(1.0 / l), $MachinePrecision]), $MachinePrecision] * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+295], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 / N[Sqrt[N[(l / N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
\mathbf{if}\;t_0 \leq 2 \cdot 10^{-318}:\\
\;\;\;\;c0 \cdot \sqrt{\left(A \cdot \frac{1}{\ell}\right) \cdot \frac{1}{V}}\\
\mathbf{elif}\;t_0 \leq 10^{+295}:\\
\;\;\;\;c0 \cdot \sqrt{t_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{\ell}{\frac{A}{V}}}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 2.0000024e-318Initial program 38.5%
add-cube-cbrt38.5%
*-commutative38.5%
times-frac57.3%
pow257.3%
Applied egg-rr57.3%
frac-times38.5%
unpow238.5%
add-cube-cbrt38.5%
*-commutative38.5%
associate-/r*56.6%
Applied egg-rr56.6%
div-inv56.6%
*-commutative56.6%
div-inv56.6%
associate-*r*57.5%
Applied egg-rr57.5%
if 2.0000024e-318 < (/.f64 A (*.f64 V l)) < 9.9999999999999998e294Initial program 98.8%
if 9.9999999999999998e294 < (/.f64 A (*.f64 V l)) Initial program 29.9%
add-cube-cbrt29.9%
*-commutative29.9%
times-frac50.0%
pow250.0%
Applied egg-rr50.0%
frac-times29.9%
unpow229.9%
add-cube-cbrt29.9%
*-commutative29.9%
associate-/r*50.1%
sqrt-undiv40.9%
clear-num41.0%
un-div-inv40.9%
sqrt-undiv50.7%
Applied egg-rr50.7%
Final simplification80.3%
NOTE: V and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
assert(V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
NOTE: V and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
assert V < l;
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
[V, l] = sort([V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
V, l = sort([V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
V, l = num2cell(sort([V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (V * l)));
end
NOTE: V and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[V, l] = \mathsf{sort}([V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
Initial program 72.1%
Final simplification72.1%
herbie shell --seed 2023274
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))