
(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 20 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}
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (sin (* PI (* angle 0.005555555555555556))))
(t_1 (* (+ b_m a) (* (- b_m a) (* 2.0 t_0))))
(t_2 (/ 1.0 (- b_m a))))
(if (<= b_m 1e+70)
(* t_1 (cos (* angle (* PI 0.005555555555555556))))
(if (<= b_m 5e+170)
(*
t_1
(cos (* (* (sqrt (* PI (sqrt PI))) (sqrt (sqrt PI))) (/ angle 180.0))))
(* (* (+ b_m a) (* t_2 (/ (* t_0 (* (- b_m a) 2.0)) t_2))) 1.0)))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = sin((((double) M_PI) * (angle * 0.005555555555555556)));
double t_1 = (b_m + a) * ((b_m - a) * (2.0 * t_0));
double t_2 = 1.0 / (b_m - a);
double tmp;
if (b_m <= 1e+70) {
tmp = t_1 * cos((angle * (((double) M_PI) * 0.005555555555555556)));
} else if (b_m <= 5e+170) {
tmp = t_1 * cos(((sqrt((((double) M_PI) * sqrt(((double) M_PI)))) * sqrt(sqrt(((double) M_PI)))) * (angle / 180.0)));
} else {
tmp = ((b_m + a) * (t_2 * ((t_0 * ((b_m - a) * 2.0)) / t_2))) * 1.0;
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = Math.sin((Math.PI * (angle * 0.005555555555555556)));
double t_1 = (b_m + a) * ((b_m - a) * (2.0 * t_0));
double t_2 = 1.0 / (b_m - a);
double tmp;
if (b_m <= 1e+70) {
tmp = t_1 * Math.cos((angle * (Math.PI * 0.005555555555555556)));
} else if (b_m <= 5e+170) {
tmp = t_1 * Math.cos(((Math.sqrt((Math.PI * Math.sqrt(Math.PI))) * Math.sqrt(Math.sqrt(Math.PI))) * (angle / 180.0)));
} else {
tmp = ((b_m + a) * (t_2 * ((t_0 * ((b_m - a) * 2.0)) / t_2))) * 1.0;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = math.sin((math.pi * (angle * 0.005555555555555556))) t_1 = (b_m + a) * ((b_m - a) * (2.0 * t_0)) t_2 = 1.0 / (b_m - a) tmp = 0 if b_m <= 1e+70: tmp = t_1 * math.cos((angle * (math.pi * 0.005555555555555556))) elif b_m <= 5e+170: tmp = t_1 * math.cos(((math.sqrt((math.pi * math.sqrt(math.pi))) * math.sqrt(math.sqrt(math.pi))) * (angle / 180.0))) else: tmp = ((b_m + a) * (t_2 * ((t_0 * ((b_m - a) * 2.0)) / t_2))) * 1.0 return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = sin(Float64(pi * Float64(angle * 0.005555555555555556))) t_1 = Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * Float64(2.0 * t_0))) t_2 = Float64(1.0 / Float64(b_m - a)) tmp = 0.0 if (b_m <= 1e+70) tmp = Float64(t_1 * cos(Float64(angle * Float64(pi * 0.005555555555555556)))); elseif (b_m <= 5e+170) tmp = Float64(t_1 * cos(Float64(Float64(sqrt(Float64(pi * sqrt(pi))) * sqrt(sqrt(pi))) * Float64(angle / 180.0)))); else tmp = Float64(Float64(Float64(b_m + a) * Float64(t_2 * Float64(Float64(t_0 * Float64(Float64(b_m - a) * 2.0)) / t_2))) * 1.0); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) t_0 = sin((pi * (angle * 0.005555555555555556))); t_1 = (b_m + a) * ((b_m - a) * (2.0 * t_0)); t_2 = 1.0 / (b_m - a); tmp = 0.0; if (b_m <= 1e+70) tmp = t_1 * cos((angle * (pi * 0.005555555555555556))); elseif (b_m <= 5e+170) tmp = t_1 * cos(((sqrt((pi * sqrt(pi))) * sqrt(sqrt(pi))) * (angle / 180.0))); else tmp = ((b_m + a) * (t_2 * ((t_0 * ((b_m - a) * 2.0)) / t_2))) * 1.0; end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b$95$m, 1e+70], N[(t$95$1 * N[Cos[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[b$95$m, 5e+170], N[(t$95$1 * N[Cos[N[(N[(N[Sqrt[N[(Pi * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Sqrt[Pi], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(t$95$2 * N[(N[(t$95$0 * N[(N[(b$95$m - a), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\\
t_1 := \left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \left(2 \cdot t\_0\right)\right)\\
t_2 := \frac{1}{b\_m - a}\\
\mathbf{if}\;b\_m \leq 10^{+70}:\\
\;\;\;\;t\_1 \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\
\mathbf{elif}\;b\_m \leq 5 \cdot 10^{+170}:\\
\;\;\;\;t\_1 \cdot \cos \left(\left(\sqrt{\pi \cdot \sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}\right) \cdot \frac{angle}{180}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b\_m + a\right) \cdot \left(t\_2 \cdot \frac{t\_0 \cdot \left(\left(b\_m - a\right) \cdot 2\right)}{t\_2}\right)\right) \cdot 1\\
\end{array}
\end{array}
if b < 1.00000000000000007e70Initial program 55.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
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6465.5
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval65.1
Applied rewrites65.1%
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
div-invN/A
lower-*.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f6467.7
Applied rewrites67.7%
if 1.00000000000000007e70 < b < 4.99999999999999977e170Initial program 50.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
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6465.7
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval68.7
Applied rewrites68.7%
rem-square-sqrtN/A
sqrt-unprodN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
associate-*r*N/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6477.9
Applied rewrites77.9%
if 4.99999999999999977e170 < b Initial program 44.1%
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
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6479.9
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval77.0
Applied rewrites77.0%
Taylor expanded in angle around 0
Applied rewrites88.4%
Applied rewrites88.5%
Final simplification71.5%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* PI (/ angle 180.0))))
(if (<=
(* (* (* 2.0 (- (pow b_m 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))
5e+274)
(* (+ b_m a) (* (- b_m a) (sin (* 0.011111111111111112 (* PI angle)))))
(*
1.0
(*
(+ b_m a)
(*
(- b_m a)
(*
2.0
(*
angle
(fma
-2.8577960676726107e-8
(* (* angle angle) (* PI (* PI PI)))
(* PI 0.005555555555555556))))))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
double tmp;
if ((((2.0 * (pow(b_m, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0)) <= 5e+274) {
tmp = (b_m + a) * ((b_m - a) * sin((0.011111111111111112 * (((double) M_PI) * angle))));
} else {
tmp = 1.0 * ((b_m + a) * ((b_m - a) * (2.0 * (angle * fma(-2.8577960676726107e-8, ((angle * angle) * (((double) M_PI) * (((double) M_PI) * ((double) M_PI)))), (((double) M_PI) * 0.005555555555555556))))));
}
return tmp;
}
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(pi * Float64(angle / 180.0)) tmp = 0.0 if (Float64(Float64(Float64(2.0 * Float64((b_m ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) <= 5e+274) tmp = Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * sin(Float64(0.011111111111111112 * Float64(pi * angle))))); else tmp = Float64(1.0 * Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * Float64(2.0 * Float64(angle * fma(-2.8577960676726107e-8, Float64(Float64(angle * angle) * Float64(pi * Float64(pi * pi))), Float64(pi * 0.005555555555555556))))))); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(2.0 * N[(N[Power[b$95$m, 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], 5e+274], N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[(2.0 * N[(angle * N[(-2.8577960676726107e-8 * N[(N[(angle * angle), $MachinePrecision] * N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\mathbf{if}\;\left(\left(2 \cdot \left({b\_m}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0 \leq 5 \cdot 10^{+274}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \left(\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \left(2 \cdot \left(angle \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8}, \left(angle \cdot angle\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), \pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) < 4.9999999999999998e274Initial program 60.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/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
Applied rewrites63.6%
if 4.9999999999999998e274 < (*.f64 (*.f64 (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) (sin.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) (cos.f64 (*.f64 (PI.f64) (/.f64 angle #s(literal 180 binary64))))) Initial program 37.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
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6474.8
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval73.4
Applied rewrites73.4%
Taylor expanded in angle around 0
Applied rewrites82.7%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-PI.f6470.9
Applied rewrites70.9%
Final simplification65.8%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* PI (* angle 0.005555555555555556))))
(if (<= (- (pow b_m 2.0) (pow a 2.0)) -1e-129)
(* a (* a (* (fma b_m (/ b_m (* a a)) -1.0) (sin (* 2.0 t_0)))))
(* (* (+ b_m a) (* (- b_m a) (* 2.0 (sin t_0)))) 1.0))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
double tmp;
if ((pow(b_m, 2.0) - pow(a, 2.0)) <= -1e-129) {
tmp = a * (a * (fma(b_m, (b_m / (a * a)), -1.0) * sin((2.0 * t_0))));
} else {
tmp = ((b_m + a) * ((b_m - a) * (2.0 * sin(t_0)))) * 1.0;
}
return tmp;
}
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) tmp = 0.0 if (Float64((b_m ^ 2.0) - (a ^ 2.0)) <= -1e-129) tmp = Float64(a * Float64(a * Float64(fma(b_m, Float64(b_m / Float64(a * a)), -1.0) * sin(Float64(2.0 * t_0))))); else tmp = Float64(Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * Float64(2.0 * sin(t_0)))) * 1.0); end return tmp end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -1e-129], N[(a * N[(a * N[(N[(b$95$m * N[(b$95$m / N[(a * a), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] * N[Sin[N[(2.0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[(2.0 * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
\mathbf{if}\;{b\_m}^{2} - {a}^{2} \leq -1 \cdot 10^{-129}:\\
\;\;\;\;a \cdot \left(a \cdot \left(\mathsf{fma}\left(b\_m, \frac{b\_m}{a \cdot a}, -1\right) \cdot \sin \left(2 \cdot t\_0\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \left(2 \cdot \sin t\_0\right)\right)\right) \cdot 1\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -9.9999999999999993e-130Initial program 61.3%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
distribute-lft-neg-inN/A
unpow1N/A
sqr-powN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6439.1
lift-pow.f64N/A
unpow2N/A
lower-*.f6439.1
Applied rewrites39.1%
Taylor expanded in a around -inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
Applied rewrites56.1%
Applied rewrites71.0%
if -9.9999999999999993e-130 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 48.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
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6464.9
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval64.6
Applied rewrites64.6%
Taylor expanded in angle around 0
Applied rewrites71.8%
Final simplification71.5%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (sin (* PI (* angle 0.005555555555555556))))
(t_1 (/ 1.0 (- b_m a))))
(if (<= (pow b_m 2.0) 1e+197)
(*
(* (+ b_m a) (* (- b_m a) (* 2.0 t_0)))
(cos (* angle (* PI 0.005555555555555556))))
(* (* (+ b_m a) (* t_1 (/ (* t_0 (* (- b_m a) 2.0)) t_1))) 1.0))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = sin((((double) M_PI) * (angle * 0.005555555555555556)));
double t_1 = 1.0 / (b_m - a);
double tmp;
if (pow(b_m, 2.0) <= 1e+197) {
tmp = ((b_m + a) * ((b_m - a) * (2.0 * t_0))) * cos((angle * (((double) M_PI) * 0.005555555555555556)));
} else {
tmp = ((b_m + a) * (t_1 * ((t_0 * ((b_m - a) * 2.0)) / t_1))) * 1.0;
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = Math.sin((Math.PI * (angle * 0.005555555555555556)));
double t_1 = 1.0 / (b_m - a);
double tmp;
if (Math.pow(b_m, 2.0) <= 1e+197) {
tmp = ((b_m + a) * ((b_m - a) * (2.0 * t_0))) * Math.cos((angle * (Math.PI * 0.005555555555555556)));
} else {
tmp = ((b_m + a) * (t_1 * ((t_0 * ((b_m - a) * 2.0)) / t_1))) * 1.0;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = math.sin((math.pi * (angle * 0.005555555555555556))) t_1 = 1.0 / (b_m - a) tmp = 0 if math.pow(b_m, 2.0) <= 1e+197: tmp = ((b_m + a) * ((b_m - a) * (2.0 * t_0))) * math.cos((angle * (math.pi * 0.005555555555555556))) else: tmp = ((b_m + a) * (t_1 * ((t_0 * ((b_m - a) * 2.0)) / t_1))) * 1.0 return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = sin(Float64(pi * Float64(angle * 0.005555555555555556))) t_1 = Float64(1.0 / Float64(b_m - a)) tmp = 0.0 if ((b_m ^ 2.0) <= 1e+197) tmp = Float64(Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * Float64(2.0 * t_0))) * cos(Float64(angle * Float64(pi * 0.005555555555555556)))); else tmp = Float64(Float64(Float64(b_m + a) * Float64(t_1 * Float64(Float64(t_0 * Float64(Float64(b_m - a) * 2.0)) / t_1))) * 1.0); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) t_0 = sin((pi * (angle * 0.005555555555555556))); t_1 = 1.0 / (b_m - a); tmp = 0.0; if ((b_m ^ 2.0) <= 1e+197) tmp = ((b_m + a) * ((b_m - a) * (2.0 * t_0))) * cos((angle * (pi * 0.005555555555555556))); else tmp = ((b_m + a) * (t_1 * ((t_0 * ((b_m - a) * 2.0)) / t_1))) * 1.0; end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[b$95$m, 2.0], $MachinePrecision], 1e+197], N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(t$95$1 * N[(N[(t$95$0 * N[(N[(b$95$m - a), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\\
t_1 := \frac{1}{b\_m - a}\\
\mathbf{if}\;{b\_m}^{2} \leq 10^{+197}:\\
\;\;\;\;\left(\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \left(2 \cdot t\_0\right)\right)\right) \cdot \cos \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b\_m + a\right) \cdot \left(t\_1 \cdot \frac{t\_0 \cdot \left(\left(b\_m - a\right) \cdot 2\right)}{t\_1}\right)\right) \cdot 1\\
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 9.9999999999999995e196Initial program 60.4%
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
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6465.5
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval65.4
Applied rewrites65.4%
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
div-invN/A
lower-*.f64N/A
div-invN/A
metadata-evalN/A
lower-*.f6467.4
Applied rewrites67.4%
if 9.9999999999999995e196 < (pow.f64 b #s(literal 2 binary64)) Initial program 41.9%
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
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6471.1
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval70.0
Applied rewrites70.0%
Taylor expanded in angle around 0
Applied rewrites83.4%
Applied rewrites83.4%
Final simplification73.2%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* PI (* angle 0.005555555555555556)))
(t_1 (* (sin t_0) (* (- b_m a) 2.0)))
(t_2 (/ 1.0 (- b_m a))))
(if (<= (pow b_m 2.0) 2e-115)
(* t_1 (* (+ b_m a) (cos t_0)))
(* (* (+ b_m a) (* t_2 (/ t_1 t_2))) 1.0))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = ((double) M_PI) * (angle * 0.005555555555555556);
double t_1 = sin(t_0) * ((b_m - a) * 2.0);
double t_2 = 1.0 / (b_m - a);
double tmp;
if (pow(b_m, 2.0) <= 2e-115) {
tmp = t_1 * ((b_m + a) * cos(t_0));
} else {
tmp = ((b_m + a) * (t_2 * (t_1 / t_2))) * 1.0;
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = Math.PI * (angle * 0.005555555555555556);
double t_1 = Math.sin(t_0) * ((b_m - a) * 2.0);
double t_2 = 1.0 / (b_m - a);
double tmp;
if (Math.pow(b_m, 2.0) <= 2e-115) {
tmp = t_1 * ((b_m + a) * Math.cos(t_0));
} else {
tmp = ((b_m + a) * (t_2 * (t_1 / t_2))) * 1.0;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = math.pi * (angle * 0.005555555555555556) t_1 = math.sin(t_0) * ((b_m - a) * 2.0) t_2 = 1.0 / (b_m - a) tmp = 0 if math.pow(b_m, 2.0) <= 2e-115: tmp = t_1 * ((b_m + a) * math.cos(t_0)) else: tmp = ((b_m + a) * (t_2 * (t_1 / t_2))) * 1.0 return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(pi * Float64(angle * 0.005555555555555556)) t_1 = Float64(sin(t_0) * Float64(Float64(b_m - a) * 2.0)) t_2 = Float64(1.0 / Float64(b_m - a)) tmp = 0.0 if ((b_m ^ 2.0) <= 2e-115) tmp = Float64(t_1 * Float64(Float64(b_m + a) * cos(t_0))); else tmp = Float64(Float64(Float64(b_m + a) * Float64(t_2 * Float64(t_1 / t_2))) * 1.0); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) t_0 = pi * (angle * 0.005555555555555556); t_1 = sin(t_0) * ((b_m - a) * 2.0); t_2 = 1.0 / (b_m - a); tmp = 0.0; if ((b_m ^ 2.0) <= 2e-115) tmp = t_1 * ((b_m + a) * cos(t_0)); else tmp = ((b_m + a) * (t_2 * (t_1 / t_2))) * 1.0; end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[t$95$0], $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[b$95$m, 2.0], $MachinePrecision], 2e-115], N[(t$95$1 * N[(N[(b$95$m + a), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(t$95$2 * N[(t$95$1 / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \left(angle \cdot 0.005555555555555556\right)\\
t_1 := \sin t\_0 \cdot \left(\left(b\_m - a\right) \cdot 2\right)\\
t_2 := \frac{1}{b\_m - a}\\
\mathbf{if}\;{b\_m}^{2} \leq 2 \cdot 10^{-115}:\\
\;\;\;\;t\_1 \cdot \left(\left(b\_m + a\right) \cdot \cos t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b\_m + a\right) \cdot \left(t\_2 \cdot \frac{t\_1}{t\_2}\right)\right) \cdot 1\\
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 2.0000000000000001e-115Initial program 61.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
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6468.2
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval68.0
Applied rewrites68.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites67.9%
if 2.0000000000000001e-115 < (pow.f64 b #s(literal 2 binary64)) Initial program 48.6%
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
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6467.0
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval66.4
Applied rewrites66.4%
Taylor expanded in angle around 0
Applied rewrites75.3%
Applied rewrites75.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (/ 1.0 (- b_m a)))
(t_1 (sin (* PI (* angle 0.005555555555555556)))))
(if (<= b_m 4.7e+67)
(* (* (+ b_m a) (* (- b_m a) (* 2.0 t_1))) (cos (/ PI (/ 180.0 angle))))
(* (* (+ b_m a) (* t_0 (/ (* t_1 (* (- b_m a) 2.0)) t_0))) 1.0))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = 1.0 / (b_m - a);
double t_1 = sin((((double) M_PI) * (angle * 0.005555555555555556)));
double tmp;
if (b_m <= 4.7e+67) {
tmp = ((b_m + a) * ((b_m - a) * (2.0 * t_1))) * cos((((double) M_PI) / (180.0 / angle)));
} else {
tmp = ((b_m + a) * (t_0 * ((t_1 * ((b_m - a) * 2.0)) / t_0))) * 1.0;
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = 1.0 / (b_m - a);
double t_1 = Math.sin((Math.PI * (angle * 0.005555555555555556)));
double tmp;
if (b_m <= 4.7e+67) {
tmp = ((b_m + a) * ((b_m - a) * (2.0 * t_1))) * Math.cos((Math.PI / (180.0 / angle)));
} else {
tmp = ((b_m + a) * (t_0 * ((t_1 * ((b_m - a) * 2.0)) / t_0))) * 1.0;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = 1.0 / (b_m - a) t_1 = math.sin((math.pi * (angle * 0.005555555555555556))) tmp = 0 if b_m <= 4.7e+67: tmp = ((b_m + a) * ((b_m - a) * (2.0 * t_1))) * math.cos((math.pi / (180.0 / angle))) else: tmp = ((b_m + a) * (t_0 * ((t_1 * ((b_m - a) * 2.0)) / t_0))) * 1.0 return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(1.0 / Float64(b_m - a)) t_1 = sin(Float64(pi * Float64(angle * 0.005555555555555556))) tmp = 0.0 if (b_m <= 4.7e+67) tmp = Float64(Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * Float64(2.0 * t_1))) * cos(Float64(pi / Float64(180.0 / angle)))); else tmp = Float64(Float64(Float64(b_m + a) * Float64(t_0 * Float64(Float64(t_1 * Float64(Float64(b_m - a) * 2.0)) / t_0))) * 1.0); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) t_0 = 1.0 / (b_m - a); t_1 = sin((pi * (angle * 0.005555555555555556))); tmp = 0.0; if (b_m <= 4.7e+67) tmp = ((b_m + a) * ((b_m - a) * (2.0 * t_1))) * cos((pi / (180.0 / angle))); else tmp = ((b_m + a) * (t_0 * ((t_1 * ((b_m - a) * 2.0)) / t_0))) * 1.0; end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(1.0 / N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b$95$m, 4.7e+67], N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[(2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi / N[(180.0 / angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(t$95$0 * N[(N[(t$95$1 * N[(N[(b$95$m - a), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \frac{1}{b\_m - a}\\
t_1 := \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\\
\mathbf{if}\;b\_m \leq 4.7 \cdot 10^{+67}:\\
\;\;\;\;\left(\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \left(2 \cdot t\_1\right)\right)\right) \cdot \cos \left(\frac{\pi}{\frac{180}{angle}}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b\_m + a\right) \cdot \left(t\_0 \cdot \frac{t\_1 \cdot \left(\left(b\_m - a\right) \cdot 2\right)}{t\_0}\right)\right) \cdot 1\\
\end{array}
\end{array}
if b < 4.70000000000000017e67Initial program 55.6%
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
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6465.3
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval64.9
Applied rewrites64.9%
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6466.6
Applied rewrites66.6%
if 4.70000000000000017e67 < b Initial program 47.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
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6474.4
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval74.0
Applied rewrites74.0%
Taylor expanded in angle around 0
Applied rewrites79.7%
Applied rewrites79.7%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= (pow b_m 2.0) 2e-150)
(* (+ b_m a) (* (- b_m a) (sin (* 0.011111111111111112 (* PI angle)))))
(*
(*
(+ b_m a)
(* (- b_m a) (* 2.0 (sin (* PI (* angle 0.005555555555555556))))))
1.0)))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (pow(b_m, 2.0) <= 2e-150) {
tmp = (b_m + a) * ((b_m - a) * sin((0.011111111111111112 * (((double) M_PI) * angle))));
} else {
tmp = ((b_m + a) * ((b_m - a) * (2.0 * sin((((double) M_PI) * (angle * 0.005555555555555556)))))) * 1.0;
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (Math.pow(b_m, 2.0) <= 2e-150) {
tmp = (b_m + a) * ((b_m - a) * Math.sin((0.011111111111111112 * (Math.PI * angle))));
} else {
tmp = ((b_m + a) * ((b_m - a) * (2.0 * Math.sin((Math.PI * (angle * 0.005555555555555556)))))) * 1.0;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if math.pow(b_m, 2.0) <= 2e-150: tmp = (b_m + a) * ((b_m - a) * math.sin((0.011111111111111112 * (math.pi * angle)))) else: tmp = ((b_m + a) * ((b_m - a) * (2.0 * math.sin((math.pi * (angle * 0.005555555555555556)))))) * 1.0 return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if ((b_m ^ 2.0) <= 2e-150) tmp = Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * sin(Float64(0.011111111111111112 * Float64(pi * angle))))); else tmp = Float64(Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * Float64(2.0 * sin(Float64(pi * Float64(angle * 0.005555555555555556)))))) * 1.0); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if ((b_m ^ 2.0) <= 2e-150) tmp = (b_m + a) * ((b_m - a) * sin((0.011111111111111112 * (pi * angle)))); else tmp = ((b_m + a) * ((b_m - a) * (2.0 * sin((pi * (angle * 0.005555555555555556)))))) * 1.0; end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[N[Power[b$95$m, 2.0], $MachinePrecision], 2e-150], N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;{b\_m}^{2} \leq 2 \cdot 10^{-150}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \left(2 \cdot \sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right) \cdot 1\\
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 2.00000000000000001e-150Initial program 61.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/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
Applied rewrites66.0%
if 2.00000000000000001e-150 < (pow.f64 b #s(literal 2 binary64)) Initial program 49.3%
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
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6466.8
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval66.2
Applied rewrites66.2%
Taylor expanded in angle around 0
Applied rewrites74.5%
Final simplification71.3%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (- (pow b_m 2.0) (pow a 2.0)) -5e-254) (* -0.011111111111111112 (* a (* PI (* a angle)))) (* 0.011111111111111112 (* angle (* PI (* b_m b_m))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if ((pow(b_m, 2.0) - pow(a, 2.0)) <= -5e-254) {
tmp = -0.011111111111111112 * (a * (((double) M_PI) * (a * angle)));
} else {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * (b_m * b_m)));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if ((Math.pow(b_m, 2.0) - Math.pow(a, 2.0)) <= -5e-254) {
tmp = -0.011111111111111112 * (a * (Math.PI * (a * angle)));
} else {
tmp = 0.011111111111111112 * (angle * (Math.PI * (b_m * b_m)));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if (math.pow(b_m, 2.0) - math.pow(a, 2.0)) <= -5e-254: tmp = -0.011111111111111112 * (a * (math.pi * (a * angle))) else: tmp = 0.011111111111111112 * (angle * (math.pi * (b_m * b_m))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (Float64((b_m ^ 2.0) - (a ^ 2.0)) <= -5e-254) tmp = Float64(-0.011111111111111112 * Float64(a * Float64(pi * Float64(a * angle)))); else tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b_m * b_m)))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if (((b_m ^ 2.0) - (a ^ 2.0)) <= -5e-254) tmp = -0.011111111111111112 * (a * (pi * (a * angle))); else tmp = 0.011111111111111112 * (angle * (pi * (b_m * b_m))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[N[(N[Power[b$95$m, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision], -5e-254], N[(-0.011111111111111112 * N[(a * N[(Pi * N[(a * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;{b\_m}^{2} - {a}^{2} \leq -5 \cdot 10^{-254}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(a \cdot \left(\pi \cdot \left(a \cdot angle\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b\_m \cdot b\_m\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -5.0000000000000003e-254Initial program 61.6%
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
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6457.5
Applied rewrites57.5%
Taylor expanded in b around 0
Applied rewrites57.4%
Applied rewrites67.0%
if -5.0000000000000003e-254 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 48.0%
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
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6453.1
Applied rewrites53.1%
Taylor expanded in b around 0
Applied rewrites23.2%
Taylor expanded in b around inf
Applied rewrites50.2%
Final simplification57.2%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (/ 1.0 (- b_m a))) (t_1 (* (- b_m a) 2.0)))
(if (<= b_m 5.5e+204)
(* (+ b_m a) (* t_1 (* (sin (* angle (* PI 0.011111111111111112))) 0.5)))
(*
(*
(+ b_m a)
(* t_0 (/ (* (sin (* PI (* angle 0.005555555555555556))) t_1) t_0)))
1.0))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = 1.0 / (b_m - a);
double t_1 = (b_m - a) * 2.0;
double tmp;
if (b_m <= 5.5e+204) {
tmp = (b_m + a) * (t_1 * (sin((angle * (((double) M_PI) * 0.011111111111111112))) * 0.5));
} else {
tmp = ((b_m + a) * (t_0 * ((sin((((double) M_PI) * (angle * 0.005555555555555556))) * t_1) / t_0))) * 1.0;
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = 1.0 / (b_m - a);
double t_1 = (b_m - a) * 2.0;
double tmp;
if (b_m <= 5.5e+204) {
tmp = (b_m + a) * (t_1 * (Math.sin((angle * (Math.PI * 0.011111111111111112))) * 0.5));
} else {
tmp = ((b_m + a) * (t_0 * ((Math.sin((Math.PI * (angle * 0.005555555555555556))) * t_1) / t_0))) * 1.0;
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = 1.0 / (b_m - a) t_1 = (b_m - a) * 2.0 tmp = 0 if b_m <= 5.5e+204: tmp = (b_m + a) * (t_1 * (math.sin((angle * (math.pi * 0.011111111111111112))) * 0.5)) else: tmp = ((b_m + a) * (t_0 * ((math.sin((math.pi * (angle * 0.005555555555555556))) * t_1) / t_0))) * 1.0 return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(1.0 / Float64(b_m - a)) t_1 = Float64(Float64(b_m - a) * 2.0) tmp = 0.0 if (b_m <= 5.5e+204) tmp = Float64(Float64(b_m + a) * Float64(t_1 * Float64(sin(Float64(angle * Float64(pi * 0.011111111111111112))) * 0.5))); else tmp = Float64(Float64(Float64(b_m + a) * Float64(t_0 * Float64(Float64(sin(Float64(pi * Float64(angle * 0.005555555555555556))) * t_1) / t_0))) * 1.0); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) t_0 = 1.0 / (b_m - a); t_1 = (b_m - a) * 2.0; tmp = 0.0; if (b_m <= 5.5e+204) tmp = (b_m + a) * (t_1 * (sin((angle * (pi * 0.011111111111111112))) * 0.5)); else tmp = ((b_m + a) * (t_0 * ((sin((pi * (angle * 0.005555555555555556))) * t_1) / t_0))) * 1.0; end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(1.0 / N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(b$95$m - a), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[b$95$m, 5.5e+204], N[(N[(b$95$m + a), $MachinePrecision] * N[(t$95$1 * N[(N[Sin[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(t$95$0 * N[(N[(N[Sin[N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := \frac{1}{b\_m - a}\\
t_1 := \left(b\_m - a\right) \cdot 2\\
\mathbf{if}\;b\_m \leq 5.5 \cdot 10^{+204}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(t\_1 \cdot \left(\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b\_m + a\right) \cdot \left(t\_0 \cdot \frac{\sin \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot t\_1}{t\_0}\right)\right) \cdot 1\\
\end{array}
\end{array}
if b < 5.4999999999999996e204Initial program 54.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
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6466.3
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval66.2
Applied rewrites66.2%
Applied rewrites67.6%
if 5.4999999999999996e204 < b Initial program 45.6%
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
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6477.7
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval74.0
Applied rewrites74.0%
Taylor expanded in angle around 0
Applied rewrites88.8%
Applied rewrites88.8%
Final simplification69.9%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= (pow b_m 2.0) 2e+69)
(fma
a
(* -0.011111111111111112 (* a (* PI angle)))
(fma 0.011111111111111112 (* PI (* angle (* b_m b_m))) 0.0))
(*
1.0
(*
(+ b_m a)
(*
(- b_m a)
(*
2.0
(*
angle
(fma
-2.8577960676726107e-8
(* (* angle angle) (* PI (* PI PI)))
(* PI 0.005555555555555556)))))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (pow(b_m, 2.0) <= 2e+69) {
tmp = fma(a, (-0.011111111111111112 * (a * (((double) M_PI) * angle))), fma(0.011111111111111112, (((double) M_PI) * (angle * (b_m * b_m))), 0.0));
} else {
tmp = 1.0 * ((b_m + a) * ((b_m - a) * (2.0 * (angle * fma(-2.8577960676726107e-8, ((angle * angle) * (((double) M_PI) * (((double) M_PI) * ((double) M_PI)))), (((double) M_PI) * 0.005555555555555556))))));
}
return tmp;
}
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if ((b_m ^ 2.0) <= 2e+69) tmp = fma(a, Float64(-0.011111111111111112 * Float64(a * Float64(pi * angle))), fma(0.011111111111111112, Float64(pi * Float64(angle * Float64(b_m * b_m))), 0.0)); else tmp = Float64(1.0 * Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * Float64(2.0 * Float64(angle * fma(-2.8577960676726107e-8, Float64(Float64(angle * angle) * Float64(pi * Float64(pi * pi))), Float64(pi * 0.005555555555555556))))))); end return tmp end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[N[Power[b$95$m, 2.0], $MachinePrecision], 2e+69], N[(a * N[(-0.011111111111111112 * N[(a * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * N[(Pi * N[(angle * N[(b$95$m * b$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 0.0), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[(2.0 * N[(angle * N[(-2.8577960676726107e-8 * N[(N[(angle * angle), $MachinePrecision] * N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;{b\_m}^{2} \leq 2 \cdot 10^{+69}:\\
\;\;\;\;\mathsf{fma}\left(a, -0.011111111111111112 \cdot \left(a \cdot \left(\pi \cdot angle\right)\right), \mathsf{fma}\left(0.011111111111111112, \pi \cdot \left(angle \cdot \left(b\_m \cdot b\_m\right)\right), 0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \left(\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \left(2 \cdot \left(angle \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8}, \left(angle \cdot angle\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), \pi \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 2.0000000000000001e69Initial program 60.5%
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
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6457.4
Applied rewrites57.4%
Taylor expanded in a around 0
Applied rewrites61.2%
if 2.0000000000000001e69 < (pow.f64 b #s(literal 2 binary64)) Initial program 45.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
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6469.0
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval68.0
Applied rewrites68.0%
Taylor expanded in angle around 0
Applied rewrites79.6%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-PI.f6472.9
Applied rewrites72.9%
Final simplification66.4%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= a 4.3e+197)
(*
1.0
(*
(+ b_m a)
(*
(- b_m a)
(*
2.0
(sin (* 0.005555555555555556 (* (sqrt PI) (* angle (sqrt PI)))))))))
(*
a
(*
a
(*
(fma b_m (/ b_m (* a a)) -1.0)
(sin (* 2.0 (* PI (* angle 0.005555555555555556)))))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (a <= 4.3e+197) {
tmp = 1.0 * ((b_m + a) * ((b_m - a) * (2.0 * sin((0.005555555555555556 * (sqrt(((double) M_PI)) * (angle * sqrt(((double) M_PI)))))))));
} else {
tmp = a * (a * (fma(b_m, (b_m / (a * a)), -1.0) * sin((2.0 * (((double) M_PI) * (angle * 0.005555555555555556))))));
}
return tmp;
}
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (a <= 4.3e+197) tmp = Float64(1.0 * Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * Float64(2.0 * sin(Float64(0.005555555555555556 * Float64(sqrt(pi) * Float64(angle * sqrt(pi))))))))); else tmp = Float64(a * Float64(a * Float64(fma(b_m, Float64(b_m / Float64(a * a)), -1.0) * sin(Float64(2.0 * Float64(pi * Float64(angle * 0.005555555555555556))))))); end return tmp end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[a, 4.3e+197], N[(1.0 * N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[(2.0 * N[Sin[N[(0.005555555555555556 * N[(N[Sqrt[Pi], $MachinePrecision] * N[(angle * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(a * N[(N[(b$95$m * N[(b$95$m / N[(a * a), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision] * N[Sin[N[(2.0 * N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.3 \cdot 10^{+197}:\\
\;\;\;\;1 \cdot \left(\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \left(2 \cdot \sin \left(0.005555555555555556 \cdot \left(\sqrt{\pi} \cdot \left(angle \cdot \sqrt{\pi}\right)\right)\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(a \cdot \left(\mathsf{fma}\left(b\_m, \frac{b\_m}{a \cdot a}, -1\right) \cdot \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 4.29999999999999996e197Initial program 52.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
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6465.2
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval64.7
Applied rewrites64.7%
Taylor expanded in angle around 0
Applied rewrites69.3%
lift-*.f64N/A
lift-*.f64N/A
metadata-evalN/A
div-invN/A
clear-numN/A
associate-*r/N/A
*-commutativeN/A
div-invN/A
times-fracN/A
metadata-evalN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6469.5
Applied rewrites69.5%
lift-/.f64N/A
lift-/.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-commutativeN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6470.4
Applied rewrites70.4%
if 4.29999999999999996e197 < a Initial program 65.6%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
distribute-lft-neg-inN/A
unpow1N/A
sqr-powN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6465.6
lift-pow.f64N/A
unpow2N/A
lower-*.f6465.6
Applied rewrites65.6%
Taylor expanded in a around -inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
Applied rewrites80.6%
Applied rewrites95.0%
Final simplification72.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= (/ angle 180.0) 4e+24)
(* (+ b_m a) (* (- b_m a) (sin (* 0.011111111111111112 (* PI angle)))))
(if (<= (/ angle 180.0) 1e+92)
(* -0.011111111111111112 (* PI (* angle (sqrt (* a (* a (* a a)))))))
(*
(sin (* 2.0 (* PI (* angle 0.005555555555555556))))
(* (+ b_m a) (- b_m a))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if ((angle / 180.0) <= 4e+24) {
tmp = (b_m + a) * ((b_m - a) * sin((0.011111111111111112 * (((double) M_PI) * angle))));
} else if ((angle / 180.0) <= 1e+92) {
tmp = -0.011111111111111112 * (((double) M_PI) * (angle * sqrt((a * (a * (a * a))))));
} else {
tmp = sin((2.0 * (((double) M_PI) * (angle * 0.005555555555555556)))) * ((b_m + a) * (b_m - a));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if ((angle / 180.0) <= 4e+24) {
tmp = (b_m + a) * ((b_m - a) * Math.sin((0.011111111111111112 * (Math.PI * angle))));
} else if ((angle / 180.0) <= 1e+92) {
tmp = -0.011111111111111112 * (Math.PI * (angle * Math.sqrt((a * (a * (a * a))))));
} else {
tmp = Math.sin((2.0 * (Math.PI * (angle * 0.005555555555555556)))) * ((b_m + a) * (b_m - a));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if (angle / 180.0) <= 4e+24: tmp = (b_m + a) * ((b_m - a) * math.sin((0.011111111111111112 * (math.pi * angle)))) elif (angle / 180.0) <= 1e+92: tmp = -0.011111111111111112 * (math.pi * (angle * math.sqrt((a * (a * (a * a)))))) else: tmp = math.sin((2.0 * (math.pi * (angle * 0.005555555555555556)))) * ((b_m + a) * (b_m - a)) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 4e+24) tmp = Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * sin(Float64(0.011111111111111112 * Float64(pi * angle))))); elseif (Float64(angle / 180.0) <= 1e+92) tmp = Float64(-0.011111111111111112 * Float64(pi * Float64(angle * sqrt(Float64(a * Float64(a * Float64(a * a))))))); else tmp = Float64(sin(Float64(2.0 * Float64(pi * Float64(angle * 0.005555555555555556)))) * Float64(Float64(b_m + a) * Float64(b_m - a))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if ((angle / 180.0) <= 4e+24) tmp = (b_m + a) * ((b_m - a) * sin((0.011111111111111112 * (pi * angle)))); elseif ((angle / 180.0) <= 1e+92) tmp = -0.011111111111111112 * (pi * (angle * sqrt((a * (a * (a * a)))))); else tmp = sin((2.0 * (pi * (angle * 0.005555555555555556)))) * ((b_m + a) * (b_m - a)); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 4e+24], N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+92], N[(-0.011111111111111112 * N[(Pi * N[(angle * N[Sqrt[N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(2.0 * N[(Pi * N[(angle * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 4 \cdot 10^{+24}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 10^{+92}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \sqrt{a \cdot \left(a \cdot \left(a \cdot a\right)\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 3.9999999999999999e24Initial program 60.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/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
Applied rewrites77.0%
if 3.9999999999999999e24 < (/.f64 angle #s(literal 180 binary64)) < 1e92Initial program 27.6%
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
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6449.0
Applied rewrites49.0%
Taylor expanded in b around 0
Applied rewrites49.3%
Applied rewrites49.3%
if 1e92 < (/.f64 angle #s(literal 180 binary64)) Initial program 35.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
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6441.7
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval41.2
Applied rewrites41.2%
lift-*.f64N/A
lift-*.f64N/A
Applied rewrites45.5%
Final simplification69.4%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= (/ angle 180.0) 4e+24)
(* (+ b_m a) (* (- b_m a) (sin (* 0.011111111111111112 (* PI angle)))))
(if (<= (/ angle 180.0) 1e+92)
(* -0.011111111111111112 (* PI (* angle (sqrt (* a (* a (* a a)))))))
(*
(* (+ b_m a) (- b_m a))
(sin (* 2.0 (* angle (* PI 0.005555555555555556))))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if ((angle / 180.0) <= 4e+24) {
tmp = (b_m + a) * ((b_m - a) * sin((0.011111111111111112 * (((double) M_PI) * angle))));
} else if ((angle / 180.0) <= 1e+92) {
tmp = -0.011111111111111112 * (((double) M_PI) * (angle * sqrt((a * (a * (a * a))))));
} else {
tmp = ((b_m + a) * (b_m - a)) * sin((2.0 * (angle * (((double) M_PI) * 0.005555555555555556))));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if ((angle / 180.0) <= 4e+24) {
tmp = (b_m + a) * ((b_m - a) * Math.sin((0.011111111111111112 * (Math.PI * angle))));
} else if ((angle / 180.0) <= 1e+92) {
tmp = -0.011111111111111112 * (Math.PI * (angle * Math.sqrt((a * (a * (a * a))))));
} else {
tmp = ((b_m + a) * (b_m - a)) * Math.sin((2.0 * (angle * (Math.PI * 0.005555555555555556))));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if (angle / 180.0) <= 4e+24: tmp = (b_m + a) * ((b_m - a) * math.sin((0.011111111111111112 * (math.pi * angle)))) elif (angle / 180.0) <= 1e+92: tmp = -0.011111111111111112 * (math.pi * (angle * math.sqrt((a * (a * (a * a)))))) else: tmp = ((b_m + a) * (b_m - a)) * math.sin((2.0 * (angle * (math.pi * 0.005555555555555556)))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 4e+24) tmp = Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * sin(Float64(0.011111111111111112 * Float64(pi * angle))))); elseif (Float64(angle / 180.0) <= 1e+92) tmp = Float64(-0.011111111111111112 * Float64(pi * Float64(angle * sqrt(Float64(a * Float64(a * Float64(a * a))))))); else tmp = Float64(Float64(Float64(b_m + a) * Float64(b_m - a)) * sin(Float64(2.0 * Float64(angle * Float64(pi * 0.005555555555555556))))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if ((angle / 180.0) <= 4e+24) tmp = (b_m + a) * ((b_m - a) * sin((0.011111111111111112 * (pi * angle)))); elseif ((angle / 180.0) <= 1e+92) tmp = -0.011111111111111112 * (pi * (angle * sqrt((a * (a * (a * a)))))); else tmp = ((b_m + a) * (b_m - a)) * sin((2.0 * (angle * (pi * 0.005555555555555556)))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 4e+24], N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[Sin[N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+92], N[(-0.011111111111111112 * N[(Pi * N[(angle * N[Sqrt[N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(2.0 * N[(angle * N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 4 \cdot 10^{+24}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 10^{+92}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \sqrt{a \cdot \left(a \cdot \left(a \cdot a\right)\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right) \cdot \sin \left(2 \cdot \left(angle \cdot \left(\pi \cdot 0.005555555555555556\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 3.9999999999999999e24Initial program 60.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/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
Applied rewrites77.0%
if 3.9999999999999999e24 < (/.f64 angle #s(literal 180 binary64)) < 1e92Initial program 27.6%
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
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6449.0
Applied rewrites49.0%
Taylor expanded in b around 0
Applied rewrites49.3%
Applied rewrites49.3%
if 1e92 < (/.f64 angle #s(literal 180 binary64)) Initial program 35.0%
lift--.f64N/A
flip--N/A
div-invN/A
difference-of-squaresN/A
lift--.f64N/A
associate-*l*N/A
lower-*.f64N/A
+-commutativeN/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites6.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
Applied rewrites43.8%
Final simplification69.1%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (/ angle 180.0) 1e+67) (* (+ b_m a) (* (- b_m a) (* angle (* PI 0.011111111111111112)))) (* (sin (* 0.011111111111111112 (* PI angle))) (* (+ b_m a) (- b_m a)))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if ((angle / 180.0) <= 1e+67) {
tmp = (b_m + a) * ((b_m - a) * (angle * (((double) M_PI) * 0.011111111111111112)));
} else {
tmp = sin((0.011111111111111112 * (((double) M_PI) * angle))) * ((b_m + a) * (b_m - a));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if ((angle / 180.0) <= 1e+67) {
tmp = (b_m + a) * ((b_m - a) * (angle * (Math.PI * 0.011111111111111112)));
} else {
tmp = Math.sin((0.011111111111111112 * (Math.PI * angle))) * ((b_m + a) * (b_m - a));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if (angle / 180.0) <= 1e+67: tmp = (b_m + a) * ((b_m - a) * (angle * (math.pi * 0.011111111111111112))) else: tmp = math.sin((0.011111111111111112 * (math.pi * angle))) * ((b_m + a) * (b_m - a)) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 1e+67) tmp = Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * Float64(angle * Float64(pi * 0.011111111111111112)))); else tmp = Float64(sin(Float64(0.011111111111111112 * Float64(pi * angle))) * Float64(Float64(b_m + a) * Float64(b_m - a))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if ((angle / 180.0) <= 1e+67) tmp = (b_m + a) * ((b_m - a) * (angle * (pi * 0.011111111111111112))); else tmp = sin((0.011111111111111112 * (pi * angle))) * ((b_m + a) * (b_m - a)); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+67], N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 10^{+67}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.99999999999999983e66Initial program 59.3%
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
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6462.9
Applied rewrites62.9%
Applied rewrites73.6%
if 9.99999999999999983e66 < (/.f64 angle #s(literal 180 binary64)) Initial program 33.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f64N/A
Applied rewrites39.2%
Final simplification66.1%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (if (<= (pow a 2.0) 4e+218) (* (* angle (* PI 0.011111111111111112)) (* (+ b_m a) (- b_m a))) (* -0.011111111111111112 (* PI (* a (* a angle))))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if (pow(a, 2.0) <= 4e+218) {
tmp = (angle * (((double) M_PI) * 0.011111111111111112)) * ((b_m + a) * (b_m - a));
} else {
tmp = -0.011111111111111112 * (((double) M_PI) * (a * (a * angle)));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double tmp;
if (Math.pow(a, 2.0) <= 4e+218) {
tmp = (angle * (Math.PI * 0.011111111111111112)) * ((b_m + a) * (b_m - a));
} else {
tmp = -0.011111111111111112 * (Math.PI * (a * (a * angle)));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): tmp = 0 if math.pow(a, 2.0) <= 4e+218: tmp = (angle * (math.pi * 0.011111111111111112)) * ((b_m + a) * (b_m - a)) else: tmp = -0.011111111111111112 * (math.pi * (a * (a * angle))) return tmp
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if ((a ^ 2.0) <= 4e+218) tmp = Float64(Float64(angle * Float64(pi * 0.011111111111111112)) * Float64(Float64(b_m + a) * Float64(b_m - a))); else tmp = Float64(-0.011111111111111112 * Float64(pi * Float64(a * Float64(a * angle)))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) tmp = 0.0; if ((a ^ 2.0) <= 4e+218) tmp = (angle * (pi * 0.011111111111111112)) * ((b_m + a) * (b_m - a)); else tmp = -0.011111111111111112 * (pi * (a * (a * angle))); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[N[Power[a, 2.0], $MachinePrecision], 4e+218], N[(N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision] * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.011111111111111112 * N[(Pi * N[(a * N[(a * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;{a}^{2} \leq 4 \cdot 10^{+218}:\\
\;\;\;\;\left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\pi \cdot \left(a \cdot \left(a \cdot angle\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 a #s(literal 2 binary64)) < 4.00000000000000033e218Initial program 59.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
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6455.5
Applied rewrites55.5%
if 4.00000000000000033e218 < (pow.f64 a #s(literal 2 binary64)) Initial program 42.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
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6453.8
Applied rewrites53.8%
Taylor expanded in b around 0
Applied rewrites55.0%
Applied rewrites66.9%
Final simplification59.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(if (<= (/ angle 180.0) 1.5e+78)
(* (+ b_m a) (* (- b_m a) (* angle (* PI 0.011111111111111112))))
(*
1.0
(*
(+ b_m a)
(*
(* b_m 2.0)
(*
angle
(fma
-2.8577960676726107e-8
(* (* angle angle) (* PI (* PI PI)))
(* PI 0.005555555555555556))))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double tmp;
if ((angle / 180.0) <= 1.5e+78) {
tmp = (b_m + a) * ((b_m - a) * (angle * (((double) M_PI) * 0.011111111111111112)));
} else {
tmp = 1.0 * ((b_m + a) * ((b_m * 2.0) * (angle * fma(-2.8577960676726107e-8, ((angle * angle) * (((double) M_PI) * (((double) M_PI) * ((double) M_PI)))), (((double) M_PI) * 0.005555555555555556)))));
}
return tmp;
}
b_m = abs(b) function code(a, b_m, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 1.5e+78) tmp = Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * Float64(angle * Float64(pi * 0.011111111111111112)))); else tmp = Float64(1.0 * Float64(Float64(b_m + a) * Float64(Float64(b_m * 2.0) * Float64(angle * fma(-2.8577960676726107e-8, Float64(Float64(angle * angle) * Float64(pi * Float64(pi * pi))), Float64(pi * 0.005555555555555556)))))); end return tmp end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1.5e+78], N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m * 2.0), $MachinePrecision] * N[(angle * N[(-2.8577960676726107e-8 * N[(N[(angle * angle), $MachinePrecision] * N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(Pi * 0.005555555555555556), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 1.5 \cdot 10^{+78}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \left(\left(b\_m + a\right) \cdot \left(\left(b\_m \cdot 2\right) \cdot \left(angle \cdot \mathsf{fma}\left(-2.8577960676726107 \cdot 10^{-8}, \left(angle \cdot angle\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), \pi \cdot 0.005555555555555556\right)\right)\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.49999999999999991e78Initial program 58.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
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6462.3
Applied rewrites62.3%
Applied rewrites72.7%
if 1.49999999999999991e78 < (/.f64 angle #s(literal 180 binary64)) Initial program 32.1%
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
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6440.3
lift-/.f64N/A
div-invN/A
lower-*.f64N/A
metadata-eval39.8
Applied rewrites39.8%
Taylor expanded in angle around 0
Applied rewrites36.7%
Taylor expanded in b around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6424.8
Applied rewrites24.8%
Taylor expanded in angle around 0
Applied rewrites34.1%
Final simplification65.3%
b_m = (fabs.f64 b)
(FPCore (a b_m angle)
:precision binary64
(let* ((t_0 (* angle (* PI 0.011111111111111112))))
(if (<= (/ angle 180.0) 2e+54)
(* (+ b_m a) (* (- b_m a) t_0))
(if (<= (/ angle 180.0) 5e+244)
(* -0.011111111111111112 (* PI (* angle (sqrt (* a (* a (* a a)))))))
(* t_0 (* (+ b_m a) (- b_m a)))))))b_m = fabs(b);
double code(double a, double b_m, double angle) {
double t_0 = angle * (((double) M_PI) * 0.011111111111111112);
double tmp;
if ((angle / 180.0) <= 2e+54) {
tmp = (b_m + a) * ((b_m - a) * t_0);
} else if ((angle / 180.0) <= 5e+244) {
tmp = -0.011111111111111112 * (((double) M_PI) * (angle * sqrt((a * (a * (a * a))))));
} else {
tmp = t_0 * ((b_m + a) * (b_m - a));
}
return tmp;
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
double t_0 = angle * (Math.PI * 0.011111111111111112);
double tmp;
if ((angle / 180.0) <= 2e+54) {
tmp = (b_m + a) * ((b_m - a) * t_0);
} else if ((angle / 180.0) <= 5e+244) {
tmp = -0.011111111111111112 * (Math.PI * (angle * Math.sqrt((a * (a * (a * a))))));
} else {
tmp = t_0 * ((b_m + a) * (b_m - a));
}
return tmp;
}
b_m = math.fabs(b) def code(a, b_m, angle): t_0 = angle * (math.pi * 0.011111111111111112) tmp = 0 if (angle / 180.0) <= 2e+54: tmp = (b_m + a) * ((b_m - a) * t_0) elif (angle / 180.0) <= 5e+244: tmp = -0.011111111111111112 * (math.pi * (angle * math.sqrt((a * (a * (a * a)))))) else: tmp = t_0 * ((b_m + a) * (b_m - a)) return tmp
b_m = abs(b) function code(a, b_m, angle) t_0 = Float64(angle * Float64(pi * 0.011111111111111112)) tmp = 0.0 if (Float64(angle / 180.0) <= 2e+54) tmp = Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * t_0)); elseif (Float64(angle / 180.0) <= 5e+244) tmp = Float64(-0.011111111111111112 * Float64(pi * Float64(angle * sqrt(Float64(a * Float64(a * Float64(a * a))))))); else tmp = Float64(t_0 * Float64(Float64(b_m + a) * Float64(b_m - a))); end return tmp end
b_m = abs(b); function tmp_2 = code(a, b_m, angle) t_0 = angle * (pi * 0.011111111111111112); tmp = 0.0; if ((angle / 180.0) <= 2e+54) tmp = (b_m + a) * ((b_m - a) * t_0); elseif ((angle / 180.0) <= 5e+244) tmp = -0.011111111111111112 * (pi * (angle * sqrt((a * (a * (a * a)))))); else tmp = t_0 * ((b_m + a) * (b_m - a)); end tmp_2 = tmp; end
b_m = N[Abs[b], $MachinePrecision]
code[a_, b$95$m_, angle_] := Block[{t$95$0 = N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e+54], N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(angle / 180.0), $MachinePrecision], 5e+244], N[(-0.011111111111111112 * N[(Pi * N[(angle * N[Sqrt[N[(a * N[(a * N[(a * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(b$95$m + a), $MachinePrecision] * N[(b$95$m - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
b_m = \left|b\right|
\\
\begin{array}{l}
t_0 := angle \cdot \left(\pi \cdot 0.011111111111111112\right)\\
\mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{+54}:\\
\;\;\;\;\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot t\_0\right)\\
\mathbf{elif}\;\frac{angle}{180} \leq 5 \cdot 10^{+244}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(\pi \cdot \left(angle \cdot \sqrt{a \cdot \left(a \cdot \left(a \cdot a\right)\right)}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\left(b\_m + a\right) \cdot \left(b\_m - a\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2.0000000000000002e54Initial program 60.3%
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
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6463.0
Applied rewrites63.0%
Applied rewrites73.9%
if 2.0000000000000002e54 < (/.f64 angle #s(literal 180 binary64)) < 5.00000000000000022e244Initial program 30.4%
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
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6426.8
Applied rewrites26.8%
Taylor expanded in b around 0
Applied rewrites29.6%
Applied rewrites29.8%
if 5.00000000000000022e244 < (/.f64 angle #s(literal 180 binary64)) Initial program 40.5%
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
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6437.7
Applied rewrites37.7%
Final simplification63.8%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* (+ b_m a) (* (- b_m a) (* angle (* PI 0.011111111111111112)))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return (b_m + a) * ((b_m - a) * (angle * (((double) M_PI) * 0.011111111111111112)));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
return (b_m + a) * ((b_m - a) * (angle * (Math.PI * 0.011111111111111112)));
}
b_m = math.fabs(b) def code(a, b_m, angle): return (b_m + a) * ((b_m - a) * (angle * (math.pi * 0.011111111111111112)))
b_m = abs(b) function code(a, b_m, angle) return Float64(Float64(b_m + a) * Float64(Float64(b_m - a) * Float64(angle * Float64(pi * 0.011111111111111112)))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = (b_m + a) * ((b_m - a) * (angle * (pi * 0.011111111111111112))); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := N[(N[(b$95$m + a), $MachinePrecision] * N[(N[(b$95$m - a), $MachinePrecision] * N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
\left(b\_m + a\right) \cdot \left(\left(b\_m - a\right) \cdot \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)\right)
\end{array}
Initial program 53.7%
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
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6454.9
Applied rewrites54.9%
Applied rewrites62.9%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* -0.011111111111111112 (* a (* PI (* a angle)))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return -0.011111111111111112 * (a * (((double) M_PI) * (a * angle)));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
return -0.011111111111111112 * (a * (Math.PI * (a * angle)));
}
b_m = math.fabs(b) def code(a, b_m, angle): return -0.011111111111111112 * (a * (math.pi * (a * angle)))
b_m = abs(b) function code(a, b_m, angle) return Float64(-0.011111111111111112 * Float64(a * Float64(pi * Float64(a * angle)))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = -0.011111111111111112 * (a * (pi * (a * angle))); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := N[(-0.011111111111111112 * N[(a * N[(Pi * N[(a * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
-0.011111111111111112 \cdot \left(a \cdot \left(\pi \cdot \left(a \cdot angle\right)\right)\right)
\end{array}
Initial program 53.7%
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
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6454.9
Applied rewrites54.9%
Taylor expanded in b around 0
Applied rewrites37.5%
Applied rewrites40.4%
Final simplification40.4%
b_m = (fabs.f64 b) (FPCore (a b_m angle) :precision binary64 (* -0.011111111111111112 (* a (* a (* PI angle)))))
b_m = fabs(b);
double code(double a, double b_m, double angle) {
return -0.011111111111111112 * (a * (a * (((double) M_PI) * angle)));
}
b_m = Math.abs(b);
public static double code(double a, double b_m, double angle) {
return -0.011111111111111112 * (a * (a * (Math.PI * angle)));
}
b_m = math.fabs(b) def code(a, b_m, angle): return -0.011111111111111112 * (a * (a * (math.pi * angle)))
b_m = abs(b) function code(a, b_m, angle) return Float64(-0.011111111111111112 * Float64(a * Float64(a * Float64(pi * angle)))) end
b_m = abs(b); function tmp = code(a, b_m, angle) tmp = -0.011111111111111112 * (a * (a * (pi * angle))); end
b_m = N[Abs[b], $MachinePrecision] code[a_, b$95$m_, angle_] := N[(-0.011111111111111112 * N[(a * N[(a * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
b_m = \left|b\right|
\\
-0.011111111111111112 \cdot \left(a \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\right)
\end{array}
Initial program 53.7%
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
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6454.9
Applied rewrites54.9%
Taylor expanded in b around 0
Applied rewrites37.5%
Applied rewrites40.4%
herbie shell --seed 2024235
(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)))))