VandenBroeck and Keller, Equation (6)

Percentage Accurate: 76.3% → 99.3%
Time: 3.6s
Alternatives: 8
Speedup: 3.2×

Specification

?
\[\begin{array}{l} \\ \pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \end{array} \]
(FPCore (F l)
 :precision binary64
 (- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))
double code(double F, double l) {
	return (((double) M_PI) * l) - ((1.0 / (F * F)) * tan((((double) M_PI) * l)));
}
public static double code(double F, double l) {
	return (Math.PI * l) - ((1.0 / (F * F)) * Math.tan((Math.PI * l)));
}
def code(F, l):
	return (math.pi * l) - ((1.0 / (F * F)) * math.tan((math.pi * l)))
function code(F, l)
	return Float64(Float64(pi * l) - Float64(Float64(1.0 / Float64(F * F)) * tan(Float64(pi * l))))
end
function tmp = code(F, l)
	tmp = (pi * l) - ((1.0 / (F * F)) * tan((pi * l)));
end
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] - N[(N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision] * N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)
\end{array}

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 8 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 76.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \end{array} \]
(FPCore (F l)
 :precision binary64
 (- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))
double code(double F, double l) {
	return (((double) M_PI) * l) - ((1.0 / (F * F)) * tan((((double) M_PI) * l)));
}
public static double code(double F, double l) {
	return (Math.PI * l) - ((1.0 / (F * F)) * Math.tan((Math.PI * l)));
}
def code(F, l):
	return (math.pi * l) - ((1.0 / (F * F)) * math.tan((math.pi * l)))
function code(F, l)
	return Float64(Float64(pi * l) - Float64(Float64(1.0 / Float64(F * F)) * tan(Float64(pi * l))))
end
function tmp = code(F, l)
	tmp = (pi * l) - ((1.0 / (F * F)) * tan((pi * l)));
end
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] - N[(N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision] * N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)
\end{array}

Alternative 1: 99.3% accurate, 0.9× speedup?

\[\begin{array}{l} l\_m = \left|\ell\right| \\ l\_s = \mathsf{copysign}\left(1, \ell\right) \\ l\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \leq 1.36 \cdot 10^{+15}:\\ \;\;\;\;\pi \cdot l\_m - \frac{\frac{1}{F} \cdot \tan \left(l\_m \cdot \pi\right)}{F}\\ \mathbf{else}:\\ \;\;\;\;l\_m \cdot \pi\\ \end{array} \end{array} \]
l\_m = (fabs.f64 l)
l\_s = (copysign.f64 #s(literal 1 binary64) l)
(FPCore (l_s F l_m)
 :precision binary64
 (*
  l_s
  (if (<= l_m 1.36e+15)
    (- (* PI l_m) (/ (* (/ 1.0 F) (tan (* l_m PI))) F))
    (* l_m PI))))
l\_m = fabs(l);
l\_s = copysign(1.0, l);
double code(double l_s, double F, double l_m) {
	double tmp;
	if (l_m <= 1.36e+15) {
		tmp = (((double) M_PI) * l_m) - (((1.0 / F) * tan((l_m * ((double) M_PI)))) / F);
	} else {
		tmp = l_m * ((double) M_PI);
	}
	return l_s * tmp;
}
l\_m = Math.abs(l);
l\_s = Math.copySign(1.0, l);
public static double code(double l_s, double F, double l_m) {
	double tmp;
	if (l_m <= 1.36e+15) {
		tmp = (Math.PI * l_m) - (((1.0 / F) * Math.tan((l_m * Math.PI))) / F);
	} else {
		tmp = l_m * Math.PI;
	}
	return l_s * tmp;
}
l\_m = math.fabs(l)
l\_s = math.copysign(1.0, l)
def code(l_s, F, l_m):
	tmp = 0
	if l_m <= 1.36e+15:
		tmp = (math.pi * l_m) - (((1.0 / F) * math.tan((l_m * math.pi))) / F)
	else:
		tmp = l_m * math.pi
	return l_s * tmp
l\_m = abs(l)
l\_s = copysign(1.0, l)
function code(l_s, F, l_m)
	tmp = 0.0
	if (l_m <= 1.36e+15)
		tmp = Float64(Float64(pi * l_m) - Float64(Float64(Float64(1.0 / F) * tan(Float64(l_m * pi))) / F));
	else
		tmp = Float64(l_m * pi);
	end
	return Float64(l_s * tmp)
end
l\_m = abs(l);
l\_s = sign(l) * abs(1.0);
function tmp_2 = code(l_s, F, l_m)
	tmp = 0.0;
	if (l_m <= 1.36e+15)
		tmp = (pi * l_m) - (((1.0 / F) * tan((l_m * pi))) / F);
	else
		tmp = l_m * pi;
	end
	tmp_2 = l_s * tmp;
end
l\_m = N[Abs[l], $MachinePrecision]
l\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[l]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[l$95$s_, F_, l$95$m_] := N[(l$95$s * If[LessEqual[l$95$m, 1.36e+15], N[(N[(Pi * l$95$m), $MachinePrecision] - N[(N[(N[(1.0 / F), $MachinePrecision] * N[Tan[N[(l$95$m * Pi), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], N[(l$95$m * Pi), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l\_m = \left|\ell\right|
\\
l\_s = \mathsf{copysign}\left(1, \ell\right)

\\
l\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 1.36 \cdot 10^{+15}:\\
\;\;\;\;\pi \cdot l\_m - \frac{\frac{1}{F} \cdot \tan \left(l\_m \cdot \pi\right)}{F}\\

\mathbf{else}:\\
\;\;\;\;l\_m \cdot \pi\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 1.36e15

    1. Initial program 76.3%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)} \]
      2. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\tan \left(\pi \cdot \ell\right) \cdot \frac{1}{F \cdot F}} \]
      3. lift-/.f64N/A

        \[\leadsto \pi \cdot \ell - \tan \left(\pi \cdot \ell\right) \cdot \color{blue}{\frac{1}{F \cdot F}} \]
      4. mult-flip-revN/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}} \]
      5. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{\color{blue}{F \cdot F}} \]
      6. associate-/r*N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
      7. lower-/.f64N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
      8. lower-/.f6482.3

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}{F} \]
      9. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\pi \cdot \ell\right)}}{F}}{F} \]
      10. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\ell \cdot \pi\right)}}{F}}{F} \]
      11. lower-*.f6482.3

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\ell \cdot \pi\right)}}{F}}{F} \]
    3. Applied rewrites82.3%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\ell \cdot \pi\right)}{F}}{F}} \]
    4. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\tan \left(\ell \cdot \pi\right)}{F}}}{F} \]
      2. mult-flipN/A

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\tan \left(\ell \cdot \pi\right) \cdot \frac{1}{F}}}{F} \]
      3. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{1}{F} \cdot \tan \left(\ell \cdot \pi\right)}}{F} \]
      4. lower-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{1}{F} \cdot \tan \left(\ell \cdot \pi\right)}}{F} \]
      5. lower-/.f6482.3

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{1}{F}} \cdot \tan \left(\ell \cdot \pi\right)}{F} \]
    5. Applied rewrites82.3%

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{1}{F} \cdot \tan \left(\ell \cdot \pi\right)}}{F} \]

    if 1.36e15 < l

    1. Initial program 76.3%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Taylor expanded in F around inf

      \[\leadsto \color{blue}{\ell \cdot \mathsf{PI}\left(\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \ell \cdot \color{blue}{\mathsf{PI}\left(\right)} \]
      2. lower-PI.f6473.2

        \[\leadsto \ell \cdot \pi \]
    4. Applied rewrites73.2%

      \[\leadsto \color{blue}{\ell \cdot \pi} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 99.2% accurate, 1.0× speedup?

\[\begin{array}{l} l\_m = \left|\ell\right| \\ l\_s = \mathsf{copysign}\left(1, \ell\right) \\ l\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \leq 1.36 \cdot 10^{+15}:\\ \;\;\;\;\pi \cdot l\_m - \frac{\frac{\tan \left(l\_m \cdot \pi\right)}{F}}{F}\\ \mathbf{else}:\\ \;\;\;\;l\_m \cdot \pi\\ \end{array} \end{array} \]
l\_m = (fabs.f64 l)
l\_s = (copysign.f64 #s(literal 1 binary64) l)
(FPCore (l_s F l_m)
 :precision binary64
 (*
  l_s
  (if (<= l_m 1.36e+15)
    (- (* PI l_m) (/ (/ (tan (* l_m PI)) F) F))
    (* l_m PI))))
l\_m = fabs(l);
l\_s = copysign(1.0, l);
double code(double l_s, double F, double l_m) {
	double tmp;
	if (l_m <= 1.36e+15) {
		tmp = (((double) M_PI) * l_m) - ((tan((l_m * ((double) M_PI))) / F) / F);
	} else {
		tmp = l_m * ((double) M_PI);
	}
	return l_s * tmp;
}
l\_m = Math.abs(l);
l\_s = Math.copySign(1.0, l);
public static double code(double l_s, double F, double l_m) {
	double tmp;
	if (l_m <= 1.36e+15) {
		tmp = (Math.PI * l_m) - ((Math.tan((l_m * Math.PI)) / F) / F);
	} else {
		tmp = l_m * Math.PI;
	}
	return l_s * tmp;
}
l\_m = math.fabs(l)
l\_s = math.copysign(1.0, l)
def code(l_s, F, l_m):
	tmp = 0
	if l_m <= 1.36e+15:
		tmp = (math.pi * l_m) - ((math.tan((l_m * math.pi)) / F) / F)
	else:
		tmp = l_m * math.pi
	return l_s * tmp
l\_m = abs(l)
l\_s = copysign(1.0, l)
function code(l_s, F, l_m)
	tmp = 0.0
	if (l_m <= 1.36e+15)
		tmp = Float64(Float64(pi * l_m) - Float64(Float64(tan(Float64(l_m * pi)) / F) / F));
	else
		tmp = Float64(l_m * pi);
	end
	return Float64(l_s * tmp)
end
l\_m = abs(l);
l\_s = sign(l) * abs(1.0);
function tmp_2 = code(l_s, F, l_m)
	tmp = 0.0;
	if (l_m <= 1.36e+15)
		tmp = (pi * l_m) - ((tan((l_m * pi)) / F) / F);
	else
		tmp = l_m * pi;
	end
	tmp_2 = l_s * tmp;
end
l\_m = N[Abs[l], $MachinePrecision]
l\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[l]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[l$95$s_, F_, l$95$m_] := N[(l$95$s * If[LessEqual[l$95$m, 1.36e+15], N[(N[(Pi * l$95$m), $MachinePrecision] - N[(N[(N[Tan[N[(l$95$m * Pi), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], N[(l$95$m * Pi), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l\_m = \left|\ell\right|
\\
l\_s = \mathsf{copysign}\left(1, \ell\right)

\\
l\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 1.36 \cdot 10^{+15}:\\
\;\;\;\;\pi \cdot l\_m - \frac{\frac{\tan \left(l\_m \cdot \pi\right)}{F}}{F}\\

\mathbf{else}:\\
\;\;\;\;l\_m \cdot \pi\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 1.36e15

    1. Initial program 76.3%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)} \]
      2. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\tan \left(\pi \cdot \ell\right) \cdot \frac{1}{F \cdot F}} \]
      3. lift-/.f64N/A

        \[\leadsto \pi \cdot \ell - \tan \left(\pi \cdot \ell\right) \cdot \color{blue}{\frac{1}{F \cdot F}} \]
      4. mult-flip-revN/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}} \]
      5. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{\color{blue}{F \cdot F}} \]
      6. associate-/r*N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
      7. lower-/.f64N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
      8. lower-/.f6482.3

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}{F} \]
      9. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\pi \cdot \ell\right)}}{F}}{F} \]
      10. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\ell \cdot \pi\right)}}{F}}{F} \]
      11. lower-*.f6482.3

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\ell \cdot \pi\right)}}{F}}{F} \]
    3. Applied rewrites82.3%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\ell \cdot \pi\right)}{F}}{F}} \]

    if 1.36e15 < l

    1. Initial program 76.3%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Taylor expanded in F around inf

      \[\leadsto \color{blue}{\ell \cdot \mathsf{PI}\left(\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \ell \cdot \color{blue}{\mathsf{PI}\left(\right)} \]
      2. lower-PI.f6473.2

        \[\leadsto \ell \cdot \pi \]
    4. Applied rewrites73.2%

      \[\leadsto \color{blue}{\ell \cdot \pi} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 3: 98.4% accurate, 1.3× speedup?

\[\begin{array}{l} l\_m = \left|\ell\right| \\ l\_s = \mathsf{copysign}\left(1, \ell\right) \\ l\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \leq 1.3 \cdot 10^{+15}:\\ \;\;\;\;\pi \cdot l\_m - \frac{\mathsf{fma}\left(\left(l\_m \cdot l\_m\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \frac{\pi}{F}\right), 0.3333333333333333, \frac{\pi}{F}\right) \cdot l\_m}{F}\\ \mathbf{else}:\\ \;\;\;\;l\_m \cdot \pi\\ \end{array} \end{array} \]
l\_m = (fabs.f64 l)
l\_s = (copysign.f64 #s(literal 1 binary64) l)
(FPCore (l_s F l_m)
 :precision binary64
 (*
  l_s
  (if (<= l_m 1.3e+15)
    (-
     (* PI l_m)
     (/
      (*
       (fma (* (* l_m l_m) (* (* PI PI) (/ PI F))) 0.3333333333333333 (/ PI F))
       l_m)
      F))
    (* l_m PI))))
l\_m = fabs(l);
l\_s = copysign(1.0, l);
double code(double l_s, double F, double l_m) {
	double tmp;
	if (l_m <= 1.3e+15) {
		tmp = (((double) M_PI) * l_m) - ((fma(((l_m * l_m) * ((((double) M_PI) * ((double) M_PI)) * (((double) M_PI) / F))), 0.3333333333333333, (((double) M_PI) / F)) * l_m) / F);
	} else {
		tmp = l_m * ((double) M_PI);
	}
	return l_s * tmp;
}
l\_m = abs(l)
l\_s = copysign(1.0, l)
function code(l_s, F, l_m)
	tmp = 0.0
	if (l_m <= 1.3e+15)
		tmp = Float64(Float64(pi * l_m) - Float64(Float64(fma(Float64(Float64(l_m * l_m) * Float64(Float64(pi * pi) * Float64(pi / F))), 0.3333333333333333, Float64(pi / F)) * l_m) / F));
	else
		tmp = Float64(l_m * pi);
	end
	return Float64(l_s * tmp)
end
l\_m = N[Abs[l], $MachinePrecision]
l\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[l]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[l$95$s_, F_, l$95$m_] := N[(l$95$s * If[LessEqual[l$95$m, 1.3e+15], N[(N[(Pi * l$95$m), $MachinePrecision] - N[(N[(N[(N[(N[(l$95$m * l$95$m), $MachinePrecision] * N[(N[(Pi * Pi), $MachinePrecision] * N[(Pi / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333 + N[(Pi / F), $MachinePrecision]), $MachinePrecision] * l$95$m), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], N[(l$95$m * Pi), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l\_m = \left|\ell\right|
\\
l\_s = \mathsf{copysign}\left(1, \ell\right)

\\
l\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 1.3 \cdot 10^{+15}:\\
\;\;\;\;\pi \cdot l\_m - \frac{\mathsf{fma}\left(\left(l\_m \cdot l\_m\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \frac{\pi}{F}\right), 0.3333333333333333, \frac{\pi}{F}\right) \cdot l\_m}{F}\\

\mathbf{else}:\\
\;\;\;\;l\_m \cdot \pi\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 1.3e15

    1. Initial program 76.3%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)} \]
      2. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\tan \left(\pi \cdot \ell\right) \cdot \frac{1}{F \cdot F}} \]
      3. lift-/.f64N/A

        \[\leadsto \pi \cdot \ell - \tan \left(\pi \cdot \ell\right) \cdot \color{blue}{\frac{1}{F \cdot F}} \]
      4. mult-flip-revN/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}} \]
      5. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{\color{blue}{F \cdot F}} \]
      6. associate-/r*N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
      7. lower-/.f64N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
      8. lower-/.f6482.3

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}{F} \]
      9. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\pi \cdot \ell\right)}}{F}}{F} \]
      10. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\ell \cdot \pi\right)}}{F}}{F} \]
      11. lower-*.f6482.3

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\ell \cdot \pi\right)}}{F}}{F} \]
    3. Applied rewrites82.3%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\ell \cdot \pi\right)}{F}}{F}} \]
    4. Taylor expanded in l around 0

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\ell \cdot \left({\ell}^{2} \cdot \left(\frac{-1}{6} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{F} - \frac{-1}{2} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{F}\right) + \frac{\mathsf{PI}\left(\right)}{F}\right)}}{F} \]
    5. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\ell \cdot \color{blue}{\left({\ell}^{2} \cdot \left(\frac{-1}{6} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{F} - \frac{-1}{2} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{F}\right) + \frac{\mathsf{PI}\left(\right)}{F}\right)}}{F} \]
      2. lower-fma.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\ell \cdot \mathsf{fma}\left({\ell}^{2}, \color{blue}{\frac{-1}{6} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{F} - \frac{-1}{2} \cdot \frac{{\mathsf{PI}\left(\right)}^{3}}{F}}, \frac{\mathsf{PI}\left(\right)}{F}\right)}{F} \]
    6. Applied rewrites59.5%

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\ell \cdot \mathsf{fma}\left({\ell}^{2}, -0.16666666666666666 \cdot \frac{{\pi}^{3}}{F} - -0.5 \cdot \frac{{\pi}^{3}}{F}, \frac{\pi}{F}\right)}}{F} \]
    7. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\ell \cdot \color{blue}{\mathsf{fma}\left({\ell}^{2}, \frac{-1}{6} \cdot \frac{{\pi}^{3}}{F} - \frac{-1}{2} \cdot \frac{{\pi}^{3}}{F}, \frac{\pi}{F}\right)}}{F} \]
      2. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \frac{\mathsf{fma}\left({\ell}^{2}, \frac{-1}{6} \cdot \frac{{\pi}^{3}}{F} - \frac{-1}{2} \cdot \frac{{\pi}^{3}}{F}, \frac{\pi}{F}\right) \cdot \color{blue}{\ell}}{F} \]
      3. lower-*.f6459.5

        \[\leadsto \pi \cdot \ell - \frac{\mathsf{fma}\left({\ell}^{2}, -0.16666666666666666 \cdot \frac{{\pi}^{3}}{F} - -0.5 \cdot \frac{{\pi}^{3}}{F}, \frac{\pi}{F}\right) \cdot \color{blue}{\ell}}{F} \]
    8. Applied rewrites59.6%

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\mathsf{fma}\left(\left(\ell \cdot \ell\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \frac{\pi}{F}\right), 0.3333333333333333, \frac{\pi}{F}\right) \cdot \ell}}{F} \]

    if 1.3e15 < l

    1. Initial program 76.3%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Taylor expanded in F around inf

      \[\leadsto \color{blue}{\ell \cdot \mathsf{PI}\left(\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \ell \cdot \color{blue}{\mathsf{PI}\left(\right)} \]
      2. lower-PI.f6473.2

        \[\leadsto \ell \cdot \pi \]
    4. Applied rewrites73.2%

      \[\leadsto \color{blue}{\ell \cdot \pi} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 98.4% accurate, 2.7× speedup?

\[\begin{array}{l} l\_m = \left|\ell\right| \\ l\_s = \mathsf{copysign}\left(1, \ell\right) \\ l\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \leq 1.3 \cdot 10^{+15}:\\ \;\;\;\;\pi \cdot l\_m - \frac{\frac{\pi}{F} \cdot l\_m}{F}\\ \mathbf{else}:\\ \;\;\;\;l\_m \cdot \pi\\ \end{array} \end{array} \]
l\_m = (fabs.f64 l)
l\_s = (copysign.f64 #s(literal 1 binary64) l)
(FPCore (l_s F l_m)
 :precision binary64
 (*
  l_s
  (if (<= l_m 1.3e+15) (- (* PI l_m) (/ (* (/ PI F) l_m) F)) (* l_m PI))))
l\_m = fabs(l);
l\_s = copysign(1.0, l);
double code(double l_s, double F, double l_m) {
	double tmp;
	if (l_m <= 1.3e+15) {
		tmp = (((double) M_PI) * l_m) - (((((double) M_PI) / F) * l_m) / F);
	} else {
		tmp = l_m * ((double) M_PI);
	}
	return l_s * tmp;
}
l\_m = Math.abs(l);
l\_s = Math.copySign(1.0, l);
public static double code(double l_s, double F, double l_m) {
	double tmp;
	if (l_m <= 1.3e+15) {
		tmp = (Math.PI * l_m) - (((Math.PI / F) * l_m) / F);
	} else {
		tmp = l_m * Math.PI;
	}
	return l_s * tmp;
}
l\_m = math.fabs(l)
l\_s = math.copysign(1.0, l)
def code(l_s, F, l_m):
	tmp = 0
	if l_m <= 1.3e+15:
		tmp = (math.pi * l_m) - (((math.pi / F) * l_m) / F)
	else:
		tmp = l_m * math.pi
	return l_s * tmp
l\_m = abs(l)
l\_s = copysign(1.0, l)
function code(l_s, F, l_m)
	tmp = 0.0
	if (l_m <= 1.3e+15)
		tmp = Float64(Float64(pi * l_m) - Float64(Float64(Float64(pi / F) * l_m) / F));
	else
		tmp = Float64(l_m * pi);
	end
	return Float64(l_s * tmp)
end
l\_m = abs(l);
l\_s = sign(l) * abs(1.0);
function tmp_2 = code(l_s, F, l_m)
	tmp = 0.0;
	if (l_m <= 1.3e+15)
		tmp = (pi * l_m) - (((pi / F) * l_m) / F);
	else
		tmp = l_m * pi;
	end
	tmp_2 = l_s * tmp;
end
l\_m = N[Abs[l], $MachinePrecision]
l\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[l]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[l$95$s_, F_, l$95$m_] := N[(l$95$s * If[LessEqual[l$95$m, 1.3e+15], N[(N[(Pi * l$95$m), $MachinePrecision] - N[(N[(N[(Pi / F), $MachinePrecision] * l$95$m), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], N[(l$95$m * Pi), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l\_m = \left|\ell\right|
\\
l\_s = \mathsf{copysign}\left(1, \ell\right)

\\
l\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 1.3 \cdot 10^{+15}:\\
\;\;\;\;\pi \cdot l\_m - \frac{\frac{\pi}{F} \cdot l\_m}{F}\\

\mathbf{else}:\\
\;\;\;\;l\_m \cdot \pi\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 1.3e15

    1. Initial program 76.3%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)} \]
      2. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\tan \left(\pi \cdot \ell\right) \cdot \frac{1}{F \cdot F}} \]
      3. lift-/.f64N/A

        \[\leadsto \pi \cdot \ell - \tan \left(\pi \cdot \ell\right) \cdot \color{blue}{\frac{1}{F \cdot F}} \]
      4. mult-flip-revN/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}} \]
      5. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{\color{blue}{F \cdot F}} \]
      6. associate-/r*N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
      7. lower-/.f64N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
      8. lower-/.f6482.3

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}{F} \]
      9. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\pi \cdot \ell\right)}}{F}}{F} \]
      10. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\ell \cdot \pi\right)}}{F}}{F} \]
      11. lower-*.f6482.3

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\ell \cdot \pi\right)}}{F}}{F} \]
    3. Applied rewrites82.3%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\ell \cdot \pi\right)}{F}}{F}} \]
    4. Taylor expanded in l around 0

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\ell \cdot \mathsf{PI}\left(\right)}{F}}}{F} \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\ell \cdot \mathsf{PI}\left(\right)}{\color{blue}{F}}}{F} \]
      2. lower-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\ell \cdot \mathsf{PI}\left(\right)}{F}}{F} \]
      3. lower-PI.f6474.9

        \[\leadsto \pi \cdot \ell - \frac{\frac{\ell \cdot \pi}{F}}{F} \]
    6. Applied rewrites74.9%

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\ell \cdot \pi}{F}}}{F} \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\ell \cdot \pi}{\color{blue}{F}}}{F} \]
      2. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\ell \cdot \pi}{F}}{F} \]
      3. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\pi \cdot \ell}{F}}{F} \]
      4. associate-*l/N/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\pi}{F} \cdot \color{blue}{\ell}}{F} \]
      5. lift-/.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\pi}{F} \cdot \ell}{F} \]
      6. lower-*.f6474.9

        \[\leadsto \pi \cdot \ell - \frac{\frac{\pi}{F} \cdot \color{blue}{\ell}}{F} \]
    8. Applied rewrites74.9%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\pi}{F} \cdot \color{blue}{\ell}}{F} \]

    if 1.3e15 < l

    1. Initial program 76.3%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Taylor expanded in F around inf

      \[\leadsto \color{blue}{\ell \cdot \mathsf{PI}\left(\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \ell \cdot \color{blue}{\mathsf{PI}\left(\right)} \]
      2. lower-PI.f6473.2

        \[\leadsto \ell \cdot \pi \]
    4. Applied rewrites73.2%

      \[\leadsto \color{blue}{\ell \cdot \pi} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 5: 98.4% accurate, 2.7× speedup?

\[\begin{array}{l} l\_m = \left|\ell\right| \\ l\_s = \mathsf{copysign}\left(1, \ell\right) \\ l\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \leq 1.3 \cdot 10^{+15}:\\ \;\;\;\;\pi \cdot l\_m - \frac{\pi \cdot \frac{l\_m}{F}}{F}\\ \mathbf{else}:\\ \;\;\;\;l\_m \cdot \pi\\ \end{array} \end{array} \]
l\_m = (fabs.f64 l)
l\_s = (copysign.f64 #s(literal 1 binary64) l)
(FPCore (l_s F l_m)
 :precision binary64
 (*
  l_s
  (if (<= l_m 1.3e+15) (- (* PI l_m) (/ (* PI (/ l_m F)) F)) (* l_m PI))))
l\_m = fabs(l);
l\_s = copysign(1.0, l);
double code(double l_s, double F, double l_m) {
	double tmp;
	if (l_m <= 1.3e+15) {
		tmp = (((double) M_PI) * l_m) - ((((double) M_PI) * (l_m / F)) / F);
	} else {
		tmp = l_m * ((double) M_PI);
	}
	return l_s * tmp;
}
l\_m = Math.abs(l);
l\_s = Math.copySign(1.0, l);
public static double code(double l_s, double F, double l_m) {
	double tmp;
	if (l_m <= 1.3e+15) {
		tmp = (Math.PI * l_m) - ((Math.PI * (l_m / F)) / F);
	} else {
		tmp = l_m * Math.PI;
	}
	return l_s * tmp;
}
l\_m = math.fabs(l)
l\_s = math.copysign(1.0, l)
def code(l_s, F, l_m):
	tmp = 0
	if l_m <= 1.3e+15:
		tmp = (math.pi * l_m) - ((math.pi * (l_m / F)) / F)
	else:
		tmp = l_m * math.pi
	return l_s * tmp
l\_m = abs(l)
l\_s = copysign(1.0, l)
function code(l_s, F, l_m)
	tmp = 0.0
	if (l_m <= 1.3e+15)
		tmp = Float64(Float64(pi * l_m) - Float64(Float64(pi * Float64(l_m / F)) / F));
	else
		tmp = Float64(l_m * pi);
	end
	return Float64(l_s * tmp)
end
l\_m = abs(l);
l\_s = sign(l) * abs(1.0);
function tmp_2 = code(l_s, F, l_m)
	tmp = 0.0;
	if (l_m <= 1.3e+15)
		tmp = (pi * l_m) - ((pi * (l_m / F)) / F);
	else
		tmp = l_m * pi;
	end
	tmp_2 = l_s * tmp;
end
l\_m = N[Abs[l], $MachinePrecision]
l\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[l]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[l$95$s_, F_, l$95$m_] := N[(l$95$s * If[LessEqual[l$95$m, 1.3e+15], N[(N[(Pi * l$95$m), $MachinePrecision] - N[(N[(Pi * N[(l$95$m / F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], N[(l$95$m * Pi), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l\_m = \left|\ell\right|
\\
l\_s = \mathsf{copysign}\left(1, \ell\right)

\\
l\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 1.3 \cdot 10^{+15}:\\
\;\;\;\;\pi \cdot l\_m - \frac{\pi \cdot \frac{l\_m}{F}}{F}\\

\mathbf{else}:\\
\;\;\;\;l\_m \cdot \pi\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 1.3e15

    1. Initial program 76.3%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)} \]
      2. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\tan \left(\pi \cdot \ell\right) \cdot \frac{1}{F \cdot F}} \]
      3. lift-/.f64N/A

        \[\leadsto \pi \cdot \ell - \tan \left(\pi \cdot \ell\right) \cdot \color{blue}{\frac{1}{F \cdot F}} \]
      4. mult-flip-revN/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}} \]
      5. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{\color{blue}{F \cdot F}} \]
      6. associate-/r*N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
      7. lower-/.f64N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
      8. lower-/.f6482.3

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}{F} \]
      9. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\pi \cdot \ell\right)}}{F}}{F} \]
      10. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\ell \cdot \pi\right)}}{F}}{F} \]
      11. lower-*.f6482.3

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\ell \cdot \pi\right)}}{F}}{F} \]
    3. Applied rewrites82.3%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\ell \cdot \pi\right)}{F}}{F}} \]
    4. Taylor expanded in l around 0

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\ell \cdot \mathsf{PI}\left(\right)}{F}}}{F} \]
    5. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\ell \cdot \mathsf{PI}\left(\right)}{\color{blue}{F}}}{F} \]
      2. lower-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\ell \cdot \mathsf{PI}\left(\right)}{F}}{F} \]
      3. lower-PI.f6474.9

        \[\leadsto \pi \cdot \ell - \frac{\frac{\ell \cdot \pi}{F}}{F} \]
    6. Applied rewrites74.9%

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\ell \cdot \pi}{F}}}{F} \]
    7. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\ell \cdot \pi}{\color{blue}{F}}}{F} \]
      2. mult-flipN/A

        \[\leadsto \pi \cdot \ell - \frac{\left(\ell \cdot \pi\right) \cdot \color{blue}{\frac{1}{F}}}{F} \]
      3. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\left(\ell \cdot \pi\right) \cdot \frac{\color{blue}{1}}{F}}{F} \]
      4. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \frac{\left(\pi \cdot \ell\right) \cdot \frac{\color{blue}{1}}{F}}{F} \]
      5. lift-/.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\left(\pi \cdot \ell\right) \cdot \frac{1}{\color{blue}{F}}}{F} \]
      6. associate-*l*N/A

        \[\leadsto \pi \cdot \ell - \frac{\pi \cdot \color{blue}{\left(\ell \cdot \frac{1}{F}\right)}}{F} \]
      7. lower-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\pi \cdot \color{blue}{\left(\ell \cdot \frac{1}{F}\right)}}{F} \]
      8. lift-/.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\pi \cdot \left(\ell \cdot \frac{1}{\color{blue}{F}}\right)}{F} \]
      9. mult-flip-revN/A

        \[\leadsto \pi \cdot \ell - \frac{\pi \cdot \frac{\ell}{\color{blue}{F}}}{F} \]
      10. lower-/.f6474.9

        \[\leadsto \pi \cdot \ell - \frac{\pi \cdot \frac{\ell}{\color{blue}{F}}}{F} \]
    8. Applied rewrites74.9%

      \[\leadsto \pi \cdot \ell - \frac{\pi \cdot \color{blue}{\frac{\ell}{F}}}{F} \]

    if 1.3e15 < l

    1. Initial program 76.3%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Taylor expanded in F around inf

      \[\leadsto \color{blue}{\ell \cdot \mathsf{PI}\left(\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \ell \cdot \color{blue}{\mathsf{PI}\left(\right)} \]
      2. lower-PI.f6473.2

        \[\leadsto \ell \cdot \pi \]
    4. Applied rewrites73.2%

      \[\leadsto \color{blue}{\ell \cdot \pi} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 92.4% accurate, 3.1× speedup?

\[\begin{array}{l} l\_m = \left|\ell\right| \\ l\_s = \mathsf{copysign}\left(1, \ell\right) \\ l\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \leq 1.3 \cdot 10^{+15}:\\ \;\;\;\;l\_m \cdot \left(\pi - \frac{\frac{\pi}{F}}{F}\right)\\ \mathbf{else}:\\ \;\;\;\;l\_m \cdot \pi\\ \end{array} \end{array} \]
l\_m = (fabs.f64 l)
l\_s = (copysign.f64 #s(literal 1 binary64) l)
(FPCore (l_s F l_m)
 :precision binary64
 (* l_s (if (<= l_m 1.3e+15) (* l_m (- PI (/ (/ PI F) F))) (* l_m PI))))
l\_m = fabs(l);
l\_s = copysign(1.0, l);
double code(double l_s, double F, double l_m) {
	double tmp;
	if (l_m <= 1.3e+15) {
		tmp = l_m * (((double) M_PI) - ((((double) M_PI) / F) / F));
	} else {
		tmp = l_m * ((double) M_PI);
	}
	return l_s * tmp;
}
l\_m = Math.abs(l);
l\_s = Math.copySign(1.0, l);
public static double code(double l_s, double F, double l_m) {
	double tmp;
	if (l_m <= 1.3e+15) {
		tmp = l_m * (Math.PI - ((Math.PI / F) / F));
	} else {
		tmp = l_m * Math.PI;
	}
	return l_s * tmp;
}
l\_m = math.fabs(l)
l\_s = math.copysign(1.0, l)
def code(l_s, F, l_m):
	tmp = 0
	if l_m <= 1.3e+15:
		tmp = l_m * (math.pi - ((math.pi / F) / F))
	else:
		tmp = l_m * math.pi
	return l_s * tmp
l\_m = abs(l)
l\_s = copysign(1.0, l)
function code(l_s, F, l_m)
	tmp = 0.0
	if (l_m <= 1.3e+15)
		tmp = Float64(l_m * Float64(pi - Float64(Float64(pi / F) / F)));
	else
		tmp = Float64(l_m * pi);
	end
	return Float64(l_s * tmp)
end
l\_m = abs(l);
l\_s = sign(l) * abs(1.0);
function tmp_2 = code(l_s, F, l_m)
	tmp = 0.0;
	if (l_m <= 1.3e+15)
		tmp = l_m * (pi - ((pi / F) / F));
	else
		tmp = l_m * pi;
	end
	tmp_2 = l_s * tmp;
end
l\_m = N[Abs[l], $MachinePrecision]
l\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[l]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[l$95$s_, F_, l$95$m_] := N[(l$95$s * If[LessEqual[l$95$m, 1.3e+15], N[(l$95$m * N[(Pi - N[(N[(Pi / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l$95$m * Pi), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l\_m = \left|\ell\right|
\\
l\_s = \mathsf{copysign}\left(1, \ell\right)

\\
l\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 1.3 \cdot 10^{+15}:\\
\;\;\;\;l\_m \cdot \left(\pi - \frac{\frac{\pi}{F}}{F}\right)\\

\mathbf{else}:\\
\;\;\;\;l\_m \cdot \pi\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 1.3e15

    1. Initial program 76.3%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)} \]
      2. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\tan \left(\pi \cdot \ell\right) \cdot \frac{1}{F \cdot F}} \]
      3. lift-/.f64N/A

        \[\leadsto \pi \cdot \ell - \tan \left(\pi \cdot \ell\right) \cdot \color{blue}{\frac{1}{F \cdot F}} \]
      4. mult-flip-revN/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}} \]
      5. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{\color{blue}{F \cdot F}} \]
      6. associate-/r*N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
      7. lower-/.f64N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
      8. lower-/.f6482.3

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}{F} \]
      9. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\pi \cdot \ell\right)}}{F}}{F} \]
      10. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\ell \cdot \pi\right)}}{F}}{F} \]
      11. lower-*.f6482.3

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\ell \cdot \pi\right)}}{F}}{F} \]
    3. Applied rewrites82.3%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\ell \cdot \pi\right)}{F}}{F}} \]
    4. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\tan \left(\ell \cdot \pi\right)}{F}}}{F} \]
      2. mult-flipN/A

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\tan \left(\ell \cdot \pi\right) \cdot \frac{1}{F}}}{F} \]
      3. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{1}{F} \cdot \tan \left(\ell \cdot \pi\right)}}{F} \]
      4. lower-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{1}{F} \cdot \tan \left(\ell \cdot \pi\right)}}{F} \]
      5. lower-/.f6482.3

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{1}{F}} \cdot \tan \left(\ell \cdot \pi\right)}{F} \]
    5. Applied rewrites82.3%

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{1}{F} \cdot \tan \left(\ell \cdot \pi\right)}}{F} \]
    6. Taylor expanded in l around 0

      \[\leadsto \color{blue}{\ell \cdot \left(\mathsf{PI}\left(\right) - \frac{\mathsf{PI}\left(\right)}{{F}^{2}}\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \ell \cdot \color{blue}{\left(\mathsf{PI}\left(\right) - \frac{\mathsf{PI}\left(\right)}{{F}^{2}}\right)} \]
      2. lower--.f64N/A

        \[\leadsto \ell \cdot \left(\mathsf{PI}\left(\right) - \color{blue}{\frac{\mathsf{PI}\left(\right)}{{F}^{2}}}\right) \]
      3. lower-PI.f64N/A

        \[\leadsto \ell \cdot \left(\pi - \frac{\color{blue}{\mathsf{PI}\left(\right)}}{{F}^{2}}\right) \]
      4. lower-/.f64N/A

        \[\leadsto \ell \cdot \left(\pi - \frac{\mathsf{PI}\left(\right)}{\color{blue}{{F}^{2}}}\right) \]
      5. lower-PI.f64N/A

        \[\leadsto \ell \cdot \left(\pi - \frac{\pi}{{\color{blue}{F}}^{2}}\right) \]
      6. lower-pow.f6468.9

        \[\leadsto \ell \cdot \left(\pi - \frac{\pi}{{F}^{\color{blue}{2}}}\right) \]
    8. Applied rewrites68.9%

      \[\leadsto \color{blue}{\ell \cdot \left(\pi - \frac{\pi}{{F}^{2}}\right)} \]
    9. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \ell \cdot \left(\pi - \frac{\pi}{\color{blue}{{F}^{2}}}\right) \]
      2. lift-pow.f64N/A

        \[\leadsto \ell \cdot \left(\pi - \frac{\pi}{{F}^{\color{blue}{2}}}\right) \]
      3. pow2N/A

        \[\leadsto \ell \cdot \left(\pi - \frac{\pi}{F \cdot \color{blue}{F}}\right) \]
      4. associate-/r*N/A

        \[\leadsto \ell \cdot \left(\pi - \frac{\frac{\pi}{F}}{\color{blue}{F}}\right) \]
      5. lower-/.f64N/A

        \[\leadsto \ell \cdot \left(\pi - \frac{\frac{\pi}{F}}{\color{blue}{F}}\right) \]
      6. lower-/.f6468.9

        \[\leadsto \ell \cdot \left(\pi - \frac{\frac{\pi}{F}}{F}\right) \]
    10. Applied rewrites68.9%

      \[\leadsto \ell \cdot \left(\pi - \frac{\frac{\pi}{F}}{\color{blue}{F}}\right) \]

    if 1.3e15 < l

    1. Initial program 76.3%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Taylor expanded in F around inf

      \[\leadsto \color{blue}{\ell \cdot \mathsf{PI}\left(\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \ell \cdot \color{blue}{\mathsf{PI}\left(\right)} \]
      2. lower-PI.f6473.2

        \[\leadsto \ell \cdot \pi \]
    4. Applied rewrites73.2%

      \[\leadsto \color{blue}{\ell \cdot \pi} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 7: 92.4% accurate, 3.2× speedup?

\[\begin{array}{l} l\_m = \left|\ell\right| \\ l\_s = \mathsf{copysign}\left(1, \ell\right) \\ l\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \leq 1.3 \cdot 10^{+15}:\\ \;\;\;\;\left(\pi - \frac{\pi}{F \cdot F}\right) \cdot l\_m\\ \mathbf{else}:\\ \;\;\;\;l\_m \cdot \pi\\ \end{array} \end{array} \]
l\_m = (fabs.f64 l)
l\_s = (copysign.f64 #s(literal 1 binary64) l)
(FPCore (l_s F l_m)
 :precision binary64
 (* l_s (if (<= l_m 1.3e+15) (* (- PI (/ PI (* F F))) l_m) (* l_m PI))))
l\_m = fabs(l);
l\_s = copysign(1.0, l);
double code(double l_s, double F, double l_m) {
	double tmp;
	if (l_m <= 1.3e+15) {
		tmp = (((double) M_PI) - (((double) M_PI) / (F * F))) * l_m;
	} else {
		tmp = l_m * ((double) M_PI);
	}
	return l_s * tmp;
}
l\_m = Math.abs(l);
l\_s = Math.copySign(1.0, l);
public static double code(double l_s, double F, double l_m) {
	double tmp;
	if (l_m <= 1.3e+15) {
		tmp = (Math.PI - (Math.PI / (F * F))) * l_m;
	} else {
		tmp = l_m * Math.PI;
	}
	return l_s * tmp;
}
l\_m = math.fabs(l)
l\_s = math.copysign(1.0, l)
def code(l_s, F, l_m):
	tmp = 0
	if l_m <= 1.3e+15:
		tmp = (math.pi - (math.pi / (F * F))) * l_m
	else:
		tmp = l_m * math.pi
	return l_s * tmp
l\_m = abs(l)
l\_s = copysign(1.0, l)
function code(l_s, F, l_m)
	tmp = 0.0
	if (l_m <= 1.3e+15)
		tmp = Float64(Float64(pi - Float64(pi / Float64(F * F))) * l_m);
	else
		tmp = Float64(l_m * pi);
	end
	return Float64(l_s * tmp)
end
l\_m = abs(l);
l\_s = sign(l) * abs(1.0);
function tmp_2 = code(l_s, F, l_m)
	tmp = 0.0;
	if (l_m <= 1.3e+15)
		tmp = (pi - (pi / (F * F))) * l_m;
	else
		tmp = l_m * pi;
	end
	tmp_2 = l_s * tmp;
end
l\_m = N[Abs[l], $MachinePrecision]
l\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[l]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[l$95$s_, F_, l$95$m_] := N[(l$95$s * If[LessEqual[l$95$m, 1.3e+15], N[(N[(Pi - N[(Pi / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * l$95$m), $MachinePrecision], N[(l$95$m * Pi), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l\_m = \left|\ell\right|
\\
l\_s = \mathsf{copysign}\left(1, \ell\right)

\\
l\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \leq 1.3 \cdot 10^{+15}:\\
\;\;\;\;\left(\pi - \frac{\pi}{F \cdot F}\right) \cdot l\_m\\

\mathbf{else}:\\
\;\;\;\;l\_m \cdot \pi\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < 1.3e15

    1. Initial program 76.3%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)} \]
      2. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\tan \left(\pi \cdot \ell\right) \cdot \frac{1}{F \cdot F}} \]
      3. lift-/.f64N/A

        \[\leadsto \pi \cdot \ell - \tan \left(\pi \cdot \ell\right) \cdot \color{blue}{\frac{1}{F \cdot F}} \]
      4. mult-flip-revN/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}} \]
      5. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{\color{blue}{F \cdot F}} \]
      6. associate-/r*N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
      7. lower-/.f64N/A

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
      8. lower-/.f6482.3

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}{F} \]
      9. lift-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\pi \cdot \ell\right)}}{F}}{F} \]
      10. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\ell \cdot \pi\right)}}{F}}{F} \]
      11. lower-*.f6482.3

        \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \color{blue}{\left(\ell \cdot \pi\right)}}{F}}{F} \]
    3. Applied rewrites82.3%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\ell \cdot \pi\right)}{F}}{F}} \]
    4. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\tan \left(\ell \cdot \pi\right)}{F}}}{F} \]
      2. mult-flipN/A

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\tan \left(\ell \cdot \pi\right) \cdot \frac{1}{F}}}{F} \]
      3. *-commutativeN/A

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{1}{F} \cdot \tan \left(\ell \cdot \pi\right)}}{F} \]
      4. lower-*.f64N/A

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{1}{F} \cdot \tan \left(\ell \cdot \pi\right)}}{F} \]
      5. lower-/.f6482.3

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{1}{F}} \cdot \tan \left(\ell \cdot \pi\right)}{F} \]
    5. Applied rewrites82.3%

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{1}{F} \cdot \tan \left(\ell \cdot \pi\right)}}{F} \]
    6. Taylor expanded in l around 0

      \[\leadsto \color{blue}{\ell \cdot \left(\mathsf{PI}\left(\right) - \frac{\mathsf{PI}\left(\right)}{{F}^{2}}\right)} \]
    7. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \ell \cdot \color{blue}{\left(\mathsf{PI}\left(\right) - \frac{\mathsf{PI}\left(\right)}{{F}^{2}}\right)} \]
      2. lower--.f64N/A

        \[\leadsto \ell \cdot \left(\mathsf{PI}\left(\right) - \color{blue}{\frac{\mathsf{PI}\left(\right)}{{F}^{2}}}\right) \]
      3. lower-PI.f64N/A

        \[\leadsto \ell \cdot \left(\pi - \frac{\color{blue}{\mathsf{PI}\left(\right)}}{{F}^{2}}\right) \]
      4. lower-/.f64N/A

        \[\leadsto \ell \cdot \left(\pi - \frac{\mathsf{PI}\left(\right)}{\color{blue}{{F}^{2}}}\right) \]
      5. lower-PI.f64N/A

        \[\leadsto \ell \cdot \left(\pi - \frac{\pi}{{\color{blue}{F}}^{2}}\right) \]
      6. lower-pow.f6468.9

        \[\leadsto \ell \cdot \left(\pi - \frac{\pi}{{F}^{\color{blue}{2}}}\right) \]
    8. Applied rewrites68.9%

      \[\leadsto \color{blue}{\ell \cdot \left(\pi - \frac{\pi}{{F}^{2}}\right)} \]
    9. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \ell \cdot \color{blue}{\left(\pi - \frac{\pi}{{F}^{2}}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \left(\pi - \frac{\pi}{{F}^{2}}\right) \cdot \color{blue}{\ell} \]
      3. lower-*.f6468.9

        \[\leadsto \left(\pi - \frac{\pi}{{F}^{2}}\right) \cdot \color{blue}{\ell} \]
      4. lift-pow.f64N/A

        \[\leadsto \left(\pi - \frac{\pi}{{F}^{2}}\right) \cdot \ell \]
      5. pow2N/A

        \[\leadsto \left(\pi - \frac{\pi}{F \cdot F}\right) \cdot \ell \]
      6. lift-*.f6468.9

        \[\leadsto \left(\pi - \frac{\pi}{F \cdot F}\right) \cdot \ell \]
    10. Applied rewrites68.9%

      \[\leadsto \color{blue}{\left(\pi - \frac{\pi}{F \cdot F}\right) \cdot \ell} \]

    if 1.3e15 < l

    1. Initial program 76.3%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Taylor expanded in F around inf

      \[\leadsto \color{blue}{\ell \cdot \mathsf{PI}\left(\right)} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \ell \cdot \color{blue}{\mathsf{PI}\left(\right)} \]
      2. lower-PI.f6473.2

        \[\leadsto \ell \cdot \pi \]
    4. Applied rewrites73.2%

      \[\leadsto \color{blue}{\ell \cdot \pi} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 8: 73.2% accurate, 13.6× speedup?

\[\begin{array}{l} l\_m = \left|\ell\right| \\ l\_s = \mathsf{copysign}\left(1, \ell\right) \\ l\_s \cdot \left(l\_m \cdot \pi\right) \end{array} \]
l\_m = (fabs.f64 l)
l\_s = (copysign.f64 #s(literal 1 binary64) l)
(FPCore (l_s F l_m) :precision binary64 (* l_s (* l_m PI)))
l\_m = fabs(l);
l\_s = copysign(1.0, l);
double code(double l_s, double F, double l_m) {
	return l_s * (l_m * ((double) M_PI));
}
l\_m = Math.abs(l);
l\_s = Math.copySign(1.0, l);
public static double code(double l_s, double F, double l_m) {
	return l_s * (l_m * Math.PI);
}
l\_m = math.fabs(l)
l\_s = math.copysign(1.0, l)
def code(l_s, F, l_m):
	return l_s * (l_m * math.pi)
l\_m = abs(l)
l\_s = copysign(1.0, l)
function code(l_s, F, l_m)
	return Float64(l_s * Float64(l_m * pi))
end
l\_m = abs(l);
l\_s = sign(l) * abs(1.0);
function tmp = code(l_s, F, l_m)
	tmp = l_s * (l_m * pi);
end
l\_m = N[Abs[l], $MachinePrecision]
l\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[l]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[l$95$s_, F_, l$95$m_] := N[(l$95$s * N[(l$95$m * Pi), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
l\_m = \left|\ell\right|
\\
l\_s = \mathsf{copysign}\left(1, \ell\right)

\\
l\_s \cdot \left(l\_m \cdot \pi\right)
\end{array}
Derivation
  1. Initial program 76.3%

    \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
  2. Taylor expanded in F around inf

    \[\leadsto \color{blue}{\ell \cdot \mathsf{PI}\left(\right)} \]
  3. Step-by-step derivation
    1. lower-*.f64N/A

      \[\leadsto \ell \cdot \color{blue}{\mathsf{PI}\left(\right)} \]
    2. lower-PI.f6473.2

      \[\leadsto \ell \cdot \pi \]
  4. Applied rewrites73.2%

    \[\leadsto \color{blue}{\ell \cdot \pi} \]
  5. Add Preprocessing

Reproduce

?
herbie shell --seed 2025156 
(FPCore (F l)
  :name "VandenBroeck and Keller, Equation (6)"
  :precision binary64
  (- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))