
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(if (<= (pow a_m 2.0) 2e+92)
(*
(cos (* (/ angle 180.0) (* (sqrt (* (sqrt PI) PI)) (sqrt (sqrt PI)))))
(*
(* (* (sin (* PI (* angle 0.005555555555555556))) 2.0) (- b a_m))
(+ b a_m)))
(*
(cos (* (/ angle 180.0) PI))
(*
(*
(* (sin (* (* (sqrt PI) angle) (pow (/ 180.0 (sqrt PI)) -1.0))) 2.0)
(- b a_m))
(+ b a_m)))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if (pow(a_m, 2.0) <= 2e+92) {
tmp = cos(((angle / 180.0) * (sqrt((sqrt(((double) M_PI)) * ((double) M_PI))) * sqrt(sqrt(((double) M_PI)))))) * (((sin((((double) M_PI) * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m));
} else {
tmp = cos(((angle / 180.0) * ((double) M_PI))) * (((sin(((sqrt(((double) M_PI)) * angle) * pow((180.0 / sqrt(((double) M_PI))), -1.0))) * 2.0) * (b - a_m)) * (b + a_m));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double tmp;
if (Math.pow(a_m, 2.0) <= 2e+92) {
tmp = Math.cos(((angle / 180.0) * (Math.sqrt((Math.sqrt(Math.PI) * Math.PI)) * Math.sqrt(Math.sqrt(Math.PI))))) * (((Math.sin((Math.PI * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m));
} else {
tmp = Math.cos(((angle / 180.0) * Math.PI)) * (((Math.sin(((Math.sqrt(Math.PI) * angle) * Math.pow((180.0 / Math.sqrt(Math.PI)), -1.0))) * 2.0) * (b - a_m)) * (b + a_m));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): tmp = 0 if math.pow(a_m, 2.0) <= 2e+92: tmp = math.cos(((angle / 180.0) * (math.sqrt((math.sqrt(math.pi) * math.pi)) * math.sqrt(math.sqrt(math.pi))))) * (((math.sin((math.pi * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m)) else: tmp = math.cos(((angle / 180.0) * math.pi)) * (((math.sin(((math.sqrt(math.pi) * angle) * math.pow((180.0 / math.sqrt(math.pi)), -1.0))) * 2.0) * (b - a_m)) * (b + a_m)) return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if ((a_m ^ 2.0) <= 2e+92) tmp = Float64(cos(Float64(Float64(angle / 180.0) * Float64(sqrt(Float64(sqrt(pi) * pi)) * sqrt(sqrt(pi))))) * Float64(Float64(Float64(sin(Float64(pi * Float64(angle * 0.005555555555555556))) * 2.0) * Float64(b - a_m)) * Float64(b + a_m))); else tmp = Float64(cos(Float64(Float64(angle / 180.0) * pi)) * Float64(Float64(Float64(sin(Float64(Float64(sqrt(pi) * angle) * (Float64(180.0 / sqrt(pi)) ^ -1.0))) * 2.0) * Float64(b - a_m)) * Float64(b + a_m))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) tmp = 0.0; if ((a_m ^ 2.0) <= 2e+92) tmp = cos(((angle / 180.0) * (sqrt((sqrt(pi) * pi)) * sqrt(sqrt(pi))))) * (((sin((pi * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m)); else tmp = cos(((angle / 180.0) * pi)) * (((sin(((sqrt(pi) * angle) * ((180.0 / sqrt(pi)) ^ -1.0))) * 2.0) * (b - a_m)) * (b + a_m)); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[N[Power[a$95$m, 2.0], $MachinePrecision], 2e+92], N[(N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * N[(N[Sqrt[N[(N[Sqrt[Pi], $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Sqrt[Pi], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[Sin[N[(N[(N[Sqrt[Pi], $MachinePrecision] * angle), $MachinePrecision] * N[Power[N[(180.0 / N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;{a\_m}^{2} \leq 2 \cdot 10^{+92}:\\
\;\;\;\;\cos \left(\frac{angle}{180} \cdot \left(\sqrt{\sqrt{\pi} \cdot \pi} \cdot \sqrt{\sqrt{\pi}}\right)\right) \cdot \left(\left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\frac{angle}{180} \cdot \pi\right) \cdot \left(\left(\left(\sin \left(\left(\sqrt{\pi} \cdot angle\right) \cdot {\left(\frac{180}{\sqrt{\pi}}\right)}^{-1}\right) \cdot 2\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 2.0000000000000001e92Initial program 57.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6463.2
Applied rewrites62.3%
rem-square-sqrtN/A
sqrt-unprodN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
associate-*l*N/A
lift-PI.f64N/A
add-sqr-sqrtN/A
cube-unmultN/A
pow3N/A
add-sqr-sqrtN/A
lift-PI.f64N/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
add-sqr-sqrtN/A
Applied rewrites65.1%
if 2.0000000000000001e92 < (pow.f64 a #s(literal 2 binary64)) Initial program 52.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6472.4
Applied rewrites72.4%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
metadata-evalN/A
associate-/r/N/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6472.8
Applied rewrites72.8%
lift-/.f64N/A
clear-numN/A
inv-powN/A
lift-/.f64N/A
div-invN/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
times-fracN/A
unpow-prod-downN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
/-rgt-identityN/A
lower-/.f64N/A
lower-*.f6481.1
Applied rewrites81.1%
lift-pow.f64N/A
unpow-1N/A
lift-/.f64N/A
clear-numN/A
/-rgt-identity81.2
Applied rewrites81.2%
Final simplification72.4%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (* (cos (* (/ angle 180.0) (* (sqrt (* (sqrt PI) PI)) (sqrt (sqrt PI))))) (* (* (* (sin (* PI (* angle 0.005555555555555556))) 2.0) (- b a_m)) (+ b a_m))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
return cos(((angle / 180.0) * (sqrt((sqrt(((double) M_PI)) * ((double) M_PI))) * sqrt(sqrt(((double) M_PI)))))) * (((sin((((double) M_PI) * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m));
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
return Math.cos(((angle / 180.0) * (Math.sqrt((Math.sqrt(Math.PI) * Math.PI)) * Math.sqrt(Math.sqrt(Math.PI))))) * (((Math.sin((Math.PI * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m));
}
a_m = math.fabs(a) def code(a_m, b, angle): return math.cos(((angle / 180.0) * (math.sqrt((math.sqrt(math.pi) * math.pi)) * math.sqrt(math.sqrt(math.pi))))) * (((math.sin((math.pi * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m))
a_m = abs(a) function code(a_m, b, angle) return Float64(cos(Float64(Float64(angle / 180.0) * Float64(sqrt(Float64(sqrt(pi) * pi)) * sqrt(sqrt(pi))))) * Float64(Float64(Float64(sin(Float64(pi * Float64(angle * 0.005555555555555556))) * 2.0) * Float64(b - a_m)) * Float64(b + a_m))) end
a_m = abs(a); function tmp = code(a_m, b, angle) tmp = cos(((angle / 180.0) * (sqrt((sqrt(pi) * pi)) * sqrt(sqrt(pi))))) * (((sin((pi * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m)); end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := N[(N[Cos[N[(N[(angle / 180.0), $MachinePrecision] * N[(N[Sqrt[N[(N[Sqrt[Pi], $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Sqrt[Pi], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
\cos \left(\frac{angle}{180} \cdot \left(\sqrt{\sqrt{\pi} \cdot \pi} \cdot \sqrt{\sqrt{\pi}}\right)\right) \cdot \left(\left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\right)
\end{array}
Initial program 54.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6467.4
Applied rewrites66.9%
rem-square-sqrtN/A
sqrt-unprodN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
associate-*l*N/A
lift-PI.f64N/A
add-sqr-sqrtN/A
cube-unmultN/A
pow3N/A
add-sqr-sqrtN/A
lift-PI.f64N/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
add-sqr-sqrtN/A
Applied rewrites69.5%
Final simplification69.5%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0
(*
(* (* (sin (* PI (* angle 0.005555555555555556))) 2.0) (- b a_m))
(+ b a_m))))
(if (<= (/ angle 180.0) 5e+122)
(* (cos (* (* PI angle) 0.005555555555555556)) t_0)
(* (cos (* (* (sqrt PI) (sqrt PI)) (/ angle 180.0))) t_0))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = ((sin((((double) M_PI) * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m);
double tmp;
if ((angle / 180.0) <= 5e+122) {
tmp = cos(((((double) M_PI) * angle) * 0.005555555555555556)) * t_0;
} else {
tmp = cos(((sqrt(((double) M_PI)) * sqrt(((double) M_PI))) * (angle / 180.0))) * t_0;
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = ((Math.sin((Math.PI * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m);
double tmp;
if ((angle / 180.0) <= 5e+122) {
tmp = Math.cos(((Math.PI * angle) * 0.005555555555555556)) * t_0;
} else {
tmp = Math.cos(((Math.sqrt(Math.PI) * Math.sqrt(Math.PI)) * (angle / 180.0))) * t_0;
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): t_0 = ((math.sin((math.pi * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m) tmp = 0 if (angle / 180.0) <= 5e+122: tmp = math.cos(((math.pi * angle) * 0.005555555555555556)) * t_0 else: tmp = math.cos(((math.sqrt(math.pi) * math.sqrt(math.pi)) * (angle / 180.0))) * t_0 return tmp
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(Float64(Float64(sin(Float64(pi * Float64(angle * 0.005555555555555556))) * 2.0) * Float64(b - a_m)) * Float64(b + a_m)) tmp = 0.0 if (Float64(angle / 180.0) <= 5e+122) tmp = Float64(cos(Float64(Float64(pi * angle) * 0.005555555555555556)) * t_0); else tmp = Float64(cos(Float64(Float64(sqrt(pi) * sqrt(pi)) * Float64(angle / 180.0))) * t_0); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) t_0 = ((sin((pi * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m); tmp = 0.0; if ((angle / 180.0) <= 5e+122) tmp = cos(((pi * angle) * 0.005555555555555556)) * t_0; else tmp = cos(((sqrt(pi) * sqrt(pi)) * (angle / 180.0))) * t_0; end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[(N[(N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+122], N[(N[Cos[N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[Cos[N[(N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\\
\mathbf{if}\;\frac{angle}{180} \leq 5 \cdot 10^{+122}:\\
\;\;\;\;\cos \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\cos \left(\left(\sqrt{\pi} \cdot \sqrt{\pi}\right) \cdot \frac{angle}{180}\right) \cdot t\_0\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 4.99999999999999989e122Initial program 59.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6473.6
Applied rewrites72.8%
Taylor expanded in angle around inf
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6474.6
Applied rewrites74.6%
if 4.99999999999999989e122 < (/.f64 angle #s(literal 180 binary64)) Initial program 21.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6424.1
Applied rewrites26.2%
lift-PI.f64N/A
add-sqr-sqrtN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6440.9
Applied rewrites40.9%
Final simplification70.3%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= (- (pow b 2.0) (pow a_m 2.0)) -2e-198) (* (* (* (* PI angle) a_m) -0.011111111111111112) a_m) (* (* (* (* b b) PI) angle) 0.011111111111111112)))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if ((pow(b, 2.0) - pow(a_m, 2.0)) <= -2e-198) {
tmp = (((((double) M_PI) * angle) * a_m) * -0.011111111111111112) * a_m;
} else {
tmp = (((b * b) * ((double) M_PI)) * angle) * 0.011111111111111112;
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a_m, 2.0)) <= -2e-198) {
tmp = (((Math.PI * angle) * a_m) * -0.011111111111111112) * a_m;
} else {
tmp = (((b * b) * Math.PI) * angle) * 0.011111111111111112;
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): tmp = 0 if (math.pow(b, 2.0) - math.pow(a_m, 2.0)) <= -2e-198: tmp = (((math.pi * angle) * a_m) * -0.011111111111111112) * a_m else: tmp = (((b * b) * math.pi) * angle) * 0.011111111111111112 return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (Float64((b ^ 2.0) - (a_m ^ 2.0)) <= -2e-198) tmp = Float64(Float64(Float64(Float64(pi * angle) * a_m) * -0.011111111111111112) * a_m); else tmp = Float64(Float64(Float64(Float64(b * b) * pi) * angle) * 0.011111111111111112); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) tmp = 0.0; if (((b ^ 2.0) - (a_m ^ 2.0)) <= -2e-198) tmp = (((pi * angle) * a_m) * -0.011111111111111112) * a_m; else tmp = (((b * b) * pi) * angle) * 0.011111111111111112; end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision], -2e-198], N[(N[(N[(N[(Pi * angle), $MachinePrecision] * a$95$m), $MachinePrecision] * -0.011111111111111112), $MachinePrecision] * a$95$m), $MachinePrecision], N[(N[(N[(N[(b * b), $MachinePrecision] * Pi), $MachinePrecision] * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -2 \cdot 10^{-198}:\\
\;\;\;\;\left(\left(\left(\pi \cdot angle\right) \cdot a\_m\right) \cdot -0.011111111111111112\right) \cdot a\_m\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(b \cdot b\right) \cdot \pi\right) \cdot angle\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1.9999999999999998e-198Initial program 57.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6452.0
Applied rewrites52.0%
Taylor expanded in b around 0
Applied rewrites51.8%
Applied rewrites63.2%
Applied rewrites63.3%
if -1.9999999999999998e-198 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 52.5%
Taylor expanded in b around inf
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
Applied rewrites55.9%
Taylor expanded in angle around 0
Applied rewrites50.0%
Final simplification55.9%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(if (<= b 2.5e+173)
(* (* (sin (* (* 0.011111111111111112 PI) angle)) (- b a_m)) (+ b a_m))
(*
(fma (* (* angle angle) -1.54320987654321e-5) (* PI PI) 1.0)
(*
(* (* (sin (* PI (* angle 0.005555555555555556))) 2.0) (- b a_m))
(+ b a_m)))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if (b <= 2.5e+173) {
tmp = (sin(((0.011111111111111112 * ((double) M_PI)) * angle)) * (b - a_m)) * (b + a_m);
} else {
tmp = fma(((angle * angle) * -1.54320987654321e-5), (((double) M_PI) * ((double) M_PI)), 1.0) * (((sin((((double) M_PI) * (angle * 0.005555555555555556))) * 2.0) * (b - a_m)) * (b + a_m));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (b <= 2.5e+173) tmp = Float64(Float64(sin(Float64(Float64(0.011111111111111112 * pi) * angle)) * Float64(b - a_m)) * Float64(b + a_m)); else tmp = Float64(fma(Float64(Float64(angle * angle) * -1.54320987654321e-5), Float64(pi * pi), 1.0) * Float64(Float64(Float64(sin(Float64(pi * Float64(angle * 0.005555555555555556))) * 2.0) * Float64(b - a_m)) * Float64(b + a_m))); end return tmp end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[b, 2.5e+173], N[(N[(N[Sin[N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * angle), $MachinePrecision]], $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(angle * angle), $MachinePrecision] * -1.54320987654321e-5), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(N[(N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 2.0), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 2.5 \cdot 10^{+173}:\\
\;\;\;\;\left(\sin \left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -1.54320987654321 \cdot 10^{-5}, \pi \cdot \pi, 1\right) \cdot \left(\left(\left(\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\right)\\
\end{array}
\end{array}
if b < 2.50000000000000017e173Initial program 56.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
flip--N/A
clear-numN/A
associate-*l/N/A
Applied rewrites56.6%
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites67.9%
if 2.50000000000000017e173 < b Initial program 32.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6475.0
Applied rewrites75.0%
Taylor expanded in angle around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f6480.0
Applied rewrites80.0%
Final simplification68.8%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(if (<= b 3.8e+265)
(* (* (sin (* (* 0.011111111111111112 PI) angle)) (- b a_m)) (+ b a_m))
(/
(*
(fma
(* -2.2862368541380886e-7 (* angle angle))
(* (* PI PI) PI)
(* 0.011111111111111112 PI))
angle)
(/ 1.0 (* (- b a_m) (+ b a_m))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if (b <= 3.8e+265) {
tmp = (sin(((0.011111111111111112 * ((double) M_PI)) * angle)) * (b - a_m)) * (b + a_m);
} else {
tmp = (fma((-2.2862368541380886e-7 * (angle * angle)), ((((double) M_PI) * ((double) M_PI)) * ((double) M_PI)), (0.011111111111111112 * ((double) M_PI))) * angle) / (1.0 / ((b - a_m) * (b + a_m)));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (b <= 3.8e+265) tmp = Float64(Float64(sin(Float64(Float64(0.011111111111111112 * pi) * angle)) * Float64(b - a_m)) * Float64(b + a_m)); else tmp = Float64(Float64(fma(Float64(-2.2862368541380886e-7 * Float64(angle * angle)), Float64(Float64(pi * pi) * pi), Float64(0.011111111111111112 * pi)) * angle) / Float64(1.0 / Float64(Float64(b - a_m) * Float64(b + a_m)))); end return tmp end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[b, 3.8e+265], N[(N[(N[Sin[N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * angle), $MachinePrecision]], $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(-2.2862368541380886e-7 * N[(angle * angle), $MachinePrecision]), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision] + N[(0.011111111111111112 * Pi), $MachinePrecision]), $MachinePrecision] * angle), $MachinePrecision] / N[(1.0 / N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.8 \cdot 10^{+265}:\\
\;\;\;\;\left(\sin \left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \left(\pi \cdot \pi\right) \cdot \pi, 0.011111111111111112 \cdot \pi\right) \cdot angle}{\frac{1}{\left(b - a\_m\right) \cdot \left(b + a\_m\right)}}\\
\end{array}
\end{array}
if b < 3.80000000000000015e265Initial program 55.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
flip--N/A
clear-numN/A
associate-*l/N/A
Applied rewrites56.1%
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-/r/N/A
lower-*.f64N/A
Applied rewrites68.5%
if 3.80000000000000015e265 < b Initial program 33.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
flip--N/A
clear-numN/A
associate-*l/N/A
Applied rewrites33.3%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow3N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-PI.f6466.7
Applied rewrites66.7%
Final simplification68.4%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(if (<= (/ angle 180.0) 1e+14)
(* (* (* (* 0.011111111111111112 PI) angle) (- b a_m)) (+ b a_m))
(/
(*
(fma
(* -2.2862368541380886e-7 (* angle angle))
(* (* PI PI) PI)
(* 0.011111111111111112 PI))
angle)
(/ 1.0 (* (- b a_m) (+ b a_m))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 1e+14) {
tmp = (((0.011111111111111112 * ((double) M_PI)) * angle) * (b - a_m)) * (b + a_m);
} else {
tmp = (fma((-2.2862368541380886e-7 * (angle * angle)), ((((double) M_PI) * ((double) M_PI)) * ((double) M_PI)), (0.011111111111111112 * ((double) M_PI))) * angle) / (1.0 / ((b - a_m) * (b + a_m)));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 1e+14) tmp = Float64(Float64(Float64(Float64(0.011111111111111112 * pi) * angle) * Float64(b - a_m)) * Float64(b + a_m)); else tmp = Float64(Float64(fma(Float64(-2.2862368541380886e-7 * Float64(angle * angle)), Float64(Float64(pi * pi) * pi), Float64(0.011111111111111112 * pi)) * angle) / Float64(1.0 / Float64(Float64(b - a_m) * Float64(b + a_m)))); end return tmp end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+14], N[(N[(N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * angle), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(-2.2862368541380886e-7 * N[(angle * angle), $MachinePrecision]), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision] + N[(0.011111111111111112 * Pi), $MachinePrecision]), $MachinePrecision] * angle), $MachinePrecision] / N[(1.0 / N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 10^{+14}:\\
\;\;\;\;\left(\left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \left(\pi \cdot \pi\right) \cdot \pi, 0.011111111111111112 \cdot \pi\right) \cdot angle}{\frac{1}{\left(b - a\_m\right) \cdot \left(b + a\_m\right)}}\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1e14Initial program 64.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6462.2
Applied rewrites62.2%
Applied rewrites75.8%
if 1e14 < (/.f64 angle #s(literal 180 binary64)) Initial program 26.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
flip--N/A
clear-numN/A
associate-*l/N/A
Applied rewrites26.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow3N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-PI.f6433.4
Applied rewrites33.4%
Final simplification65.3%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= a_m 1.55e+140) (* (* (* (- b a_m) (+ b a_m)) (* 0.011111111111111112 PI)) angle) (* (* (* (* PI angle) a_m) -0.011111111111111112) a_m)))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if (a_m <= 1.55e+140) {
tmp = (((b - a_m) * (b + a_m)) * (0.011111111111111112 * ((double) M_PI))) * angle;
} else {
tmp = (((((double) M_PI) * angle) * a_m) * -0.011111111111111112) * a_m;
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double tmp;
if (a_m <= 1.55e+140) {
tmp = (((b - a_m) * (b + a_m)) * (0.011111111111111112 * Math.PI)) * angle;
} else {
tmp = (((Math.PI * angle) * a_m) * -0.011111111111111112) * a_m;
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): tmp = 0 if a_m <= 1.55e+140: tmp = (((b - a_m) * (b + a_m)) * (0.011111111111111112 * math.pi)) * angle else: tmp = (((math.pi * angle) * a_m) * -0.011111111111111112) * a_m return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (a_m <= 1.55e+140) tmp = Float64(Float64(Float64(Float64(b - a_m) * Float64(b + a_m)) * Float64(0.011111111111111112 * pi)) * angle); else tmp = Float64(Float64(Float64(Float64(pi * angle) * a_m) * -0.011111111111111112) * a_m); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) tmp = 0.0; if (a_m <= 1.55e+140) tmp = (((b - a_m) * (b + a_m)) * (0.011111111111111112 * pi)) * angle; else tmp = (((pi * angle) * a_m) * -0.011111111111111112) * a_m; end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[a$95$m, 1.55e+140], N[(N[(N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * N[(0.011111111111111112 * Pi), $MachinePrecision]), $MachinePrecision] * angle), $MachinePrecision], N[(N[(N[(N[(Pi * angle), $MachinePrecision] * a$95$m), $MachinePrecision] * -0.011111111111111112), $MachinePrecision] * a$95$m), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 1.55 \cdot 10^{+140}:\\
\;\;\;\;\left(\left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right) \cdot \left(0.011111111111111112 \cdot \pi\right)\right) \cdot angle\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\pi \cdot angle\right) \cdot a\_m\right) \cdot -0.011111111111111112\right) \cdot a\_m\\
\end{array}
\end{array}
if a < 1.55e140Initial program 56.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6451.7
Applied rewrites51.7%
Applied rewrites51.8%
if 1.55e140 < a Initial program 43.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6448.7
Applied rewrites48.7%
Taylor expanded in b around 0
Applied rewrites51.3%
Applied rewrites71.0%
Applied rewrites70.9%
Final simplification54.6%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= a_m 1.55e+140) (* (* (* (- b a_m) (+ b a_m)) PI) (* 0.011111111111111112 angle)) (* (* (* (* PI angle) a_m) -0.011111111111111112) a_m)))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if (a_m <= 1.55e+140) {
tmp = (((b - a_m) * (b + a_m)) * ((double) M_PI)) * (0.011111111111111112 * angle);
} else {
tmp = (((((double) M_PI) * angle) * a_m) * -0.011111111111111112) * a_m;
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double tmp;
if (a_m <= 1.55e+140) {
tmp = (((b - a_m) * (b + a_m)) * Math.PI) * (0.011111111111111112 * angle);
} else {
tmp = (((Math.PI * angle) * a_m) * -0.011111111111111112) * a_m;
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): tmp = 0 if a_m <= 1.55e+140: tmp = (((b - a_m) * (b + a_m)) * math.pi) * (0.011111111111111112 * angle) else: tmp = (((math.pi * angle) * a_m) * -0.011111111111111112) * a_m return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (a_m <= 1.55e+140) tmp = Float64(Float64(Float64(Float64(b - a_m) * Float64(b + a_m)) * pi) * Float64(0.011111111111111112 * angle)); else tmp = Float64(Float64(Float64(Float64(pi * angle) * a_m) * -0.011111111111111112) * a_m); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) tmp = 0.0; if (a_m <= 1.55e+140) tmp = (((b - a_m) * (b + a_m)) * pi) * (0.011111111111111112 * angle); else tmp = (((pi * angle) * a_m) * -0.011111111111111112) * a_m; end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[a$95$m, 1.55e+140], N[(N[(N[(N[(b - a$95$m), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision] * N[(0.011111111111111112 * angle), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(Pi * angle), $MachinePrecision] * a$95$m), $MachinePrecision] * -0.011111111111111112), $MachinePrecision] * a$95$m), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 1.55 \cdot 10^{+140}:\\
\;\;\;\;\left(\left(\left(b - a\_m\right) \cdot \left(b + a\_m\right)\right) \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot angle\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\pi \cdot angle\right) \cdot a\_m\right) \cdot -0.011111111111111112\right) \cdot a\_m\\
\end{array}
\end{array}
if a < 1.55e140Initial program 56.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6451.7
Applied rewrites51.7%
Applied rewrites51.7%
if 1.55e140 < a Initial program 43.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6448.7
Applied rewrites48.7%
Taylor expanded in b around 0
Applied rewrites51.3%
Applied rewrites71.0%
Applied rewrites70.9%
Final simplification54.6%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (* (* (* (* 0.011111111111111112 PI) angle) (- b a_m)) (+ b a_m)))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
return (((0.011111111111111112 * ((double) M_PI)) * angle) * (b - a_m)) * (b + a_m);
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
return (((0.011111111111111112 * Math.PI) * angle) * (b - a_m)) * (b + a_m);
}
a_m = math.fabs(a) def code(a_m, b, angle): return (((0.011111111111111112 * math.pi) * angle) * (b - a_m)) * (b + a_m)
a_m = abs(a) function code(a_m, b, angle) return Float64(Float64(Float64(Float64(0.011111111111111112 * pi) * angle) * Float64(b - a_m)) * Float64(b + a_m)) end
a_m = abs(a); function tmp = code(a_m, b, angle) tmp = (((0.011111111111111112 * pi) * angle) * (b - a_m)) * (b + a_m); end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := N[(N[(N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * angle), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b + a$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
\left(\left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \left(b - a\_m\right)\right) \cdot \left(b + a\_m\right)
\end{array}
Initial program 54.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6451.3
Applied rewrites51.3%
Applied rewrites61.3%
Final simplification61.3%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (* (* (* -0.011111111111111112 a_m) angle) (* PI a_m)))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
return ((-0.011111111111111112 * a_m) * angle) * (((double) M_PI) * a_m);
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
return ((-0.011111111111111112 * a_m) * angle) * (Math.PI * a_m);
}
a_m = math.fabs(a) def code(a_m, b, angle): return ((-0.011111111111111112 * a_m) * angle) * (math.pi * a_m)
a_m = abs(a) function code(a_m, b, angle) return Float64(Float64(Float64(-0.011111111111111112 * a_m) * angle) * Float64(pi * a_m)) end
a_m = abs(a); function tmp = code(a_m, b, angle) tmp = ((-0.011111111111111112 * a_m) * angle) * (pi * a_m); end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := N[(N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * angle), $MachinePrecision] * N[(Pi * a$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
\left(\left(-0.011111111111111112 \cdot a\_m\right) \cdot angle\right) \cdot \left(\pi \cdot a\_m\right)
\end{array}
Initial program 54.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6451.3
Applied rewrites51.3%
Taylor expanded in b around 0
Applied rewrites37.3%
Applied rewrites42.5%
Applied rewrites42.5%
Final simplification42.5%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (* (* (* PI angle) a_m) (* -0.011111111111111112 a_m)))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
return ((((double) M_PI) * angle) * a_m) * (-0.011111111111111112 * a_m);
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
return ((Math.PI * angle) * a_m) * (-0.011111111111111112 * a_m);
}
a_m = math.fabs(a) def code(a_m, b, angle): return ((math.pi * angle) * a_m) * (-0.011111111111111112 * a_m)
a_m = abs(a) function code(a_m, b, angle) return Float64(Float64(Float64(pi * angle) * a_m) * Float64(-0.011111111111111112 * a_m)) end
a_m = abs(a); function tmp = code(a_m, b, angle) tmp = ((pi * angle) * a_m) * (-0.011111111111111112 * a_m); end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := N[(N[(N[(Pi * angle), $MachinePrecision] * a$95$m), $MachinePrecision] * N[(-0.011111111111111112 * a$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
\left(\left(\pi \cdot angle\right) \cdot a\_m\right) \cdot \left(-0.011111111111111112 \cdot a\_m\right)
\end{array}
Initial program 54.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6451.3
Applied rewrites51.3%
Taylor expanded in b around 0
Applied rewrites37.3%
Applied rewrites42.5%
Final simplification42.5%
herbie shell --seed 2024240
(FPCore (a b angle)
:name "ab-angle->ABCF B"
:precision binary64
(* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* PI (/ angle 180.0)))) (cos (* PI (/ angle 180.0)))))