
(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 13 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 (<= (* l V) (- INFINITY))
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* l V) -4e-284)
(/ c0 (/ (sqrt (- 0.0 (fma V l 0.0))) (sqrt (- 0.0 A))))
(if (<= (* l V) 0.0)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(* c0 (/ (sqrt A) (sqrt (* l V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -((double) INFINITY)) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((l * V) <= -4e-284) {
tmp = c0 / (sqrt((0.0 - fma(V, l, 0.0))) / sqrt((0.0 - A)));
} else if ((l * V) <= 0.0) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= Float64(-Inf)) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(l * V) <= -4e-284) tmp = Float64(c0 / Float64(sqrt(Float64(0.0 - fma(V, l, 0.0))) / sqrt(Float64(0.0 - A)))); elseif (Float64(l * V) <= 0.0) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return 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[(l * V), $MachinePrecision], (-Infinity)], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -4e-284], N[(c0 / N[(N[Sqrt[N[(0.0 - N[(V * l + 0.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 0.0], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -\infty:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq -4 \cdot 10^{-284}:\\
\;\;\;\;\frac{c0}{\frac{\sqrt{0 - \mathsf{fma}\left(V, \ell, 0\right)}}{\sqrt{0 - A}}}\\
\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 41.9%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6441.9
Applied egg-rr41.9%
+-rgt-identityN/A
associate-*l/N/A
sqrt-divN/A
*-lft-identityN/A
pow1/2N/A
associate-*r/N/A
clear-numN/A
associate-/l/N/A
pow1/2N/A
sqrt-divN/A
associate-*r/N/A
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r/N/A
sqrt-lowering-sqrt.f64N/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
/-lowering-/.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6441.9
Applied egg-rr41.9%
sqrt-divN/A
+-rgt-identityN/A
sqrt-prodN/A
associate-*l/N/A
*-lowering-*.f64N/A
sqrt-undivN/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6443.7
Applied egg-rr43.7%
if -inf.0 < (*.f64 V l) < -4.00000000000000015e-284Initial program 85.7%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6485.8
Applied egg-rr85.8%
+-rgt-identityN/A
associate-*l/N/A
sqrt-divN/A
*-lft-identityN/A
pow1/2N/A
associate-*r/N/A
clear-numN/A
associate-/l/N/A
pow1/2N/A
sqrt-divN/A
associate-*r/N/A
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r/N/A
sqrt-lowering-sqrt.f64N/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
/-lowering-/.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6486.6
Applied egg-rr86.6%
frac-2negN/A
+-rgt-identityN/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f6499.6
Applied egg-rr99.6%
if -4.00000000000000015e-284 < (*.f64 V l) < -0.0Initial program 34.7%
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-/.f6450.1
Applied egg-rr50.1%
if -0.0 < (*.f64 V l) Initial program 81.5%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6492.0
Applied egg-rr92.0%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6492.0
Applied egg-rr92.0%
Final simplification86.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ A (* l V))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+263) (* 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 / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+263) {
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 / (l * v)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+263) 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 / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+263) {
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 / (l * V) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+263: 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(l * V)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+263) 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 / (l * V);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+263)
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[(l * V), $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+263], 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}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+263}:\\
\;\;\;\;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 43.7%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6459.1
Applied egg-rr59.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.00000000000000003e263Initial program 98.3%
if 2.00000000000000003e263 < (/.f64 A (*.f64 V l)) Initial program 48.5%
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-/.f6453.6
Applied egg-rr53.6%
Final simplification79.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 (/ A (* l V))))
(if (<= t_0 0.0)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= t_0 2e+263) (* c0 (sqrt t_0)) (* c0 (sqrt (/ (/ A l) V)))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * sqrt(((A / V) / l));
} else if (t_0 <= 2e+263) {
tmp = c0 * sqrt(t_0);
} else {
tmp = c0 * sqrt(((A / l) / V));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = a / (l * v)
if (t_0 <= 0.0d0) then
tmp = c0 * sqrt(((a / v) / l))
else if (t_0 <= 2d+263) then
tmp = c0 * sqrt(t_0)
else
tmp = c0 * sqrt(((a / l) / v))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double t_0 = A / (l * V);
double tmp;
if (t_0 <= 0.0) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if (t_0 <= 2e+263) {
tmp = c0 * Math.sqrt(t_0);
} else {
tmp = c0 * Math.sqrt(((A / l) / V));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): t_0 = A / (l * V) tmp = 0 if t_0 <= 0.0: tmp = c0 * math.sqrt(((A / V) / l)) elif t_0 <= 2e+263: tmp = c0 * math.sqrt(t_0) else: tmp = c0 * math.sqrt(((A / l) / V)) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(A / Float64(l * V)) tmp = 0.0 if (t_0 <= 0.0) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (t_0 <= 2e+263) tmp = Float64(c0 * sqrt(t_0)); else tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
t_0 = A / (l * V);
tmp = 0.0;
if (t_0 <= 0.0)
tmp = c0 * sqrt(((A / V) / l));
elseif (t_0 <= 2e+263)
tmp = c0 * sqrt(t_0);
else
tmp = c0 * sqrt(((A / l) / V));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
code[c0_, A_, V_, l_] := Block[{t$95$0 = N[(A / N[(l * V), $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+263], N[(c0 * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{A}{\ell \cdot V}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+263}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0Initial program 43.7%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6459.1
Applied egg-rr59.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 2.00000000000000003e263Initial program 98.3%
if 2.00000000000000003e263 < (/.f64 A (*.f64 V l)) Initial program 48.5%
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f6452.0
Applied egg-rr52.0%
Final simplification79.2%
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 (* l V))) (t_1 (* c0 (sqrt (/ (/ A V) l))))) (if (<= t_0 0.0) t_1 (if (<= t_0 5e+303) (* 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 / (l * V);
double t_1 = c0 * sqrt(((A / V) / l));
double tmp;
if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 5e+303) {
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 / (l * v)
t_1 = c0 * sqrt(((a / v) / l))
if (t_0 <= 0.0d0) then
tmp = t_1
else if (t_0 <= 5d+303) 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 / (l * V);
double t_1 = c0 * Math.sqrt(((A / V) / l));
double tmp;
if (t_0 <= 0.0) {
tmp = t_1;
} else if (t_0 <= 5e+303) {
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 / (l * V) t_1 = c0 * math.sqrt(((A / V) / l)) tmp = 0 if t_0 <= 0.0: tmp = t_1 elif t_0 <= 5e+303: 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(l * V)) t_1 = Float64(c0 * sqrt(Float64(Float64(A / V) / l))) tmp = 0.0 if (t_0 <= 0.0) tmp = t_1; elseif (t_0 <= 5e+303) 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 / (l * V);
t_1 = c0 * sqrt(((A / V) / l));
tmp = 0.0;
if (t_0 <= 0.0)
tmp = t_1;
elseif (t_0 <= 5e+303)
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[(l * V), $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, 5e+303], 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}{\ell \cdot V}\\
t_1 := c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{if}\;t\_0 \leq 0:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+303}:\\
\;\;\;\;c0 \cdot \sqrt{t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 A (*.f64 V l)) < 0.0 or 4.9999999999999997e303 < (/.f64 A (*.f64 V l)) Initial program 41.0%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6455.1
Applied egg-rr55.1%
if 0.0 < (/.f64 A (*.f64 V l)) < 4.9999999999999997e303Initial program 98.4%
Final simplification80.6%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) (- INFINITY))
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* l V) -4e-284)
(* (sqrt (- 0.0 A)) (/ c0 (sqrt (- 0.0 (fma V l 0.0)))))
(if (<= (* l V) 0.0)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(* c0 (/ (sqrt A) (sqrt (* l V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -((double) INFINITY)) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((l * V) <= -4e-284) {
tmp = sqrt((0.0 - A)) * (c0 / sqrt((0.0 - fma(V, l, 0.0))));
} else if ((l * V) <= 0.0) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= Float64(-Inf)) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(l * V) <= -4e-284) tmp = Float64(sqrt(Float64(0.0 - A)) * Float64(c0 / sqrt(Float64(0.0 - fma(V, l, 0.0))))); elseif (Float64(l * V) <= 0.0) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return 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[(l * V), $MachinePrecision], (-Infinity)], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -4e-284], N[(N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision] * N[(c0 / N[Sqrt[N[(0.0 - N[(V * l + 0.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 0.0], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -\infty:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq -4 \cdot 10^{-284}:\\
\;\;\;\;\sqrt{0 - A} \cdot \frac{c0}{\sqrt{0 - \mathsf{fma}\left(V, \ell, 0\right)}}\\
\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0Initial program 41.9%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6441.9
Applied egg-rr41.9%
+-rgt-identityN/A
associate-*l/N/A
sqrt-divN/A
*-lft-identityN/A
pow1/2N/A
associate-*r/N/A
clear-numN/A
associate-/l/N/A
pow1/2N/A
sqrt-divN/A
associate-*r/N/A
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r/N/A
sqrt-lowering-sqrt.f64N/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
/-lowering-/.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6441.9
Applied egg-rr41.9%
sqrt-divN/A
+-rgt-identityN/A
sqrt-prodN/A
associate-*l/N/A
*-lowering-*.f64N/A
sqrt-undivN/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6443.7
Applied egg-rr43.7%
if -inf.0 < (*.f64 V l) < -4.00000000000000015e-284Initial program 85.7%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6485.8
Applied egg-rr85.8%
+-rgt-identityN/A
associate-*l/N/A
sqrt-divN/A
*-lft-identityN/A
pow1/2N/A
associate-*r/N/A
clear-numN/A
associate-/l/N/A
pow1/2N/A
sqrt-divN/A
associate-*r/N/A
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r/N/A
sqrt-lowering-sqrt.f64N/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
/-lowering-/.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6486.6
Applied egg-rr86.6%
frac-2negN/A
+-rgt-identityN/A
sqrt-divN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f6499.5
Applied egg-rr99.5%
if -4.00000000000000015e-284 < (*.f64 V l) < -0.0Initial program 34.7%
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-/.f6450.1
Applied egg-rr50.1%
if -0.0 < (*.f64 V l) Initial program 81.5%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6492.0
Applied egg-rr92.0%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6492.0
Applied egg-rr92.0%
Final simplification86.3%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (/ c0 (* (sqrt l) (sqrt (/ V A))))))
(if (<= (* l V) (- INFINITY))
t_0
(if (<= (* l V) -5e-244)
(* c0 (/ (sqrt (- 0.0 A)) (sqrt (- 0.0 (fma V l 0.0)))))
(if (<= (* l V) 0.0) t_0 (* c0 (/ (sqrt A) (sqrt (* l V)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = c0 / (sqrt(l) * sqrt((V / A)));
double tmp;
if ((l * V) <= -((double) INFINITY)) {
tmp = t_0;
} else if ((l * V) <= -5e-244) {
tmp = c0 * (sqrt((0.0 - A)) / sqrt((0.0 - fma(V, l, 0.0))));
} else if ((l * V) <= 0.0) {
tmp = t_0;
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))) tmp = 0.0 if (Float64(l * V) <= Float64(-Inf)) tmp = t_0; elseif (Float64(l * V) <= -5e-244) tmp = Float64(c0 * Float64(sqrt(Float64(0.0 - A)) / sqrt(Float64(0.0 - fma(V, l, 0.0))))); elseif (Float64(l * V) <= 0.0) tmp = t_0; else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return 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[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(l * V), $MachinePrecision], (-Infinity)], t$95$0, If[LessEqual[N[(l * V), $MachinePrecision], -5e-244], N[(c0 * N[(N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision] / N[Sqrt[N[(0.0 - N[(V * l + 0.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 0.0], t$95$0, N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{if}\;\ell \cdot V \leq -\infty:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \cdot V \leq -5 \cdot 10^{-244}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{0 - A}}{\sqrt{0 - \mathsf{fma}\left(V, \ell, 0\right)}}\\
\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -inf.0 or -4.99999999999999998e-244 < (*.f64 V l) < -0.0Initial program 37.4%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6436.8
Applied egg-rr36.8%
+-rgt-identityN/A
associate-*l/N/A
sqrt-divN/A
*-lft-identityN/A
pow1/2N/A
associate-*r/N/A
clear-numN/A
associate-/l/N/A
pow1/2N/A
sqrt-divN/A
associate-*r/N/A
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r/N/A
sqrt-lowering-sqrt.f64N/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
/-lowering-/.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6437.4
Applied egg-rr37.4%
sqrt-divN/A
+-rgt-identityN/A
sqrt-prodN/A
associate-*l/N/A
*-lowering-*.f64N/A
sqrt-undivN/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6446.2
Applied egg-rr46.2%
if -inf.0 < (*.f64 V l) < -4.99999999999999998e-244Initial program 86.6%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6486.6
Applied egg-rr86.6%
frac-2negN/A
metadata-evalN/A
associate-*l/N/A
neg-mul-1N/A
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
+-rgt-identityN/A
neg-sub0N/A
--lowering--.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6499.4
Applied egg-rr99.4%
if -0.0 < (*.f64 V l) Initial program 81.5%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6492.0
Applied egg-rr92.0%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6492.0
Applied egg-rr92.0%
Final simplification85.9%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(if (<= (* l V) -2e+164)
(/ c0 (* (sqrt l) (sqrt (/ V A))))
(if (<= (* l V) -4e-210)
(/ c0 (sqrt (* (fma V l 0.0) (/ 1.0 A))))
(if (<= (* l V) 0.0)
(* (/ c0 (sqrt l)) (sqrt (/ A V)))
(* c0 (/ (sqrt A) (sqrt (* l V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -2e+164) {
tmp = c0 / (sqrt(l) * sqrt((V / A)));
} else if ((l * V) <= -4e-210) {
tmp = c0 / sqrt((fma(V, l, 0.0) * (1.0 / A)));
} else if ((l * V) <= 0.0) {
tmp = (c0 / sqrt(l)) * sqrt((A / V));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= -2e+164) tmp = Float64(c0 / Float64(sqrt(l) * sqrt(Float64(V / A)))); elseif (Float64(l * V) <= -4e-210) tmp = Float64(c0 / sqrt(Float64(fma(V, l, 0.0) * Float64(1.0 / A)))); elseif (Float64(l * V) <= 0.0) tmp = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return 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[(l * V), $MachinePrecision], -2e+164], N[(c0 / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[N[(V / A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -4e-210], N[(c0 / N[Sqrt[N[(N[(V * l + 0.0), $MachinePrecision] * N[(1.0 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 0.0], N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -2 \cdot 10^{+164}:\\
\;\;\;\;\frac{c0}{\sqrt{\ell} \cdot \sqrt{\frac{V}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq -4 \cdot 10^{-210}:\\
\;\;\;\;\frac{c0}{\sqrt{\mathsf{fma}\left(V, \ell, 0\right) \cdot \frac{1}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;\frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2e164Initial program 58.8%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6458.8
Applied egg-rr58.8%
+-rgt-identityN/A
associate-*l/N/A
sqrt-divN/A
*-lft-identityN/A
pow1/2N/A
associate-*r/N/A
clear-numN/A
associate-/l/N/A
pow1/2N/A
sqrt-divN/A
associate-*r/N/A
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r/N/A
sqrt-lowering-sqrt.f64N/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
/-lowering-/.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6458.8
Applied egg-rr58.8%
sqrt-divN/A
+-rgt-identityN/A
sqrt-prodN/A
associate-*l/N/A
*-lowering-*.f64N/A
sqrt-undivN/A
sqrt-lowering-sqrt.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f6459.0
Applied egg-rr59.0%
if -2e164 < (*.f64 V l) < -4.0000000000000002e-210Initial program 92.1%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6492.1
Applied egg-rr92.1%
+-rgt-identityN/A
associate-*l/N/A
sqrt-divN/A
*-lft-identityN/A
pow1/2N/A
associate-*r/N/A
clear-numN/A
associate-/l/N/A
pow1/2N/A
sqrt-divN/A
associate-*r/N/A
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r/N/A
sqrt-lowering-sqrt.f64N/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
/-lowering-/.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6493.3
Applied egg-rr93.3%
div-invN/A
+-rgt-identityN/A
*-lowering-*.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6493.4
Applied egg-rr93.4%
if -4.0000000000000002e-210 < (*.f64 V l) < -0.0Initial program 40.5%
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-/.f6442.9
Applied egg-rr42.9%
if -0.0 < (*.f64 V l) Initial program 81.5%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6492.0
Applied egg-rr92.0%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6492.0
Applied egg-rr92.0%
Final simplification80.0%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
(FPCore (c0 A V l)
:precision binary64
(let* ((t_0 (* (/ c0 (sqrt l)) (sqrt (/ A V)))))
(if (<= (* l V) -2e+164)
t_0
(if (<= (* l V) -4e-210)
(/ c0 (sqrt (* (fma V l 0.0) (/ 1.0 A))))
(if (<= (* l V) 0.0) t_0 (* c0 (/ (sqrt A) (sqrt (* l V)))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double t_0 = (c0 / sqrt(l)) * sqrt((A / V));
double tmp;
if ((l * V) <= -2e+164) {
tmp = t_0;
} else if ((l * V) <= -4e-210) {
tmp = c0 / sqrt((fma(V, l, 0.0) * (1.0 / A)));
} else if ((l * V) <= 0.0) {
tmp = t_0;
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) t_0 = Float64(Float64(c0 / sqrt(l)) * sqrt(Float64(A / V))) tmp = 0.0 if (Float64(l * V) <= -2e+164) tmp = t_0; elseif (Float64(l * V) <= -4e-210) tmp = Float64(c0 / sqrt(Float64(fma(V, l, 0.0) * Float64(1.0 / A)))); elseif (Float64(l * V) <= 0.0) tmp = t_0; else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return 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[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(A / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(l * V), $MachinePrecision], -2e+164], t$95$0, If[LessEqual[N[(l * V), $MachinePrecision], -4e-210], N[(c0 / N[Sqrt[N[(N[(V * l + 0.0), $MachinePrecision] * N[(1.0 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 0.0], t$95$0, N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
t_0 := \frac{c0}{\sqrt{\ell}} \cdot \sqrt{\frac{A}{V}}\\
\mathbf{if}\;\ell \cdot V \leq -2 \cdot 10^{+164}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \cdot V \leq -4 \cdot 10^{-210}:\\
\;\;\;\;\frac{c0}{\sqrt{\mathsf{fma}\left(V, \ell, 0\right) \cdot \frac{1}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -2e164 or -4.0000000000000002e-210 < (*.f64 V l) < -0.0Initial program 50.7%
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-/.f6451.8
Applied egg-rr51.8%
if -2e164 < (*.f64 V l) < -4.0000000000000002e-210Initial program 92.1%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6492.1
Applied egg-rr92.1%
+-rgt-identityN/A
associate-*l/N/A
sqrt-divN/A
*-lft-identityN/A
pow1/2N/A
associate-*r/N/A
clear-numN/A
associate-/l/N/A
pow1/2N/A
sqrt-divN/A
associate-*r/N/A
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r/N/A
sqrt-lowering-sqrt.f64N/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
/-lowering-/.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6493.3
Applied egg-rr93.3%
div-invN/A
+-rgt-identityN/A
*-lowering-*.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6493.4
Applied egg-rr93.4%
if -0.0 < (*.f64 V l) Initial program 81.5%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6492.0
Applied egg-rr92.0%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6492.0
Applied egg-rr92.0%
Final simplification80.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 (<= (* l V) -1e+191)
(* c0 (sqrt (* (/ A l) (/ 1.0 V))))
(if (<= (* l V) -2e-189)
(/ c0 (sqrt (* (fma V l 0.0) (/ 1.0 A))))
(if (<= (* l V) 5e-309)
(* c0 (sqrt (/ (/ A l) V)))
(* c0 (/ (sqrt A) (sqrt (* l V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -1e+191) {
tmp = c0 * sqrt(((A / l) * (1.0 / V)));
} else if ((l * V) <= -2e-189) {
tmp = c0 / sqrt((fma(V, l, 0.0) * (1.0 / A)));
} else if ((l * V) <= 5e-309) {
tmp = c0 * sqrt(((A / l) / V));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= -1e+191) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) * Float64(1.0 / V)))); elseif (Float64(l * V) <= -2e-189) tmp = Float64(c0 / sqrt(Float64(fma(V, l, 0.0) * Float64(1.0 / A)))); elseif (Float64(l * V) <= 5e-309) tmp = Float64(c0 * sqrt(Float64(Float64(A / l) / V))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return 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[(l * V), $MachinePrecision], -1e+191], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] * N[(1.0 / V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -2e-189], N[(c0 / N[Sqrt[N[(N[(V * l + 0.0), $MachinePrecision] * N[(1.0 / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 5e-309], N[(c0 * N[Sqrt[N[(N[(A / l), $MachinePrecision] / V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -1 \cdot 10^{+191}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{A}{\ell} \cdot \frac{1}{V}}\\
\mathbf{elif}\;\ell \cdot V \leq -2 \cdot 10^{-189}:\\
\;\;\;\;\frac{c0}{\sqrt{\mathsf{fma}\left(V, \ell, 0\right) \cdot \frac{1}{A}}}\\
\mathbf{elif}\;\ell \cdot V \leq 5 \cdot 10^{-309}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{\ell}}{V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.00000000000000007e191Initial program 59.8%
associate-/l/N/A
div-invN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
/-lowering-/.f6473.5
Applied egg-rr73.5%
if -1.00000000000000007e191 < (*.f64 V l) < -2.00000000000000014e-189Initial program 88.5%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6488.5
Applied egg-rr88.5%
+-rgt-identityN/A
associate-*l/N/A
sqrt-divN/A
*-lft-identityN/A
pow1/2N/A
associate-*r/N/A
clear-numN/A
associate-/l/N/A
pow1/2N/A
sqrt-divN/A
associate-*r/N/A
clear-numN/A
/-lowering-/.f64N/A
*-commutativeN/A
associate-/r/N/A
sqrt-lowering-sqrt.f64N/A
associate-/r/N/A
associate-*l/N/A
*-commutativeN/A
/-lowering-/.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f6489.6
Applied egg-rr89.6%
div-invN/A
+-rgt-identityN/A
*-lowering-*.f64N/A
+-rgt-identityN/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6489.7
Applied egg-rr89.7%
if -2.00000000000000014e-189 < (*.f64 V l) < 4.9999999999999995e-309Initial program 47.9%
associate-/l/N/A
/-lowering-/.f64N/A
/-lowering-/.f6461.7
Applied egg-rr61.7%
if 4.9999999999999995e-309 < (*.f64 V l) Initial program 81.2%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6491.9
Applied egg-rr91.9%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6491.9
Applied egg-rr91.9%
Final simplification83.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 (<= (* l V) -2e+228)
(* c0 (sqrt (/ (/ A V) l)))
(if (<= (* l V) -2e-91)
(* c0 (sqrt (* A (/ 1.0 (* l V)))))
(if (<= (* l V) 1e-272)
(/ c0 (sqrt (* V (/ l A))))
(* c0 (/ (sqrt A) (sqrt (* l V))))))))assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -2e+228) {
tmp = c0 * sqrt(((A / V) / l));
} else if ((l * V) <= -2e-91) {
tmp = c0 * sqrt((A * (1.0 / (l * V))));
} else if ((l * V) <= 1e-272) {
tmp = c0 / sqrt((V * (l / A)));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if ((l * v) <= (-2d+228)) then
tmp = c0 * sqrt(((a / v) / l))
else if ((l * v) <= (-2d-91)) then
tmp = c0 * sqrt((a * (1.0d0 / (l * v))))
else if ((l * v) <= 1d-272) then
tmp = c0 / sqrt((v * (l / a)))
else
tmp = c0 * (sqrt(a) / sqrt((l * v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if ((l * V) <= -2e+228) {
tmp = c0 * Math.sqrt(((A / V) / l));
} else if ((l * V) <= -2e-91) {
tmp = c0 * Math.sqrt((A * (1.0 / (l * V))));
} else if ((l * V) <= 1e-272) {
tmp = c0 / Math.sqrt((V * (l / A)));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if (l * V) <= -2e+228: tmp = c0 * math.sqrt(((A / V) / l)) elif (l * V) <= -2e-91: tmp = c0 * math.sqrt((A * (1.0 / (l * V)))) elif (l * V) <= 1e-272: tmp = c0 / math.sqrt((V * (l / A))) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) return tmp
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) tmp = 0.0 if (Float64(l * V) <= -2e+228) tmp = Float64(c0 * sqrt(Float64(Float64(A / V) / l))); elseif (Float64(l * V) <= -2e-91) tmp = Float64(c0 * sqrt(Float64(A * Float64(1.0 / Float64(l * V))))); elseif (Float64(l * V) <= 1e-272) tmp = Float64(c0 / sqrt(Float64(V * Float64(l / A)))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if ((l * V) <= -2e+228)
tmp = c0 * sqrt(((A / V) / l));
elseif ((l * V) <= -2e-91)
tmp = c0 * sqrt((A * (1.0 / (l * V))));
elseif ((l * V) <= 1e-272)
tmp = c0 / sqrt((V * (l / A)));
else
tmp = c0 * (sqrt(A) / sqrt((l * V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[N[(l * V), $MachinePrecision], -2e+228], N[(c0 * N[Sqrt[N[(N[(A / V), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], -2e-91], N[(c0 * N[Sqrt[N[(A * N[(1.0 / N[(l * V), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(l * V), $MachinePrecision], 1e-272], N[(c0 / N[Sqrt[N[(V * N[(l / A), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \cdot V \leq -2 \cdot 10^{+228}:\\
\;\;\;\;c0 \cdot \sqrt{\frac{\frac{A}{V}}{\ell}}\\
\mathbf{elif}\;\ell \cdot V \leq -2 \cdot 10^{-91}:\\
\;\;\;\;c0 \cdot \sqrt{A \cdot \frac{1}{\ell \cdot V}}\\
\mathbf{elif}\;\ell \cdot V \leq 10^{-272}:\\
\;\;\;\;\frac{c0}{\sqrt{V \cdot \frac{\ell}{A}}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if (*.f64 V l) < -1.9999999999999998e228Initial program 47.3%
associate-/r*N/A
/-lowering-/.f64N/A
/-lowering-/.f6468.6
Applied egg-rr68.6%
if -1.9999999999999998e228 < (*.f64 V l) < -2.00000000000000004e-91Initial program 91.7%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6491.8
Applied egg-rr91.8%
Taylor expanded in V around 0
/-lowering-/.f64N/A
*-lowering-*.f6491.8
Simplified91.8%
if -2.00000000000000004e-91 < (*.f64 V l) < 9.9999999999999993e-273Initial program 58.9%
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-/.f6467.7
Applied egg-rr67.7%
if 9.9999999999999993e-273 < (*.f64 V l) Initial program 81.1%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6491.8
Applied egg-rr91.8%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6491.8
Applied egg-rr91.8%
Final simplification83.7%
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 l)) (sqrt (- 0.0 A))) (sqrt (- 0.0 V))) (* c0 (/ (sqrt A) (sqrt (* l V))))))
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(l)) * sqrt((0.0 - A))) / sqrt((0.0 - V));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-5d-310)) then
tmp = ((c0 / sqrt(l)) * sqrt((0.0d0 - a))) / sqrt((0.0d0 - v))
else
tmp = c0 * (sqrt(a) / sqrt((l * v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = ((c0 / Math.sqrt(l)) * Math.sqrt((0.0 - A))) / Math.sqrt((0.0 - V));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
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(l)) * math.sqrt((0.0 - A))) / math.sqrt((0.0 - V)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) 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(Float64(c0 / sqrt(l)) * sqrt(Float64(0.0 - A))) / sqrt(Float64(0.0 - V))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -5e-310)
tmp = ((c0 / sqrt(l)) * sqrt((0.0 - A))) / sqrt((0.0 - V));
else
tmp = c0 * (sqrt(A) / sqrt((l * V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -5e-310], N[(N[(N[(c0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(0.0 - V), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $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{\frac{c0}{\sqrt{\ell}} \cdot \sqrt{0 - A}}{\sqrt{0 - V}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 72.0%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6471.8
Applied egg-rr71.8%
*-commutativeN/A
+-rgt-identityN/A
div-invN/A
associate-/r*N/A
sqrt-divN/A
associate-*r/N/A
associate-*l/N/A
frac-2negN/A
sqrt-divN/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f6444.6
Applied egg-rr44.6%
if -4.999999999999985e-310 < A Initial program 78.1%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6487.7
Applied egg-rr87.7%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6487.7
Applied egg-rr87.7%
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) (/ (sqrt (- 0.0 A)) (* (sqrt (- 0.0 V)) (/ (sqrt l) c0))) (* c0 (/ (sqrt A) (sqrt (* l V))))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = sqrt((0.0 - A)) / (sqrt((0.0 - V)) * (sqrt(l) / c0));
} else {
tmp = c0 * (sqrt(A) / sqrt((l * V)));
}
return tmp;
}
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function.
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: tmp
if (a <= (-5d-310)) then
tmp = sqrt((0.0d0 - a)) / (sqrt((0.0d0 - v)) * (sqrt(l) / c0))
else
tmp = c0 * (sqrt(a) / sqrt((l * v)))
end if
code = tmp
end function
assert c0 < A && A < V && V < l;
public static double code(double c0, double A, double V, double l) {
double tmp;
if (A <= -5e-310) {
tmp = Math.sqrt((0.0 - A)) / (Math.sqrt((0.0 - V)) * (Math.sqrt(l) / c0));
} else {
tmp = c0 * (Math.sqrt(A) / Math.sqrt((l * V)));
}
return tmp;
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): tmp = 0 if A <= -5e-310: tmp = math.sqrt((0.0 - A)) / (math.sqrt((0.0 - V)) * (math.sqrt(l) / c0)) else: tmp = c0 * (math.sqrt(A) / math.sqrt((l * V))) 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(sqrt(Float64(0.0 - A)) / Float64(sqrt(Float64(0.0 - V)) * Float64(sqrt(l) / c0))); else tmp = Float64(c0 * Float64(sqrt(A) / sqrt(Float64(l * V)))); end return tmp end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp_2 = code(c0, A, V, l)
tmp = 0.0;
if (A <= -5e-310)
tmp = sqrt((0.0 - A)) / (sqrt((0.0 - V)) * (sqrt(l) / c0));
else
tmp = c0 * (sqrt(A) / sqrt((l * V)));
end
tmp_2 = tmp;
end
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. code[c0_, A_, V_, l_] := If[LessEqual[A, -5e-310], N[(N[Sqrt[N[(0.0 - A), $MachinePrecision]], $MachinePrecision] / N[(N[Sqrt[N[(0.0 - V), $MachinePrecision]], $MachinePrecision] * N[(N[Sqrt[l], $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Sqrt[A], $MachinePrecision] / N[Sqrt[N[(l * V), $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{\sqrt{0 - A}}{\sqrt{0 - V} \cdot \frac{\sqrt{\ell}}{c0}}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\sqrt{A}}{\sqrt{\ell \cdot V}}\\
\end{array}
\end{array}
if A < -4.999999999999985e-310Initial program 72.0%
clear-numN/A
associate-/r/N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6471.8
Applied egg-rr71.8%
*-commutativeN/A
*-commutativeN/A
+-rgt-identityN/A
div-invN/A
associate-/r*N/A
sqrt-divN/A
associate-/r/N/A
frac-2negN/A
sqrt-divN/A
associate-/l/N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
neg-sub0N/A
--lowering--.f6445.1
Applied egg-rr45.1%
if -4.999999999999985e-310 < A Initial program 78.1%
sqrt-divN/A
/-lowering-/.f64N/A
sqrt-lowering-sqrt.f64N/A
sqrt-lowering-sqrt.f64N/A
+-lft-identityN/A
+-commutativeN/A
accelerator-lowering-fma.f6487.7
Applied egg-rr87.7%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f6487.7
Applied egg-rr87.7%
Final simplification64.8%
NOTE: c0, A, V, and l should be sorted in increasing order before calling this function. (FPCore (c0 A V l) :precision binary64 (* c0 (sqrt (/ A (* l V)))))
assert(c0 < A && A < V && V < l);
double code(double c0, double A, double V, double l) {
return c0 * sqrt((A / (l * V)));
}
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 / (l * v)))
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 / (l * V)));
}
[c0, A, V, l] = sort([c0, A, V, l]) def code(c0, A, V, l): return c0 * math.sqrt((A / (l * V)))
c0, A, V, l = sort([c0, A, V, l]) function code(c0, A, V, l) return Float64(c0 * sqrt(Float64(A / Float64(l * V)))) end
c0, A, V, l = num2cell(sort([c0, A, V, l])){:}
function tmp = code(c0, A, V, l)
tmp = c0 * sqrt((A / (l * V)));
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[(l * V), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[c0, A, V, l] = \mathsf{sort}([c0, A, V, l])\\
\\
c0 \cdot \sqrt{\frac{A}{\ell \cdot V}}
\end{array}
Initial program 74.8%
Final simplification74.8%
herbie shell --seed 2024196
(FPCore (c0 A V l)
:name "Henrywood and Agarwal, Equation (3)"
:precision binary64
(* c0 (sqrt (/ A (* V l)))))