
(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}
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}
Herbie found 15 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}
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}
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (- (fabs b) a))
(t_1 (+ a (fabs b)))
(t_2 (* PI (fabs angle)))
(t_3 (* PI (exp (* (log (/ 180.0 (fabs angle))) -1.0)))))
(*
(copysign 1.0 angle)
(if (<= (fabs angle) 5.2e+46)
(*
(+ (fabs b) a)
(*
(* 2.0 t_0)
(*
(sin (fma t_2 0.005555555555555556 (* PI 0.5)))
(sin (* 0.005555555555555556 t_2)))))
(if (<= (fabs angle) 8.8e+165)
(* (* (* t_1 (* t_0 2.0)) (sin t_3)) (cos t_3))
(*
t_1
(*
t_0
(sin
(*
(log (exp (* PI 0.011111111111111112)))
(fabs angle))))))))))double code(double a, double b, double angle) {
double t_0 = fabs(b) - a;
double t_1 = a + fabs(b);
double t_2 = ((double) M_PI) * fabs(angle);
double t_3 = ((double) M_PI) * exp((log((180.0 / fabs(angle))) * -1.0));
double tmp;
if (fabs(angle) <= 5.2e+46) {
tmp = (fabs(b) + a) * ((2.0 * t_0) * (sin(fma(t_2, 0.005555555555555556, (((double) M_PI) * 0.5))) * sin((0.005555555555555556 * t_2))));
} else if (fabs(angle) <= 8.8e+165) {
tmp = ((t_1 * (t_0 * 2.0)) * sin(t_3)) * cos(t_3);
} else {
tmp = t_1 * (t_0 * sin((log(exp((((double) M_PI) * 0.011111111111111112))) * fabs(angle))));
}
return copysign(1.0, angle) * tmp;
}
function code(a, b, angle) t_0 = Float64(abs(b) - a) t_1 = Float64(a + abs(b)) t_2 = Float64(pi * abs(angle)) t_3 = Float64(pi * exp(Float64(log(Float64(180.0 / abs(angle))) * -1.0))) tmp = 0.0 if (abs(angle) <= 5.2e+46) tmp = Float64(Float64(abs(b) + a) * Float64(Float64(2.0 * t_0) * Float64(sin(fma(t_2, 0.005555555555555556, Float64(pi * 0.5))) * sin(Float64(0.005555555555555556 * t_2))))); elseif (abs(angle) <= 8.8e+165) tmp = Float64(Float64(Float64(t_1 * Float64(t_0 * 2.0)) * sin(t_3)) * cos(t_3)); else tmp = Float64(t_1 * Float64(t_0 * sin(Float64(log(exp(Float64(pi * 0.011111111111111112))) * abs(angle))))); end return Float64(copysign(1.0, angle) * tmp) end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] - a), $MachinePrecision]}, Block[{t$95$1 = N[(a + N[Abs[b], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(Pi * N[Abs[angle], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(Pi * N[Exp[N[(N[Log[N[(180.0 / N[Abs[angle], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 5.2e+46], N[(N[(N[Abs[b], $MachinePrecision] + a), $MachinePrecision] * N[(N[(2.0 * t$95$0), $MachinePrecision] * N[(N[Sin[N[(t$95$2 * 0.005555555555555556 + N[(Pi * 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(0.005555555555555556 * t$95$2), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[angle], $MachinePrecision], 8.8e+165], N[(N[(N[(t$95$1 * N[(t$95$0 * 2.0), $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$3], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$3], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t$95$0 * N[Sin[N[(N[Log[N[Exp[N[(Pi * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Abs[angle], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left|b\right| - a\\
t_1 := a + \left|b\right|\\
t_2 := \pi \cdot \left|angle\right|\\
t_3 := \pi \cdot e^{\log \left(\frac{180}{\left|angle\right|}\right) \cdot -1}\\
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 5.2 \cdot 10^{+46}:\\
\;\;\;\;\left(\left|b\right| + a\right) \cdot \left(\left(2 \cdot t\_0\right) \cdot \left(\sin \left(\mathsf{fma}\left(t\_2, 0.005555555555555556, \pi \cdot 0.5\right)\right) \cdot \sin \left(0.005555555555555556 \cdot t\_2\right)\right)\right)\\
\mathbf{elif}\;\left|angle\right| \leq 8.8 \cdot 10^{+165}:\\
\;\;\;\;\left(\left(t\_1 \cdot \left(t\_0 \cdot 2\right)\right) \cdot \sin t\_3\right) \cdot \cos t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(t\_0 \cdot \sin \left(\log \left(e^{\pi \cdot 0.011111111111111112}\right) \cdot \left|angle\right|\right)\right)\\
\end{array}
\end{array}
if angle < 5.2000000000000003e46Initial program 53.9%
lift-*.f64N/A
*-commutativeN/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
+-commutativeN/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6457.6%
Applied rewrites57.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-/.f64N/A
div-flip-revN/A
lift-/.f64N/A
lift-/.f64N/A
lift-/.f64N/A
div-flip-revN/A
lift-/.f64N/A
lift-/.f64N/A
Applied rewrites68.3%
lift-cos.f64N/A
sin-+PI/2-revN/A
lower-sin.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-PI.f64N/A
mult-flipN/A
lower-*.f64N/A
metadata-eval68.2%
Applied rewrites68.2%
if 5.2000000000000003e46 < angle < 8.7999999999999996e165Initial program 53.9%
lift-*.f64N/A
*-commutativeN/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
+-commutativeN/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6457.6%
Applied rewrites57.6%
lift-/.f64N/A
div-flip-revN/A
lift-/.f64N/A
inv-powN/A
pow-to-expN/A
lower-unsound-exp.f64N/A
lower-unsound-*.f64N/A
lower-unsound-log.f6427.9%
Applied rewrites27.9%
lift-/.f64N/A
div-flip-revN/A
lift-/.f64N/A
inv-powN/A
pow-to-expN/A
lower-unsound-exp.f64N/A
lower-unsound-*.f64N/A
lower-unsound-log.f6428.1%
Applied rewrites28.1%
if 8.7999999999999996e165 < angle Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0%
Applied rewrites68.0%
lift-*.f64N/A
lift-PI.f64N/A
add-log-expN/A
log-pow-revN/A
lower-log.f64N/A
lift-PI.f64N/A
pow-expN/A
*-commutativeN/A
lift-*.f64N/A
lower-exp.f6466.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.5%
Applied rewrites66.5%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (- (fabs b) a)) (t_1 (fabs (fabs angle))))
(*
(copysign 1.0 angle)
(if (<= (fabs angle) 1.65e+167)
(*
(+ (fabs b) a)
(*
(* 2.0 t_0)
(/
(+
(sin
(* (fma t_1 PI (* PI (fabs angle))) 0.005555555555555556))
(sin
(fma
(* 0.005555555555555556 (fabs angle))
PI
(- (* (* t_1 PI) 0.005555555555555556)))))
2.0)))
(*
(+ a (fabs b))
(*
t_0
(sin
(* (log (exp (* PI 0.011111111111111112))) (fabs angle)))))))))double code(double a, double b, double angle) {
double t_0 = fabs(b) - a;
double t_1 = fabs(fabs(angle));
double tmp;
if (fabs(angle) <= 1.65e+167) {
tmp = (fabs(b) + a) * ((2.0 * t_0) * ((sin((fma(t_1, ((double) M_PI), (((double) M_PI) * fabs(angle))) * 0.005555555555555556)) + sin(fma((0.005555555555555556 * fabs(angle)), ((double) M_PI), -((t_1 * ((double) M_PI)) * 0.005555555555555556)))) / 2.0));
} else {
tmp = (a + fabs(b)) * (t_0 * sin((log(exp((((double) M_PI) * 0.011111111111111112))) * fabs(angle))));
}
return copysign(1.0, angle) * tmp;
}
function code(a, b, angle) t_0 = Float64(abs(b) - a) t_1 = abs(abs(angle)) tmp = 0.0 if (abs(angle) <= 1.65e+167) tmp = Float64(Float64(abs(b) + a) * Float64(Float64(2.0 * t_0) * Float64(Float64(sin(Float64(fma(t_1, pi, Float64(pi * abs(angle))) * 0.005555555555555556)) + sin(fma(Float64(0.005555555555555556 * abs(angle)), pi, Float64(-Float64(Float64(t_1 * pi) * 0.005555555555555556))))) / 2.0))); else tmp = Float64(Float64(a + abs(b)) * Float64(t_0 * sin(Float64(log(exp(Float64(pi * 0.011111111111111112))) * abs(angle))))); end return Float64(copysign(1.0, angle) * tmp) end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] - a), $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[Abs[angle], $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 1.65e+167], N[(N[(N[Abs[b], $MachinePrecision] + a), $MachinePrecision] * N[(N[(2.0 * t$95$0), $MachinePrecision] * N[(N[(N[Sin[N[(N[(t$95$1 * Pi + N[(Pi * N[Abs[angle], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.005555555555555556), $MachinePrecision]], $MachinePrecision] + N[Sin[N[(N[(0.005555555555555556 * N[Abs[angle], $MachinePrecision]), $MachinePrecision] * Pi + (-N[(N[(t$95$1 * Pi), $MachinePrecision] * 0.005555555555555556), $MachinePrecision])), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[Sin[N[(N[Log[N[Exp[N[(Pi * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Abs[angle], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left|b\right| - a\\
t_1 := \left|\left|angle\right|\right|\\
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 1.65 \cdot 10^{+167}:\\
\;\;\;\;\left(\left|b\right| + a\right) \cdot \left(\left(2 \cdot t\_0\right) \cdot \frac{\sin \left(\mathsf{fma}\left(t\_1, \pi, \pi \cdot \left|angle\right|\right) \cdot 0.005555555555555556\right) + \sin \left(\mathsf{fma}\left(0.005555555555555556 \cdot \left|angle\right|, \pi, -\left(t\_1 \cdot \pi\right) \cdot 0.005555555555555556\right)\right)}{2}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + \left|b\right|\right) \cdot \left(t\_0 \cdot \sin \left(\log \left(e^{\pi \cdot 0.011111111111111112}\right) \cdot \left|angle\right|\right)\right)\\
\end{array}
\end{array}
if angle < 1.6500000000000001e167Initial program 53.9%
lift-*.f64N/A
*-commutativeN/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
+-commutativeN/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6457.6%
Applied rewrites57.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-/.f64N/A
div-flip-revN/A
lift-/.f64N/A
lift-/.f64N/A
lift-/.f64N/A
div-flip-revN/A
lift-/.f64N/A
lift-/.f64N/A
Applied rewrites68.3%
Applied rewrites68.6%
if 1.6500000000000001e167 < angle Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0%
Applied rewrites68.0%
lift-*.f64N/A
lift-PI.f64N/A
add-log-expN/A
log-pow-revN/A
lower-log.f64N/A
lift-PI.f64N/A
pow-expN/A
*-commutativeN/A
lift-*.f64N/A
lower-exp.f6466.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.5%
Applied rewrites66.5%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (- (fabs b) a)) (t_1 (+ a (fabs b))))
(*
(copysign 1.0 angle)
(if (<= (fabs angle) 8.4e+161)
(* t_1 (* t_0 (sin (* 0.03490658503988659 (fabs angle)))))
(*
t_1
(*
t_0
(sin
(* (log (exp (* PI 0.011111111111111112))) (fabs angle)))))))))double code(double a, double b, double angle) {
double t_0 = fabs(b) - a;
double t_1 = a + fabs(b);
double tmp;
if (fabs(angle) <= 8.4e+161) {
tmp = t_1 * (t_0 * sin((0.03490658503988659 * fabs(angle))));
} else {
tmp = t_1 * (t_0 * sin((log(exp((((double) M_PI) * 0.011111111111111112))) * fabs(angle))));
}
return copysign(1.0, angle) * tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.abs(b) - a;
double t_1 = a + Math.abs(b);
double tmp;
if (Math.abs(angle) <= 8.4e+161) {
tmp = t_1 * (t_0 * Math.sin((0.03490658503988659 * Math.abs(angle))));
} else {
tmp = t_1 * (t_0 * Math.sin((Math.log(Math.exp((Math.PI * 0.011111111111111112))) * Math.abs(angle))));
}
return Math.copySign(1.0, angle) * tmp;
}
def code(a, b, angle): t_0 = math.fabs(b) - a t_1 = a + math.fabs(b) tmp = 0 if math.fabs(angle) <= 8.4e+161: tmp = t_1 * (t_0 * math.sin((0.03490658503988659 * math.fabs(angle)))) else: tmp = t_1 * (t_0 * math.sin((math.log(math.exp((math.pi * 0.011111111111111112))) * math.fabs(angle)))) return math.copysign(1.0, angle) * tmp
function code(a, b, angle) t_0 = Float64(abs(b) - a) t_1 = Float64(a + abs(b)) tmp = 0.0 if (abs(angle) <= 8.4e+161) tmp = Float64(t_1 * Float64(t_0 * sin(Float64(0.03490658503988659 * abs(angle))))); else tmp = Float64(t_1 * Float64(t_0 * sin(Float64(log(exp(Float64(pi * 0.011111111111111112))) * abs(angle))))); end return Float64(copysign(1.0, angle) * tmp) end
function tmp_2 = code(a, b, angle) t_0 = abs(b) - a; t_1 = a + abs(b); tmp = 0.0; if (abs(angle) <= 8.4e+161) tmp = t_1 * (t_0 * sin((0.03490658503988659 * abs(angle)))); else tmp = t_1 * (t_0 * sin((log(exp((pi * 0.011111111111111112))) * abs(angle)))); end tmp_2 = (sign(angle) * abs(1.0)) * tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] - a), $MachinePrecision]}, Block[{t$95$1 = N[(a + N[Abs[b], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 8.4e+161], N[(t$95$1 * N[(t$95$0 * N[Sin[N[(0.03490658503988659 * N[Abs[angle], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(t$95$0 * N[Sin[N[(N[Log[N[Exp[N[(Pi * 0.011111111111111112), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[Abs[angle], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left|b\right| - a\\
t_1 := a + \left|b\right|\\
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 8.4 \cdot 10^{+161}:\\
\;\;\;\;t\_1 \cdot \left(t\_0 \cdot \sin \left(0.03490658503988659 \cdot \left|angle\right|\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(t\_0 \cdot \sin \left(\log \left(e^{\pi \cdot 0.011111111111111112}\right) \cdot \left|angle\right|\right)\right)\\
\end{array}
\end{array}
if angle < 8.4000000000000001e161Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0%
Applied rewrites68.0%
Evaluated real constant68.0%
if 8.4000000000000001e161 < angle Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0%
Applied rewrites68.0%
lift-*.f64N/A
lift-PI.f64N/A
add-log-expN/A
log-pow-revN/A
lower-log.f64N/A
lift-PI.f64N/A
pow-expN/A
*-commutativeN/A
lift-*.f64N/A
lower-exp.f6466.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6466.5%
Applied rewrites66.5%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (- (fabs b) a)))
(if (<= (fabs b) 1.5e+231)
(* (+ a (fabs b)) (* t_0 (sin (* 0.03490658503988659 angle))))
(*
(+ (fabs b) a)
(*
(* 2.0 t_0)
(* 1.0 (sin (* 0.005555555555555556 (* PI angle)))))))))double code(double a, double b, double angle) {
double t_0 = fabs(b) - a;
double tmp;
if (fabs(b) <= 1.5e+231) {
tmp = (a + fabs(b)) * (t_0 * sin((0.03490658503988659 * angle)));
} else {
tmp = (fabs(b) + a) * ((2.0 * t_0) * (1.0 * sin((0.005555555555555556 * (((double) M_PI) * angle)))));
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.abs(b) - a;
double tmp;
if (Math.abs(b) <= 1.5e+231) {
tmp = (a + Math.abs(b)) * (t_0 * Math.sin((0.03490658503988659 * angle)));
} else {
tmp = (Math.abs(b) + a) * ((2.0 * t_0) * (1.0 * Math.sin((0.005555555555555556 * (Math.PI * angle)))));
}
return tmp;
}
def code(a, b, angle): t_0 = math.fabs(b) - a tmp = 0 if math.fabs(b) <= 1.5e+231: tmp = (a + math.fabs(b)) * (t_0 * math.sin((0.03490658503988659 * angle))) else: tmp = (math.fabs(b) + a) * ((2.0 * t_0) * (1.0 * math.sin((0.005555555555555556 * (math.pi * angle))))) return tmp
function code(a, b, angle) t_0 = Float64(abs(b) - a) tmp = 0.0 if (abs(b) <= 1.5e+231) tmp = Float64(Float64(a + abs(b)) * Float64(t_0 * sin(Float64(0.03490658503988659 * angle)))); else tmp = Float64(Float64(abs(b) + a) * Float64(Float64(2.0 * t_0) * Float64(1.0 * sin(Float64(0.005555555555555556 * Float64(pi * angle)))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = abs(b) - a; tmp = 0.0; if (abs(b) <= 1.5e+231) tmp = (a + abs(b)) * (t_0 * sin((0.03490658503988659 * angle))); else tmp = (abs(b) + a) * ((2.0 * t_0) * (1.0 * sin((0.005555555555555556 * (pi * angle))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] - a), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 1.5e+231], N[(N[(a + N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[Sin[N[(0.03490658503988659 * angle), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[b], $MachinePrecision] + a), $MachinePrecision] * N[(N[(2.0 * t$95$0), $MachinePrecision] * N[(1.0 * N[Sin[N[(0.005555555555555556 * N[(Pi * angle), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left|b\right| - a\\
\mathbf{if}\;\left|b\right| \leq 1.5 \cdot 10^{+231}:\\
\;\;\;\;\left(a + \left|b\right|\right) \cdot \left(t\_0 \cdot \sin \left(0.03490658503988659 \cdot angle\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left|b\right| + a\right) \cdot \left(\left(2 \cdot t\_0\right) \cdot \left(1 \cdot \sin \left(0.005555555555555556 \cdot \left(\pi \cdot angle\right)\right)\right)\right)\\
\end{array}
if b < 1.5000000000000001e231Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0%
Applied rewrites68.0%
Evaluated real constant68.0%
if 1.5000000000000001e231 < b Initial program 53.9%
lift-*.f64N/A
*-commutativeN/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
+-commutativeN/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6457.6%
Applied rewrites57.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-/.f64N/A
div-flip-revN/A
lift-/.f64N/A
lift-/.f64N/A
lift-/.f64N/A
div-flip-revN/A
lift-/.f64N/A
lift-/.f64N/A
Applied rewrites68.3%
Taylor expanded in angle around 0
Applied rewrites66.6%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (- (fabs b) (fabs a))))
(if (<= (fabs b) 1.65e+163)
(*
(+ (fabs a) (fabs b))
(* t_0 (sin (* 0.03490658503988659 angle))))
(* 0.011111111111111112 (* (* (* PI angle) (fabs b)) t_0)))))double code(double a, double b, double angle) {
double t_0 = fabs(b) - fabs(a);
double tmp;
if (fabs(b) <= 1.65e+163) {
tmp = (fabs(a) + fabs(b)) * (t_0 * sin((0.03490658503988659 * angle)));
} else {
tmp = 0.011111111111111112 * (((((double) M_PI) * angle) * fabs(b)) * t_0);
}
return tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.abs(b) - Math.abs(a);
double tmp;
if (Math.abs(b) <= 1.65e+163) {
tmp = (Math.abs(a) + Math.abs(b)) * (t_0 * Math.sin((0.03490658503988659 * angle)));
} else {
tmp = 0.011111111111111112 * (((Math.PI * angle) * Math.abs(b)) * t_0);
}
return tmp;
}
def code(a, b, angle): t_0 = math.fabs(b) - math.fabs(a) tmp = 0 if math.fabs(b) <= 1.65e+163: tmp = (math.fabs(a) + math.fabs(b)) * (t_0 * math.sin((0.03490658503988659 * angle))) else: tmp = 0.011111111111111112 * (((math.pi * angle) * math.fabs(b)) * t_0) return tmp
function code(a, b, angle) t_0 = Float64(abs(b) - abs(a)) tmp = 0.0 if (abs(b) <= 1.65e+163) tmp = Float64(Float64(abs(a) + abs(b)) * Float64(t_0 * sin(Float64(0.03490658503988659 * angle)))); else tmp = Float64(0.011111111111111112 * Float64(Float64(Float64(pi * angle) * abs(b)) * t_0)); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = abs(b) - abs(a); tmp = 0.0; if (abs(b) <= 1.65e+163) tmp = (abs(a) + abs(b)) * (t_0 * sin((0.03490658503988659 * angle))); else tmp = 0.011111111111111112 * (((pi * angle) * abs(b)) * t_0); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] - N[Abs[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[b], $MachinePrecision], 1.65e+163], N[(N[(N[Abs[a], $MachinePrecision] + N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[Sin[N[(0.03490658503988659 * angle), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[(N[(Pi * angle), $MachinePrecision] * N[Abs[b], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left|b\right| - \left|a\right|\\
\mathbf{if}\;\left|b\right| \leq 1.65 \cdot 10^{+163}:\\
\;\;\;\;\left(\left|a\right| + \left|b\right|\right) \cdot \left(t\_0 \cdot \sin \left(0.03490658503988659 \cdot angle\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left(\left(\pi \cdot angle\right) \cdot \left|b\right|\right) \cdot t\_0\right)\\
\end{array}
if b < 1.65e163Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0%
Applied rewrites68.0%
Evaluated real constant68.0%
if 1.65e163 < b Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6454.6%
Applied rewrites54.6%
Taylor expanded in a around 0
Applied rewrites37.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6440.5%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6440.5%
Applied rewrites40.5%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (- (fabs b) a)))
(*
(copysign 1.0 angle)
(if (<= (fabs angle) 4e-9)
(* (+ a (fabs b)) (* 0.03490658503988659 (* (fabs angle) t_0)))
(*
(* t_0 (+ (fabs b) a))
(sin (* (fabs angle) 0.03490658503988659)))))))double code(double a, double b, double angle) {
double t_0 = fabs(b) - a;
double tmp;
if (fabs(angle) <= 4e-9) {
tmp = (a + fabs(b)) * (0.03490658503988659 * (fabs(angle) * t_0));
} else {
tmp = (t_0 * (fabs(b) + a)) * sin((fabs(angle) * 0.03490658503988659));
}
return copysign(1.0, angle) * tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.abs(b) - a;
double tmp;
if (Math.abs(angle) <= 4e-9) {
tmp = (a + Math.abs(b)) * (0.03490658503988659 * (Math.abs(angle) * t_0));
} else {
tmp = (t_0 * (Math.abs(b) + a)) * Math.sin((Math.abs(angle) * 0.03490658503988659));
}
return Math.copySign(1.0, angle) * tmp;
}
def code(a, b, angle): t_0 = math.fabs(b) - a tmp = 0 if math.fabs(angle) <= 4e-9: tmp = (a + math.fabs(b)) * (0.03490658503988659 * (math.fabs(angle) * t_0)) else: tmp = (t_0 * (math.fabs(b) + a)) * math.sin((math.fabs(angle) * 0.03490658503988659)) return math.copysign(1.0, angle) * tmp
function code(a, b, angle) t_0 = Float64(abs(b) - a) tmp = 0.0 if (abs(angle) <= 4e-9) tmp = Float64(Float64(a + abs(b)) * Float64(0.03490658503988659 * Float64(abs(angle) * t_0))); else tmp = Float64(Float64(t_0 * Float64(abs(b) + a)) * sin(Float64(abs(angle) * 0.03490658503988659))); end return Float64(copysign(1.0, angle) * tmp) end
function tmp_2 = code(a, b, angle) t_0 = abs(b) - a; tmp = 0.0; if (abs(angle) <= 4e-9) tmp = (a + abs(b)) * (0.03490658503988659 * (abs(angle) * t_0)); else tmp = (t_0 * (abs(b) + a)) * sin((abs(angle) * 0.03490658503988659)); end tmp_2 = (sign(angle) * abs(1.0)) * tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] - a), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 4e-9], N[(N[(a + N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[(0.03490658503988659 * N[(N[Abs[angle], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$0 * N[(N[Abs[b], $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(N[Abs[angle], $MachinePrecision] * 0.03490658503988659), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_0 := \left|b\right| - a\\
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 4 \cdot 10^{-9}:\\
\;\;\;\;\left(a + \left|b\right|\right) \cdot \left(0.03490658503988659 \cdot \left(\left|angle\right| \cdot t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_0 \cdot \left(\left|b\right| + a\right)\right) \cdot \sin \left(\left|angle\right| \cdot 0.03490658503988659\right)\\
\end{array}
\end{array}
if angle < 4.0000000000000002e-9Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0%
Applied rewrites68.0%
Evaluated real constant68.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower--.f6463.3%
Applied rewrites63.3%
if 4.0000000000000002e-9 < angle Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0%
Applied rewrites68.0%
Evaluated real constant68.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6457.7%
lift-+.f64N/A
+-commutativeN/A
lift-+.f6457.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6457.7%
Applied rewrites57.7%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (+ (fabs a) (fabs b))))
(if (<= (fabs a) 9e-117)
(* t_0 (* (fabs b) (sin (* 0.03490658503988659 angle))))
(*
t_0
(*
(- (fabs b) (fabs a))
(*
angle
(+
0.03490658503988659
(* -7.088769245610384e-6 (pow angle 2.0)))))))))double code(double a, double b, double angle) {
double t_0 = fabs(a) + fabs(b);
double tmp;
if (fabs(a) <= 9e-117) {
tmp = t_0 * (fabs(b) * sin((0.03490658503988659 * angle)));
} else {
tmp = t_0 * ((fabs(b) - fabs(a)) * (angle * (0.03490658503988659 + (-7.088769245610384e-6 * pow(angle, 2.0)))));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(a, b, angle)
use fmin_fmax_functions
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
real(8) :: t_0
real(8) :: tmp
t_0 = abs(a) + abs(b)
if (abs(a) <= 9d-117) then
tmp = t_0 * (abs(b) * sin((0.03490658503988659d0 * angle)))
else
tmp = t_0 * ((abs(b) - abs(a)) * (angle * (0.03490658503988659d0 + ((-7.088769245610384d-6) * (angle ** 2.0d0)))))
end if
code = tmp
end function
public static double code(double a, double b, double angle) {
double t_0 = Math.abs(a) + Math.abs(b);
double tmp;
if (Math.abs(a) <= 9e-117) {
tmp = t_0 * (Math.abs(b) * Math.sin((0.03490658503988659 * angle)));
} else {
tmp = t_0 * ((Math.abs(b) - Math.abs(a)) * (angle * (0.03490658503988659 + (-7.088769245610384e-6 * Math.pow(angle, 2.0)))));
}
return tmp;
}
def code(a, b, angle): t_0 = math.fabs(a) + math.fabs(b) tmp = 0 if math.fabs(a) <= 9e-117: tmp = t_0 * (math.fabs(b) * math.sin((0.03490658503988659 * angle))) else: tmp = t_0 * ((math.fabs(b) - math.fabs(a)) * (angle * (0.03490658503988659 + (-7.088769245610384e-6 * math.pow(angle, 2.0))))) return tmp
function code(a, b, angle) t_0 = Float64(abs(a) + abs(b)) tmp = 0.0 if (abs(a) <= 9e-117) tmp = Float64(t_0 * Float64(abs(b) * sin(Float64(0.03490658503988659 * angle)))); else tmp = Float64(t_0 * Float64(Float64(abs(b) - abs(a)) * Float64(angle * Float64(0.03490658503988659 + Float64(-7.088769245610384e-6 * (angle ^ 2.0)))))); end return tmp end
function tmp_2 = code(a, b, angle) t_0 = abs(a) + abs(b); tmp = 0.0; if (abs(a) <= 9e-117) tmp = t_0 * (abs(b) * sin((0.03490658503988659 * angle))); else tmp = t_0 * ((abs(b) - abs(a)) * (angle * (0.03490658503988659 + (-7.088769245610384e-6 * (angle ^ 2.0))))); end tmp_2 = tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[a], $MachinePrecision] + N[Abs[b], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[Abs[a], $MachinePrecision], 9e-117], N[(t$95$0 * N[(N[Abs[b], $MachinePrecision] * N[Sin[N[(0.03490658503988659 * angle), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(N[Abs[b], $MachinePrecision] - N[Abs[a], $MachinePrecision]), $MachinePrecision] * N[(angle * N[(0.03490658503988659 + N[(-7.088769245610384e-6 * N[Power[angle, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left|a\right| + \left|b\right|\\
\mathbf{if}\;\left|a\right| \leq 9 \cdot 10^{-117}:\\
\;\;\;\;t\_0 \cdot \left(\left|b\right| \cdot \sin \left(0.03490658503988659 \cdot angle\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\left(\left|b\right| - \left|a\right|\right) \cdot \left(angle \cdot \left(0.03490658503988659 + -7.088769245610384 \cdot 10^{-6} \cdot {angle}^{2}\right)\right)\right)\\
\end{array}
if a < 8.9999999999999994e-117Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0%
Applied rewrites68.0%
Evaluated real constant68.0%
Taylor expanded in a around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-*.f6441.8%
Applied rewrites41.8%
if 8.9999999999999994e-117 < a Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0%
Applied rewrites68.0%
Evaluated real constant68.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6463.3%
Applied rewrites63.3%
(FPCore (a b angle)
:precision binary64
(*
(copysign 1.0 angle)
(if (<= (fabs angle) 2850000000000.0)
(*
(+ a b)
(*
(fabs angle)
(fma
-7.088769245610384e-6
(* (pow (fabs angle) 2.0) (- b a))
(* 0.03490658503988659 (- b a)))))
(*
0.011111111111111112
(* (fabs angle) (log (exp (* (* PI (- b a)) (+ b a)))))))))double code(double a, double b, double angle) {
double tmp;
if (fabs(angle) <= 2850000000000.0) {
tmp = (a + b) * (fabs(angle) * fma(-7.088769245610384e-6, (pow(fabs(angle), 2.0) * (b - a)), (0.03490658503988659 * (b - a))));
} else {
tmp = 0.011111111111111112 * (fabs(angle) * log(exp(((((double) M_PI) * (b - a)) * (b + a)))));
}
return copysign(1.0, angle) * tmp;
}
function code(a, b, angle) tmp = 0.0 if (abs(angle) <= 2850000000000.0) tmp = Float64(Float64(a + b) * Float64(abs(angle) * fma(-7.088769245610384e-6, Float64((abs(angle) ^ 2.0) * Float64(b - a)), Float64(0.03490658503988659 * Float64(b - a))))); else tmp = Float64(0.011111111111111112 * Float64(abs(angle) * log(exp(Float64(Float64(pi * Float64(b - a)) * Float64(b + a)))))); end return Float64(copysign(1.0, angle) * tmp) end
code[a_, b_, angle_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 2850000000000.0], N[(N[(a + b), $MachinePrecision] * N[(N[Abs[angle], $MachinePrecision] * N[(-7.088769245610384e-6 * N[(N[Power[N[Abs[angle], $MachinePrecision], 2.0], $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision] + N[(0.03490658503988659 * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[Abs[angle], $MachinePrecision] * N[Log[N[Exp[N[(N[(Pi * N[(b - a), $MachinePrecision]), $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 2850000000000:\\
\;\;\;\;\left(a + b\right) \cdot \left(\left|angle\right| \cdot \mathsf{fma}\left(-7.088769245610384 \cdot 10^{-6}, {\left(\left|angle\right|\right)}^{2} \cdot \left(b - a\right), 0.03490658503988659 \cdot \left(b - a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left|angle\right| \cdot \log \left(e^{\left(\pi \cdot \left(b - a\right)\right) \cdot \left(b + a\right)}\right)\right)\\
\end{array}
if angle < 2.85e12Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0%
Applied rewrites68.0%
Evaluated real constant68.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6463.4%
Applied rewrites63.4%
if 2.85e12 < angle Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6454.6%
Applied rewrites54.6%
lift-*.f64N/A
*-commutativeN/A
lift-PI.f64N/A
add-log-expN/A
log-pow-revN/A
lower-log.f64N/A
lift-PI.f64N/A
pow-expN/A
lift-*.f64N/A
lower-exp.f6435.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6435.2%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6435.2%
Applied rewrites35.2%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (- (fabs b) a)))
(*
(copysign 1.0 angle)
(if (<= (fabs angle) 2850000000000.0)
(*
(+ a (fabs b))
(*
t_0
(*
(fabs angle)
(+
0.03490658503988659
(* -7.088769245610384e-6 (pow (fabs angle) 2.0))))))
(*
0.011111111111111112
(* (fabs angle) (log (exp (* (* PI t_0) (+ (fabs b) a))))))))))double code(double a, double b, double angle) {
double t_0 = fabs(b) - a;
double tmp;
if (fabs(angle) <= 2850000000000.0) {
tmp = (a + fabs(b)) * (t_0 * (fabs(angle) * (0.03490658503988659 + (-7.088769245610384e-6 * pow(fabs(angle), 2.0)))));
} else {
tmp = 0.011111111111111112 * (fabs(angle) * log(exp(((((double) M_PI) * t_0) * (fabs(b) + a)))));
}
return copysign(1.0, angle) * tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.abs(b) - a;
double tmp;
if (Math.abs(angle) <= 2850000000000.0) {
tmp = (a + Math.abs(b)) * (t_0 * (Math.abs(angle) * (0.03490658503988659 + (-7.088769245610384e-6 * Math.pow(Math.abs(angle), 2.0)))));
} else {
tmp = 0.011111111111111112 * (Math.abs(angle) * Math.log(Math.exp(((Math.PI * t_0) * (Math.abs(b) + a)))));
}
return Math.copySign(1.0, angle) * tmp;
}
def code(a, b, angle): t_0 = math.fabs(b) - a tmp = 0 if math.fabs(angle) <= 2850000000000.0: tmp = (a + math.fabs(b)) * (t_0 * (math.fabs(angle) * (0.03490658503988659 + (-7.088769245610384e-6 * math.pow(math.fabs(angle), 2.0))))) else: tmp = 0.011111111111111112 * (math.fabs(angle) * math.log(math.exp(((math.pi * t_0) * (math.fabs(b) + a))))) return math.copysign(1.0, angle) * tmp
function code(a, b, angle) t_0 = Float64(abs(b) - a) tmp = 0.0 if (abs(angle) <= 2850000000000.0) tmp = Float64(Float64(a + abs(b)) * Float64(t_0 * Float64(abs(angle) * Float64(0.03490658503988659 + Float64(-7.088769245610384e-6 * (abs(angle) ^ 2.0)))))); else tmp = Float64(0.011111111111111112 * Float64(abs(angle) * log(exp(Float64(Float64(pi * t_0) * Float64(abs(b) + a)))))); end return Float64(copysign(1.0, angle) * tmp) end
function tmp_2 = code(a, b, angle) t_0 = abs(b) - a; tmp = 0.0; if (abs(angle) <= 2850000000000.0) tmp = (a + abs(b)) * (t_0 * (abs(angle) * (0.03490658503988659 + (-7.088769245610384e-6 * (abs(angle) ^ 2.0))))); else tmp = 0.011111111111111112 * (abs(angle) * log(exp(((pi * t_0) * (abs(b) + a))))); end tmp_2 = (sign(angle) * abs(1.0)) * tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] - a), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 2850000000000.0], N[(N[(a + N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(N[Abs[angle], $MachinePrecision] * N[(0.03490658503988659 + N[(-7.088769245610384e-6 * N[Power[N[Abs[angle], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[Abs[angle], $MachinePrecision] * N[Log[N[Exp[N[(N[(Pi * t$95$0), $MachinePrecision] * N[(N[Abs[b], $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_0 := \left|b\right| - a\\
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 2850000000000:\\
\;\;\;\;\left(a + \left|b\right|\right) \cdot \left(t\_0 \cdot \left(\left|angle\right| \cdot \left(0.03490658503988659 + -7.088769245610384 \cdot 10^{-6} \cdot {\left(\left|angle\right|\right)}^{2}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left|angle\right| \cdot \log \left(e^{\left(\pi \cdot t\_0\right) \cdot \left(\left|b\right| + a\right)}\right)\right)\\
\end{array}
\end{array}
if angle < 2.85e12Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0%
Applied rewrites68.0%
Evaluated real constant68.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6463.3%
Applied rewrites63.3%
if 2.85e12 < angle Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6454.6%
Applied rewrites54.6%
lift-*.f64N/A
*-commutativeN/A
lift-PI.f64N/A
add-log-expN/A
log-pow-revN/A
lower-log.f64N/A
lift-PI.f64N/A
pow-expN/A
lift-*.f64N/A
lower-exp.f6435.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6435.2%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6435.2%
Applied rewrites35.2%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (- (fabs b) a)))
(*
(copysign 1.0 angle)
(if (<= (fabs angle) 190000.0)
(* (+ a (fabs b)) (* 0.03490658503988659 (* (fabs angle) t_0)))
(*
0.011111111111111112
(* (fabs angle) (log (exp (* (* PI t_0) (+ (fabs b) a))))))))))double code(double a, double b, double angle) {
double t_0 = fabs(b) - a;
double tmp;
if (fabs(angle) <= 190000.0) {
tmp = (a + fabs(b)) * (0.03490658503988659 * (fabs(angle) * t_0));
} else {
tmp = 0.011111111111111112 * (fabs(angle) * log(exp(((((double) M_PI) * t_0) * (fabs(b) + a)))));
}
return copysign(1.0, angle) * tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.abs(b) - a;
double tmp;
if (Math.abs(angle) <= 190000.0) {
tmp = (a + Math.abs(b)) * (0.03490658503988659 * (Math.abs(angle) * t_0));
} else {
tmp = 0.011111111111111112 * (Math.abs(angle) * Math.log(Math.exp(((Math.PI * t_0) * (Math.abs(b) + a)))));
}
return Math.copySign(1.0, angle) * tmp;
}
def code(a, b, angle): t_0 = math.fabs(b) - a tmp = 0 if math.fabs(angle) <= 190000.0: tmp = (a + math.fabs(b)) * (0.03490658503988659 * (math.fabs(angle) * t_0)) else: tmp = 0.011111111111111112 * (math.fabs(angle) * math.log(math.exp(((math.pi * t_0) * (math.fabs(b) + a))))) return math.copysign(1.0, angle) * tmp
function code(a, b, angle) t_0 = Float64(abs(b) - a) tmp = 0.0 if (abs(angle) <= 190000.0) tmp = Float64(Float64(a + abs(b)) * Float64(0.03490658503988659 * Float64(abs(angle) * t_0))); else tmp = Float64(0.011111111111111112 * Float64(abs(angle) * log(exp(Float64(Float64(pi * t_0) * Float64(abs(b) + a)))))); end return Float64(copysign(1.0, angle) * tmp) end
function tmp_2 = code(a, b, angle) t_0 = abs(b) - a; tmp = 0.0; if (abs(angle) <= 190000.0) tmp = (a + abs(b)) * (0.03490658503988659 * (abs(angle) * t_0)); else tmp = 0.011111111111111112 * (abs(angle) * log(exp(((pi * t_0) * (abs(b) + a))))); end tmp_2 = (sign(angle) * abs(1.0)) * tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] - a), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 190000.0], N[(N[(a + N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[(0.03490658503988659 * N[(N[Abs[angle], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[Abs[angle], $MachinePrecision] * N[Log[N[Exp[N[(N[(Pi * t$95$0), $MachinePrecision] * N[(N[Abs[b], $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_0 := \left|b\right| - a\\
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 190000:\\
\;\;\;\;\left(a + \left|b\right|\right) \cdot \left(0.03490658503988659 \cdot \left(\left|angle\right| \cdot t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left|angle\right| \cdot \log \left(e^{\left(\pi \cdot t\_0\right) \cdot \left(\left|b\right| + a\right)}\right)\right)\\
\end{array}
\end{array}
if angle < 1.9e5Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0%
Applied rewrites68.0%
Evaluated real constant68.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower--.f6463.3%
Applied rewrites63.3%
if 1.9e5 < angle Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6454.6%
Applied rewrites54.6%
lift-*.f64N/A
*-commutativeN/A
lift-PI.f64N/A
add-log-expN/A
log-pow-revN/A
lower-log.f64N/A
lift-PI.f64N/A
pow-expN/A
lift-*.f64N/A
lower-exp.f6435.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6435.2%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6435.2%
Applied rewrites35.2%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (- (fabs b) a)) (t_1 (+ (fabs b) a)))
(*
(copysign 1.0 angle)
(if (<= (fabs angle) 0.0056)
(* (+ a (fabs b)) (* 0.03490658503988659 (* (fabs angle) t_0)))
(*
0.011111111111111112
(* (fabs angle) (* PI (* (fabs b) (/ (* t_0 t_1) t_1)))))))))double code(double a, double b, double angle) {
double t_0 = fabs(b) - a;
double t_1 = fabs(b) + a;
double tmp;
if (fabs(angle) <= 0.0056) {
tmp = (a + fabs(b)) * (0.03490658503988659 * (fabs(angle) * t_0));
} else {
tmp = 0.011111111111111112 * (fabs(angle) * (((double) M_PI) * (fabs(b) * ((t_0 * t_1) / t_1))));
}
return copysign(1.0, angle) * tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.abs(b) - a;
double t_1 = Math.abs(b) + a;
double tmp;
if (Math.abs(angle) <= 0.0056) {
tmp = (a + Math.abs(b)) * (0.03490658503988659 * (Math.abs(angle) * t_0));
} else {
tmp = 0.011111111111111112 * (Math.abs(angle) * (Math.PI * (Math.abs(b) * ((t_0 * t_1) / t_1))));
}
return Math.copySign(1.0, angle) * tmp;
}
def code(a, b, angle): t_0 = math.fabs(b) - a t_1 = math.fabs(b) + a tmp = 0 if math.fabs(angle) <= 0.0056: tmp = (a + math.fabs(b)) * (0.03490658503988659 * (math.fabs(angle) * t_0)) else: tmp = 0.011111111111111112 * (math.fabs(angle) * (math.pi * (math.fabs(b) * ((t_0 * t_1) / t_1)))) return math.copysign(1.0, angle) * tmp
function code(a, b, angle) t_0 = Float64(abs(b) - a) t_1 = Float64(abs(b) + a) tmp = 0.0 if (abs(angle) <= 0.0056) tmp = Float64(Float64(a + abs(b)) * Float64(0.03490658503988659 * Float64(abs(angle) * t_0))); else tmp = Float64(0.011111111111111112 * Float64(abs(angle) * Float64(pi * Float64(abs(b) * Float64(Float64(t_0 * t_1) / t_1))))); end return Float64(copysign(1.0, angle) * tmp) end
function tmp_2 = code(a, b, angle) t_0 = abs(b) - a; t_1 = abs(b) + a; tmp = 0.0; if (abs(angle) <= 0.0056) tmp = (a + abs(b)) * (0.03490658503988659 * (abs(angle) * t_0)); else tmp = 0.011111111111111112 * (abs(angle) * (pi * (abs(b) * ((t_0 * t_1) / t_1)))); end tmp_2 = (sign(angle) * abs(1.0)) * tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] - a), $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[b], $MachinePrecision] + a), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 0.0056], N[(N[(a + N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[(0.03490658503988659 * N[(N[Abs[angle], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[Abs[angle], $MachinePrecision] * N[(Pi * N[(N[Abs[b], $MachinePrecision] * N[(N[(t$95$0 * t$95$1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left|b\right| - a\\
t_1 := \left|b\right| + a\\
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 0.0056:\\
\;\;\;\;\left(a + \left|b\right|\right) \cdot \left(0.03490658503988659 \cdot \left(\left|angle\right| \cdot t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left|angle\right| \cdot \left(\pi \cdot \left(\left|b\right| \cdot \frac{t\_0 \cdot t\_1}{t\_1}\right)\right)\right)\\
\end{array}
\end{array}
if angle < 0.0055999999999999999Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0%
Applied rewrites68.0%
Evaluated real constant68.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower--.f6463.3%
Applied rewrites63.3%
if 0.0055999999999999999 < angle Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6454.6%
Applied rewrites54.6%
Taylor expanded in a around 0
Applied rewrites37.7%
lift--.f64N/A
flip--N/A
lower-unsound-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-unsound-/.f64N/A
lower-unsound--.f32N/A
lower--.f32N/A
lower-unsound-*.f32N/A
lower-*.f32N/A
lower-unsound-*.f32N/A
lower-*.f32N/A
difference-of-squares-revN/A
+-commutativeN/A
lift-+.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f6441.6%
lift-+.f64N/A
+-commutativeN/A
lift-+.f6441.6%
lift-+.f64N/A
+-commutativeN/A
lift-+.f6441.6%
Applied rewrites41.6%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (- (fabs b) a)))
(*
(copysign 1.0 angle)
(if (<= (fabs angle) 5e-44)
(* (+ a (fabs b)) (* 0.03490658503988659 (* (fabs angle) t_0)))
(*
(* (fabs angle) PI)
(* (* t_0 (+ (fabs b) a)) 0.011111111111111112))))))double code(double a, double b, double angle) {
double t_0 = fabs(b) - a;
double tmp;
if (fabs(angle) <= 5e-44) {
tmp = (a + fabs(b)) * (0.03490658503988659 * (fabs(angle) * t_0));
} else {
tmp = (fabs(angle) * ((double) M_PI)) * ((t_0 * (fabs(b) + a)) * 0.011111111111111112);
}
return copysign(1.0, angle) * tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.abs(b) - a;
double tmp;
if (Math.abs(angle) <= 5e-44) {
tmp = (a + Math.abs(b)) * (0.03490658503988659 * (Math.abs(angle) * t_0));
} else {
tmp = (Math.abs(angle) * Math.PI) * ((t_0 * (Math.abs(b) + a)) * 0.011111111111111112);
}
return Math.copySign(1.0, angle) * tmp;
}
def code(a, b, angle): t_0 = math.fabs(b) - a tmp = 0 if math.fabs(angle) <= 5e-44: tmp = (a + math.fabs(b)) * (0.03490658503988659 * (math.fabs(angle) * t_0)) else: tmp = (math.fabs(angle) * math.pi) * ((t_0 * (math.fabs(b) + a)) * 0.011111111111111112) return math.copysign(1.0, angle) * tmp
function code(a, b, angle) t_0 = Float64(abs(b) - a) tmp = 0.0 if (abs(angle) <= 5e-44) tmp = Float64(Float64(a + abs(b)) * Float64(0.03490658503988659 * Float64(abs(angle) * t_0))); else tmp = Float64(Float64(abs(angle) * pi) * Float64(Float64(t_0 * Float64(abs(b) + a)) * 0.011111111111111112)); end return Float64(copysign(1.0, angle) * tmp) end
function tmp_2 = code(a, b, angle) t_0 = abs(b) - a; tmp = 0.0; if (abs(angle) <= 5e-44) tmp = (a + abs(b)) * (0.03490658503988659 * (abs(angle) * t_0)); else tmp = (abs(angle) * pi) * ((t_0 * (abs(b) + a)) * 0.011111111111111112); end tmp_2 = (sign(angle) * abs(1.0)) * tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] - a), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 5e-44], N[(N[(a + N[Abs[b], $MachinePrecision]), $MachinePrecision] * N[(0.03490658503988659 * N[(N[Abs[angle], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[angle], $MachinePrecision] * Pi), $MachinePrecision] * N[(N[(t$95$0 * N[(N[Abs[b], $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision] * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_0 := \left|b\right| - a\\
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 5 \cdot 10^{-44}:\\
\;\;\;\;\left(a + \left|b\right|\right) \cdot \left(0.03490658503988659 \cdot \left(\left|angle\right| \cdot t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left|angle\right| \cdot \pi\right) \cdot \left(\left(t\_0 \cdot \left(\left|b\right| + a\right)\right) \cdot 0.011111111111111112\right)\\
\end{array}
\end{array}
if angle < 5.0000000000000004e-44Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0%
Applied rewrites68.0%
Evaluated real constant68.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower--.f6463.3%
Applied rewrites63.3%
if 5.0000000000000004e-44 < angle Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6454.6%
Applied rewrites54.6%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f6454.7%
lift-*.f64N/A
*-commutativeN/A
lift-*.f6454.7%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6454.7%
Applied rewrites54.7%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (- (fabs b) a)) (t_1 (+ a (fabs b))))
(*
(copysign 1.0 angle)
(if (<= (fabs angle) 5e-57)
(* t_1 (* 0.03490658503988659 (* (fabs angle) t_0)))
(* 0.011111111111111112 (* (fabs angle) (* PI (* t_1 t_0))))))))double code(double a, double b, double angle) {
double t_0 = fabs(b) - a;
double t_1 = a + fabs(b);
double tmp;
if (fabs(angle) <= 5e-57) {
tmp = t_1 * (0.03490658503988659 * (fabs(angle) * t_0));
} else {
tmp = 0.011111111111111112 * (fabs(angle) * (((double) M_PI) * (t_1 * t_0)));
}
return copysign(1.0, angle) * tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.abs(b) - a;
double t_1 = a + Math.abs(b);
double tmp;
if (Math.abs(angle) <= 5e-57) {
tmp = t_1 * (0.03490658503988659 * (Math.abs(angle) * t_0));
} else {
tmp = 0.011111111111111112 * (Math.abs(angle) * (Math.PI * (t_1 * t_0)));
}
return Math.copySign(1.0, angle) * tmp;
}
def code(a, b, angle): t_0 = math.fabs(b) - a t_1 = a + math.fabs(b) tmp = 0 if math.fabs(angle) <= 5e-57: tmp = t_1 * (0.03490658503988659 * (math.fabs(angle) * t_0)) else: tmp = 0.011111111111111112 * (math.fabs(angle) * (math.pi * (t_1 * t_0))) return math.copysign(1.0, angle) * tmp
function code(a, b, angle) t_0 = Float64(abs(b) - a) t_1 = Float64(a + abs(b)) tmp = 0.0 if (abs(angle) <= 5e-57) tmp = Float64(t_1 * Float64(0.03490658503988659 * Float64(abs(angle) * t_0))); else tmp = Float64(0.011111111111111112 * Float64(abs(angle) * Float64(pi * Float64(t_1 * t_0)))); end return Float64(copysign(1.0, angle) * tmp) end
function tmp_2 = code(a, b, angle) t_0 = abs(b) - a; t_1 = a + abs(b); tmp = 0.0; if (abs(angle) <= 5e-57) tmp = t_1 * (0.03490658503988659 * (abs(angle) * t_0)); else tmp = 0.011111111111111112 * (abs(angle) * (pi * (t_1 * t_0))); end tmp_2 = (sign(angle) * abs(1.0)) * tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] - a), $MachinePrecision]}, Block[{t$95$1 = N[(a + N[Abs[b], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 5e-57], N[(t$95$1 * N[(0.03490658503988659 * N[(N[Abs[angle], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.011111111111111112 * N[(N[Abs[angle], $MachinePrecision] * N[(Pi * N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left|b\right| - a\\
t_1 := a + \left|b\right|\\
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 5 \cdot 10^{-57}:\\
\;\;\;\;t\_1 \cdot \left(0.03490658503988659 \cdot \left(\left|angle\right| \cdot t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.011111111111111112 \cdot \left(\left|angle\right| \cdot \left(\pi \cdot \left(t\_1 \cdot t\_0\right)\right)\right)\\
\end{array}
\end{array}
if angle < 5.0000000000000002e-57Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0%
Applied rewrites68.0%
Evaluated real constant68.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower--.f6463.3%
Applied rewrites63.3%
if 5.0000000000000002e-57 < angle Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-PI.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6454.6%
Applied rewrites54.6%
(FPCore (a b angle)
:precision binary64
(let* ((t_0 (- (fabs b) a)) (t_1 (+ a (fabs b))))
(*
(copysign 1.0 angle)
(if (<= (fabs angle) 5e+36)
(* t_1 (* 0.03490658503988659 (* (fabs angle) t_0)))
(* 0.03490658503988659 (* (fabs angle) (* t_1 t_0)))))))double code(double a, double b, double angle) {
double t_0 = fabs(b) - a;
double t_1 = a + fabs(b);
double tmp;
if (fabs(angle) <= 5e+36) {
tmp = t_1 * (0.03490658503988659 * (fabs(angle) * t_0));
} else {
tmp = 0.03490658503988659 * (fabs(angle) * (t_1 * t_0));
}
return copysign(1.0, angle) * tmp;
}
public static double code(double a, double b, double angle) {
double t_0 = Math.abs(b) - a;
double t_1 = a + Math.abs(b);
double tmp;
if (Math.abs(angle) <= 5e+36) {
tmp = t_1 * (0.03490658503988659 * (Math.abs(angle) * t_0));
} else {
tmp = 0.03490658503988659 * (Math.abs(angle) * (t_1 * t_0));
}
return Math.copySign(1.0, angle) * tmp;
}
def code(a, b, angle): t_0 = math.fabs(b) - a t_1 = a + math.fabs(b) tmp = 0 if math.fabs(angle) <= 5e+36: tmp = t_1 * (0.03490658503988659 * (math.fabs(angle) * t_0)) else: tmp = 0.03490658503988659 * (math.fabs(angle) * (t_1 * t_0)) return math.copysign(1.0, angle) * tmp
function code(a, b, angle) t_0 = Float64(abs(b) - a) t_1 = Float64(a + abs(b)) tmp = 0.0 if (abs(angle) <= 5e+36) tmp = Float64(t_1 * Float64(0.03490658503988659 * Float64(abs(angle) * t_0))); else tmp = Float64(0.03490658503988659 * Float64(abs(angle) * Float64(t_1 * t_0))); end return Float64(copysign(1.0, angle) * tmp) end
function tmp_2 = code(a, b, angle) t_0 = abs(b) - a; t_1 = a + abs(b); tmp = 0.0; if (abs(angle) <= 5e+36) tmp = t_1 * (0.03490658503988659 * (abs(angle) * t_0)); else tmp = 0.03490658503988659 * (abs(angle) * (t_1 * t_0)); end tmp_2 = (sign(angle) * abs(1.0)) * tmp; end
code[a_, b_, angle_] := Block[{t$95$0 = N[(N[Abs[b], $MachinePrecision] - a), $MachinePrecision]}, Block[{t$95$1 = N[(a + N[Abs[b], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[angle]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[angle], $MachinePrecision], 5e+36], N[(t$95$1 * N[(0.03490658503988659 * N[(N[Abs[angle], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.03490658503988659 * N[(N[Abs[angle], $MachinePrecision] * N[(t$95$1 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left|b\right| - a\\
t_1 := a + \left|b\right|\\
\mathsf{copysign}\left(1, angle\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|angle\right| \leq 5 \cdot 10^{+36}:\\
\;\;\;\;t\_1 \cdot \left(0.03490658503988659 \cdot \left(\left|angle\right| \cdot t\_0\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.03490658503988659 \cdot \left(\left|angle\right| \cdot \left(t\_1 \cdot t\_0\right)\right)\\
\end{array}
\end{array}
if angle < 4.9999999999999998e36Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0%
Applied rewrites68.0%
Evaluated real constant68.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower--.f6463.3%
Applied rewrites63.3%
if 4.9999999999999998e36 < angle Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0%
Applied rewrites68.0%
Evaluated real constant68.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6454.7%
Applied rewrites54.7%
(FPCore (a b angle) :precision binary64 (* 0.03490658503988659 (* angle (* (+ a b) (- b a)))))
double code(double a, double b, double angle) {
return 0.03490658503988659 * (angle * ((a + b) * (b - a)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(a, b, angle)
use fmin_fmax_functions
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: angle
code = 0.03490658503988659d0 * (angle * ((a + b) * (b - a)))
end function
public static double code(double a, double b, double angle) {
return 0.03490658503988659 * (angle * ((a + b) * (b - a)));
}
def code(a, b, angle): return 0.03490658503988659 * (angle * ((a + b) * (b - a)))
function code(a, b, angle) return Float64(0.03490658503988659 * Float64(angle * Float64(Float64(a + b) * Float64(b - a)))) end
function tmp = code(a, b, angle) tmp = 0.03490658503988659 * (angle * ((a + b) * (b - a))); end
code[a_, b_, angle_] := N[(0.03490658503988659 * N[(angle * N[(N[(a + b), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
0.03490658503988659 \cdot \left(angle \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)\right)
Initial program 53.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
lift-sin.f64N/A
lift-cos.f64N/A
Applied rewrites68.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.0%
Applied rewrites68.0%
Evaluated real constant68.0%
Taylor expanded in angle around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower--.f6454.7%
Applied rewrites54.7%
herbie shell --seed 2025212
(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)))))