
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return pow((a * cos(t_0)), 2.0) + pow((b * sin(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return Math.pow((a * Math.cos(t_0)), 2.0) + Math.pow((b * Math.sin(t_0)), 2.0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return math.pow((a * math.cos(t_0)), 2.0) + math.pow((b * math.sin(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((a * cos(t_0)) ^ 2.0) + ((b * sin(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (+ (pow (* a (cos t_0)) 2.0) (pow (* b (sin t_0)) 2.0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return pow((a * cos(t_0)), 2.0) + pow((b * sin(t_0)), 2.0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return Math.pow((a * Math.cos(t_0)), 2.0) + Math.pow((b * Math.sin(t_0)), 2.0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return math.pow((a * math.cos(t_0)), 2.0) + math.pow((b * math.sin(t_0)), 2.0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64((Float64(a * cos(t_0)) ^ 2.0) + (Float64(b * sin(t_0)) ^ 2.0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((a * cos(t_0)) ^ 2.0) + ((b * sin(t_0)) ^ 2.0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[Power[N[(a * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
{\left(a \cdot \cos t\_0\right)}^{2} + {\left(b \cdot \sin t\_0\right)}^{2}
\end{array}
\end{array}
(FPCore (a b angle)
:precision binary64
(+
(pow
(*
a
(cos
(*
(sqrt PI)
(*
(* angle 0.005555555555555556)
(sqrt
(*
(pow (* (* PI PI) (sqrt PI)) 0.3333333333333333)
(cbrt (sqrt PI))))))))
2.0)
(pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * cos((sqrt(((double) M_PI)) * ((angle * 0.005555555555555556) * sqrt((pow(((((double) M_PI) * ((double) M_PI)) * sqrt(((double) M_PI))), 0.3333333333333333) * cbrt(sqrt(((double) M_PI))))))))), 2.0) + pow((b * sin((((double) M_PI) * (angle / 180.0)))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.cos((Math.sqrt(Math.PI) * ((angle * 0.005555555555555556) * Math.sqrt((Math.pow(((Math.PI * Math.PI) * Math.sqrt(Math.PI)), 0.3333333333333333) * Math.cbrt(Math.sqrt(Math.PI)))))))), 2.0) + Math.pow((b * Math.sin((Math.PI * (angle / 180.0)))), 2.0);
}
function code(a, b, angle) return Float64((Float64(a * cos(Float64(sqrt(pi) * Float64(Float64(angle * 0.005555555555555556) * sqrt(Float64((Float64(Float64(pi * pi) * sqrt(pi)) ^ 0.3333333333333333) * cbrt(sqrt(pi)))))))) ^ 2.0) + (Float64(b * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(N[Sqrt[Pi], $MachinePrecision] * N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[Sqrt[N[(N[Power[N[(N[(Pi * Pi), $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision], 0.3333333333333333], $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left(\sqrt{\pi} \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \sqrt{{\left(\left(\pi \cdot \pi\right) \cdot \sqrt{\pi}\right)}^{0.3333333333333333} \cdot \sqrt[3]{\sqrt{\pi}}}\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2}
\end{array}
Initial program 77.4%
add-cube-cbrtN/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-evalN/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f6477.4
Applied egg-rr77.4%
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
add-cube-cbrtN/A
*-commutativeN/A
add-sqr-sqrtN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f6477.4
Applied egg-rr77.4%
add-cbrt-cubeN/A
pow1/3N/A
add-sqr-sqrtN/A
associate-*r*N/A
unpow-prod-downN/A
pow1/3N/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
cbrt-lowering-cbrt.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f6477.5
Applied egg-rr77.5%
Final simplification77.5%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (* PI (/ angle 180.0)))) 2.0) (pow (* a (cos (* (sqrt PI) (* (* angle 0.005555555555555556) (sqrt PI))))) 2.0)))
double code(double a, double b, double angle) {
return pow((b * sin((((double) M_PI) * (angle / 180.0)))), 2.0) + pow((a * cos((sqrt(((double) M_PI)) * ((angle * 0.005555555555555556) * sqrt(((double) M_PI)))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin((Math.PI * (angle / 180.0)))), 2.0) + Math.pow((a * Math.cos((Math.sqrt(Math.PI) * ((angle * 0.005555555555555556) * Math.sqrt(Math.PI))))), 2.0);
}
def code(a, b, angle): return math.pow((b * math.sin((math.pi * (angle / 180.0)))), 2.0) + math.pow((a * math.cos((math.sqrt(math.pi) * ((angle * 0.005555555555555556) * math.sqrt(math.pi))))), 2.0)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + (Float64(a * cos(Float64(sqrt(pi) * Float64(Float64(angle * 0.005555555555555556) * sqrt(pi))))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((b * sin((pi * (angle / 180.0)))) ^ 2.0) + ((a * cos((sqrt(pi) * ((angle * 0.005555555555555556) * sqrt(pi))))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(a * N[Cos[N[(N[Sqrt[Pi], $MachinePrecision] * N[(N[(angle * 0.005555555555555556), $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(a \cdot \cos \left(\sqrt{\pi} \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \sqrt{\pi}\right)\right)\right)}^{2}
\end{array}
Initial program 77.4%
add-cube-cbrtN/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-evalN/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f6477.4
Applied egg-rr77.4%
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
add-cube-cbrtN/A
*-commutativeN/A
add-sqr-sqrtN/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f64N/A
sqrt-lowering-sqrt.f64N/A
PI-lowering-PI.f6477.4
Applied egg-rr77.4%
Final simplification77.4%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (/ (* angle PI) 180.0))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * cos((((double) M_PI) * (angle / 180.0)))), 2.0) + pow((b * sin(((angle * ((double) M_PI)) / 180.0))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.cos((Math.PI * (angle / 180.0)))), 2.0) + Math.pow((b * Math.sin(((angle * Math.PI) / 180.0))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.cos((math.pi * (angle / 180.0)))), 2.0) + math.pow((b * math.sin(((angle * math.pi) / 180.0))), 2.0)
function code(a, b, angle) return Float64((Float64(a * cos(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + (Float64(b * sin(Float64(Float64(angle * pi) / 180.0))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * cos((pi * (angle / 180.0)))) ^ 2.0) + ((b * sin(((angle * pi) / 180.0))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(N[(angle * Pi), $MachinePrecision] / 180.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle \cdot \pi}{180}\right)\right)}^{2}
\end{array}
Initial program 77.4%
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6477.4
Applied egg-rr77.4%
Final simplification77.4%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (* 0.005555555555555556 (* angle PI)))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * cos((((double) M_PI) * (angle / 180.0)))), 2.0) + pow((b * sin((0.005555555555555556 * (angle * ((double) M_PI))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.cos((Math.PI * (angle / 180.0)))), 2.0) + Math.pow((b * Math.sin((0.005555555555555556 * (angle * Math.PI)))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.cos((math.pi * (angle / 180.0)))), 2.0) + math.pow((b * math.sin((0.005555555555555556 * (angle * math.pi)))), 2.0)
function code(a, b, angle) return Float64((Float64(a * cos(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + (Float64(b * sin(Float64(0.005555555555555556 * Float64(angle * pi)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * cos((pi * (angle / 180.0)))) ^ 2.0) + ((b * sin((0.005555555555555556 * (angle * pi)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right)}^{2}
\end{array}
Initial program 77.4%
associate-*r/N/A
div-invN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-eval77.4
Applied egg-rr77.4%
Final simplification77.4%
(FPCore (a b angle) :precision binary64 (+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (* angle (* 0.005555555555555556 PI)))) 2.0)))
double code(double a, double b, double angle) {
return pow((a * cos((((double) M_PI) * (angle / 180.0)))), 2.0) + pow((b * sin((angle * (0.005555555555555556 * ((double) M_PI))))), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((a * Math.cos((Math.PI * (angle / 180.0)))), 2.0) + Math.pow((b * Math.sin((angle * (0.005555555555555556 * Math.PI)))), 2.0);
}
def code(a, b, angle): return math.pow((a * math.cos((math.pi * (angle / 180.0)))), 2.0) + math.pow((b * math.sin((angle * (0.005555555555555556 * math.pi)))), 2.0)
function code(a, b, angle) return Float64((Float64(a * cos(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + (Float64(b * sin(Float64(angle * Float64(0.005555555555555556 * pi)))) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((a * cos((pi * (angle / 180.0)))) ^ 2.0) + ((b * sin((angle * (0.005555555555555556 * pi)))) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(a * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(b * N[Sin[N[(angle * N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(a \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + {\left(b \cdot \sin \left(angle \cdot \left(0.005555555555555556 \cdot \pi\right)\right)\right)}^{2}
\end{array}
Initial program 77.4%
*-commutativeN/A
div-invN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
metadata-eval77.4
Applied egg-rr77.4%
Final simplification77.4%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (* PI (/ angle 180.0)))) 2.0) (* (+ 0.5 (* 0.5 (cos (* 2.0 (* (* angle 0.005555555555555556) PI))))) (* a a))))
double code(double a, double b, double angle) {
return pow((b * sin((((double) M_PI) * (angle / 180.0)))), 2.0) + ((0.5 + (0.5 * cos((2.0 * ((angle * 0.005555555555555556) * ((double) M_PI)))))) * (a * a));
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin((Math.PI * (angle / 180.0)))), 2.0) + ((0.5 + (0.5 * Math.cos((2.0 * ((angle * 0.005555555555555556) * Math.PI))))) * (a * a));
}
def code(a, b, angle): return math.pow((b * math.sin((math.pi * (angle / 180.0)))), 2.0) + ((0.5 + (0.5 * math.cos((2.0 * ((angle * 0.005555555555555556) * math.pi))))) * (a * a))
function code(a, b, angle) return Float64((Float64(b * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + Float64(Float64(0.5 + Float64(0.5 * cos(Float64(2.0 * Float64(Float64(angle * 0.005555555555555556) * pi))))) * Float64(a * a))) end
function tmp = code(a, b, angle) tmp = ((b * sin((pi * (angle / 180.0)))) ^ 2.0) + ((0.5 + (0.5 * cos((2.0 * ((angle * 0.005555555555555556) * pi))))) * (a * a)); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(N[(0.5 + N[(0.5 * N[Cos[N[(2.0 * N[(N[(angle * 0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right) \cdot \left(a \cdot a\right)
\end{array}
Initial program 77.4%
*-commutativeN/A
unpow-prod-downN/A
*-lowering-*.f64N/A
Applied egg-rr77.4%
Final simplification77.4%
(FPCore (a b angle) :precision binary64 (+ (pow (* b (sin (* PI (/ angle 180.0)))) 2.0) (* a a)))
double code(double a, double b, double angle) {
return pow((b * sin((((double) M_PI) * (angle / 180.0)))), 2.0) + (a * a);
}
public static double code(double a, double b, double angle) {
return Math.pow((b * Math.sin((Math.PI * (angle / 180.0)))), 2.0) + (a * a);
}
def code(a, b, angle): return math.pow((b * math.sin((math.pi * (angle / 180.0)))), 2.0) + (a * a)
function code(a, b, angle) return Float64((Float64(b * sin(Float64(pi * Float64(angle / 180.0)))) ^ 2.0) + Float64(a * a)) end
function tmp = code(a, b, angle) tmp = ((b * sin((pi * (angle / 180.0)))) ^ 2.0) + (a * a); end
code[a_, b_, angle_] := N[(N[Power[N[(b * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(b \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right)}^{2} + a \cdot a
\end{array}
Initial program 77.4%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6476.5
Simplified76.5%
Final simplification76.5%
(FPCore (a b angle)
:precision binary64
(if (<= (/ angle 180.0) 5000000.0)
(fma
(*
(* b (* 0.005555555555555556 (* angle PI)))
(*
angle
(fma
(* PI (* PI PI))
(* -2.8577960676726107e-8 (* angle angle))
(* 0.005555555555555556 PI))))
b
(* (* a a) (fma 0.5 (cos (* (* angle PI) 0.011111111111111112)) 0.5)))
(fma
a
a
(*
(* b b)
(- 0.5 (* 0.5 (cos (* 2.0 (* (* angle 0.005555555555555556) PI)))))))))
double code(double a, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 5000000.0) {
tmp = fma(((b * (0.005555555555555556 * (angle * ((double) M_PI)))) * (angle * fma((((double) M_PI) * (((double) M_PI) * ((double) M_PI))), (-2.8577960676726107e-8 * (angle * angle)), (0.005555555555555556 * ((double) M_PI))))), b, ((a * a) * fma(0.5, cos(((angle * ((double) M_PI)) * 0.011111111111111112)), 0.5)));
} else {
tmp = fma(a, a, ((b * b) * (0.5 - (0.5 * cos((2.0 * ((angle * 0.005555555555555556) * ((double) M_PI))))))));
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 5000000.0) tmp = fma(Float64(Float64(b * Float64(0.005555555555555556 * Float64(angle * pi))) * Float64(angle * fma(Float64(pi * Float64(pi * pi)), Float64(-2.8577960676726107e-8 * Float64(angle * angle)), Float64(0.005555555555555556 * pi)))), b, Float64(Float64(a * a) * fma(0.5, cos(Float64(Float64(angle * pi) * 0.011111111111111112)), 0.5))); else tmp = fma(a, a, Float64(Float64(b * b) * Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * Float64(Float64(angle * 0.005555555555555556) * pi))))))); end return tmp end
code[a_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5000000.0], N[(N[(N[(b * N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(angle * N[(N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision] * N[(-2.8577960676726107e-8 * N[(angle * angle), $MachinePrecision]), $MachinePrecision] + N[(0.005555555555555556 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * b + N[(N[(a * a), $MachinePrecision] * N[(0.5 * N[Cos[N[(N[(angle * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * a + N[(N[(b * b), $MachinePrecision] * N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * N[(N[(angle * 0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 5000000:\\
\;\;\;\;\mathsf{fma}\left(\left(b \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \left(angle \cdot \mathsf{fma}\left(\pi \cdot \left(\pi \cdot \pi\right), -2.8577960676726107 \cdot 10^{-8} \cdot \left(angle \cdot angle\right), 0.005555555555555556 \cdot \pi\right)\right), b, \left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right), 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, a, \left(b \cdot b\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot \left(\left(angle \cdot 0.005555555555555556\right) \cdot \pi\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 5e6Initial program 82.5%
add-cube-cbrtN/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-evalN/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f6482.5
Applied egg-rr82.5%
Applied egg-rr81.2%
Taylor expanded in angle around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6471.3
Simplified71.3%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
*-lowering-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
accelerator-lowering-fma.f64N/A
Simplified63.7%
if 5e6 < (/.f64 angle #s(literal 180 binary64)) Initial program 60.8%
rem-exp-logN/A
unpow2N/A
*-commutativeN/A
associate-*r*N/A
log-prodN/A
exp-sumN/A
rem-exp-logN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr40.1%
Taylor expanded in angle around 0
Simplified60.9%
Final simplification63.0%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (* angle 0.005555555555555556) PI)))
(if (<= (/ angle 180.0) 5e-7)
(fma
(* (* b (* 0.005555555555555556 (* angle PI))) (sin t_0))
b
(* (* a a) (fma 0.5 1.0 0.5)))
(fma a a (* (* b b) (- 0.5 (* 0.5 (cos (* 2.0 t_0)))))))))
double code(double a, double b, double angle) {
double t_0 = (angle * 0.005555555555555556) * ((double) M_PI);
double tmp;
if ((angle / 180.0) <= 5e-7) {
tmp = fma(((b * (0.005555555555555556 * (angle * ((double) M_PI)))) * sin(t_0)), b, ((a * a) * fma(0.5, 1.0, 0.5)));
} else {
tmp = fma(a, a, ((b * b) * (0.5 - (0.5 * cos((2.0 * t_0))))));
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(Float64(angle * 0.005555555555555556) * pi) tmp = 0.0 if (Float64(angle / 180.0) <= 5e-7) tmp = fma(Float64(Float64(b * Float64(0.005555555555555556 * Float64(angle * pi))) * sin(t_0)), b, Float64(Float64(a * a) * fma(0.5, 1.0, 0.5))); else tmp = fma(a, a, Float64(Float64(b * b) * Float64(0.5 - Float64(0.5 * cos(Float64(2.0 * t_0)))))); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(angle * 0.005555555555555556), $MachinePrecision] * Pi), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e-7], N[(N[(N[(b * N[(0.005555555555555556 * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * b + N[(N[(a * a), $MachinePrecision] * N[(0.5 * 1.0 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * a + N[(N[(b * b), $MachinePrecision] * N[(0.5 - N[(0.5 * N[Cos[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(angle \cdot 0.005555555555555556\right) \cdot \pi\\
\mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(\left(b \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \pi\right)\right)\right) \cdot \sin t\_0, b, \left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, 1, 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, a, \left(b \cdot b\right) \cdot \left(0.5 - 0.5 \cdot \cos \left(2 \cdot t\_0\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999977e-7Initial program 82.2%
add-cube-cbrtN/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-evalN/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f6482.1
Applied egg-rr82.1%
Applied egg-rr80.8%
Taylor expanded in angle around 0
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6471.4
Simplified71.4%
Taylor expanded in angle around 0
Simplified70.7%
if 4.99999999999999977e-7 < (/.f64 angle #s(literal 180 binary64)) Initial program 63.7%
rem-exp-logN/A
unpow2N/A
*-commutativeN/A
associate-*r*N/A
log-prodN/A
exp-sumN/A
rem-exp-logN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr44.5%
Taylor expanded in angle around 0
Simplified61.8%
Final simplification68.4%
(FPCore (a b angle)
:precision binary64
(if (<= a 1.4e+69)
(fma
(*
(* angle PI)
(* PI (fma b (* b 3.08641975308642e-5) (* (* a a) -3.08641975308642e-5))))
angle
(* a a))
(* (* a a) (fma 0.5 (cos (* angle (* PI 0.011111111111111112))) 0.5))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 1.4e+69) {
tmp = fma(((angle * ((double) M_PI)) * (((double) M_PI) * fma(b, (b * 3.08641975308642e-5), ((a * a) * -3.08641975308642e-5)))), angle, (a * a));
} else {
tmp = (a * a) * fma(0.5, cos((angle * (((double) M_PI) * 0.011111111111111112))), 0.5);
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (a <= 1.4e+69) tmp = fma(Float64(Float64(angle * pi) * Float64(pi * fma(b, Float64(b * 3.08641975308642e-5), Float64(Float64(a * a) * -3.08641975308642e-5)))), angle, Float64(a * a)); else tmp = Float64(Float64(a * a) * fma(0.5, cos(Float64(angle * Float64(pi * 0.011111111111111112))), 0.5)); end return tmp end
code[a_, b_, angle_] := If[LessEqual[a, 1.4e+69], N[(N[(N[(angle * Pi), $MachinePrecision] * N[(Pi * N[(b * N[(b * 3.08641975308642e-5), $MachinePrecision] + N[(N[(a * a), $MachinePrecision] * -3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * angle + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(N[(a * a), $MachinePrecision] * N[(0.5 * N[Cos[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.4 \cdot 10^{+69}:\\
\;\;\;\;\mathsf{fma}\left(\left(angle \cdot \pi\right) \cdot \left(\pi \cdot \mathsf{fma}\left(b, b \cdot 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), angle, a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right), 0.5\right)\\
\end{array}
\end{array}
if a < 1.39999999999999991e69Initial program 75.6%
Taylor expanded in angle around 0
accelerator-lowering-fma.f64N/A
Simplified43.9%
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr47.9%
if 1.39999999999999991e69 < a Initial program 84.3%
rem-exp-logN/A
unpow2N/A
*-commutativeN/A
associate-*r*N/A
log-prodN/A
exp-sumN/A
rem-exp-logN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr79.5%
Taylor expanded in a around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
cos-lowering-cos.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f6484.2
Simplified84.2%
(FPCore (a b angle)
:precision binary64
(if (<= a 3.7e-135)
(* angle (* (* angle PI) (* PI (* (* b b) 3.08641975308642e-5))))
(if (<= a 2.4e+69)
(fma
(* angle angle)
(*
(* PI PI)
(fma (* b b) 3.08641975308642e-5 (* (* a a) -3.08641975308642e-5)))
(* a a))
(* a a))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 3.7e-135) {
tmp = angle * ((angle * ((double) M_PI)) * (((double) M_PI) * ((b * b) * 3.08641975308642e-5)));
} else if (a <= 2.4e+69) {
tmp = fma((angle * angle), ((((double) M_PI) * ((double) M_PI)) * fma((b * b), 3.08641975308642e-5, ((a * a) * -3.08641975308642e-5))), (a * a));
} else {
tmp = a * a;
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (a <= 3.7e-135) tmp = Float64(angle * Float64(Float64(angle * pi) * Float64(pi * Float64(Float64(b * b) * 3.08641975308642e-5)))); elseif (a <= 2.4e+69) tmp = fma(Float64(angle * angle), Float64(Float64(pi * pi) * fma(Float64(b * b), 3.08641975308642e-5, Float64(Float64(a * a) * -3.08641975308642e-5))), Float64(a * a)); else tmp = Float64(a * a); end return tmp end
code[a_, b_, angle_] := If[LessEqual[a, 3.7e-135], N[(angle * N[(N[(angle * Pi), $MachinePrecision] * N[(Pi * N[(N[(b * b), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.4e+69], N[(N[(angle * angle), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * N[(N[(b * b), $MachinePrecision] * 3.08641975308642e-5 + N[(N[(a * a), $MachinePrecision] * -3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(a * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.7 \cdot 10^{-135}:\\
\;\;\;\;angle \cdot \left(\left(angle \cdot \pi\right) \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{+69}:\\
\;\;\;\;\mathsf{fma}\left(angle \cdot angle, \left(\pi \cdot \pi\right) \cdot \mathsf{fma}\left(b \cdot b, 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right), a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot a\\
\end{array}
\end{array}
if a < 3.6999999999999997e-135Initial program 75.4%
Taylor expanded in angle around 0
accelerator-lowering-fma.f64N/A
Simplified37.0%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6436.0
Simplified36.0%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6444.0
Applied egg-rr44.0%
if 3.6999999999999997e-135 < a < 2.4000000000000002e69Initial program 76.0%
add-cube-cbrtN/A
associate-*l*N/A
associate-*l*N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
div-invN/A
*-lowering-*.f64N/A
metadata-evalN/A
cbrt-lowering-cbrt.f64N/A
PI-lowering-PI.f6476.0
Applied egg-rr76.0%
Taylor expanded in angle around 0
accelerator-lowering-fma.f64N/A
Simplified64.4%
if 2.4000000000000002e69 < a Initial program 84.3%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6481.8
Simplified81.8%
Final simplification56.0%
(FPCore (a b angle)
:precision binary64
(if (<= a 1.96e-134)
(* angle (* (* angle PI) (* PI (* (* b b) 3.08641975308642e-5))))
(if (<= a 4.8e+70)
(fma
(* angle angle)
(*
PI
(*
PI
(fma (* b b) 3.08641975308642e-5 (* (* a a) -3.08641975308642e-5))))
(* a a))
(* a a))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 1.96e-134) {
tmp = angle * ((angle * ((double) M_PI)) * (((double) M_PI) * ((b * b) * 3.08641975308642e-5)));
} else if (a <= 4.8e+70) {
tmp = fma((angle * angle), (((double) M_PI) * (((double) M_PI) * fma((b * b), 3.08641975308642e-5, ((a * a) * -3.08641975308642e-5)))), (a * a));
} else {
tmp = a * a;
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (a <= 1.96e-134) tmp = Float64(angle * Float64(Float64(angle * pi) * Float64(pi * Float64(Float64(b * b) * 3.08641975308642e-5)))); elseif (a <= 4.8e+70) tmp = fma(Float64(angle * angle), Float64(pi * Float64(pi * fma(Float64(b * b), 3.08641975308642e-5, Float64(Float64(a * a) * -3.08641975308642e-5)))), Float64(a * a)); else tmp = Float64(a * a); end return tmp end
code[a_, b_, angle_] := If[LessEqual[a, 1.96e-134], N[(angle * N[(N[(angle * Pi), $MachinePrecision] * N[(Pi * N[(N[(b * b), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 4.8e+70], N[(N[(angle * angle), $MachinePrecision] * N[(Pi * N[(Pi * N[(N[(b * b), $MachinePrecision] * 3.08641975308642e-5 + N[(N[(a * a), $MachinePrecision] * -3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(a * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.96 \cdot 10^{-134}:\\
\;\;\;\;angle \cdot \left(\left(angle \cdot \pi\right) \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\
\mathbf{elif}\;a \leq 4.8 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(angle \cdot angle, \pi \cdot \left(\pi \cdot \mathsf{fma}\left(b \cdot b, 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot a\\
\end{array}
\end{array}
if a < 1.9600000000000001e-134Initial program 75.4%
Taylor expanded in angle around 0
accelerator-lowering-fma.f64N/A
Simplified37.0%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6436.0
Simplified36.0%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6444.0
Applied egg-rr44.0%
if 1.9600000000000001e-134 < a < 4.79999999999999974e70Initial program 76.0%
Taylor expanded in angle around 0
accelerator-lowering-fma.f64N/A
Simplified64.4%
if 4.79999999999999974e70 < a Initial program 84.3%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6481.8
Simplified81.8%
Final simplification56.0%
(FPCore (a b angle)
:precision binary64
(if (<= a 8.6e+71)
(fma
(*
(* angle PI)
(* PI (fma b (* b 3.08641975308642e-5) (* (* a a) -3.08641975308642e-5))))
angle
(* a a))
(* a a)))
double code(double a, double b, double angle) {
double tmp;
if (a <= 8.6e+71) {
tmp = fma(((angle * ((double) M_PI)) * (((double) M_PI) * fma(b, (b * 3.08641975308642e-5), ((a * a) * -3.08641975308642e-5)))), angle, (a * a));
} else {
tmp = a * a;
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (a <= 8.6e+71) tmp = fma(Float64(Float64(angle * pi) * Float64(pi * fma(b, Float64(b * 3.08641975308642e-5), Float64(Float64(a * a) * -3.08641975308642e-5)))), angle, Float64(a * a)); else tmp = Float64(a * a); end return tmp end
code[a_, b_, angle_] := If[LessEqual[a, 8.6e+71], N[(N[(N[(angle * Pi), $MachinePrecision] * N[(Pi * N[(b * N[(b * 3.08641975308642e-5), $MachinePrecision] + N[(N[(a * a), $MachinePrecision] * -3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * angle + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(a * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 8.6 \cdot 10^{+71}:\\
\;\;\;\;\mathsf{fma}\left(\left(angle \cdot \pi\right) \cdot \left(\pi \cdot \mathsf{fma}\left(b, b \cdot 3.08641975308642 \cdot 10^{-5}, \left(a \cdot a\right) \cdot -3.08641975308642 \cdot 10^{-5}\right)\right), angle, a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot a\\
\end{array}
\end{array}
if a < 8.59999999999999967e71Initial program 75.6%
Taylor expanded in angle around 0
accelerator-lowering-fma.f64N/A
Simplified43.9%
associate-*l*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
Applied egg-rr47.9%
if 8.59999999999999967e71 < a Initial program 84.3%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6481.8
Simplified81.8%
(FPCore (a b angle) :precision binary64 (if (<= b 9.4e+83) (* a a) (* angle (* (* angle PI) (* PI (* (* b b) 3.08641975308642e-5))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 9.4e+83) {
tmp = a * a;
} else {
tmp = angle * ((angle * ((double) M_PI)) * (((double) M_PI) * ((b * b) * 3.08641975308642e-5)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 9.4e+83) {
tmp = a * a;
} else {
tmp = angle * ((angle * Math.PI) * (Math.PI * ((b * b) * 3.08641975308642e-5)));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 9.4e+83: tmp = a * a else: tmp = angle * ((angle * math.pi) * (math.pi * ((b * b) * 3.08641975308642e-5))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 9.4e+83) tmp = Float64(a * a); else tmp = Float64(angle * Float64(Float64(angle * pi) * Float64(pi * Float64(Float64(b * b) * 3.08641975308642e-5)))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 9.4e+83) tmp = a * a; else tmp = angle * ((angle * pi) * (pi * ((b * b) * 3.08641975308642e-5))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 9.4e+83], N[(a * a), $MachinePrecision], N[(angle * N[(N[(angle * Pi), $MachinePrecision] * N[(Pi * N[(N[(b * b), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 9.4 \cdot 10^{+83}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;angle \cdot \left(\left(angle \cdot \pi\right) \cdot \left(\pi \cdot \left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\\
\end{array}
\end{array}
if b < 9.3999999999999997e83Initial program 75.6%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6460.2
Simplified60.2%
if 9.3999999999999997e83 < b Initial program 87.0%
Taylor expanded in angle around 0
accelerator-lowering-fma.f64N/A
Simplified51.5%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6456.6
Simplified56.6%
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f6464.1
Applied egg-rr64.1%
Final simplification60.8%
(FPCore (a b angle) :precision binary64 (if (<= b 1.32e+112) (* a a) (* (* angle angle) (* PI (* PI (* b (* b 3.08641975308642e-5)))))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.32e+112) {
tmp = a * a;
} else {
tmp = (angle * angle) * (((double) M_PI) * (((double) M_PI) * (b * (b * 3.08641975308642e-5))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 1.32e+112) {
tmp = a * a;
} else {
tmp = (angle * angle) * (Math.PI * (Math.PI * (b * (b * 3.08641975308642e-5))));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 1.32e+112: tmp = a * a else: tmp = (angle * angle) * (math.pi * (math.pi * (b * (b * 3.08641975308642e-5)))) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 1.32e+112) tmp = Float64(a * a); else tmp = Float64(Float64(angle * angle) * Float64(pi * Float64(pi * Float64(b * Float64(b * 3.08641975308642e-5))))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 1.32e+112) tmp = a * a; else tmp = (angle * angle) * (pi * (pi * (b * (b * 3.08641975308642e-5)))); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 1.32e+112], N[(a * a), $MachinePrecision], N[(N[(angle * angle), $MachinePrecision] * N[(Pi * N[(Pi * N[(b * N[(b * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.32 \cdot 10^{+112}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot angle\right) \cdot \left(\pi \cdot \left(\pi \cdot \left(b \cdot \left(b \cdot 3.08641975308642 \cdot 10^{-5}\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 1.32e112Initial program 75.2%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6460.0
Simplified60.0%
if 1.32e112 < b Initial program 90.6%
Taylor expanded in angle around 0
accelerator-lowering-fma.f64N/A
Simplified54.2%
Taylor expanded in b around inf
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r*N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-lowering-*.f64N/A
PI-lowering-PI.f64N/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6459.8
Simplified59.8%
(FPCore (a b angle) :precision binary64 (* a a))
double code(double a, double b, double angle) {
return a * a;
}
real(8) function code(a, b, angle)
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
code = a * a
end function
public static double code(double a, double b, double angle) {
return a * a;
}
def code(a, b, angle): return a * a
function code(a, b, angle) return Float64(a * a) end
function tmp = code(a, b, angle) tmp = a * a; end
code[a_, b_, angle_] := N[(a * a), $MachinePrecision]
\begin{array}{l}
\\
a \cdot a
\end{array}
Initial program 77.4%
Taylor expanded in angle around 0
unpow2N/A
*-lowering-*.f6456.6
Simplified56.6%
herbie shell --seed 2024207
(FPCore (a b angle)
:name "ab-angle->ABCF C"
:precision binary64
(+ (pow (* a (cos (* PI (/ angle 180.0)))) 2.0) (pow (* b (sin (* PI (/ angle 180.0)))) 2.0)))