
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* (/ angle 180.0) PI))) (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * ((double) M_PI);
return pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * Math.PI;
return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
def code(a, b, angle): t_0 = (angle / 180.0) * math.pi return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(Float64(angle / 180.0) * pi) return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = (angle / 180.0) * pi; tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* (/ angle 180.0) PI))) (+ (pow (* a (sin t_0)) 2.0) (pow (* b (cos t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * ((double) M_PI);
return pow((a * sin(t_0)), 2.0) + pow((b * cos(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = (angle / 180.0) * Math.PI;
return Math.pow((a * Math.sin(t_0)), 2.0) + Math.pow((b * Math.cos(t_0)), 2.0);
}
def code(a, b, angle): t_0 = (angle / 180.0) * math.pi return math.pow((a * math.sin(t_0)), 2.0) + math.pow((b * math.cos(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(Float64(angle / 180.0) * pi) return Float64((Float64(a * sin(t_0)) ^ 2.0) + (Float64(b * cos(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = (angle / 180.0) * pi; tmp = ((a * sin(t_0)) ^ 2.0) + ((b * cos(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \pi\\
{\left(a \cdot \sin t\_0\right)}^{2} + {\left(b \cdot \cos t\_0\right)}^{2}
\end{array}
\end{array}
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (pow (cbrt (sqrt PI)) 3.0)))
(+
(pow (* a (sin (* (/ angle 180.0) PI))) 2.0)
(pow (* b (cos (/ (* t_0 t_0) (* 180.0 (/ 1.0 angle))))) 2.0))))
double code(double a, double b, double angle) {
double t_0 = pow(cbrt(sqrt(((double) M_PI))), 3.0);
return pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos(((t_0 * t_0) / (180.0 * (1.0 / angle))))), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.pow(Math.cbrt(Math.sqrt(Math.PI)), 3.0);
return Math.pow((a * Math.sin(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos(((t_0 * t_0) / (180.0 * (1.0 / angle))))), 2.0);
}
function code(a, b, angle) t_0 = cbrt(sqrt(pi)) ^ 3.0 return Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(Float64(t_0 * t_0) / Float64(180.0 * Float64(1.0 / angle))))) ^ 2.0)) end
code[a_, b_, angle_] := Block[{t$95$0 = N[Power[N[Power[N[Sqrt[Pi], $MachinePrecision], 1/3], $MachinePrecision], 3.0], $MachinePrecision]}, N[(N[Power[N[(a * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[(t$95$0 * t$95$0), $MachinePrecision] / N[(180.0 * N[(1.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\sqrt[3]{\sqrt{\pi}}\right)}^{3}\\
{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{t\_0 \cdot t\_0}{180 \cdot \frac{1}{angle}}\right)\right)}^{2}
\end{array}
\end{array}
Initial program 76.8%
lift-PI.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-PI.f64N/A
add-cube-cbrtN/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lift-PI.f64N/A
lower-cbrt.f6477.0
Applied rewrites77.0%
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-cbrt.f64N/A
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
Applied rewrites76.8%
add-cube-cbrtN/A
pow3N/A
lift-PI.f64N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
cbrt-prodN/A
unpow-prod-downN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-cbrt.f64N/A
lower-pow.f64N/A
lower-cbrt.f6477.1
Applied rewrites77.1%
Final simplification77.1%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (cos (* (sqrt PI) (* (sqrt PI) (* angle 0.005555555555555556))))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos((sqrt(((double) M_PI)) * (sqrt(((double) M_PI)) * (angle * 0.005555555555555556))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos((Math.sqrt(Math.PI) * (Math.sqrt(Math.PI) * (angle * 0.005555555555555556))))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin(((angle / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos((math.sqrt(math.pi) * (math.sqrt(math.pi) * (angle * 0.005555555555555556))))), 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(sqrt(pi) * Float64(sqrt(pi) * Float64(angle * 0.005555555555555556))))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin(((angle / 180.0) * pi))) ^ 2.0) + ((b * cos((sqrt(pi) * (sqrt(pi) * (angle * 0.005555555555555556))))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(N[Sqrt[Pi], $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\sqrt{\pi} \cdot \left(\sqrt{\pi} \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}^{2}
\end{array}
Initial program 76.8%
lift-PI.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-PI.f64N/A
add-cube-cbrtN/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lift-PI.f64N/A
lower-cbrt.f6477.0
Applied rewrites77.0%
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
Applied rewrites77.0%
Final simplification77.0%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (cos (/ 1.0 (/ (/ 180.0 angle) PI)))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow((b * cos((1.0 / ((180.0 / angle) / ((double) M_PI))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin(((angle / 180.0) * Math.PI))), 2.0) + Math.pow((b * Math.cos((1.0 / ((180.0 / angle) / Math.PI)))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin(((angle / 180.0) * math.pi))), 2.0) + math.pow((b * math.cos((1.0 / ((180.0 / angle) / math.pi)))), 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (Float64(b * cos(Float64(1.0 / Float64(Float64(180.0 / angle) / pi)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin(((angle / 180.0) * pi))) ^ 2.0) + ((b * cos((1.0 / ((180.0 / angle) / pi)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Cos[N[(1.0 / N[(N[(180.0 / angle), $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{1}{\frac{\frac{180}{angle}}{\pi}}\right)\right)}^{2}
\end{array}
Initial program 76.8%
lift-PI.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-PI.f64N/A
add-cube-cbrtN/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lift-PI.f64N/A
lower-cbrt.f6477.0
Applied rewrites77.0%
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-cbrt.f64N/A
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
Applied rewrites77.0%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow b 2.0)))
double code(double a, double b, double angle) {
return pow((a * sin(((angle / 180.0) * ((double) M_PI)))), 2.0) + pow(b, 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.sin(((angle / 180.0) * Math.PI))), 2.0) + Math.pow(b, 2.0);
}
def code(a, b, angle): return math.pow((a * math.sin(((angle / 180.0) * math.pi))), 2.0) + math.pow(b, 2.0)
function code(a, b, angle) return Float64((Float64(a * sin(Float64(Float64(angle / 180.0) * pi))) ^ 2.0) + (b ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * sin(((angle / 180.0) * pi))) ^ 2.0) + (b ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[b, 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \pi\right)\right)}^{2} + {b}^{2}
\end{array}
Initial program 76.8%
Taylor expanded in angle around 0
Applied rewrites76.9%
Final simplification76.9%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (cos (* PI (* angle 0.011111111111111112)))))
(if (<= (/ angle 180.0) 5e-6)
(fma (pow (* angle (* a 0.005555555555555556)) 2.0) (* PI PI) (* b b))
(fma
(* (* a -0.5) t_0)
a
(fma a (* a 0.5) (* (* b b) (fma 0.5 t_0 0.5)))))))
double code(double a, double b, double angle) {
double t_0 = cos((((double) M_PI) * (angle * 0.011111111111111112)));
double tmp;
if ((angle / 180.0) <= 5e-6) {
tmp = fma(pow((angle * (a * 0.005555555555555556)), 2.0), (((double) M_PI) * ((double) M_PI)), (b * b));
} else {
tmp = fma(((a * -0.5) * t_0), a, fma(a, (a * 0.5), ((b * b) * fma(0.5, t_0, 0.5))));
}
return tmp;
}
function code(a, b, angle) t_0 = cos(Float64(pi * Float64(angle * 0.011111111111111112))) tmp = 0.0 if (Float64(angle / 180.0) <= 5e-6) tmp = fma((Float64(angle * Float64(a * 0.005555555555555556)) ^ 2.0), Float64(pi * pi), Float64(b * b)); else tmp = fma(Float64(Float64(a * -0.5) * t_0), a, fma(a, Float64(a * 0.5), Float64(Float64(b * b) * fma(0.5, t_0, 0.5)))); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[Cos[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e-6], N[(N[Power[N[(angle * N[(a * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * -0.5), $MachinePrecision] * t$95$0), $MachinePrecision] * a + N[(a * N[(a * 0.5), $MachinePrecision] + N[(N[(b * b), $MachinePrecision] * N[(0.5 * t$95$0 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\
\mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left({\left(angle \cdot \left(a \cdot 0.005555555555555556\right)\right)}^{2}, \pi \cdot \pi, b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(a \cdot -0.5\right) \cdot t\_0, a, \mathsf{fma}\left(a, a \cdot 0.5, \left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, t\_0, 0.5\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000041e-6Initial program 82.9%
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6482.9
rem-exp-logN/A
unpow1N/A
log-powN/A
lift-pow.f64N/A
log-powN/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites46.7%
Taylor expanded in angle around 0
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
log-EN/A
*-lft-identityN/A
lower-+.f64N/A
lower-log.f64N/A
lower-log.f64N/A
Applied rewrites17.2%
lift-log.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-log.f64N/A
rem-log-expN/A
lift-+.f64N/A
pow-to-expN/A
exp-prodN/A
lift-*.f64N/A
lift-exp.f64N/A
lift-*.f64N/A
Applied rewrites79.2%
if 5.00000000000000041e-6 < (/.f64 angle #s(literal 180 binary64)) Initial program 61.0%
lift-PI.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-PI.f64N/A
add-cube-cbrtN/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lift-PI.f64N/A
lower-cbrt.f6461.0
Applied rewrites61.0%
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-cbrt.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
Applied rewrites60.9%
Applied rewrites60.8%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (cos (* PI (* angle 0.011111111111111112)))))
(if (<= (/ angle 180.0) 5e-6)
(fma (pow (* angle (* a 0.005555555555555556)) 2.0) (* PI PI) (* b b))
(fma (* a (fma t_0 -0.5 0.5)) a (* (* b b) (fma 0.5 t_0 0.5))))))
double code(double a, double b, double angle) {
double t_0 = cos((((double) M_PI) * (angle * 0.011111111111111112)));
double tmp;
if ((angle / 180.0) <= 5e-6) {
tmp = fma(pow((angle * (a * 0.005555555555555556)), 2.0), (((double) M_PI) * ((double) M_PI)), (b * b));
} else {
tmp = fma((a * fma(t_0, -0.5, 0.5)), a, ((b * b) * fma(0.5, t_0, 0.5)));
}
return tmp;
}
function code(a, b, angle) t_0 = cos(Float64(pi * Float64(angle * 0.011111111111111112))) tmp = 0.0 if (Float64(angle / 180.0) <= 5e-6) tmp = fma((Float64(angle * Float64(a * 0.005555555555555556)) ^ 2.0), Float64(pi * pi), Float64(b * b)); else tmp = fma(Float64(a * fma(t_0, -0.5, 0.5)), a, Float64(Float64(b * b) * fma(0.5, t_0, 0.5))); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[Cos[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e-6], N[(N[Power[N[(angle * N[(a * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(t$95$0 * -0.5 + 0.5), $MachinePrecision]), $MachinePrecision] * a + N[(N[(b * b), $MachinePrecision] * N[(0.5 * t$95$0 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\
\mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left({\left(angle \cdot \left(a \cdot 0.005555555555555556\right)\right)}^{2}, \pi \cdot \pi, b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot \mathsf{fma}\left(t\_0, -0.5, 0.5\right), a, \left(b \cdot b\right) \cdot \mathsf{fma}\left(0.5, t\_0, 0.5\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000041e-6Initial program 82.9%
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6482.9
rem-exp-logN/A
unpow1N/A
log-powN/A
lift-pow.f64N/A
log-powN/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites46.7%
Taylor expanded in angle around 0
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
log-EN/A
*-lft-identityN/A
lower-+.f64N/A
lower-log.f64N/A
lower-log.f64N/A
Applied rewrites17.2%
lift-log.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-log.f64N/A
rem-log-expN/A
lift-+.f64N/A
pow-to-expN/A
exp-prodN/A
lift-*.f64N/A
lift-exp.f64N/A
lift-*.f64N/A
Applied rewrites79.2%
if 5.00000000000000041e-6 < (/.f64 angle #s(literal 180 binary64)) Initial program 61.0%
lift-PI.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-PI.f64N/A
add-cube-cbrtN/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lift-PI.f64N/A
lower-cbrt.f6461.0
Applied rewrites61.0%
Applied rewrites60.8%
Final simplification74.1%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (cos (* PI (* angle 0.011111111111111112)))))
(if (<= (/ angle 180.0) 5e-6)
(fma (pow (* angle (* a 0.005555555555555556)) 2.0) (* PI PI) (* b b))
(fma b (* b (fma 0.5 t_0 0.5)) (* (fma t_0 -0.5 0.5) (* a a))))))
double code(double a, double b, double angle) {
double t_0 = cos((((double) M_PI) * (angle * 0.011111111111111112)));
double tmp;
if ((angle / 180.0) <= 5e-6) {
tmp = fma(pow((angle * (a * 0.005555555555555556)), 2.0), (((double) M_PI) * ((double) M_PI)), (b * b));
} else {
tmp = fma(b, (b * fma(0.5, t_0, 0.5)), (fma(t_0, -0.5, 0.5) * (a * a)));
}
return tmp;
}
function code(a, b, angle) t_0 = cos(Float64(pi * Float64(angle * 0.011111111111111112))) tmp = 0.0 if (Float64(angle / 180.0) <= 5e-6) tmp = fma((Float64(angle * Float64(a * 0.005555555555555556)) ^ 2.0), Float64(pi * pi), Float64(b * b)); else tmp = fma(b, Float64(b * fma(0.5, t_0, 0.5)), Float64(fma(t_0, -0.5, 0.5) * Float64(a * a))); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[Cos[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e-6], N[(N[Power[N[(angle * N[(a * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], N[(b * N[(b * N[(0.5 * t$95$0 + 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(t$95$0 * -0.5 + 0.5), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\
\mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left({\left(angle \cdot \left(a \cdot 0.005555555555555556\right)\right)}^{2}, \pi \cdot \pi, b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, b \cdot \mathsf{fma}\left(0.5, t\_0, 0.5\right), \mathsf{fma}\left(t\_0, -0.5, 0.5\right) \cdot \left(a \cdot a\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000041e-6Initial program 82.9%
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6482.9
rem-exp-logN/A
unpow1N/A
log-powN/A
lift-pow.f64N/A
log-powN/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites46.7%
Taylor expanded in angle around 0
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
log-EN/A
*-lft-identityN/A
lower-+.f64N/A
lower-log.f64N/A
lower-log.f64N/A
Applied rewrites17.2%
lift-log.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-log.f64N/A
rem-log-expN/A
lift-+.f64N/A
pow-to-expN/A
exp-prodN/A
lift-*.f64N/A
lift-exp.f64N/A
lift-*.f64N/A
Applied rewrites79.2%
if 5.00000000000000041e-6 < (/.f64 angle #s(literal 180 binary64)) Initial program 61.0%
lift-PI.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-PI.f64N/A
add-cube-cbrtN/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lift-PI.f64N/A
lower-cbrt.f6461.0
Applied rewrites61.0%
Applied rewrites60.8%
Final simplification74.1%
(FPCore (a b angle)
:precision binary64
(if (<= a 7.2e+84)
(+
(pow b 2.0)
(fma
(* a a)
0.5
(* (* a a) (* -0.5 (cos (* PI (* angle 0.011111111111111112)))))))
(fma (pow (* angle (* a 0.005555555555555556)) 2.0) (* PI PI) (* b b))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 7.2e+84) {
tmp = pow(b, 2.0) + fma((a * a), 0.5, ((a * a) * (-0.5 * cos((((double) M_PI) * (angle * 0.011111111111111112))))));
} else {
tmp = fma(pow((angle * (a * 0.005555555555555556)), 2.0), (((double) M_PI) * ((double) M_PI)), (b * b));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (a <= 7.2e+84) tmp = Float64((b ^ 2.0) + fma(Float64(a * a), 0.5, Float64(Float64(a * a) * Float64(-0.5 * cos(Float64(pi * Float64(angle * 0.011111111111111112))))))); else tmp = fma((Float64(angle * Float64(a * 0.005555555555555556)) ^ 2.0), Float64(pi * pi), Float64(b * b)); end return tmp end
code[a_, b_, angle_] := If[LessEqual[a, 7.2e+84], N[(N[Power[b, 2.0], $MachinePrecision] + N[(N[(a * a), $MachinePrecision] * 0.5 + N[(N[(a * a), $MachinePrecision] * N[(-0.5 * N[Cos[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(angle * N[(a * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 7.2 \cdot 10^{+84}:\\
\;\;\;\;{b}^{2} + \mathsf{fma}\left(a \cdot a, 0.5, \left(a \cdot a\right) \cdot \left(-0.5 \cdot \cos \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left({\left(angle \cdot \left(a \cdot 0.005555555555555556\right)\right)}^{2}, \pi \cdot \pi, b \cdot b\right)\\
\end{array}
\end{array}
if a < 7.1999999999999999e84Initial program 73.1%
clear-numN/A
lift-PI.f64N/A
associate-*l/N/A
*-commutativeN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6473.1
Applied rewrites73.1%
Applied rewrites61.2%
Taylor expanded in angle around 0
Applied rewrites61.3%
if 7.1999999999999999e84 < a Initial program 90.6%
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6490.6
rem-exp-logN/A
unpow1N/A
log-powN/A
lift-pow.f64N/A
log-powN/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites45.5%
Taylor expanded in angle around 0
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
log-EN/A
*-lft-identityN/A
lower-+.f64N/A
lower-log.f64N/A
lower-log.f64N/A
Applied rewrites42.5%
lift-log.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-log.f64N/A
rem-log-expN/A
lift-+.f64N/A
pow-to-expN/A
exp-prodN/A
lift-*.f64N/A
lift-exp.f64N/A
lift-*.f64N/A
Applied rewrites89.6%
Final simplification67.3%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (/ (* 0.005555555555555556 (* a PI)) (/ -1.0 angle))))
(if (<= b 2.25e-160)
(pow (* a (sin (* 0.005555555555555556 (* angle PI)))) 2.0)
(fma b b (* t_0 t_0)))))
double code(double a, double b, double angle) {
double t_0 = (0.005555555555555556 * (a * ((double) M_PI))) / (-1.0 / angle);
double tmp;
if (b <= 2.25e-160) {
tmp = pow((a * sin((0.005555555555555556 * (angle * ((double) M_PI))))), 2.0);
} else {
tmp = fma(b, b, (t_0 * t_0));
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(Float64(0.005555555555555556 * Float64(a * pi)) / Float64(-1.0 / angle)) tmp = 0.0 if (b <= 2.25e-160) tmp = Float64(a * sin(Float64(0.005555555555555556 * Float64(angle * pi)))) ^ 2.0; else tmp = fma(b, b, Float64(t_0 * t_0)); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(0.005555555555555556 * N[(a * Pi), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / angle), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, 2.25e-160], N[Power[N[(a * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(b * b + N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{0.005555555555555556 \cdot \left(a \cdot \pi\right)}{\frac{-1}{angle}}\\
\mathbf{if}\;b \leq 2.25 \cdot 10^{-160}:\\
\;\;\;\;{\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, b, t\_0 \cdot t\_0\right)\\
\end{array}
\end{array}
if b < 2.25000000000000013e-160Initial program 76.3%
lift-PI.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-PI.f64N/A
add-cube-cbrtN/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lift-PI.f64N/A
lower-cbrt.f6476.6
Applied rewrites76.6%
Taylor expanded in a around inf
unpow2N/A
unpow2N/A
unswap-sqrN/A
rem-exp-logN/A
*-lft-identityN/A
log-EN/A
rem-exp-logN/A
*-lft-identityN/A
log-EN/A
unpow2N/A
Applied rewrites44.2%
if 2.25000000000000013e-160 < b Initial program 77.6%
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6477.6
rem-exp-logN/A
unpow1N/A
log-powN/A
lift-pow.f64N/A
log-powN/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites44.4%
Taylor expanded in angle around 0
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
log-EN/A
*-lft-identityN/A
lower-+.f64N/A
lower-log.f64N/A
lower-log.f64N/A
Applied rewrites14.2%
Taylor expanded in angle around -inf
distribute-rgt-inN/A
exp-sumN/A
exp-to-powN/A
metadata-evalN/A
lower-*.f64N/A
exp-lft-sqrN/A
lower-*.f64N/A
Applied rewrites74.4%
Final simplification56.0%
(FPCore (a b angle) :precision binary64 (if (<= a 7.2e-9) (* b b) (fma (pow (* angle (* a 0.005555555555555556)) 2.0) (* PI PI) (* b b))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 7.2e-9) {
tmp = b * b;
} else {
tmp = fma(pow((angle * (a * 0.005555555555555556)), 2.0), (((double) M_PI) * ((double) M_PI)), (b * b));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (a <= 7.2e-9) tmp = Float64(b * b); else tmp = fma((Float64(angle * Float64(a * 0.005555555555555556)) ^ 2.0), Float64(pi * pi), Float64(b * b)); end return tmp end
code[a_, b_, angle_] := If[LessEqual[a, 7.2e-9], N[(b * b), $MachinePrecision], N[(N[Power[N[(angle * N[(a * 0.005555555555555556), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 7.2 \cdot 10^{-9}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left({\left(angle \cdot \left(a \cdot 0.005555555555555556\right)\right)}^{2}, \pi \cdot \pi, b \cdot b\right)\\
\end{array}
\end{array}
if a < 7.2e-9Initial program 75.4%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6461.7
Applied rewrites61.7%
if 7.2e-9 < a Initial program 80.3%
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6480.3
rem-exp-logN/A
unpow1N/A
log-powN/A
lift-pow.f64N/A
log-powN/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites36.7%
Taylor expanded in angle around 0
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
log-EN/A
*-lft-identityN/A
lower-+.f64N/A
lower-log.f64N/A
lower-log.f64N/A
Applied rewrites33.8%
lift-log.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-log.f64N/A
rem-log-expN/A
lift-+.f64N/A
pow-to-expN/A
exp-prodN/A
lift-*.f64N/A
lift-exp.f64N/A
lift-*.f64N/A
Applied rewrites75.6%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (/ (* 0.005555555555555556 (* a PI)) (/ -1.0 angle)))) (if (<= a 7.2e-9) (* b b) (fma b b (* t_0 t_0)))))
double code(double a, double b, double angle) {
double t_0 = (0.005555555555555556 * (a * ((double) M_PI))) / (-1.0 / angle);
double tmp;
if (a <= 7.2e-9) {
tmp = b * b;
} else {
tmp = fma(b, b, (t_0 * t_0));
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(Float64(0.005555555555555556 * Float64(a * pi)) / Float64(-1.0 / angle)) tmp = 0.0 if (a <= 7.2e-9) tmp = Float64(b * b); else tmp = fma(b, b, Float64(t_0 * t_0)); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(0.005555555555555556 * N[(a * Pi), $MachinePrecision]), $MachinePrecision] / N[(-1.0 / angle), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 7.2e-9], N[(b * b), $MachinePrecision], N[(b * b + N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{0.005555555555555556 \cdot \left(a \cdot \pi\right)}{\frac{-1}{angle}}\\
\mathbf{if}\;a \leq 7.2 \cdot 10^{-9}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, b, t\_0 \cdot t\_0\right)\\
\end{array}
\end{array}
if a < 7.2e-9Initial program 75.4%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6461.7
Applied rewrites61.7%
if 7.2e-9 < a Initial program 80.3%
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6480.3
rem-exp-logN/A
unpow1N/A
log-powN/A
lift-pow.f64N/A
log-powN/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites36.7%
Taylor expanded in angle around 0
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
log-EN/A
*-lft-identityN/A
lower-+.f64N/A
lower-log.f64N/A
lower-log.f64N/A
Applied rewrites33.8%
Taylor expanded in angle around -inf
distribute-rgt-inN/A
exp-sumN/A
exp-to-powN/A
metadata-evalN/A
lower-*.f64N/A
exp-lft-sqrN/A
lower-*.f64N/A
Applied rewrites75.6%
Final simplification65.6%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* angle (* PI 0.005555555555555556))) (t_1 (* a t_0)))
(if (<= a 7.2e-9)
(* b b)
(if (<= a 1.35e+154) (fma (* a a) (* t_0 t_0) (* b b)) (* t_1 t_1)))))
double code(double a, double b, double angle) {
double t_0 = angle * (((double) M_PI) * 0.005555555555555556);
double t_1 = a * t_0;
double tmp;
if (a <= 7.2e-9) {
tmp = b * b;
} else if (a <= 1.35e+154) {
tmp = fma((a * a), (t_0 * t_0), (b * b));
} else {
tmp = t_1 * t_1;
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(angle * Float64(pi * 0.005555555555555556)) t_1 = Float64(a * t_0) tmp = 0.0 if (a <= 7.2e-9) tmp = Float64(b * b); elseif (a <= 1.35e+154) tmp = fma(Float64(a * a), Float64(t_0 * t_0), Float64(b * b)); else tmp = Float64(t_1 * t_1); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(a * t$95$0), $MachinePrecision]}, If[LessEqual[a, 7.2e-9], N[(b * b), $MachinePrecision], If[LessEqual[a, 1.35e+154], N[(N[(a * a), $MachinePrecision] * N[(t$95$0 * t$95$0), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := angle \cdot \left(\pi \cdot 0.005555555555555556\right)\\
t_1 := a \cdot t\_0\\
\mathbf{if}\;a \leq 7.2 \cdot 10^{-9}:\\
\;\;\;\;b \cdot b\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot a, t\_0 \cdot t\_0, b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot t\_1\\
\end{array}
\end{array}
if a < 7.2e-9Initial program 75.4%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6461.7
Applied rewrites61.7%
if 7.2e-9 < a < 1.35000000000000003e154Initial program 60.9%
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6460.9
rem-exp-logN/A
unpow1N/A
log-powN/A
lift-pow.f64N/A
log-powN/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites26.7%
Taylor expanded in angle around 0
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
log-EN/A
*-lft-identityN/A
lower-+.f64N/A
lower-log.f64N/A
lower-log.f64N/A
Applied rewrites23.9%
Taylor expanded in b around 0
Applied rewrites48.9%
if 1.35000000000000003e154 < a Initial program 99.8%
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6499.8
rem-exp-logN/A
unpow1N/A
log-powN/A
lift-pow.f64N/A
log-powN/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites46.8%
Taylor expanded in angle around 0
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
log-EN/A
*-lft-identityN/A
lower-+.f64N/A
lower-log.f64N/A
lower-log.f64N/A
Applied rewrites43.8%
Taylor expanded in b around 0
Applied rewrites83.4%
Final simplification62.9%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* a (* angle (* PI 0.005555555555555556)))))
(if (<= a 7.2e-9)
(* b b)
(if (<= a 4.8e+154)
(fma
(* angle angle)
(* (* PI PI) (* a (* a 3.08641975308642e-5)))
(* b b))
(* t_0 t_0)))))
double code(double a, double b, double angle) {
double t_0 = a * (angle * (((double) M_PI) * 0.005555555555555556));
double tmp;
if (a <= 7.2e-9) {
tmp = b * b;
} else if (a <= 4.8e+154) {
tmp = fma((angle * angle), ((((double) M_PI) * ((double) M_PI)) * (a * (a * 3.08641975308642e-5))), (b * b));
} else {
tmp = t_0 * t_0;
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(a * Float64(angle * Float64(pi * 0.005555555555555556))) tmp = 0.0 if (a <= 7.2e-9) tmp = Float64(b * b); elseif (a <= 4.8e+154) tmp = fma(Float64(angle * angle), Float64(Float64(pi * pi) * Float64(a * Float64(a * 3.08641975308642e-5))), Float64(b * b)); else tmp = Float64(t_0 * t_0); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(a * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 7.2e-9], N[(b * b), $MachinePrecision], If[LessEqual[a, 4.8e+154], N[(N[(angle * angle), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * N[(a * N[(a * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\
\mathbf{if}\;a \leq 7.2 \cdot 10^{-9}:\\
\;\;\;\;b \cdot b\\
\mathbf{elif}\;a \leq 4.8 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(angle \cdot angle, \left(\pi \cdot \pi\right) \cdot \left(a \cdot \left(a \cdot 3.08641975308642 \cdot 10^{-5}\right)\right), b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot t\_0\\
\end{array}
\end{array}
if a < 7.2e-9Initial program 75.4%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6461.7
Applied rewrites61.7%
if 7.2e-9 < a < 4.8000000000000003e154Initial program 60.9%
lift-PI.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-PI.f64N/A
add-cube-cbrtN/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lift-PI.f64N/A
lower-cbrt.f6460.9
Applied rewrites60.9%
Taylor expanded in angle around 0
lower-fma.f64N/A
Applied rewrites28.6%
Taylor expanded in b around 0
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6448.8
Applied rewrites48.8%
if 4.8000000000000003e154 < a Initial program 99.8%
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6499.8
rem-exp-logN/A
unpow1N/A
log-powN/A
lift-pow.f64N/A
log-powN/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites46.8%
Taylor expanded in angle around 0
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
log-EN/A
*-lft-identityN/A
lower-+.f64N/A
lower-log.f64N/A
lower-log.f64N/A
Applied rewrites43.8%
Taylor expanded in b around 0
Applied rewrites83.4%
Final simplification62.9%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* a (* angle (* PI 0.005555555555555556)))))
(if (<= a 7.2e-9)
(* b b)
(if (<= a 1.35e+154)
(fma
(* angle angle)
(* (* a a) (* PI (* PI 3.08641975308642e-5)))
(* b b))
(* t_0 t_0)))))
double code(double a, double b, double angle) {
double t_0 = a * (angle * (((double) M_PI) * 0.005555555555555556));
double tmp;
if (a <= 7.2e-9) {
tmp = b * b;
} else if (a <= 1.35e+154) {
tmp = fma((angle * angle), ((a * a) * (((double) M_PI) * (((double) M_PI) * 3.08641975308642e-5))), (b * b));
} else {
tmp = t_0 * t_0;
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(a * Float64(angle * Float64(pi * 0.005555555555555556))) tmp = 0.0 if (a <= 7.2e-9) tmp = Float64(b * b); elseif (a <= 1.35e+154) tmp = fma(Float64(angle * angle), Float64(Float64(a * a) * Float64(pi * Float64(pi * 3.08641975308642e-5))), Float64(b * b)); else tmp = Float64(t_0 * t_0); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(a * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 7.2e-9], N[(b * b), $MachinePrecision], If[LessEqual[a, 1.35e+154], N[(N[(angle * angle), $MachinePrecision] * N[(N[(a * a), $MachinePrecision] * N[(Pi * N[(Pi * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * b), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\
\mathbf{if}\;a \leq 7.2 \cdot 10^{-9}:\\
\;\;\;\;b \cdot b\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(angle \cdot angle, \left(a \cdot a\right) \cdot \left(\pi \cdot \left(\pi \cdot 3.08641975308642 \cdot 10^{-5}\right)\right), b \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot t\_0\\
\end{array}
\end{array}
if a < 7.2e-9Initial program 75.4%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6461.7
Applied rewrites61.7%
if 7.2e-9 < a < 1.35000000000000003e154Initial program 60.9%
lift-PI.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-PI.f64N/A
add-cube-cbrtN/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lift-PI.f64N/A
lower-cbrt.f6460.9
Applied rewrites60.9%
Taylor expanded in angle around 0
lower-fma.f64N/A
Applied rewrites28.6%
Taylor expanded in b around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-PI.f6448.8
Applied rewrites48.8%
if 1.35000000000000003e154 < a Initial program 99.8%
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6499.8
rem-exp-logN/A
unpow1N/A
log-powN/A
lift-pow.f64N/A
log-powN/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites46.8%
Taylor expanded in angle around 0
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
log-EN/A
*-lft-identityN/A
lower-+.f64N/A
lower-log.f64N/A
lower-log.f64N/A
Applied rewrites43.8%
Taylor expanded in b around 0
Applied rewrites83.4%
Final simplification62.9%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* angle (* PI (* a 0.005555555555555556))))) (if (<= a 7.2e-9) (* b b) (fma t_0 t_0 (* b b)))))
double code(double a, double b, double angle) {
double t_0 = angle * (((double) M_PI) * (a * 0.005555555555555556));
double tmp;
if (a <= 7.2e-9) {
tmp = b * b;
} else {
tmp = fma(t_0, t_0, (b * b));
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(angle * Float64(pi * Float64(a * 0.005555555555555556))) tmp = 0.0 if (a <= 7.2e-9) tmp = Float64(b * b); else tmp = fma(t_0, t_0, Float64(b * b)); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(angle * N[(Pi * N[(a * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 7.2e-9], N[(b * b), $MachinePrecision], N[(t$95$0 * t$95$0 + N[(b * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := angle \cdot \left(\pi \cdot \left(a \cdot 0.005555555555555556\right)\right)\\
\mathbf{if}\;a \leq 7.2 \cdot 10^{-9}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, t\_0, b \cdot b\right)\\
\end{array}
\end{array}
if a < 7.2e-9Initial program 75.4%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6461.7
Applied rewrites61.7%
if 7.2e-9 < a Initial program 80.3%
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6480.3
rem-exp-logN/A
unpow1N/A
log-powN/A
lift-pow.f64N/A
log-powN/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites36.7%
Taylor expanded in angle around 0
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
log-EN/A
*-lft-identityN/A
lower-+.f64N/A
lower-log.f64N/A
lower-log.f64N/A
Applied rewrites33.8%
lift-log.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-log.f64N/A
rem-log-expN/A
lift-+.f64N/A
pow-to-expN/A
exp-prodN/A
lift-*.f64N/A
lift-exp.f64N/A
lift-*.f64N/A
Applied rewrites75.6%
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* a (* angle (* PI 0.005555555555555556))))) (if (<= a 2.2e+137) (* b b) (* t_0 t_0))))
double code(double a, double b, double angle) {
double t_0 = a * (angle * (((double) M_PI) * 0.005555555555555556));
double tmp;
if (a <= 2.2e+137) {
tmp = b * b;
} else {
tmp = t_0 * t_0;
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = a * (angle * (Math.PI * 0.005555555555555556));
double tmp;
if (a <= 2.2e+137) {
tmp = b * b;
} else {
tmp = t_0 * t_0;
}
return tmp;
}
def code(a, b, angle): t_0 = a * (angle * (math.pi * 0.005555555555555556)) tmp = 0 if a <= 2.2e+137: tmp = b * b else: tmp = t_0 * t_0 return tmp
function code(a, b, angle) t_0 = Float64(a * Float64(angle * Float64(pi * 0.005555555555555556))) tmp = 0.0 if (a <= 2.2e+137) tmp = Float64(b * b); else tmp = Float64(t_0 * t_0); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = a * (angle * (pi * 0.005555555555555556)); tmp = 0.0; if (a <= 2.2e+137) tmp = b * b; else tmp = t_0 * t_0; end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(a * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 2.2e+137], N[(b * b), $MachinePrecision], N[(t$95$0 * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := a \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\
\mathbf{if}\;a \leq 2.2 \cdot 10^{+137}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot t\_0\\
\end{array}
\end{array}
if a < 2.20000000000000015e137Initial program 73.1%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6458.4
Applied rewrites58.4%
if 2.20000000000000015e137 < a Initial program 95.8%
lift-PI.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lift-pow.f6495.8
rem-exp-logN/A
unpow1N/A
log-powN/A
lift-pow.f64N/A
log-powN/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
Applied rewrites43.0%
Taylor expanded in angle around 0
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-exp.f64N/A
lower-*.f64N/A
log-EN/A
*-lft-identityN/A
lower-+.f64N/A
lower-log.f64N/A
lower-log.f64N/A
Applied rewrites40.2%
Taylor expanded in b around 0
Applied rewrites76.9%
Final simplification61.4%
(FPCore (a b angle) :precision binary64 (if (<= a 2.2e+137) (* b b) (* (* angle (* a (* a (* PI PI)))) (* angle 3.08641975308642e-5))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 2.2e+137) {
tmp = b * b;
} else {
tmp = (angle * (a * (a * (((double) M_PI) * ((double) M_PI))))) * (angle * 3.08641975308642e-5);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 2.2e+137) {
tmp = b * b;
} else {
tmp = (angle * (a * (a * (Math.PI * Math.PI)))) * (angle * 3.08641975308642e-5);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 2.2e+137: tmp = b * b else: tmp = (angle * (a * (a * (math.pi * math.pi)))) * (angle * 3.08641975308642e-5) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 2.2e+137) tmp = Float64(b * b); else tmp = Float64(Float64(angle * Float64(a * Float64(a * Float64(pi * pi)))) * Float64(angle * 3.08641975308642e-5)); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 2.2e+137) tmp = b * b; else tmp = (angle * (a * (a * (pi * pi)))) * (angle * 3.08641975308642e-5); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 2.2e+137], N[(b * b), $MachinePrecision], N[(N[(angle * N[(a * N[(a * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(angle * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.2 \cdot 10^{+137}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot \left(a \cdot \left(a \cdot \left(\pi \cdot \pi\right)\right)\right)\right) \cdot \left(angle \cdot 3.08641975308642 \cdot 10^{-5}\right)\\
\end{array}
\end{array}
if a < 2.20000000000000015e137Initial program 73.1%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6458.4
Applied rewrites58.4%
if 2.20000000000000015e137 < a Initial program 95.8%
lift-PI.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-PI.f64N/A
add-cube-cbrtN/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lift-PI.f64N/A
lower-cbrt.f6495.8
Applied rewrites95.8%
Taylor expanded in angle around 0
lower-fma.f64N/A
Applied rewrites53.5%
Taylor expanded in b around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6468.0
Applied rewrites68.0%
lift-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.9
Applied rewrites72.9%
Final simplification60.8%
(FPCore (a b angle) :precision binary64 (if (<= a 1.45e+140) (* b b) (* a (* (* a PI) (* (* angle 3.08641975308642e-5) (* angle PI))))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 1.45e+140) {
tmp = b * b;
} else {
tmp = a * ((a * ((double) M_PI)) * ((angle * 3.08641975308642e-5) * (angle * ((double) M_PI))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 1.45e+140) {
tmp = b * b;
} else {
tmp = a * ((a * Math.PI) * ((angle * 3.08641975308642e-5) * (angle * Math.PI)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 1.45e+140: tmp = b * b else: tmp = a * ((a * math.pi) * ((angle * 3.08641975308642e-5) * (angle * math.pi))) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 1.45e+140) tmp = Float64(b * b); else tmp = Float64(a * Float64(Float64(a * pi) * Float64(Float64(angle * 3.08641975308642e-5) * Float64(angle * pi)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 1.45e+140) tmp = b * b; else tmp = a * ((a * pi) * ((angle * 3.08641975308642e-5) * (angle * pi))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 1.45e+140], N[(b * b), $MachinePrecision], N[(a * N[(N[(a * Pi), $MachinePrecision] * N[(N[(angle * 3.08641975308642e-5), $MachinePrecision] * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.45 \cdot 10^{+140}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\left(a \cdot \pi\right) \cdot \left(\left(angle \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(angle \cdot \pi\right)\right)\right)\\
\end{array}
\end{array}
if a < 1.4499999999999999e140Initial program 73.1%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6458.4
Applied rewrites58.4%
if 1.4499999999999999e140 < a Initial program 95.8%
lift-PI.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-PI.f64N/A
add-cube-cbrtN/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lift-PI.f64N/A
lower-cbrt.f6495.8
Applied rewrites95.8%
Taylor expanded in angle around 0
lower-fma.f64N/A
Applied rewrites53.5%
Taylor expanded in b around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6468.0
Applied rewrites68.0%
lift-PI.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.9%
Final simplification60.8%
(FPCore (a b angle) :precision binary64 (if (<= a 5.8e+137) (* b b) (* (* a a) (* 3.08641975308642e-5 (* angle (* angle (* PI PI)))))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 5.8e+137) {
tmp = b * b;
} else {
tmp = (a * a) * (3.08641975308642e-5 * (angle * (angle * (((double) M_PI) * ((double) M_PI)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 5.8e+137) {
tmp = b * b;
} else {
tmp = (a * a) * (3.08641975308642e-5 * (angle * (angle * (Math.PI * Math.PI))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 5.8e+137: tmp = b * b else: tmp = (a * a) * (3.08641975308642e-5 * (angle * (angle * (math.pi * math.pi)))) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 5.8e+137) tmp = Float64(b * b); else tmp = Float64(Float64(a * a) * Float64(3.08641975308642e-5 * Float64(angle * Float64(angle * Float64(pi * pi))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 5.8e+137) tmp = b * b; else tmp = (a * a) * (3.08641975308642e-5 * (angle * (angle * (pi * pi)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 5.8e+137], N[(b * b), $MachinePrecision], N[(N[(a * a), $MachinePrecision] * N[(3.08641975308642e-5 * N[(angle * N[(angle * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 5.8 \cdot 10^{+137}:\\
\;\;\;\;b \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot \left(angle \cdot \left(\pi \cdot \pi\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 5.79999999999999969e137Initial program 73.1%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6458.4
Applied rewrites58.4%
if 5.79999999999999969e137 < a Initial program 95.8%
lift-PI.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-PI.f64N/A
add-cube-cbrtN/A
associate-*l*N/A
associate-*l*N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-evalN/A
lift-PI.f64N/A
lower-cbrt.f6495.8
Applied rewrites95.8%
Taylor expanded in angle around 0
lower-fma.f64N/A
Applied rewrites53.5%
Taylor expanded in b around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6468.0
Applied rewrites68.0%
Taylor expanded in a around 0
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites67.9%
Final simplification60.0%
(FPCore (a b angle) :precision binary64 (* b b))
double code(double a, double b, double angle) {
return b * b;
}
real(8) function code(a, b, angle)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
code = b * b
end function
public static double code(double a, double b, double angle) {
return b * b;
}
def code(a, b, angle): return b * b
function code(a, b, angle) return Float64(b * b) end
function tmp = code(a, b, angle) tmp = b * b; end
code[a_, b_, angle_] := N[(b * b), $MachinePrecision]
\begin{array}{l}
\\
b \cdot b
\end{array}
Initial program 76.8%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6454.7
Applied rewrites54.7%
herbie shell --seed 2024214
(FPCore (a b angle)
:name "ab-angle->ABCF A"
:precision binary64
(+ (pow (* a (sin (* (/ angle 180.0) PI))) 2.0) (pow (* b (cos (* (/ angle 180.0) PI))) 2.0)))