
(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 23 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}
(FPCore (a1 a2 th) :precision binary64 (* (cos th) (/ (fma a1 a1 (* a2 a2)) (sqrt 2.0))))
double code(double a1, double a2, double th) {
return cos(th) * (fma(a1, a1, (a2 * a2)) / sqrt(2.0));
}
function code(a1, a2, th) return Float64(cos(th) * Float64(fma(a1, a1, Float64(a2 * a2)) / sqrt(2.0))) end
code[a1_, a2_, th_] := N[(N[Cos[th], $MachinePrecision] * N[(N[(a1 * a1 + N[(a2 * a2), $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos th \cdot \frac{\mathsf{fma}\left(a1, a1, a2 \cdot a2\right)}{\sqrt{2}}
\end{array}
Initial program 99.6%
distribute-lft-out99.6%
associate-*l/99.7%
associate-*r/99.7%
fma-def99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (a1 a2 th) :precision binary64 (let* ((t_1 (+ (* a2 a2) (* a1 a1)))) (if (<= (cos th) 0.7) (* (cos th) t_1) (* t_1 (sqrt 0.5)))))
double code(double a1, double a2, double th) {
double t_1 = (a2 * a2) + (a1 * a1);
double tmp;
if (cos(th) <= 0.7) {
tmp = cos(th) * t_1;
} else {
tmp = t_1 * sqrt(0.5);
}
return tmp;
}
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
real(8) :: tmp
t_1 = (a2 * a2) + (a1 * a1)
if (cos(th) <= 0.7d0) then
tmp = cos(th) * t_1
else
tmp = t_1 * sqrt(0.5d0)
end if
code = tmp
end function
public static double code(double a1, double a2, double th) {
double t_1 = (a2 * a2) + (a1 * a1);
double tmp;
if (Math.cos(th) <= 0.7) {
tmp = Math.cos(th) * t_1;
} else {
tmp = t_1 * Math.sqrt(0.5);
}
return tmp;
}
def code(a1, a2, th): t_1 = (a2 * a2) + (a1 * a1) tmp = 0 if math.cos(th) <= 0.7: tmp = math.cos(th) * t_1 else: tmp = t_1 * math.sqrt(0.5) return tmp
function code(a1, a2, th) t_1 = Float64(Float64(a2 * a2) + Float64(a1 * a1)) tmp = 0.0 if (cos(th) <= 0.7) tmp = Float64(cos(th) * t_1); else tmp = Float64(t_1 * sqrt(0.5)); end return tmp end
function tmp_2 = code(a1, a2, th) t_1 = (a2 * a2) + (a1 * a1); tmp = 0.0; if (cos(th) <= 0.7) tmp = cos(th) * t_1; else tmp = t_1 * sqrt(0.5); end tmp_2 = tmp; end
code[a1_, a2_, th_] := Block[{t$95$1 = N[(N[(a2 * a2), $MachinePrecision] + N[(a1 * a1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Cos[th], $MachinePrecision], 0.7], N[(N[Cos[th], $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a2 \cdot a2 + a1 \cdot a1\\
\mathbf{if}\;\cos th \leq 0.7:\\
\;\;\;\;\cos th \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 \cdot \sqrt{0.5}\\
\end{array}
\end{array}
if (cos.f64 th) < 0.69999999999999996Initial program 99.5%
distribute-lft-out99.5%
Simplified99.5%
*-un-lft-identity99.5%
add-sqr-sqrt99.5%
times-frac99.5%
pow1/299.5%
sqrt-pow199.5%
metadata-eval99.5%
pow1/299.5%
sqrt-pow199.5%
metadata-eval99.5%
Applied egg-rr99.5%
Taylor expanded in th around inf 99.6%
Applied egg-rr55.1%
rem-log-exp55.1%
Simplified55.1%
if 0.69999999999999996 < (cos.f64 th) Initial program 99.7%
distribute-lft-out99.7%
Simplified99.7%
*-un-lft-identity99.7%
add-sqr-sqrt99.5%
times-frac99.1%
pow1/299.1%
sqrt-pow199.1%
metadata-eval99.1%
pow1/299.1%
sqrt-pow199.1%
metadata-eval99.1%
Applied egg-rr99.1%
Taylor expanded in th around 0 92.0%
*-commutative92.0%
unpow292.0%
unpow292.0%
Simplified92.0%
Final simplification77.1%
(FPCore (a1 a2 th) :precision binary64 (let* ((t_1 (+ (* a2 a2) (* a1 a1)))) (if (<= (cos th) 0.7) (* (cos th) t_1) (/ t_1 (sqrt 2.0)))))
double code(double a1, double a2, double th) {
double t_1 = (a2 * a2) + (a1 * a1);
double tmp;
if (cos(th) <= 0.7) {
tmp = cos(th) * t_1;
} else {
tmp = t_1 / sqrt(2.0);
}
return tmp;
}
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
real(8) :: tmp
t_1 = (a2 * a2) + (a1 * a1)
if (cos(th) <= 0.7d0) then
tmp = cos(th) * t_1
else
tmp = t_1 / sqrt(2.0d0)
end if
code = tmp
end function
public static double code(double a1, double a2, double th) {
double t_1 = (a2 * a2) + (a1 * a1);
double tmp;
if (Math.cos(th) <= 0.7) {
tmp = Math.cos(th) * t_1;
} else {
tmp = t_1 / Math.sqrt(2.0);
}
return tmp;
}
def code(a1, a2, th): t_1 = (a2 * a2) + (a1 * a1) tmp = 0 if math.cos(th) <= 0.7: tmp = math.cos(th) * t_1 else: tmp = t_1 / math.sqrt(2.0) return tmp
function code(a1, a2, th) t_1 = Float64(Float64(a2 * a2) + Float64(a1 * a1)) tmp = 0.0 if (cos(th) <= 0.7) tmp = Float64(cos(th) * t_1); else tmp = Float64(t_1 / sqrt(2.0)); end return tmp end
function tmp_2 = code(a1, a2, th) t_1 = (a2 * a2) + (a1 * a1); tmp = 0.0; if (cos(th) <= 0.7) tmp = cos(th) * t_1; else tmp = t_1 / sqrt(2.0); end tmp_2 = tmp; end
code[a1_, a2_, th_] := Block[{t$95$1 = N[(N[(a2 * a2), $MachinePrecision] + N[(a1 * a1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Cos[th], $MachinePrecision], 0.7], N[(N[Cos[th], $MachinePrecision] * t$95$1), $MachinePrecision], N[(t$95$1 / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a2 \cdot a2 + a1 \cdot a1\\
\mathbf{if}\;\cos th \leq 0.7:\\
\;\;\;\;\cos th \cdot t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{t_1}{\sqrt{2}}\\
\end{array}
\end{array}
if (cos.f64 th) < 0.69999999999999996Initial program 99.5%
distribute-lft-out99.5%
Simplified99.5%
*-un-lft-identity99.5%
add-sqr-sqrt99.5%
times-frac99.5%
pow1/299.5%
sqrt-pow199.5%
metadata-eval99.5%
pow1/299.5%
sqrt-pow199.5%
metadata-eval99.5%
Applied egg-rr99.5%
Taylor expanded in th around inf 99.6%
Applied egg-rr55.1%
rem-log-exp55.1%
Simplified55.1%
if 0.69999999999999996 < (cos.f64 th) Initial program 99.7%
distribute-lft-out99.7%
associate-*l/99.7%
associate-*r/99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in th around inf 99.7%
associate-/l*99.7%
unpow299.7%
unpow299.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in th around 0 92.1%
unpow292.1%
unpow292.1%
Simplified92.1%
Final simplification77.2%
(FPCore (a1 a2 th) :precision binary64 (* (+ (* a2 a2) (* a1 a1)) (* (cos th) (sqrt 0.5))))
double code(double a1, double a2, double th) {
return ((a2 * a2) + (a1 * a1)) * (cos(th) * sqrt(0.5));
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
code = ((a2 * a2) + (a1 * a1)) * (cos(th) * sqrt(0.5d0))
end function
public static double code(double a1, double a2, double th) {
return ((a2 * a2) + (a1 * a1)) * (Math.cos(th) * Math.sqrt(0.5));
}
def code(a1, a2, th): return ((a2 * a2) + (a1 * a1)) * (math.cos(th) * math.sqrt(0.5))
function code(a1, a2, th) return Float64(Float64(Float64(a2 * a2) + Float64(a1 * a1)) * Float64(cos(th) * sqrt(0.5))) end
function tmp = code(a1, a2, th) tmp = ((a2 * a2) + (a1 * a1)) * (cos(th) * sqrt(0.5)); end
code[a1_, a2_, th_] := N[(N[(N[(a2 * a2), $MachinePrecision] + N[(a1 * a1), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[th], $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(a2 \cdot a2 + a1 \cdot a1\right) \cdot \left(\cos th \cdot \sqrt{0.5}\right)
\end{array}
Initial program 99.6%
distribute-lft-out99.6%
Simplified99.6%
*-un-lft-identity99.6%
add-sqr-sqrt99.5%
times-frac99.3%
pow1/299.3%
sqrt-pow199.3%
metadata-eval99.3%
pow1/299.3%
sqrt-pow199.3%
metadata-eval99.3%
Applied egg-rr99.3%
Taylor expanded in th around inf 99.6%
Final simplification99.6%
(FPCore (a1 a2 th) :precision binary64 (* (+ (* a2 a2) (* a1 a1)) (/ (cos th) (sqrt 2.0))))
double code(double a1, double a2, double th) {
return ((a2 * a2) + (a1 * a1)) * (cos(th) / sqrt(2.0));
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
code = ((a2 * a2) + (a1 * a1)) * (cos(th) / sqrt(2.0d0))
end function
public static double code(double a1, double a2, double th) {
return ((a2 * a2) + (a1 * a1)) * (Math.cos(th) / Math.sqrt(2.0));
}
def code(a1, a2, th): return ((a2 * a2) + (a1 * a1)) * (math.cos(th) / math.sqrt(2.0))
function code(a1, a2, th) return Float64(Float64(Float64(a2 * a2) + Float64(a1 * a1)) * Float64(cos(th) / sqrt(2.0))) end
function tmp = code(a1, a2, th) tmp = ((a2 * a2) + (a1 * a1)) * (cos(th) / sqrt(2.0)); end
code[a1_, a2_, th_] := N[(N[(N[(a2 * a2), $MachinePrecision] + N[(a1 * a1), $MachinePrecision]), $MachinePrecision] * N[(N[Cos[th], $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(a2 \cdot a2 + a1 \cdot a1\right) \cdot \frac{\cos th}{\sqrt{2}}
\end{array}
Initial program 99.6%
distribute-lft-out99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (a1 a2 th) :precision binary64 (/ (+ (* a2 a2) (* a1 a1)) (/ (sqrt 2.0) (cos th))))
double code(double a1, double a2, double th) {
return ((a2 * a2) + (a1 * a1)) / (sqrt(2.0) / cos(th));
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
code = ((a2 * a2) + (a1 * a1)) / (sqrt(2.0d0) / cos(th))
end function
public static double code(double a1, double a2, double th) {
return ((a2 * a2) + (a1 * a1)) / (Math.sqrt(2.0) / Math.cos(th));
}
def code(a1, a2, th): return ((a2 * a2) + (a1 * a1)) / (math.sqrt(2.0) / math.cos(th))
function code(a1, a2, th) return Float64(Float64(Float64(a2 * a2) + Float64(a1 * a1)) / Float64(sqrt(2.0) / cos(th))) end
function tmp = code(a1, a2, th) tmp = ((a2 * a2) + (a1 * a1)) / (sqrt(2.0) / cos(th)); end
code[a1_, a2_, th_] := N[(N[(N[(a2 * a2), $MachinePrecision] + N[(a1 * a1), $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[2.0], $MachinePrecision] / N[Cos[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{a2 \cdot a2 + a1 \cdot a1}{\frac{\sqrt{2}}{\cos th}}
\end{array}
Initial program 99.6%
distribute-lft-out99.6%
associate-*l/99.7%
associate-*r/99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in th around inf 99.7%
associate-/l*99.6%
unpow299.6%
unpow299.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in th around inf 99.7%
associate-/l*99.6%
unpow299.6%
unpow299.6%
Simplified99.6%
Final simplification99.6%
(FPCore (a1 a2 th)
:precision binary64
(let* ((t_1 (+ (* a2 a2) (* a1 a1))))
(if (<= a2 9e-46)
(* a1 (* a1 (* (cos th) (sqrt 0.5))))
(if (<= a2 1.35e+154) (/ t_1 (sqrt 2.0)) (* (cos th) t_1)))))
double code(double a1, double a2, double th) {
double t_1 = (a2 * a2) + (a1 * a1);
double tmp;
if (a2 <= 9e-46) {
tmp = a1 * (a1 * (cos(th) * sqrt(0.5)));
} else if (a2 <= 1.35e+154) {
tmp = t_1 / sqrt(2.0);
} else {
tmp = cos(th) * t_1;
}
return tmp;
}
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
real(8) :: tmp
t_1 = (a2 * a2) + (a1 * a1)
if (a2 <= 9d-46) then
tmp = a1 * (a1 * (cos(th) * sqrt(0.5d0)))
else if (a2 <= 1.35d+154) then
tmp = t_1 / sqrt(2.0d0)
else
tmp = cos(th) * t_1
end if
code = tmp
end function
public static double code(double a1, double a2, double th) {
double t_1 = (a2 * a2) + (a1 * a1);
double tmp;
if (a2 <= 9e-46) {
tmp = a1 * (a1 * (Math.cos(th) * Math.sqrt(0.5)));
} else if (a2 <= 1.35e+154) {
tmp = t_1 / Math.sqrt(2.0);
} else {
tmp = Math.cos(th) * t_1;
}
return tmp;
}
def code(a1, a2, th): t_1 = (a2 * a2) + (a1 * a1) tmp = 0 if a2 <= 9e-46: tmp = a1 * (a1 * (math.cos(th) * math.sqrt(0.5))) elif a2 <= 1.35e+154: tmp = t_1 / math.sqrt(2.0) else: tmp = math.cos(th) * t_1 return tmp
function code(a1, a2, th) t_1 = Float64(Float64(a2 * a2) + Float64(a1 * a1)) tmp = 0.0 if (a2 <= 9e-46) tmp = Float64(a1 * Float64(a1 * Float64(cos(th) * sqrt(0.5)))); elseif (a2 <= 1.35e+154) tmp = Float64(t_1 / sqrt(2.0)); else tmp = Float64(cos(th) * t_1); end return tmp end
function tmp_2 = code(a1, a2, th) t_1 = (a2 * a2) + (a1 * a1); tmp = 0.0; if (a2 <= 9e-46) tmp = a1 * (a1 * (cos(th) * sqrt(0.5))); elseif (a2 <= 1.35e+154) tmp = t_1 / sqrt(2.0); else tmp = cos(th) * t_1; end tmp_2 = tmp; end
code[a1_, a2_, th_] := Block[{t$95$1 = N[(N[(a2 * a2), $MachinePrecision] + N[(a1 * a1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a2, 9e-46], N[(a1 * N[(a1 * N[(N[Cos[th], $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a2, 1.35e+154], N[(t$95$1 / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision], N[(N[Cos[th], $MachinePrecision] * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a2 \cdot a2 + a1 \cdot a1\\
\mathbf{if}\;a2 \leq 9 \cdot 10^{-46}:\\
\;\;\;\;a1 \cdot \left(a1 \cdot \left(\cos th \cdot \sqrt{0.5}\right)\right)\\
\mathbf{elif}\;a2 \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{t_1}{\sqrt{2}}\\
\mathbf{else}:\\
\;\;\;\;\cos th \cdot t_1\\
\end{array}
\end{array}
if a2 < 9.00000000000000001e-46Initial program 99.6%
distribute-lft-out99.6%
Simplified99.6%
*-un-lft-identity99.6%
add-sqr-sqrt99.5%
times-frac99.2%
pow1/299.2%
sqrt-pow199.2%
metadata-eval99.2%
pow1/299.2%
sqrt-pow199.2%
metadata-eval99.2%
Applied egg-rr99.2%
Taylor expanded in a1 around inf 68.4%
*-commutative68.4%
unpow268.4%
associate-*r*68.4%
associate-*r*68.4%
Simplified68.4%
if 9.00000000000000001e-46 < a2 < 1.35000000000000003e154Initial program 99.5%
distribute-lft-out99.5%
associate-*l/99.6%
associate-*r/99.5%
fma-def99.5%
Simplified99.5%
Taylor expanded in th around inf 99.6%
associate-/l*99.5%
unpow299.5%
unpow299.5%
fma-def99.5%
Simplified99.5%
Taylor expanded in th around 0 56.2%
unpow256.2%
unpow256.2%
Simplified56.2%
if 1.35000000000000003e154 < a2 Initial program 100.0%
distribute-lft-out100.0%
Simplified100.0%
*-un-lft-identity100.0%
add-sqr-sqrt100.0%
times-frac100.0%
pow1/2100.0%
sqrt-pow1100.0%
metadata-eval100.0%
pow1/2100.0%
sqrt-pow1100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in th around inf 100.0%
Applied egg-rr100.0%
rem-log-exp100.0%
Simplified100.0%
Final simplification70.2%
(FPCore (a1 a2 th)
:precision binary64
(let* ((t_1 (+ (* a2 a2) (* a1 a1))))
(if (<= a2 1.3e-45)
(* a1 (* (sqrt 0.5) (* (cos th) a1)))
(if (<= a2 1.15e+154) (/ t_1 (sqrt 2.0)) (* (cos th) t_1)))))
double code(double a1, double a2, double th) {
double t_1 = (a2 * a2) + (a1 * a1);
double tmp;
if (a2 <= 1.3e-45) {
tmp = a1 * (sqrt(0.5) * (cos(th) * a1));
} else if (a2 <= 1.15e+154) {
tmp = t_1 / sqrt(2.0);
} else {
tmp = cos(th) * t_1;
}
return tmp;
}
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
real(8) :: tmp
t_1 = (a2 * a2) + (a1 * a1)
if (a2 <= 1.3d-45) then
tmp = a1 * (sqrt(0.5d0) * (cos(th) * a1))
else if (a2 <= 1.15d+154) then
tmp = t_1 / sqrt(2.0d0)
else
tmp = cos(th) * t_1
end if
code = tmp
end function
public static double code(double a1, double a2, double th) {
double t_1 = (a2 * a2) + (a1 * a1);
double tmp;
if (a2 <= 1.3e-45) {
tmp = a1 * (Math.sqrt(0.5) * (Math.cos(th) * a1));
} else if (a2 <= 1.15e+154) {
tmp = t_1 / Math.sqrt(2.0);
} else {
tmp = Math.cos(th) * t_1;
}
return tmp;
}
def code(a1, a2, th): t_1 = (a2 * a2) + (a1 * a1) tmp = 0 if a2 <= 1.3e-45: tmp = a1 * (math.sqrt(0.5) * (math.cos(th) * a1)) elif a2 <= 1.15e+154: tmp = t_1 / math.sqrt(2.0) else: tmp = math.cos(th) * t_1 return tmp
function code(a1, a2, th) t_1 = Float64(Float64(a2 * a2) + Float64(a1 * a1)) tmp = 0.0 if (a2 <= 1.3e-45) tmp = Float64(a1 * Float64(sqrt(0.5) * Float64(cos(th) * a1))); elseif (a2 <= 1.15e+154) tmp = Float64(t_1 / sqrt(2.0)); else tmp = Float64(cos(th) * t_1); end return tmp end
function tmp_2 = code(a1, a2, th) t_1 = (a2 * a2) + (a1 * a1); tmp = 0.0; if (a2 <= 1.3e-45) tmp = a1 * (sqrt(0.5) * (cos(th) * a1)); elseif (a2 <= 1.15e+154) tmp = t_1 / sqrt(2.0); else tmp = cos(th) * t_1; end tmp_2 = tmp; end
code[a1_, a2_, th_] := Block[{t$95$1 = N[(N[(a2 * a2), $MachinePrecision] + N[(a1 * a1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a2, 1.3e-45], N[(a1 * N[(N[Sqrt[0.5], $MachinePrecision] * N[(N[Cos[th], $MachinePrecision] * a1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a2, 1.15e+154], N[(t$95$1 / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision], N[(N[Cos[th], $MachinePrecision] * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a2 \cdot a2 + a1 \cdot a1\\
\mathbf{if}\;a2 \leq 1.3 \cdot 10^{-45}:\\
\;\;\;\;a1 \cdot \left(\sqrt{0.5} \cdot \left(\cos th \cdot a1\right)\right)\\
\mathbf{elif}\;a2 \leq 1.15 \cdot 10^{+154}:\\
\;\;\;\;\frac{t_1}{\sqrt{2}}\\
\mathbf{else}:\\
\;\;\;\;\cos th \cdot t_1\\
\end{array}
\end{array}
if a2 < 1.29999999999999993e-45Initial program 99.6%
distribute-lft-out99.6%
associate-*l/99.6%
associate-*r/99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in a1 around inf 68.4%
unpow268.4%
Simplified68.4%
expm1-log1p-u66.7%
expm1-udef55.2%
div-inv55.2%
add-sqr-sqrt55.2%
sqrt-unprod55.2%
frac-times55.2%
metadata-eval55.2%
add-sqr-sqrt55.2%
metadata-eval55.2%
Applied egg-rr55.2%
expm1-def66.7%
expm1-log1p68.4%
associate-*r*68.3%
Simplified68.3%
Taylor expanded in th around inf 68.4%
unpow268.4%
associate-*l*68.4%
associate-*r*68.4%
*-commutative68.4%
associate-*l*68.4%
Simplified68.4%
if 1.29999999999999993e-45 < a2 < 1.15e154Initial program 99.5%
distribute-lft-out99.5%
associate-*l/99.6%
associate-*r/99.5%
fma-def99.5%
Simplified99.5%
Taylor expanded in th around inf 99.6%
associate-/l*99.5%
unpow299.5%
unpow299.5%
fma-def99.5%
Simplified99.5%
Taylor expanded in th around 0 56.2%
unpow256.2%
unpow256.2%
Simplified56.2%
if 1.15e154 < a2 Initial program 100.0%
distribute-lft-out100.0%
Simplified100.0%
*-un-lft-identity100.0%
add-sqr-sqrt100.0%
times-frac100.0%
pow1/2100.0%
sqrt-pow1100.0%
metadata-eval100.0%
pow1/2100.0%
sqrt-pow1100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in th around inf 100.0%
Applied egg-rr100.0%
rem-log-exp100.0%
Simplified100.0%
Final simplification70.2%
(FPCore (a1 a2 th) :precision binary64 (if (<= a1 -1.28e-71) (* a1 (* (sqrt 0.5) (* (cos th) a1))) (* a2 (/ a2 (/ (sqrt 2.0) (cos th))))))
double code(double a1, double a2, double th) {
double tmp;
if (a1 <= -1.28e-71) {
tmp = a1 * (sqrt(0.5) * (cos(th) * a1));
} else {
tmp = a2 * (a2 / (sqrt(2.0) / cos(th)));
}
return tmp;
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: tmp
if (a1 <= (-1.28d-71)) then
tmp = a1 * (sqrt(0.5d0) * (cos(th) * a1))
else
tmp = a2 * (a2 / (sqrt(2.0d0) / cos(th)))
end if
code = tmp
end function
public static double code(double a1, double a2, double th) {
double tmp;
if (a1 <= -1.28e-71) {
tmp = a1 * (Math.sqrt(0.5) * (Math.cos(th) * a1));
} else {
tmp = a2 * (a2 / (Math.sqrt(2.0) / Math.cos(th)));
}
return tmp;
}
def code(a1, a2, th): tmp = 0 if a1 <= -1.28e-71: tmp = a1 * (math.sqrt(0.5) * (math.cos(th) * a1)) else: tmp = a2 * (a2 / (math.sqrt(2.0) / math.cos(th))) return tmp
function code(a1, a2, th) tmp = 0.0 if (a1 <= -1.28e-71) tmp = Float64(a1 * Float64(sqrt(0.5) * Float64(cos(th) * a1))); else tmp = Float64(a2 * Float64(a2 / Float64(sqrt(2.0) / cos(th)))); end return tmp end
function tmp_2 = code(a1, a2, th) tmp = 0.0; if (a1 <= -1.28e-71) tmp = a1 * (sqrt(0.5) * (cos(th) * a1)); else tmp = a2 * (a2 / (sqrt(2.0) / cos(th))); end tmp_2 = tmp; end
code[a1_, a2_, th_] := If[LessEqual[a1, -1.28e-71], N[(a1 * N[(N[Sqrt[0.5], $MachinePrecision] * N[(N[Cos[th], $MachinePrecision] * a1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a2 * N[(a2 / N[(N[Sqrt[2.0], $MachinePrecision] / N[Cos[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a1 \leq -1.28 \cdot 10^{-71}:\\
\;\;\;\;a1 \cdot \left(\sqrt{0.5} \cdot \left(\cos th \cdot a1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a2 \cdot \frac{a2}{\frac{\sqrt{2}}{\cos th}}\\
\end{array}
\end{array}
if a1 < -1.28e-71Initial program 99.6%
distribute-lft-out99.6%
associate-*l/99.6%
associate-*r/99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in a1 around inf 69.4%
unpow269.4%
Simplified69.4%
expm1-log1p-u67.3%
expm1-udef58.6%
div-inv58.6%
add-sqr-sqrt58.6%
sqrt-unprod58.6%
frac-times58.6%
metadata-eval58.6%
add-sqr-sqrt58.6%
metadata-eval58.6%
Applied egg-rr58.6%
expm1-def67.3%
expm1-log1p69.4%
associate-*r*69.4%
Simplified69.4%
Taylor expanded in th around inf 69.4%
unpow269.4%
associate-*l*69.4%
associate-*r*69.3%
*-commutative69.3%
associate-*l*69.3%
Simplified69.3%
if -1.28e-71 < a1 Initial program 99.6%
distribute-lft-out99.6%
associate-*l/99.7%
associate-*r/99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in a1 around 0 64.0%
unpow264.0%
associate-*l*64.0%
associate-*r/64.0%
associate-/l*63.9%
Simplified63.9%
Final simplification65.6%
(FPCore (a1 a2 th) :precision binary64 (if (<= a1 -9.5e-80) (* (cos th) (/ (* a1 a1) (sqrt 2.0))) (* a2 (/ a2 (/ (sqrt 2.0) (cos th))))))
double code(double a1, double a2, double th) {
double tmp;
if (a1 <= -9.5e-80) {
tmp = cos(th) * ((a1 * a1) / sqrt(2.0));
} else {
tmp = a2 * (a2 / (sqrt(2.0) / cos(th)));
}
return tmp;
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: tmp
if (a1 <= (-9.5d-80)) then
tmp = cos(th) * ((a1 * a1) / sqrt(2.0d0))
else
tmp = a2 * (a2 / (sqrt(2.0d0) / cos(th)))
end if
code = tmp
end function
public static double code(double a1, double a2, double th) {
double tmp;
if (a1 <= -9.5e-80) {
tmp = Math.cos(th) * ((a1 * a1) / Math.sqrt(2.0));
} else {
tmp = a2 * (a2 / (Math.sqrt(2.0) / Math.cos(th)));
}
return tmp;
}
def code(a1, a2, th): tmp = 0 if a1 <= -9.5e-80: tmp = math.cos(th) * ((a1 * a1) / math.sqrt(2.0)) else: tmp = a2 * (a2 / (math.sqrt(2.0) / math.cos(th))) return tmp
function code(a1, a2, th) tmp = 0.0 if (a1 <= -9.5e-80) tmp = Float64(cos(th) * Float64(Float64(a1 * a1) / sqrt(2.0))); else tmp = Float64(a2 * Float64(a2 / Float64(sqrt(2.0) / cos(th)))); end return tmp end
function tmp_2 = code(a1, a2, th) tmp = 0.0; if (a1 <= -9.5e-80) tmp = cos(th) * ((a1 * a1) / sqrt(2.0)); else tmp = a2 * (a2 / (sqrt(2.0) / cos(th))); end tmp_2 = tmp; end
code[a1_, a2_, th_] := If[LessEqual[a1, -9.5e-80], N[(N[Cos[th], $MachinePrecision] * N[(N[(a1 * a1), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a2 * N[(a2 / N[(N[Sqrt[2.0], $MachinePrecision] / N[Cos[th], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a1 \leq -9.5 \cdot 10^{-80}:\\
\;\;\;\;\cos th \cdot \frac{a1 \cdot a1}{\sqrt{2}}\\
\mathbf{else}:\\
\;\;\;\;a2 \cdot \frac{a2}{\frac{\sqrt{2}}{\cos th}}\\
\end{array}
\end{array}
if a1 < -9.5000000000000003e-80Initial program 99.6%
distribute-lft-out99.6%
associate-*l/99.6%
associate-*r/99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in a1 around inf 68.9%
unpow268.9%
Simplified68.9%
if -9.5000000000000003e-80 < a1 Initial program 99.6%
distribute-lft-out99.6%
associate-*l/99.7%
associate-*r/99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in a1 around 0 64.1%
unpow264.1%
associate-*l*64.1%
associate-*r/64.1%
associate-/l*64.1%
Simplified64.1%
Final simplification65.6%
(FPCore (a1 a2 th) :precision binary64 (if (<= (* a2 a2) 4e-144) (* a1 (/ a1 (sqrt 2.0))) (if (<= (* a2 a2) 1e+277) (* a1 (* (cos th) a1)) (* a2 a2))))
double code(double a1, double a2, double th) {
double tmp;
if ((a2 * a2) <= 4e-144) {
tmp = a1 * (a1 / sqrt(2.0));
} else if ((a2 * a2) <= 1e+277) {
tmp = a1 * (cos(th) * a1);
} else {
tmp = a2 * a2;
}
return tmp;
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: tmp
if ((a2 * a2) <= 4d-144) then
tmp = a1 * (a1 / sqrt(2.0d0))
else if ((a2 * a2) <= 1d+277) then
tmp = a1 * (cos(th) * a1)
else
tmp = a2 * a2
end if
code = tmp
end function
public static double code(double a1, double a2, double th) {
double tmp;
if ((a2 * a2) <= 4e-144) {
tmp = a1 * (a1 / Math.sqrt(2.0));
} else if ((a2 * a2) <= 1e+277) {
tmp = a1 * (Math.cos(th) * a1);
} else {
tmp = a2 * a2;
}
return tmp;
}
def code(a1, a2, th): tmp = 0 if (a2 * a2) <= 4e-144: tmp = a1 * (a1 / math.sqrt(2.0)) elif (a2 * a2) <= 1e+277: tmp = a1 * (math.cos(th) * a1) else: tmp = a2 * a2 return tmp
function code(a1, a2, th) tmp = 0.0 if (Float64(a2 * a2) <= 4e-144) tmp = Float64(a1 * Float64(a1 / sqrt(2.0))); elseif (Float64(a2 * a2) <= 1e+277) tmp = Float64(a1 * Float64(cos(th) * a1)); else tmp = Float64(a2 * a2); end return tmp end
function tmp_2 = code(a1, a2, th) tmp = 0.0; if ((a2 * a2) <= 4e-144) tmp = a1 * (a1 / sqrt(2.0)); elseif ((a2 * a2) <= 1e+277) tmp = a1 * (cos(th) * a1); else tmp = a2 * a2; end tmp_2 = tmp; end
code[a1_, a2_, th_] := If[LessEqual[N[(a2 * a2), $MachinePrecision], 4e-144], N[(a1 * N[(a1 / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a2 * a2), $MachinePrecision], 1e+277], N[(a1 * N[(N[Cos[th], $MachinePrecision] * a1), $MachinePrecision]), $MachinePrecision], N[(a2 * a2), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a2 \cdot a2 \leq 4 \cdot 10^{-144}:\\
\;\;\;\;a1 \cdot \frac{a1}{\sqrt{2}}\\
\mathbf{elif}\;a2 \cdot a2 \leq 10^{+277}:\\
\;\;\;\;a1 \cdot \left(\cos th \cdot a1\right)\\
\mathbf{else}:\\
\;\;\;\;a2 \cdot a2\\
\end{array}
\end{array}
if (*.f64 a2 a2) < 3.9999999999999998e-144Initial program 99.5%
distribute-lft-out99.5%
Simplified99.5%
Taylor expanded in th around 0 68.8%
Taylor expanded in a1 around inf 63.7%
unpow263.7%
associate-*r/63.7%
Simplified63.7%
if 3.9999999999999998e-144 < (*.f64 a2 a2) < 1e277Initial program 99.5%
distribute-lft-out99.5%
associate-*l/99.5%
associate-*r/99.5%
fma-def99.5%
Simplified99.5%
Taylor expanded in a1 around inf 40.7%
unpow240.7%
Simplified40.7%
expm1-log1p-u39.0%
expm1-udef38.1%
div-inv38.1%
add-sqr-sqrt38.1%
sqrt-unprod38.1%
frac-times38.1%
metadata-eval38.1%
add-sqr-sqrt38.1%
metadata-eval38.1%
Applied egg-rr38.1%
expm1-def39.0%
expm1-log1p40.7%
associate-*r*40.8%
Simplified40.8%
Taylor expanded in th around inf 40.7%
unpow240.7%
associate-*l*40.7%
associate-*r*40.7%
*-commutative40.7%
associate-*l*40.7%
Simplified40.7%
Applied egg-rr23.5%
log-pow23.5%
rem-log-exp26.6%
*-commutative26.6%
Simplified26.6%
if 1e277 < (*.f64 a2 a2) Initial program 100.0%
distribute-lft-out100.0%
Simplified100.0%
Taylor expanded in th around 0 76.4%
Taylor expanded in a1 around 0 73.8%
unpow273.8%
Simplified73.8%
Applied egg-rr70.3%
Final simplification52.6%
(FPCore (a1 a2 th) :precision binary64 (if (<= (* a2 a2) 2e-278) (/ (* a1 a1) (sqrt 2.0)) (* (cos th) (+ (* a2 a2) (* a1 a1)))))
double code(double a1, double a2, double th) {
double tmp;
if ((a2 * a2) <= 2e-278) {
tmp = (a1 * a1) / sqrt(2.0);
} else {
tmp = cos(th) * ((a2 * a2) + (a1 * a1));
}
return tmp;
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: tmp
if ((a2 * a2) <= 2d-278) then
tmp = (a1 * a1) / sqrt(2.0d0)
else
tmp = cos(th) * ((a2 * a2) + (a1 * a1))
end if
code = tmp
end function
public static double code(double a1, double a2, double th) {
double tmp;
if ((a2 * a2) <= 2e-278) {
tmp = (a1 * a1) / Math.sqrt(2.0);
} else {
tmp = Math.cos(th) * ((a2 * a2) + (a1 * a1));
}
return tmp;
}
def code(a1, a2, th): tmp = 0 if (a2 * a2) <= 2e-278: tmp = (a1 * a1) / math.sqrt(2.0) else: tmp = math.cos(th) * ((a2 * a2) + (a1 * a1)) return tmp
function code(a1, a2, th) tmp = 0.0 if (Float64(a2 * a2) <= 2e-278) tmp = Float64(Float64(a1 * a1) / sqrt(2.0)); else tmp = Float64(cos(th) * Float64(Float64(a2 * a2) + Float64(a1 * a1))); end return tmp end
function tmp_2 = code(a1, a2, th) tmp = 0.0; if ((a2 * a2) <= 2e-278) tmp = (a1 * a1) / sqrt(2.0); else tmp = cos(th) * ((a2 * a2) + (a1 * a1)); end tmp_2 = tmp; end
code[a1_, a2_, th_] := If[LessEqual[N[(a2 * a2), $MachinePrecision], 2e-278], N[(N[(a1 * a1), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision], N[(N[Cos[th], $MachinePrecision] * N[(N[(a2 * a2), $MachinePrecision] + N[(a1 * a1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a2 \cdot a2 \leq 2 \cdot 10^{-278}:\\
\;\;\;\;\frac{a1 \cdot a1}{\sqrt{2}}\\
\mathbf{else}:\\
\;\;\;\;\cos th \cdot \left(a2 \cdot a2 + a1 \cdot a1\right)\\
\end{array}
\end{array}
if (*.f64 a2 a2) < 1.99999999999999988e-278Initial program 99.6%
distribute-lft-out99.6%
associate-*l/99.6%
associate-*r/99.7%
fma-def99.7%
Simplified99.7%
Taylor expanded in a1 around inf 97.4%
unpow297.4%
associate-/l*97.4%
Simplified97.4%
Taylor expanded in th around 0 72.8%
if 1.99999999999999988e-278 < (*.f64 a2 a2) Initial program 99.6%
distribute-lft-out99.6%
Simplified99.6%
*-un-lft-identity99.6%
add-sqr-sqrt99.5%
times-frac99.3%
pow1/299.3%
sqrt-pow199.3%
metadata-eval99.3%
pow1/299.3%
sqrt-pow199.3%
metadata-eval99.3%
Applied egg-rr99.3%
Taylor expanded in th around inf 99.5%
Applied egg-rr58.4%
rem-log-exp58.4%
Simplified58.4%
Final simplification62.5%
(FPCore (a1 a2 th) :precision binary64 (if (<= a1 -1.95e+151) (* a1 (* (cos th) a1)) (if (<= a1 -4e+38) (* a1 (/ a1 (sqrt 2.0))) (* (* a2 a2) (sqrt 0.5)))))
double code(double a1, double a2, double th) {
double tmp;
if (a1 <= -1.95e+151) {
tmp = a1 * (cos(th) * a1);
} else if (a1 <= -4e+38) {
tmp = a1 * (a1 / sqrt(2.0));
} else {
tmp = (a2 * a2) * sqrt(0.5);
}
return tmp;
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: tmp
if (a1 <= (-1.95d+151)) then
tmp = a1 * (cos(th) * a1)
else if (a1 <= (-4d+38)) then
tmp = a1 * (a1 / sqrt(2.0d0))
else
tmp = (a2 * a2) * sqrt(0.5d0)
end if
code = tmp
end function
public static double code(double a1, double a2, double th) {
double tmp;
if (a1 <= -1.95e+151) {
tmp = a1 * (Math.cos(th) * a1);
} else if (a1 <= -4e+38) {
tmp = a1 * (a1 / Math.sqrt(2.0));
} else {
tmp = (a2 * a2) * Math.sqrt(0.5);
}
return tmp;
}
def code(a1, a2, th): tmp = 0 if a1 <= -1.95e+151: tmp = a1 * (math.cos(th) * a1) elif a1 <= -4e+38: tmp = a1 * (a1 / math.sqrt(2.0)) else: tmp = (a2 * a2) * math.sqrt(0.5) return tmp
function code(a1, a2, th) tmp = 0.0 if (a1 <= -1.95e+151) tmp = Float64(a1 * Float64(cos(th) * a1)); elseif (a1 <= -4e+38) tmp = Float64(a1 * Float64(a1 / sqrt(2.0))); else tmp = Float64(Float64(a2 * a2) * sqrt(0.5)); end return tmp end
function tmp_2 = code(a1, a2, th) tmp = 0.0; if (a1 <= -1.95e+151) tmp = a1 * (cos(th) * a1); elseif (a1 <= -4e+38) tmp = a1 * (a1 / sqrt(2.0)); else tmp = (a2 * a2) * sqrt(0.5); end tmp_2 = tmp; end
code[a1_, a2_, th_] := If[LessEqual[a1, -1.95e+151], N[(a1 * N[(N[Cos[th], $MachinePrecision] * a1), $MachinePrecision]), $MachinePrecision], If[LessEqual[a1, -4e+38], N[(a1 * N[(a1 / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a2 * a2), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a1 \leq -1.95 \cdot 10^{+151}:\\
\;\;\;\;a1 \cdot \left(\cos th \cdot a1\right)\\
\mathbf{elif}\;a1 \leq -4 \cdot 10^{+38}:\\
\;\;\;\;a1 \cdot \frac{a1}{\sqrt{2}}\\
\mathbf{else}:\\
\;\;\;\;\left(a2 \cdot a2\right) \cdot \sqrt{0.5}\\
\end{array}
\end{array}
if a1 < -1.94999999999999988e151Initial program 100.0%
distribute-lft-out100.0%
associate-*l/100.0%
associate-*r/100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in a1 around inf 100.0%
unpow2100.0%
Simplified100.0%
expm1-log1p-u100.0%
expm1-udef100.0%
div-inv100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
frac-times100.0%
metadata-eval100.0%
add-sqr-sqrt100.0%
metadata-eval100.0%
Applied egg-rr100.0%
expm1-def100.0%
expm1-log1p100.0%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in th around inf 100.0%
unpow2100.0%
associate-*l*100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Applied egg-rr100.0%
log-pow100.0%
rem-log-exp100.0%
*-commutative100.0%
Simplified100.0%
if -1.94999999999999988e151 < a1 < -3.99999999999999991e38Initial program 99.4%
distribute-lft-out99.4%
Simplified99.4%
Taylor expanded in th around 0 61.2%
Taylor expanded in a1 around inf 31.6%
unpow231.6%
associate-*r/31.7%
Simplified31.7%
if -3.99999999999999991e38 < a1 Initial program 99.6%
distribute-lft-out99.6%
Simplified99.6%
*-un-lft-identity99.6%
add-sqr-sqrt99.5%
times-frac99.2%
pow1/299.2%
sqrt-pow199.2%
metadata-eval99.2%
pow1/299.2%
sqrt-pow199.2%
metadata-eval99.2%
Applied egg-rr99.2%
Taylor expanded in th around 0 63.6%
*-commutative63.6%
unpow263.6%
unpow263.6%
Simplified63.6%
Taylor expanded in a2 around inf 41.9%
*-commutative41.9%
unpow241.9%
Simplified41.9%
Final simplification46.7%
(FPCore (a1 a2 th) :precision binary64 (if (<= a1 -1.95e+151) (* a1 (* (cos th) a1)) (if (<= a1 -1.55e+39) (* a1 (/ a1 (sqrt 2.0))) (* a2 (/ a2 (sqrt 2.0))))))
double code(double a1, double a2, double th) {
double tmp;
if (a1 <= -1.95e+151) {
tmp = a1 * (cos(th) * a1);
} else if (a1 <= -1.55e+39) {
tmp = a1 * (a1 / sqrt(2.0));
} else {
tmp = a2 * (a2 / sqrt(2.0));
}
return tmp;
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: tmp
if (a1 <= (-1.95d+151)) then
tmp = a1 * (cos(th) * a1)
else if (a1 <= (-1.55d+39)) then
tmp = a1 * (a1 / sqrt(2.0d0))
else
tmp = a2 * (a2 / sqrt(2.0d0))
end if
code = tmp
end function
public static double code(double a1, double a2, double th) {
double tmp;
if (a1 <= -1.95e+151) {
tmp = a1 * (Math.cos(th) * a1);
} else if (a1 <= -1.55e+39) {
tmp = a1 * (a1 / Math.sqrt(2.0));
} else {
tmp = a2 * (a2 / Math.sqrt(2.0));
}
return tmp;
}
def code(a1, a2, th): tmp = 0 if a1 <= -1.95e+151: tmp = a1 * (math.cos(th) * a1) elif a1 <= -1.55e+39: tmp = a1 * (a1 / math.sqrt(2.0)) else: tmp = a2 * (a2 / math.sqrt(2.0)) return tmp
function code(a1, a2, th) tmp = 0.0 if (a1 <= -1.95e+151) tmp = Float64(a1 * Float64(cos(th) * a1)); elseif (a1 <= -1.55e+39) tmp = Float64(a1 * Float64(a1 / sqrt(2.0))); else tmp = Float64(a2 * Float64(a2 / sqrt(2.0))); end return tmp end
function tmp_2 = code(a1, a2, th) tmp = 0.0; if (a1 <= -1.95e+151) tmp = a1 * (cos(th) * a1); elseif (a1 <= -1.55e+39) tmp = a1 * (a1 / sqrt(2.0)); else tmp = a2 * (a2 / sqrt(2.0)); end tmp_2 = tmp; end
code[a1_, a2_, th_] := If[LessEqual[a1, -1.95e+151], N[(a1 * N[(N[Cos[th], $MachinePrecision] * a1), $MachinePrecision]), $MachinePrecision], If[LessEqual[a1, -1.55e+39], N[(a1 * N[(a1 / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a2 * N[(a2 / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a1 \leq -1.95 \cdot 10^{+151}:\\
\;\;\;\;a1 \cdot \left(\cos th \cdot a1\right)\\
\mathbf{elif}\;a1 \leq -1.55 \cdot 10^{+39}:\\
\;\;\;\;a1 \cdot \frac{a1}{\sqrt{2}}\\
\mathbf{else}:\\
\;\;\;\;a2 \cdot \frac{a2}{\sqrt{2}}\\
\end{array}
\end{array}
if a1 < -1.94999999999999988e151Initial program 100.0%
distribute-lft-out100.0%
associate-*l/100.0%
associate-*r/100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in a1 around inf 100.0%
unpow2100.0%
Simplified100.0%
expm1-log1p-u100.0%
expm1-udef100.0%
div-inv100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
frac-times100.0%
metadata-eval100.0%
add-sqr-sqrt100.0%
metadata-eval100.0%
Applied egg-rr100.0%
expm1-def100.0%
expm1-log1p100.0%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in th around inf 100.0%
unpow2100.0%
associate-*l*100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Applied egg-rr100.0%
log-pow100.0%
rem-log-exp100.0%
*-commutative100.0%
Simplified100.0%
if -1.94999999999999988e151 < a1 < -1.5500000000000001e39Initial program 99.4%
distribute-lft-out99.4%
Simplified99.4%
Taylor expanded in th around 0 61.2%
Taylor expanded in a1 around inf 31.6%
unpow231.6%
associate-*r/31.7%
Simplified31.7%
if -1.5500000000000001e39 < a1 Initial program 99.6%
distribute-lft-out99.6%
Simplified99.6%
Taylor expanded in th around 0 63.6%
Taylor expanded in a1 around 0 41.9%
unpow241.9%
Simplified41.9%
Taylor expanded in a2 around 0 41.9%
unpow241.9%
associate-/l*41.9%
associate-/r/41.9%
Simplified41.9%
Final simplification46.8%
(FPCore (a1 a2 th) :precision binary64 (if (<= a1 -1.95e+151) (* a1 (* (cos th) a1)) (if (<= a1 -7e+37) (/ (* a1 a1) (sqrt 2.0)) (* a2 (/ a2 (sqrt 2.0))))))
double code(double a1, double a2, double th) {
double tmp;
if (a1 <= -1.95e+151) {
tmp = a1 * (cos(th) * a1);
} else if (a1 <= -7e+37) {
tmp = (a1 * a1) / sqrt(2.0);
} else {
tmp = a2 * (a2 / sqrt(2.0));
}
return tmp;
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: tmp
if (a1 <= (-1.95d+151)) then
tmp = a1 * (cos(th) * a1)
else if (a1 <= (-7d+37)) then
tmp = (a1 * a1) / sqrt(2.0d0)
else
tmp = a2 * (a2 / sqrt(2.0d0))
end if
code = tmp
end function
public static double code(double a1, double a2, double th) {
double tmp;
if (a1 <= -1.95e+151) {
tmp = a1 * (Math.cos(th) * a1);
} else if (a1 <= -7e+37) {
tmp = (a1 * a1) / Math.sqrt(2.0);
} else {
tmp = a2 * (a2 / Math.sqrt(2.0));
}
return tmp;
}
def code(a1, a2, th): tmp = 0 if a1 <= -1.95e+151: tmp = a1 * (math.cos(th) * a1) elif a1 <= -7e+37: tmp = (a1 * a1) / math.sqrt(2.0) else: tmp = a2 * (a2 / math.sqrt(2.0)) return tmp
function code(a1, a2, th) tmp = 0.0 if (a1 <= -1.95e+151) tmp = Float64(a1 * Float64(cos(th) * a1)); elseif (a1 <= -7e+37) tmp = Float64(Float64(a1 * a1) / sqrt(2.0)); else tmp = Float64(a2 * Float64(a2 / sqrt(2.0))); end return tmp end
function tmp_2 = code(a1, a2, th) tmp = 0.0; if (a1 <= -1.95e+151) tmp = a1 * (cos(th) * a1); elseif (a1 <= -7e+37) tmp = (a1 * a1) / sqrt(2.0); else tmp = a2 * (a2 / sqrt(2.0)); end tmp_2 = tmp; end
code[a1_, a2_, th_] := If[LessEqual[a1, -1.95e+151], N[(a1 * N[(N[Cos[th], $MachinePrecision] * a1), $MachinePrecision]), $MachinePrecision], If[LessEqual[a1, -7e+37], N[(N[(a1 * a1), $MachinePrecision] / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision], N[(a2 * N[(a2 / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a1 \leq -1.95 \cdot 10^{+151}:\\
\;\;\;\;a1 \cdot \left(\cos th \cdot a1\right)\\
\mathbf{elif}\;a1 \leq -7 \cdot 10^{+37}:\\
\;\;\;\;\frac{a1 \cdot a1}{\sqrt{2}}\\
\mathbf{else}:\\
\;\;\;\;a2 \cdot \frac{a2}{\sqrt{2}}\\
\end{array}
\end{array}
if a1 < -1.94999999999999988e151Initial program 100.0%
distribute-lft-out100.0%
associate-*l/100.0%
associate-*r/100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in a1 around inf 100.0%
unpow2100.0%
Simplified100.0%
expm1-log1p-u100.0%
expm1-udef100.0%
div-inv100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
frac-times100.0%
metadata-eval100.0%
add-sqr-sqrt100.0%
metadata-eval100.0%
Applied egg-rr100.0%
expm1-def100.0%
expm1-log1p100.0%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in th around inf 100.0%
unpow2100.0%
associate-*l*100.0%
associate-*r*100.0%
*-commutative100.0%
associate-*l*100.0%
Simplified100.0%
Applied egg-rr100.0%
log-pow100.0%
rem-log-exp100.0%
*-commutative100.0%
Simplified100.0%
if -1.94999999999999988e151 < a1 < -7e37Initial program 99.4%
distribute-lft-out99.4%
associate-*l/99.4%
associate-*r/99.5%
fma-def99.5%
Simplified99.5%
Taylor expanded in a1 around inf 63.4%
unpow263.4%
associate-/l*63.3%
Simplified63.3%
Taylor expanded in th around 0 31.6%
if -7e37 < a1 Initial program 99.6%
distribute-lft-out99.6%
Simplified99.6%
Taylor expanded in th around 0 63.6%
Taylor expanded in a1 around 0 41.9%
unpow241.9%
Simplified41.9%
Taylor expanded in a2 around 0 41.9%
unpow241.9%
associate-/l*41.9%
associate-/r/41.9%
Simplified41.9%
Final simplification46.8%
(FPCore (a1 a2 th) :precision binary64 (if (<= a2 1.05e+117) (* a1 (* (cos th) a1)) (* a2 a2)))
double code(double a1, double a2, double th) {
double tmp;
if (a2 <= 1.05e+117) {
tmp = a1 * (cos(th) * a1);
} else {
tmp = a2 * a2;
}
return tmp;
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: tmp
if (a2 <= 1.05d+117) then
tmp = a1 * (cos(th) * a1)
else
tmp = a2 * a2
end if
code = tmp
end function
public static double code(double a1, double a2, double th) {
double tmp;
if (a2 <= 1.05e+117) {
tmp = a1 * (Math.cos(th) * a1);
} else {
tmp = a2 * a2;
}
return tmp;
}
def code(a1, a2, th): tmp = 0 if a2 <= 1.05e+117: tmp = a1 * (math.cos(th) * a1) else: tmp = a2 * a2 return tmp
function code(a1, a2, th) tmp = 0.0 if (a2 <= 1.05e+117) tmp = Float64(a1 * Float64(cos(th) * a1)); else tmp = Float64(a2 * a2); end return tmp end
function tmp_2 = code(a1, a2, th) tmp = 0.0; if (a2 <= 1.05e+117) tmp = a1 * (cos(th) * a1); else tmp = a2 * a2; end tmp_2 = tmp; end
code[a1_, a2_, th_] := If[LessEqual[a2, 1.05e+117], N[(a1 * N[(N[Cos[th], $MachinePrecision] * a1), $MachinePrecision]), $MachinePrecision], N[(a2 * a2), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a2 \leq 1.05 \cdot 10^{+117}:\\
\;\;\;\;a1 \cdot \left(\cos th \cdot a1\right)\\
\mathbf{else}:\\
\;\;\;\;a2 \cdot a2\\
\end{array}
\end{array}
if a2 < 1.0500000000000001e117Initial program 99.6%
distribute-lft-out99.6%
associate-*l/99.6%
associate-*r/99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in a1 around inf 63.0%
unpow263.0%
Simplified63.0%
expm1-log1p-u61.3%
expm1-udef51.7%
div-inv51.7%
add-sqr-sqrt51.7%
sqrt-unprod51.7%
frac-times51.7%
metadata-eval51.7%
add-sqr-sqrt51.7%
metadata-eval51.7%
Applied egg-rr51.7%
expm1-def61.3%
expm1-log1p62.9%
associate-*r*62.9%
Simplified62.9%
Taylor expanded in th around inf 62.9%
unpow262.9%
associate-*l*62.9%
associate-*r*62.9%
*-commutative62.9%
associate-*l*62.9%
Simplified62.9%
Applied egg-rr38.2%
log-pow38.2%
rem-log-exp39.4%
*-commutative39.4%
Simplified39.4%
if 1.0500000000000001e117 < a2 Initial program 99.9%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in th around 0 69.2%
Taylor expanded in a1 around 0 66.9%
unpow266.9%
Simplified66.9%
Applied egg-rr60.8%
Final simplification42.6%
(FPCore (a1 a2 th) :precision binary64 (if (<= a2 2e+67) (* a1 (* a1 (- -2.0))) (* a2 a2)))
double code(double a1, double a2, double th) {
double tmp;
if (a2 <= 2e+67) {
tmp = a1 * (a1 * -(-2.0));
} else {
tmp = a2 * a2;
}
return tmp;
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: tmp
if (a2 <= 2d+67) then
tmp = a1 * (a1 * -(-2.0d0))
else
tmp = a2 * a2
end if
code = tmp
end function
public static double code(double a1, double a2, double th) {
double tmp;
if (a2 <= 2e+67) {
tmp = a1 * (a1 * -(-2.0));
} else {
tmp = a2 * a2;
}
return tmp;
}
def code(a1, a2, th): tmp = 0 if a2 <= 2e+67: tmp = a1 * (a1 * -(-2.0)) else: tmp = a2 * a2 return tmp
function code(a1, a2, th) tmp = 0.0 if (a2 <= 2e+67) tmp = Float64(a1 * Float64(a1 * Float64(-(-2.0)))); else tmp = Float64(a2 * a2); end return tmp end
function tmp_2 = code(a1, a2, th) tmp = 0.0; if (a2 <= 2e+67) tmp = a1 * (a1 * -(-2.0)); else tmp = a2 * a2; end tmp_2 = tmp; end
code[a1_, a2_, th_] := If[LessEqual[a2, 2e+67], N[(a1 * N[(a1 * (--2.0)), $MachinePrecision]), $MachinePrecision], N[(a2 * a2), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a2 \leq 2 \cdot 10^{+67}:\\
\;\;\;\;a1 \cdot \left(a1 \cdot \left(--2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a2 \cdot a2\\
\end{array}
\end{array}
if a2 < 1.99999999999999997e67Initial program 99.5%
distribute-lft-out99.6%
Simplified99.6%
Taylor expanded in th around 0 64.1%
Taylor expanded in a1 around inf 43.9%
unpow243.9%
associate-*r/43.9%
Simplified43.9%
frac-2neg43.9%
div-inv43.9%
Applied egg-rr43.9%
Applied egg-rr32.5%
if 1.99999999999999997e67 < a2 Initial program 99.8%
distribute-lft-out99.8%
Simplified99.8%
Taylor expanded in th around 0 65.4%
Taylor expanded in a1 around 0 62.2%
unpow262.2%
Simplified62.2%
Applied egg-rr51.6%
Final simplification36.1%
(FPCore (a1 a2 th) :precision binary64 (if (<= a2 6.2e+66) (* a1 (* a1 (- -0.5))) (* a2 a2)))
double code(double a1, double a2, double th) {
double tmp;
if (a2 <= 6.2e+66) {
tmp = a1 * (a1 * -(-0.5));
} else {
tmp = a2 * a2;
}
return tmp;
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: tmp
if (a2 <= 6.2d+66) then
tmp = a1 * (a1 * -(-0.5d0))
else
tmp = a2 * a2
end if
code = tmp
end function
public static double code(double a1, double a2, double th) {
double tmp;
if (a2 <= 6.2e+66) {
tmp = a1 * (a1 * -(-0.5));
} else {
tmp = a2 * a2;
}
return tmp;
}
def code(a1, a2, th): tmp = 0 if a2 <= 6.2e+66: tmp = a1 * (a1 * -(-0.5)) else: tmp = a2 * a2 return tmp
function code(a1, a2, th) tmp = 0.0 if (a2 <= 6.2e+66) tmp = Float64(a1 * Float64(a1 * Float64(-(-0.5)))); else tmp = Float64(a2 * a2); end return tmp end
function tmp_2 = code(a1, a2, th) tmp = 0.0; if (a2 <= 6.2e+66) tmp = a1 * (a1 * -(-0.5)); else tmp = a2 * a2; end tmp_2 = tmp; end
code[a1_, a2_, th_] := If[LessEqual[a2, 6.2e+66], N[(a1 * N[(a1 * (--0.5)), $MachinePrecision]), $MachinePrecision], N[(a2 * a2), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a2 \leq 6.2 \cdot 10^{+66}:\\
\;\;\;\;a1 \cdot \left(a1 \cdot \left(--0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a2 \cdot a2\\
\end{array}
\end{array}
if a2 < 6.20000000000000037e66Initial program 99.5%
distribute-lft-out99.6%
Simplified99.6%
Taylor expanded in th around 0 64.1%
Taylor expanded in a1 around inf 43.9%
unpow243.9%
associate-*r/43.9%
Simplified43.9%
frac-2neg43.9%
div-inv43.9%
Applied egg-rr43.9%
Applied egg-rr33.0%
if 6.20000000000000037e66 < a2 Initial program 99.8%
distribute-lft-out99.8%
Simplified99.8%
Taylor expanded in th around 0 65.4%
Taylor expanded in a1 around 0 62.2%
unpow262.2%
Simplified62.2%
Applied egg-rr51.6%
Final simplification36.5%
(FPCore (a1 a2 th) :precision binary64 (if (<= a1 -2e+158) (* a1 (* a1 -0.5)) (* a2 a2)))
double code(double a1, double a2, double th) {
double tmp;
if (a1 <= -2e+158) {
tmp = a1 * (a1 * -0.5);
} else {
tmp = a2 * a2;
}
return tmp;
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: tmp
if (a1 <= (-2d+158)) then
tmp = a1 * (a1 * (-0.5d0))
else
tmp = a2 * a2
end if
code = tmp
end function
public static double code(double a1, double a2, double th) {
double tmp;
if (a1 <= -2e+158) {
tmp = a1 * (a1 * -0.5);
} else {
tmp = a2 * a2;
}
return tmp;
}
def code(a1, a2, th): tmp = 0 if a1 <= -2e+158: tmp = a1 * (a1 * -0.5) else: tmp = a2 * a2 return tmp
function code(a1, a2, th) tmp = 0.0 if (a1 <= -2e+158) tmp = Float64(a1 * Float64(a1 * -0.5)); else tmp = Float64(a2 * a2); end return tmp end
function tmp_2 = code(a1, a2, th) tmp = 0.0; if (a1 <= -2e+158) tmp = a1 * (a1 * -0.5); else tmp = a2 * a2; end tmp_2 = tmp; end
code[a1_, a2_, th_] := If[LessEqual[a1, -2e+158], N[(a1 * N[(a1 * -0.5), $MachinePrecision]), $MachinePrecision], N[(a2 * a2), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a1 \leq -2 \cdot 10^{+158}:\\
\;\;\;\;a1 \cdot \left(a1 \cdot -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;a2 \cdot a2\\
\end{array}
\end{array}
if a1 < -1.99999999999999991e158Initial program 100.0%
distribute-lft-out100.0%
Simplified100.0%
*-un-lft-identity100.0%
add-sqr-sqrt100.0%
times-frac100.0%
pow1/2100.0%
sqrt-pow1100.0%
metadata-eval100.0%
pow1/2100.0%
sqrt-pow1100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in th around 0 70.8%
*-commutative70.8%
unpow270.8%
unpow270.8%
Simplified70.8%
Taylor expanded in a2 around 0 70.8%
unpow270.8%
Simplified70.8%
Applied egg-rr29.2%
*-rgt-identity29.2%
metadata-eval29.2%
associate-*r/29.2%
associate-/r/29.2%
metadata-eval29.2%
metadata-eval29.2%
Simplified29.2%
if -1.99999999999999991e158 < a1 Initial program 99.6%
distribute-lft-out99.6%
Simplified99.6%
Taylor expanded in th around 0 63.7%
Taylor expanded in a1 around 0 40.4%
unpow240.4%
Simplified40.4%
Applied egg-rr30.2%
Final simplification30.1%
(FPCore (a1 a2 th) :precision binary64 (if (<= a2 6e+66) (* a1 a1) (* a2 a2)))
double code(double a1, double a2, double th) {
double tmp;
if (a2 <= 6e+66) {
tmp = a1 * a1;
} else {
tmp = a2 * a2;
}
return tmp;
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
real(8) :: tmp
if (a2 <= 6d+66) then
tmp = a1 * a1
else
tmp = a2 * a2
end if
code = tmp
end function
public static double code(double a1, double a2, double th) {
double tmp;
if (a2 <= 6e+66) {
tmp = a1 * a1;
} else {
tmp = a2 * a2;
}
return tmp;
}
def code(a1, a2, th): tmp = 0 if a2 <= 6e+66: tmp = a1 * a1 else: tmp = a2 * a2 return tmp
function code(a1, a2, th) tmp = 0.0 if (a2 <= 6e+66) tmp = Float64(a1 * a1); else tmp = Float64(a2 * a2); end return tmp end
function tmp_2 = code(a1, a2, th) tmp = 0.0; if (a2 <= 6e+66) tmp = a1 * a1; else tmp = a2 * a2; end tmp_2 = tmp; end
code[a1_, a2_, th_] := If[LessEqual[a2, 6e+66], N[(a1 * a1), $MachinePrecision], N[(a2 * a2), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a2 \leq 6 \cdot 10^{+66}:\\
\;\;\;\;a1 \cdot a1\\
\mathbf{else}:\\
\;\;\;\;a2 \cdot a2\\
\end{array}
\end{array}
if a2 < 6.00000000000000005e66Initial program 99.5%
distribute-lft-out99.6%
Simplified99.6%
Taylor expanded in th around 0 64.1%
Taylor expanded in a1 around inf 43.9%
unpow243.9%
associate-*r/43.9%
Simplified43.9%
frac-2neg43.9%
div-inv43.9%
Applied egg-rr43.9%
Applied egg-rr33.0%
if 6.00000000000000005e66 < a2 Initial program 99.8%
distribute-lft-out99.8%
Simplified99.8%
Taylor expanded in th around 0 65.4%
Taylor expanded in a1 around 0 62.2%
unpow262.2%
Simplified62.2%
Applied egg-rr51.6%
Final simplification36.5%
(FPCore (a1 a2 th) :precision binary64 (* a2 a2))
double code(double a1, double a2, double th) {
return a2 * a2;
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
code = a2 * a2
end function
public static double code(double a1, double a2, double th) {
return a2 * a2;
}
def code(a1, a2, th): return a2 * a2
function code(a1, a2, th) return Float64(a2 * a2) end
function tmp = code(a1, a2, th) tmp = a2 * a2; end
code[a1_, a2_, th_] := N[(a2 * a2), $MachinePrecision]
\begin{array}{l}
\\
a2 \cdot a2
\end{array}
Initial program 99.6%
distribute-lft-out99.6%
Simplified99.6%
Taylor expanded in th around 0 64.3%
Taylor expanded in a1 around 0 38.3%
unpow238.3%
Simplified38.3%
Applied egg-rr29.1%
Final simplification29.1%
(FPCore (a1 a2 th) :precision binary64 1.0)
double code(double a1, double a2, double th) {
return 1.0;
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
code = 1.0d0
end function
public static double code(double a1, double a2, double th) {
return 1.0;
}
def code(a1, a2, th): return 1.0
function code(a1, a2, th) return 1.0 end
function tmp = code(a1, a2, th) tmp = 1.0; end
code[a1_, a2_, th_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 99.6%
distribute-lft-out99.6%
Simplified99.6%
*-un-lft-identity99.6%
add-sqr-sqrt99.5%
times-frac99.3%
pow1/299.3%
sqrt-pow199.3%
metadata-eval99.3%
pow1/299.3%
sqrt-pow199.3%
metadata-eval99.3%
Applied egg-rr99.3%
Taylor expanded in th around inf 99.6%
Applied egg-rr3.5%
*-inverses3.5%
Simplified3.5%
Final simplification3.5%
(FPCore (a1 a2 th) :precision binary64 a2)
double code(double a1, double a2, double th) {
return a2;
}
real(8) function code(a1, a2, th)
real(8), intent (in) :: a1
real(8), intent (in) :: a2
real(8), intent (in) :: th
code = a2
end function
public static double code(double a1, double a2, double th) {
return a2;
}
def code(a1, a2, th): return a2
function code(a1, a2, th) return a2 end
function tmp = code(a1, a2, th) tmp = a2; end
code[a1_, a2_, th_] := a2
\begin{array}{l}
\\
a2
\end{array}
Initial program 99.6%
distribute-lft-out99.6%
Simplified99.6%
Taylor expanded in th around 0 64.3%
Taylor expanded in a1 around 0 38.3%
unpow238.3%
Simplified38.3%
Applied egg-rr4.6%
unpow14.6%
metadata-eval4.6%
sqr-pow2.3%
fabs-sqr2.3%
sqr-pow3.7%
metadata-eval3.7%
unpow13.7%
Simplified3.7%
Final simplification3.7%
herbie shell --seed 2023195
(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))))