
(FPCore (a b angle) :precision binary64 (let* ((t_0 (* PI (/ angle 180.0)))) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin t_0)) (cos t_0))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (angle / 180.0);
return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin(t_0)) * cos(t_0);
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (angle / 180.0);
return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin(t_0)) * Math.cos(t_0);
}
def code(a, b, angle): t_0 = math.pi * (angle / 180.0) return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin(t_0)) * math.cos(t_0)
function code(a, b, angle) t_0 = Float64(pi * Float64(angle / 180.0)) return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0)) end
function tmp = code(a, b, angle) t_0 = pi * (angle / 180.0); tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin(t_0)) * cos(t_0); end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$0], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \frac{angle}{180}\\
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin t\_0\right) \cdot \cos t\_0
\end{array}
\end{array}
Herbie found 13 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}
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 2.0 (- (pow b 2.0) (pow a 2.0))))
(t_1 (* (sqrt 0.005555555555555556) (sqrt (fabs angle)))))
(if (<= t_0 1e-311)
(*
(*
(* (* (sin (* (* PI angle) 0.005555555555555556)) a) a)
(cos (* (* PI 0.005555555555555556) (fabs angle))))
-2.0)
(if (<= t_0 INFINITY)
(*
(* (* 2.0 (* b b)) (sin (* PI (/ angle 180.0))))
(sin (fma (* t_1 t_1) PI (/ PI 2.0))))
(*
(*
(* (* (* (+ (/ 1.0 a) (/ (- a) (* b b))) (* b b)) a) 2.0)
(sin (* (* 0.005555555555555556 angle) PI)))
1.0)))))
double code(double a, double b, double angle) {
double t_0 = 2.0 * (pow(b, 2.0) - pow(a, 2.0));
double t_1 = sqrt(0.005555555555555556) * sqrt(fabs(angle));
double tmp;
if (t_0 <= 1e-311) {
tmp = (((sin(((((double) M_PI) * angle) * 0.005555555555555556)) * a) * a) * cos(((((double) M_PI) * 0.005555555555555556) * fabs(angle)))) * -2.0;
} else if (t_0 <= ((double) INFINITY)) {
tmp = ((2.0 * (b * b)) * sin((((double) M_PI) * (angle / 180.0)))) * sin(fma((t_1 * t_1), ((double) M_PI), (((double) M_PI) / 2.0)));
} else {
tmp = ((((((1.0 / a) + (-a / (b * b))) * (b * b)) * a) * 2.0) * sin(((0.005555555555555556 * angle) * ((double) M_PI)))) * 1.0;
}
return tmp;
}
function code(a, b, angle) t_0 = Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) t_1 = Float64(sqrt(0.005555555555555556) * sqrt(abs(angle))) tmp = 0.0 if (t_0 <= 1e-311) tmp = Float64(Float64(Float64(Float64(sin(Float64(Float64(pi * angle) * 0.005555555555555556)) * a) * a) * cos(Float64(Float64(pi * 0.005555555555555556) * abs(angle)))) * -2.0); elseif (t_0 <= Inf) tmp = Float64(Float64(Float64(2.0 * Float64(b * b)) * sin(Float64(pi * Float64(angle / 180.0)))) * sin(fma(Float64(t_1 * t_1), pi, Float64(pi / 2.0)))); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(1.0 / a) + Float64(Float64(-a) / Float64(b * b))) * Float64(b * b)) * a) * 2.0) * sin(Float64(Float64(0.005555555555555556 * angle) * pi))) * 1.0); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[0.005555555555555556], $MachinePrecision] * N[Sqrt[N[Abs[angle], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-311], N[(N[(N[(N[(N[Sin[N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision] * N[Cos[N[(N[(Pi * 0.005555555555555556), $MachinePrecision] * N[Abs[angle], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[(N[(N[(2.0 * N[(b * b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(t$95$1 * t$95$1), $MachinePrecision] * Pi + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(1.0 / a), $MachinePrecision] + N[((-a) / N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision] * 2.0), $MachinePrecision] * N[Sin[N[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \left({b}^{2} - {a}^{2}\right)\\
t_1 := \sqrt{0.005555555555555556} \cdot \sqrt{\left|angle\right|}\\
\mathbf{if}\;t\_0 \leq 10^{-311}:\\
\;\;\;\;\left(\left(\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot a\right) \cdot a\right) \cdot \cos \left(\left(\pi \cdot 0.005555555555555556\right) \cdot \left|angle\right|\right)\right) \cdot -2\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\left(\left(2 \cdot \left(b \cdot b\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \sin \left(\mathsf{fma}\left(t\_1 \cdot t\_1, \pi, \frac{\pi}{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\frac{1}{a} + \frac{-a}{b \cdot b}\right) \cdot \left(b \cdot b\right)\right) \cdot a\right) \cdot 2\right) \cdot \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)\right) \cdot 1\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < 9.99999999999948e-312Initial program 54.1%
lift-cos.f64N/A
cos-fabs-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
fabs-mulN/A
add-exp-logN/A
exp-fabsN/A
add-exp-logN/A
lower-fma.f64N/A
lower-fabs.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-/.f64N/A
lift-PI.f6454.3
Applied rewrites54.3%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6426.7
Applied rewrites26.7%
lift-*.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
sqrt-unprodN/A
rem-sqrt-square-revN/A
fabs-mulN/A
metadata-evalN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-fabs.f6426.7
Applied rewrites26.7%
lift-*.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
sqrt-unprodN/A
rem-sqrt-square-revN/A
fabs-mulN/A
metadata-evalN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-fabs.f6454.1
Applied rewrites54.1%
Taylor expanded in a around inf
Applied rewrites40.7%
if 9.99999999999948e-312 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < +inf.0Initial program 54.1%
lift-cos.f64N/A
cos-fabs-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
fabs-mulN/A
add-exp-logN/A
exp-fabsN/A
add-exp-logN/A
lower-fma.f64N/A
lower-fabs.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-/.f64N/A
lift-PI.f6454.3
Applied rewrites54.3%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6426.7
Applied rewrites26.7%
lift-*.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
sqrt-unprodN/A
rem-sqrt-square-revN/A
fabs-mulN/A
metadata-evalN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-fabs.f6426.7
Applied rewrites26.7%
lift-*.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
sqrt-unprodN/A
rem-sqrt-square-revN/A
fabs-mulN/A
metadata-evalN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-fabs.f6454.1
Applied rewrites54.1%
Taylor expanded in a around 0
pow2N/A
lower-*.f6436.7
Applied rewrites36.7%
if +inf.0 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 54.1%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
sub-flipN/A
unpow2N/A
unpow2N/A
times-fracN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6447.2
Applied rewrites47.2%
Taylor expanded in angle around 0
Applied rewrites46.3%
Applied rewrites49.9%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lower-*.f6436.1
Applied rewrites36.1%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (sin (* (* 0.005555555555555556 angle) PI)))
(t_1 (* 2.0 (- (pow b 2.0) (pow a 2.0))))
(t_2 (sqrt (* 0.005555555555555556 angle))))
(if (<= t_1 2e-168)
(*
(*
(* (* (sin (* (* PI angle) 0.005555555555555556)) a) a)
(cos (* (* PI 0.005555555555555556) (fabs angle))))
-2.0)
(if (<= t_1 INFINITY)
(* (* (* t_0 (* b b)) 2.0) (sin (fma (* t_2 t_2) PI (/ PI 2.0))))
(*
(* (* (* (* (+ (/ 1.0 a) (/ (- a) (* b b))) (* b b)) a) 2.0) t_0)
1.0)))))
double code(double a, double b, double angle) {
double t_0 = sin(((0.005555555555555556 * angle) * ((double) M_PI)));
double t_1 = 2.0 * (pow(b, 2.0) - pow(a, 2.0));
double t_2 = sqrt((0.005555555555555556 * angle));
double tmp;
if (t_1 <= 2e-168) {
tmp = (((sin(((((double) M_PI) * angle) * 0.005555555555555556)) * a) * a) * cos(((((double) M_PI) * 0.005555555555555556) * fabs(angle)))) * -2.0;
} else if (t_1 <= ((double) INFINITY)) {
tmp = ((t_0 * (b * b)) * 2.0) * sin(fma((t_2 * t_2), ((double) M_PI), (((double) M_PI) / 2.0)));
} else {
tmp = ((((((1.0 / a) + (-a / (b * b))) * (b * b)) * a) * 2.0) * t_0) * 1.0;
}
return tmp;
}
function code(a, b, angle) t_0 = sin(Float64(Float64(0.005555555555555556 * angle) * pi)) t_1 = Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) t_2 = sqrt(Float64(0.005555555555555556 * angle)) tmp = 0.0 if (t_1 <= 2e-168) tmp = Float64(Float64(Float64(Float64(sin(Float64(Float64(pi * angle) * 0.005555555555555556)) * a) * a) * cos(Float64(Float64(pi * 0.005555555555555556) * abs(angle)))) * -2.0); elseif (t_1 <= Inf) tmp = Float64(Float64(Float64(t_0 * Float64(b * b)) * 2.0) * sin(fma(Float64(t_2 * t_2), pi, Float64(pi / 2.0)))); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(1.0 / a) + Float64(Float64(-a) / Float64(b * b))) * Float64(b * b)) * a) * 2.0) * t_0) * 1.0); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[Sin[N[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(0.005555555555555556 * angle), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 2e-168], N[(N[(N[(N[(N[Sin[N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision] * N[Cos[N[(N[(Pi * 0.005555555555555556), $MachinePrecision] * N[Abs[angle], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(N[(t$95$0 * N[(b * b), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * N[Sin[N[(N[(t$95$2 * t$95$2), $MachinePrecision] * Pi + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(1.0 / a), $MachinePrecision] + N[((-a) / N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision] * 2.0), $MachinePrecision] * t$95$0), $MachinePrecision] * 1.0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)\\
t_1 := 2 \cdot \left({b}^{2} - {a}^{2}\right)\\
t_2 := \sqrt{0.005555555555555556 \cdot angle}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{-168}:\\
\;\;\;\;\left(\left(\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot a\right) \cdot a\right) \cdot \cos \left(\left(\pi \cdot 0.005555555555555556\right) \cdot \left|angle\right|\right)\right) \cdot -2\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\left(\left(t\_0 \cdot \left(b \cdot b\right)\right) \cdot 2\right) \cdot \sin \left(\mathsf{fma}\left(t\_2 \cdot t\_2, \pi, \frac{\pi}{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(\left(\frac{1}{a} + \frac{-a}{b \cdot b}\right) \cdot \left(b \cdot b\right)\right) \cdot a\right) \cdot 2\right) \cdot t\_0\right) \cdot 1\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < 2.0000000000000001e-168Initial program 54.1%
lift-cos.f64N/A
cos-fabs-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
fabs-mulN/A
add-exp-logN/A
exp-fabsN/A
add-exp-logN/A
lower-fma.f64N/A
lower-fabs.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-/.f64N/A
lift-PI.f6454.3
Applied rewrites54.3%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6426.7
Applied rewrites26.7%
lift-*.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
sqrt-unprodN/A
rem-sqrt-square-revN/A
fabs-mulN/A
metadata-evalN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-fabs.f6426.7
Applied rewrites26.7%
lift-*.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
sqrt-unprodN/A
rem-sqrt-square-revN/A
fabs-mulN/A
metadata-evalN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-fabs.f6454.1
Applied rewrites54.1%
Taylor expanded in a around inf
Applied rewrites40.7%
if 2.0000000000000001e-168 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < +inf.0Initial program 54.1%
lift-cos.f64N/A
cos-fabs-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
fabs-mulN/A
add-exp-logN/A
exp-fabsN/A
add-exp-logN/A
lower-fma.f64N/A
lower-fabs.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-/.f64N/A
lift-PI.f6454.3
Applied rewrites54.3%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6426.7
Applied rewrites26.7%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
rem-square-sqrtN/A
lower-sin.f64N/A
lower-*.f64N/A
rem-square-sqrtN/A
lift-*.f64N/A
lift-PI.f64N/A
pow2N/A
lower-*.f6417.9
Applied rewrites17.9%
if +inf.0 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 54.1%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
sub-flipN/A
unpow2N/A
unpow2N/A
times-fracN/A
metadata-evalN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f64N/A
unpow2N/A
lower-*.f6447.2
Applied rewrites47.2%
Taylor expanded in angle around 0
Applied rewrites46.3%
Applied rewrites49.9%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lower-*.f6436.1
Applied rewrites36.1%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (sqrt (* 0.005555555555555556 angle))))
(if (<= a 3.3e+153)
(*
(*
(* 2.0 (- (/ 1.0 (/ 1.0 (* b b))) (pow a 2.0)))
(sin (* PI (/ angle 180.0))))
(sin (fma (* t_0 t_0) PI (/ PI 2.0))))
(* (* -0.011111111111111112 a) (* a (* PI angle))))))
double code(double a, double b, double angle) {
double t_0 = sqrt((0.005555555555555556 * angle));
double tmp;
if (a <= 3.3e+153) {
tmp = ((2.0 * ((1.0 / (1.0 / (b * b))) - pow(a, 2.0))) * sin((((double) M_PI) * (angle / 180.0)))) * sin(fma((t_0 * t_0), ((double) M_PI), (((double) M_PI) / 2.0)));
} else {
tmp = (-0.011111111111111112 * a) * (a * (((double) M_PI) * angle));
}
return tmp;
}
function code(a, b, angle) t_0 = sqrt(Float64(0.005555555555555556 * angle)) tmp = 0.0 if (a <= 3.3e+153) tmp = Float64(Float64(Float64(2.0 * Float64(Float64(1.0 / Float64(1.0 / Float64(b * b))) - (a ^ 2.0))) * sin(Float64(pi * Float64(angle / 180.0)))) * sin(fma(Float64(t_0 * t_0), pi, Float64(pi / 2.0)))); else tmp = Float64(Float64(-0.011111111111111112 * a) * Float64(a * Float64(pi * angle))); end return tmp end
code[a_, b_, angle_] := Block[{t$95$0 = N[Sqrt[N[(0.005555555555555556 * angle), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[a, 3.3e+153], N[(N[(N[(2.0 * N[(N[(1.0 / N[(1.0 / N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(t$95$0 * t$95$0), $MachinePrecision] * Pi + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(-0.011111111111111112 * a), $MachinePrecision] * N[(a * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{0.005555555555555556 \cdot angle}\\
\mathbf{if}\;a \leq 3.3 \cdot 10^{+153}:\\
\;\;\;\;\left(\left(2 \cdot \left(\frac{1}{\frac{1}{b \cdot b}} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \sin \left(\mathsf{fma}\left(t\_0 \cdot t\_0, \pi, \frac{\pi}{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\right) \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\\
\end{array}
\end{array}
if a < 3.29999999999999994e153Initial program 54.1%
lift-cos.f64N/A
cos-fabs-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
fabs-mulN/A
add-exp-logN/A
exp-fabsN/A
add-exp-logN/A
lower-fma.f64N/A
lower-fabs.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-/.f64N/A
lift-PI.f6454.3
Applied rewrites54.3%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6426.7
Applied rewrites26.7%
lift-pow.f64N/A
metadata-evalN/A
pow-negN/A
metadata-evalN/A
pow-flipN/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
lower-*.f6426.7
Applied rewrites26.7%
if 3.29999999999999994e153 < a Initial program 54.1%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6450.9
Applied rewrites50.9%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6434.6
Applied rewrites34.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f6437.8
Applied rewrites37.8%
(FPCore (a b angle)
:precision binary64
(if (<= (* 2.0 (- (pow b 2.0) (pow a 2.0))) 1e-291)
(*
(*
(* (* (sin (* (* PI angle) 0.005555555555555556)) a) a)
(cos (* (* PI 0.005555555555555556) (fabs angle))))
-2.0)
(*
(* (* 2.0 (* b b)) (sin (* PI (/ angle 180.0))))
(cos (* (* 0.005555555555555556 angle) PI)))))
double code(double a, double b, double angle) {
double tmp;
if ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) <= 1e-291) {
tmp = (((sin(((((double) M_PI) * angle) * 0.005555555555555556)) * a) * a) * cos(((((double) M_PI) * 0.005555555555555556) * fabs(angle)))) * -2.0;
} else {
tmp = ((2.0 * (b * b)) * sin((((double) M_PI) * (angle / 180.0)))) * cos(((0.005555555555555556 * angle) * ((double) M_PI)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) <= 1e-291) {
tmp = (((Math.sin(((Math.PI * angle) * 0.005555555555555556)) * a) * a) * Math.cos(((Math.PI * 0.005555555555555556) * Math.abs(angle)))) * -2.0;
} else {
tmp = ((2.0 * (b * b)) * Math.sin((Math.PI * (angle / 180.0)))) * Math.cos(((0.005555555555555556 * angle) * Math.PI));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if (2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) <= 1e-291: tmp = (((math.sin(((math.pi * angle) * 0.005555555555555556)) * a) * a) * math.cos(((math.pi * 0.005555555555555556) * math.fabs(angle)))) * -2.0 else: tmp = ((2.0 * (b * b)) * math.sin((math.pi * (angle / 180.0)))) * math.cos(((0.005555555555555556 * angle) * math.pi)) return tmp
function code(a, b, angle) tmp = 0.0 if (Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) <= 1e-291) tmp = Float64(Float64(Float64(Float64(sin(Float64(Float64(pi * angle) * 0.005555555555555556)) * a) * a) * cos(Float64(Float64(pi * 0.005555555555555556) * abs(angle)))) * -2.0); else tmp = Float64(Float64(Float64(2.0 * Float64(b * b)) * sin(Float64(pi * Float64(angle / 180.0)))) * cos(Float64(Float64(0.005555555555555556 * angle) * pi))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) <= 1e-291) tmp = (((sin(((pi * angle) * 0.005555555555555556)) * a) * a) * cos(((pi * 0.005555555555555556) * abs(angle)))) * -2.0; else tmp = ((2.0 * (b * b)) * sin((pi * (angle / 180.0)))) * cos(((0.005555555555555556 * angle) * pi)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e-291], N[(N[(N[(N[(N[Sin[N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision] * N[Cos[N[(N[(Pi * 0.005555555555555556), $MachinePrecision] * N[Abs[angle], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], N[(N[(N[(2.0 * N[(b * b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot \left({b}^{2} - {a}^{2}\right) \leq 10^{-291}:\\
\;\;\;\;\left(\left(\left(\sin \left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right) \cdot a\right) \cdot a\right) \cdot \cos \left(\left(\pi \cdot 0.005555555555555556\right) \cdot \left|angle\right|\right)\right) \cdot -2\\
\mathbf{else}:\\
\;\;\;\;\left(\left(2 \cdot \left(b \cdot b\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < 9.99999999999999962e-292Initial program 54.1%
lift-cos.f64N/A
cos-fabs-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
fabs-mulN/A
add-exp-logN/A
exp-fabsN/A
add-exp-logN/A
lower-fma.f64N/A
lower-fabs.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-/.f64N/A
lift-PI.f6454.3
Applied rewrites54.3%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6426.7
Applied rewrites26.7%
lift-*.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
sqrt-unprodN/A
rem-sqrt-square-revN/A
fabs-mulN/A
metadata-evalN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-fabs.f6426.7
Applied rewrites26.7%
lift-*.f64N/A
lift-sqrt.f64N/A
rem-square-sqrtN/A
sqrt-unprodN/A
rem-sqrt-square-revN/A
fabs-mulN/A
metadata-evalN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f64N/A
lower-fabs.f6454.1
Applied rewrites54.1%
Taylor expanded in a around inf
Applied rewrites40.7%
if 9.99999999999999962e-292 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 54.1%
lift-cos.f64N/A
cos-fabs-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
fabs-mulN/A
add-exp-logN/A
exp-fabsN/A
add-exp-logN/A
lower-fma.f64N/A
lower-fabs.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-/.f64N/A
lift-PI.f6454.3
Applied rewrites54.3%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6426.7
Applied rewrites26.7%
lift-sin.f64N/A
lift-PI.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
sin-+PI/2N/A
lower-cos.f64N/A
lower-*.f64N/A
Applied rewrites54.0%
Taylor expanded in a around 0
pow2N/A
lower-*.f6436.5
Applied rewrites36.5%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (* PI angle) 0.005555555555555556)))
(if (<= (* 2.0 (- (pow b 2.0) (pow a 2.0))) 1e-291)
(* (cos t_0) (* (* (* (sin t_0) a) a) -2.0))
(*
(* (* 2.0 (* b b)) (sin (* PI (/ angle 180.0))))
(cos (* (* 0.005555555555555556 angle) PI))))))
double code(double a, double b, double angle) {
double t_0 = (((double) M_PI) * angle) * 0.005555555555555556;
double tmp;
if ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) <= 1e-291) {
tmp = cos(t_0) * (((sin(t_0) * a) * a) * -2.0);
} else {
tmp = ((2.0 * (b * b)) * sin((((double) M_PI) * (angle / 180.0)))) * cos(((0.005555555555555556 * angle) * ((double) M_PI)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = (Math.PI * angle) * 0.005555555555555556;
double tmp;
if ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) <= 1e-291) {
tmp = Math.cos(t_0) * (((Math.sin(t_0) * a) * a) * -2.0);
} else {
tmp = ((2.0 * (b * b)) * Math.sin((Math.PI * (angle / 180.0)))) * Math.cos(((0.005555555555555556 * angle) * Math.PI));
}
return tmp;
}
def code(a, b, angle): t_0 = (math.pi * angle) * 0.005555555555555556 tmp = 0 if (2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) <= 1e-291: tmp = math.cos(t_0) * (((math.sin(t_0) * a) * a) * -2.0) else: tmp = ((2.0 * (b * b)) * math.sin((math.pi * (angle / 180.0)))) * math.cos(((0.005555555555555556 * angle) * math.pi)) return tmp
function code(a, b, angle) t_0 = Float64(Float64(pi * angle) * 0.005555555555555556) tmp = 0.0 if (Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) <= 1e-291) tmp = Float64(cos(t_0) * Float64(Float64(Float64(sin(t_0) * a) * a) * -2.0)); else tmp = Float64(Float64(Float64(2.0 * Float64(b * b)) * sin(Float64(pi * Float64(angle / 180.0)))) * cos(Float64(Float64(0.005555555555555556 * angle) * pi))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = (pi * angle) * 0.005555555555555556; tmp = 0.0; if ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) <= 1e-291) tmp = cos(t_0) * (((sin(t_0) * a) * a) * -2.0); else tmp = ((2.0 * (b * b)) * sin((pi * (angle / 180.0)))) * cos(((0.005555555555555556 * angle) * pi)); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, If[LessEqual[N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e-291], N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(2.0 * N[(b * b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\pi \cdot angle\right) \cdot 0.005555555555555556\\
\mathbf{if}\;2 \cdot \left({b}^{2} - {a}^{2}\right) \leq 10^{-291}:\\
\;\;\;\;\cos t\_0 \cdot \left(\left(\left(\sin t\_0 \cdot a\right) \cdot a\right) \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(2 \cdot \left(b \cdot b\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < 9.99999999999999962e-292Initial program 54.1%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites36.0%
lift-*.f64N/A
lift-cos.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites40.9%
if 9.99999999999999962e-292 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 54.1%
lift-cos.f64N/A
cos-fabs-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
fabs-mulN/A
add-exp-logN/A
exp-fabsN/A
add-exp-logN/A
lower-fma.f64N/A
lower-fabs.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-/.f64N/A
lift-PI.f6454.3
Applied rewrites54.3%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6426.7
Applied rewrites26.7%
lift-sin.f64N/A
lift-PI.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
sin-+PI/2N/A
lower-cos.f64N/A
lower-*.f64N/A
Applied rewrites54.0%
Taylor expanded in a around 0
pow2N/A
lower-*.f6436.5
Applied rewrites36.5%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (* PI angle) 0.005555555555555556)))
(if (<= (* 2.0 (- (pow b 2.0) (pow a 2.0))) -4e-146)
(* (cos t_0) (* (* (* (sin t_0) a) a) -2.0))
(*
(* (* (sin (* PI (* 0.005555555555555556 angle))) (* b b)) 2.0)
(cos (* PI (/ angle 180.0)))))))
double code(double a, double b, double angle) {
double t_0 = (((double) M_PI) * angle) * 0.005555555555555556;
double tmp;
if ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) <= -4e-146) {
tmp = cos(t_0) * (((sin(t_0) * a) * a) * -2.0);
} else {
tmp = ((sin((((double) M_PI) * (0.005555555555555556 * angle))) * (b * b)) * 2.0) * cos((((double) M_PI) * (angle / 180.0)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = (Math.PI * angle) * 0.005555555555555556;
double tmp;
if ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) <= -4e-146) {
tmp = Math.cos(t_0) * (((Math.sin(t_0) * a) * a) * -2.0);
} else {
tmp = ((Math.sin((Math.PI * (0.005555555555555556 * angle))) * (b * b)) * 2.0) * Math.cos((Math.PI * (angle / 180.0)));
}
return tmp;
}
def code(a, b, angle): t_0 = (math.pi * angle) * 0.005555555555555556 tmp = 0 if (2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) <= -4e-146: tmp = math.cos(t_0) * (((math.sin(t_0) * a) * a) * -2.0) else: tmp = ((math.sin((math.pi * (0.005555555555555556 * angle))) * (b * b)) * 2.0) * math.cos((math.pi * (angle / 180.0))) return tmp
function code(a, b, angle) t_0 = Float64(Float64(pi * angle) * 0.005555555555555556) tmp = 0.0 if (Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) <= -4e-146) tmp = Float64(cos(t_0) * Float64(Float64(Float64(sin(t_0) * a) * a) * -2.0)); else tmp = Float64(Float64(Float64(sin(Float64(pi * Float64(0.005555555555555556 * angle))) * Float64(b * b)) * 2.0) * cos(Float64(pi * Float64(angle / 180.0)))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = (pi * angle) * 0.005555555555555556; tmp = 0.0; if ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) <= -4e-146) tmp = cos(t_0) * (((sin(t_0) * a) * a) * -2.0); else tmp = ((sin((pi * (0.005555555555555556 * angle))) * (b * b)) * 2.0) * cos((pi * (angle / 180.0))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, If[LessEqual[N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -4e-146], N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(N[(N[Sin[t$95$0], $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Sin[N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b * b), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\pi \cdot angle\right) \cdot 0.005555555555555556\\
\mathbf{if}\;2 \cdot \left({b}^{2} - {a}^{2}\right) \leq -4 \cdot 10^{-146}:\\
\;\;\;\;\cos t\_0 \cdot \left(\left(\left(\sin t\_0 \cdot a\right) \cdot a\right) \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\sin \left(\pi \cdot \left(0.005555555555555556 \cdot angle\right)\right) \cdot \left(b \cdot b\right)\right) \cdot 2\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -4.0000000000000001e-146Initial program 54.1%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites36.0%
lift-*.f64N/A
lift-cos.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites40.9%
if -4.0000000000000001e-146 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 54.1%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites36.6%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* (* PI angle) 0.005555555555555556)) (t_1 (sin t_0)))
(if (<= (* 2.0 (- (pow b 2.0) (pow a 2.0))) -4e-146)
(* (cos t_0) (* (* (* t_1 a) a) -2.0))
(* (* (* t_1 (* b b)) 2.0) (cos (* (* 0.005555555555555556 angle) PI))))))
double code(double a, double b, double angle) {
double t_0 = (((double) M_PI) * angle) * 0.005555555555555556;
double t_1 = sin(t_0);
double tmp;
if ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) <= -4e-146) {
tmp = cos(t_0) * (((t_1 * a) * a) * -2.0);
} else {
tmp = ((t_1 * (b * b)) * 2.0) * cos(((0.005555555555555556 * angle) * ((double) M_PI)));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = (Math.PI * angle) * 0.005555555555555556;
double t_1 = Math.sin(t_0);
double tmp;
if ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) <= -4e-146) {
tmp = Math.cos(t_0) * (((t_1 * a) * a) * -2.0);
} else {
tmp = ((t_1 * (b * b)) * 2.0) * Math.cos(((0.005555555555555556 * angle) * Math.PI));
}
return tmp;
}
def code(a, b, angle): t_0 = (math.pi * angle) * 0.005555555555555556 t_1 = math.sin(t_0) tmp = 0 if (2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) <= -4e-146: tmp = math.cos(t_0) * (((t_1 * a) * a) * -2.0) else: tmp = ((t_1 * (b * b)) * 2.0) * math.cos(((0.005555555555555556 * angle) * math.pi)) return tmp
function code(a, b, angle) t_0 = Float64(Float64(pi * angle) * 0.005555555555555556) t_1 = sin(t_0) tmp = 0.0 if (Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) <= -4e-146) tmp = Float64(cos(t_0) * Float64(Float64(Float64(t_1 * a) * a) * -2.0)); else tmp = Float64(Float64(Float64(t_1 * Float64(b * b)) * 2.0) * cos(Float64(Float64(0.005555555555555556 * angle) * pi))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = (pi * angle) * 0.005555555555555556; t_1 = sin(t_0); tmp = 0.0; if ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) <= -4e-146) tmp = cos(t_0) * (((t_1 * a) * a) * -2.0); else tmp = ((t_1 * (b * b)) * 2.0) * cos(((0.005555555555555556 * angle) * pi)); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, Block[{t$95$1 = N[Sin[t$95$0], $MachinePrecision]}, If[LessEqual[N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -4e-146], N[(N[Cos[t$95$0], $MachinePrecision] * N[(N[(N[(t$95$1 * a), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$1 * N[(b * b), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * N[Cos[N[(N[(0.005555555555555556 * angle), $MachinePrecision] * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\pi \cdot angle\right) \cdot 0.005555555555555556\\
t_1 := \sin t\_0\\
\mathbf{if}\;2 \cdot \left({b}^{2} - {a}^{2}\right) \leq -4 \cdot 10^{-146}:\\
\;\;\;\;\cos t\_0 \cdot \left(\left(\left(t\_1 \cdot a\right) \cdot a\right) \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_1 \cdot \left(b \cdot b\right)\right) \cdot 2\right) \cdot \cos \left(\left(0.005555555555555556 \cdot angle\right) \cdot \pi\right)\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -4.0000000000000001e-146Initial program 54.1%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites36.0%
lift-*.f64N/A
lift-cos.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites40.9%
if -4.0000000000000001e-146 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 54.1%
lift-cos.f64N/A
cos-fabs-revN/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
fabs-mulN/A
add-exp-logN/A
exp-fabsN/A
add-exp-logN/A
lower-fma.f64N/A
lower-fabs.f64N/A
lift-/.f64N/A
mult-flipN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-/.f64N/A
lift-PI.f6454.3
Applied rewrites54.3%
lift-fabs.f64N/A
rem-sqrt-square-revN/A
sqrt-prodN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-sqrt.f6426.7
Applied rewrites26.7%
lift-sin.f64N/A
lift-PI.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-PI.f64N/A
lift-/.f64N/A
sin-+PI/2N/A
lower-cos.f64N/A
lower-*.f64N/A
Applied rewrites54.0%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
pow2N/A
lower-*.f6436.6
Applied rewrites36.6%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* PI (* 0.005555555555555556 angle)))
(t_1 (* (* PI angle) 0.005555555555555556)))
(if (<= (* 2.0 (- (pow b 2.0) (pow a 2.0))) 1e-291)
(* (cos t_1) (* (* (* (sin t_1) a) a) -2.0))
(* (* (* b b) 2.0) (* (sin t_0) (cos t_0))))))
double code(double a, double b, double angle) {
double t_0 = ((double) M_PI) * (0.005555555555555556 * angle);
double t_1 = (((double) M_PI) * angle) * 0.005555555555555556;
double tmp;
if ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) <= 1e-291) {
tmp = cos(t_1) * (((sin(t_1) * a) * a) * -2.0);
} else {
tmp = ((b * b) * 2.0) * (sin(t_0) * cos(t_0));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.PI * (0.005555555555555556 * angle);
double t_1 = (Math.PI * angle) * 0.005555555555555556;
double tmp;
if ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) <= 1e-291) {
tmp = Math.cos(t_1) * (((Math.sin(t_1) * a) * a) * -2.0);
} else {
tmp = ((b * b) * 2.0) * (Math.sin(t_0) * Math.cos(t_0));
}
return tmp;
}
def code(a, b, angle): t_0 = math.pi * (0.005555555555555556 * angle) t_1 = (math.pi * angle) * 0.005555555555555556 tmp = 0 if (2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) <= 1e-291: tmp = math.cos(t_1) * (((math.sin(t_1) * a) * a) * -2.0) else: tmp = ((b * b) * 2.0) * (math.sin(t_0) * math.cos(t_0)) return tmp
function code(a, b, angle) t_0 = Float64(pi * Float64(0.005555555555555556 * angle)) t_1 = Float64(Float64(pi * angle) * 0.005555555555555556) tmp = 0.0 if (Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) <= 1e-291) tmp = Float64(cos(t_1) * Float64(Float64(Float64(sin(t_1) * a) * a) * -2.0)); else tmp = Float64(Float64(Float64(b * b) * 2.0) * Float64(sin(t_0) * cos(t_0))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = pi * (0.005555555555555556 * angle); t_1 = (pi * angle) * 0.005555555555555556; tmp = 0.0; if ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) <= 1e-291) tmp = cos(t_1) * (((sin(t_1) * a) * a) * -2.0); else tmp = ((b * b) * 2.0) * (sin(t_0) * cos(t_0)); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(Pi * N[(0.005555555555555556 * angle), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(Pi * angle), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]}, If[LessEqual[N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e-291], N[(N[Cos[t$95$1], $MachinePrecision] * N[(N[(N[(N[Sin[t$95$1], $MachinePrecision] * a), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * b), $MachinePrecision] * 2.0), $MachinePrecision] * N[(N[Sin[t$95$0], $MachinePrecision] * N[Cos[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \pi \cdot \left(0.005555555555555556 \cdot angle\right)\\
t_1 := \left(\pi \cdot angle\right) \cdot 0.005555555555555556\\
\mathbf{if}\;2 \cdot \left({b}^{2} - {a}^{2}\right) \leq 10^{-291}:\\
\;\;\;\;\cos t\_1 \cdot \left(\left(\left(\sin t\_1 \cdot a\right) \cdot a\right) \cdot -2\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b \cdot b\right) \cdot 2\right) \cdot \left(\sin t\_0 \cdot \cos t\_0\right)\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < 9.99999999999999962e-292Initial program 54.1%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites36.0%
lift-*.f64N/A
lift-cos.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites40.9%
if 9.99999999999999962e-292 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 54.1%
Taylor expanded in a around 0
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
metadata-evalN/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
Applied rewrites36.7%
(FPCore (a b angle) :precision binary64 (if (<= a 2.6e+153) (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* PI (/ angle 180.0)))) 1.0) (* (* -0.011111111111111112 a) (* a (* PI angle)))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 2.6e+153) {
tmp = ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin((((double) M_PI) * (angle / 180.0)))) * 1.0;
} else {
tmp = (-0.011111111111111112 * a) * (a * (((double) M_PI) * angle));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 2.6e+153) {
tmp = ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin((Math.PI * (angle / 180.0)))) * 1.0;
} else {
tmp = (-0.011111111111111112 * a) * (a * (Math.PI * angle));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 2.6e+153: tmp = ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin((math.pi * (angle / 180.0)))) * 1.0 else: tmp = (-0.011111111111111112 * a) * (a * (math.pi * angle)) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 2.6e+153) tmp = Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(Float64(pi * Float64(angle / 180.0)))) * 1.0); else tmp = Float64(Float64(-0.011111111111111112 * a) * Float64(a * Float64(pi * angle))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 2.6e+153) tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin((pi * (angle / 180.0)))) * 1.0; else tmp = (-0.011111111111111112 * a) * (a * (pi * angle)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 2.6e+153], N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(-0.011111111111111112 * a), $MachinePrecision] * N[(a * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.6 \cdot 10^{+153}:\\
\;\;\;\;\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\right) \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\\
\end{array}
\end{array}
if a < 2.5999999999999999e153Initial program 54.1%
Taylor expanded in angle around 0
Applied rewrites53.0%
if 2.5999999999999999e153 < a Initial program 54.1%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6450.9
Applied rewrites50.9%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6434.6
Applied rewrites34.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f6437.8
Applied rewrites37.8%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 2.0 (- (pow b 2.0) (pow a 2.0))))
(t_1 (* (* -0.011111111111111112 a) (* a (* PI angle)))))
(if (<= t_0 -2e-139)
t_1
(if (<= t_0 INFINITY)
(* (* 0.011111111111111112 angle) (* PI (* b b)))
t_1))))
double code(double a, double b, double angle) {
double t_0 = 2.0 * (pow(b, 2.0) - pow(a, 2.0));
double t_1 = (-0.011111111111111112 * a) * (a * (((double) M_PI) * angle));
double tmp;
if (t_0 <= -2e-139) {
tmp = t_1;
} else if (t_0 <= ((double) INFINITY)) {
tmp = (0.011111111111111112 * angle) * (((double) M_PI) * (b * b));
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0));
double t_1 = (-0.011111111111111112 * a) * (a * (Math.PI * angle));
double tmp;
if (t_0 <= -2e-139) {
tmp = t_1;
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = (0.011111111111111112 * angle) * (Math.PI * (b * b));
} else {
tmp = t_1;
}
return tmp;
}
def code(a, b, angle): t_0 = 2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0)) t_1 = (-0.011111111111111112 * a) * (a * (math.pi * angle)) tmp = 0 if t_0 <= -2e-139: tmp = t_1 elif t_0 <= math.inf: tmp = (0.011111111111111112 * angle) * (math.pi * (b * b)) else: tmp = t_1 return tmp
function code(a, b, angle) t_0 = Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) t_1 = Float64(Float64(-0.011111111111111112 * a) * Float64(a * Float64(pi * angle))) tmp = 0.0 if (t_0 <= -2e-139) tmp = t_1; elseif (t_0 <= Inf) tmp = Float64(Float64(0.011111111111111112 * angle) * Float64(pi * Float64(b * b))); else tmp = t_1; end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 2.0 * ((b ^ 2.0) - (a ^ 2.0)); t_1 = (-0.011111111111111112 * a) * (a * (pi * angle)); tmp = 0.0; if (t_0 <= -2e-139) tmp = t_1; elseif (t_0 <= Inf) tmp = (0.011111111111111112 * angle) * (pi * (b * b)); else tmp = t_1; end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-0.011111111111111112 * a), $MachinePrecision] * N[(a * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-139], t$95$1, If[LessEqual[t$95$0, Infinity], N[(N[(0.011111111111111112 * angle), $MachinePrecision] * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \left({b}^{2} - {a}^{2}\right)\\
t_1 := \left(-0.011111111111111112 \cdot a\right) \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-139}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\left(0.011111111111111112 \cdot angle\right) \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -2.00000000000000006e-139 or +inf.0 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 54.1%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6450.9
Applied rewrites50.9%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6434.6
Applied rewrites34.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f6437.8
Applied rewrites37.8%
if -2.00000000000000006e-139 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < +inf.0Initial program 54.1%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6450.9
Applied rewrites50.9%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
pow2N/A
lift-*.f6436.2
Applied rewrites36.2%
(FPCore (a b angle) :precision binary64 (if (<= a 5.4e+140) (* (* (* 0.011111111111111112 angle) PI) (* (+ b a) (- b a))) (* (* -0.011111111111111112 a) (* a (* PI angle)))))
double code(double a, double b, double angle) {
double tmp;
if (a <= 5.4e+140) {
tmp = ((0.011111111111111112 * angle) * ((double) M_PI)) * ((b + a) * (b - a));
} else {
tmp = (-0.011111111111111112 * a) * (a * (((double) M_PI) * angle));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double tmp;
if (a <= 5.4e+140) {
tmp = ((0.011111111111111112 * angle) * Math.PI) * ((b + a) * (b - a));
} else {
tmp = (-0.011111111111111112 * a) * (a * (Math.PI * angle));
}
return tmp;
}
def code(a, b, angle): tmp = 0 if a <= 5.4e+140: tmp = ((0.011111111111111112 * angle) * math.pi) * ((b + a) * (b - a)) else: tmp = (-0.011111111111111112 * a) * (a * (math.pi * angle)) return tmp
function code(a, b, angle) tmp = 0.0 if (a <= 5.4e+140) tmp = Float64(Float64(Float64(0.011111111111111112 * angle) * pi) * Float64(Float64(b + a) * Float64(b - a))); else tmp = Float64(Float64(-0.011111111111111112 * a) * Float64(a * Float64(pi * angle))); end return tmp end
function tmp_2 = code(a, b, angle) tmp = 0.0; if (a <= 5.4e+140) tmp = ((0.011111111111111112 * angle) * pi) * ((b + a) * (b - a)); else tmp = (-0.011111111111111112 * a) * (a * (pi * angle)); end tmp_2 = tmp; end
code[a_, b_, angle_] := If[LessEqual[a, 5.4e+140], N[(N[(N[(0.011111111111111112 * angle), $MachinePrecision] * Pi), $MachinePrecision] * N[(N[(b + a), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-0.011111111111111112 * a), $MachinePrecision] * N[(a * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 5.4 \cdot 10^{+140}:\\
\;\;\;\;\left(\left(0.011111111111111112 \cdot angle\right) \cdot \pi\right) \cdot \left(\left(b + a\right) \cdot \left(b - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\right) \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\\
\end{array}
\end{array}
if a < 5.40000000000000036e140Initial program 54.1%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6450.9
Applied rewrites50.9%
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
lift--.f64N/A
lift-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lower-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
pow2N/A
pow2N/A
difference-of-squaresN/A
lower-*.f64N/A
Applied rewrites54.9%
if 5.40000000000000036e140 < a Initial program 54.1%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6450.9
Applied rewrites50.9%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6434.6
Applied rewrites34.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f6437.8
Applied rewrites37.8%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (* 2.0 (- (pow b 2.0) (pow a 2.0))))
(t_1 (* (* -0.011111111111111112 a) (* a (* PI angle)))))
(if (<= t_0 -2e-139)
t_1
(if (<= t_0 INFINITY)
(* (* (* PI (* b b)) angle) 0.011111111111111112)
t_1))))
double code(double a, double b, double angle) {
double t_0 = 2.0 * (pow(b, 2.0) - pow(a, 2.0));
double t_1 = (-0.011111111111111112 * a) * (a * (((double) M_PI) * angle));
double tmp;
if (t_0 <= -2e-139) {
tmp = t_1;
} else if (t_0 <= ((double) INFINITY)) {
tmp = ((((double) M_PI) * (b * b)) * angle) * 0.011111111111111112;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = 2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0));
double t_1 = (-0.011111111111111112 * a) * (a * (Math.PI * angle));
double tmp;
if (t_0 <= -2e-139) {
tmp = t_1;
} else if (t_0 <= Double.POSITIVE_INFINITY) {
tmp = ((Math.PI * (b * b)) * angle) * 0.011111111111111112;
} else {
tmp = t_1;
}
return tmp;
}
def code(a, b, angle): t_0 = 2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0)) t_1 = (-0.011111111111111112 * a) * (a * (math.pi * angle)) tmp = 0 if t_0 <= -2e-139: tmp = t_1 elif t_0 <= math.inf: tmp = ((math.pi * (b * b)) * angle) * 0.011111111111111112 else: tmp = t_1 return tmp
function code(a, b, angle) t_0 = Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) t_1 = Float64(Float64(-0.011111111111111112 * a) * Float64(a * Float64(pi * angle))) tmp = 0.0 if (t_0 <= -2e-139) tmp = t_1; elseif (t_0 <= Inf) tmp = Float64(Float64(Float64(pi * Float64(b * b)) * angle) * 0.011111111111111112); else tmp = t_1; end return tmp end
function tmp_2 = code(a, b, angle) t_0 = 2.0 * ((b ^ 2.0) - (a ^ 2.0)); t_1 = (-0.011111111111111112 * a) * (a * (pi * angle)); tmp = 0.0; if (t_0 <= -2e-139) tmp = t_1; elseif (t_0 <= Inf) tmp = ((pi * (b * b)) * angle) * 0.011111111111111112; else tmp = t_1; end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(-0.011111111111111112 * a), $MachinePrecision] * N[(a * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-139], t$95$1, If[LessEqual[t$95$0, Infinity], N[(N[(N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision] * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \left({b}^{2} - {a}^{2}\right)\\
t_1 := \left(-0.011111111111111112 \cdot a\right) \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-139}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;\left(\left(\pi \cdot \left(b \cdot b\right)\right) \cdot angle\right) \cdot 0.011111111111111112\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < -2.00000000000000006e-139 or +inf.0 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) Initial program 54.1%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6450.9
Applied rewrites50.9%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6434.6
Applied rewrites34.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f6437.8
Applied rewrites37.8%
if -2.00000000000000006e-139 < (*.f64 #s(literal 2 binary64) (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64)))) < +inf.0Initial program 54.1%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6450.9
Applied rewrites50.9%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
pow2N/A
lift-*.f6436.2
Applied rewrites36.2%
(FPCore (a b angle) :precision binary64 (* (* -0.011111111111111112 a) (* a (* PI angle))))
double code(double a, double b, double angle) {
return (-0.011111111111111112 * a) * (a * (((double) M_PI) * angle));
}
public static double code(double a, double b, double angle) {
return (-0.011111111111111112 * a) * (a * (Math.PI * angle));
}
def code(a, b, angle): return (-0.011111111111111112 * a) * (a * (math.pi * angle))
function code(a, b, angle) return Float64(Float64(-0.011111111111111112 * a) * Float64(a * Float64(pi * angle))) end
function tmp = code(a, b, angle) tmp = (-0.011111111111111112 * a) * (a * (pi * angle)); end
code[a_, b_, angle_] := N[(N[(-0.011111111111111112 * a), $MachinePrecision] * N[(a * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-0.011111111111111112 \cdot a\right) \cdot \left(a \cdot \left(\pi \cdot angle\right)\right)
\end{array}
Initial program 54.1%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-PI.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6450.9
Applied rewrites50.9%
Taylor expanded in a around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f6434.6
Applied rewrites34.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f6437.8
Applied rewrites37.8%
herbie shell --seed 2025142
(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)))))