
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* V l)))))
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (V * l)));
}
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
def code(c0, A, V, l): return c0 * math.sqrt((A / (V * l)))
function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(V * l)))) end
function tmp = code(c0, A, V, l) tmp = c0 * sqrt((A / (V * l))); end
code[c0_, A_, V_, l_] := N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\end{array}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (if (<= A -5e-310) (/ (* c0 (sqrt (- A))) (* (sqrt (- V)) (sqrt l))) (* 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 <= -5e-310) {
tmp = (c0 * sqrt(-A)) / (sqrt(-V) * sqrt(l));
} 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 <= (-5d-310)) then
tmp = (c0 * sqrt(-a)) / (sqrt(-v) * sqrt(l))
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 <= -5e-310) {
tmp = (c0 * Math.sqrt(-A)) / (Math.sqrt(-V) * Math.sqrt(l));
} 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 <= -5e-310: tmp = (c0 * math.sqrt(-A)) / (math.sqrt(-V) * math.sqrt(l)) 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 <= -5e-310) tmp = Float64(Float64(c0 * sqrt(Float64(-A))) / Float64(sqrt(Float64(-V)) * sqrt(l))); 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 <= -5e-310)
tmp = (c0 * sqrt(-A)) / (sqrt(-V) * sqrt(l));
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, -5e-310], N[(N[(c0 * N[Sqrt[(-A)], $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[(-V)], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;A \leq -5 \cdot 10^{-310}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{-A}}{\sqrt{-V} \cdot \sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 72.5%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6471.7
Applied egg-rr71.7%
*-commutativeN/A
sqrt-prodN/A
pow1/2N/A
associate-*l*N/A
pow1/2N/A
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
associate-/l/N/A
times-fracN/A
sqrt-divN/A
associate-/r/N/A
/-lowering-/.f64N/A
sqrt-undivN/A
sqrt-lowering-sqrt.f64N/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
/-lowering-/.f64N/A
Applied egg-rr73.1%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6468.2
Applied egg-rr68.2%
Applied egg-rr51.8%
if -4.999999999999985e-310 < A Initial program 78.0%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6488.5
Applied egg-rr88.5%
Final simplification71.5%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (sqrt (/ A (* V l))))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+276) t_0 (/ c0 (sqrt (* l (/ V A))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+276) {
tmp = t_0;
} else {
tmp = c0 / sqrt((l * (V / A)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+276) then
tmp = t_0
else
tmp = c0 / sqrt((l * (v / a)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+276) {
tmp = t_0;
} else {
tmp = c0 / Math.sqrt((l * (V / A)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * math.sqrt((A / (V * l))) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+276: tmp = t_0 else: tmp = c0 / math.sqrt((l * (V / A))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * sqrt(Float64(A / Float64(V * l)))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+276) tmp = t_0; else tmp = Float64(c0 / sqrt(Float64(l * Float64(V / A)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = c0 * sqrt((A / (V * l)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+276)
tmp = t_0;
else
tmp = c0 / sqrt((l * (V / A)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+276], t$95$0, N[(c0 / N[Sqrt[N[(l * N[(V / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+276}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell \cdot \frac{V}{A}}}\\
\end{array}
\end{array}
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 0.0Initial program 69.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6468.6
Applied egg-rr68.6%
if 0.0 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 2.0000000000000001e276Initial program 99.4%
if 2.0000000000000001e276 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) Initial program 43.2%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6443.2
Applied egg-rr43.2%
*-commutativeN/A
sqrt-prodN/A
pow1/2N/A
associate-*l*N/A
pow1/2N/A
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
associate-/l/N/A
times-fracN/A
sqrt-divN/A
associate-/r/N/A
/-lowering-/.f64N/A
sqrt-undivN/A
sqrt-lowering-sqrt.f64N/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
/-lowering-/.f64N/A
Applied egg-rr46.0%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6456.7
Applied egg-rr56.7%
Final simplification76.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 5e+301) (* 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 / V) / l));
} else if (t_0 <= 5e+301) {
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 / v) / l))
else if (t_0 <= 5d+301) 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 / V) / l));
} else if (t_0 <= 5e+301) {
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 / V) / l)) elif t_0 <= 5e+301: 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 / V) / l))); elseif (t_0 <= 5e+301) 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 / V) / l));
elseif (t_0 <= 5e+301)
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 / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+301], 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}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+301}:\\
\;\;\;\;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 48.4%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6460.8
Applied egg-rr60.8%
if 0.0 < (/.f64 A (*.f64 V l)) < 5.0000000000000004e301Initial program 99.1%
if 5.0000000000000004e301 < (/.f64 A (*.f64 V l)) Initial program 26.2%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6442.7
Applied egg-rr42.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))) (t_1 (* c0 (sqrt (/ (/ A V) l))))) (if (<= t_0 0.0) t_1 (if (<= t_0 1e+304) (* c0 (sqrt t_0)) t_1))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double t_1 = c0 * sqrt(((A / V) / l));
double tmp;
if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 1e+304) {
tmp = c0 * sqrt(t_0);
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = a / (v * l)
t_1 = c0 * sqrt(((a / v) / l))
if (t_0 <= 0.0d0) then
tmp = t_1
else if (t_0 <= 1d+304) then
tmp = c0 * sqrt(t_0)
else
tmp = t_1
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 t_1 = c0 * Math.sqrt(((A / V) / l));
double tmp;
if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 1e+304) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = t_1;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) t_1 = c0 * math.sqrt(((A / V) / l)) tmp = 0 if t_0 <= 0.0: tmp = t_1 elif t_0 <= 1e+304: tmp = c0 * math.sqrt(t_0) else: tmp = t_1 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) t_1 = Float64(c0 * sqrt(Float64(Float64(A / V) / l))) tmp = 0.0 if (t_0 <= 0.0) tmp = t_1; elseif (t_0 <= 1e+304) tmp = Float64(c0 * sqrt(t_0)); else tmp = t_1; 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);
t_1 = c0 * sqrt(((A / V) / l));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = t_1;
elseif (t_0 <= 1e+304)
tmp = c0 * sqrt(t_0);
else
tmp = t_1;
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]}, Block[{t$95$1 = N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], t$95$1, If[LessEqual[t$95$0, 1e+304], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
t_1 := c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10^{+304}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 9.9999999999999994e303 < (/.f64 A (*.f64 V l)) Initial program 36.7%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6449.7
Applied egg-rr49.7%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999994e303Initial program 99.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) (- INFINITY))
(* c0 (/ (sqrt (/ A (- l))) (sqrt (- V))))
(if (<= (* V l) -5e-304)
(* c0 (/ (sqrt (- A)) (sqrt (- (* V l)))))
(if (<= (* V l) 0.0)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(* 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 ((V * l) <= -((double) INFINITY)) {
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
} else if ((V * l) <= -5e-304) {
tmp = c0 * (sqrt(-A) / sqrt(-(V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else {
tmp = c0 * (sqrt(A) / sqrt((V * l)));
}
return tmp;
}
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((V * l) <= -Double.POSITIVE_INFINITY) {
tmp = c0 * (Math.sqrt((A / -l)) / Math.sqrt(-V));
} else if ((V * l) <= -5e-304) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt(-(V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} 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 (V * l) <= -math.inf: tmp = c0 * (math.sqrt((A / -l)) / math.sqrt(-V)) elif (V * l) <= -5e-304: tmp = c0 * (math.sqrt(-A) / math.sqrt(-(V * l))) elif (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) 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 (Float64(V * l) <= Float64(-Inf)) tmp = Float64(c0 * Float64(sqrt(Float64(A / Float64(-l))) / sqrt(Float64(-V)))); elseif (Float64(V * l) <= -5e-304) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(-Float64(V * l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); 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 ((V * l) <= -Inf)
tmp = c0 * (sqrt((A / -l)) / sqrt(-V));
elseif ((V * l) <= -5e-304)
tmp = c0 * (sqrt(-A) / sqrt(-(V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
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[N[(V * l), $MachinePrecision], (-Infinity)], N[(c0 * N[(N[Sqrt[N[(A / (-l)), $MachinePrecision]], $MachinePrecision] / N[Sqrt[(-V)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-304], 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[l], $MachinePrecision] * N[Sqrt[N[(V / A), $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}\;V \cdot \ell \leq -\infty:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{-\ell}}}{\sqrt{-V}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-304}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{-V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 46.2%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6446.2
Applied egg-rr46.2%
associate-*l/N/A
*-commutativeN/A
frac-timesN/A
frac-2negN/A
associate-*l/N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
distribute-lft-neg-outN/A
div-invN/A
distribute-frac-neg2N/A
/-lowering-/.f64N/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f6431.8
Applied egg-rr31.8%
if -inf.0 < (*.f64 V l) < -4.99999999999999965e-304Initial program 88.2%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6488.2
Applied egg-rr88.2%
*-commutativeN/A
div-invN/A
frac-2negN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6499.4
Applied egg-rr99.4%
if -4.99999999999999965e-304 < (*.f64 V l) < -0.0Initial program 25.4%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6422.0
Applied egg-rr22.0%
*-commutativeN/A
sqrt-prodN/A
pow1/2N/A
associate-*l*N/A
pow1/2N/A
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
associate-/l/N/A
times-fracN/A
sqrt-divN/A
associate-/r/N/A
/-lowering-/.f64N/A
sqrt-undivN/A
sqrt-lowering-sqrt.f64N/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
/-lowering-/.f64N/A
Applied egg-rr25.4%
associate-*r/N/A
clear-numN/A
un-div-invN/A
associate-/r/N/A
sqrt-prodN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6447.1
Applied egg-rr47.1%
if -0.0 < (*.f64 V l) Initial program 82.5%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6494.1
Applied egg-rr94.1%
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) -2e+306)
(/ (* c0 (sqrt (/ A V))) (sqrt l))
(if (<= (* V l) -5e-304)
(* c0 (/ (sqrt (- A)) (sqrt (- (* V l)))))
(if (<= (* V l) 0.0)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(* 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 ((V * l) <= -2e+306) {
tmp = (c0 * sqrt((A / V))) / sqrt(l);
} else if ((V * l) <= -5e-304) {
tmp = c0 * (sqrt(-A) / sqrt(-(V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} 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 ((v * l) <= (-2d+306)) then
tmp = (c0 * sqrt((a / v))) / sqrt(l)
else if ((v * l) <= (-5d-304)) then
tmp = c0 * (sqrt(-a) / sqrt(-(v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
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 ((V * l) <= -2e+306) {
tmp = (c0 * Math.sqrt((A / V))) / Math.sqrt(l);
} else if ((V * l) <= -5e-304) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt(-(V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} 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 (V * l) <= -2e+306: tmp = (c0 * math.sqrt((A / V))) / math.sqrt(l) elif (V * l) <= -5e-304: tmp = c0 * (math.sqrt(-A) / math.sqrt(-(V * l))) elif (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) 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 (Float64(V * l) <= -2e+306) tmp = Float64(Float64(c0 * sqrt(Float64(A / V))) / sqrt(l)); elseif (Float64(V * l) <= -5e-304) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(-Float64(V * l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); 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 ((V * l) <= -2e+306)
tmp = (c0 * sqrt((A / V))) / sqrt(l);
elseif ((V * l) <= -5e-304)
tmp = c0 * (sqrt(-A) / sqrt(-(V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
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[N[(V * l), $MachinePrecision], -2e+306], N[(N[(c0 * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-304], 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[l], $MachinePrecision] * N[Sqrt[N[(V / A), $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}\;V \cdot \ell \leq -2 \cdot 10^{+306}:\\
\;\;\;\;\frac{c0 \cdot \sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-304}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{-V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2.00000000000000003e306Initial program 48.8%
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6435.2
Applied egg-rr35.2%
if -2.00000000000000003e306 < (*.f64 V l) < -4.99999999999999965e-304Initial program 88.1%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6488.0
Applied egg-rr88.0%
*-commutativeN/A
div-invN/A
frac-2negN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6499.4
Applied egg-rr99.4%
if -4.99999999999999965e-304 < (*.f64 V l) < -0.0Initial program 25.4%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6422.0
Applied egg-rr22.0%
*-commutativeN/A
sqrt-prodN/A
pow1/2N/A
associate-*l*N/A
pow1/2N/A
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
associate-/l/N/A
times-fracN/A
sqrt-divN/A
associate-/r/N/A
/-lowering-/.f64N/A
sqrt-undivN/A
sqrt-lowering-sqrt.f64N/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
/-lowering-/.f64N/A
Applied egg-rr25.4%
associate-*r/N/A
clear-numN/A
un-div-invN/A
associate-/r/N/A
sqrt-prodN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6447.1
Applied egg-rr47.1%
if -0.0 < (*.f64 V l) Initial program 82.5%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6494.1
Applied egg-rr94.1%
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) -1e+262)
(* c0 (/ (sqrt (/ A V)) (sqrt l)))
(if (<= (* V l) -5e-304)
(* c0 (/ (sqrt (- A)) (sqrt (- (* V l)))))
(if (<= (* V l) 0.0)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(* 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 ((V * l) <= -1e+262) {
tmp = c0 * (sqrt((A / V)) / sqrt(l));
} else if ((V * l) <= -5e-304) {
tmp = c0 * (sqrt(-A) / sqrt(-(V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} 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 ((v * l) <= (-1d+262)) then
tmp = c0 * (sqrt((a / v)) / sqrt(l))
else if ((v * l) <= (-5d-304)) then
tmp = c0 * (sqrt(-a) / sqrt(-(v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 / (sqrt(l) * sqrt((v / a)))
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 ((V * l) <= -1e+262) {
tmp = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
} else if ((V * l) <= -5e-304) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt(-(V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 / (Math.sqrt(l) * Math.sqrt((V / A)));
} 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 (V * l) <= -1e+262: tmp = c0 * (math.sqrt((A / V)) / math.sqrt(l)) elif (V * l) <= -5e-304: tmp = c0 * (math.sqrt(-A) / math.sqrt(-(V * l))) elif (V * l) <= 0.0: tmp = c0 / (math.sqrt(l) * math.sqrt((V / A))) 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 (Float64(V * l) <= -1e+262) tmp = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))); elseif (Float64(V * l) <= -5e-304) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(-Float64(V * l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); 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 ((V * l) <= -1e+262)
tmp = c0 * (sqrt((A / V)) / sqrt(l));
elseif ((V * l) <= -5e-304)
tmp = c0 * (sqrt(-A) / sqrt(-(V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 / (sqrt(l) * sqrt((V / A)));
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[N[(V * l), $MachinePrecision], -1e+262], N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-304], 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[l], $MachinePrecision] * N[Sqrt[N[(V / A), $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}\;V \cdot \ell \leq -1 \cdot 10^{+262}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-304}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{-V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1e262Initial program 59.0%
associate-/r*N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6436.1
Applied egg-rr36.1%
if -1e262 < (*.f64 V l) < -4.99999999999999965e-304Initial program 87.3%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6487.3
Applied egg-rr87.3%
*-commutativeN/A
div-invN/A
frac-2negN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6499.4
Applied egg-rr99.4%
if -4.99999999999999965e-304 < (*.f64 V l) < -0.0Initial program 25.4%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6422.0
Applied egg-rr22.0%
*-commutativeN/A
sqrt-prodN/A
pow1/2N/A
associate-*l*N/A
pow1/2N/A
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
associate-/l/N/A
times-fracN/A
sqrt-divN/A
associate-/r/N/A
/-lowering-/.f64N/A
sqrt-undivN/A
sqrt-lowering-sqrt.f64N/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
/-lowering-/.f64N/A
Applied egg-rr25.4%
associate-*r/N/A
clear-numN/A
un-div-invN/A
associate-/r/N/A
sqrt-prodN/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6447.1
Applied egg-rr47.1%
if -0.0 < (*.f64 V l) Initial program 82.5%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6494.1
Applied egg-rr94.1%
Final simplification84.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (sqrt (/ A V))))
(if (<= (* V l) -1e+262)
(* c0 (/ t_0 (sqrt l)))
(if (<= (* V l) -5e-304)
(* c0 (/ (sqrt (- A)) (sqrt (- (* V l)))))
(if (<= (* V l) 0.0)
(* t_0 (/ c0 (sqrt l)))
(* c0 (/ (sqrt A) (sqrt (* V l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = sqrt((A / V));
double tmp;
if ((V * l) <= -1e+262) {
tmp = c0 * (t_0 / sqrt(l));
} else if ((V * l) <= -5e-304) {
tmp = c0 * (sqrt(-A) / sqrt(-(V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0 * (c0 / sqrt(l));
} 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) :: t_0
real(8) :: tmp
t_0 = sqrt((a / v))
if ((v * l) <= (-1d+262)) then
tmp = c0 * (t_0 / sqrt(l))
else if ((v * l) <= (-5d-304)) then
tmp = c0 * (sqrt(-a) / sqrt(-(v * l)))
else if ((v * l) <= 0.0d0) then
tmp = t_0 * (c0 / sqrt(l))
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 t_0 = Math.sqrt((A / V));
double tmp;
if ((V * l) <= -1e+262) {
tmp = c0 * (t_0 / Math.sqrt(l));
} else if ((V * l) <= -5e-304) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt(-(V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0 * (c0 / Math.sqrt(l));
} 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): t_0 = math.sqrt((A / V)) tmp = 0 if (V * l) <= -1e+262: tmp = c0 * (t_0 / math.sqrt(l)) elif (V * l) <= -5e-304: tmp = c0 * (math.sqrt(-A) / math.sqrt(-(V * l))) elif (V * l) <= 0.0: tmp = t_0 * (c0 / math.sqrt(l)) 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) t_0 = sqrt(Float64(A / V)) tmp = 0.0 if (Float64(V * l) <= -1e+262) tmp = Float64(c0 * Float64(t_0 / sqrt(l))); elseif (Float64(V * l) <= -5e-304) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(-Float64(V * l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(t_0 * Float64(c0 / sqrt(l))); 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)
t_0 = sqrt((A / V));
tmp = 0.0;
if ((V * l) <= -1e+262)
tmp = c0 * (t_0 / sqrt(l));
elseif ((V * l) <= -5e-304)
tmp = c0 * (sqrt(-A) / sqrt(-(V * l)));
elseif ((V * l) <= 0.0)
tmp = t_0 * (c0 / sqrt(l));
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_] := Block[{t$95$0 = N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+262], N[(c0 * N[(t$95$0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], -5e-304], 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[(t$95$0 * N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \sqrt{\frac{A}{V}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+262}:\\
\;\;\;\;c0 \cdot \frac{t\_0}{\sqrt{\ell}}\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-304}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{-V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0 \cdot \frac{c0}{\sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1e262Initial program 59.0%
associate-/r*N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6436.1
Applied egg-rr36.1%
if -1e262 < (*.f64 V l) < -4.99999999999999965e-304Initial program 87.3%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6487.3
Applied egg-rr87.3%
*-commutativeN/A
div-invN/A
frac-2negN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6499.4
Applied egg-rr99.4%
if -4.99999999999999965e-304 < (*.f64 V l) < -0.0Initial program 25.4%
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
associate-*l/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f6447.0
Applied egg-rr47.0%
if -0.0 < (*.f64 V l) Initial program 82.5%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6494.1
Applied egg-rr94.1%
Final simplification84.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* c0 (/ (sqrt (/ A V)) (sqrt l)))))
(if (<= (* V l) -1e+262)
t_0
(if (<= (* V l) -5e-304)
(* c0 (/ (sqrt (- A)) (sqrt (- (* V l)))))
(if (<= (* V l) 0.0) t_0 (* c0 (/ (sqrt A) (sqrt (* V l)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 * (sqrt((A / V)) / sqrt(l));
double tmp;
if ((V * l) <= -1e+262) {
tmp = t_0;
} else if ((V * l) <= -5e-304) {
tmp = c0 * (sqrt(-A) / sqrt(-(V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = c0 * (sqrt((a / v)) / sqrt(l))
if ((v * l) <= (-1d+262)) then
tmp = t_0
else if ((v * l) <= (-5d-304)) then
tmp = c0 * (sqrt(-a) / sqrt(-(v * l)))
else if ((v * l) <= 0.0d0) then
tmp = t_0
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 t_0 = c0 * (Math.sqrt((A / V)) / Math.sqrt(l));
double tmp;
if ((V * l) <= -1e+262) {
tmp = t_0;
} else if ((V * l) <= -5e-304) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt(-(V * l)));
} else if ((V * l) <= 0.0) {
tmp = t_0;
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((V * l)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = c0 * (math.sqrt((A / V)) / math.sqrt(l)) tmp = 0 if (V * l) <= -1e+262: tmp = t_0 elif (V * l) <= -5e-304: tmp = c0 * (math.sqrt(-A) / math.sqrt(-(V * l))) elif (V * l) <= 0.0: tmp = t_0 else: tmp = c0 * (math.sqrt(A) / math.sqrt((V * l))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 * Float64(sqrt(Float64(A / V)) / sqrt(l))) tmp = 0.0 if (Float64(V * l) <= -1e+262) tmp = t_0; elseif (Float64(V * l) <= -5e-304) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(-Float64(V * l))))); elseif (Float64(V * l) <= 0.0) tmp = t_0; 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)
t_0 = c0 * (sqrt((A / V)) / sqrt(l));
tmp = 0.0;
if ((V * l) <= -1e+262)
tmp = t_0;
elseif ((V * l) <= -5e-304)
tmp = c0 * (sqrt(-A) / sqrt(-(V * l)));
elseif ((V * l) <= 0.0)
tmp = t_0;
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_] := Block[{t$95$0 = N[(c0 * N[(N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(V * l), $MachinePrecision], -1e+262], t$95$0, If[LessEqual[N[(V * l), $MachinePrecision], -5e-304], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[Sqrt[(-N[(V * l), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], t$95$0, N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(V * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := c0 \cdot \frac{\sqrt{\frac{A}{V}}}{\sqrt{\ell}}\\
\mathbf{if}\;V \cdot \ell \leq -1 \cdot 10^{+262}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;V \cdot \ell \leq -5 \cdot 10^{-304}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{-V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1e262 or -4.99999999999999965e-304 < (*.f64 V l) < -0.0Initial program 41.2%
associate-/r*N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6441.8
Applied egg-rr41.8%
if -1e262 < (*.f64 V l) < -4.99999999999999965e-304Initial program 87.3%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6487.3
Applied egg-rr87.3%
*-commutativeN/A
div-invN/A
frac-2negN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6499.4
Applied egg-rr99.4%
if -0.0 < (*.f64 V l) Initial program 82.5%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6494.1
Applied egg-rr94.1%
Final simplification84.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* V l))) (t_1 (sqrt (* l (* A V)))))
(if (<= t_0 0.0)
(* A (/ c0 t_1))
(if (<= t_0 1e+304) (* c0 (sqrt t_0)) (* c0 (/ A t_1))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double t_1 = sqrt((l * (A * V)));
double tmp;
if (t_0 <= 0.0) {
tmp = A * (c0 / t_1);
} else if (t_0 <= 1e+304) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * (A / t_1);
}
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) :: t_1
real(8) :: tmp
t_0 = a / (v * l)
t_1 = sqrt((l * (a * v)))
if (t_0 <= 0.0d0) then
tmp = a * (c0 / t_1)
else if (t_0 <= 1d+304) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * (a / t_1)
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 t_1 = Math.sqrt((l * (A * V)));
double tmp;
if (t_0 <= 0.0) {
tmp = A * (c0 / t_1);
} else if (t_0 <= 1e+304) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * (A / t_1);
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) t_1 = math.sqrt((l * (A * V))) tmp = 0 if t_0 <= 0.0: tmp = A * (c0 / t_1) elif t_0 <= 1e+304: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * (A / t_1) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) t_1 = sqrt(Float64(l * Float64(A * V))) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(A * Float64(c0 / t_1)); elseif (t_0 <= 1e+304) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * Float64(A / t_1)); 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);
t_1 = sqrt((l * (A * V)));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = A * (c0 / t_1);
elseif (t_0 <= 1e+304)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * (A / t_1);
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]}, Block[{t$95$1 = N[Sqrt[N[(l * N[(A * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], N[(A * N[(c0 / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+304], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(A / t$95$1), $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}\\
t_1 := \sqrt{\ell \cdot \left(A \cdot V\right)}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;A \cdot \frac{c0}{t\_1}\\
\mathbf{elif}\;t\_0 \leq 10^{+304}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{A}{t\_1}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 48.4%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6448.4
Applied egg-rr48.4%
*-commutativeN/A
sqrt-prodN/A
pow1/2N/A
associate-*l*N/A
pow1/2N/A
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
associate-/l/N/A
times-fracN/A
sqrt-divN/A
associate-/r/N/A
/-lowering-/.f64N/A
sqrt-undivN/A
sqrt-lowering-sqrt.f64N/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
/-lowering-/.f64N/A
Applied egg-rr48.4%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6459.9
Applied egg-rr59.9%
div-invN/A
metadata-evalN/A
sqrt-divN/A
associate-*l/N/A
clear-numN/A
*-rgt-identityN/A
*-inversesN/A
times-fracN/A
sqrt-divN/A
sqrt-prodN/A
rem-square-sqrtN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6463.7
Applied egg-rr63.7%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999994e303Initial program 99.1%
if 9.9999999999999994e303 < (/.f64 A (*.f64 V l)) Initial program 24.7%
Applied egg-rr24.1%
sqrt-divN/A
sqrt-prodN/A
rem-square-sqrtN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6435.4
Applied egg-rr35.4%
Final simplification80.4%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (let* ((t_0 (/ A (* V l))) (t_1 (* A (/ c0 (sqrt (* l (* A V))))))) (if (<= t_0 0.0) t_1 (if (<= t_0 1e+304) (* c0 (sqrt t_0)) t_1))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (V * l);
double t_1 = A * (c0 / sqrt((l * (A * V))));
double tmp;
if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 1e+304) {
tmp = c0 * sqrt(t_0);
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = a / (v * l)
t_1 = a * (c0 / sqrt((l * (a * v))))
if (t_0 <= 0.0d0) then
tmp = t_1
else if (t_0 <= 1d+304) then
tmp = c0 * sqrt(t_0)
else
tmp = t_1
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 t_1 = A * (c0 / Math.sqrt((l * (A * V))));
double tmp;
if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 1e+304) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = t_1;
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (V * l) t_1 = A * (c0 / math.sqrt((l * (A * V)))) tmp = 0 if t_0 <= 0.0: tmp = t_1 elif t_0 <= 1e+304: tmp = c0 * math.sqrt(t_0) else: tmp = t_1 return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(V * l)) t_1 = Float64(A * Float64(c0 / sqrt(Float64(l * Float64(A * V))))) tmp = 0.0 if (t_0 <= 0.0) tmp = t_1; elseif (t_0 <= 1e+304) tmp = Float64(c0 * sqrt(t_0)); else tmp = t_1; 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);
t_1 = A * (c0 / sqrt((l * (A * V))));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = t_1;
elseif (t_0 <= 1e+304)
tmp = c0 * sqrt(t_0);
else
tmp = t_1;
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]}, Block[{t$95$1 = N[(A * N[(c0 / N[Sqrt[N[(l * N[(A * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.0], t$95$1, If[LessEqual[t$95$0, 1e+304], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{V \cdot \ell}\\
t_1 := A \cdot \frac{c0}{\sqrt{\ell \cdot \left(A \cdot V\right)}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10^{+304}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 9.9999999999999994e303 < (/.f64 A (*.f64 V l)) Initial program 36.7%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6436.7
Applied egg-rr36.7%
*-commutativeN/A
sqrt-prodN/A
pow1/2N/A
associate-*l*N/A
pow1/2N/A
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
associate-/l/N/A
times-fracN/A
sqrt-divN/A
associate-/r/N/A
/-lowering-/.f64N/A
sqrt-undivN/A
sqrt-lowering-sqrt.f64N/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
/-lowering-/.f64N/A
Applied egg-rr39.4%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6451.2
Applied egg-rr51.2%
div-invN/A
metadata-evalN/A
sqrt-divN/A
associate-*l/N/A
clear-numN/A
*-rgt-identityN/A
*-inversesN/A
times-fracN/A
sqrt-divN/A
sqrt-prodN/A
rem-square-sqrtN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6449.6
Applied egg-rr49.6%
if 0.0 < (/.f64 A (*.f64 V l)) < 9.9999999999999994e303Initial program 99.1%
Final simplification80.4%
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-304)
(* c0 (/ (sqrt (- A)) (sqrt (- (* V l)))))
(if (<= (* V l) 0.0)
(* c0 (/ (sqrt (* l (/ A V))) l))
(* 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 ((V * l) <= -5e-304) {
tmp = c0 * (sqrt(-A) / sqrt(-(V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((l * (A / V))) / l);
} 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 ((v * l) <= (-5d-304)) then
tmp = c0 * (sqrt(-a) / sqrt(-(v * l)))
else if ((v * l) <= 0.0d0) then
tmp = c0 * (sqrt((l * (a / v))) / l)
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 ((V * l) <= -5e-304) {
tmp = c0 * (Math.sqrt(-A) / Math.sqrt(-(V * l)));
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.sqrt((l * (A / V))) / l);
} 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 (V * l) <= -5e-304: tmp = c0 * (math.sqrt(-A) / math.sqrt(-(V * l))) elif (V * l) <= 0.0: tmp = c0 * (math.sqrt((l * (A / V))) / l) 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 (Float64(V * l) <= -5e-304) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / sqrt(Float64(-Float64(V * l))))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(l * Float64(A / V))) / l)); 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 ((V * l) <= -5e-304)
tmp = c0 * (sqrt(-A) / sqrt(-(V * l)));
elseif ((V * l) <= 0.0)
tmp = c0 * (sqrt((l * (A / V))) / l);
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[N[(V * l), $MachinePrecision], -5e-304], 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[(l * N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / l), $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}\;V \cdot \ell \leq -5 \cdot 10^{-304}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{-V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\ell \cdot \frac{A}{V}}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.99999999999999965e-304Initial program 80.5%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6480.5
Applied egg-rr80.5%
*-commutativeN/A
div-invN/A
frac-2negN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6489.7
Applied egg-rr89.7%
if -4.99999999999999965e-304 < (*.f64 V l) < -0.0Initial program 25.4%
Applied egg-rr20.9%
associate-/l*N/A
*-commutativeN/A
associate-/r*N/A
*-inversesN/A
div-invN/A
associate-/r*N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
metadata-evalN/A
pow-plusN/A
pow-flipN/A
pow1/2N/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr43.7%
if -0.0 < (*.f64 V l) Initial program 82.5%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6494.1
Applied egg-rr94.1%
Final simplification86.8%
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) -1e-276)
(/ c0 (sqrt (/ (* V l) A)))
(if (<= (* V l) 0.0)
(* c0 (/ (sqrt (* l (/ A V))) l))
(* 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 ((V * l) <= -1e-276) {
tmp = c0 / sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = c0 * (sqrt((l * (A / V))) / l);
} 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 ((v * l) <= (-1d-276)) then
tmp = c0 / sqrt(((v * l) / a))
else if ((v * l) <= 0.0d0) then
tmp = c0 * (sqrt((l * (a / v))) / l)
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 ((V * l) <= -1e-276) {
tmp = c0 / Math.sqrt(((V * l) / A));
} else if ((V * l) <= 0.0) {
tmp = c0 * (Math.sqrt((l * (A / V))) / l);
} 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 (V * l) <= -1e-276: tmp = c0 / math.sqrt(((V * l) / A)) elif (V * l) <= 0.0: tmp = c0 * (math.sqrt((l * (A / V))) / l) 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 (Float64(V * l) <= -1e-276) tmp = Float64(c0 / sqrt(Float64(Float64(V * l) / A))); elseif (Float64(V * l) <= 0.0) tmp = Float64(c0 * Float64(sqrt(Float64(l * Float64(A / V))) / l)); 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 ((V * l) <= -1e-276)
tmp = c0 / sqrt(((V * l) / A));
elseif ((V * l) <= 0.0)
tmp = c0 * (sqrt((l * (A / V))) / l);
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[N[(V * l), $MachinePrecision], -1e-276], N[(c0 / N[Sqrt[N[(N[(V * l), $MachinePrecision] / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 0.0], N[(c0 * N[(N[Sqrt[N[(l * N[(A / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / l), $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}\;V \cdot \ell \leq -1 \cdot 10^{-276}:\\
\;\;\;\;\frac{c0}{\sqrt{\frac{V \cdot \ell}{A}}}\\
\mathbf{elif}\;V \cdot \ell \leq 0:\\
\;\;\;\;c0 \cdot \frac{\sqrt{\ell \cdot \frac{A}{V}}}{\ell}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1e-276Initial program 81.3%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6481.2
Applied egg-rr81.2%
*-commutativeN/A
sqrt-prodN/A
pow1/2N/A
associate-*l*N/A
pow1/2N/A
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
sqrt-divN/A
metadata-evalN/A
div-invN/A
associate-/l/N/A
times-fracN/A
sqrt-divN/A
associate-/r/N/A
/-lowering-/.f64N/A
sqrt-undivN/A
sqrt-lowering-sqrt.f64N/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
/-lowering-/.f64N/A
Applied egg-rr82.0%
if -1e-276 < (*.f64 V l) < -0.0Initial program 24.6%
Applied egg-rr20.3%
associate-/l*N/A
*-commutativeN/A
associate-/r*N/A
*-inversesN/A
div-invN/A
associate-/r*N/A
sqrt-divN/A
pow1/2N/A
metadata-evalN/A
metadata-evalN/A
pow-plusN/A
pow-flipN/A
pow1/2N/A
associate-/r*N/A
/-lowering-/.f64N/A
Applied egg-rr42.3%
if -0.0 < (*.f64 V l) Initial program 82.5%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6494.1
Applied egg-rr94.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) -4e-184)
(* c0 (sqrt (/ A (* V l))))
(if (<= (* V l) 4e-300)
(/ c0 (sqrt (* V (/ l A))))
(* 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 ((V * l) <= -4e-184) {
tmp = c0 * sqrt((A / (V * l)));
} else if ((V * l) <= 4e-300) {
tmp = c0 / sqrt((V * (l / A)));
} 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 ((v * l) <= (-4d-184)) then
tmp = c0 * sqrt((a / (v * l)))
else if ((v * l) <= 4d-300) then
tmp = c0 / sqrt((v * (l / a)))
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 ((V * l) <= -4e-184) {
tmp = c0 * Math.sqrt((A / (V * l)));
} else if ((V * l) <= 4e-300) {
tmp = c0 / Math.sqrt((V * (l / A)));
} 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 (V * l) <= -4e-184: tmp = c0 * math.sqrt((A / (V * l))) elif (V * l) <= 4e-300: tmp = c0 / math.sqrt((V * (l / A))) 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 (Float64(V * l) <= -4e-184) tmp = Float64(c0 * sqrt(Float64(A / Float64(V * l)))); elseif (Float64(V * l) <= 4e-300) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); 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 ((V * l) <= -4e-184)
tmp = c0 * sqrt((A / (V * l)));
elseif ((V * l) <= 4e-300)
tmp = c0 / sqrt((V * (l / A)));
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[N[(V * l), $MachinePrecision], -4e-184], N[(c0 * N[Sqrt[N[(A / N[(V * l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(V * l), $MachinePrecision], 4e-300], N[(c0 / N[Sqrt[N[(V * N[(l / A), $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}\;V \cdot \ell \leq -4 \cdot 10^{-184}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}\\
\mathbf{elif}\;V \cdot \ell \leq 4 \cdot 10^{-300}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if (*.f64 V l) < -4.0000000000000002e-184Initial program 81.8%
if -4.0000000000000002e-184 < (*.f64 V l) < 4.0000000000000001e-300Initial program 43.7%
clear-numN/A
sqrt-divN/A
metadata-evalN/A
un-div-invN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
/-lowering-/.f6458.2
Applied egg-rr58.2%
if 4.0000000000000001e-300 < (*.f64 V l) Initial program 82.2%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6494.0
Applied egg-rr94.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 (<= A -5e-310) (* c0 (/ (sqrt (- A)) (* (sqrt (- V)) (sqrt l)))) (* 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 <= -5e-310) {
tmp = c0 * (sqrt(-A) / (sqrt(-V) * sqrt(l)));
} 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 <= (-5d-310)) then
tmp = c0 * (sqrt(-a) / (sqrt(-v) * sqrt(l)))
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 <= -5e-310) {
tmp = c0 * (Math.sqrt(-A) / (Math.sqrt(-V) * Math.sqrt(l)));
} 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 <= -5e-310: tmp = c0 * (math.sqrt(-A) / (math.sqrt(-V) * math.sqrt(l))) 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 <= -5e-310) tmp = Float64(c0 * Float64(sqrt(Float64(-A)) / Float64(sqrt(Float64(-V)) * sqrt(l)))); 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 <= -5e-310)
tmp = c0 * (sqrt(-A) / (sqrt(-V) * sqrt(l)));
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, -5e-310], N[(c0 * N[(N[Sqrt[(-A)], $MachinePrecision] / N[(N[Sqrt[(-V)], $MachinePrecision] * N[Sqrt[l], $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 -5 \cdot 10^{-310}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{-A}}{\sqrt{-V} \cdot \sqrt{\ell}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{V \cdot \ell}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 72.5%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6471.7
Applied egg-rr71.7%
*-commutativeN/A
div-invN/A
frac-2negN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f64N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f6480.5
Applied egg-rr80.5%
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
sqrt-prodN/A
pow1/2N/A
*-lowering-*.f64N/A
pow1/2N/A
sqrt-lowering-sqrt.f64N/A
neg-lowering-neg.f64N/A
sqrt-lowering-sqrt.f6451.8
Applied egg-rr51.8%
if -4.999999999999985e-310 < A Initial program 78.0%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
*-lowering-*.f6488.5
Applied egg-rr88.5%
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 75.5%
herbie shell --seed 2024205
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))