
(FPCore (a1 a2 th) :precision binary64 (let* ((t_1 (/ (cos th) (sqrt 2.0)))) (+ (* t_1 (* a1 a1)) (* t_1 (* a2 a2)))))
double code(double a1, double a2, double th) {
double t_1 = cos(th) / sqrt(2.0);
return (t_1 * (a1 * a1)) + (t_1 * (a2 * a2));
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: t_1
t_1 = cos(th) / sqrt(2.0d0)
code = (t_1 * (a1 * a1)) + (t_1 * (a2 * a2))
end function
public static double code(double a1, double a2, double th) {
double t_1 = Math.cos(th) / Math.sqrt(2.0);
return (t_1 * (a1 * a1)) + (t_1 * (a2 * a2));
}
def code(a1, a2, th): t_1 = math.cos(th) / math.sqrt(2.0) return (t_1 * (a1 * a1)) + (t_1 * (a2 * a2))
function code(a1, a2, th) t_1 = Float64(cos(th) / sqrt(2.0)) return Float64(Float64(t_1 * Float64(a1 * a1)) + Float64(t_1 * Float64(a2 * a2))) end
function tmp = code(a1, a2, th) t_1 = cos(th) / sqrt(2.0); tmp = (t_1 * (a1 * a1)) + (t_1 * (a2 * a2)); end
code[a1_, a2_, th_] := Block[{t$95$1 = N[(N[Cos[th], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, N[(N[(t$95$1 * N[(a1 * a1), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(a2 * a2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\cos th}{\sqrt{2}}\\
t_1 \cdot \left(a1 \cdot a1\right) + t_1 \cdot \left(a2 \cdot a2\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a1 a2 th) :precision binary64 (let* ((t_1 (/ (cos th) (sqrt 2.0)))) (+ (* t_1 (* a1 a1)) (* t_1 (* a2 a2)))))
double code(double a1, double a2, double th) {
double t_1 = cos(th) / sqrt(2.0);
return (t_1 * (a1 * a1)) + (t_1 * (a2 * a2));
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: t_1
t_1 = cos(th) / sqrt(2.0d0)
code = (t_1 * (a1 * a1)) + (t_1 * (a2 * a2))
end function
public static double code(double a1, double a2, double th) {
double t_1 = Math.cos(th) / Math.sqrt(2.0);
return (t_1 * (a1 * a1)) + (t_1 * (a2 * a2));
}
def code(a1, a2, th): t_1 = math.cos(th) / math.sqrt(2.0) return (t_1 * (a1 * a1)) + (t_1 * (a2 * a2))
function code(a1, a2, th) t_1 = Float64(cos(th) / sqrt(2.0)) return Float64(Float64(t_1 * Float64(a1 * a1)) + Float64(t_1 * Float64(a2 * a2))) end
function tmp = code(a1, a2, th) t_1 = cos(th) / sqrt(2.0); tmp = (t_1 * (a1 * a1)) + (t_1 * (a2 * a2)); end
code[a1_, a2_, th_] := Block[{t$95$1 = N[(N[Cos[th], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, N[(N[(t$95$1 * N[(a1 * a1), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[(a2 * a2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\cos th}{\sqrt{2}}\\
t_1 \cdot \left(a1 \cdot a1\right) + t_1 \cdot \left(a2 \cdot a2\right)
\end{array}
\end{array}
a1_m = (fabs.f64 a1) NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. (FPCore (a1_m a2 th) :precision binary64 (let* ((t_1 (/ (cos th) (sqrt 2.0)))) (fma (* t_1 a2) a2 (* t_1 (pow a1_m 2.0)))))
a1_m = fabs(a1);
assert(a1_m < a2 && a2 < th);
double code(double a1_m, double a2, double th) {
double t_1 = cos(th) / sqrt(2.0);
return fma((t_1 * a2), a2, (t_1 * pow(a1_m, 2.0)));
}
a1_m = abs(a1) a1_m, a2, th = sort([a1_m, a2, th]) function code(a1_m, a2, th) t_1 = Float64(cos(th) / sqrt(2.0)) return fma(Float64(t_1 * a2), a2, Float64(t_1 * (a1_m ^ 2.0))) end
a1_m = N[Abs[a1], $MachinePrecision]
NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function.
code[a1$95$m_, a2_, th_] := Block[{t$95$1 = N[(N[Cos[th], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]}, N[(N[(t$95$1 * a2), $MachinePrecision] * a2 + N[(t$95$1 * N[Power[a1$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a1_m = \left|a1\right|
\\
[a1_m, a2, th] = \mathsf{sort}([a1_m, a2, th])\\
\\
\begin{array}{l}
t_1 := \frac{\cos th}{\sqrt{2}}\\
\mathsf{fma}\left(t_1 \cdot a2, a2, t_1 \cdot {a1_m}^{2}\right)
\end{array}
\end{array}
a1_m = (fabs.f64 a1) NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. (FPCore (a1_m a2 th) :precision binary64 (* (cos th) (/ (pow (hypot a1_m a2) 2.0) (sqrt 2.0))))
a1_m = fabs(a1);
assert(a1_m < a2 && a2 < th);
double code(double a1_m, double a2, double th) {
return cos(th) * (pow(hypot(a1_m, a2), 2.0) / sqrt(2.0));
}
a1_m = Math.abs(a1);
assert a1_m < a2 && a2 < th;
public static double code(double a1_m, double a2, double th) {
return Math.cos(th) * (Math.pow(Math.hypot(a1_m, a2), 2.0) / Math.sqrt(2.0));
}
a1_m = math.fabs(a1) [a1_m, a2, th] = sort([a1_m, a2, th]) def code(a1_m, a2, th): return math.cos(th) * (math.pow(math.hypot(a1_m, a2), 2.0) / math.sqrt(2.0))
a1_m = abs(a1) a1_m, a2, th = sort([a1_m, a2, th]) function code(a1_m, a2, th) return Float64(cos(th) * Float64((hypot(a1_m, a2) ^ 2.0) / sqrt(2.0))) end
a1_m = abs(a1);
a1_m, a2, th = num2cell(sort([a1_m, a2, th])){:}
function tmp = code(a1_m, a2, th)
tmp = cos(th) * ((hypot(a1_m, a2) ^ 2.0) / sqrt(2.0));
end
a1_m = N[Abs[a1], $MachinePrecision] NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. code[a1$95$m_, a2_, th_] := N[(N[Cos[th], $MachinePrecision] * N[(N[Power[N[Sqrt[a1$95$m ^ 2 + a2 ^ 2], $MachinePrecision], 2.0], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a1_m = \left|a1\right|
\\
[a1_m, a2, th] = \mathsf{sort}([a1_m, a2, th])\\
\\
\cos th \cdot \frac{{\left(\mathsf{hypot}\left(a1_m, a2\right)\right)}^{2}}{\sqrt{2}}
\end{array}
a1_m = (fabs.f64 a1) NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. (FPCore (a1_m a2 th) :precision binary64 (/ (cos th) (* (sqrt 2.0) (pow (hypot a1_m a2) -2.0))))
a1_m = fabs(a1);
assert(a1_m < a2 && a2 < th);
double code(double a1_m, double a2, double th) {
return cos(th) / (sqrt(2.0) * pow(hypot(a1_m, a2), -2.0));
}
a1_m = Math.abs(a1);
assert a1_m < a2 && a2 < th;
public static double code(double a1_m, double a2, double th) {
return Math.cos(th) / (Math.sqrt(2.0) * Math.pow(Math.hypot(a1_m, a2), -2.0));
}
a1_m = math.fabs(a1) [a1_m, a2, th] = sort([a1_m, a2, th]) def code(a1_m, a2, th): return math.cos(th) / (math.sqrt(2.0) * math.pow(math.hypot(a1_m, a2), -2.0))
a1_m = abs(a1) a1_m, a2, th = sort([a1_m, a2, th]) function code(a1_m, a2, th) return Float64(cos(th) / Float64(sqrt(2.0) * (hypot(a1_m, a2) ^ -2.0))) end
a1_m = abs(a1);
a1_m, a2, th = num2cell(sort([a1_m, a2, th])){:}
function tmp = code(a1_m, a2, th)
tmp = cos(th) / (sqrt(2.0) * (hypot(a1_m, a2) ^ -2.0));
end
a1_m = N[Abs[a1], $MachinePrecision] NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. code[a1$95$m_, a2_, th_] := N[(N[Cos[th], $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] * N[Power[N[Sqrt[a1$95$m ^ 2 + a2 ^ 2], $MachinePrecision], -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a1_m = \left|a1\right|
\\
[a1_m, a2, th] = \mathsf{sort}([a1_m, a2, th])\\
\\
\frac{\cos th}{\sqrt{2} \cdot {\left(\mathsf{hypot}\left(a1_m, a2\right)\right)}^{-2}}
\end{array}
a1_m = (fabs.f64 a1) NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. (FPCore (a1_m a2 th) :precision binary64 (if (<= (cos th) 0.7) (* (cos th) (* (+ a2 a1_m) (+ a2 a1_m))) (* (+ (* a1_m a1_m) (* a2 a2)) (pow 0.25 0.25))))
a1_m = fabs(a1);
assert(a1_m < a2 && a2 < th);
double code(double a1_m, double a2, double th) {
double tmp;
if (cos(th) <= 0.7) {
tmp = cos(th) * ((a2 + a1_m) * (a2 + a1_m));
} else {
tmp = ((a1_m * a1_m) + (a2 * a2)) * pow(0.25, 0.25);
}
return tmp;
}
a1_m = abs(a1)
NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function.
real(8) function code(a1_m, a2, th)
real(8), intent (in) :: a1_m
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: tmp
if (cos(th) <= 0.7d0) then
tmp = cos(th) * ((a2 + a1_m) * (a2 + a1_m))
else
tmp = ((a1_m * a1_m) + (a2 * a2)) * (0.25d0 ** 0.25d0)
end if
code = tmp
end function
a1_m = Math.abs(a1);
assert a1_m < a2 && a2 < th;
public static double code(double a1_m, double a2, double th) {
double tmp;
if (Math.cos(th) <= 0.7) {
tmp = Math.cos(th) * ((a2 + a1_m) * (a2 + a1_m));
} else {
tmp = ((a1_m * a1_m) + (a2 * a2)) * Math.pow(0.25, 0.25);
}
return tmp;
}
a1_m = math.fabs(a1) [a1_m, a2, th] = sort([a1_m, a2, th]) def code(a1_m, a2, th): tmp = 0 if math.cos(th) <= 0.7: tmp = math.cos(th) * ((a2 + a1_m) * (a2 + a1_m)) else: tmp = ((a1_m * a1_m) + (a2 * a2)) * math.pow(0.25, 0.25) return tmp
a1_m = abs(a1) a1_m, a2, th = sort([a1_m, a2, th]) function code(a1_m, a2, th) tmp = 0.0 if (cos(th) <= 0.7) tmp = Float64(cos(th) * Float64(Float64(a2 + a1_m) * Float64(a2 + a1_m))); else tmp = Float64(Float64(Float64(a1_m * a1_m) + Float64(a2 * a2)) * (0.25 ^ 0.25)); end return tmp end
a1_m = abs(a1);
a1_m, a2, th = num2cell(sort([a1_m, a2, th])){:}
function tmp_2 = code(a1_m, a2, th)
tmp = 0.0;
if (cos(th) <= 0.7)
tmp = cos(th) * ((a2 + a1_m) * (a2 + a1_m));
else
tmp = ((a1_m * a1_m) + (a2 * a2)) * (0.25 ^ 0.25);
end
tmp_2 = tmp;
end
a1_m = N[Abs[a1], $MachinePrecision] NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. code[a1$95$m_, a2_, th_] := If[LessEqual[N[Cos[th], $MachinePrecision], 0.7], N[(N[Cos[th], $MachinePrecision] * N[(N[(a2 + a1$95$m), $MachinePrecision] * N[(a2 + a1$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a1$95$m * a1$95$m), $MachinePrecision] + N[(a2 * a2), $MachinePrecision]), $MachinePrecision] * N[Power[0.25, 0.25], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a1_m = \left|a1\right|
\\
[a1_m, a2, th] = \mathsf{sort}([a1_m, a2, th])\\
\\
\begin{array}{l}
\mathbf{if}\;\cos th \leq 0.7:\\
\;\;\;\;\cos th \cdot \left(\left(a2 + a1_m\right) \cdot \left(a2 + a1_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a1_m \cdot a1_m + a2 \cdot a2\right) \cdot {0.25}^{0.25}\\
\end{array}
\end{array}
a1_m = (fabs.f64 a1) NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. (FPCore (a1_m a2 th) :precision binary64 (let* ((t_1 (+ (* a1_m a1_m) (* a2 a2)))) (if (<= (cos th) 0.7) (* (cos th) t_1) (* t_1 (pow 0.25 0.25)))))
a1_m = fabs(a1);
assert(a1_m < a2 && a2 < th);
double code(double a1_m, double a2, double th) {
double t_1 = (a1_m * a1_m) + (a2 * a2);
double tmp;
if (cos(th) <= 0.7) {
tmp = cos(th) * t_1;
} else {
tmp = t_1 * pow(0.25, 0.25);
}
return tmp;
}
a1_m = abs(a1)
NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function.
real(8) function code(a1_m, a2, th)
real(8), intent (in) :: a1_m
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: t_1
real(8) :: tmp
t_1 = (a1_m * a1_m) + (a2 * a2)
if (cos(th) <= 0.7d0) then
tmp = cos(th) * t_1
else
tmp = t_1 * (0.25d0 ** 0.25d0)
end if
code = tmp
end function
a1_m = Math.abs(a1);
assert a1_m < a2 && a2 < th;
public static double code(double a1_m, double a2, double th) {
double t_1 = (a1_m * a1_m) + (a2 * a2);
double tmp;
if (Math.cos(th) <= 0.7) {
tmp = Math.cos(th) * t_1;
} else {
tmp = t_1 * Math.pow(0.25, 0.25);
}
return tmp;
}
a1_m = math.fabs(a1) [a1_m, a2, th] = sort([a1_m, a2, th]) def code(a1_m, a2, th): t_1 = (a1_m * a1_m) + (a2 * a2) tmp = 0 if math.cos(th) <= 0.7: tmp = math.cos(th) * t_1 else: tmp = t_1 * math.pow(0.25, 0.25) return tmp
a1_m = abs(a1) a1_m, a2, th = sort([a1_m, a2, th]) function code(a1_m, a2, th) t_1 = Float64(Float64(a1_m * a1_m) + Float64(a2 * a2)) tmp = 0.0 if (cos(th) <= 0.7) tmp = Float64(cos(th) * t_1); else tmp = Float64(t_1 * (0.25 ^ 0.25)); end return tmp end
a1_m = abs(a1);
a1_m, a2, th = num2cell(sort([a1_m, a2, th])){:}
function tmp_2 = code(a1_m, a2, th)
t_1 = (a1_m * a1_m) + (a2 * a2);
tmp = 0.0;
if (cos(th) <= 0.7)
tmp = cos(th) * t_1;
else
tmp = t_1 * (0.25 ^ 0.25);
end
tmp_2 = tmp;
end
a1_m = N[Abs[a1], $MachinePrecision]
NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function.
code[a1$95$m_, a2_, th_] := Block[{t$95$1 = N[(N[(a1$95$m * a1$95$m), $MachinePrecision] + N[(a2 * a2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Cos[th], $MachinePrecision], 0.7], N[(N[Cos[th], $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * N[Power[0.25, 0.25], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a1_m = \left|a1\right|
\\
[a1_m, a2, th] = \mathsf{sort}([a1_m, a2, th])\\
\\
\begin{array}{l}
t_1 := a1_m \cdot a1_m + a2 \cdot a2\\
\mathbf{if}\;\cos th \leq 0.7:\\
\;\;\;\;\cos th \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot {0.25}^{0.25}\\
\end{array}
\end{array}
a1_m = (fabs.f64 a1) NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. (FPCore (a1_m a2 th) :precision binary64 (* (* (cos th) (pow 2.0 -0.5)) (+ (* a1_m a1_m) (* a2 a2))))
a1_m = fabs(a1);
assert(a1_m < a2 && a2 < th);
double code(double a1_m, double a2, double th) {
return (cos(th) * pow(2.0, -0.5)) * ((a1_m * a1_m) + (a2 * a2));
}
a1_m = abs(a1)
NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function.
real(8) function code(a1_m, a2, th)
real(8), intent (in) :: a1_m
real(8), intent (in) :: a2
real(8), intent (in) :: th
code = (cos(th) * (2.0d0 ** (-0.5d0))) * ((a1_m * a1_m) + (a2 * a2))
end function
a1_m = Math.abs(a1);
assert a1_m < a2 && a2 < th;
public static double code(double a1_m, double a2, double th) {
return (Math.cos(th) * Math.pow(2.0, -0.5)) * ((a1_m * a1_m) + (a2 * a2));
}
a1_m = math.fabs(a1) [a1_m, a2, th] = sort([a1_m, a2, th]) def code(a1_m, a2, th): return (math.cos(th) * math.pow(2.0, -0.5)) * ((a1_m * a1_m) + (a2 * a2))
a1_m = abs(a1) a1_m, a2, th = sort([a1_m, a2, th]) function code(a1_m, a2, th) return Float64(Float64(cos(th) * (2.0 ^ -0.5)) * Float64(Float64(a1_m * a1_m) + Float64(a2 * a2))) end
a1_m = abs(a1);
a1_m, a2, th = num2cell(sort([a1_m, a2, th])){:}
function tmp = code(a1_m, a2, th)
tmp = (cos(th) * (2.0 ^ -0.5)) * ((a1_m * a1_m) + (a2 * a2));
end
a1_m = N[Abs[a1], $MachinePrecision] NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. code[a1$95$m_, a2_, th_] := N[(N[(N[Cos[th], $MachinePrecision] * N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision] * N[(N[(a1$95$m * a1$95$m), $MachinePrecision] + N[(a2 * a2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a1_m = \left|a1\right|
\\
[a1_m, a2, th] = \mathsf{sort}([a1_m, a2, th])\\
\\
\left(\cos th \cdot {2}^{-0.5}\right) \cdot \left(a1_m \cdot a1_m + a2 \cdot a2\right)
\end{array}
a1_m = (fabs.f64 a1) NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. (FPCore (a1_m a2 th) :precision binary64 (if (<= (cos th) 0.7) (* (cos th) (* (+ a2 a1_m) (+ a2 a1_m))) (* a2 (/ a2 (sqrt 2.0)))))
a1_m = fabs(a1);
assert(a1_m < a2 && a2 < th);
double code(double a1_m, double a2, double th) {
double tmp;
if (cos(th) <= 0.7) {
tmp = cos(th) * ((a2 + a1_m) * (a2 + a1_m));
} else {
tmp = a2 * (a2 / sqrt(2.0));
}
return tmp;
}
a1_m = abs(a1)
NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function.
real(8) function code(a1_m, a2, th)
real(8), intent (in) :: a1_m
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: tmp
if (cos(th) <= 0.7d0) then
tmp = cos(th) * ((a2 + a1_m) * (a2 + a1_m))
else
tmp = a2 * (a2 / sqrt(2.0d0))
end if
code = tmp
end function
a1_m = Math.abs(a1);
assert a1_m < a2 && a2 < th;
public static double code(double a1_m, double a2, double th) {
double tmp;
if (Math.cos(th) <= 0.7) {
tmp = Math.cos(th) * ((a2 + a1_m) * (a2 + a1_m));
} else {
tmp = a2 * (a2 / Math.sqrt(2.0));
}
return tmp;
}
a1_m = math.fabs(a1) [a1_m, a2, th] = sort([a1_m, a2, th]) def code(a1_m, a2, th): tmp = 0 if math.cos(th) <= 0.7: tmp = math.cos(th) * ((a2 + a1_m) * (a2 + a1_m)) else: tmp = a2 * (a2 / math.sqrt(2.0)) return tmp
a1_m = abs(a1) a1_m, a2, th = sort([a1_m, a2, th]) function code(a1_m, a2, th) tmp = 0.0 if (cos(th) <= 0.7) tmp = Float64(cos(th) * Float64(Float64(a2 + a1_m) * Float64(a2 + a1_m))); else tmp = Float64(a2 * Float64(a2 / sqrt(2.0))); end return tmp end
a1_m = abs(a1);
a1_m, a2, th = num2cell(sort([a1_m, a2, th])){:}
function tmp_2 = code(a1_m, a2, th)
tmp = 0.0;
if (cos(th) <= 0.7)
tmp = cos(th) * ((a2 + a1_m) * (a2 + a1_m));
else
tmp = a2 * (a2 / sqrt(2.0));
end
tmp_2 = tmp;
end
a1_m = N[Abs[a1], $MachinePrecision] NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. code[a1$95$m_, a2_, th_] := If[LessEqual[N[Cos[th], $MachinePrecision], 0.7], N[(N[Cos[th], $MachinePrecision] * N[(N[(a2 + a1$95$m), $MachinePrecision] * N[(a2 + a1$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a2 * N[(a2 / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a1_m = \left|a1\right|
\\
[a1_m, a2, th] = \mathsf{sort}([a1_m, a2, th])\\
\\
\begin{array}{l}
\mathbf{if}\;\cos th \leq 0.7:\\
\;\;\;\;\cos th \cdot \left(\left(a2 + a1_m\right) \cdot \left(a2 + a1_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a2 \cdot \frac{a2}{\sqrt{2}}\\
\end{array}
\end{array}
a1_m = (fabs.f64 a1) NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. (FPCore (a1_m a2 th) :precision binary64 (* (/ (cos th) (sqrt 2.0)) (+ (* a1_m a1_m) (* a2 a2))))
a1_m = fabs(a1);
assert(a1_m < a2 && a2 < th);
double code(double a1_m, double a2, double th) {
return (cos(th) / sqrt(2.0)) * ((a1_m * a1_m) + (a2 * a2));
}
a1_m = abs(a1)
NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function.
real(8) function code(a1_m, a2, th)
real(8), intent (in) :: a1_m
real(8), intent (in) :: a2
real(8), intent (in) :: th
code = (cos(th) / sqrt(2.0d0)) * ((a1_m * a1_m) + (a2 * a2))
end function
a1_m = Math.abs(a1);
assert a1_m < a2 && a2 < th;
public static double code(double a1_m, double a2, double th) {
return (Math.cos(th) / Math.sqrt(2.0)) * ((a1_m * a1_m) + (a2 * a2));
}
a1_m = math.fabs(a1) [a1_m, a2, th] = sort([a1_m, a2, th]) def code(a1_m, a2, th): return (math.cos(th) / math.sqrt(2.0)) * ((a1_m * a1_m) + (a2 * a2))
a1_m = abs(a1) a1_m, a2, th = sort([a1_m, a2, th]) function code(a1_m, a2, th) return Float64(Float64(cos(th) / sqrt(2.0)) * Float64(Float64(a1_m * a1_m) + Float64(a2 * a2))) end
a1_m = abs(a1);
a1_m, a2, th = num2cell(sort([a1_m, a2, th])){:}
function tmp = code(a1_m, a2, th)
tmp = (cos(th) / sqrt(2.0)) * ((a1_m * a1_m) + (a2 * a2));
end
a1_m = N[Abs[a1], $MachinePrecision] NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. code[a1$95$m_, a2_, th_] := N[(N[(N[Cos[th], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] * N[(N[(a1$95$m * a1$95$m), $MachinePrecision] + N[(a2 * a2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a1_m = \left|a1\right|
\\
[a1_m, a2, th] = \mathsf{sort}([a1_m, a2, th])\\
\\
\frac{\cos th}{\sqrt{2}} \cdot \left(a1_m \cdot a1_m + a2 \cdot a2\right)
\end{array}
a1_m = (fabs.f64 a1) NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. (FPCore (a1_m a2 th) :precision binary64 (if (<= (cos th) -1e-310) (* -0.5 (pow a2 2.0)) (* a2 (* a2 (pow 2.0 -0.5)))))
a1_m = fabs(a1);
assert(a1_m < a2 && a2 < th);
double code(double a1_m, double a2, double th) {
double tmp;
if (cos(th) <= -1e-310) {
tmp = -0.5 * pow(a2, 2.0);
} else {
tmp = a2 * (a2 * pow(2.0, -0.5));
}
return tmp;
}
a1_m = abs(a1)
NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function.
real(8) function code(a1_m, a2, th)
real(8), intent (in) :: a1_m
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: tmp
if (cos(th) <= (-1d-310)) then
tmp = (-0.5d0) * (a2 ** 2.0d0)
else
tmp = a2 * (a2 * (2.0d0 ** (-0.5d0)))
end if
code = tmp
end function
a1_m = Math.abs(a1);
assert a1_m < a2 && a2 < th;
public static double code(double a1_m, double a2, double th) {
double tmp;
if (Math.cos(th) <= -1e-310) {
tmp = -0.5 * Math.pow(a2, 2.0);
} else {
tmp = a2 * (a2 * Math.pow(2.0, -0.5));
}
return tmp;
}
a1_m = math.fabs(a1) [a1_m, a2, th] = sort([a1_m, a2, th]) def code(a1_m, a2, th): tmp = 0 if math.cos(th) <= -1e-310: tmp = -0.5 * math.pow(a2, 2.0) else: tmp = a2 * (a2 * math.pow(2.0, -0.5)) return tmp
a1_m = abs(a1) a1_m, a2, th = sort([a1_m, a2, th]) function code(a1_m, a2, th) tmp = 0.0 if (cos(th) <= -1e-310) tmp = Float64(-0.5 * (a2 ^ 2.0)); else tmp = Float64(a2 * Float64(a2 * (2.0 ^ -0.5))); end return tmp end
a1_m = abs(a1);
a1_m, a2, th = num2cell(sort([a1_m, a2, th])){:}
function tmp_2 = code(a1_m, a2, th)
tmp = 0.0;
if (cos(th) <= -1e-310)
tmp = -0.5 * (a2 ^ 2.0);
else
tmp = a2 * (a2 * (2.0 ^ -0.5));
end
tmp_2 = tmp;
end
a1_m = N[Abs[a1], $MachinePrecision] NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. code[a1$95$m_, a2_, th_] := If[LessEqual[N[Cos[th], $MachinePrecision], -1e-310], N[(-0.5 * N[Power[a2, 2.0], $MachinePrecision]), $MachinePrecision], N[(a2 * N[(a2 * N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a1_m = \left|a1\right|
\\
[a1_m, a2, th] = \mathsf{sort}([a1_m, a2, th])\\
\\
\begin{array}{l}
\mathbf{if}\;\cos th \leq -1 \cdot 10^{-310}:\\
\;\;\;\;-0.5 \cdot {a2}^{2}\\
\mathbf{else}:\\
\;\;\;\;a2 \cdot \left(a2 \cdot {2}^{-0.5}\right)\\
\end{array}
\end{array}
a1_m = (fabs.f64 a1) NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. (FPCore (a1_m a2 th) :precision binary64 (if (<= (cos th) -1e-310) (* -0.5 (pow a2 2.0)) (* a2 (/ a2 (sqrt 2.0)))))
a1_m = fabs(a1);
assert(a1_m < a2 && a2 < th);
double code(double a1_m, double a2, double th) {
double tmp;
if (cos(th) <= -1e-310) {
tmp = -0.5 * pow(a2, 2.0);
} else {
tmp = a2 * (a2 / sqrt(2.0));
}
return tmp;
}
a1_m = abs(a1)
NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function.
real(8) function code(a1_m, a2, th)
real(8), intent (in) :: a1_m
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: tmp
if (cos(th) <= (-1d-310)) then
tmp = (-0.5d0) * (a2 ** 2.0d0)
else
tmp = a2 * (a2 / sqrt(2.0d0))
end if
code = tmp
end function
a1_m = Math.abs(a1);
assert a1_m < a2 && a2 < th;
public static double code(double a1_m, double a2, double th) {
double tmp;
if (Math.cos(th) <= -1e-310) {
tmp = -0.5 * Math.pow(a2, 2.0);
} else {
tmp = a2 * (a2 / Math.sqrt(2.0));
}
return tmp;
}
a1_m = math.fabs(a1) [a1_m, a2, th] = sort([a1_m, a2, th]) def code(a1_m, a2, th): tmp = 0 if math.cos(th) <= -1e-310: tmp = -0.5 * math.pow(a2, 2.0) else: tmp = a2 * (a2 / math.sqrt(2.0)) return tmp
a1_m = abs(a1) a1_m, a2, th = sort([a1_m, a2, th]) function code(a1_m, a2, th) tmp = 0.0 if (cos(th) <= -1e-310) tmp = Float64(-0.5 * (a2 ^ 2.0)); else tmp = Float64(a2 * Float64(a2 / sqrt(2.0))); end return tmp end
a1_m = abs(a1);
a1_m, a2, th = num2cell(sort([a1_m, a2, th])){:}
function tmp_2 = code(a1_m, a2, th)
tmp = 0.0;
if (cos(th) <= -1e-310)
tmp = -0.5 * (a2 ^ 2.0);
else
tmp = a2 * (a2 / sqrt(2.0));
end
tmp_2 = tmp;
end
a1_m = N[Abs[a1], $MachinePrecision] NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. code[a1$95$m_, a2_, th_] := If[LessEqual[N[Cos[th], $MachinePrecision], -1e-310], N[(-0.5 * N[Power[a2, 2.0], $MachinePrecision]), $MachinePrecision], N[(a2 * N[(a2 / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a1_m = \left|a1\right|
\\
[a1_m, a2, th] = \mathsf{sort}([a1_m, a2, th])\\
\\
\begin{array}{l}
\mathbf{if}\;\cos th \leq -1 \cdot 10^{-310}:\\
\;\;\;\;-0.5 \cdot {a2}^{2}\\
\mathbf{else}:\\
\;\;\;\;a2 \cdot \frac{a2}{\sqrt{2}}\\
\end{array}
\end{array}
a1_m = (fabs.f64 a1) NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. (FPCore (a1_m a2 th) :precision binary64 (if (<= (cos th) -1e-310) (* -0.5 (pow a2 2.0)) (* (+ (* a1_m a1_m) (* a2 a2)) 0.5)))
a1_m = fabs(a1);
assert(a1_m < a2 && a2 < th);
double code(double a1_m, double a2, double th) {
double tmp;
if (cos(th) <= -1e-310) {
tmp = -0.5 * pow(a2, 2.0);
} else {
tmp = ((a1_m * a1_m) + (a2 * a2)) * 0.5;
}
return tmp;
}
a1_m = abs(a1)
NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function.
real(8) function code(a1_m, a2, th)
real(8), intent (in) :: a1_m
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: tmp
if (cos(th) <= (-1d-310)) then
tmp = (-0.5d0) * (a2 ** 2.0d0)
else
tmp = ((a1_m * a1_m) + (a2 * a2)) * 0.5d0
end if
code = tmp
end function
a1_m = Math.abs(a1);
assert a1_m < a2 && a2 < th;
public static double code(double a1_m, double a2, double th) {
double tmp;
if (Math.cos(th) <= -1e-310) {
tmp = -0.5 * Math.pow(a2, 2.0);
} else {
tmp = ((a1_m * a1_m) + (a2 * a2)) * 0.5;
}
return tmp;
}
a1_m = math.fabs(a1) [a1_m, a2, th] = sort([a1_m, a2, th]) def code(a1_m, a2, th): tmp = 0 if math.cos(th) <= -1e-310: tmp = -0.5 * math.pow(a2, 2.0) else: tmp = ((a1_m * a1_m) + (a2 * a2)) * 0.5 return tmp
a1_m = abs(a1) a1_m, a2, th = sort([a1_m, a2, th]) function code(a1_m, a2, th) tmp = 0.0 if (cos(th) <= -1e-310) tmp = Float64(-0.5 * (a2 ^ 2.0)); else tmp = Float64(Float64(Float64(a1_m * a1_m) + Float64(a2 * a2)) * 0.5); end return tmp end
a1_m = abs(a1);
a1_m, a2, th = num2cell(sort([a1_m, a2, th])){:}
function tmp_2 = code(a1_m, a2, th)
tmp = 0.0;
if (cos(th) <= -1e-310)
tmp = -0.5 * (a2 ^ 2.0);
else
tmp = ((a1_m * a1_m) + (a2 * a2)) * 0.5;
end
tmp_2 = tmp;
end
a1_m = N[Abs[a1], $MachinePrecision] NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. code[a1$95$m_, a2_, th_] := If[LessEqual[N[Cos[th], $MachinePrecision], -1e-310], N[(-0.5 * N[Power[a2, 2.0], $MachinePrecision]), $MachinePrecision], N[(N[(N[(a1$95$m * a1$95$m), $MachinePrecision] + N[(a2 * a2), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]]
\begin{array}{l}
a1_m = \left|a1\right|
\\
[a1_m, a2, th] = \mathsf{sort}([a1_m, a2, th])\\
\\
\begin{array}{l}
\mathbf{if}\;\cos th \leq -1 \cdot 10^{-310}:\\
\;\;\;\;-0.5 \cdot {a2}^{2}\\
\mathbf{else}:\\
\;\;\;\;\left(a1_m \cdot a1_m + a2 \cdot a2\right) \cdot 0.5\\
\end{array}
\end{array}
a1_m = (fabs.f64 a1) NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. (FPCore (a1_m a2 th) :precision binary64 (let* ((t_1 (+ (* a1_m a1_m) (* a2 a2)))) (if (<= (cos th) -1e-310) (* -0.5 t_1) (* t_1 0.5))))
a1_m = fabs(a1);
assert(a1_m < a2 && a2 < th);
double code(double a1_m, double a2, double th) {
double t_1 = (a1_m * a1_m) + (a2 * a2);
double tmp;
if (cos(th) <= -1e-310) {
tmp = -0.5 * t_1;
} else {
tmp = t_1 * 0.5;
}
return tmp;
}
a1_m = abs(a1)
NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function.
real(8) function code(a1_m, a2, th)
real(8), intent (in) :: a1_m
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: t_1
real(8) :: tmp
t_1 = (a1_m * a1_m) + (a2 * a2)
if (cos(th) <= (-1d-310)) then
tmp = (-0.5d0) * t_1
else
tmp = t_1 * 0.5d0
end if
code = tmp
end function
a1_m = Math.abs(a1);
assert a1_m < a2 && a2 < th;
public static double code(double a1_m, double a2, double th) {
double t_1 = (a1_m * a1_m) + (a2 * a2);
double tmp;
if (Math.cos(th) <= -1e-310) {
tmp = -0.5 * t_1;
} else {
tmp = t_1 * 0.5;
}
return tmp;
}
a1_m = math.fabs(a1) [a1_m, a2, th] = sort([a1_m, a2, th]) def code(a1_m, a2, th): t_1 = (a1_m * a1_m) + (a2 * a2) tmp = 0 if math.cos(th) <= -1e-310: tmp = -0.5 * t_1 else: tmp = t_1 * 0.5 return tmp
a1_m = abs(a1) a1_m, a2, th = sort([a1_m, a2, th]) function code(a1_m, a2, th) t_1 = Float64(Float64(a1_m * a1_m) + Float64(a2 * a2)) tmp = 0.0 if (cos(th) <= -1e-310) tmp = Float64(-0.5 * t_1); else tmp = Float64(t_1 * 0.5); end return tmp end
a1_m = abs(a1);
a1_m, a2, th = num2cell(sort([a1_m, a2, th])){:}
function tmp_2 = code(a1_m, a2, th)
t_1 = (a1_m * a1_m) + (a2 * a2);
tmp = 0.0;
if (cos(th) <= -1e-310)
tmp = -0.5 * t_1;
else
tmp = t_1 * 0.5;
end
tmp_2 = tmp;
end
a1_m = N[Abs[a1], $MachinePrecision]
NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function.
code[a1$95$m_, a2_, th_] := Block[{t$95$1 = N[(N[(a1$95$m * a1$95$m), $MachinePrecision] + N[(a2 * a2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Cos[th], $MachinePrecision], -1e-310], N[(-0.5 * t$95$1), $MachinePrecision], N[(t$95$1 * 0.5), $MachinePrecision]]]
\begin{array}{l}
a1_m = \left|a1\right|
\\
[a1_m, a2, th] = \mathsf{sort}([a1_m, a2, th])\\
\\
\begin{array}{l}
t_1 := a1_m \cdot a1_m + a2 \cdot a2\\
\mathbf{if}\;\cos th \leq -1 \cdot 10^{-310}:\\
\;\;\;\;-0.5 \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot 0.5\\
\end{array}
\end{array}
a1_m = (fabs.f64 a1) NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. (FPCore (a1_m a2 th) :precision binary64 (if (<= th 26.5) (+ a2 a1_m) (- a1_m (* a2 a2))))
a1_m = fabs(a1);
assert(a1_m < a2 && a2 < th);
double code(double a1_m, double a2, double th) {
double tmp;
if (th <= 26.5) {
tmp = a2 + a1_m;
} else {
tmp = a1_m - (a2 * a2);
}
return tmp;
}
a1_m = abs(a1)
NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function.
real(8) function code(a1_m, a2, th)
real(8), intent (in) :: a1_m
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: tmp
if (th <= 26.5d0) then
tmp = a2 + a1_m
else
tmp = a1_m - (a2 * a2)
end if
code = tmp
end function
a1_m = Math.abs(a1);
assert a1_m < a2 && a2 < th;
public static double code(double a1_m, double a2, double th) {
double tmp;
if (th <= 26.5) {
tmp = a2 + a1_m;
} else {
tmp = a1_m - (a2 * a2);
}
return tmp;
}
a1_m = math.fabs(a1) [a1_m, a2, th] = sort([a1_m, a2, th]) def code(a1_m, a2, th): tmp = 0 if th <= 26.5: tmp = a2 + a1_m else: tmp = a1_m - (a2 * a2) return tmp
a1_m = abs(a1) a1_m, a2, th = sort([a1_m, a2, th]) function code(a1_m, a2, th) tmp = 0.0 if (th <= 26.5) tmp = Float64(a2 + a1_m); else tmp = Float64(a1_m - Float64(a2 * a2)); end return tmp end
a1_m = abs(a1);
a1_m, a2, th = num2cell(sort([a1_m, a2, th])){:}
function tmp_2 = code(a1_m, a2, th)
tmp = 0.0;
if (th <= 26.5)
tmp = a2 + a1_m;
else
tmp = a1_m - (a2 * a2);
end
tmp_2 = tmp;
end
a1_m = N[Abs[a1], $MachinePrecision] NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. code[a1$95$m_, a2_, th_] := If[LessEqual[th, 26.5], N[(a2 + a1$95$m), $MachinePrecision], N[(a1$95$m - N[(a2 * a2), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a1_m = \left|a1\right|
\\
[a1_m, a2, th] = \mathsf{sort}([a1_m, a2, th])\\
\\
\begin{array}{l}
\mathbf{if}\;th \leq 26.5:\\
\;\;\;\;a2 + a1_m\\
\mathbf{else}:\\
\;\;\;\;a1_m - a2 \cdot a2\\
\end{array}
\end{array}
a1_m = (fabs.f64 a1) NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. (FPCore (a1_m a2 th) :precision binary64 (* (+ a2 a1_m) (+ a2 a1_m)))
a1_m = fabs(a1);
assert(a1_m < a2 && a2 < th);
double code(double a1_m, double a2, double th) {
return (a2 + a1_m) * (a2 + a1_m);
}
a1_m = abs(a1)
NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function.
real(8) function code(a1_m, a2, th)
real(8), intent (in) :: a1_m
real(8), intent (in) :: a2
real(8), intent (in) :: th
code = (a2 + a1_m) * (a2 + a1_m)
end function
a1_m = Math.abs(a1);
assert a1_m < a2 && a2 < th;
public static double code(double a1_m, double a2, double th) {
return (a2 + a1_m) * (a2 + a1_m);
}
a1_m = math.fabs(a1) [a1_m, a2, th] = sort([a1_m, a2, th]) def code(a1_m, a2, th): return (a2 + a1_m) * (a2 + a1_m)
a1_m = abs(a1) a1_m, a2, th = sort([a1_m, a2, th]) function code(a1_m, a2, th) return Float64(Float64(a2 + a1_m) * Float64(a2 + a1_m)) end
a1_m = abs(a1);
a1_m, a2, th = num2cell(sort([a1_m, a2, th])){:}
function tmp = code(a1_m, a2, th)
tmp = (a2 + a1_m) * (a2 + a1_m);
end
a1_m = N[Abs[a1], $MachinePrecision] NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. code[a1$95$m_, a2_, th_] := N[(N[(a2 + a1$95$m), $MachinePrecision] * N[(a2 + a1$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a1_m = \left|a1\right|
\\
[a1_m, a2, th] = \mathsf{sort}([a1_m, a2, th])\\
\\
\left(a2 + a1_m\right) \cdot \left(a2 + a1_m\right)
\end{array}
a1_m = (fabs.f64 a1) NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. (FPCore (a1_m a2 th) :precision binary64 (+ a2 a1_m))
a1_m = fabs(a1);
assert(a1_m < a2 && a2 < th);
double code(double a1_m, double a2, double th) {
return a2 + a1_m;
}
a1_m = abs(a1)
NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function.
real(8) function code(a1_m, a2, th)
real(8), intent (in) :: a1_m
real(8), intent (in) :: a2
real(8), intent (in) :: th
code = a2 + a1_m
end function
a1_m = Math.abs(a1);
assert a1_m < a2 && a2 < th;
public static double code(double a1_m, double a2, double th) {
return a2 + a1_m;
}
a1_m = math.fabs(a1) [a1_m, a2, th] = sort([a1_m, a2, th]) def code(a1_m, a2, th): return a2 + a1_m
a1_m = abs(a1) a1_m, a2, th = sort([a1_m, a2, th]) function code(a1_m, a2, th) return Float64(a2 + a1_m) end
a1_m = abs(a1);
a1_m, a2, th = num2cell(sort([a1_m, a2, th])){:}
function tmp = code(a1_m, a2, th)
tmp = a2 + a1_m;
end
a1_m = N[Abs[a1], $MachinePrecision] NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. code[a1$95$m_, a2_, th_] := N[(a2 + a1$95$m), $MachinePrecision]
\begin{array}{l}
a1_m = \left|a1\right|
\\
[a1_m, a2, th] = \mathsf{sort}([a1_m, a2, th])\\
\\
a2 + a1_m
\end{array}
a1_m = (fabs.f64 a1) NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. (FPCore (a1_m a2 th) :precision binary64 1.0)
a1_m = fabs(a1);
assert(a1_m < a2 && a2 < th);
double code(double a1_m, double a2, double th) {
return 1.0;
}
a1_m = abs(a1)
NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function.
real(8) function code(a1_m, a2, th)
real(8), intent (in) :: a1_m
real(8), intent (in) :: a2
real(8), intent (in) :: th
code = 1.0d0
end function
a1_m = Math.abs(a1);
assert a1_m < a2 && a2 < th;
public static double code(double a1_m, double a2, double th) {
return 1.0;
}
a1_m = math.fabs(a1) [a1_m, a2, th] = sort([a1_m, a2, th]) def code(a1_m, a2, th): return 1.0
a1_m = abs(a1) a1_m, a2, th = sort([a1_m, a2, th]) function code(a1_m, a2, th) return 1.0 end
a1_m = abs(a1);
a1_m, a2, th = num2cell(sort([a1_m, a2, th])){:}
function tmp = code(a1_m, a2, th)
tmp = 1.0;
end
a1_m = N[Abs[a1], $MachinePrecision] NOTE: a1_m, a2, and th should be sorted in increasing order before calling this function. code[a1$95$m_, a2_, th_] := 1.0
\begin{array}{l}
a1_m = \left|a1\right|
\\
[a1_m, a2, th] = \mathsf{sort}([a1_m, a2, th])\\
\\
1
\end{array}
herbie shell --seed 2023347
(FPCore (a1 a2 th)
:name "Migdal et al, Equation (64)"
:precision binary64
(+ (* (/ (cos th) (sqrt 2.0)) (* a1 a1)) (* (/ (cos th) (sqrt 2.0)) (* a2 a2))))