
(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}
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(if (<= a_m 6.2e+250)
(*
(fma (sqrt a_m) (sqrt a_m) b)
(*
(- b a_m)
(sin
(*
(*
(* (pow (* (* PI PI) (sqrt PI)) 0.3333333333333333) (cbrt (sqrt PI)))
angle)
0.011111111111111112))))
(*
(+ a_m b)
(*
(- b a_m)
(sin
(*
0.011111111111111112
(* angle (* (sqrt (* PI (sqrt PI))) (sqrt (sqrt PI))))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if (a_m <= 6.2e+250) {
tmp = fma(sqrt(a_m), sqrt(a_m), b) * ((b - a_m) * sin((((pow(((((double) M_PI) * ((double) M_PI)) * sqrt(((double) M_PI))), 0.3333333333333333) * cbrt(sqrt(((double) M_PI)))) * angle) * 0.011111111111111112)));
} else {
tmp = (a_m + b) * ((b - a_m) * sin((0.011111111111111112 * (angle * (sqrt((((double) M_PI) * sqrt(((double) M_PI)))) * sqrt(sqrt(((double) M_PI))))))));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (a_m <= 6.2e+250) tmp = Float64(fma(sqrt(a_m), sqrt(a_m), b) * Float64(Float64(b - a_m) * sin(Float64(Float64(Float64((Float64(Float64(pi * pi) * sqrt(pi)) ^ 0.3333333333333333) * cbrt(sqrt(pi))) * angle) * 0.011111111111111112)))); else tmp = Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * sin(Float64(0.011111111111111112 * Float64(angle * Float64(sqrt(Float64(pi * sqrt(pi))) * sqrt(sqrt(pi)))))))); end return tmp end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[a$95$m, 6.2e+250], N[(N[(N[Sqrt[a$95$m], $MachinePrecision] * N[Sqrt[a$95$m], $MachinePrecision] + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[Sin[N[(N[(N[(N[Power[N[(N[(Pi * Pi), $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision], 0.3333333333333333], $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[Sin[N[(0.011111111111111112 * N[(angle * N[(N[Sqrt[N[(Pi * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Sqrt[Pi], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 6.2 \cdot 10^{+250}:\\
\;\;\;\;\mathsf{fma}\left(\sqrt{a\_m}, \sqrt{a\_m}, b\right) \cdot \left(\left(b - a\_m\right) \cdot \sin \left(\left(\left({\left(\left(\pi \cdot \pi\right) \cdot \sqrt{\pi}\right)}^{0.3333333333333333} \cdot \sqrt[3]{\sqrt{\pi}}\right) \cdot angle\right) \cdot 0.011111111111111112\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \left(\sqrt{\pi \cdot \sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 6.2000000000000001e250Initial program 53.1%
Applied rewrites68.6%
add-cbrt-cubeN/A
pow1/3N/A
add-sqr-sqrtN/A
associate-*r*N/A
unpow-prod-downN/A
pow1/3N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6471.5
Applied rewrites71.5%
+-commutativeN/A
unpow1N/A
sqr-powN/A
lower-fma.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f6432.9
Applied rewrites32.9%
if 6.2000000000000001e250 < a Initial program 72.2%
Applied rewrites66.7%
lift-PI.f6466.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.f6488.9
Applied rewrites88.9%
Final simplification36.8%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0
(*
(+ a_m b)
(*
(- b a_m)
(*
angle
(*
PI
(fma
(* -2.2862368541380886e-7 (* angle angle))
(* PI PI)
0.011111111111111112))))))
(t_1 (* PI (/ angle 180.0)))
(t_2
(* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_1)) (cos t_1))))
(if (<= t_2 -1e-304)
t_0
(if (<= t_2 2e+229)
(* (sin (* 0.011111111111111112 (* PI angle))) (* b b))
(if (<= t_2 INFINITY)
t_0
(* (+ a_m b) (* 0.011111111111111112 (* angle (* (- b a_m) PI)))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = (a_m + b) * ((b - a_m) * (angle * (((double) M_PI) * fma((-2.2862368541380886e-7 * (angle * angle)), (((double) M_PI) * ((double) M_PI)), 0.011111111111111112))));
double t_1 = ((double) M_PI) * (angle / 180.0);
double t_2 = ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_1)) * cos(t_1);
double tmp;
if (t_2 <= -1e-304) {
tmp = t_0;
} else if (t_2 <= 2e+229) {
tmp = sin((0.011111111111111112 * (((double) M_PI) * angle))) * (b * b);
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_0;
} else {
tmp = (a_m + b) * (0.011111111111111112 * (angle * ((b - a_m) * ((double) M_PI))));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(angle * Float64(pi * fma(Float64(-2.2862368541380886e-7 * Float64(angle * angle)), Float64(pi * pi), 0.011111111111111112))))) t_1 = Float64(pi * Float64(angle / 180.0)) t_2 = Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_1)) * cos(t_1)) tmp = 0.0 if (t_2 <= -1e-304) tmp = t_0; elseif (t_2 <= 2e+229) tmp = Float64(sin(Float64(0.011111111111111112 * Float64(pi * angle))) * Float64(b * b)); elseif (t_2 <= Inf) tmp = t_0; else tmp = Float64(Float64(a_m + b) * Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a_m) * pi)))); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(angle * N[(Pi * N[(N[(-2.2862368541380886e-7 * N[(angle * angle), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-304], t$95$0, If[LessEqual[t$95$2, 2e+229], N[(N[Sin[N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$0, N[(N[(a$95$m + b), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(N[(b - a$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \pi \cdot \pi, 0.011111111111111112\right)\right)\right)\right)\\
t_1 := \pi \cdot \frac{angle}{180}\\
t_2 := \left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_1\right) \cdot \cos t\_1\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-304}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+229}:\\
\;\;\;\;\sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(b \cdot b\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\_m\right) \cdot \pi\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))))) < -9.99999999999999971e-305 or 2e229 < (*.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))))) < +inf.0Initial program 50.4%
Applied rewrites65.3%
add-cbrt-cubeN/A
pow1/3N/A
add-sqr-sqrtN/A
associate-*r*N/A
unpow-prod-downN/A
pow1/3N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6470.7
Applied rewrites70.7%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites68.1%
if -9.99999999999999971e-305 < (*.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))))) < 2e229Initial program 72.6%
Applied rewrites72.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6446.0
Applied rewrites46.0%
if +inf.0 < (*.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 0.0%
Applied rewrites90.5%
add-cbrt-cubeN/A
pow1/3N/A
add-sqr-sqrtN/A
associate-*r*N/A
unpow-prod-downN/A
pow1/3N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6481.2
Applied rewrites81.2%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6499.7
Applied rewrites99.7%
Final simplification63.4%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0
(*
(+ a_m b)
(*
(- b a_m)
(*
angle
(*
PI
(fma
(* -2.2862368541380886e-7 (* angle angle))
(* PI PI)
0.011111111111111112))))))
(t_1 (* PI (/ angle 180.0)))
(t_2
(* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_1)) (cos t_1))))
(if (<= t_2 -1e-304)
t_0
(if (<= t_2 5e+210)
(* (* angle 0.011111111111111112) (* PI (* b b)))
(if (<= t_2 INFINITY)
t_0
(* (+ a_m b) (* 0.011111111111111112 (* angle (* (- b a_m) PI)))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = (a_m + b) * ((b - a_m) * (angle * (((double) M_PI) * fma((-2.2862368541380886e-7 * (angle * angle)), (((double) M_PI) * ((double) M_PI)), 0.011111111111111112))));
double t_1 = ((double) M_PI) * (angle / 180.0);
double t_2 = ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_1)) * cos(t_1);
double tmp;
if (t_2 <= -1e-304) {
tmp = t_0;
} else if (t_2 <= 5e+210) {
tmp = (angle * 0.011111111111111112) * (((double) M_PI) * (b * b));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_0;
} else {
tmp = (a_m + b) * (0.011111111111111112 * (angle * ((b - a_m) * ((double) M_PI))));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(angle * Float64(pi * fma(Float64(-2.2862368541380886e-7 * Float64(angle * angle)), Float64(pi * pi), 0.011111111111111112))))) t_1 = Float64(pi * Float64(angle / 180.0)) t_2 = Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_1)) * cos(t_1)) tmp = 0.0 if (t_2 <= -1e-304) tmp = t_0; elseif (t_2 <= 5e+210) tmp = Float64(Float64(angle * 0.011111111111111112) * Float64(pi * Float64(b * b))); elseif (t_2 <= Inf) tmp = t_0; else tmp = Float64(Float64(a_m + b) * Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a_m) * pi)))); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(angle * N[(Pi * N[(N[(-2.2862368541380886e-7 * N[(angle * angle), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-304], t$95$0, If[LessEqual[t$95$2, 5e+210], N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$0, N[(N[(a$95$m + b), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(N[(b - a$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \pi \cdot \pi, 0.011111111111111112\right)\right)\right)\right)\\
t_1 := \pi \cdot \frac{angle}{180}\\
t_2 := \left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_1\right) \cdot \cos t\_1\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-304}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+210}:\\
\;\;\;\;\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\_m\right) \cdot \pi\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))))) < -9.99999999999999971e-305 or 4.9999999999999998e210 < (*.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))))) < +inf.0Initial program 50.2%
Applied rewrites65.0%
add-cbrt-cubeN/A
pow1/3N/A
add-sqr-sqrtN/A
associate-*r*N/A
unpow-prod-downN/A
pow1/3N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6470.3
Applied rewrites70.3%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites67.8%
if -9.99999999999999971e-305 < (*.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.9999999999999998e210Initial program 73.6%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6469.5
Applied rewrites69.5%
Taylor expanded in b around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6445.9
Applied rewrites45.9%
if +inf.0 < (*.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 0.0%
Applied rewrites90.5%
add-cbrt-cubeN/A
pow1/3N/A
add-sqr-sqrtN/A
associate-*r*N/A
unpow-prod-downN/A
pow1/3N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6481.2
Applied rewrites81.2%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6499.7
Applied rewrites99.7%
Final simplification63.2%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0
(*
(+ a_m b)
(*
angle
(*
(- b a_m)
(*
PI
(fma
(* -2.2862368541380886e-7 (* angle angle))
(* PI PI)
0.011111111111111112))))))
(t_1 (* PI (/ angle 180.0)))
(t_2
(* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_1)) (cos t_1))))
(if (<= t_2 -1e-304)
t_0
(if (<= t_2 5e+210)
(* (* angle 0.011111111111111112) (* PI (* b b)))
(if (<= t_2 INFINITY)
t_0
(* (+ a_m b) (* 0.011111111111111112 (* angle (* (- b a_m) PI)))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = (a_m + b) * (angle * ((b - a_m) * (((double) M_PI) * fma((-2.2862368541380886e-7 * (angle * angle)), (((double) M_PI) * ((double) M_PI)), 0.011111111111111112))));
double t_1 = ((double) M_PI) * (angle / 180.0);
double t_2 = ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_1)) * cos(t_1);
double tmp;
if (t_2 <= -1e-304) {
tmp = t_0;
} else if (t_2 <= 5e+210) {
tmp = (angle * 0.011111111111111112) * (((double) M_PI) * (b * b));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_0;
} else {
tmp = (a_m + b) * (0.011111111111111112 * (angle * ((b - a_m) * ((double) M_PI))));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(Float64(a_m + b) * Float64(angle * Float64(Float64(b - a_m) * Float64(pi * fma(Float64(-2.2862368541380886e-7 * Float64(angle * angle)), Float64(pi * pi), 0.011111111111111112))))) t_1 = Float64(pi * Float64(angle / 180.0)) t_2 = Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_1)) * cos(t_1)) tmp = 0.0 if (t_2 <= -1e-304) tmp = t_0; elseif (t_2 <= 5e+210) tmp = Float64(Float64(angle * 0.011111111111111112) * Float64(pi * Float64(b * b))); elseif (t_2 <= Inf) tmp = t_0; else tmp = Float64(Float64(a_m + b) * Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a_m) * pi)))); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[(a$95$m + b), $MachinePrecision] * N[(angle * N[(N[(b - a$95$m), $MachinePrecision] * N[(Pi * N[(N[(-2.2862368541380886e-7 * N[(angle * angle), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-304], t$95$0, If[LessEqual[t$95$2, 5e+210], N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$0, N[(N[(a$95$m + b), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(N[(b - a$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \left(a\_m + b\right) \cdot \left(angle \cdot \left(\left(b - a\_m\right) \cdot \left(\pi \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \pi \cdot \pi, 0.011111111111111112\right)\right)\right)\right)\\
t_1 := \pi \cdot \frac{angle}{180}\\
t_2 := \left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_1\right) \cdot \cos t\_1\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-304}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+210}:\\
\;\;\;\;\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\_m\right) \cdot \pi\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))))) < -9.99999999999999971e-305 or 4.9999999999999998e210 < (*.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))))) < +inf.0Initial program 50.2%
Applied rewrites65.0%
add-cbrt-cubeN/A
pow1/3N/A
add-sqr-sqrtN/A
associate-*r*N/A
unpow-prod-downN/A
pow1/3N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6470.3
Applied rewrites70.3%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
Applied rewrites67.8%
if -9.99999999999999971e-305 < (*.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.9999999999999998e210Initial program 73.6%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6469.5
Applied rewrites69.5%
Taylor expanded in b around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6445.9
Applied rewrites45.9%
if +inf.0 < (*.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 0.0%
Applied rewrites90.5%
add-cbrt-cubeN/A
pow1/3N/A
add-sqr-sqrtN/A
associate-*r*N/A
unpow-prod-downN/A
pow1/3N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6481.2
Applied rewrites81.2%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6499.7
Applied rewrites99.7%
Final simplification63.2%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (* PI (/ angle 180.0)))
(t_1
(* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_0)) (cos t_0))))
(if (<= t_1 5e+210)
(*
(+ a_m b)
(*
(- b a_m)
(sin (* 0.011111111111111112 (* angle (* (sqrt PI) (sqrt PI)))))))
(if (<= t_1 INFINITY)
(*
(+ a_m b)
(*
(- b a_m)
(*
angle
(*
PI
(fma
(* -2.2862368541380886e-7 (* angle angle))
(* PI PI)
0.011111111111111112)))))
(* (+ a_m b) (* 0.011111111111111112 (* angle (* (- b a_m) PI))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
double t_1 = ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_0)) * cos(t_0);
double tmp;
if (t_1 <= 5e+210) {
tmp = (a_m + b) * ((b - a_m) * sin((0.011111111111111112 * (angle * (sqrt(((double) M_PI)) * sqrt(((double) M_PI)))))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (a_m + b) * ((b - a_m) * (angle * (((double) M_PI) * fma((-2.2862368541380886e-7 * (angle * angle)), (((double) M_PI) * ((double) M_PI)), 0.011111111111111112))));
} else {
tmp = (a_m + b) * (0.011111111111111112 * (angle * ((b - a_m) * ((double) M_PI))));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) t_1 = Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0)) * cos(t_0)) tmp = 0.0 if (t_1 <= 5e+210) tmp = Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * sin(Float64(0.011111111111111112 * Float64(angle * Float64(sqrt(pi) * sqrt(pi))))))); elseif (t_1 <= Inf) tmp = Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(angle * Float64(pi * fma(Float64(-2.2862368541380886e-7 * Float64(angle * angle)), Float64(pi * pi), 0.011111111111111112))))); else tmp = Float64(Float64(a_m + b) * Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a_m) * pi)))); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+210], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[Sin[N[(0.011111111111111112 * N[(angle * N[(N[Sqrt[Pi], $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(angle * N[(Pi * N[(N[(-2.2862368541380886e-7 * N[(angle * angle), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a$95$m + b), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(N[(b - a$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
t_1 := \left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+210}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \left(\sqrt{\pi} \cdot \sqrt{\pi}\right)\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \pi \cdot \pi, 0.011111111111111112\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\_m\right) \cdot \pi\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.9999999999999998e210Initial program 61.0%
Applied rewrites66.1%
add-sqr-sqrtN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6465.1
Applied rewrites65.1%
if 4.9999999999999998e210 < (*.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))))) < +inf.0Initial program 47.4%
Applied rewrites70.6%
add-cbrt-cubeN/A
pow1/3N/A
add-sqr-sqrtN/A
associate-*r*N/A
unpow-prod-downN/A
pow1/3N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6477.2
Applied rewrites77.2%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites78.8%
if +inf.0 < (*.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 0.0%
Applied rewrites90.5%
add-cbrt-cubeN/A
pow1/3N/A
add-sqr-sqrtN/A
associate-*r*N/A
unpow-prod-downN/A
pow1/3N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6481.2
Applied rewrites81.2%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6499.7
Applied rewrites99.7%
Final simplification70.6%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (* PI (/ angle 180.0)))
(t_1
(* (* (* 2.0 (- (pow b 2.0) (pow a_m 2.0))) (sin t_0)) (cos t_0))))
(if (<= t_1 4e+263)
(*
(+ a_m b)
(*
(- b a_m)
(sin (* (sqrt PI) (* (sqrt PI) (* angle 0.011111111111111112))))))
(if (<= t_1 INFINITY)
(*
(+ a_m b)
(*
(- b a_m)
(*
angle
(*
PI
(fma
(* -2.2862368541380886e-7 (* angle angle))
(* PI PI)
0.011111111111111112)))))
(* (+ a_m b) (* 0.011111111111111112 (* angle (* (- b a_m) PI))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
double t_1 = ((2.0 * (pow(b, 2.0) - pow(a_m, 2.0))) * sin(t_0)) * cos(t_0);
double tmp;
if (t_1 <= 4e+263) {
tmp = (a_m + b) * ((b - a_m) * sin((sqrt(((double) M_PI)) * (sqrt(((double) M_PI)) * (angle * 0.011111111111111112)))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = (a_m + b) * ((b - a_m) * (angle * (((double) M_PI) * fma((-2.2862368541380886e-7 * (angle * angle)), (((double) M_PI) * ((double) M_PI)), 0.011111111111111112))));
} else {
tmp = (a_m + b) * (0.011111111111111112 * (angle * ((b - a_m) * ((double) M_PI))));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) t_1 = Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a_m ^ 2.0))) * sin(t_0)) * cos(t_0)) tmp = 0.0 if (t_1 <= 4e+263) tmp = Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * sin(Float64(sqrt(pi) * Float64(sqrt(pi) * Float64(angle * 0.011111111111111112)))))); elseif (t_1 <= Inf) tmp = Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(angle * Float64(pi * fma(Float64(-2.2862368541380886e-7 * Float64(angle * angle)), Float64(pi * pi), 0.011111111111111112))))); else tmp = Float64(Float64(a_m + b) * Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a_m) * pi)))); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 4e+263], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[Sin[N[(N[Sqrt[Pi], $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(angle * N[(Pi * N[(N[(-2.2862368541380886e-7 * N[(angle * angle), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a$95$m + b), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(N[(b - a$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
t_1 := \left(\left(2 \cdot \left({b}^{2} - {a\_m}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0\\
\mathbf{if}\;t\_1 \leq 4 \cdot 10^{+263}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \sin \left(\sqrt{\pi} \cdot \left(\sqrt{\pi} \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \pi \cdot \pi, 0.011111111111111112\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\_m\right) \cdot \pi\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.00000000000000006e263Initial program 60.0%
Applied rewrites64.9%
lift-PI.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
lift-PI.f64N/A
add-sqr-sqrtN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6463.8
Applied rewrites63.8%
if 4.00000000000000006e263 < (*.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))))) < +inf.0Initial program 49.4%
Applied rewrites73.5%
add-cbrt-cubeN/A
pow1/3N/A
add-sqr-sqrtN/A
associate-*r*N/A
unpow-prod-downN/A
pow1/3N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6480.0
Applied rewrites80.0%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites82.0%
if +inf.0 < (*.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 0.0%
Applied rewrites90.5%
add-cbrt-cubeN/A
pow1/3N/A
add-sqr-sqrtN/A
associate-*r*N/A
unpow-prod-downN/A
pow1/3N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6481.2
Applied rewrites81.2%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6499.7
Applied rewrites99.7%
Final simplification70.5%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (- (pow b 2.0) (pow a_m 2.0))))
(if (<= t_0 -5e+239)
(* a_m (* (* PI angle) (* a_m -0.011111111111111112)))
(if (<= t_0 2e+114)
(* 0.011111111111111112 (* (* PI angle) (* (- b a_m) (+ a_m b))))
(* b (* b (* PI (* angle 0.011111111111111112))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = pow(b, 2.0) - pow(a_m, 2.0);
double tmp;
if (t_0 <= -5e+239) {
tmp = a_m * ((((double) M_PI) * angle) * (a_m * -0.011111111111111112));
} else if (t_0 <= 2e+114) {
tmp = 0.011111111111111112 * ((((double) M_PI) * angle) * ((b - a_m) * (a_m + b)));
} else {
tmp = b * (b * (((double) M_PI) * (angle * 0.011111111111111112)));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = Math.pow(b, 2.0) - Math.pow(a_m, 2.0);
double tmp;
if (t_0 <= -5e+239) {
tmp = a_m * ((Math.PI * angle) * (a_m * -0.011111111111111112));
} else if (t_0 <= 2e+114) {
tmp = 0.011111111111111112 * ((Math.PI * angle) * ((b - a_m) * (a_m + b)));
} else {
tmp = b * (b * (Math.PI * (angle * 0.011111111111111112)));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): t_0 = math.pow(b, 2.0) - math.pow(a_m, 2.0) tmp = 0 if t_0 <= -5e+239: tmp = a_m * ((math.pi * angle) * (a_m * -0.011111111111111112)) elif t_0 <= 2e+114: tmp = 0.011111111111111112 * ((math.pi * angle) * ((b - a_m) * (a_m + b))) else: tmp = b * (b * (math.pi * (angle * 0.011111111111111112))) return tmp
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64((b ^ 2.0) - (a_m ^ 2.0)) tmp = 0.0 if (t_0 <= -5e+239) tmp = Float64(a_m * Float64(Float64(pi * angle) * Float64(a_m * -0.011111111111111112))); elseif (t_0 <= 2e+114) tmp = Float64(0.011111111111111112 * Float64(Float64(pi * angle) * Float64(Float64(b - a_m) * Float64(a_m + b)))); else tmp = Float64(b * Float64(b * Float64(pi * Float64(angle * 0.011111111111111112)))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) t_0 = (b ^ 2.0) - (a_m ^ 2.0); tmp = 0.0; if (t_0 <= -5e+239) tmp = a_m * ((pi * angle) * (a_m * -0.011111111111111112)); elseif (t_0 <= 2e+114) tmp = 0.011111111111111112 * ((pi * angle) * ((b - a_m) * (a_m + b))); else tmp = b * (b * (pi * (angle * 0.011111111111111112))); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+239], N[(a$95$m * N[(N[(Pi * angle), $MachinePrecision] * N[(a$95$m * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+114], N[(0.011111111111111112 * N[(N[(Pi * angle), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(b * N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := {b}^{2} - {a\_m}^{2}\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+239}:\\
\;\;\;\;a\_m \cdot \left(\left(\pi \cdot angle\right) \cdot \left(a\_m \cdot -0.011111111111111112\right)\right)\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+114}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\pi \cdot angle\right) \cdot \left(\left(b - a\_m\right) \cdot \left(a\_m + b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -5.00000000000000007e239Initial program 73.0%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6457.1
Applied rewrites57.1%
Taylor expanded in b around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6457.1
Applied rewrites57.1%
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.6
Applied rewrites68.6%
if -5.00000000000000007e239 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 2e114Initial program 59.2%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6453.7
Applied rewrites53.7%
lift-PI.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f64N/A
Applied rewrites53.8%
if 2e114 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 35.5%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6438.6
Applied rewrites38.6%
Taylor expanded in b around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6436.3
Applied rewrites36.3%
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6463.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6463.2
Applied rewrites63.2%
Final simplification60.7%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (- (pow b 2.0) (pow a_m 2.0))))
(if (<= t_0 (- INFINITY))
(* a_m (* (* PI angle) (* a_m -0.011111111111111112)))
(if (<= t_0 2e-295)
(* (* 0.011111111111111112 (* PI angle)) (* (- b a_m) (+ a_m b)))
(* b (* b (* PI (* angle 0.011111111111111112))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = pow(b, 2.0) - pow(a_m, 2.0);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = a_m * ((((double) M_PI) * angle) * (a_m * -0.011111111111111112));
} else if (t_0 <= 2e-295) {
tmp = (0.011111111111111112 * (((double) M_PI) * angle)) * ((b - a_m) * (a_m + b));
} else {
tmp = b * (b * (((double) M_PI) * (angle * 0.011111111111111112)));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_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) * (a_m * -0.011111111111111112));
} else if (t_0 <= 2e-295) {
tmp = (0.011111111111111112 * (Math.PI * angle)) * ((b - a_m) * (a_m + b));
} else {
tmp = b * (b * (Math.PI * (angle * 0.011111111111111112)));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): t_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) * (a_m * -0.011111111111111112)) elif t_0 <= 2e-295: tmp = (0.011111111111111112 * (math.pi * angle)) * ((b - a_m) * (a_m + b)) else: tmp = b * (b * (math.pi * (angle * 0.011111111111111112))) return tmp
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64((b ^ 2.0) - (a_m ^ 2.0)) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(a_m * Float64(Float64(pi * angle) * Float64(a_m * -0.011111111111111112))); elseif (t_0 <= 2e-295) tmp = Float64(Float64(0.011111111111111112 * Float64(pi * angle)) * Float64(Float64(b - a_m) * Float64(a_m + b))); else tmp = Float64(b * Float64(b * Float64(pi * Float64(angle * 0.011111111111111112)))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) t_0 = (b ^ 2.0) - (a_m ^ 2.0); tmp = 0.0; if (t_0 <= -Inf) tmp = a_m * ((pi * angle) * (a_m * -0.011111111111111112)); elseif (t_0 <= 2e-295) tmp = (0.011111111111111112 * (pi * angle)) * ((b - a_m) * (a_m + b)); else tmp = b * (b * (pi * (angle * 0.011111111111111112))); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(a$95$m * N[(N[(Pi * angle), $MachinePrecision] * N[(a$95$m * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e-295], N[(N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(b * N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := {b}^{2} - {a\_m}^{2}\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;a\_m \cdot \left(\left(\pi \cdot angle\right) \cdot \left(a\_m \cdot -0.011111111111111112\right)\right)\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-295}:\\
\;\;\;\;\left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(\left(b - a\_m\right) \cdot \left(a\_m + b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 70.7%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6452.8
Applied rewrites52.8%
Taylor expanded in b around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6452.8
Applied rewrites52.8%
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.0
Applied rewrites66.0%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 2.00000000000000012e-295Initial program 64.5%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6459.7
Applied rewrites59.7%
if 2.00000000000000012e-295 < (-.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
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6439.9
Applied rewrites39.9%
Taylor expanded in b around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6438.1
Applied rewrites38.1%
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6458.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6458.9
Applied rewrites58.9%
Final simplification60.7%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (- (pow b 2.0) (pow a_m 2.0))))
(if (<= t_0 -1e-264)
(* a_m (* (* PI angle) (* a_m -0.011111111111111112)))
(if (<= t_0 1e+73)
(* 0.011111111111111112 (* angle (* PI (* b b))))
(* b (* b (* PI (* angle 0.011111111111111112))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = pow(b, 2.0) - pow(a_m, 2.0);
double tmp;
if (t_0 <= -1e-264) {
tmp = a_m * ((((double) M_PI) * angle) * (a_m * -0.011111111111111112));
} else if (t_0 <= 1e+73) {
tmp = 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
} else {
tmp = b * (b * (((double) M_PI) * (angle * 0.011111111111111112)));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = Math.pow(b, 2.0) - Math.pow(a_m, 2.0);
double tmp;
if (t_0 <= -1e-264) {
tmp = a_m * ((Math.PI * angle) * (a_m * -0.011111111111111112));
} else if (t_0 <= 1e+73) {
tmp = 0.011111111111111112 * (angle * (Math.PI * (b * b)));
} else {
tmp = b * (b * (Math.PI * (angle * 0.011111111111111112)));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): t_0 = math.pow(b, 2.0) - math.pow(a_m, 2.0) tmp = 0 if t_0 <= -1e-264: tmp = a_m * ((math.pi * angle) * (a_m * -0.011111111111111112)) elif t_0 <= 1e+73: tmp = 0.011111111111111112 * (angle * (math.pi * (b * b))) else: tmp = b * (b * (math.pi * (angle * 0.011111111111111112))) return tmp
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64((b ^ 2.0) - (a_m ^ 2.0)) tmp = 0.0 if (t_0 <= -1e-264) tmp = Float64(a_m * Float64(Float64(pi * angle) * Float64(a_m * -0.011111111111111112))); elseif (t_0 <= 1e+73) tmp = Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))); else tmp = Float64(b * Float64(b * Float64(pi * Float64(angle * 0.011111111111111112)))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) t_0 = (b ^ 2.0) - (a_m ^ 2.0); tmp = 0.0; if (t_0 <= -1e-264) tmp = a_m * ((pi * angle) * (a_m * -0.011111111111111112)); elseif (t_0 <= 1e+73) tmp = 0.011111111111111112 * (angle * (pi * (b * b))); else tmp = b * (b * (pi * (angle * 0.011111111111111112))); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-264], N[(a$95$m * N[(N[(Pi * angle), $MachinePrecision] * N[(a$95$m * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+73], N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(b * N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := {b}^{2} - {a\_m}^{2}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-264}:\\
\;\;\;\;a\_m \cdot \left(\left(\pi \cdot angle\right) \cdot \left(a\_m \cdot -0.011111111111111112\right)\right)\\
\mathbf{elif}\;t\_0 \leq 10^{+73}:\\
\;\;\;\;0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1e-264Initial program 64.1%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6452.6
Applied rewrites52.6%
Taylor expanded in b around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6452.3
Applied rewrites52.3%
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6458.5
Applied rewrites58.5%
if -1e-264 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 9.99999999999999983e72Initial program 65.0%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6460.8
Applied rewrites60.8%
Taylor expanded in b around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6461.2
Applied rewrites61.2%
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6461.3
Applied rewrites61.3%
if 9.99999999999999983e72 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 36.8%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6439.5
Applied rewrites39.5%
Taylor expanded in b around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6437.3
Applied rewrites37.3%
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6463.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6463.3
Applied rewrites63.3%
Final simplification60.7%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (- (pow b 2.0) (pow a_m 2.0))))
(if (<= t_0 -1e-264)
(* a_m (* (* PI angle) (* a_m -0.011111111111111112)))
(if (<= t_0 5e+24)
(* (* angle 0.011111111111111112) (* PI (* b b)))
(* (* b PI) (* b (* angle 0.011111111111111112)))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = pow(b, 2.0) - pow(a_m, 2.0);
double tmp;
if (t_0 <= -1e-264) {
tmp = a_m * ((((double) M_PI) * angle) * (a_m * -0.011111111111111112));
} else if (t_0 <= 5e+24) {
tmp = (angle * 0.011111111111111112) * (((double) M_PI) * (b * b));
} else {
tmp = (b * ((double) M_PI)) * (b * (angle * 0.011111111111111112));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = Math.pow(b, 2.0) - Math.pow(a_m, 2.0);
double tmp;
if (t_0 <= -1e-264) {
tmp = a_m * ((Math.PI * angle) * (a_m * -0.011111111111111112));
} else if (t_0 <= 5e+24) {
tmp = (angle * 0.011111111111111112) * (Math.PI * (b * b));
} else {
tmp = (b * Math.PI) * (b * (angle * 0.011111111111111112));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): t_0 = math.pow(b, 2.0) - math.pow(a_m, 2.0) tmp = 0 if t_0 <= -1e-264: tmp = a_m * ((math.pi * angle) * (a_m * -0.011111111111111112)) elif t_0 <= 5e+24: tmp = (angle * 0.011111111111111112) * (math.pi * (b * b)) else: tmp = (b * math.pi) * (b * (angle * 0.011111111111111112)) return tmp
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64((b ^ 2.0) - (a_m ^ 2.0)) tmp = 0.0 if (t_0 <= -1e-264) tmp = Float64(a_m * Float64(Float64(pi * angle) * Float64(a_m * -0.011111111111111112))); elseif (t_0 <= 5e+24) tmp = Float64(Float64(angle * 0.011111111111111112) * Float64(pi * Float64(b * b))); else tmp = Float64(Float64(b * pi) * Float64(b * Float64(angle * 0.011111111111111112))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) t_0 = (b ^ 2.0) - (a_m ^ 2.0); tmp = 0.0; if (t_0 <= -1e-264) tmp = a_m * ((pi * angle) * (a_m * -0.011111111111111112)); elseif (t_0 <= 5e+24) tmp = (angle * 0.011111111111111112) * (pi * (b * b)); else tmp = (b * pi) * (b * (angle * 0.011111111111111112)); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-264], N[(a$95$m * N[(N[(Pi * angle), $MachinePrecision] * N[(a$95$m * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+24], N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * Pi), $MachinePrecision] * N[(b * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := {b}^{2} - {a\_m}^{2}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-264}:\\
\;\;\;\;a\_m \cdot \left(\left(\pi \cdot angle\right) \cdot \left(a\_m \cdot -0.011111111111111112\right)\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+24}:\\
\;\;\;\;\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1e-264Initial program 64.1%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6452.6
Applied rewrites52.6%
Taylor expanded in b around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6452.3
Applied rewrites52.3%
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6458.5
Applied rewrites58.5%
if -1e-264 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 5.00000000000000045e24Initial program 65.3%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6461.6
Applied rewrites61.6%
Taylor expanded in b around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6462.1
Applied rewrites62.1%
if 5.00000000000000045e24 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 38.1%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6440.3
Applied rewrites40.3%
Taylor expanded in b around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6438.1
Applied rewrites38.1%
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6462.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6462.7
Applied rewrites62.7%
Final simplification60.7%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (- (pow b 2.0) (pow a_m 2.0))))
(if (<= t_0 -1e-264)
(* -0.011111111111111112 (* a_m (* a_m (* PI angle))))
(if (<= t_0 5e+24)
(* (* angle 0.011111111111111112) (* PI (* b b)))
(* (* b PI) (* b (* angle 0.011111111111111112)))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = pow(b, 2.0) - pow(a_m, 2.0);
double tmp;
if (t_0 <= -1e-264) {
tmp = -0.011111111111111112 * (a_m * (a_m * (((double) M_PI) * angle)));
} else if (t_0 <= 5e+24) {
tmp = (angle * 0.011111111111111112) * (((double) M_PI) * (b * b));
} else {
tmp = (b * ((double) M_PI)) * (b * (angle * 0.011111111111111112));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = Math.pow(b, 2.0) - Math.pow(a_m, 2.0);
double tmp;
if (t_0 <= -1e-264) {
tmp = -0.011111111111111112 * (a_m * (a_m * (Math.PI * angle)));
} else if (t_0 <= 5e+24) {
tmp = (angle * 0.011111111111111112) * (Math.PI * (b * b));
} else {
tmp = (b * Math.PI) * (b * (angle * 0.011111111111111112));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): t_0 = math.pow(b, 2.0) - math.pow(a_m, 2.0) tmp = 0 if t_0 <= -1e-264: tmp = -0.011111111111111112 * (a_m * (a_m * (math.pi * angle))) elif t_0 <= 5e+24: tmp = (angle * 0.011111111111111112) * (math.pi * (b * b)) else: tmp = (b * math.pi) * (b * (angle * 0.011111111111111112)) return tmp
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64((b ^ 2.0) - (a_m ^ 2.0)) tmp = 0.0 if (t_0 <= -1e-264) tmp = Float64(-0.011111111111111112 * Float64(a_m * Float64(a_m * Float64(pi * angle)))); elseif (t_0 <= 5e+24) tmp = Float64(Float64(angle * 0.011111111111111112) * Float64(pi * Float64(b * b))); else tmp = Float64(Float64(b * pi) * Float64(b * Float64(angle * 0.011111111111111112))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) t_0 = (b ^ 2.0) - (a_m ^ 2.0); tmp = 0.0; if (t_0 <= -1e-264) tmp = -0.011111111111111112 * (a_m * (a_m * (pi * angle))); elseif (t_0 <= 5e+24) tmp = (angle * 0.011111111111111112) * (pi * (b * b)); else tmp = (b * pi) * (b * (angle * 0.011111111111111112)); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-264], N[(-0.011111111111111112 * N[(a$95$m * N[(a$95$m * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+24], N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * Pi), $MachinePrecision] * N[(b * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := {b}^{2} - {a\_m}^{2}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-264}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(a\_m \cdot \left(a\_m \cdot \left(\pi \cdot angle\right)\right)\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+24}:\\
\;\;\;\;\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot \pi\right) \cdot \left(b \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1e-264Initial program 64.1%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6452.6
Applied rewrites52.6%
Taylor expanded in b around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6452.3
Applied rewrites52.3%
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6458.4
lift-*.f64N/A
*-commutativeN/A
lift-*.f6458.4
Applied rewrites58.4%
if -1e-264 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 5.00000000000000045e24Initial program 65.3%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6461.6
Applied rewrites61.6%
Taylor expanded in b around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6462.1
Applied rewrites62.1%
if 5.00000000000000045e24 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 38.1%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6440.3
Applied rewrites40.3%
Taylor expanded in b around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6438.1
Applied rewrites38.1%
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6462.7
lift-*.f64N/A
*-commutativeN/A
lower-*.f6462.7
Applied rewrites62.7%
Final simplification60.6%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(if (<= a_m 5.8e+250)
(*
(+ a_m b)
(*
(- b a_m)
(sin
(*
0.011111111111111112
(* angle (* (cbrt (sqrt PI)) (pow (sqrt PI) 1.6666666666666667)))))))
(*
(+ a_m b)
(*
(- b a_m)
(sin
(*
0.011111111111111112
(* angle (* (sqrt (* PI (sqrt PI))) (sqrt (sqrt PI))))))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if (a_m <= 5.8e+250) {
tmp = (a_m + b) * ((b - a_m) * sin((0.011111111111111112 * (angle * (cbrt(sqrt(((double) M_PI))) * pow(sqrt(((double) M_PI)), 1.6666666666666667))))));
} else {
tmp = (a_m + b) * ((b - a_m) * sin((0.011111111111111112 * (angle * (sqrt((((double) M_PI) * sqrt(((double) M_PI)))) * sqrt(sqrt(((double) M_PI))))))));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double tmp;
if (a_m <= 5.8e+250) {
tmp = (a_m + b) * ((b - a_m) * Math.sin((0.011111111111111112 * (angle * (Math.cbrt(Math.sqrt(Math.PI)) * Math.pow(Math.sqrt(Math.PI), 1.6666666666666667))))));
} else {
tmp = (a_m + b) * ((b - a_m) * Math.sin((0.011111111111111112 * (angle * (Math.sqrt((Math.PI * Math.sqrt(Math.PI))) * Math.sqrt(Math.sqrt(Math.PI)))))));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (a_m <= 5.8e+250) tmp = Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * sin(Float64(0.011111111111111112 * Float64(angle * Float64(cbrt(sqrt(pi)) * (sqrt(pi) ^ 1.6666666666666667))))))); else tmp = Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * sin(Float64(0.011111111111111112 * Float64(angle * Float64(sqrt(Float64(pi * sqrt(pi))) * sqrt(sqrt(pi)))))))); end return tmp end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[a$95$m, 5.8e+250], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[Sin[N[(0.011111111111111112 * N[(angle * N[(N[Power[N[Sqrt[Pi], $MachinePrecision], 1/3], $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 1.6666666666666667], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[Sin[N[(0.011111111111111112 * N[(angle * N[(N[Sqrt[N[(Pi * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sqrt[N[Sqrt[Pi], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 5.8 \cdot 10^{+250}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \left(\sqrt[3]{\sqrt{\pi}} \cdot {\left(\sqrt{\pi}\right)}^{1.6666666666666667}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \left(\sqrt{\pi \cdot \sqrt{\pi}} \cdot \sqrt{\sqrt{\pi}}\right)\right)\right)\right)\\
\end{array}
\end{array}
if a < 5.80000000000000018e250Initial program 53.1%
Applied rewrites68.6%
add-cbrt-cubeN/A
pow1/3N/A
add-sqr-sqrtN/A
associate-*r*N/A
unpow-prod-downN/A
pow1/3N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6471.5
Applied rewrites71.5%
lift-PI.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lift-sqrt.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
unpow-prod-downN/A
pow1/3N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
pow3N/A
rem-cbrt-cubeN/A
pow1/3N/A
lift-PI.f64N/A
Applied rewrites71.5%
lift-PI.f64N/A
pow1/2N/A
lift-PI.f64N/A
pow1/3N/A
pow-prod-upN/A
unpow1N/A
metadata-evalN/A
sqrt-pow2N/A
lift-sqrt.f64N/A
pow-powN/A
lower-pow.f64N/A
metadata-evalN/A
metadata-eval71.5
Applied rewrites71.5%
if 5.80000000000000018e250 < a Initial program 72.2%
Applied rewrites66.7%
lift-PI.f6466.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.f6488.9
Applied rewrites88.9%
Final simplification72.8%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(if (<= (pow b 2.0) 4e+41)
(* (- b a_m) (* (+ a_m b) (sin (* PI (* angle 0.011111111111111112)))))
(*
(+ a_m b)
(*
(- b a_m)
(*
angle
(fma
-2.2862368541380886e-7
(* (* angle angle) (* PI (* PI PI)))
(* PI 0.011111111111111112)))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if (pow(b, 2.0) <= 4e+41) {
tmp = (b - a_m) * ((a_m + b) * sin((((double) M_PI) * (angle * 0.011111111111111112))));
} else {
tmp = (a_m + b) * ((b - a_m) * (angle * fma(-2.2862368541380886e-7, ((angle * angle) * (((double) M_PI) * (((double) M_PI) * ((double) M_PI)))), (((double) M_PI) * 0.011111111111111112))));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if ((b ^ 2.0) <= 4e+41) tmp = Float64(Float64(b - a_m) * Float64(Float64(a_m + b) * sin(Float64(pi * Float64(angle * 0.011111111111111112))))); else tmp = Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(angle * fma(-2.2862368541380886e-7, Float64(Float64(angle * angle) * Float64(pi * Float64(pi * pi))), Float64(pi * 0.011111111111111112))))); end return tmp end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 4e+41], N[(N[(b - a$95$m), $MachinePrecision] * N[(N[(a$95$m + b), $MachinePrecision] * N[Sin[N[(Pi * N[(angle * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(angle * N[(-2.2862368541380886e-7 * N[(N[(angle * angle), $MachinePrecision] * N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 4 \cdot 10^{+41}:\\
\;\;\;\;\left(b - a\_m\right) \cdot \left(\left(a\_m + b\right) \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(angle \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, \left(angle \cdot angle\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), \pi \cdot 0.011111111111111112\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 4.00000000000000002e41Initial program 62.7%
Applied rewrites65.7%
lift-+.f64N/A
lift--.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6465.7
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6465.9
Applied rewrites65.9%
if 4.00000000000000002e41 < (pow.f64 b #s(literal 2 binary64)) Initial program 45.1%
Applied rewrites71.5%
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.f6476.8
Applied rewrites76.8%
Final simplification71.0%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(if (<= (pow b 2.0) 2e+81)
(* (+ a_m b) (* (- b a_m) (sin (* 0.011111111111111112 (* PI angle)))))
(*
(+ a_m b)
(*
(- b a_m)
(*
angle
(fma
-2.2862368541380886e-7
(* (* angle angle) (* PI (* PI PI)))
(* PI 0.011111111111111112)))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if (pow(b, 2.0) <= 2e+81) {
tmp = (a_m + b) * ((b - a_m) * sin((0.011111111111111112 * (((double) M_PI) * angle))));
} else {
tmp = (a_m + b) * ((b - a_m) * (angle * fma(-2.2862368541380886e-7, ((angle * angle) * (((double) M_PI) * (((double) M_PI) * ((double) M_PI)))), (((double) M_PI) * 0.011111111111111112))));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if ((b ^ 2.0) <= 2e+81) tmp = Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * sin(Float64(0.011111111111111112 * Float64(pi * angle))))); else tmp = Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(angle * fma(-2.2862368541380886e-7, Float64(Float64(angle * angle) * Float64(pi * Float64(pi * pi))), Float64(pi * 0.011111111111111112))))); end return tmp end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 2e+81], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[Sin[N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(angle * N[(-2.2862368541380886e-7 * N[(N[(angle * angle), $MachinePrecision] * N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 2 \cdot 10^{+81}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(angle \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7}, \left(angle \cdot angle\right) \cdot \left(\pi \cdot \left(\pi \cdot \pi\right)\right), \pi \cdot 0.011111111111111112\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 1.99999999999999984e81Initial program 63.9%
Applied rewrites68.1%
if 1.99999999999999984e81 < (pow.f64 b #s(literal 2 binary64)) Initial program 41.8%
Applied rewrites68.9%
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.f6474.7
Applied rewrites74.7%
Final simplification70.9%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(if (<= (pow b 2.0) 4e-116)
(* (+ a_m b) (* (sin (* 0.011111111111111112 (* PI angle))) (- a_m)))
(*
(+ a_m b)
(*
(- b a_m)
(*
angle
(*
PI
(fma
(* -2.2862368541380886e-7 (* angle angle))
(* PI PI)
0.011111111111111112)))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if (pow(b, 2.0) <= 4e-116) {
tmp = (a_m + b) * (sin((0.011111111111111112 * (((double) M_PI) * angle))) * -a_m);
} else {
tmp = (a_m + b) * ((b - a_m) * (angle * (((double) M_PI) * fma((-2.2862368541380886e-7 * (angle * angle)), (((double) M_PI) * ((double) M_PI)), 0.011111111111111112))));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if ((b ^ 2.0) <= 4e-116) tmp = Float64(Float64(a_m + b) * Float64(sin(Float64(0.011111111111111112 * Float64(pi * angle))) * Float64(-a_m))); else tmp = Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(angle * Float64(pi * fma(Float64(-2.2862368541380886e-7 * Float64(angle * angle)), Float64(pi * pi), 0.011111111111111112))))); end return tmp end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 4e-116], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[Sin[N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * (-a$95$m)), $MachinePrecision]), $MachinePrecision], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(angle * N[(Pi * N[(N[(-2.2862368541380886e-7 * N[(angle * angle), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} \leq 4 \cdot 10^{-116}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(-a\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \pi \cdot \pi, 0.011111111111111112\right)\right)\right)\right)\\
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 4e-116Initial program 63.0%
Applied rewrites65.5%
Taylor expanded in b around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
mul-1-negN/A
lower-neg.f6464.4
Applied rewrites64.4%
if 4e-116 < (pow.f64 b #s(literal 2 binary64)) Initial program 47.0%
Applied rewrites71.0%
add-cbrt-cubeN/A
pow1/3N/A
add-sqr-sqrtN/A
associate-*r*N/A
unpow-prod-downN/A
pow1/3N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6479.0
Applied rewrites79.0%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites75.1%
Final simplification70.2%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= (- (pow b 2.0) (pow a_m 2.0)) -1e-264) (* -0.011111111111111112 (* a_m (* a_m (* PI angle)))) (* (* angle 0.011111111111111112) (* PI (* b b)))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if ((pow(b, 2.0) - pow(a_m, 2.0)) <= -1e-264) {
tmp = -0.011111111111111112 * (a_m * (a_m * (((double) M_PI) * angle)));
} else {
tmp = (angle * 0.011111111111111112) * (((double) M_PI) * (b * b));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a_m, 2.0)) <= -1e-264) {
tmp = -0.011111111111111112 * (a_m * (a_m * (Math.PI * angle)));
} else {
tmp = (angle * 0.011111111111111112) * (Math.PI * (b * b));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): tmp = 0 if (math.pow(b, 2.0) - math.pow(a_m, 2.0)) <= -1e-264: tmp = -0.011111111111111112 * (a_m * (a_m * (math.pi * angle))) else: tmp = (angle * 0.011111111111111112) * (math.pi * (b * b)) return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (Float64((b ^ 2.0) - (a_m ^ 2.0)) <= -1e-264) tmp = Float64(-0.011111111111111112 * Float64(a_m * Float64(a_m * Float64(pi * angle)))); else tmp = Float64(Float64(angle * 0.011111111111111112) * Float64(pi * Float64(b * b))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) tmp = 0.0; if (((b ^ 2.0) - (a_m ^ 2.0)) <= -1e-264) tmp = -0.011111111111111112 * (a_m * (a_m * (pi * angle))); else tmp = (angle * 0.011111111111111112) * (pi * (b * b)); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision], -1e-264], N[(-0.011111111111111112 * N[(a$95$m * N[(a$95$m * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -1 \cdot 10^{-264}:\\
\;\;\;\;-0.011111111111111112 \cdot \left(a\_m \cdot \left(a\_m \cdot \left(\pi \cdot angle\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1e-264Initial program 64.1%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6452.6
Applied rewrites52.6%
Taylor expanded in b around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6452.3
Applied rewrites52.3%
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6458.4
lift-*.f64N/A
*-commutativeN/A
lift-*.f6458.4
Applied rewrites58.4%
if -1e-264 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 45.9%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6446.4
Applied rewrites46.4%
Taylor expanded in b around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6445.0
Applied rewrites45.0%
Final simplification51.3%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= (- (pow b 2.0) (pow a_m 2.0)) -1e-264) (* (* PI angle) (* (* a_m a_m) -0.011111111111111112)) (* (* angle 0.011111111111111112) (* PI (* b b)))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if ((pow(b, 2.0) - pow(a_m, 2.0)) <= -1e-264) {
tmp = (((double) M_PI) * angle) * ((a_m * a_m) * -0.011111111111111112);
} else {
tmp = (angle * 0.011111111111111112) * (((double) M_PI) * (b * b));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a_m, 2.0)) <= -1e-264) {
tmp = (Math.PI * angle) * ((a_m * a_m) * -0.011111111111111112);
} else {
tmp = (angle * 0.011111111111111112) * (Math.PI * (b * b));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): tmp = 0 if (math.pow(b, 2.0) - math.pow(a_m, 2.0)) <= -1e-264: tmp = (math.pi * angle) * ((a_m * a_m) * -0.011111111111111112) else: tmp = (angle * 0.011111111111111112) * (math.pi * (b * b)) return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (Float64((b ^ 2.0) - (a_m ^ 2.0)) <= -1e-264) tmp = Float64(Float64(pi * angle) * Float64(Float64(a_m * a_m) * -0.011111111111111112)); else tmp = Float64(Float64(angle * 0.011111111111111112) * Float64(pi * Float64(b * b))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) tmp = 0.0; if (((b ^ 2.0) - (a_m ^ 2.0)) <= -1e-264) tmp = (pi * angle) * ((a_m * a_m) * -0.011111111111111112); else tmp = (angle * 0.011111111111111112) * (pi * (b * b)); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision], -1e-264], N[(N[(Pi * angle), $MachinePrecision] * N[(N[(a$95$m * a$95$m), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(N[(angle * 0.011111111111111112), $MachinePrecision] * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -1 \cdot 10^{-264}:\\
\;\;\;\;\left(\pi \cdot angle\right) \cdot \left(\left(a\_m \cdot a\_m\right) \cdot -0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;\left(angle \cdot 0.011111111111111112\right) \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1e-264Initial program 64.1%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6452.6
Applied rewrites52.6%
Taylor expanded in b around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6452.3
Applied rewrites52.3%
if -1e-264 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 45.9%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6446.4
Applied rewrites46.4%
Taylor expanded in b around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6445.0
Applied rewrites45.0%
Final simplification48.4%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(if (<= b 6.5e-168)
(* (sin (* 0.011111111111111112 (* PI angle))) (* a_m (- a_m)))
(*
(+ a_m b)
(*
(- b a_m)
(*
angle
(*
PI
(fma
(* -2.2862368541380886e-7 (* angle angle))
(* PI PI)
0.011111111111111112)))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if (b <= 6.5e-168) {
tmp = sin((0.011111111111111112 * (((double) M_PI) * angle))) * (a_m * -a_m);
} else {
tmp = (a_m + b) * ((b - a_m) * (angle * (((double) M_PI) * fma((-2.2862368541380886e-7 * (angle * angle)), (((double) M_PI) * ((double) M_PI)), 0.011111111111111112))));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (b <= 6.5e-168) tmp = Float64(sin(Float64(0.011111111111111112 * Float64(pi * angle))) * Float64(a_m * Float64(-a_m))); else tmp = Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(angle * Float64(pi * fma(Float64(-2.2862368541380886e-7 * Float64(angle * angle)), Float64(pi * pi), 0.011111111111111112))))); end return tmp end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[b, 6.5e-168], N[(N[Sin[N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(a$95$m * (-a$95$m)), $MachinePrecision]), $MachinePrecision], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(angle * N[(Pi * N[(N[(-2.2862368541380886e-7 * N[(angle * angle), $MachinePrecision]), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision] + 0.011111111111111112), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;b \leq 6.5 \cdot 10^{-168}:\\
\;\;\;\;\sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(a\_m \cdot \left(-a\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(angle \cdot \left(\pi \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \pi \cdot \pi, 0.011111111111111112\right)\right)\right)\right)\\
\end{array}
\end{array}
if b < 6.4999999999999997e-168Initial program 58.7%
Applied rewrites70.3%
Taylor expanded in b around 0
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6446.2
Applied rewrites46.2%
if 6.4999999999999997e-168 < b Initial program 47.7%
Applied rewrites65.5%
add-cbrt-cubeN/A
pow1/3N/A
add-sqr-sqrtN/A
associate-*r*N/A
unpow-prod-downN/A
pow1/3N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6472.3
Applied rewrites72.3%
Taylor expanded in angle around 0
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
Applied rewrites72.2%
Final simplification56.4%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= (/ angle 180.0) 1.2e+122) (* (+ a_m b) (* 0.011111111111111112 (* angle (* (- b a_m) PI)))) (- (* (* 0.011111111111111112 (* PI angle)) (* a_m (+ a_m b))))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 1.2e+122) {
tmp = (a_m + b) * (0.011111111111111112 * (angle * ((b - a_m) * ((double) M_PI))));
} else {
tmp = -((0.011111111111111112 * (((double) M_PI) * angle)) * (a_m * (a_m + b)));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 1.2e+122) {
tmp = (a_m + b) * (0.011111111111111112 * (angle * ((b - a_m) * Math.PI)));
} else {
tmp = -((0.011111111111111112 * (Math.PI * angle)) * (a_m * (a_m + b)));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): tmp = 0 if (angle / 180.0) <= 1.2e+122: tmp = (a_m + b) * (0.011111111111111112 * (angle * ((b - a_m) * math.pi))) else: tmp = -((0.011111111111111112 * (math.pi * angle)) * (a_m * (a_m + b))) return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 1.2e+122) tmp = Float64(Float64(a_m + b) * Float64(0.011111111111111112 * Float64(angle * Float64(Float64(b - a_m) * pi)))); else tmp = Float64(-Float64(Float64(0.011111111111111112 * Float64(pi * angle)) * Float64(a_m * Float64(a_m + b)))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) tmp = 0.0; if ((angle / 180.0) <= 1.2e+122) tmp = (a_m + b) * (0.011111111111111112 * (angle * ((b - a_m) * pi))); else tmp = -((0.011111111111111112 * (pi * angle)) * (a_m * (a_m + b))); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1.2e+122], N[(N[(a$95$m + b), $MachinePrecision] * N[(0.011111111111111112 * N[(angle * N[(N[(b - a$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision] * N[(a$95$m * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 1.2 \cdot 10^{+122}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(0.011111111111111112 \cdot \left(angle \cdot \left(\left(b - a\_m\right) \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-\left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right) \cdot \left(a\_m \cdot \left(a\_m + b\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.2000000000000001e122Initial program 61.2%
Applied rewrites77.4%
add-cbrt-cubeN/A
pow1/3N/A
add-sqr-sqrtN/A
associate-*r*N/A
unpow-prod-downN/A
pow1/3N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lift-PI.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6478.6
Applied rewrites78.6%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6470.4
Applied rewrites70.4%
if 1.2000000000000001e122 < (/.f64 angle #s(literal 180 binary64)) Initial program 26.4%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6415.4
Applied rewrites15.4%
Taylor expanded in b around 0
mul-1-negN/A
lower-neg.f6420.2
Applied rewrites20.2%
Final simplification60.6%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (* (* PI angle) (* (* a_m a_m) -0.011111111111111112)))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
return (((double) M_PI) * angle) * ((a_m * a_m) * -0.011111111111111112);
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
return (Math.PI * angle) * ((a_m * a_m) * -0.011111111111111112);
}
a_m = math.fabs(a) def code(a_m, b, angle): return (math.pi * angle) * ((a_m * a_m) * -0.011111111111111112)
a_m = abs(a) function code(a_m, b, angle) return Float64(Float64(pi * angle) * Float64(Float64(a_m * a_m) * -0.011111111111111112)) end
a_m = abs(a); function tmp = code(a_m, b, angle) tmp = (pi * angle) * ((a_m * a_m) * -0.011111111111111112); end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := N[(N[(Pi * angle), $MachinePrecision] * N[(N[(a$95$m * a$95$m), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
\left(\pi \cdot angle\right) \cdot \left(\left(a\_m \cdot a\_m\right) \cdot -0.011111111111111112\right)
\end{array}
Initial program 54.4%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6449.3
Applied rewrites49.3%
Taylor expanded in b around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6435.4
Applied rewrites35.4%
Final simplification35.4%
herbie shell --seed 2024219
(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)))))