
(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 15 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 (* (sin (* (/ angle 180.0) PI)) b) 2.0)
(pow
(*
(cos
(*
(/ (pow PI 0.16666666666666666) (/ 1.0 angle))
(/
(pow (pow PI 0.08333333333333333) 4.0)
(/ 180.0 (/ 1.0 (/ 1.0 (sqrt PI)))))))
a)
2.0)))
double code(double a, double b, double angle) {
return pow((sin(((angle / 180.0) * ((double) M_PI))) * b), 2.0) + pow((cos(((pow(((double) M_PI), 0.16666666666666666) / (1.0 / angle)) * (pow(pow(((double) M_PI), 0.08333333333333333), 4.0) / (180.0 / (1.0 / (1.0 / sqrt(((double) M_PI)))))))) * a), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((Math.sin(((angle / 180.0) * Math.PI)) * b), 2.0) + Math.pow((Math.cos(((Math.pow(Math.PI, 0.16666666666666666) / (1.0 / angle)) * (Math.pow(Math.pow(Math.PI, 0.08333333333333333), 4.0) / (180.0 / (1.0 / (1.0 / Math.sqrt(Math.PI))))))) * a), 2.0);
}
def code(a, b, angle): return math.pow((math.sin(((angle / 180.0) * math.pi)) * b), 2.0) + math.pow((math.cos(((math.pow(math.pi, 0.16666666666666666) / (1.0 / angle)) * (math.pow(math.pow(math.pi, 0.08333333333333333), 4.0) / (180.0 / (1.0 / (1.0 / math.sqrt(math.pi))))))) * a), 2.0)
function code(a, b, angle) return Float64((Float64(sin(Float64(Float64(angle / 180.0) * pi)) * b) ^ 2.0) + (Float64(cos(Float64(Float64((pi ^ 0.16666666666666666) / Float64(1.0 / angle)) * Float64(((pi ^ 0.08333333333333333) ^ 4.0) / Float64(180.0 / Float64(1.0 / Float64(1.0 / sqrt(pi))))))) * a) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((sin(((angle / 180.0) * pi)) * b) ^ 2.0) + ((cos((((pi ^ 0.16666666666666666) / (1.0 / angle)) * (((pi ^ 0.08333333333333333) ^ 4.0) / (180.0 / (1.0 / (1.0 / sqrt(pi))))))) * a) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * b), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(N[Cos[N[(N[(N[Power[Pi, 0.16666666666666666], $MachinePrecision] / N[(1.0 / angle), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[Power[Pi, 0.08333333333333333], $MachinePrecision], 4.0], $MachinePrecision] / N[(180.0 / N[(1.0 / N[(1.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * a), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot b\right)}^{2} + {\left(\cos \left(\frac{{\pi}^{0.16666666666666666}}{\frac{1}{angle}} \cdot \frac{{\left({\pi}^{0.08333333333333333}\right)}^{4}}{\frac{180}{\frac{1}{\frac{1}{\sqrt{\pi}}}}}\right) \cdot a\right)}^{2}
\end{array}
Initial program 79.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f6479.8
Applied rewrites79.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
metadata-evalN/A
lift-sqrt.f64N/A
sqrt-prodN/A
lift-PI.f64N/A
*-un-lft-identityN/A
add-cube-cbrtN/A
sqrt-prodN/A
pow2N/A
sqrt-pow1N/A
metadata-evalN/A
unpow1N/A
pow1/2N/A
Applied rewrites79.8%
lift-cbrt.f64N/A
pow1/3N/A
metadata-evalN/A
pow-prod-upN/A
sqr-powN/A
pow2N/A
sqr-powN/A
pow2N/A
pow-prod-upN/A
lower-pow.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-eval79.8
Applied rewrites79.8%
/-rgt-identityN/A
clear-numN/A
lower-/.f64N/A
lower-/.f6479.8
Applied rewrites79.8%
Final simplification79.8%
(FPCore (a b angle)
:precision binary64
(+
(pow
(*
(cos
(*
(/ (pow (pow PI 0.08333333333333333) 4.0) (/ 180.0 (sqrt PI)))
(/ (pow PI 0.16666666666666666) (/ 1.0 angle))))
a)
2.0)
(pow (* (sin (* (/ angle 180.0) PI)) b) 2.0)))
double code(double a, double b, double angle) {
return pow((cos(((pow(pow(((double) M_PI), 0.08333333333333333), 4.0) / (180.0 / sqrt(((double) M_PI)))) * (pow(((double) M_PI), 0.16666666666666666) / (1.0 / angle)))) * a), 2.0) + pow((sin(((angle / 180.0) * ((double) M_PI))) * b), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((Math.cos(((Math.pow(Math.pow(Math.PI, 0.08333333333333333), 4.0) / (180.0 / Math.sqrt(Math.PI))) * (Math.pow(Math.PI, 0.16666666666666666) / (1.0 / angle)))) * a), 2.0) + Math.pow((Math.sin(((angle / 180.0) * Math.PI)) * b), 2.0);
}
def code(a, b, angle): return math.pow((math.cos(((math.pow(math.pow(math.pi, 0.08333333333333333), 4.0) / (180.0 / math.sqrt(math.pi))) * (math.pow(math.pi, 0.16666666666666666) / (1.0 / angle)))) * a), 2.0) + math.pow((math.sin(((angle / 180.0) * math.pi)) * b), 2.0)
function code(a, b, angle) return Float64((Float64(cos(Float64(Float64(((pi ^ 0.08333333333333333) ^ 4.0) / Float64(180.0 / sqrt(pi))) * Float64((pi ^ 0.16666666666666666) / Float64(1.0 / angle)))) * a) ^ 2.0) + (Float64(sin(Float64(Float64(angle / 180.0) * pi)) * b) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((cos(((((pi ^ 0.08333333333333333) ^ 4.0) / (180.0 / sqrt(pi))) * ((pi ^ 0.16666666666666666) / (1.0 / angle)))) * a) ^ 2.0) + ((sin(((angle / 180.0) * pi)) * b) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(N[Cos[N[(N[(N[Power[N[Power[Pi, 0.08333333333333333], $MachinePrecision], 4.0], $MachinePrecision] / N[(180.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[Pi, 0.16666666666666666], $MachinePrecision] / N[(1.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * a), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(\cos \left(\frac{{\left({\pi}^{0.08333333333333333}\right)}^{4}}{\frac{180}{\sqrt{\pi}}} \cdot \frac{{\pi}^{0.16666666666666666}}{\frac{1}{angle}}\right) \cdot a\right)}^{2} + {\left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot b\right)}^{2}
\end{array}
Initial program 79.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f6479.8
Applied rewrites79.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
metadata-evalN/A
lift-sqrt.f64N/A
sqrt-prodN/A
lift-PI.f64N/A
*-un-lft-identityN/A
add-cube-cbrtN/A
sqrt-prodN/A
pow2N/A
sqrt-pow1N/A
metadata-evalN/A
unpow1N/A
pow1/2N/A
Applied rewrites79.8%
lift-cbrt.f64N/A
pow1/3N/A
metadata-evalN/A
pow-prod-upN/A
sqr-powN/A
pow2N/A
sqr-powN/A
pow2N/A
pow-prod-upN/A
lower-pow.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-eval79.8
Applied rewrites79.8%
Final simplification79.8%
(FPCore (a b angle)
:precision binary64
(+
(pow
(*
(cos
(*
(* (* 0.005555555555555556 (cbrt PI)) (sqrt PI))
(/ (pow PI 0.16666666666666666) (/ 1.0 angle))))
a)
2.0)
(pow (* (sin (* (/ angle 180.0) PI)) b) 2.0)))
double code(double a, double b, double angle) {
return pow((cos((((0.005555555555555556 * cbrt(((double) M_PI))) * sqrt(((double) M_PI))) * (pow(((double) M_PI), 0.16666666666666666) / (1.0 / angle)))) * a), 2.0) + pow((sin(((angle / 180.0) * ((double) M_PI))) * b), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((Math.cos((((0.005555555555555556 * Math.cbrt(Math.PI)) * Math.sqrt(Math.PI)) * (Math.pow(Math.PI, 0.16666666666666666) / (1.0 / angle)))) * a), 2.0) + Math.pow((Math.sin(((angle / 180.0) * Math.PI)) * b), 2.0);
}
function code(a, b, angle) return Float64((Float64(cos(Float64(Float64(Float64(0.005555555555555556 * cbrt(pi)) * sqrt(pi)) * Float64((pi ^ 0.16666666666666666) / Float64(1.0 / angle)))) * a) ^ 2.0) + (Float64(sin(Float64(Float64(angle / 180.0) * pi)) * b) ^ 2.0)) end
code[a_, b_, angle_] := N[(N[Power[N[(N[Cos[N[(N[(N[(0.005555555555555556 * N[Power[Pi, 1/3], $MachinePrecision]), $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(N[Power[Pi, 0.16666666666666666], $MachinePrecision] / N[(1.0 / angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * a), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(\cos \left(\left(\left(0.005555555555555556 \cdot \sqrt[3]{\pi}\right) \cdot \sqrt{\pi}\right) \cdot \frac{{\pi}^{0.16666666666666666}}{\frac{1}{angle}}\right) \cdot a\right)}^{2} + {\left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot b\right)}^{2}
\end{array}
Initial program 79.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f6479.8
Applied rewrites79.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
lift-/.f64N/A
frac-timesN/A
metadata-evalN/A
lift-sqrt.f64N/A
sqrt-prodN/A
lift-PI.f64N/A
*-un-lft-identityN/A
add-cube-cbrtN/A
sqrt-prodN/A
pow2N/A
sqrt-pow1N/A
metadata-evalN/A
unpow1N/A
pow1/2N/A
Applied rewrites79.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
lower-*.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f6479.8
Applied rewrites79.8%
Final simplification79.8%
(FPCore (a b angle) :precision binary64 (+ (pow (* (cos (* (/ 1.0 (/ 1.0 (* angle (sqrt PI)))) (/ (sqrt PI) 180.0))) a) 2.0) (pow (* (sin (* (/ angle 180.0) PI)) b) 2.0)))
double code(double a, double b, double angle) {
return pow((cos(((1.0 / (1.0 / (angle * sqrt(((double) M_PI))))) * (sqrt(((double) M_PI)) / 180.0))) * a), 2.0) + pow((sin(((angle / 180.0) * ((double) M_PI))) * b), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((Math.cos(((1.0 / (1.0 / (angle * Math.sqrt(Math.PI)))) * (Math.sqrt(Math.PI) / 180.0))) * a), 2.0) + Math.pow((Math.sin(((angle / 180.0) * Math.PI)) * b), 2.0);
}
def code(a, b, angle): return math.pow((math.cos(((1.0 / (1.0 / (angle * math.sqrt(math.pi)))) * (math.sqrt(math.pi) / 180.0))) * a), 2.0) + math.pow((math.sin(((angle / 180.0) * math.pi)) * b), 2.0)
function code(a, b, angle) return Float64((Float64(cos(Float64(Float64(1.0 / Float64(1.0 / Float64(angle * sqrt(pi)))) * Float64(sqrt(pi) / 180.0))) * a) ^ 2.0) + (Float64(sin(Float64(Float64(angle / 180.0) * pi)) * b) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((cos(((1.0 / (1.0 / (angle * sqrt(pi)))) * (sqrt(pi) / 180.0))) * a) ^ 2.0) + ((sin(((angle / 180.0) * pi)) * b) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(N[Cos[N[(N[(1.0 / N[(1.0 / N[(angle * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * a), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(\cos \left(\frac{1}{\frac{1}{angle \cdot \sqrt{\pi}}} \cdot \frac{\sqrt{\pi}}{180}\right) \cdot a\right)}^{2} + {\left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot b\right)}^{2}
\end{array}
Initial program 79.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f6479.8
Applied rewrites79.8%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
clear-numN/A
lift-/.f64N/A
lower-/.f6479.8
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-commutativeN/A
lower-*.f6479.8
Applied rewrites79.8%
Final simplification79.8%
(FPCore (a b angle) :precision binary64 (+ (pow (* (sin (* (* (* angle (sqrt PI)) 0.005555555555555556) (sqrt PI))) b) 2.0) (pow (* (cos (* (/ angle 180.0) PI)) a) 2.0)))
double code(double a, double b, double angle) {
return pow((sin((((angle * sqrt(((double) M_PI))) * 0.005555555555555556) * sqrt(((double) M_PI)))) * b), 2.0) + pow((cos(((angle / 180.0) * ((double) M_PI))) * a), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((Math.sin((((angle * Math.sqrt(Math.PI)) * 0.005555555555555556) * Math.sqrt(Math.PI))) * b), 2.0) + Math.pow((Math.cos(((angle / 180.0) * Math.PI)) * a), 2.0);
}
def code(a, b, angle): return math.pow((math.sin((((angle * math.sqrt(math.pi)) * 0.005555555555555556) * math.sqrt(math.pi))) * b), 2.0) + math.pow((math.cos(((angle / 180.0) * math.pi)) * a), 2.0)
function code(a, b, angle) return Float64((Float64(sin(Float64(Float64(Float64(angle * sqrt(pi)) * 0.005555555555555556) * sqrt(pi))) * b) ^ 2.0) + (Float64(cos(Float64(Float64(angle / 180.0) * pi)) * a) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((sin((((angle * sqrt(pi)) * 0.005555555555555556) * sqrt(pi))) * b) ^ 2.0) + ((cos(((angle / 180.0) * pi)) * a) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(N[Sin[N[(N[(N[(angle * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * 0.005555555555555556), $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * b), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * a), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(\sin \left(\left(\left(angle \cdot \sqrt{\pi}\right) \cdot 0.005555555555555556\right) \cdot \sqrt{\pi}\right) \cdot b\right)}^{2} + {\left(\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot a\right)}^{2}
\end{array}
Initial program 79.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
div-invN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-/.f6479.8
Applied rewrites79.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
frac-timesN/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
div-invN/A
times-fracN/A
Applied rewrites79.8%
Final simplification79.8%
(FPCore (a b angle) :precision binary64 (+ (pow (* (sin (* (/ PI (/ 1.0 angle)) 0.005555555555555556)) b) 2.0) (pow (* (cos (* (/ angle 180.0) PI)) a) 2.0)))
double code(double a, double b, double angle) {
return pow((sin(((((double) M_PI) / (1.0 / angle)) * 0.005555555555555556)) * b), 2.0) + pow((cos(((angle / 180.0) * ((double) M_PI))) * a), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((Math.sin(((Math.PI / (1.0 / angle)) * 0.005555555555555556)) * b), 2.0) + Math.pow((Math.cos(((angle / 180.0) * Math.PI)) * a), 2.0);
}
def code(a, b, angle): return math.pow((math.sin(((math.pi / (1.0 / angle)) * 0.005555555555555556)) * b), 2.0) + math.pow((math.cos(((angle / 180.0) * math.pi)) * a), 2.0)
function code(a, b, angle) return Float64((Float64(sin(Float64(Float64(pi / Float64(1.0 / angle)) * 0.005555555555555556)) * b) ^ 2.0) + (Float64(cos(Float64(Float64(angle / 180.0) * pi)) * a) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((sin(((pi / (1.0 / angle)) * 0.005555555555555556)) * b) ^ 2.0) + ((cos(((angle / 180.0) * pi)) * a) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(N[Sin[N[(N[(Pi / N[(1.0 / angle), $MachinePrecision]), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * b), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * a), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(\sin \left(\frac{\pi}{\frac{1}{angle}} \cdot 0.005555555555555556\right) \cdot b\right)}^{2} + {\left(\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot a\right)}^{2}
\end{array}
Initial program 79.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-*r/N/A
*-commutativeN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6479.8
Applied rewrites79.8%
Final simplification79.8%
(FPCore (a b angle) :precision binary64 (+ (pow (* (sin (* (* angle PI) 0.005555555555555556)) b) 2.0) (pow (* (cos (* (/ angle 180.0) PI)) a) 2.0)))
double code(double a, double b, double angle) {
return pow((sin(((angle * ((double) M_PI)) * 0.005555555555555556)) * b), 2.0) + pow((cos(((angle / 180.0) * ((double) M_PI))) * a), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((Math.sin(((angle * Math.PI) * 0.005555555555555556)) * b), 2.0) + Math.pow((Math.cos(((angle / 180.0) * Math.PI)) * a), 2.0);
}
def code(a, b, angle): return math.pow((math.sin(((angle * math.pi) * 0.005555555555555556)) * b), 2.0) + math.pow((math.cos(((angle / 180.0) * math.pi)) * a), 2.0)
function code(a, b, angle) return Float64((Float64(sin(Float64(Float64(angle * pi) * 0.005555555555555556)) * b) ^ 2.0) + (Float64(cos(Float64(Float64(angle / 180.0) * pi)) * a) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((sin(((angle * pi) * 0.005555555555555556)) * b) ^ 2.0) + ((cos(((angle / 180.0) * pi)) * a) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(N[Sin[N[(N[(angle * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * b), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * a), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(\sin \left(\left(angle \cdot \pi\right) \cdot 0.005555555555555556\right) \cdot b\right)}^{2} + {\left(\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot a\right)}^{2}
\end{array}
Initial program 79.8%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
div-invN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
metadata-eval79.8
Applied rewrites79.8%
Final simplification79.8%
(FPCore (a b angle) :precision binary64 (+ (pow (* (sin (* (* 0.005555555555555556 PI) angle)) b) 2.0) (pow (* (cos (* (/ angle 180.0) PI)) a) 2.0)))
double code(double a, double b, double angle) {
return pow((sin(((0.005555555555555556 * ((double) M_PI)) * angle)) * b), 2.0) + pow((cos(((angle / 180.0) * ((double) M_PI))) * a), 2.0);
}
public static double code(double a, double b, double angle) {
return Math.pow((Math.sin(((0.005555555555555556 * Math.PI) * angle)) * b), 2.0) + Math.pow((Math.cos(((angle / 180.0) * Math.PI)) * a), 2.0);
}
def code(a, b, angle): return math.pow((math.sin(((0.005555555555555556 * math.pi) * angle)) * b), 2.0) + math.pow((math.cos(((angle / 180.0) * math.pi)) * a), 2.0)
function code(a, b, angle) return Float64((Float64(sin(Float64(Float64(0.005555555555555556 * pi) * angle)) * b) ^ 2.0) + (Float64(cos(Float64(Float64(angle / 180.0) * pi)) * a) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = ((sin(((0.005555555555555556 * pi) * angle)) * b) ^ 2.0) + ((cos(((angle / 180.0) * pi)) * a) ^ 2.0); end
code[a_, b_, angle_] := N[(N[Power[N[(N[Sin[N[(N[(0.005555555555555556 * Pi), $MachinePrecision] * angle), $MachinePrecision]], $MachinePrecision] * b), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * a), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(\sin \left(\left(0.005555555555555556 \cdot \pi\right) \cdot angle\right) \cdot b\right)}^{2} + {\left(\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot a\right)}^{2}
\end{array}
Initial program 79.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
metadata-eval79.8
Applied rewrites79.8%
Final simplification79.8%
(FPCore (a b angle) :precision binary64 (+ (pow (* (sin (/ (/ PI 180.0) (/ 1.0 angle))) b) 2.0) (* a a)))
double code(double a, double b, double angle) {
return pow((sin(((((double) M_PI) / 180.0) / (1.0 / angle))) * b), 2.0) + (a * a);
}
public static double code(double a, double b, double angle) {
return Math.pow((Math.sin(((Math.PI / 180.0) / (1.0 / angle))) * b), 2.0) + (a * a);
}
def code(a, b, angle): return math.pow((math.sin(((math.pi / 180.0) / (1.0 / angle))) * b), 2.0) + (a * a)
function code(a, b, angle) return Float64((Float64(sin(Float64(Float64(pi / 180.0) / Float64(1.0 / angle))) * b) ^ 2.0) + Float64(a * a)) end
function tmp = code(a, b, angle) tmp = ((sin(((pi / 180.0) / (1.0 / angle))) * b) ^ 2.0) + (a * a); end
code[a_, b_, angle_] := N[(N[Power[N[(N[Sin[N[(N[(Pi / 180.0), $MachinePrecision] / N[(1.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * b), $MachinePrecision], 2.0], $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(\sin \left(\frac{\frac{\pi}{180}}{\frac{1}{angle}}\right) \cdot b\right)}^{2} + a \cdot a
\end{array}
Initial program 79.8%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
div-invN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-/.f6479.8
Applied rewrites79.8%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6479.8
Applied rewrites79.8%
Final simplification79.8%
(FPCore (a b angle) :precision binary64 (+ (* a a) (pow (* (sin (* (/ angle 180.0) PI)) b) 2.0)))
double code(double a, double b, double angle) {
return (a * a) + pow((sin(((angle / 180.0) * ((double) M_PI))) * b), 2.0);
}
public static double code(double a, double b, double angle) {
return (a * a) + Math.pow((Math.sin(((angle / 180.0) * Math.PI)) * b), 2.0);
}
def code(a, b, angle): return (a * a) + math.pow((math.sin(((angle / 180.0) * math.pi)) * b), 2.0)
function code(a, b, angle) return Float64(Float64(a * a) + (Float64(sin(Float64(Float64(angle / 180.0) * pi)) * b) ^ 2.0)) end
function tmp = code(a, b, angle) tmp = (a * a) + ((sin(((angle / 180.0) * pi)) * b) ^ 2.0); end
code[a_, b_, angle_] := N[(N[(a * a), $MachinePrecision] + N[Power[N[(N[Sin[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * b), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot a + {\left(\sin \left(\frac{angle}{180} \cdot \pi\right) \cdot b\right)}^{2}
\end{array}
Initial program 79.8%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6479.7
Applied rewrites79.7%
Final simplification79.7%
(FPCore (a b angle)
:precision binary64
(if (<= b 1.1e-62)
(* a a)
(if (<= b 3.2e+159)
(fma
(* (* (* (* b b) 3.08641975308642e-5) PI) PI)
(* angle angle)
(* a a))
(* (* PI PI) (* (* (* (* b angle) angle) b) 3.08641975308642e-5)))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 1.1e-62) {
tmp = a * a;
} else if (b <= 3.2e+159) {
tmp = fma(((((b * b) * 3.08641975308642e-5) * ((double) M_PI)) * ((double) M_PI)), (angle * angle), (a * a));
} else {
tmp = (((double) M_PI) * ((double) M_PI)) * ((((b * angle) * angle) * b) * 3.08641975308642e-5);
}
return tmp;
}
function code(a, b, angle) tmp = 0.0 if (b <= 1.1e-62) tmp = Float64(a * a); elseif (b <= 3.2e+159) tmp = fma(Float64(Float64(Float64(Float64(b * b) * 3.08641975308642e-5) * pi) * pi), Float64(angle * angle), Float64(a * a)); else tmp = Float64(Float64(pi * pi) * Float64(Float64(Float64(Float64(b * angle) * angle) * b) * 3.08641975308642e-5)); end return tmp end
code[a_, b_, angle_] := If[LessEqual[b, 1.1e-62], N[(a * a), $MachinePrecision], If[LessEqual[b, 3.2e+159], N[(N[(N[(N[(N[(b * b), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision] * Pi), $MachinePrecision] * Pi), $MachinePrecision] * N[(angle * angle), $MachinePrecision] + N[(a * a), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * Pi), $MachinePrecision] * N[(N[(N[(N[(b * angle), $MachinePrecision] * angle), $MachinePrecision] * b), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.1 \cdot 10^{-62}:\\
\;\;\;\;a \cdot a\\
\mathbf{elif}\;b \leq 3.2 \cdot 10^{+159}:\\
\;\;\;\;\mathsf{fma}\left(\left(\left(\left(b \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \pi\right) \cdot \pi, angle \cdot angle, a \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\pi \cdot \pi\right) \cdot \left(\left(\left(\left(b \cdot angle\right) \cdot angle\right) \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\\
\end{array}
\end{array}
if b < 1.10000000000000009e-62Initial program 77.5%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6463.2
Applied rewrites63.2%
if 1.10000000000000009e-62 < b < 3.19999999999999985e159Initial program 70.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f6470.6
Applied rewrites70.6%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites35.1%
Taylor expanded in b around inf
Applied rewrites59.3%
if 3.19999999999999985e159 < b Initial program 99.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites43.7%
Taylor expanded in b around inf
Applied rewrites77.3%
Applied rewrites90.1%
Final simplification66.7%
(FPCore (a b angle) :precision binary64 (if (<= b 5.2e+118) (* a a) (* (* PI PI) (* (* (* (* b angle) angle) b) 3.08641975308642e-5))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 5.2e+118) {
tmp = a * a;
} else {
tmp = (((double) M_PI) * ((double) M_PI)) * ((((b * angle) * angle) * b) * 3.08641975308642e-5);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 5.2e+118) {
tmp = a * a;
} else {
tmp = (Math.PI * Math.PI) * ((((b * angle) * angle) * b) * 3.08641975308642e-5);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 5.2e+118: tmp = a * a else: tmp = (math.pi * math.pi) * ((((b * angle) * angle) * b) * 3.08641975308642e-5) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 5.2e+118) tmp = Float64(a * a); else tmp = Float64(Float64(pi * pi) * Float64(Float64(Float64(Float64(b * angle) * angle) * b) * 3.08641975308642e-5)); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 5.2e+118) tmp = a * a; else tmp = (pi * pi) * ((((b * angle) * angle) * b) * 3.08641975308642e-5); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 5.2e+118], N[(a * a), $MachinePrecision], N[(N[(Pi * Pi), $MachinePrecision] * N[(N[(N[(N[(b * angle), $MachinePrecision] * angle), $MachinePrecision] * b), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5.2 \cdot 10^{+118}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\pi \cdot \pi\right) \cdot \left(\left(\left(\left(b \cdot angle\right) \cdot angle\right) \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right)\\
\end{array}
\end{array}
if b < 5.20000000000000032e118Initial program 75.9%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6460.8
Applied rewrites60.8%
if 5.20000000000000032e118 < b Initial program 96.3%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f6496.3
Applied rewrites96.3%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites39.0%
Taylor expanded in b around inf
Applied rewrites69.3%
Applied rewrites83.9%
Final simplification65.1%
(FPCore (a b angle) :precision binary64 (if (<= b 3.2e+159) (* a a) (* (* (* (* (* angle angle) b) b) 3.08641975308642e-5) (* PI PI))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 3.2e+159) {
tmp = a * a;
} else {
tmp = ((((angle * angle) * b) * b) * 3.08641975308642e-5) * (((double) M_PI) * ((double) M_PI));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 3.2e+159) {
tmp = a * a;
} else {
tmp = ((((angle * angle) * b) * b) * 3.08641975308642e-5) * (Math.PI * Math.PI);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 3.2e+159: tmp = a * a else: tmp = ((((angle * angle) * b) * b) * 3.08641975308642e-5) * (math.pi * math.pi) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 3.2e+159) tmp = Float64(a * a); else tmp = Float64(Float64(Float64(Float64(Float64(angle * angle) * b) * b) * 3.08641975308642e-5) * Float64(pi * pi)); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 3.2e+159) tmp = a * a; else tmp = ((((angle * angle) * b) * b) * 3.08641975308642e-5) * (pi * pi); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 3.2e+159], N[(a * a), $MachinePrecision], N[(N[(N[(N[(N[(angle * angle), $MachinePrecision] * b), $MachinePrecision] * b), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.2 \cdot 10^{+159}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(angle \cdot angle\right) \cdot b\right) \cdot b\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot \left(\pi \cdot \pi\right)\\
\end{array}
\end{array}
if b < 3.19999999999999985e159Initial program 76.1%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6460.0
Applied rewrites60.0%
if 3.19999999999999985e159 < b Initial program 99.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites43.7%
Taylor expanded in b around inf
Applied rewrites77.3%
Final simplification62.7%
(FPCore (a b angle) :precision binary64 (if (<= b 3.2e+159) (* a a) (* (* (* (* (* angle angle) 3.08641975308642e-5) b) b) (* PI PI))))
double code(double a, double b, double angle) {
double tmp;
if (b <= 3.2e+159) {
tmp = a * a;
} else {
tmp = ((((angle * angle) * 3.08641975308642e-5) * b) * b) * (((double) M_PI) * ((double) M_PI));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (b <= 3.2e+159) {
tmp = a * a;
} else {
tmp = ((((angle * angle) * 3.08641975308642e-5) * b) * b) * (Math.PI * Math.PI);
}
return tmp;
}
def code(a, b, angle): tmp = 0 if b <= 3.2e+159: tmp = a * a else: tmp = ((((angle * angle) * 3.08641975308642e-5) * b) * b) * (math.pi * math.pi) return tmp
function code(a, b, angle) tmp = 0.0 if (b <= 3.2e+159) tmp = Float64(a * a); else tmp = Float64(Float64(Float64(Float64(Float64(angle * angle) * 3.08641975308642e-5) * b) * b) * Float64(pi * pi)); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (b <= 3.2e+159) tmp = a * a; else tmp = ((((angle * angle) * 3.08641975308642e-5) * b) * b) * (pi * pi); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[b, 3.2e+159], N[(a * a), $MachinePrecision], N[(N[(N[(N[(N[(angle * angle), $MachinePrecision] * 3.08641975308642e-5), $MachinePrecision] * b), $MachinePrecision] * b), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.2 \cdot 10^{+159}:\\
\;\;\;\;a \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}\right) \cdot b\right) \cdot b\right) \cdot \left(\pi \cdot \pi\right)\\
\end{array}
\end{array}
if b < 3.19999999999999985e159Initial program 76.1%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6460.0
Applied rewrites60.0%
if 3.19999999999999985e159 < b Initial program 99.7%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
div-invN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites43.7%
Taylor expanded in b around inf
Applied rewrites77.3%
Taylor expanded in angle around 0
Applied rewrites76.8%
Final simplification62.7%
(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 79.8%
Taylor expanded in angle around 0
unpow2N/A
lower-*.f6455.7
Applied rewrites55.7%
herbie shell --seed 2024235
(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)))