
(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}
Herbie found 10 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)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 4.6e+19)
(* (* (* (+ a_m b) PI) angle_m) (* (- b a_m) 0.011111111111111112))
(*
(* (* angle_m PI) (* (* (- b a_m) (+ a_m b)) 0.011111111111111112))
(cos (* PI (/ angle_m 180.0)))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 4.6e+19) {
tmp = (((a_m + b) * ((double) M_PI)) * angle_m) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = ((angle_m * ((double) M_PI)) * (((b - a_m) * (a_m + b)) * 0.011111111111111112)) * cos((((double) M_PI) * (angle_m / 180.0)));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 4.6e+19) {
tmp = (((a_m + b) * Math.PI) * angle_m) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = ((angle_m * Math.PI) * (((b - a_m) * (a_m + b)) * 0.011111111111111112)) * Math.cos((Math.PI * (angle_m / 180.0)));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if angle_m <= 4.6e+19: tmp = (((a_m + b) * math.pi) * angle_m) * ((b - a_m) * 0.011111111111111112) else: tmp = ((angle_m * math.pi) * (((b - a_m) * (a_m + b)) * 0.011111111111111112)) * math.cos((math.pi * (angle_m / 180.0))) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (angle_m <= 4.6e+19) tmp = Float64(Float64(Float64(Float64(a_m + b) * pi) * angle_m) * Float64(Float64(b - a_m) * 0.011111111111111112)); else tmp = Float64(Float64(Float64(angle_m * pi) * Float64(Float64(Float64(b - a_m) * Float64(a_m + b)) * 0.011111111111111112)) * cos(Float64(pi * Float64(angle_m / 180.0)))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (angle_m <= 4.6e+19) tmp = (((a_m + b) * pi) * angle_m) * ((b - a_m) * 0.011111111111111112); else tmp = ((angle_m * pi) * (((b - a_m) * (a_m + b)) * 0.011111111111111112)) * cos((pi * (angle_m / 180.0))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 4.6e+19], N[(N[(N[(N[(a$95$m + b), $MachinePrecision] * Pi), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(N[(N[(b - a$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 4.6 \cdot 10^{+19}:\\
\;\;\;\;\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(angle\_m \cdot \pi\right) \cdot \left(\left(\left(b - a\_m\right) \cdot \left(a\_m + b\right)\right) \cdot 0.011111111111111112\right)\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\
\end{array}
\end{array}
if angle < 4.6e19Initial program 75.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6477.4
Applied rewrites77.4%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6495.4
Applied rewrites95.4%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites95.6%
if 4.6e19 < angle Initial program 30.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6427.9
Applied rewrites27.9%
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6428.0
Applied rewrites28.0%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (- (pow b 2.0) (pow a_m 2.0)))))
(*
angle_s
(if (<= t_0 (- INFINITY))
(* (* (* a_m PI) angle_m) (* (- b a_m) 0.011111111111111112))
(if (<= t_0 1e+304)
(* (* 0.011111111111111112 angle_m) (* (* PI (+ a_m b)) (- b a_m)))
(* (* (* (* PI b) angle_m) (- b a_m)) 0.011111111111111112))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * (pow(b, 2.0) - pow(a_m, 2.0));
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = ((a_m * ((double) M_PI)) * angle_m) * ((b - a_m) * 0.011111111111111112);
} else if (t_0 <= 1e+304) {
tmp = (0.011111111111111112 * angle_m) * ((((double) M_PI) * (a_m + b)) * (b - a_m));
} else {
tmp = (((((double) M_PI) * b) * angle_m) * (b - a_m)) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0));
double tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = ((a_m * Math.PI) * angle_m) * ((b - a_m) * 0.011111111111111112);
} else if (t_0 <= 1e+304) {
tmp = (0.011111111111111112 * angle_m) * ((Math.PI * (a_m + b)) * (b - a_m));
} else {
tmp = (((Math.PI * b) * angle_m) * (b - a_m)) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = 2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0)) tmp = 0 if t_0 <= -math.inf: tmp = ((a_m * math.pi) * angle_m) * ((b - a_m) * 0.011111111111111112) elif t_0 <= 1e+304: tmp = (0.011111111111111112 * angle_m) * ((math.pi * (a_m + b)) * (b - a_m)) else: tmp = (((math.pi * b) * angle_m) * (b - a_m)) * 0.011111111111111112 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(Float64(a_m * pi) * angle_m) * Float64(Float64(b - a_m) * 0.011111111111111112)); elseif (t_0 <= 1e+304) tmp = Float64(Float64(0.011111111111111112 * angle_m) * Float64(Float64(pi * Float64(a_m + b)) * Float64(b - a_m))); else tmp = Float64(Float64(Float64(Float64(pi * b) * angle_m) * Float64(b - a_m)) * 0.011111111111111112); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = 2.0 * ((b ^ 2.0) - (a_m ^ 2.0)); tmp = 0.0; if (t_0 <= -Inf) tmp = ((a_m * pi) * angle_m) * ((b - a_m) * 0.011111111111111112); elseif (t_0 <= 1e+304) tmp = (0.011111111111111112 * angle_m) * ((pi * (a_m + b)) * (b - a_m)); else tmp = (((pi * b) * angle_m) * (b - a_m)) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(a$95$m * Pi), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+304], N[(N[(0.011111111111111112 * angle$95$m), $MachinePrecision] * N[(N[(Pi * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(Pi * b), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\left(\left(a\_m \cdot \pi\right) \cdot angle\_m\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{elif}\;t\_0 \leq 10^{+304}:\\
\;\;\;\;\left(0.011111111111111112 \cdot angle\_m\right) \cdot \left(\left(\pi \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\pi \cdot b\right) \cdot angle\_m\right) \cdot \left(b - a\_m\right)\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -inf.0Initial program 52.6%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6452.0
Applied rewrites52.0%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6474.7
Applied rewrites74.7%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites75.0%
Taylor expanded in a around inf
Applied rewrites75.0%
if -inf.0 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < 9.9999999999999994e303Initial program 61.3%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6456.4
Applied rewrites56.4%
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
difference-of-squares-revN/A
pow2N/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
Applied rewrites56.4%
if 9.9999999999999994e303 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 39.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6454.4
Applied rewrites54.4%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6475.5
Applied rewrites75.5%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6469.5
Applied rewrites69.5%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* 2.0 (- (pow b 2.0) (pow a_m 2.0)))))
(*
angle_s
(if (<= t_0 -5e-166)
(* (* -0.011111111111111112 a_m) (* (* angle_m PI) a_m))
(if (<= t_0 1e+299)
(* (* (* PI angle_m) (* b b)) 0.011111111111111112)
(* (* (* (* PI b) angle_m) (- b a_m)) 0.011111111111111112))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * (pow(b, 2.0) - pow(a_m, 2.0));
double tmp;
if (t_0 <= -5e-166) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * ((double) M_PI)) * a_m);
} else if (t_0 <= 1e+299) {
tmp = ((((double) M_PI) * angle_m) * (b * b)) * 0.011111111111111112;
} else {
tmp = (((((double) M_PI) * b) * angle_m) * (b - a_m)) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = 2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0));
double tmp;
if (t_0 <= -5e-166) {
tmp = (-0.011111111111111112 * a_m) * ((angle_m * Math.PI) * a_m);
} else if (t_0 <= 1e+299) {
tmp = ((Math.PI * angle_m) * (b * b)) * 0.011111111111111112;
} else {
tmp = (((Math.PI * b) * angle_m) * (b - a_m)) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = 2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0)) tmp = 0 if t_0 <= -5e-166: tmp = (-0.011111111111111112 * a_m) * ((angle_m * math.pi) * a_m) elif t_0 <= 1e+299: tmp = ((math.pi * angle_m) * (b * b)) * 0.011111111111111112 else: tmp = (((math.pi * b) * angle_m) * (b - a_m)) * 0.011111111111111112 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) tmp = 0.0 if (t_0 <= -5e-166) tmp = Float64(Float64(-0.011111111111111112 * a_m) * Float64(Float64(angle_m * pi) * a_m)); elseif (t_0 <= 1e+299) tmp = Float64(Float64(Float64(pi * angle_m) * Float64(b * b)) * 0.011111111111111112); else tmp = Float64(Float64(Float64(Float64(pi * b) * angle_m) * Float64(b - a_m)) * 0.011111111111111112); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = 2.0 * ((b ^ 2.0) - (a_m ^ 2.0)); tmp = 0.0; if (t_0 <= -5e-166) tmp = (-0.011111111111111112 * a_m) * ((angle_m * pi) * a_m); elseif (t_0 <= 1e+299) tmp = ((pi * angle_m) * (b * b)) * 0.011111111111111112; else tmp = (((pi * b) * angle_m) * (b - a_m)) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$0, -5e-166], N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+299], N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(N[(N[(N[(Pi * b), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := 2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{-166}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\\
\mathbf{elif}\;t\_0 \leq 10^{+299}:\\
\;\;\;\;\left(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\pi \cdot b\right) \cdot angle\_m\right) \cdot \left(b - a\_m\right)\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -5e-166Initial program 54.8%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-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 a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
lift-PI.f6452.0
Applied rewrites52.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6452.2
Applied rewrites52.2%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6462.6
Applied rewrites62.6%
if -5e-166 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < 1.0000000000000001e299Initial program 64.4%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6459.3
Applied rewrites59.3%
Taylor expanded in a around 0
difference-of-squares-revN/A
pow2N/A
metadata-evalN/A
pow-flipN/A
pow2N/A
pow2N/A
lift-*.f6458.3
Applied rewrites58.3%
if 1.0000000000000001e299 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 39.1%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6454.2
Applied rewrites54.2%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6475.0
Applied rewrites75.0%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6469.2
Applied rewrites69.2%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* (* -0.011111111111111112 a_m) (* (* angle_m PI) a_m)))
(t_1 (* 2.0 (- (pow b 2.0) (pow a_m 2.0)))))
(*
angle_s
(if (<= t_1 -5e-166)
t_0
(if (<= t_1 INFINITY)
(* (* (* PI angle_m) (* b b)) 0.011111111111111112)
t_0)))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (-0.011111111111111112 * a_m) * ((angle_m * ((double) M_PI)) * a_m);
double t_1 = 2.0 * (pow(b, 2.0) - pow(a_m, 2.0));
double tmp;
if (t_1 <= -5e-166) {
tmp = t_0;
} else if (t_1 <= ((double) INFINITY)) {
tmp = ((((double) M_PI) * angle_m) * (b * b)) * 0.011111111111111112;
} else {
tmp = t_0;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (-0.011111111111111112 * a_m) * ((angle_m * Math.PI) * a_m);
double t_1 = 2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0));
double tmp;
if (t_1 <= -5e-166) {
tmp = t_0;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = ((Math.PI * angle_m) * (b * b)) * 0.011111111111111112;
} else {
tmp = t_0;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = (-0.011111111111111112 * a_m) * ((angle_m * math.pi) * a_m) t_1 = 2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0)) tmp = 0 if t_1 <= -5e-166: tmp = t_0 elif t_1 <= math.inf: tmp = ((math.pi * angle_m) * (b * b)) * 0.011111111111111112 else: tmp = t_0 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(Float64(-0.011111111111111112 * a_m) * Float64(Float64(angle_m * pi) * a_m)) t_1 = Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) tmp = 0.0 if (t_1 <= -5e-166) tmp = t_0; elseif (t_1 <= Inf) tmp = Float64(Float64(Float64(pi * angle_m) * Float64(b * b)) * 0.011111111111111112); else tmp = t_0; end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = (-0.011111111111111112 * a_m) * ((angle_m * pi) * a_m); t_1 = 2.0 * ((b ^ 2.0) - (a_m ^ 2.0)); tmp = 0.0; if (t_1 <= -5e-166) tmp = t_0; elseif (t_1 <= Inf) tmp = ((pi * angle_m) * (b * b)) * 0.011111111111111112; else tmp = t_0; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, -5e-166], t$95$0, If[LessEqual[t$95$1, Infinity], N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], t$95$0]]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\\
t_1 := 2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-166}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\left(\left(\pi \cdot angle\_m\right) \cdot \left(b \cdot b\right)\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -5e-166 or +inf.0 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 46.8%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6452.9
Applied rewrites52.9%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
lift-PI.f6450.3
Applied rewrites50.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.5
Applied rewrites50.5%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6460.6
Applied rewrites60.6%
if -5e-166 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < +inf.0Initial program 60.6%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6457.0
Applied rewrites57.0%
Taylor expanded in a around 0
difference-of-squares-revN/A
pow2N/A
metadata-evalN/A
pow-flipN/A
pow2N/A
pow2N/A
lift-*.f6456.4
Applied rewrites56.4%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* (* -0.011111111111111112 a_m) (* (* angle_m PI) a_m)))
(t_1 (* 2.0 (- (pow b 2.0) (pow a_m 2.0)))))
(*
angle_s
(if (<= t_1 -5e-166)
t_0
(if (<= t_1 INFINITY)
(* (* (* PI (* b b)) angle_m) 0.011111111111111112)
t_0)))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (-0.011111111111111112 * a_m) * ((angle_m * ((double) M_PI)) * a_m);
double t_1 = 2.0 * (pow(b, 2.0) - pow(a_m, 2.0));
double tmp;
if (t_1 <= -5e-166) {
tmp = t_0;
} else if (t_1 <= ((double) INFINITY)) {
tmp = ((((double) M_PI) * (b * b)) * angle_m) * 0.011111111111111112;
} else {
tmp = t_0;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (-0.011111111111111112 * a_m) * ((angle_m * Math.PI) * a_m);
double t_1 = 2.0 * (Math.pow(b, 2.0) - Math.pow(a_m, 2.0));
double tmp;
if (t_1 <= -5e-166) {
tmp = t_0;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = ((Math.PI * (b * b)) * angle_m) * 0.011111111111111112;
} else {
tmp = t_0;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = (-0.011111111111111112 * a_m) * ((angle_m * math.pi) * a_m) t_1 = 2.0 * (math.pow(b, 2.0) - math.pow(a_m, 2.0)) tmp = 0 if t_1 <= -5e-166: tmp = t_0 elif t_1 <= math.inf: tmp = ((math.pi * (b * b)) * angle_m) * 0.011111111111111112 else: tmp = t_0 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(Float64(-0.011111111111111112 * a_m) * Float64(Float64(angle_m * pi) * a_m)) t_1 = Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) tmp = 0.0 if (t_1 <= -5e-166) tmp = t_0; elseif (t_1 <= Inf) tmp = Float64(Float64(Float64(pi * Float64(b * b)) * angle_m) * 0.011111111111111112); else tmp = t_0; end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = (-0.011111111111111112 * a_m) * ((angle_m * pi) * a_m); t_1 = 2.0 * ((b ^ 2.0) - (a_m ^ 2.0)); tmp = 0.0; if (t_1 <= -5e-166) tmp = t_0; elseif (t_1 <= Inf) tmp = ((pi * (b * b)) * angle_m) * 0.011111111111111112; else tmp = t_0; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[t$95$1, -5e-166], t$95$0, If[LessEqual[t$95$1, Infinity], N[(N[(N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision] * angle$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], t$95$0]]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\\
t_1 := 2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-166}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\left(\left(\pi \cdot \left(b \cdot b\right)\right) \cdot angle\_m\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -5e-166 or +inf.0 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 46.8%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6452.9
Applied rewrites52.9%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
lift-PI.f6450.3
Applied rewrites50.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6450.5
Applied rewrites50.5%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6460.6
Applied rewrites60.6%
if -5e-166 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < +inf.0Initial program 60.6%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6457.0
Applied rewrites57.0%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
pow2N/A
lift-*.f6456.3
Applied rewrites56.3%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 4.6e+19)
(* (* (* (+ a_m b) PI) angle_m) (* (- b a_m) 0.011111111111111112))
(*
(* (* (* PI angle_m) (* (+ b a_m) (- b a_m))) 0.011111111111111112)
(cos (* PI (* 0.005555555555555556 angle_m)))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 4.6e+19) {
tmp = (((a_m + b) * ((double) M_PI)) * angle_m) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = (((((double) M_PI) * angle_m) * ((b + a_m) * (b - a_m))) * 0.011111111111111112) * cos((((double) M_PI) * (0.005555555555555556 * angle_m)));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 4.6e+19) {
tmp = (((a_m + b) * Math.PI) * angle_m) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = (((Math.PI * angle_m) * ((b + a_m) * (b - a_m))) * 0.011111111111111112) * Math.cos((Math.PI * (0.005555555555555556 * angle_m)));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if angle_m <= 4.6e+19: tmp = (((a_m + b) * math.pi) * angle_m) * ((b - a_m) * 0.011111111111111112) else: tmp = (((math.pi * angle_m) * ((b + a_m) * (b - a_m))) * 0.011111111111111112) * math.cos((math.pi * (0.005555555555555556 * angle_m))) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (angle_m <= 4.6e+19) tmp = Float64(Float64(Float64(Float64(a_m + b) * pi) * angle_m) * Float64(Float64(b - a_m) * 0.011111111111111112)); else tmp = Float64(Float64(Float64(Float64(pi * angle_m) * Float64(Float64(b + a_m) * Float64(b - a_m))) * 0.011111111111111112) * cos(Float64(pi * Float64(0.005555555555555556 * angle_m)))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (angle_m <= 4.6e+19) tmp = (((a_m + b) * pi) * angle_m) * ((b - a_m) * 0.011111111111111112); else tmp = (((pi * angle_m) * ((b + a_m) * (b - a_m))) * 0.011111111111111112) * cos((pi * (0.005555555555555556 * angle_m))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 4.6e+19], N[(N[(N[(N[(a$95$m + b), $MachinePrecision] * Pi), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(Pi * angle$95$m), $MachinePrecision] * N[(N[(b + a$95$m), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision] * N[Cos[N[(Pi * N[(0.005555555555555556 * angle$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 4.6 \cdot 10^{+19}:\\
\;\;\;\;\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\pi \cdot angle\_m\right) \cdot \left(\left(b + a\_m\right) \cdot \left(b - a\_m\right)\right)\right) \cdot 0.011111111111111112\right) \cdot \cos \left(\pi \cdot \left(0.005555555555555556 \cdot angle\_m\right)\right)\\
\end{array}
\end{array}
if angle < 4.6e19Initial program 75.0%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6477.4
Applied rewrites77.4%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6495.4
Applied rewrites95.4%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites95.6%
if 4.6e19 < angle Initial program 30.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6427.9
Applied rewrites27.9%
Taylor expanded in angle around 0
lower-*.f6428.4
Applied rewrites28.4%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 1.4e+20)
(* (* (* (+ a_m b) PI) angle_m) (* (- b a_m) 0.011111111111111112))
(*
(* (* -0.011111111111111112 (* a_m a_m)) (* angle_m PI))
(cos (* PI (/ angle_m 180.0)))))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 1.4e+20) {
tmp = (((a_m + b) * ((double) M_PI)) * angle_m) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = ((-0.011111111111111112 * (a_m * a_m)) * (angle_m * ((double) M_PI))) * cos((((double) M_PI) * (angle_m / 180.0)));
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 1.4e+20) {
tmp = (((a_m + b) * Math.PI) * angle_m) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = ((-0.011111111111111112 * (a_m * a_m)) * (angle_m * Math.PI)) * Math.cos((Math.PI * (angle_m / 180.0)));
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if angle_m <= 1.4e+20: tmp = (((a_m + b) * math.pi) * angle_m) * ((b - a_m) * 0.011111111111111112) else: tmp = ((-0.011111111111111112 * (a_m * a_m)) * (angle_m * math.pi)) * math.cos((math.pi * (angle_m / 180.0))) return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (angle_m <= 1.4e+20) tmp = Float64(Float64(Float64(Float64(a_m + b) * pi) * angle_m) * Float64(Float64(b - a_m) * 0.011111111111111112)); else tmp = Float64(Float64(Float64(-0.011111111111111112 * Float64(a_m * a_m)) * Float64(angle_m * pi)) * cos(Float64(pi * Float64(angle_m / 180.0)))); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (angle_m <= 1.4e+20) tmp = (((a_m + b) * pi) * angle_m) * ((b - a_m) * 0.011111111111111112); else tmp = ((-0.011111111111111112 * (a_m * a_m)) * (angle_m * pi)) * cos((pi * (angle_m / 180.0))); end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 1.4e+20], N[(N[(N[(N[(a$95$m + b), $MachinePrecision] * Pi), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.011111111111111112 * N[(a$95$m * a$95$m), $MachinePrecision]), $MachinePrecision] * N[(angle$95$m * Pi), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle$95$m / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 1.4 \cdot 10^{+20}:\\
\;\;\;\;\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-0.011111111111111112 \cdot \left(a\_m \cdot a\_m\right)\right) \cdot \left(angle\_m \cdot \pi\right)\right) \cdot \cos \left(\pi \cdot \frac{angle\_m}{180}\right)\\
\end{array}
\end{array}
if angle < 1.4e20Initial program 74.8%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6477.3
Applied rewrites77.3%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6495.3
Applied rewrites95.3%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites95.5%
if 1.4e20 < angle Initial program 30.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6427.9
Applied rewrites27.9%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
lift-PI.f6422.5
Applied rewrites22.5%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(*
angle_s
(if (<= angle_m 2.5e+61)
(* (* (* (+ a_m b) PI) angle_m) (* (- b a_m) 0.011111111111111112))
(* (* (* (* angle_m PI) (+ a_m b)) b) 0.011111111111111112))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 2.5e+61) {
tmp = (((a_m + b) * ((double) M_PI)) * angle_m) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = (((angle_m * ((double) M_PI)) * (a_m + b)) * b) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double tmp;
if (angle_m <= 2.5e+61) {
tmp = (((a_m + b) * Math.PI) * angle_m) * ((b - a_m) * 0.011111111111111112);
} else {
tmp = (((angle_m * Math.PI) * (a_m + b)) * b) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): tmp = 0 if angle_m <= 2.5e+61: tmp = (((a_m + b) * math.pi) * angle_m) * ((b - a_m) * 0.011111111111111112) else: tmp = (((angle_m * math.pi) * (a_m + b)) * b) * 0.011111111111111112 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) tmp = 0.0 if (angle_m <= 2.5e+61) tmp = Float64(Float64(Float64(Float64(a_m + b) * pi) * angle_m) * Float64(Float64(b - a_m) * 0.011111111111111112)); else tmp = Float64(Float64(Float64(Float64(angle_m * pi) * Float64(a_m + b)) * b) * 0.011111111111111112); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) tmp = 0.0; if (angle_m <= 2.5e+61) tmp = (((a_m + b) * pi) * angle_m) * ((b - a_m) * 0.011111111111111112); else tmp = (((angle_m * pi) * (a_m + b)) * b) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * If[LessEqual[angle$95$m, 2.5e+61], N[(N[(N[(N[(a$95$m + b), $MachinePrecision] * Pi), $MachinePrecision] * angle$95$m), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 2.5 \cdot 10^{+61}:\\
\;\;\;\;\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot angle\_m\right) \cdot \left(\left(b - a\_m\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(angle\_m \cdot \pi\right) \cdot \left(a\_m + b\right)\right) \cdot b\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
if angle < 2.50000000000000009e61Initial program 69.9%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6471.9
Applied rewrites71.9%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6487.7
Applied rewrites87.7%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites87.9%
if 2.50000000000000009e61 < angle Initial program 30.6%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6429.8
Applied rewrites29.8%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6425.6
Applied rewrites25.6%
Taylor expanded in a around 0
Applied rewrites25.4%
a_m = (fabs.f64 a)
angle\_m = (fabs.f64 angle)
angle\_s = (copysign.f64 #s(literal 1 binary64) angle)
(FPCore (angle_s a_m b angle_m)
:precision binary64
(let* ((t_0 (* (* angle_m PI) (+ a_m b))))
(*
angle_s
(if (<= angle_m 2.5e+61)
(* (* t_0 (- b a_m)) 0.011111111111111112)
(* (* t_0 b) 0.011111111111111112)))))a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (angle_m * ((double) M_PI)) * (a_m + b);
double tmp;
if (angle_m <= 2.5e+61) {
tmp = (t_0 * (b - a_m)) * 0.011111111111111112;
} else {
tmp = (t_0 * b) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
double t_0 = (angle_m * Math.PI) * (a_m + b);
double tmp;
if (angle_m <= 2.5e+61) {
tmp = (t_0 * (b - a_m)) * 0.011111111111111112;
} else {
tmp = (t_0 * b) * 0.011111111111111112;
}
return angle_s * tmp;
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): t_0 = (angle_m * math.pi) * (a_m + b) tmp = 0 if angle_m <= 2.5e+61: tmp = (t_0 * (b - a_m)) * 0.011111111111111112 else: tmp = (t_0 * b) * 0.011111111111111112 return angle_s * tmp
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) t_0 = Float64(Float64(angle_m * pi) * Float64(a_m + b)) tmp = 0.0 if (angle_m <= 2.5e+61) tmp = Float64(Float64(t_0 * Float64(b - a_m)) * 0.011111111111111112); else tmp = Float64(Float64(t_0 * b) * 0.011111111111111112); end return Float64(angle_s * tmp) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp_2 = code(angle_s, a_m, b, angle_m) t_0 = (angle_m * pi) * (a_m + b); tmp = 0.0; if (angle_m <= 2.5e+61) tmp = (t_0 * (b - a_m)) * 0.011111111111111112; else tmp = (t_0 * b) * 0.011111111111111112; end tmp_2 = angle_s * tmp; end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := Block[{t$95$0 = N[(N[(angle$95$m * Pi), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision]}, N[(angle$95$s * If[LessEqual[angle$95$m, 2.5e+61], N[(N[(t$95$0 * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], N[(N[(t$95$0 * b), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
\begin{array}{l}
t_0 := \left(angle\_m \cdot \pi\right) \cdot \left(a\_m + b\right)\\
angle\_s \cdot \begin{array}{l}
\mathbf{if}\;angle\_m \leq 2.5 \cdot 10^{+61}:\\
\;\;\;\;\left(t\_0 \cdot \left(b - a\_m\right)\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;\left(t\_0 \cdot b\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
\end{array}
if angle < 2.50000000000000009e61Initial program 69.9%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6471.9
Applied rewrites71.9%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6487.7
Applied rewrites87.7%
if 2.50000000000000009e61 < angle Initial program 30.6%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6429.8
Applied rewrites29.8%
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift--.f6425.6
Applied rewrites25.6%
Taylor expanded in a around 0
Applied rewrites25.4%
a_m = (fabs.f64 a) angle\_m = (fabs.f64 angle) angle\_s = (copysign.f64 #s(literal 1 binary64) angle) (FPCore (angle_s a_m b angle_m) :precision binary64 (* angle_s (* (* -0.011111111111111112 a_m) (* (* angle_m PI) a_m))))
a_m = fabs(a);
angle\_m = fabs(angle);
angle\_s = copysign(1.0, angle);
double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * ((-0.011111111111111112 * a_m) * ((angle_m * ((double) M_PI)) * a_m));
}
a_m = Math.abs(a);
angle\_m = Math.abs(angle);
angle\_s = Math.copySign(1.0, angle);
public static double code(double angle_s, double a_m, double b, double angle_m) {
return angle_s * ((-0.011111111111111112 * a_m) * ((angle_m * Math.PI) * a_m));
}
a_m = math.fabs(a) angle\_m = math.fabs(angle) angle\_s = math.copysign(1.0, angle) def code(angle_s, a_m, b, angle_m): return angle_s * ((-0.011111111111111112 * a_m) * ((angle_m * math.pi) * a_m))
a_m = abs(a) angle\_m = abs(angle) angle\_s = copysign(1.0, angle) function code(angle_s, a_m, b, angle_m) return Float64(angle_s * Float64(Float64(-0.011111111111111112 * a_m) * Float64(Float64(angle_m * pi) * a_m))) end
a_m = abs(a); angle\_m = abs(angle); angle\_s = sign(angle) * abs(1.0); function tmp = code(angle_s, a_m, b, angle_m) tmp = angle_s * ((-0.011111111111111112 * a_m) * ((angle_m * pi) * a_m)); end
a_m = N[Abs[a], $MachinePrecision]
angle\_m = N[Abs[angle], $MachinePrecision]
angle\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[angle$95$s_, a$95$m_, b_, angle$95$m_] := N[(angle$95$s * N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(angle$95$m * Pi), $MachinePrecision] * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
angle\_m = \left|angle\right|
\\
angle\_s = \mathsf{copysign}\left(1, angle\right)
\\
angle\_s \cdot \left(\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(angle\_m \cdot \pi\right) \cdot a\_m\right)\right)
\end{array}
Initial program 54.1%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6455.1
Applied rewrites55.1%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f64N/A
lift-PI.f6435.7
Applied rewrites35.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6435.8
Applied rewrites35.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f6439.2
Applied rewrites39.2%
herbie shell --seed 2025088
(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)))))