
(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 18 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
(let* ((t_0 (* (cbrt PI) (cbrt (sqrt PI)))))
(if (<= (pow b 2.0) 5e+300)
(/
(*
(+ a_m b)
(sin (* (* 0.011111111111111112 (sqrt PI)) (* angle (sqrt PI)))))
(/ -1.0 (- a_m b)))
(*
(* (sin (* (* (* t_0 t_0) angle) 0.011111111111111112)) (- b a_m))
(+ a_m b)))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = cbrt(((double) M_PI)) * cbrt(sqrt(((double) M_PI)));
double tmp;
if (pow(b, 2.0) <= 5e+300) {
tmp = ((a_m + b) * sin(((0.011111111111111112 * sqrt(((double) M_PI))) * (angle * sqrt(((double) M_PI)))))) / (-1.0 / (a_m - b));
} else {
tmp = (sin((((t_0 * t_0) * angle) * 0.011111111111111112)) * (b - a_m)) * (a_m + b);
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = Math.cbrt(Math.PI) * Math.cbrt(Math.sqrt(Math.PI));
double tmp;
if (Math.pow(b, 2.0) <= 5e+300) {
tmp = ((a_m + b) * Math.sin(((0.011111111111111112 * Math.sqrt(Math.PI)) * (angle * Math.sqrt(Math.PI))))) / (-1.0 / (a_m - b));
} else {
tmp = (Math.sin((((t_0 * t_0) * angle) * 0.011111111111111112)) * (b - a_m)) * (a_m + b);
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(cbrt(pi) * cbrt(sqrt(pi))) tmp = 0.0 if ((b ^ 2.0) <= 5e+300) tmp = Float64(Float64(Float64(a_m + b) * sin(Float64(Float64(0.011111111111111112 * sqrt(pi)) * Float64(angle * sqrt(pi))))) / Float64(-1.0 / Float64(a_m - b))); else tmp = Float64(Float64(sin(Float64(Float64(Float64(t_0 * t_0) * angle) * 0.011111111111111112)) * Float64(b - a_m)) * Float64(a_m + b)); end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[Power[Pi, 1/3], $MachinePrecision] * N[Power[N[Sqrt[Pi], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Power[b, 2.0], $MachinePrecision], 5e+300], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[Sin[N[(N[(0.011111111111111112 * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision] * N[(angle * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(-1.0 / N[(a$95$m - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \sqrt[3]{\pi} \cdot \sqrt[3]{\sqrt{\pi}}\\
\mathbf{if}\;{b}^{2} \leq 5 \cdot 10^{+300}:\\
\;\;\;\;\frac{\left(a\_m + b\right) \cdot \sin \left(\left(0.011111111111111112 \cdot \sqrt{\pi}\right) \cdot \left(angle \cdot \sqrt{\pi}\right)\right)}{\frac{-1}{a\_m - b}}\\
\mathbf{else}:\\
\;\;\;\;\left(\sin \left(\left(\left(t\_0 \cdot t\_0\right) \cdot angle\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\_m\right)\right) \cdot \left(a\_m + b\right)\\
\end{array}
\end{array}
if (pow.f64 b #s(literal 2 binary64)) < 5.00000000000000026e300Initial program 58.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites63.3%
Applied rewrites64.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
rem-square-sqrtN/A
lift-sqrt.f64N/A
lift-sqrt.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6464.7
Applied rewrites64.7%
if 5.00000000000000026e300 < (pow.f64 b #s(literal 2 binary64)) Initial program 39.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites77.5%
lift-PI.f64N/A
add-cube-cbrtN/A
associate-*l*N/A
add-sqr-sqrtN/A
cbrt-prodN/A
unswap-sqrN/A
lower-*.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-cbrt.f64N/A
lower-*.f64N/A
lower-cbrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-cbrt.f6485.6
Applied rewrites85.6%
Final simplification69.4%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0
(*
(*
(*
(fma
(* (* angle angle) -2.2862368541380886e-7)
(* (* PI PI) PI)
(* 0.011111111111111112 PI))
angle)
(- b a_m))
(+ a_m b)))
(t_1 (* (/ angle 180.0) PI))
(t_2
(* (cos t_1) (* (sin t_1) (* (- (pow b 2.0) (pow a_m 2.0)) 2.0)))))
(if (<= t_2 -1e+133)
t_0
(if (<= t_2 1e+285)
(* (* (- b a_m) (+ a_m b)) (* (* 0.011111111111111112 PI) angle))
t_0))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = ((fma(((angle * angle) * -2.2862368541380886e-7), ((((double) M_PI) * ((double) M_PI)) * ((double) M_PI)), (0.011111111111111112 * ((double) M_PI))) * angle) * (b - a_m)) * (a_m + b);
double t_1 = (angle / 180.0) * ((double) M_PI);
double t_2 = cos(t_1) * (sin(t_1) * ((pow(b, 2.0) - pow(a_m, 2.0)) * 2.0));
double tmp;
if (t_2 <= -1e+133) {
tmp = t_0;
} else if (t_2 <= 1e+285) {
tmp = ((b - a_m) * (a_m + b)) * ((0.011111111111111112 * ((double) M_PI)) * angle);
} else {
tmp = t_0;
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(Float64(Float64(fma(Float64(Float64(angle * angle) * -2.2862368541380886e-7), Float64(Float64(pi * pi) * pi), Float64(0.011111111111111112 * pi)) * angle) * Float64(b - a_m)) * Float64(a_m + b)) t_1 = Float64(Float64(angle / 180.0) * pi) t_2 = Float64(cos(t_1) * Float64(sin(t_1) * Float64(Float64((b ^ 2.0) - (a_m ^ 2.0)) * 2.0))) tmp = 0.0 if (t_2 <= -1e+133) tmp = t_0; elseif (t_2 <= 1e+285) tmp = Float64(Float64(Float64(b - a_m) * Float64(a_m + b)) * Float64(Float64(0.011111111111111112 * pi) * angle)); else tmp = t_0; end return tmp end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[(N[(N[(N[(N[(angle * angle), $MachinePrecision] * -2.2862368541380886e-7), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision] + N[(0.011111111111111112 * Pi), $MachinePrecision]), $MachinePrecision] * angle), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(angle / 180.0), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$2 = N[(N[Cos[t$95$1], $MachinePrecision] * N[(N[Sin[t$95$1], $MachinePrecision] * N[(N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+133], t$95$0, If[LessEqual[t$95$2, 1e+285], N[(N[(N[(b - a$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \left(\left(\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -2.2862368541380886 \cdot 10^{-7}, \left(\pi \cdot \pi\right) \cdot \pi, 0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \left(b - a\_m\right)\right) \cdot \left(a\_m + b\right)\\
t_1 := \frac{angle}{180} \cdot \pi\\
t_2 := \cos t\_1 \cdot \left(\sin t\_1 \cdot \left(\left({b}^{2} - {a\_m}^{2}\right) \cdot 2\right)\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+133}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_2 \leq 10^{+285}:\\
\;\;\;\;\left(\left(b - a\_m\right) \cdot \left(a\_m + b\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\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))))) < -1e133 or 9.9999999999999998e284 < (*.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 44.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites69.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow3N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6470.7
Applied rewrites70.7%
if -1e133 < (*.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.9999999999999998e284Initial program 63.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6459.6
Applied rewrites59.6%
Final simplification64.9%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (- (pow b 2.0) (pow a_m 2.0)))
(t_1
(*
(*
(*
(fma
(* (* angle angle) -2.2862368541380886e-7)
(* (* PI PI) PI)
(* 0.011111111111111112 PI))
angle)
(- b a_m))
(+ a_m b))))
(if (<= t_0 -1e-218)
t_1
(if (<= t_0 5e+287)
(* (* b b) (sin (* (* angle PI) 0.011111111111111112)))
t_1))))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 t_1 = ((fma(((angle * angle) * -2.2862368541380886e-7), ((((double) M_PI) * ((double) M_PI)) * ((double) M_PI)), (0.011111111111111112 * ((double) M_PI))) * angle) * (b - a_m)) * (a_m + b);
double tmp;
if (t_0 <= -1e-218) {
tmp = t_1;
} else if (t_0 <= 5e+287) {
tmp = (b * b) * sin(((angle * ((double) M_PI)) * 0.011111111111111112));
} else {
tmp = t_1;
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64((b ^ 2.0) - (a_m ^ 2.0)) t_1 = Float64(Float64(Float64(fma(Float64(Float64(angle * angle) * -2.2862368541380886e-7), Float64(Float64(pi * pi) * pi), Float64(0.011111111111111112 * pi)) * angle) * Float64(b - a_m)) * Float64(a_m + b)) tmp = 0.0 if (t_0 <= -1e-218) tmp = t_1; elseif (t_0 <= 5e+287) tmp = Float64(Float64(b * b) * sin(Float64(Float64(angle * pi) * 0.011111111111111112))); else tmp = t_1; end return 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]}, Block[{t$95$1 = N[(N[(N[(N[(N[(N[(angle * angle), $MachinePrecision] * -2.2862368541380886e-7), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision] + N[(0.011111111111111112 * Pi), $MachinePrecision]), $MachinePrecision] * angle), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-218], t$95$1, If[LessEqual[t$95$0, 5e+287], N[(N[(b * b), $MachinePrecision] * N[Sin[N[(N[(angle * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := {b}^{2} - {a\_m}^{2}\\
t_1 := \left(\left(\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -2.2862368541380886 \cdot 10^{-7}, \left(\pi \cdot \pi\right) \cdot \pi, 0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \left(b - a\_m\right)\right) \cdot \left(a\_m + b\right)\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-218}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+287}:\\
\;\;\;\;\left(b \cdot b\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -1e-218 or 5e287 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 50.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites68.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow3N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6468.9
Applied rewrites68.9%
if -1e-218 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 5e287Initial program 61.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites62.5%
Taylor expanded in b around inf
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6462.6
Applied rewrites62.6%
Final simplification66.7%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(if (<= a_m 2.8e-31)
(*
(*
(sin
(*
(*
(* (pow (* (* PI PI) (sqrt PI)) 0.3333333333333333) (cbrt (sqrt PI)))
angle)
0.011111111111111112))
(- b a_m))
(+ a_m b))
(*
(* (sin (* (* 0.011111111111111112 PI) angle)) (fma (/ b a_m) a_m a_m))
(- b a_m))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if (a_m <= 2.8e-31) {
tmp = (sin((((pow(((((double) M_PI) * ((double) M_PI)) * sqrt(((double) M_PI))), 0.3333333333333333) * cbrt(sqrt(((double) M_PI)))) * angle) * 0.011111111111111112)) * (b - a_m)) * (a_m + b);
} else {
tmp = (sin(((0.011111111111111112 * ((double) M_PI)) * angle)) * fma((b / a_m), a_m, a_m)) * (b - a_m);
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (a_m <= 2.8e-31) tmp = Float64(Float64(sin(Float64(Float64(Float64((Float64(Float64(pi * pi) * sqrt(pi)) ^ 0.3333333333333333) * cbrt(sqrt(pi))) * angle) * 0.011111111111111112)) * Float64(b - a_m)) * Float64(a_m + b)); else tmp = Float64(Float64(sin(Float64(Float64(0.011111111111111112 * pi) * angle)) * fma(Float64(b / a_m), a_m, a_m)) * Float64(b - a_m)); end return tmp end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[a$95$m, 2.8e-31], N[(N[(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] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * angle), $MachinePrecision]], $MachinePrecision] * N[(N[(b / a$95$m), $MachinePrecision] * a$95$m + a$95$m), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 2.8 \cdot 10^{-31}:\\
\;\;\;\;\left(\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) \cdot \left(b - a\_m\right)\right) \cdot \left(a\_m + b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sin \left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \mathsf{fma}\left(\frac{b}{a\_m}, a\_m, a\_m\right)\right) \cdot \left(b - a\_m\right)\\
\end{array}
\end{array}
if a < 2.7999999999999999e-31Initial program 53.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites64.9%
lift-PI.f64N/A
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.f6464.0
Applied rewrites64.0%
if 2.7999999999999999e-31 < a Initial program 57.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites70.5%
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6470.5
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6474.0
Applied rewrites74.0%
Taylor expanded in a around inf
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
lower-/.f6474.0
Applied rewrites74.0%
Final simplification67.0%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= (- (pow b 2.0) (pow a_m 2.0)) -5e-230) (* (- a_m) (* (sin (* (* 0.011111111111111112 PI) angle)) (+ a_m b))) (* (* (sin (* (* angle PI) 0.011111111111111112)) b) (- b a_m))))
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)) <= -5e-230) {
tmp = -a_m * (sin(((0.011111111111111112 * ((double) M_PI)) * angle)) * (a_m + b));
} else {
tmp = (sin(((angle * ((double) M_PI)) * 0.011111111111111112)) * b) * (b - a_m);
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a_m, 2.0)) <= -5e-230) {
tmp = -a_m * (Math.sin(((0.011111111111111112 * Math.PI) * angle)) * (a_m + b));
} else {
tmp = (Math.sin(((angle * Math.PI) * 0.011111111111111112)) * b) * (b - a_m);
}
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)) <= -5e-230: tmp = -a_m * (math.sin(((0.011111111111111112 * math.pi) * angle)) * (a_m + b)) else: tmp = (math.sin(((angle * math.pi) * 0.011111111111111112)) * b) * (b - a_m) return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (Float64((b ^ 2.0) - (a_m ^ 2.0)) <= -5e-230) tmp = Float64(Float64(-a_m) * Float64(sin(Float64(Float64(0.011111111111111112 * pi) * angle)) * Float64(a_m + b))); else tmp = Float64(Float64(sin(Float64(Float64(angle * pi) * 0.011111111111111112)) * b) * Float64(b - a_m)); 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)) <= -5e-230) tmp = -a_m * (sin(((0.011111111111111112 * pi) * angle)) * (a_m + b)); else tmp = (sin(((angle * pi) * 0.011111111111111112)) * b) * (b - a_m); 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], -5e-230], N[((-a$95$m) * N[(N[Sin[N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * angle), $MachinePrecision]], $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[N[(N[(angle * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] * b), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -5 \cdot 10^{-230}:\\
\;\;\;\;\left(-a\_m\right) \cdot \left(\sin \left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \left(a\_m + b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right) \cdot b\right) \cdot \left(b - a\_m\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -5.00000000000000035e-230Initial program 54.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites62.4%
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6462.4
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6465.1
Applied rewrites65.1%
Taylor expanded in b around 0
mul-1-negN/A
lower-neg.f6463.9
Applied rewrites63.9%
if -5.00000000000000035e-230 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 54.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites69.4%
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6469.4
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6469.1
Applied rewrites69.1%
Taylor expanded in b around inf
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6467.4
Applied rewrites67.4%
Final simplification65.9%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= (- (pow b 2.0) (pow a_m 2.0)) (- INFINITY)) (* (* -0.011111111111111112 a_m) (* (* PI a_m) angle)) (* (* (- b a_m) (+ a_m b)) (* (* 0.011111111111111112 PI) angle))))
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)) <= -((double) INFINITY)) {
tmp = (-0.011111111111111112 * a_m) * ((((double) M_PI) * a_m) * angle);
} else {
tmp = ((b - a_m) * (a_m + b)) * ((0.011111111111111112 * ((double) M_PI)) * angle);
}
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)) <= -Double.POSITIVE_INFINITY) {
tmp = (-0.011111111111111112 * a_m) * ((Math.PI * a_m) * angle);
} else {
tmp = ((b - a_m) * (a_m + b)) * ((0.011111111111111112 * Math.PI) * angle);
}
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)) <= -math.inf: tmp = (-0.011111111111111112 * a_m) * ((math.pi * a_m) * angle) else: tmp = ((b - a_m) * (a_m + b)) * ((0.011111111111111112 * math.pi) * angle) return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (Float64((b ^ 2.0) - (a_m ^ 2.0)) <= Float64(-Inf)) tmp = Float64(Float64(-0.011111111111111112 * a_m) * Float64(Float64(pi * a_m) * angle)); else tmp = Float64(Float64(Float64(b - a_m) * Float64(a_m + b)) * Float64(Float64(0.011111111111111112 * pi) * angle)); 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)) <= -Inf) tmp = (-0.011111111111111112 * a_m) * ((pi * a_m) * angle); else tmp = ((b - a_m) * (a_m + b)) * ((0.011111111111111112 * pi) * angle); 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], (-Infinity)], N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(Pi * a$95$m), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -\infty:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(\pi \cdot a\_m\right) \cdot angle\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\_m\right) \cdot \left(a\_m + b\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 55.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6444.4
Applied rewrites44.4%
Taylor expanded in b around 0
Applied rewrites44.4%
Applied rewrites63.5%
Applied rewrites63.6%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 54.0%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6454.2
Applied rewrites54.2%
Final simplification55.8%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= (- (pow b 2.0) (pow a_m 2.0)) (- INFINITY)) (* (* -0.011111111111111112 a_m) (* (* PI a_m) angle)) (* (* (* (- b a_m) (+ a_m b)) PI) (* 0.011111111111111112 angle))))
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)) <= -((double) INFINITY)) {
tmp = (-0.011111111111111112 * a_m) * ((((double) M_PI) * a_m) * angle);
} else {
tmp = (((b - a_m) * (a_m + b)) * ((double) M_PI)) * (0.011111111111111112 * angle);
}
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)) <= -Double.POSITIVE_INFINITY) {
tmp = (-0.011111111111111112 * a_m) * ((Math.PI * a_m) * angle);
} else {
tmp = (((b - a_m) * (a_m + b)) * Math.PI) * (0.011111111111111112 * angle);
}
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)) <= -math.inf: tmp = (-0.011111111111111112 * a_m) * ((math.pi * a_m) * angle) else: tmp = (((b - a_m) * (a_m + b)) * math.pi) * (0.011111111111111112 * angle) return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (Float64((b ^ 2.0) - (a_m ^ 2.0)) <= Float64(-Inf)) tmp = Float64(Float64(-0.011111111111111112 * a_m) * Float64(Float64(pi * a_m) * angle)); else tmp = Float64(Float64(Float64(Float64(b - a_m) * Float64(a_m + b)) * pi) * Float64(0.011111111111111112 * angle)); 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)) <= -Inf) tmp = (-0.011111111111111112 * a_m) * ((pi * a_m) * angle); else tmp = (((b - a_m) * (a_m + b)) * pi) * (0.011111111111111112 * angle); 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], (-Infinity)], N[(N[(-0.011111111111111112 * a$95$m), $MachinePrecision] * N[(N[(Pi * a$95$m), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(b - a$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision] * N[(0.011111111111111112 * angle), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -\infty:\\
\;\;\;\;\left(-0.011111111111111112 \cdot a\_m\right) \cdot \left(\left(\pi \cdot a\_m\right) \cdot angle\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(b - a\_m\right) \cdot \left(a\_m + b\right)\right) \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot angle\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 55.8%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6444.4
Applied rewrites44.4%
Taylor expanded in b around 0
Applied rewrites44.4%
Applied rewrites63.5%
Applied rewrites63.6%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 54.0%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6454.2
Applied rewrites54.2%
Applied rewrites54.2%
Final simplification55.8%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= (- (pow b 2.0) (pow a_m 2.0)) -5e-230) (* (* (* angle PI) a_m) (* -0.011111111111111112 a_m)) (* (* (* (* b b) PI) angle) 0.011111111111111112)))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if ((pow(b, 2.0) - pow(a_m, 2.0)) <= -5e-230) {
tmp = ((angle * ((double) M_PI)) * a_m) * (-0.011111111111111112 * a_m);
} else {
tmp = (((b * b) * ((double) M_PI)) * angle) * 0.011111111111111112;
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double tmp;
if ((Math.pow(b, 2.0) - Math.pow(a_m, 2.0)) <= -5e-230) {
tmp = ((angle * Math.PI) * a_m) * (-0.011111111111111112 * a_m);
} else {
tmp = (((b * b) * Math.PI) * angle) * 0.011111111111111112;
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): tmp = 0 if (math.pow(b, 2.0) - math.pow(a_m, 2.0)) <= -5e-230: tmp = ((angle * math.pi) * a_m) * (-0.011111111111111112 * a_m) else: tmp = (((b * b) * math.pi) * angle) * 0.011111111111111112 return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (Float64((b ^ 2.0) - (a_m ^ 2.0)) <= -5e-230) tmp = Float64(Float64(Float64(angle * pi) * a_m) * Float64(-0.011111111111111112 * a_m)); else tmp = Float64(Float64(Float64(Float64(b * b) * pi) * angle) * 0.011111111111111112); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) tmp = 0.0; if (((b ^ 2.0) - (a_m ^ 2.0)) <= -5e-230) tmp = ((angle * pi) * a_m) * (-0.011111111111111112 * a_m); else tmp = (((b * b) * pi) * angle) * 0.011111111111111112; end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision], -5e-230], N[(N[(N[(angle * Pi), $MachinePrecision] * a$95$m), $MachinePrecision] * N[(-0.011111111111111112 * a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(b * b), $MachinePrecision] * Pi), $MachinePrecision] * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -5 \cdot 10^{-230}:\\
\;\;\;\;\left(\left(angle \cdot \pi\right) \cdot a\_m\right) \cdot \left(-0.011111111111111112 \cdot a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(b \cdot b\right) \cdot \pi\right) \cdot angle\right) \cdot 0.011111111111111112\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -5.00000000000000035e-230Initial program 54.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6447.3
Applied rewrites47.3%
Taylor expanded in b around 0
Applied rewrites46.4%
Applied rewrites54.4%
if -5.00000000000000035e-230 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 54.4%
Taylor expanded in b around inf
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
Applied rewrites59.0%
Taylor expanded in angle around 0
Applied rewrites53.7%
Final simplification54.0%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(if (<= (/ angle 180.0) 3e+38)
(*
(*
(*
(fma
(* (* angle angle) -2.2862368541380886e-7)
(* (* PI PI) PI)
(* 0.011111111111111112 PI))
angle)
(- b a_m))
(+ a_m b))
(* (* (- b a_m) (+ a_m b)) (sin (* (* angle PI) 0.011111111111111112)))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 3e+38) {
tmp = ((fma(((angle * angle) * -2.2862368541380886e-7), ((((double) M_PI) * ((double) M_PI)) * ((double) M_PI)), (0.011111111111111112 * ((double) M_PI))) * angle) * (b - a_m)) * (a_m + b);
} else {
tmp = ((b - a_m) * (a_m + b)) * sin(((angle * ((double) M_PI)) * 0.011111111111111112));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 3e+38) tmp = Float64(Float64(Float64(fma(Float64(Float64(angle * angle) * -2.2862368541380886e-7), Float64(Float64(pi * pi) * pi), Float64(0.011111111111111112 * pi)) * angle) * Float64(b - a_m)) * Float64(a_m + b)); else tmp = Float64(Float64(Float64(b - a_m) * Float64(a_m + b)) * sin(Float64(Float64(angle * pi) * 0.011111111111111112))); end return tmp end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 3e+38], N[(N[(N[(N[(N[(N[(angle * angle), $MachinePrecision] * -2.2862368541380886e-7), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision] + N[(0.011111111111111112 * Pi), $MachinePrecision]), $MachinePrecision] * angle), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - a$95$m), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[(angle * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 3 \cdot 10^{+38}:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -2.2862368541380886 \cdot 10^{-7}, \left(\pi \cdot \pi\right) \cdot \pi, 0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \left(b - a\_m\right)\right) \cdot \left(a\_m + b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b - a\_m\right) \cdot \left(a\_m + b\right)\right) \cdot \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 3.0000000000000001e38Initial program 63.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites77.8%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow3N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6474.4
Applied rewrites74.4%
if 3.0000000000000001e38 < (/.f64 angle #s(literal 180 binary64)) Initial program 28.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites34.0%
Final simplification64.0%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(if (<= a_m 8.8e-111)
(* (* (sin (* (* angle PI) 0.011111111111111112)) b) (+ a_m b))
(if (<= a_m 3.8e+249)
(*
(*
(*
(fma
(* (* angle angle) -2.2862368541380886e-7)
(* (* PI PI) PI)
(* 0.011111111111111112 PI))
angle)
(- b a_m))
(+ a_m b))
(* (* (* (* (- b a_m) PI) angle) 0.011111111111111112) (+ a_m b)))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if (a_m <= 8.8e-111) {
tmp = (sin(((angle * ((double) M_PI)) * 0.011111111111111112)) * b) * (a_m + b);
} else if (a_m <= 3.8e+249) {
tmp = ((fma(((angle * angle) * -2.2862368541380886e-7), ((((double) M_PI) * ((double) M_PI)) * ((double) M_PI)), (0.011111111111111112 * ((double) M_PI))) * angle) * (b - a_m)) * (a_m + b);
} else {
tmp = ((((b - a_m) * ((double) M_PI)) * angle) * 0.011111111111111112) * (a_m + b);
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (a_m <= 8.8e-111) tmp = Float64(Float64(sin(Float64(Float64(angle * pi) * 0.011111111111111112)) * b) * Float64(a_m + b)); elseif (a_m <= 3.8e+249) tmp = Float64(Float64(Float64(fma(Float64(Float64(angle * angle) * -2.2862368541380886e-7), Float64(Float64(pi * pi) * pi), Float64(0.011111111111111112 * pi)) * angle) * Float64(b - a_m)) * Float64(a_m + b)); else tmp = Float64(Float64(Float64(Float64(Float64(b - a_m) * pi) * angle) * 0.011111111111111112) * Float64(a_m + b)); end return tmp end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[a$95$m, 8.8e-111], N[(N[(N[Sin[N[(N[(angle * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] * b), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a$95$m, 3.8e+249], N[(N[(N[(N[(N[(N[(angle * angle), $MachinePrecision] * -2.2862368541380886e-7), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision] + N[(0.011111111111111112 * Pi), $MachinePrecision]), $MachinePrecision] * angle), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(b - a$95$m), $MachinePrecision] * Pi), $MachinePrecision] * angle), $MachinePrecision] * 0.011111111111111112), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 8.8 \cdot 10^{-111}:\\
\;\;\;\;\left(\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right) \cdot b\right) \cdot \left(a\_m + b\right)\\
\mathbf{elif}\;a\_m \leq 3.8 \cdot 10^{+249}:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(\left(angle \cdot angle\right) \cdot -2.2862368541380886 \cdot 10^{-7}, \left(\pi \cdot \pi\right) \cdot \pi, 0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \left(b - a\_m\right)\right) \cdot \left(a\_m + b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\left(b - a\_m\right) \cdot \pi\right) \cdot angle\right) \cdot 0.011111111111111112\right) \cdot \left(a\_m + b\right)\\
\end{array}
\end{array}
if a < 8.8e-111Initial program 52.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites64.3%
Taylor expanded in b around inf
lower-*.f64N/A
lower-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6447.6
Applied rewrites47.6%
if 8.8e-111 < a < 3.7999999999999997e249Initial program 58.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites68.1%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow3N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6467.2
Applied rewrites67.2%
if 3.7999999999999997e249 < a Initial program 50.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites85.6%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-PI.f6478.6
Applied rewrites78.6%
Final simplification54.8%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (* (* (sin (* (* 0.011111111111111112 PI) angle)) (+ a_m b)) (- b a_m)))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
return (sin(((0.011111111111111112 * ((double) M_PI)) * angle)) * (a_m + b)) * (b - a_m);
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
return (Math.sin(((0.011111111111111112 * Math.PI) * angle)) * (a_m + b)) * (b - a_m);
}
a_m = math.fabs(a) def code(a_m, b, angle): return (math.sin(((0.011111111111111112 * math.pi) * angle)) * (a_m + b)) * (b - a_m)
a_m = abs(a) function code(a_m, b, angle) return Float64(Float64(sin(Float64(Float64(0.011111111111111112 * pi) * angle)) * Float64(a_m + b)) * Float64(b - a_m)) end
a_m = abs(a); function tmp = code(a_m, b, angle) tmp = (sin(((0.011111111111111112 * pi) * angle)) * (a_m + b)) * (b - a_m); end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := N[(N[(N[Sin[N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * angle), $MachinePrecision]], $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
\left(\sin \left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right) \cdot \left(a\_m + b\right)\right) \cdot \left(b - a\_m\right)
\end{array}
Initial program 54.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites66.5%
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6466.5
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6467.4
Applied rewrites67.4%
Final simplification67.4%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (* (* (sin (* (* angle PI) 0.011111111111111112)) (- b a_m)) (+ a_m b)))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
return (sin(((angle * ((double) M_PI)) * 0.011111111111111112)) * (b - a_m)) * (a_m + b);
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
return (Math.sin(((angle * Math.PI) * 0.011111111111111112)) * (b - a_m)) * (a_m + b);
}
a_m = math.fabs(a) def code(a_m, b, angle): return (math.sin(((angle * math.pi) * 0.011111111111111112)) * (b - a_m)) * (a_m + b)
a_m = abs(a) function code(a_m, b, angle) return Float64(Float64(sin(Float64(Float64(angle * pi) * 0.011111111111111112)) * Float64(b - a_m)) * Float64(a_m + b)) end
a_m = abs(a); function tmp = code(a_m, b, angle) tmp = (sin(((angle * pi) * 0.011111111111111112)) * (b - a_m)) * (a_m + b); end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := N[(N[(N[Sin[N[(N[(angle * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]], $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
\left(\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\_m\right)\right) \cdot \left(a\_m + b\right)
\end{array}
Initial program 54.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites66.5%
Final simplification66.5%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (* (* 0.011111111111111112 PI) angle)))
(if (<= (/ angle 180.0) 1e+147)
(/ (* t_0 (- b a_m)) (/ 1.0 (+ a_m b)))
(* (* (- a_m) (+ a_m b)) t_0))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double t_0 = (0.011111111111111112 * ((double) M_PI)) * angle;
double tmp;
if ((angle / 180.0) <= 1e+147) {
tmp = (t_0 * (b - a_m)) / (1.0 / (a_m + b));
} else {
tmp = (-a_m * (a_m + b)) * t_0;
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = (0.011111111111111112 * Math.PI) * angle;
double tmp;
if ((angle / 180.0) <= 1e+147) {
tmp = (t_0 * (b - a_m)) / (1.0 / (a_m + b));
} else {
tmp = (-a_m * (a_m + b)) * t_0;
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): t_0 = (0.011111111111111112 * math.pi) * angle tmp = 0 if (angle / 180.0) <= 1e+147: tmp = (t_0 * (b - a_m)) / (1.0 / (a_m + b)) else: tmp = (-a_m * (a_m + b)) * t_0 return tmp
a_m = abs(a) function code(a_m, b, angle) t_0 = Float64(Float64(0.011111111111111112 * pi) * angle) tmp = 0.0 if (Float64(angle / 180.0) <= 1e+147) tmp = Float64(Float64(t_0 * Float64(b - a_m)) / Float64(1.0 / Float64(a_m + b))); else tmp = Float64(Float64(Float64(-a_m) * Float64(a_m + b)) * t_0); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) t_0 = (0.011111111111111112 * pi) * angle; tmp = 0.0; if ((angle / 180.0) <= 1e+147) tmp = (t_0 * (b - a_m)) / (1.0 / (a_m + b)); else tmp = (-a_m * (a_m + b)) * t_0; end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * angle), $MachinePrecision]}, If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+147], N[(N[(t$95$0 * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(a$95$m + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-a$95$m) * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := \left(0.011111111111111112 \cdot \pi\right) \cdot angle\\
\mathbf{if}\;\frac{angle}{180} \leq 10^{+147}:\\
\;\;\;\;\frac{t\_0 \cdot \left(b - a\_m\right)}{\frac{1}{a\_m + b}}\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-a\_m\right) \cdot \left(a\_m + b\right)\right) \cdot t\_0\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999998e146Initial program 58.0%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6458.2
Applied rewrites58.2%
Applied rewrites64.7%
if 9.9999999999999998e146 < (/.f64 angle #s(literal 180 binary64)) Initial program 27.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6411.3
Applied rewrites11.3%
Taylor expanded in b around 0
Applied rewrites15.1%
Final simplification58.7%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= (/ angle 180.0) 1e+147) (* (* (* (* angle PI) 0.011111111111111112) (- b a_m)) (+ a_m b)) (* (* (- a_m) (+ a_m b)) (* (* 0.011111111111111112 PI) angle))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 1e+147) {
tmp = (((angle * ((double) M_PI)) * 0.011111111111111112) * (b - a_m)) * (a_m + b);
} else {
tmp = (-a_m * (a_m + b)) * ((0.011111111111111112 * ((double) M_PI)) * angle);
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 1e+147) {
tmp = (((angle * Math.PI) * 0.011111111111111112) * (b - a_m)) * (a_m + b);
} else {
tmp = (-a_m * (a_m + b)) * ((0.011111111111111112 * Math.PI) * angle);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): tmp = 0 if (angle / 180.0) <= 1e+147: tmp = (((angle * math.pi) * 0.011111111111111112) * (b - a_m)) * (a_m + b) else: tmp = (-a_m * (a_m + b)) * ((0.011111111111111112 * math.pi) * angle) return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 1e+147) tmp = Float64(Float64(Float64(Float64(angle * pi) * 0.011111111111111112) * Float64(b - a_m)) * Float64(a_m + b)); else tmp = Float64(Float64(Float64(-a_m) * Float64(a_m + b)) * Float64(Float64(0.011111111111111112 * pi) * angle)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) tmp = 0.0; if ((angle / 180.0) <= 1e+147) tmp = (((angle * pi) * 0.011111111111111112) * (b - a_m)) * (a_m + b); else tmp = (-a_m * (a_m + b)) * ((0.011111111111111112 * pi) * angle); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+147], N[(N[(N[(N[(angle * Pi), $MachinePrecision] * 0.011111111111111112), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision], N[(N[((-a$95$m) * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 10^{+147}:\\
\;\;\;\;\left(\left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right) \cdot \left(b - a\_m\right)\right) \cdot \left(a\_m + b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-a\_m\right) \cdot \left(a\_m + b\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999998e146Initial program 58.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift--.f64N/A
lift-pow.f64N/A
unpow2N/A
lift-pow.f64N/A
unpow2N/A
difference-of-squaresN/A
associate-*l*N/A
lower-*.f64N/A
Applied rewrites71.7%
Taylor expanded in angle around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f6464.7
Applied rewrites64.7%
if 9.9999999999999998e146 < (/.f64 angle #s(literal 180 binary64)) Initial program 27.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6411.3
Applied rewrites11.3%
Taylor expanded in b around 0
Applied rewrites15.1%
Final simplification58.7%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= (/ angle 180.0) 1e+147) (* (* (* (+ a_m b) PI) (* 0.011111111111111112 angle)) (- b a_m)) (* (* (- a_m) (+ a_m b)) (* (* 0.011111111111111112 PI) angle))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 1e+147) {
tmp = (((a_m + b) * ((double) M_PI)) * (0.011111111111111112 * angle)) * (b - a_m);
} else {
tmp = (-a_m * (a_m + b)) * ((0.011111111111111112 * ((double) M_PI)) * angle);
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 1e+147) {
tmp = (((a_m + b) * Math.PI) * (0.011111111111111112 * angle)) * (b - a_m);
} else {
tmp = (-a_m * (a_m + b)) * ((0.011111111111111112 * Math.PI) * angle);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): tmp = 0 if (angle / 180.0) <= 1e+147: tmp = (((a_m + b) * math.pi) * (0.011111111111111112 * angle)) * (b - a_m) else: tmp = (-a_m * (a_m + b)) * ((0.011111111111111112 * math.pi) * angle) return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 1e+147) tmp = Float64(Float64(Float64(Float64(a_m + b) * pi) * Float64(0.011111111111111112 * angle)) * Float64(b - a_m)); else tmp = Float64(Float64(Float64(-a_m) * Float64(a_m + b)) * Float64(Float64(0.011111111111111112 * pi) * angle)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) tmp = 0.0; if ((angle / 180.0) <= 1e+147) tmp = (((a_m + b) * pi) * (0.011111111111111112 * angle)) * (b - a_m); else tmp = (-a_m * (a_m + b)) * ((0.011111111111111112 * pi) * angle); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 1e+147], N[(N[(N[(N[(a$95$m + b), $MachinePrecision] * Pi), $MachinePrecision] * N[(0.011111111111111112 * angle), $MachinePrecision]), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[((-a$95$m) * N[(a$95$m + b), $MachinePrecision]), $MachinePrecision] * N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * angle), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 10^{+147}:\\
\;\;\;\;\left(\left(\left(a\_m + b\right) \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot angle\right)\right) \cdot \left(b - a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-a\_m\right) \cdot \left(a\_m + b\right)\right) \cdot \left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 9.9999999999999998e146Initial program 58.0%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6458.2
Applied rewrites58.2%
Applied rewrites64.7%
if 9.9999999999999998e146 < (/.f64 angle #s(literal 180 binary64)) Initial program 27.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6411.3
Applied rewrites11.3%
Taylor expanded in b around 0
Applied rewrites15.1%
Final simplification58.7%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= (/ angle 180.0) 0.0001) (* (* (* angle PI) a_m) (* -0.011111111111111112 a_m)) (* (* (* (* a_m a_m) -0.011111111111111112) PI) angle)))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 0.0001) {
tmp = ((angle * ((double) M_PI)) * a_m) * (-0.011111111111111112 * a_m);
} else {
tmp = (((a_m * a_m) * -0.011111111111111112) * ((double) M_PI)) * angle;
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 0.0001) {
tmp = ((angle * Math.PI) * a_m) * (-0.011111111111111112 * a_m);
} else {
tmp = (((a_m * a_m) * -0.011111111111111112) * Math.PI) * angle;
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): tmp = 0 if (angle / 180.0) <= 0.0001: tmp = ((angle * math.pi) * a_m) * (-0.011111111111111112 * a_m) else: tmp = (((a_m * a_m) * -0.011111111111111112) * math.pi) * angle return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 0.0001) tmp = Float64(Float64(Float64(angle * pi) * a_m) * Float64(-0.011111111111111112 * a_m)); else tmp = Float64(Float64(Float64(Float64(a_m * a_m) * -0.011111111111111112) * pi) * angle); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) tmp = 0.0; if ((angle / 180.0) <= 0.0001) tmp = ((angle * pi) * a_m) * (-0.011111111111111112 * a_m); else tmp = (((a_m * a_m) * -0.011111111111111112) * pi) * angle; end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 0.0001], N[(N[(N[(angle * Pi), $MachinePrecision] * a$95$m), $MachinePrecision] * N[(-0.011111111111111112 * a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(a$95$m * a$95$m), $MachinePrecision] * -0.011111111111111112), $MachinePrecision] * Pi), $MachinePrecision] * angle), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 0.0001:\\
\;\;\;\;\left(\left(angle \cdot \pi\right) \cdot a\_m\right) \cdot \left(-0.011111111111111112 \cdot a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(a\_m \cdot a\_m\right) \cdot -0.011111111111111112\right) \cdot \pi\right) \cdot angle\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000005e-4Initial program 64.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6462.7
Applied rewrites62.7%
Taylor expanded in b around 0
Applied rewrites37.1%
Applied rewrites40.2%
if 1.00000000000000005e-4 < (/.f64 angle #s(literal 180 binary64)) Initial program 29.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6427.4
Applied rewrites27.4%
Taylor expanded in b around 0
Applied rewrites23.8%
Applied rewrites23.8%
Final simplification35.5%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= (/ angle 180.0) 0.0001) (* (* (* angle PI) a_m) (* -0.011111111111111112 a_m)) (* (* (* a_m a_m) -0.011111111111111112) (* angle PI))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 0.0001) {
tmp = ((angle * ((double) M_PI)) * a_m) * (-0.011111111111111112 * a_m);
} else {
tmp = ((a_m * a_m) * -0.011111111111111112) * (angle * ((double) M_PI));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 0.0001) {
tmp = ((angle * Math.PI) * a_m) * (-0.011111111111111112 * a_m);
} else {
tmp = ((a_m * a_m) * -0.011111111111111112) * (angle * Math.PI);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): tmp = 0 if (angle / 180.0) <= 0.0001: tmp = ((angle * math.pi) * a_m) * (-0.011111111111111112 * a_m) else: tmp = ((a_m * a_m) * -0.011111111111111112) * (angle * math.pi) return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 0.0001) tmp = Float64(Float64(Float64(angle * pi) * a_m) * Float64(-0.011111111111111112 * a_m)); else tmp = Float64(Float64(Float64(a_m * a_m) * -0.011111111111111112) * Float64(angle * pi)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) tmp = 0.0; if ((angle / 180.0) <= 0.0001) tmp = ((angle * pi) * a_m) * (-0.011111111111111112 * a_m); else tmp = ((a_m * a_m) * -0.011111111111111112) * (angle * pi); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 0.0001], N[(N[(N[(angle * Pi), $MachinePrecision] * a$95$m), $MachinePrecision] * N[(-0.011111111111111112 * a$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a$95$m * a$95$m), $MachinePrecision] * -0.011111111111111112), $MachinePrecision] * N[(angle * Pi), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 0.0001:\\
\;\;\;\;\left(\left(angle \cdot \pi\right) \cdot a\_m\right) \cdot \left(-0.011111111111111112 \cdot a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a\_m \cdot a\_m\right) \cdot -0.011111111111111112\right) \cdot \left(angle \cdot \pi\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.00000000000000005e-4Initial program 64.2%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6462.7
Applied rewrites62.7%
Taylor expanded in b around 0
Applied rewrites37.1%
Applied rewrites40.2%
if 1.00000000000000005e-4 < (/.f64 angle #s(literal 180 binary64)) Initial program 29.9%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6427.4
Applied rewrites27.4%
Taylor expanded in b around 0
Applied rewrites23.8%
Final simplification35.5%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (* (* (* angle PI) a_m) (* -0.011111111111111112 a_m)))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
return ((angle * ((double) M_PI)) * a_m) * (-0.011111111111111112 * a_m);
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
return ((angle * Math.PI) * a_m) * (-0.011111111111111112 * a_m);
}
a_m = math.fabs(a) def code(a_m, b, angle): return ((angle * math.pi) * a_m) * (-0.011111111111111112 * a_m)
a_m = abs(a) function code(a_m, b, angle) return Float64(Float64(Float64(angle * pi) * a_m) * Float64(-0.011111111111111112 * a_m)) end
a_m = abs(a); function tmp = code(a_m, b, angle) tmp = ((angle * pi) * a_m) * (-0.011111111111111112 * a_m); end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := N[(N[(N[(angle * Pi), $MachinePrecision] * a$95$m), $MachinePrecision] * N[(-0.011111111111111112 * a$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
\left(\left(angle \cdot \pi\right) \cdot a\_m\right) \cdot \left(-0.011111111111111112 \cdot a\_m\right)
\end{array}
Initial program 54.3%
Taylor expanded in angle around 0
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6452.5
Applied rewrites52.5%
Taylor expanded in b around 0
Applied rewrites33.3%
Applied rewrites35.4%
Final simplification35.4%
herbie shell --seed 2024236
(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)))))