
(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 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}
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= a_m 4e+191) (* (+ a_m b) (* (- b a_m) (sin (* (* 0.011111111111111112 PI) angle)))) (/ (* (+ a_m b) (* PI (* 0.011111111111111112 angle))) (/ 1.0 (- b a_m)))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if (a_m <= 4e+191) {
tmp = (a_m + b) * ((b - a_m) * sin(((0.011111111111111112 * ((double) M_PI)) * angle)));
} else {
tmp = ((a_m + b) * (((double) M_PI) * (0.011111111111111112 * angle))) / (1.0 / (b - a_m));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double tmp;
if (a_m <= 4e+191) {
tmp = (a_m + b) * ((b - a_m) * Math.sin(((0.011111111111111112 * Math.PI) * angle)));
} else {
tmp = ((a_m + b) * (Math.PI * (0.011111111111111112 * angle))) / (1.0 / (b - a_m));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): tmp = 0 if a_m <= 4e+191: tmp = (a_m + b) * ((b - a_m) * math.sin(((0.011111111111111112 * math.pi) * angle))) else: tmp = ((a_m + b) * (math.pi * (0.011111111111111112 * angle))) / (1.0 / (b - a_m)) return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (a_m <= 4e+191) tmp = Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * sin(Float64(Float64(0.011111111111111112 * pi) * angle)))); else tmp = Float64(Float64(Float64(a_m + b) * Float64(pi * Float64(0.011111111111111112 * angle))) / Float64(1.0 / Float64(b - a_m))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) tmp = 0.0; if (a_m <= 4e+191) tmp = (a_m + b) * ((b - a_m) * sin(((0.011111111111111112 * pi) * angle))); else tmp = ((a_m + b) * (pi * (0.011111111111111112 * angle))) / (1.0 / (b - a_m)); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[a$95$m, 4e+191], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[Sin[N[(N[(0.011111111111111112 * Pi), $MachinePrecision] * angle), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(Pi * N[(0.011111111111111112 * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;a\_m \leq 4 \cdot 10^{+191}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \sin \left(\left(0.011111111111111112 \cdot \pi\right) \cdot angle\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(a\_m + b\right) \cdot \left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right)}{\frac{1}{b - a\_m}}\\
\end{array}
\end{array}
if a < 4.00000000000000029e191Initial program 52.5%
Applied rewrites62.9%
lift-PI.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6464.5
Applied rewrites64.5%
if 4.00000000000000029e191 < a Initial program 50.2%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6483.5
Applied rewrites83.5%
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lift--.f64N/A
flip3--N/A
clear-numN/A
clear-numN/A
flip3--N/A
lift--.f64N/A
un-div-invN/A
lower-/.f64N/A
Applied rewrites87.5%
Final simplification66.7%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(let* ((t_0 (- (pow b 2.0) (pow a_m 2.0)))
(t_1 (* PI (* 0.011111111111111112 angle))))
(if (<= t_0 (- INFINITY))
(* (+ a_m b) (* (* 0.011111111111111112 angle) (* (- b a_m) PI)))
(if (<= t_0 5e+284)
(* (* (+ a_m b) (- b a_m)) (sin t_1))
(/ (* (+ a_m b) t_1) (/ 1.0 (- b a_m)))))))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 = ((double) M_PI) * (0.011111111111111112 * angle);
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * ((double) M_PI)));
} else if (t_0 <= 5e+284) {
tmp = ((a_m + b) * (b - a_m)) * sin(t_1);
} else {
tmp = ((a_m + b) * t_1) / (1.0 / (b - a_m));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = Math.pow(b, 2.0) - Math.pow(a_m, 2.0);
double t_1 = Math.PI * (0.011111111111111112 * angle);
double tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * Math.PI));
} else if (t_0 <= 5e+284) {
tmp = ((a_m + b) * (b - a_m)) * Math.sin(t_1);
} else {
tmp = ((a_m + b) * t_1) / (1.0 / (b - a_m));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): t_0 = math.pow(b, 2.0) - math.pow(a_m, 2.0) t_1 = math.pi * (0.011111111111111112 * angle) tmp = 0 if t_0 <= -math.inf: tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * math.pi)) elif t_0 <= 5e+284: tmp = ((a_m + b) * (b - a_m)) * math.sin(t_1) else: tmp = ((a_m + b) * t_1) / (1.0 / (b - a_m)) 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(pi * Float64(0.011111111111111112 * angle)) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(a_m + b) * Float64(Float64(0.011111111111111112 * angle) * Float64(Float64(b - a_m) * pi))); elseif (t_0 <= 5e+284) tmp = Float64(Float64(Float64(a_m + b) * Float64(b - a_m)) * sin(t_1)); else tmp = Float64(Float64(Float64(a_m + b) * t_1) / Float64(1.0 / Float64(b - a_m))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) t_0 = (b ^ 2.0) - (a_m ^ 2.0); t_1 = pi * (0.011111111111111112 * angle); tmp = 0.0; if (t_0 <= -Inf) tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * pi)); elseif (t_0 <= 5e+284) tmp = ((a_m + b) * (b - a_m)) * sin(t_1); else tmp = ((a_m + b) * t_1) / (1.0 / (b - a_m)); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(Pi * N[(0.011111111111111112 * angle), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(0.011111111111111112 * angle), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+284], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision], N[(N[(N[(a$95$m + b), $MachinePrecision] * t$95$1), $MachinePrecision] / N[(1.0 / N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := {b}^{2} - {a\_m}^{2}\\
t_1 := \pi \cdot \left(0.011111111111111112 \cdot angle\right)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(0.011111111111111112 \cdot angle\right) \cdot \left(\left(b - a\_m\right) \cdot \pi\right)\right)\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+284}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(b - a\_m\right)\right) \cdot \sin t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(a\_m + b\right) \cdot t\_1}{\frac{1}{b - a\_m}}\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 49.9%
Applied rewrites72.2%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6482.9
Applied rewrites82.9%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 4.9999999999999999e284Initial program 58.4%
Applied rewrites58.0%
lift-+.f64N/A
lift--.f64N/A
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*r*N/A
lift-+.f64N/A
lift--.f64N/A
difference-of-squaresN/A
pow2N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
lift--.f64N/A
lower-*.f6458.0
Applied rewrites58.2%
if 4.9999999999999999e284 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 39.2%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6457.6
Applied rewrites57.6%
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
associate-*r*N/A
lift--.f64N/A
flip3--N/A
clear-numN/A
clear-numN/A
flip3--N/A
lift--.f64N/A
un-div-invN/A
lower-/.f64N/A
Applied rewrites72.6%
Final simplification66.1%
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 (sin (* 0.011111111111111112 (* PI angle)))))
(if (<= t_0 (- INFINITY))
(* (+ a_m b) (* (* 0.011111111111111112 angle) (* (- b a_m) PI)))
(if (<= t_0 4e-306) (* (+ a_m b) (* t_1 (- a_m))) (* b (* b 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 = sin((0.011111111111111112 * (((double) M_PI) * angle)));
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * ((double) M_PI)));
} else if (t_0 <= 4e-306) {
tmp = (a_m + b) * (t_1 * -a_m);
} else {
tmp = b * (b * t_1);
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = Math.pow(b, 2.0) - Math.pow(a_m, 2.0);
double t_1 = Math.sin((0.011111111111111112 * (Math.PI * angle)));
double tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * Math.PI));
} else if (t_0 <= 4e-306) {
tmp = (a_m + b) * (t_1 * -a_m);
} else {
tmp = b * (b * t_1);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): t_0 = math.pow(b, 2.0) - math.pow(a_m, 2.0) t_1 = math.sin((0.011111111111111112 * (math.pi * angle))) tmp = 0 if t_0 <= -math.inf: tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * math.pi)) elif t_0 <= 4e-306: tmp = (a_m + b) * (t_1 * -a_m) else: tmp = b * (b * 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 = sin(Float64(0.011111111111111112 * Float64(pi * angle))) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(a_m + b) * Float64(Float64(0.011111111111111112 * angle) * Float64(Float64(b - a_m) * pi))); elseif (t_0 <= 4e-306) tmp = Float64(Float64(a_m + b) * Float64(t_1 * Float64(-a_m))); else tmp = Float64(b * Float64(b * t_1)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) t_0 = (b ^ 2.0) - (a_m ^ 2.0); t_1 = sin((0.011111111111111112 * (pi * angle))); tmp = 0.0; if (t_0 <= -Inf) tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * pi)); elseif (t_0 <= 4e-306) tmp = (a_m + b) * (t_1 * -a_m); else tmp = b * (b * t_1); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(0.011111111111111112 * angle), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e-306], N[(N[(a$95$m + b), $MachinePrecision] * N[(t$95$1 * (-a$95$m)), $MachinePrecision]), $MachinePrecision], N[(b * N[(b * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := {b}^{2} - {a\_m}^{2}\\
t_1 := \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(0.011111111111111112 \cdot angle\right) \cdot \left(\left(b - a\_m\right) \cdot \pi\right)\right)\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{-306}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(t\_1 \cdot \left(-a\_m\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot t\_1\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 49.9%
Applied rewrites72.2%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6482.9
Applied rewrites82.9%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 4.00000000000000011e-306Initial program 63.8%
Applied rewrites64.2%
Taylor expanded in b around 0
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
mul-1-negN/A
lower-neg.f6464.2
Applied rewrites64.2%
if 4.00000000000000011e-306 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 45.3%
Applied rewrites59.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6452.9
Applied rewrites52.9%
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6460.3
lift-*.f64N/A
*-commutativeN/A
lift-*.f6460.3
Applied rewrites60.3%
Final simplification65.8%
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 (sin (* 0.011111111111111112 (* PI angle)))))
(if (<= t_0 (- INFINITY))
(* (+ a_m b) (* (* 0.011111111111111112 angle) (* (- b a_m) PI)))
(if (<= t_0 4e-306) (* t_1 (- (* a_m a_m))) (* b (* b 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 = sin((0.011111111111111112 * (((double) M_PI) * angle)));
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * ((double) M_PI)));
} else if (t_0 <= 4e-306) {
tmp = t_1 * -(a_m * a_m);
} else {
tmp = b * (b * t_1);
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double t_0 = Math.pow(b, 2.0) - Math.pow(a_m, 2.0);
double t_1 = Math.sin((0.011111111111111112 * (Math.PI * angle)));
double tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * Math.PI));
} else if (t_0 <= 4e-306) {
tmp = t_1 * -(a_m * a_m);
} else {
tmp = b * (b * t_1);
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): t_0 = math.pow(b, 2.0) - math.pow(a_m, 2.0) t_1 = math.sin((0.011111111111111112 * (math.pi * angle))) tmp = 0 if t_0 <= -math.inf: tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * math.pi)) elif t_0 <= 4e-306: tmp = t_1 * -(a_m * a_m) else: tmp = b * (b * 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 = sin(Float64(0.011111111111111112 * Float64(pi * angle))) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(a_m + b) * Float64(Float64(0.011111111111111112 * angle) * Float64(Float64(b - a_m) * pi))); elseif (t_0 <= 4e-306) tmp = Float64(t_1 * Float64(-Float64(a_m * a_m))); else tmp = Float64(b * Float64(b * t_1)); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) t_0 = (b ^ 2.0) - (a_m ^ 2.0); t_1 = sin((0.011111111111111112 * (pi * angle))); tmp = 0.0; if (t_0 <= -Inf) tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * pi)); elseif (t_0 <= 4e-306) tmp = t_1 * -(a_m * a_m); else tmp = b * (b * t_1); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision]
code[a$95$m_, b_, angle_] := Block[{t$95$0 = N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a$95$m, 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(0.011111111111111112 * angle), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e-306], N[(t$95$1 * (-N[(a$95$m * a$95$m), $MachinePrecision])), $MachinePrecision], N[(b * N[(b * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
t_0 := {b}^{2} - {a\_m}^{2}\\
t_1 := \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(0.011111111111111112 \cdot angle\right) \cdot \left(\left(b - a\_m\right) \cdot \pi\right)\right)\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{-306}:\\
\;\;\;\;t\_1 \cdot \left(-a\_m \cdot a\_m\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot t\_1\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -inf.0Initial program 49.9%
Applied rewrites72.2%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6482.9
Applied rewrites82.9%
if -inf.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 4.00000000000000011e-306Initial program 63.8%
Applied rewrites64.2%
Taylor expanded in b around 0
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6464.2
Applied rewrites64.2%
if 4.00000000000000011e-306 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 45.3%
Applied rewrites59.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6452.9
Applied rewrites52.9%
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6460.3
lift-*.f64N/A
*-commutativeN/A
lift-*.f6460.3
Applied rewrites60.3%
Final simplification65.8%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= (- (pow b 2.0) (pow a_m 2.0)) -5e-244) (* (* a_m -0.011111111111111112) (* a_m (* PI angle))) (* b (* b (sin (* 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)) <= -5e-244) {
tmp = (a_m * -0.011111111111111112) * (a_m * (((double) M_PI) * angle));
} else {
tmp = b * (b * sin((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)) <= -5e-244) {
tmp = (a_m * -0.011111111111111112) * (a_m * (Math.PI * angle));
} else {
tmp = b * (b * Math.sin((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)) <= -5e-244: tmp = (a_m * -0.011111111111111112) * (a_m * (math.pi * angle)) else: tmp = b * (b * math.sin((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)) <= -5e-244) tmp = Float64(Float64(a_m * -0.011111111111111112) * Float64(a_m * Float64(pi * angle))); else tmp = Float64(b * Float64(b * sin(Float64(0.011111111111111112 * Float64(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)) <= -5e-244) tmp = (a_m * -0.011111111111111112) * (a_m * (pi * angle)); else tmp = b * (b * sin((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], -5e-244], N[(N[(a$95$m * -0.011111111111111112), $MachinePrecision] * N[(a$95$m * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(b * N[(b * N[Sin[N[(0.011111111111111112 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq -5 \cdot 10^{-244}:\\
\;\;\;\;\left(a\_m \cdot -0.011111111111111112\right) \cdot \left(a\_m \cdot \left(\pi \cdot angle\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(b \cdot \sin \left(0.011111111111111112 \cdot \left(\pi \cdot angle\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < -4.99999999999999998e-244Initial program 53.2%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6456.2
Applied rewrites56.2%
Taylor expanded in b around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6456.0
Applied rewrites56.0%
associate-*r*N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6464.1
lift-*.f64N/A
*-commutativeN/A
lift-*.f6464.1
Applied rewrites64.1%
if -4.99999999999999998e-244 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 51.6%
Applied rewrites63.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6457.6
Applied rewrites57.6%
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6463.8
lift-*.f64N/A
*-commutativeN/A
lift-*.f6463.8
Applied rewrites63.8%
Final simplification63.9%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= (- (pow b 2.0) (pow a_m 2.0)) 0.0) (* (* a_m -0.011111111111111112) (* a_m (* PI angle))) (* 0.011111111111111112 (* b (* b (* 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)) <= 0.0) {
tmp = (a_m * -0.011111111111111112) * (a_m * (((double) M_PI) * angle));
} else {
tmp = 0.011111111111111112 * (b * (b * (((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)) <= 0.0) {
tmp = (a_m * -0.011111111111111112) * (a_m * (Math.PI * angle));
} else {
tmp = 0.011111111111111112 * (b * (b * (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)) <= 0.0: tmp = (a_m * -0.011111111111111112) * (a_m * (math.pi * angle)) else: tmp = 0.011111111111111112 * (b * (b * (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)) <= 0.0) tmp = Float64(Float64(a_m * -0.011111111111111112) * Float64(a_m * Float64(pi * angle))); else tmp = Float64(0.011111111111111112 * Float64(b * Float64(b * Float64(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)) <= 0.0) tmp = (a_m * -0.011111111111111112) * (a_m * (pi * angle)); else tmp = 0.011111111111111112 * (b * (b * (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], 0.0], N[(N[(a$95$m * -0.011111111111111112), $MachinePrecision] * N[(a$95$m * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(b * N[(b * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq 0:\\
\;\;\;\;\left(a\_m \cdot -0.011111111111111112\right) \cdot \left(a\_m \cdot \left(\pi \cdot angle\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(b \cdot \left(\pi \cdot angle\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 0.0Initial program 59.2%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6461.0
Applied rewrites61.0%
Taylor expanded in b around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6460.9
Applied rewrites60.9%
associate-*r*N/A
lift-PI.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6464.9
lift-*.f64N/A
*-commutativeN/A
lift-*.f6464.9
Applied rewrites64.9%
if 0.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 45.0%
Applied rewrites58.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6452.6
Applied rewrites52.6%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6449.3
Applied rewrites49.3%
lift-PI.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6456.6
lift-*.f64N/A
*-commutativeN/A
lift-*.f6456.6
Applied rewrites56.6%
Final simplification60.9%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= (- (pow b 2.0) (pow a_m 2.0)) 0.0) (* PI (* -0.011111111111111112 (* angle (* a_m a_m)))) (* 0.011111111111111112 (* b (* b (* 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)) <= 0.0) {
tmp = ((double) M_PI) * (-0.011111111111111112 * (angle * (a_m * a_m)));
} else {
tmp = 0.011111111111111112 * (b * (b * (((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)) <= 0.0) {
tmp = Math.PI * (-0.011111111111111112 * (angle * (a_m * a_m)));
} else {
tmp = 0.011111111111111112 * (b * (b * (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)) <= 0.0: tmp = math.pi * (-0.011111111111111112 * (angle * (a_m * a_m))) else: tmp = 0.011111111111111112 * (b * (b * (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)) <= 0.0) tmp = Float64(pi * Float64(-0.011111111111111112 * Float64(angle * Float64(a_m * a_m)))); else tmp = Float64(0.011111111111111112 * Float64(b * Float64(b * Float64(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)) <= 0.0) tmp = pi * (-0.011111111111111112 * (angle * (a_m * a_m))); else tmp = 0.011111111111111112 * (b * (b * (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], 0.0], N[(Pi * N[(-0.011111111111111112 * N[(angle * N[(a$95$m * a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(b * N[(b * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq 0:\\
\;\;\;\;\pi \cdot \left(-0.011111111111111112 \cdot \left(angle \cdot \left(a\_m \cdot a\_m\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(b \cdot \left(\pi \cdot angle\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 0.0Initial program 59.2%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6461.0
Applied rewrites61.0%
Taylor expanded in b around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6460.9
Applied rewrites60.9%
lift-*.f64N/A
lift-*.f64N/A
lift-PI.f64N/A
associate-*r*N/A
lower-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6461.0
Applied rewrites61.0%
if 0.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 45.0%
Applied rewrites58.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6452.6
Applied rewrites52.6%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6449.3
Applied rewrites49.3%
lift-PI.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6456.6
lift-*.f64N/A
*-commutativeN/A
lift-*.f6456.6
Applied rewrites56.6%
Final simplification58.9%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= (- (pow b 2.0) (pow a_m 2.0)) 0.0) (* (* PI angle) (* (* a_m a_m) -0.011111111111111112)) (* 0.011111111111111112 (* b (* b (* 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)) <= 0.0) {
tmp = (((double) M_PI) * angle) * ((a_m * a_m) * -0.011111111111111112);
} else {
tmp = 0.011111111111111112 * (b * (b * (((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)) <= 0.0) {
tmp = (Math.PI * angle) * ((a_m * a_m) * -0.011111111111111112);
} else {
tmp = 0.011111111111111112 * (b * (b * (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)) <= 0.0: tmp = (math.pi * angle) * ((a_m * a_m) * -0.011111111111111112) else: tmp = 0.011111111111111112 * (b * (b * (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)) <= 0.0) tmp = Float64(Float64(pi * angle) * Float64(Float64(a_m * a_m) * -0.011111111111111112)); else tmp = Float64(0.011111111111111112 * Float64(b * Float64(b * Float64(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)) <= 0.0) tmp = (pi * angle) * ((a_m * a_m) * -0.011111111111111112); else tmp = 0.011111111111111112 * (b * (b * (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], 0.0], N[(N[(Pi * angle), $MachinePrecision] * N[(N[(a$95$m * a$95$m), $MachinePrecision] * -0.011111111111111112), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(b * N[(b * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;{b}^{2} - {a\_m}^{2} \leq 0:\\
\;\;\;\;\left(\pi \cdot angle\right) \cdot \left(\left(a\_m \cdot a\_m\right) \cdot -0.011111111111111112\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(b \cdot \left(\pi \cdot angle\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) < 0.0Initial program 59.2%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6461.0
Applied rewrites61.0%
Taylor expanded in b around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f6460.9
Applied rewrites60.9%
if 0.0 < (-.f64 (pow.f64 b #s(literal 2 binary64)) (pow.f64 a #s(literal 2 binary64))) Initial program 45.0%
Applied rewrites58.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6452.6
Applied rewrites52.6%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6449.3
Applied rewrites49.3%
lift-PI.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6456.6
lift-*.f64N/A
*-commutativeN/A
lift-*.f6456.6
Applied rewrites56.6%
Final simplification58.8%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(if (<= (/ angle 180.0) 500000.0)
(*
(+ a_m b)
(*
(- b a_m)
(*
angle
(fma
(* -2.2862368541380886e-7 (* angle angle))
(* PI (* PI PI))
(* 0.011111111111111112 PI)))))
(* (* PI (* 0.011111111111111112 angle)) (* (+ a_m b) (- b a_m)))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 500000.0) {
tmp = (a_m + b) * ((b - a_m) * (angle * fma((-2.2862368541380886e-7 * (angle * angle)), (((double) M_PI) * (((double) M_PI) * ((double) M_PI))), (0.011111111111111112 * ((double) M_PI)))));
} else {
tmp = (((double) M_PI) * (0.011111111111111112 * angle)) * ((a_m + b) * (b - a_m));
}
return tmp;
}
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 500000.0) tmp = Float64(Float64(a_m + b) * Float64(Float64(b - a_m) * Float64(angle * fma(Float64(-2.2862368541380886e-7 * Float64(angle * angle)), Float64(pi * Float64(pi * pi)), Float64(0.011111111111111112 * pi))))); else tmp = Float64(Float64(pi * Float64(0.011111111111111112 * angle)) * Float64(Float64(a_m + b) * Float64(b - a_m))); end return tmp end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 500000.0], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * N[(angle * N[(N[(-2.2862368541380886e-7 * N[(angle * angle), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision] + N[(0.011111111111111112 * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * N[(0.011111111111111112 * angle), $MachinePrecision]), $MachinePrecision] * N[(N[(a$95$m + b), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 500000:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(b - a\_m\right) \cdot \left(angle \cdot \mathsf{fma}\left(-2.2862368541380886 \cdot 10^{-7} \cdot \left(angle \cdot angle\right), \pi \cdot \left(\pi \cdot \pi\right), 0.011111111111111112 \cdot \pi\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right) \cdot \left(\left(a\_m + b\right) \cdot \left(b - a\_m\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 5e5Initial program 58.8%
Applied rewrites72.0%
Taylor expanded in angle around 0
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
cube-multN/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-PI.f6467.0
Applied rewrites67.0%
if 5e5 < (/.f64 angle #s(literal 180 binary64)) Initial program 35.0%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6442.2
Applied rewrites42.2%
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
pow2N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6435.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squaresN/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f6442.2
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6442.2
Applied rewrites42.2%
Final simplification60.2%
a_m = (fabs.f64 a)
(FPCore (a_m b angle)
:precision binary64
(if (<= (/ angle 180.0) 2e-14)
(* (+ a_m b) (* (* 0.011111111111111112 angle) (* (- b a_m) PI)))
(*
(* (+ a_m b) (- b a_m))
(* (sqrt PI) (* (* 0.011111111111111112 angle) (sqrt PI))))))a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 2e-14) {
tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * ((double) M_PI)));
} else {
tmp = ((a_m + b) * (b - a_m)) * (sqrt(((double) M_PI)) * ((0.011111111111111112 * angle) * sqrt(((double) M_PI))));
}
return tmp;
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 2e-14) {
tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * Math.PI));
} else {
tmp = ((a_m + b) * (b - a_m)) * (Math.sqrt(Math.PI) * ((0.011111111111111112 * angle) * Math.sqrt(Math.PI)));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): tmp = 0 if (angle / 180.0) <= 2e-14: tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * math.pi)) else: tmp = ((a_m + b) * (b - a_m)) * (math.sqrt(math.pi) * ((0.011111111111111112 * angle) * math.sqrt(math.pi))) return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 2e-14) tmp = Float64(Float64(a_m + b) * Float64(Float64(0.011111111111111112 * angle) * Float64(Float64(b - a_m) * pi))); else tmp = Float64(Float64(Float64(a_m + b) * Float64(b - a_m)) * Float64(sqrt(pi) * Float64(Float64(0.011111111111111112 * angle) * sqrt(pi)))); end return tmp end
a_m = abs(a); function tmp_2 = code(a_m, b, angle) tmp = 0.0; if ((angle / 180.0) <= 2e-14) tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * pi)); else tmp = ((a_m + b) * (b - a_m)) * (sqrt(pi) * ((0.011111111111111112 * angle) * sqrt(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], 2e-14], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(0.011111111111111112 * angle), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a$95$m + b), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[Pi], $MachinePrecision] * N[(N[(0.011111111111111112 * angle), $MachinePrecision] * N[Sqrt[Pi], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-14}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(0.011111111111111112 \cdot angle\right) \cdot \left(\left(b - a\_m\right) \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a\_m + b\right) \cdot \left(b - a\_m\right)\right) \cdot \left(\sqrt{\pi} \cdot \left(\left(0.011111111111111112 \cdot angle\right) \cdot \sqrt{\pi}\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 2e-14Initial program 58.0%
Applied rewrites71.5%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6471.0
Applied rewrites71.0%
if 2e-14 < (/.f64 angle #s(literal 180 binary64)) Initial program 38.2%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6443.6
Applied rewrites43.6%
lift-PI.f64N/A
associate-*r*N/A
lift-PI.f64N/A
add-sqr-sqrtN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-PI.f64N/A
lower-sqrt.f64N/A
lift-PI.f64N/A
lower-sqrt.f6443.6
Applied rewrites43.6%
Final simplification63.1%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (if (<= (/ angle 180.0) 2e-64) (* (+ a_m b) (* (* 0.011111111111111112 angle) (* (- b a_m) PI))) (* (* PI (* 0.011111111111111112 angle)) (* (+ a_m b) (- b a_m)))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
double tmp;
if ((angle / 180.0) <= 2e-64) {
tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * ((double) M_PI)));
} else {
tmp = (((double) M_PI) * (0.011111111111111112 * angle)) * ((a_m + 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 ((angle / 180.0) <= 2e-64) {
tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * Math.PI));
} else {
tmp = (Math.PI * (0.011111111111111112 * angle)) * ((a_m + b) * (b - a_m));
}
return tmp;
}
a_m = math.fabs(a) def code(a_m, b, angle): tmp = 0 if (angle / 180.0) <= 2e-64: tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * math.pi)) else: tmp = (math.pi * (0.011111111111111112 * angle)) * ((a_m + b) * (b - a_m)) return tmp
a_m = abs(a) function code(a_m, b, angle) tmp = 0.0 if (Float64(angle / 180.0) <= 2e-64) tmp = Float64(Float64(a_m + b) * Float64(Float64(0.011111111111111112 * angle) * Float64(Float64(b - a_m) * pi))); else tmp = Float64(Float64(pi * Float64(0.011111111111111112 * angle)) * Float64(Float64(a_m + 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 ((angle / 180.0) <= 2e-64) tmp = (a_m + b) * ((0.011111111111111112 * angle) * ((b - a_m) * pi)); else tmp = (pi * (0.011111111111111112 * angle)) * ((a_m + b) * (b - a_m)); end tmp_2 = tmp; end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := If[LessEqual[N[(angle / 180.0), $MachinePrecision], 2e-64], N[(N[(a$95$m + b), $MachinePrecision] * N[(N[(0.011111111111111112 * angle), $MachinePrecision] * N[(N[(b - a$95$m), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * N[(0.011111111111111112 * angle), $MachinePrecision]), $MachinePrecision] * N[(N[(a$95$m + b), $MachinePrecision] * N[(b - a$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
a_m = \left|a\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{angle}{180} \leq 2 \cdot 10^{-64}:\\
\;\;\;\;\left(a\_m + b\right) \cdot \left(\left(0.011111111111111112 \cdot angle\right) \cdot \left(\left(b - a\_m\right) \cdot \pi\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\pi \cdot \left(0.011111111111111112 \cdot angle\right)\right) \cdot \left(\left(a\_m + b\right) \cdot \left(b - a\_m\right)\right)\\
\end{array}
\end{array}
if (/.f64 angle #s(literal 180 binary64)) < 1.99999999999999993e-64Initial program 55.3%
Applied rewrites69.3%
Taylor expanded in angle around 0
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower--.f6468.8
Applied rewrites68.8%
if 1.99999999999999993e-64 < (/.f64 angle #s(literal 180 binary64)) Initial program 46.3%
Taylor expanded in angle around 0
associate-*r*N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
unpow2N/A
difference-of-squaresN/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6452.0
Applied rewrites52.0%
lift-PI.f64N/A
lift-*.f64N/A
lift-*.f64N/A
difference-of-squaresN/A
pow2N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6445.1
lift--.f64N/A
lift-pow.f64N/A
pow2N/A
lift-pow.f64N/A
pow2N/A
difference-of-squaresN/A
lift-+.f64N/A
lift--.f64N/A
lift-*.f6452.0
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6452.0
Applied rewrites52.0%
Final simplification63.1%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (* 0.011111111111111112 (* b (* b (* PI angle)))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
return 0.011111111111111112 * (b * (b * (((double) M_PI) * angle)));
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
return 0.011111111111111112 * (b * (b * (Math.PI * angle)));
}
a_m = math.fabs(a) def code(a_m, b, angle): return 0.011111111111111112 * (b * (b * (math.pi * angle)))
a_m = abs(a) function code(a_m, b, angle) return Float64(0.011111111111111112 * Float64(b * Float64(b * Float64(pi * angle)))) end
a_m = abs(a); function tmp = code(a_m, b, angle) tmp = 0.011111111111111112 * (b * (b * (pi * angle))); end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := N[(0.011111111111111112 * N[(b * N[(b * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
0.011111111111111112 \cdot \left(b \cdot \left(b \cdot \left(\pi \cdot angle\right)\right)\right)
\end{array}
Initial program 52.3%
Applied rewrites63.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6436.7
Applied rewrites36.7%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6436.8
Applied rewrites36.8%
lift-PI.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6438.9
lift-*.f64N/A
*-commutativeN/A
lift-*.f6438.9
Applied rewrites38.9%
Final simplification38.9%
a_m = (fabs.f64 a) (FPCore (a_m b angle) :precision binary64 (* 0.011111111111111112 (* angle (* PI (* b b)))))
a_m = fabs(a);
double code(double a_m, double b, double angle) {
return 0.011111111111111112 * (angle * (((double) M_PI) * (b * b)));
}
a_m = Math.abs(a);
public static double code(double a_m, double b, double angle) {
return 0.011111111111111112 * (angle * (Math.PI * (b * b)));
}
a_m = math.fabs(a) def code(a_m, b, angle): return 0.011111111111111112 * (angle * (math.pi * (b * b)))
a_m = abs(a) function code(a_m, b, angle) return Float64(0.011111111111111112 * Float64(angle * Float64(pi * Float64(b * b)))) end
a_m = abs(a); function tmp = code(a_m, b, angle) tmp = 0.011111111111111112 * (angle * (pi * (b * b))); end
a_m = N[Abs[a], $MachinePrecision] code[a$95$m_, b_, angle_] := N[(0.011111111111111112 * N[(angle * N[(Pi * N[(b * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
a_m = \left|a\right|
\\
0.011111111111111112 \cdot \left(angle \cdot \left(\pi \cdot \left(b \cdot b\right)\right)\right)
\end{array}
Initial program 52.3%
Applied rewrites63.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6436.7
Applied rewrites36.7%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-PI.f64N/A
unpow2N/A
lower-*.f6436.8
Applied rewrites36.8%
herbie shell --seed 2024214
(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)))))