VandenBroeck and Keller, Equation (6)

Percentage Accurate: 75.8% → 86.6%
Time: 36.5s
Alternatives: 10
Speedup: 1.0×

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}

Sampling outcomes in binary64 precision:

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 10 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: 75.8% 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: 86.6% accurate, 0.0× speedup?

\[\begin{array}{l} F = |F|\\ \\ \begin{array}{l} t_0 := \frac{\tan \left(\pi \cdot \ell\right)}{F}\\ t_1 := {\pi}^{3} \cdot 0.3333333333333333\\ t_2 := 0.008333333333333333 \cdot {\pi}^{5} - \mathsf{fma}\left(-0.5, t_1 \cdot {\pi}^{2}, {\pi}^{5} \cdot 0.041666666666666664\right)\\ t_3 := \mathsf{fma}\left(-1, \frac{{t_1}^{2} \cdot \left(F \cdot F\right)}{{\pi}^{3}}, \frac{\left(F \cdot F\right) \cdot t_2}{{\pi}^{2}}\right)\\ \mathbf{if}\;F \leq 3.5 \cdot 10^{-162}:\\ \;\;\;\;\pi \cdot \ell + t_0 \cdot \frac{-1}{F}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{-22}:\\ \;\;\;\;\pi \cdot \ell - \frac{1}{\mathsf{fma}\left(-1, {\ell}^{3} \cdot t_3, \mathsf{fma}\left(-1, {\ell}^{5} \cdot \mathsf{fma}\left(-1, \frac{t_3}{\frac{\pi}{t_1}}, \mathsf{fma}\left(-1, \frac{t_2 \cdot \left(t_1 \cdot \left(F \cdot F\right)\right)}{{\pi}^{3}}, \frac{F \cdot F}{\frac{{\pi}^{2}}{-0.0001984126984126984 \cdot {\pi}^{7} - \mathsf{fma}\left(-0.5, {\pi}^{2} \cdot t_2, \mathsf{fma}\left(-0.001388888888888889, {\pi}^{7}, 0.041666666666666664 \cdot \left(t_1 \cdot {\pi}^{4}\right)\right)\right)}}\right)\right), \mathsf{fma}\left(-1, \frac{t_1 \cdot \left(\ell \cdot \left(F \cdot F\right)\right)}{{\pi}^{2}}, \frac{F \cdot F}{\pi \cdot \ell}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell + \frac{-1}{\frac{F}{t_0}}\\ \end{array} \end{array} \]
NOTE: F should be positive before calling this function
(FPCore (F l)
 :precision binary64
 (let* ((t_0 (/ (tan (* PI l)) F))
        (t_1 (* (pow PI 3.0) 0.3333333333333333))
        (t_2
         (-
          (* 0.008333333333333333 (pow PI 5.0))
          (fma
           -0.5
           (* t_1 (pow PI 2.0))
           (* (pow PI 5.0) 0.041666666666666664))))
        (t_3
         (fma
          -1.0
          (/ (* (pow t_1 2.0) (* F F)) (pow PI 3.0))
          (/ (* (* F F) t_2) (pow PI 2.0)))))
   (if (<= F 3.5e-162)
     (+ (* PI l) (* t_0 (/ -1.0 F)))
     (if (<= F 2.8e-22)
       (-
        (* PI l)
        (/
         1.0
         (fma
          -1.0
          (* (pow l 3.0) t_3)
          (fma
           -1.0
           (*
            (pow l 5.0)
            (fma
             -1.0
             (/ t_3 (/ PI t_1))
             (fma
              -1.0
              (/ (* t_2 (* t_1 (* F F))) (pow PI 3.0))
              (/
               (* F F)
               (/
                (pow PI 2.0)
                (-
                 (* -0.0001984126984126984 (pow PI 7.0))
                 (fma
                  -0.5
                  (* (pow PI 2.0) t_2)
                  (fma
                   -0.001388888888888889
                   (pow PI 7.0)
                   (* 0.041666666666666664 (* t_1 (pow PI 4.0)))))))))))
           (fma
            -1.0
            (/ (* t_1 (* l (* F F))) (pow PI 2.0))
            (/ (* F F) (* PI l)))))))
       (+ (* PI l) (/ -1.0 (/ F t_0)))))))
F = abs(F);
double code(double F, double l) {
	double t_0 = tan((((double) M_PI) * l)) / F;
	double t_1 = pow(((double) M_PI), 3.0) * 0.3333333333333333;
	double t_2 = (0.008333333333333333 * pow(((double) M_PI), 5.0)) - fma(-0.5, (t_1 * pow(((double) M_PI), 2.0)), (pow(((double) M_PI), 5.0) * 0.041666666666666664));
	double t_3 = fma(-1.0, ((pow(t_1, 2.0) * (F * F)) / pow(((double) M_PI), 3.0)), (((F * F) * t_2) / pow(((double) M_PI), 2.0)));
	double tmp;
	if (F <= 3.5e-162) {
		tmp = (((double) M_PI) * l) + (t_0 * (-1.0 / F));
	} else if (F <= 2.8e-22) {
		tmp = (((double) M_PI) * l) - (1.0 / fma(-1.0, (pow(l, 3.0) * t_3), fma(-1.0, (pow(l, 5.0) * fma(-1.0, (t_3 / (((double) M_PI) / t_1)), fma(-1.0, ((t_2 * (t_1 * (F * F))) / pow(((double) M_PI), 3.0)), ((F * F) / (pow(((double) M_PI), 2.0) / ((-0.0001984126984126984 * pow(((double) M_PI), 7.0)) - fma(-0.5, (pow(((double) M_PI), 2.0) * t_2), fma(-0.001388888888888889, pow(((double) M_PI), 7.0), (0.041666666666666664 * (t_1 * pow(((double) M_PI), 4.0))))))))))), fma(-1.0, ((t_1 * (l * (F * F))) / pow(((double) M_PI), 2.0)), ((F * F) / (((double) M_PI) * l))))));
	} else {
		tmp = (((double) M_PI) * l) + (-1.0 / (F / t_0));
	}
	return tmp;
}
F = abs(F)
function code(F, l)
	t_0 = Float64(tan(Float64(pi * l)) / F)
	t_1 = Float64((pi ^ 3.0) * 0.3333333333333333)
	t_2 = Float64(Float64(0.008333333333333333 * (pi ^ 5.0)) - fma(-0.5, Float64(t_1 * (pi ^ 2.0)), Float64((pi ^ 5.0) * 0.041666666666666664)))
	t_3 = fma(-1.0, Float64(Float64((t_1 ^ 2.0) * Float64(F * F)) / (pi ^ 3.0)), Float64(Float64(Float64(F * F) * t_2) / (pi ^ 2.0)))
	tmp = 0.0
	if (F <= 3.5e-162)
		tmp = Float64(Float64(pi * l) + Float64(t_0 * Float64(-1.0 / F)));
	elseif (F <= 2.8e-22)
		tmp = Float64(Float64(pi * l) - Float64(1.0 / fma(-1.0, Float64((l ^ 3.0) * t_3), fma(-1.0, Float64((l ^ 5.0) * fma(-1.0, Float64(t_3 / Float64(pi / t_1)), fma(-1.0, Float64(Float64(t_2 * Float64(t_1 * Float64(F * F))) / (pi ^ 3.0)), Float64(Float64(F * F) / Float64((pi ^ 2.0) / Float64(Float64(-0.0001984126984126984 * (pi ^ 7.0)) - fma(-0.5, Float64((pi ^ 2.0) * t_2), fma(-0.001388888888888889, (pi ^ 7.0), Float64(0.041666666666666664 * Float64(t_1 * (pi ^ 4.0))))))))))), fma(-1.0, Float64(Float64(t_1 * Float64(l * Float64(F * F))) / (pi ^ 2.0)), Float64(Float64(F * F) / Float64(pi * l)))))));
	else
		tmp = Float64(Float64(pi * l) + Float64(-1.0 / Float64(F / t_0)));
	end
	return tmp
end
NOTE: F should be positive before calling this function
code[F_, l_] := Block[{t$95$0 = N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[Pi, 3.0], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]}, Block[{t$95$2 = N[(N[(0.008333333333333333 * N[Power[Pi, 5.0], $MachinePrecision]), $MachinePrecision] - N[(-0.5 * N[(t$95$1 * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[Power[Pi, 5.0], $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-1.0 * N[(N[(N[Power[t$95$1, 2.0], $MachinePrecision] * N[(F * F), $MachinePrecision]), $MachinePrecision] / N[Power[Pi, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(F * F), $MachinePrecision] * t$95$2), $MachinePrecision] / N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, 3.5e-162], N[(N[(Pi * l), $MachinePrecision] + N[(t$95$0 * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.8e-22], N[(N[(Pi * l), $MachinePrecision] - N[(1.0 / N[(-1.0 * N[(N[Power[l, 3.0], $MachinePrecision] * t$95$3), $MachinePrecision] + N[(-1.0 * N[(N[Power[l, 5.0], $MachinePrecision] * N[(-1.0 * N[(t$95$3 / N[(Pi / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(N[(t$95$2 * N[(t$95$1 * N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[Pi, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[(F * F), $MachinePrecision] / N[(N[Power[Pi, 2.0], $MachinePrecision] / N[(N[(-0.0001984126984126984 * N[Power[Pi, 7.0], $MachinePrecision]), $MachinePrecision] - N[(-0.5 * N[(N[Power[Pi, 2.0], $MachinePrecision] * t$95$2), $MachinePrecision] + N[(-0.001388888888888889 * N[Power[Pi, 7.0], $MachinePrecision] + N[(0.041666666666666664 * N[(t$95$1 * N[Power[Pi, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(N[(t$95$1 * N[(l * N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(F * F), $MachinePrecision] / N[(Pi * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(-1.0 / N[(F / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
F = |F|\\
\\
\begin{array}{l}
t_0 := \frac{\tan \left(\pi \cdot \ell\right)}{F}\\
t_1 := {\pi}^{3} \cdot 0.3333333333333333\\
t_2 := 0.008333333333333333 \cdot {\pi}^{5} - \mathsf{fma}\left(-0.5, t_1 \cdot {\pi}^{2}, {\pi}^{5} \cdot 0.041666666666666664\right)\\
t_3 := \mathsf{fma}\left(-1, \frac{{t_1}^{2} \cdot \left(F \cdot F\right)}{{\pi}^{3}}, \frac{\left(F \cdot F\right) \cdot t_2}{{\pi}^{2}}\right)\\
\mathbf{if}\;F \leq 3.5 \cdot 10^{-162}:\\
\;\;\;\;\pi \cdot \ell + t_0 \cdot \frac{-1}{F}\\

\mathbf{elif}\;F \leq 2.8 \cdot 10^{-22}:\\
\;\;\;\;\pi \cdot \ell - \frac{1}{\mathsf{fma}\left(-1, {\ell}^{3} \cdot t_3, \mathsf{fma}\left(-1, {\ell}^{5} \cdot \mathsf{fma}\left(-1, \frac{t_3}{\frac{\pi}{t_1}}, \mathsf{fma}\left(-1, \frac{t_2 \cdot \left(t_1 \cdot \left(F \cdot F\right)\right)}{{\pi}^{3}}, \frac{F \cdot F}{\frac{{\pi}^{2}}{-0.0001984126984126984 \cdot {\pi}^{7} - \mathsf{fma}\left(-0.5, {\pi}^{2} \cdot t_2, \mathsf{fma}\left(-0.001388888888888889, {\pi}^{7}, 0.041666666666666664 \cdot \left(t_1 \cdot {\pi}^{4}\right)\right)\right)}}\right)\right), \mathsf{fma}\left(-1, \frac{t_1 \cdot \left(\ell \cdot \left(F \cdot F\right)\right)}{{\pi}^{2}}, \frac{F \cdot F}{\pi \cdot \ell}\right)\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + \frac{-1}{\frac{F}{t_0}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < 3.4999999999999999e-162

    1. Initial program 67.7%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. sqr-neg67.7%

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

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1 \cdot \tan \left(\pi \cdot \ell\right)}{\left(-F\right) \cdot \left(-F\right)}} \]
      3. *-lft-identity67.7%

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\tan \left(\pi \cdot \ell\right)}}{\left(-F\right) \cdot \left(-F\right)} \]
      4. sqr-neg67.7%

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

      \[\leadsto \color{blue}{\pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}} \]
    4. Step-by-step derivation
      1. associate-/r*75.8%

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
      2. div-inv75.8%

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

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

    if 3.4999999999999999e-162 < F < 2.79999999999999995e-22

    1. Initial program 68.1%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. associate-/r/68.1%

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{\frac{F}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}} \]
    4. Step-by-step derivation
      1. expm1-log1p-u53.1%

        \[\leadsto \pi \cdot \ell - \frac{1}{\frac{F}{\frac{\tan \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \ell\right)\right)\right)}}{F}}} \]
    5. Applied egg-rr53.1%

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

      \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{-1 \cdot \left({\ell}^{3} \cdot \left(-1 \cdot \frac{{F}^{2} \cdot {\left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)}^{2}}{{\pi}^{3}} + \frac{{F}^{2} \cdot \left(0.008333333333333333 \cdot {\pi}^{5} - \left(-0.5 \cdot \left({\pi}^{2} \cdot \left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)\right) + 0.041666666666666664 \cdot {\pi}^{5}\right)\right)}{{\pi}^{2}}\right)\right) + \left(-1 \cdot \left({\ell}^{5} \cdot \left(-1 \cdot \frac{\left(-1 \cdot \frac{{F}^{2} \cdot {\left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)}^{2}}{{\pi}^{3}} + \frac{{F}^{2} \cdot \left(0.008333333333333333 \cdot {\pi}^{5} - \left(-0.5 \cdot \left({\pi}^{2} \cdot \left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)\right) + 0.041666666666666664 \cdot {\pi}^{5}\right)\right)}{{\pi}^{2}}\right) \cdot \left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)}{\pi} + \left(-1 \cdot \frac{{F}^{2} \cdot \left(\left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right) \cdot \left(0.008333333333333333 \cdot {\pi}^{5} - \left(-0.5 \cdot \left({\pi}^{2} \cdot \left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)\right) + 0.041666666666666664 \cdot {\pi}^{5}\right)\right)\right)}{{\pi}^{3}} + \frac{{F}^{2} \cdot \left(-0.0001984126984126984 \cdot {\pi}^{7} - \left(-0.5 \cdot \left({\pi}^{2} \cdot \left(0.008333333333333333 \cdot {\pi}^{5} - \left(-0.5 \cdot \left({\pi}^{2} \cdot \left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)\right) + 0.041666666666666664 \cdot {\pi}^{5}\right)\right)\right) + \left(-0.001388888888888889 \cdot {\pi}^{7} + 0.041666666666666664 \cdot \left({\pi}^{4} \cdot \left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)\right)\right)\right)\right)}{{\pi}^{2}}\right)\right)\right) + \left(-1 \cdot \frac{{F}^{2} \cdot \left(\ell \cdot \left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)\right)}{{\pi}^{2}} + \frac{{F}^{2}}{\ell \cdot \pi}\right)\right)}} \]
    7. Simplified91.4%

      \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{\mathsf{fma}\left(-1, {\ell}^{3} \cdot \mathsf{fma}\left(-1, \frac{{\left({\pi}^{3} \cdot 0.3333333333333333\right)}^{2} \cdot \left(F \cdot F\right)}{{\pi}^{3}}, \frac{\left(0.008333333333333333 \cdot {\pi}^{5} - \mathsf{fma}\left(-0.5, {\pi}^{2} \cdot \left({\pi}^{3} \cdot 0.3333333333333333\right), {\pi}^{5} \cdot 0.041666666666666664\right)\right) \cdot \left(F \cdot F\right)}{{\pi}^{2}}\right), \mathsf{fma}\left(-1, {\ell}^{5} \cdot \mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, \frac{{\left({\pi}^{3} \cdot 0.3333333333333333\right)}^{2} \cdot \left(F \cdot F\right)}{{\pi}^{3}}, \frac{\left(0.008333333333333333 \cdot {\pi}^{5} - \mathsf{fma}\left(-0.5, {\pi}^{2} \cdot \left({\pi}^{3} \cdot 0.3333333333333333\right), {\pi}^{5} \cdot 0.041666666666666664\right)\right) \cdot \left(F \cdot F\right)}{{\pi}^{2}}\right)}{\frac{\pi}{{\pi}^{3} \cdot 0.3333333333333333}}, \mathsf{fma}\left(-1, \frac{\left(\left(F \cdot F\right) \cdot \left({\pi}^{3} \cdot 0.3333333333333333\right)\right) \cdot \left(0.008333333333333333 \cdot {\pi}^{5} - \mathsf{fma}\left(-0.5, {\pi}^{2} \cdot \left({\pi}^{3} \cdot 0.3333333333333333\right), {\pi}^{5} \cdot 0.041666666666666664\right)\right)}{{\pi}^{3}}, \frac{F \cdot F}{\frac{{\pi}^{2}}{-0.0001984126984126984 \cdot {\pi}^{7} - \mathsf{fma}\left(-0.5, {\pi}^{2} \cdot \left(0.008333333333333333 \cdot {\pi}^{5} - \mathsf{fma}\left(-0.5, {\pi}^{2} \cdot \left({\pi}^{3} \cdot 0.3333333333333333\right), {\pi}^{5} \cdot 0.041666666666666664\right)\right), \mathsf{fma}\left(-0.001388888888888889, {\pi}^{7}, 0.041666666666666664 \cdot \left(\left({\pi}^{3} \cdot 0.3333333333333333\right) \cdot {\pi}^{4}\right)\right)\right)}}\right)\right), \mathsf{fma}\left(-1, \frac{\left(\left(F \cdot F\right) \cdot \ell\right) \cdot \left({\pi}^{3} \cdot 0.3333333333333333\right)}{{\pi}^{2}}, \frac{F \cdot F}{\ell \cdot \pi}\right)\right)\right)}} \]

    if 2.79999999999999995e-22 < F

    1. Initial program 99.0%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. associate-/r/99.0%

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{\frac{F}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification84.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 3.5 \cdot 10^{-162}:\\ \;\;\;\;\pi \cdot \ell + \frac{\tan \left(\pi \cdot \ell\right)}{F} \cdot \frac{-1}{F}\\ \mathbf{elif}\;F \leq 2.8 \cdot 10^{-22}:\\ \;\;\;\;\pi \cdot \ell - \frac{1}{\mathsf{fma}\left(-1, {\ell}^{3} \cdot \mathsf{fma}\left(-1, \frac{{\left({\pi}^{3} \cdot 0.3333333333333333\right)}^{2} \cdot \left(F \cdot F\right)}{{\pi}^{3}}, \frac{\left(F \cdot F\right) \cdot \left(0.008333333333333333 \cdot {\pi}^{5} - \mathsf{fma}\left(-0.5, \left({\pi}^{3} \cdot 0.3333333333333333\right) \cdot {\pi}^{2}, {\pi}^{5} \cdot 0.041666666666666664\right)\right)}{{\pi}^{2}}\right), \mathsf{fma}\left(-1, {\ell}^{5} \cdot \mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, \frac{{\left({\pi}^{3} \cdot 0.3333333333333333\right)}^{2} \cdot \left(F \cdot F\right)}{{\pi}^{3}}, \frac{\left(F \cdot F\right) \cdot \left(0.008333333333333333 \cdot {\pi}^{5} - \mathsf{fma}\left(-0.5, \left({\pi}^{3} \cdot 0.3333333333333333\right) \cdot {\pi}^{2}, {\pi}^{5} \cdot 0.041666666666666664\right)\right)}{{\pi}^{2}}\right)}{\frac{\pi}{{\pi}^{3} \cdot 0.3333333333333333}}, \mathsf{fma}\left(-1, \frac{\left(0.008333333333333333 \cdot {\pi}^{5} - \mathsf{fma}\left(-0.5, \left({\pi}^{3} \cdot 0.3333333333333333\right) \cdot {\pi}^{2}, {\pi}^{5} \cdot 0.041666666666666664\right)\right) \cdot \left(\left({\pi}^{3} \cdot 0.3333333333333333\right) \cdot \left(F \cdot F\right)\right)}{{\pi}^{3}}, \frac{F \cdot F}{\frac{{\pi}^{2}}{-0.0001984126984126984 \cdot {\pi}^{7} - \mathsf{fma}\left(-0.5, {\pi}^{2} \cdot \left(0.008333333333333333 \cdot {\pi}^{5} - \mathsf{fma}\left(-0.5, \left({\pi}^{3} \cdot 0.3333333333333333\right) \cdot {\pi}^{2}, {\pi}^{5} \cdot 0.041666666666666664\right)\right), \mathsf{fma}\left(-0.001388888888888889, {\pi}^{7}, 0.041666666666666664 \cdot \left(\left({\pi}^{3} \cdot 0.3333333333333333\right) \cdot {\pi}^{4}\right)\right)\right)}}\right)\right), \mathsf{fma}\left(-1, \frac{\left({\pi}^{3} \cdot 0.3333333333333333\right) \cdot \left(\ell \cdot \left(F \cdot F\right)\right)}{{\pi}^{2}}, \frac{F \cdot F}{\pi \cdot \ell}\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell + \frac{-1}{\frac{F}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}\\ \end{array} \]

Alternative 2: 85.9% accurate, 0.1× speedup?

\[\begin{array}{l} F = |F|\\ \\ \begin{array}{l} t_0 := \frac{\tan \left(\pi \cdot \ell\right)}{F}\\ t_1 := {\pi}^{3} \cdot 0.3333333333333333\\ \mathbf{if}\;F \leq 3.5 \cdot 10^{-164}:\\ \;\;\;\;\pi \cdot \ell + t_0 \cdot \frac{-1}{F}\\ \mathbf{elif}\;F \leq 2.05 \cdot 10^{-22}:\\ \;\;\;\;\pi \cdot \ell + \frac{-1}{\mathsf{fma}\left(-1, {\ell}^{3} \cdot \mathsf{fma}\left(-1, \frac{{t_1}^{2} \cdot \left(F \cdot F\right)}{{\pi}^{3}}, \frac{\left(F \cdot F\right) \cdot \left(0.008333333333333333 \cdot {\pi}^{5} - \mathsf{fma}\left(-0.5, t_1 \cdot {\pi}^{2}, {\pi}^{5} \cdot 0.041666666666666664\right)\right)}{{\pi}^{2}}\right), \mathsf{fma}\left(-1, \frac{t_1 \cdot \left(\ell \cdot \left(F \cdot F\right)\right)}{{\pi}^{2}}, \frac{F \cdot F}{\pi \cdot \ell}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell + \frac{-1}{\frac{F}{t_0}}\\ \end{array} \end{array} \]
NOTE: F should be positive before calling this function
(FPCore (F l)
 :precision binary64
 (let* ((t_0 (/ (tan (* PI l)) F)) (t_1 (* (pow PI 3.0) 0.3333333333333333)))
   (if (<= F 3.5e-164)
     (+ (* PI l) (* t_0 (/ -1.0 F)))
     (if (<= F 2.05e-22)
       (+
        (* PI l)
        (/
         -1.0
         (fma
          -1.0
          (*
           (pow l 3.0)
           (fma
            -1.0
            (/ (* (pow t_1 2.0) (* F F)) (pow PI 3.0))
            (/
             (*
              (* F F)
              (-
               (* 0.008333333333333333 (pow PI 5.0))
               (fma
                -0.5
                (* t_1 (pow PI 2.0))
                (* (pow PI 5.0) 0.041666666666666664))))
             (pow PI 2.0))))
          (fma
           -1.0
           (/ (* t_1 (* l (* F F))) (pow PI 2.0))
           (/ (* F F) (* PI l))))))
       (+ (* PI l) (/ -1.0 (/ F t_0)))))))
F = abs(F);
double code(double F, double l) {
	double t_0 = tan((((double) M_PI) * l)) / F;
	double t_1 = pow(((double) M_PI), 3.0) * 0.3333333333333333;
	double tmp;
	if (F <= 3.5e-164) {
		tmp = (((double) M_PI) * l) + (t_0 * (-1.0 / F));
	} else if (F <= 2.05e-22) {
		tmp = (((double) M_PI) * l) + (-1.0 / fma(-1.0, (pow(l, 3.0) * fma(-1.0, ((pow(t_1, 2.0) * (F * F)) / pow(((double) M_PI), 3.0)), (((F * F) * ((0.008333333333333333 * pow(((double) M_PI), 5.0)) - fma(-0.5, (t_1 * pow(((double) M_PI), 2.0)), (pow(((double) M_PI), 5.0) * 0.041666666666666664)))) / pow(((double) M_PI), 2.0)))), fma(-1.0, ((t_1 * (l * (F * F))) / pow(((double) M_PI), 2.0)), ((F * F) / (((double) M_PI) * l)))));
	} else {
		tmp = (((double) M_PI) * l) + (-1.0 / (F / t_0));
	}
	return tmp;
}
F = abs(F)
function code(F, l)
	t_0 = Float64(tan(Float64(pi * l)) / F)
	t_1 = Float64((pi ^ 3.0) * 0.3333333333333333)
	tmp = 0.0
	if (F <= 3.5e-164)
		tmp = Float64(Float64(pi * l) + Float64(t_0 * Float64(-1.0 / F)));
	elseif (F <= 2.05e-22)
		tmp = Float64(Float64(pi * l) + Float64(-1.0 / fma(-1.0, Float64((l ^ 3.0) * fma(-1.0, Float64(Float64((t_1 ^ 2.0) * Float64(F * F)) / (pi ^ 3.0)), Float64(Float64(Float64(F * F) * Float64(Float64(0.008333333333333333 * (pi ^ 5.0)) - fma(-0.5, Float64(t_1 * (pi ^ 2.0)), Float64((pi ^ 5.0) * 0.041666666666666664)))) / (pi ^ 2.0)))), fma(-1.0, Float64(Float64(t_1 * Float64(l * Float64(F * F))) / (pi ^ 2.0)), Float64(Float64(F * F) / Float64(pi * l))))));
	else
		tmp = Float64(Float64(pi * l) + Float64(-1.0 / Float64(F / t_0)));
	end
	return tmp
end
NOTE: F should be positive before calling this function
code[F_, l_] := Block[{t$95$0 = N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[Pi, 3.0], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]}, If[LessEqual[F, 3.5e-164], N[(N[(Pi * l), $MachinePrecision] + N[(t$95$0 * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.05e-22], N[(N[(Pi * l), $MachinePrecision] + N[(-1.0 / N[(-1.0 * N[(N[Power[l, 3.0], $MachinePrecision] * N[(-1.0 * N[(N[(N[Power[t$95$1, 2.0], $MachinePrecision] * N[(F * F), $MachinePrecision]), $MachinePrecision] / N[Power[Pi, 3.0], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(F * F), $MachinePrecision] * N[(N[(0.008333333333333333 * N[Power[Pi, 5.0], $MachinePrecision]), $MachinePrecision] - N[(-0.5 * N[(t$95$1 * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[Power[Pi, 5.0], $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(N[(t$95$1 * N[(l * N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[(F * F), $MachinePrecision] / N[(Pi * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(-1.0 / N[(F / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
F = |F|\\
\\
\begin{array}{l}
t_0 := \frac{\tan \left(\pi \cdot \ell\right)}{F}\\
t_1 := {\pi}^{3} \cdot 0.3333333333333333\\
\mathbf{if}\;F \leq 3.5 \cdot 10^{-164}:\\
\;\;\;\;\pi \cdot \ell + t_0 \cdot \frac{-1}{F}\\

\mathbf{elif}\;F \leq 2.05 \cdot 10^{-22}:\\
\;\;\;\;\pi \cdot \ell + \frac{-1}{\mathsf{fma}\left(-1, {\ell}^{3} \cdot \mathsf{fma}\left(-1, \frac{{t_1}^{2} \cdot \left(F \cdot F\right)}{{\pi}^{3}}, \frac{\left(F \cdot F\right) \cdot \left(0.008333333333333333 \cdot {\pi}^{5} - \mathsf{fma}\left(-0.5, t_1 \cdot {\pi}^{2}, {\pi}^{5} \cdot 0.041666666666666664\right)\right)}{{\pi}^{2}}\right), \mathsf{fma}\left(-1, \frac{t_1 \cdot \left(\ell \cdot \left(F \cdot F\right)\right)}{{\pi}^{2}}, \frac{F \cdot F}{\pi \cdot \ell}\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + \frac{-1}{\frac{F}{t_0}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < 3.5e-164

    1. Initial program 67.7%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. sqr-neg67.7%

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

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1 \cdot \tan \left(\pi \cdot \ell\right)}{\left(-F\right) \cdot \left(-F\right)}} \]
      3. *-lft-identity67.7%

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\tan \left(\pi \cdot \ell\right)}}{\left(-F\right) \cdot \left(-F\right)} \]
      4. sqr-neg67.7%

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

      \[\leadsto \color{blue}{\pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}} \]
    4. Step-by-step derivation
      1. associate-/r*75.8%

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
      2. div-inv75.8%

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

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

    if 3.5e-164 < F < 2.05e-22

    1. Initial program 68.1%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. associate-/r/68.1%

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{\frac{F}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}} \]
    4. Step-by-step derivation
      1. expm1-log1p-u53.1%

        \[\leadsto \pi \cdot \ell - \frac{1}{\frac{F}{\frac{\tan \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \ell\right)\right)\right)}}{F}}} \]
    5. Applied egg-rr53.1%

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

      \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{-1 \cdot \left({\ell}^{3} \cdot \left(-1 \cdot \frac{{F}^{2} \cdot {\left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)}^{2}}{{\pi}^{3}} + \frac{{F}^{2} \cdot \left(0.008333333333333333 \cdot {\pi}^{5} - \left(-0.5 \cdot \left({\pi}^{2} \cdot \left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)\right) + 0.041666666666666664 \cdot {\pi}^{5}\right)\right)}{{\pi}^{2}}\right)\right) + \left(-1 \cdot \frac{{F}^{2} \cdot \left(\ell \cdot \left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)\right)}{{\pi}^{2}} + \frac{{F}^{2}}{\ell \cdot \pi}\right)}} \]
    7. Simplified91.3%

      \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{\mathsf{fma}\left(-1, {\ell}^{3} \cdot \mathsf{fma}\left(-1, \frac{{\left({\pi}^{3} \cdot 0.3333333333333333\right)}^{2} \cdot \left(F \cdot F\right)}{{\pi}^{3}}, \frac{\left(0.008333333333333333 \cdot {\pi}^{5} - \mathsf{fma}\left(-0.5, {\pi}^{2} \cdot \left({\pi}^{3} \cdot 0.3333333333333333\right), {\pi}^{5} \cdot 0.041666666666666664\right)\right) \cdot \left(F \cdot F\right)}{{\pi}^{2}}\right), \mathsf{fma}\left(-1, \frac{\left(\left(F \cdot F\right) \cdot \ell\right) \cdot \left({\pi}^{3} \cdot 0.3333333333333333\right)}{{\pi}^{2}}, \frac{F \cdot F}{\ell \cdot \pi}\right)\right)}} \]

    if 2.05e-22 < F

    1. Initial program 99.0%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. associate-/r/99.0%

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{\frac{F}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification84.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 3.5 \cdot 10^{-164}:\\ \;\;\;\;\pi \cdot \ell + \frac{\tan \left(\pi \cdot \ell\right)}{F} \cdot \frac{-1}{F}\\ \mathbf{elif}\;F \leq 2.05 \cdot 10^{-22}:\\ \;\;\;\;\pi \cdot \ell + \frac{-1}{\mathsf{fma}\left(-1, {\ell}^{3} \cdot \mathsf{fma}\left(-1, \frac{{\left({\pi}^{3} \cdot 0.3333333333333333\right)}^{2} \cdot \left(F \cdot F\right)}{{\pi}^{3}}, \frac{\left(F \cdot F\right) \cdot \left(0.008333333333333333 \cdot {\pi}^{5} - \mathsf{fma}\left(-0.5, \left({\pi}^{3} \cdot 0.3333333333333333\right) \cdot {\pi}^{2}, {\pi}^{5} \cdot 0.041666666666666664\right)\right)}{{\pi}^{2}}\right), \mathsf{fma}\left(-1, \frac{\left({\pi}^{3} \cdot 0.3333333333333333\right) \cdot \left(\ell \cdot \left(F \cdot F\right)\right)}{{\pi}^{2}}, \frac{F \cdot F}{\pi \cdot \ell}\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell + \frac{-1}{\frac{F}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}\\ \end{array} \]

Alternative 3: 85.5% accurate, 0.1× speedup?

\[\begin{array}{l} F = |F|\\ \\ \begin{array}{l} t_0 := \frac{\tan \left(\pi \cdot \ell\right)}{F}\\ t_1 := \frac{{\pi}^{2}}{F \cdot F}\\ t_2 := \frac{1}{F \cdot F}\\ t_3 := {\pi}^{3} \cdot 0.3333333333333333\\ \mathbf{if}\;t_2 \leq 10^{+42}:\\ \;\;\;\;\pi \cdot \ell + \frac{-1}{\frac{F}{t_0}}\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+299}:\\ \;\;\;\;\pi \cdot \ell + \frac{-1}{\left(\frac{F}{\pi} \cdot \frac{F}{\ell} - \frac{{\pi}^{3} \cdot \left(\ell \cdot 0.3333333333333333\right)}{t_1}\right) + {\ell}^{3} \cdot \left(\frac{{t_3}^{2}}{\frac{{\pi}^{3}}{F \cdot F}} + \frac{\mathsf{fma}\left(-0.5 \cdot {\pi}^{2}, t_3, {\pi}^{5} \cdot 0.041666666666666664\right) - 0.008333333333333333 \cdot {\pi}^{5}}{t_1}\right)}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell + t_0 \cdot \frac{-1}{F}\\ \end{array} \end{array} \]
NOTE: F should be positive before calling this function
(FPCore (F l)
 :precision binary64
 (let* ((t_0 (/ (tan (* PI l)) F))
        (t_1 (/ (pow PI 2.0) (* F F)))
        (t_2 (/ 1.0 (* F F)))
        (t_3 (* (pow PI 3.0) 0.3333333333333333)))
   (if (<= t_2 1e+42)
     (+ (* PI l) (/ -1.0 (/ F t_0)))
     (if (<= t_2 5e+299)
       (+
        (* PI l)
        (/
         -1.0
         (+
          (-
           (* (/ F PI) (/ F l))
           (/ (* (pow PI 3.0) (* l 0.3333333333333333)) t_1))
          (*
           (pow l 3.0)
           (+
            (/ (pow t_3 2.0) (/ (pow PI 3.0) (* F F)))
            (/
             (-
              (fma
               (* -0.5 (pow PI 2.0))
               t_3
               (* (pow PI 5.0) 0.041666666666666664))
              (* 0.008333333333333333 (pow PI 5.0)))
             t_1))))))
       (+ (* PI l) (* t_0 (/ -1.0 F)))))))
F = abs(F);
double code(double F, double l) {
	double t_0 = tan((((double) M_PI) * l)) / F;
	double t_1 = pow(((double) M_PI), 2.0) / (F * F);
	double t_2 = 1.0 / (F * F);
	double t_3 = pow(((double) M_PI), 3.0) * 0.3333333333333333;
	double tmp;
	if (t_2 <= 1e+42) {
		tmp = (((double) M_PI) * l) + (-1.0 / (F / t_0));
	} else if (t_2 <= 5e+299) {
		tmp = (((double) M_PI) * l) + (-1.0 / ((((F / ((double) M_PI)) * (F / l)) - ((pow(((double) M_PI), 3.0) * (l * 0.3333333333333333)) / t_1)) + (pow(l, 3.0) * ((pow(t_3, 2.0) / (pow(((double) M_PI), 3.0) / (F * F))) + ((fma((-0.5 * pow(((double) M_PI), 2.0)), t_3, (pow(((double) M_PI), 5.0) * 0.041666666666666664)) - (0.008333333333333333 * pow(((double) M_PI), 5.0))) / t_1)))));
	} else {
		tmp = (((double) M_PI) * l) + (t_0 * (-1.0 / F));
	}
	return tmp;
}
F = abs(F)
function code(F, l)
	t_0 = Float64(tan(Float64(pi * l)) / F)
	t_1 = Float64((pi ^ 2.0) / Float64(F * F))
	t_2 = Float64(1.0 / Float64(F * F))
	t_3 = Float64((pi ^ 3.0) * 0.3333333333333333)
	tmp = 0.0
	if (t_2 <= 1e+42)
		tmp = Float64(Float64(pi * l) + Float64(-1.0 / Float64(F / t_0)));
	elseif (t_2 <= 5e+299)
		tmp = Float64(Float64(pi * l) + Float64(-1.0 / Float64(Float64(Float64(Float64(F / pi) * Float64(F / l)) - Float64(Float64((pi ^ 3.0) * Float64(l * 0.3333333333333333)) / t_1)) + Float64((l ^ 3.0) * Float64(Float64((t_3 ^ 2.0) / Float64((pi ^ 3.0) / Float64(F * F))) + Float64(Float64(fma(Float64(-0.5 * (pi ^ 2.0)), t_3, Float64((pi ^ 5.0) * 0.041666666666666664)) - Float64(0.008333333333333333 * (pi ^ 5.0))) / t_1))))));
	else
		tmp = Float64(Float64(pi * l) + Float64(t_0 * Float64(-1.0 / F)));
	end
	return tmp
end
NOTE: F should be positive before calling this function
code[F_, l_] := Block[{t$95$0 = N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[Pi, 2.0], $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[Pi, 3.0], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]}, If[LessEqual[t$95$2, 1e+42], N[(N[(Pi * l), $MachinePrecision] + N[(-1.0 / N[(F / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+299], N[(N[(Pi * l), $MachinePrecision] + N[(-1.0 / N[(N[(N[(N[(F / Pi), $MachinePrecision] * N[(F / l), $MachinePrecision]), $MachinePrecision] - N[(N[(N[Power[Pi, 3.0], $MachinePrecision] * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[Power[l, 3.0], $MachinePrecision] * N[(N[(N[Power[t$95$3, 2.0], $MachinePrecision] / N[(N[Power[Pi, 3.0], $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(-0.5 * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision] * t$95$3 + N[(N[Power[Pi, 5.0], $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision] - N[(0.008333333333333333 * N[Power[Pi, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(t$95$0 * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
F = |F|\\
\\
\begin{array}{l}
t_0 := \frac{\tan \left(\pi \cdot \ell\right)}{F}\\
t_1 := \frac{{\pi}^{2}}{F \cdot F}\\
t_2 := \frac{1}{F \cdot F}\\
t_3 := {\pi}^{3} \cdot 0.3333333333333333\\
\mathbf{if}\;t_2 \leq 10^{+42}:\\
\;\;\;\;\pi \cdot \ell + \frac{-1}{\frac{F}{t_0}}\\

\mathbf{elif}\;t_2 \leq 5 \cdot 10^{+299}:\\
\;\;\;\;\pi \cdot \ell + \frac{-1}{\left(\frac{F}{\pi} \cdot \frac{F}{\ell} - \frac{{\pi}^{3} \cdot \left(\ell \cdot 0.3333333333333333\right)}{t_1}\right) + {\ell}^{3} \cdot \left(\frac{{t_3}^{2}}{\frac{{\pi}^{3}}{F \cdot F}} + \frac{\mathsf{fma}\left(-0.5 \cdot {\pi}^{2}, t_3, {\pi}^{5} \cdot 0.041666666666666664\right) - 0.008333333333333333 \cdot {\pi}^{5}}{t_1}\right)}\\

\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + t_0 \cdot \frac{-1}{F}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (/.f64 1 (*.f64 F F)) < 1.00000000000000004e42

    1. Initial program 99.2%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. associate-/r/99.2%

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

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

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

    if 1.00000000000000004e42 < (/.f64 1 (*.f64 F F)) < 5.0000000000000003e299

    1. Initial program 73.3%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. associate-/r/73.3%

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{\frac{F}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}} \]
    4. Step-by-step derivation
      1. expm1-log1p-u56.9%

        \[\leadsto \pi \cdot \ell - \frac{1}{\frac{F}{\frac{\tan \color{blue}{\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\pi \cdot \ell\right)\right)\right)}}{F}}} \]
    5. Applied egg-rr56.9%

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

      \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{-1 \cdot \left({\ell}^{3} \cdot \left(-1 \cdot \frac{{F}^{2} \cdot {\left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)}^{2}}{{\pi}^{3}} + \frac{{F}^{2} \cdot \left(0.008333333333333333 \cdot {\pi}^{5} - \left(-0.5 \cdot \left({\pi}^{2} \cdot \left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)\right) + 0.041666666666666664 \cdot {\pi}^{5}\right)\right)}{{\pi}^{2}}\right)\right) + \left(-1 \cdot \frac{{F}^{2} \cdot \left(\ell \cdot \left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)\right)}{{\pi}^{2}} + \frac{{F}^{2}}{\ell \cdot \pi}\right)}} \]
    7. Simplified92.2%

      \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{\left(\frac{F}{\pi} \cdot \frac{F}{\ell} - \frac{{\pi}^{3} \cdot \left(0.3333333333333333 \cdot \ell\right)}{\frac{{\pi}^{2}}{F \cdot F}}\right) - {\ell}^{3} \cdot \left(\frac{0.008333333333333333 \cdot {\pi}^{5} - \mathsf{fma}\left(-0.5 \cdot {\pi}^{2}, {\pi}^{3} \cdot 0.3333333333333333, {\pi}^{5} \cdot 0.041666666666666664\right)}{\frac{{\pi}^{2}}{F \cdot F}} - \frac{{\left({\pi}^{3} \cdot 0.3333333333333333\right)}^{2}}{\frac{{\pi}^{3}}{F \cdot F}}\right)}} \]

    if 5.0000000000000003e299 < (/.f64 1 (*.f64 F F))

    1. Initial program 33.8%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. sqr-neg33.8%

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

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1 \cdot \tan \left(\pi \cdot \ell\right)}{\left(-F\right) \cdot \left(-F\right)}} \]
      3. *-lft-identity33.8%

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\tan \left(\pi \cdot \ell\right)}}{\left(-F\right) \cdot \left(-F\right)} \]
      4. sqr-neg33.8%

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

      \[\leadsto \color{blue}{\pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}} \]
    4. Step-by-step derivation
      1. associate-/r*51.4%

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
      2. div-inv51.4%

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\tan \left(\pi \cdot \ell\right)}{F} \cdot \frac{1}{F}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification85.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{1}{F \cdot F} \leq 10^{+42}:\\ \;\;\;\;\pi \cdot \ell + \frac{-1}{\frac{F}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}\\ \mathbf{elif}\;\frac{1}{F \cdot F} \leq 5 \cdot 10^{+299}:\\ \;\;\;\;\pi \cdot \ell + \frac{-1}{\left(\frac{F}{\pi} \cdot \frac{F}{\ell} - \frac{{\pi}^{3} \cdot \left(\ell \cdot 0.3333333333333333\right)}{\frac{{\pi}^{2}}{F \cdot F}}\right) + {\ell}^{3} \cdot \left(\frac{{\left({\pi}^{3} \cdot 0.3333333333333333\right)}^{2}}{\frac{{\pi}^{3}}{F \cdot F}} + \frac{\mathsf{fma}\left(-0.5 \cdot {\pi}^{2}, {\pi}^{3} \cdot 0.3333333333333333, {\pi}^{5} \cdot 0.041666666666666664\right) - 0.008333333333333333 \cdot {\pi}^{5}}{\frac{{\pi}^{2}}{F \cdot F}}\right)}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell + \frac{\tan \left(\pi \cdot \ell\right)}{F} \cdot \frac{-1}{F}\\ \end{array} \]

Alternative 4: 80.5% accurate, 1.0× speedup?

\[\begin{array}{l} F = |F|\\ \\ \begin{array}{l} \mathbf{if}\;F \leq 3.5 \cdot 10^{-164}:\\ \;\;\;\;\pi \cdot \ell - \frac{\ell}{F} \cdot \frac{\pi}{F}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}\\ \end{array} \end{array} \]
NOTE: F should be positive before calling this function
(FPCore (F l)
 :precision binary64
 (if (<= F 3.5e-164)
   (- (* PI l) (* (/ l F) (/ PI F)))
   (- (* PI l) (/ (tan (* PI l)) (* F F)))))
F = abs(F);
double code(double F, double l) {
	double tmp;
	if (F <= 3.5e-164) {
		tmp = (((double) M_PI) * l) - ((l / F) * (((double) M_PI) / F));
	} else {
		tmp = (((double) M_PI) * l) - (tan((((double) M_PI) * l)) / (F * F));
	}
	return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
	double tmp;
	if (F <= 3.5e-164) {
		tmp = (Math.PI * l) - ((l / F) * (Math.PI / F));
	} else {
		tmp = (Math.PI * l) - (Math.tan((Math.PI * l)) / (F * F));
	}
	return tmp;
}
F = abs(F)
def code(F, l):
	tmp = 0
	if F <= 3.5e-164:
		tmp = (math.pi * l) - ((l / F) * (math.pi / F))
	else:
		tmp = (math.pi * l) - (math.tan((math.pi * l)) / (F * F))
	return tmp
F = abs(F)
function code(F, l)
	tmp = 0.0
	if (F <= 3.5e-164)
		tmp = Float64(Float64(pi * l) - Float64(Float64(l / F) * Float64(pi / F)));
	else
		tmp = Float64(Float64(pi * l) - Float64(tan(Float64(pi * l)) / Float64(F * F)));
	end
	return tmp
end
F = abs(F)
function tmp_2 = code(F, l)
	tmp = 0.0;
	if (F <= 3.5e-164)
		tmp = (pi * l) - ((l / F) * (pi / F));
	else
		tmp = (pi * l) - (tan((pi * l)) / (F * F));
	end
	tmp_2 = tmp;
end
NOTE: F should be positive before calling this function
code[F_, l_] := If[LessEqual[F, 3.5e-164], N[(N[(Pi * l), $MachinePrecision] - N[(N[(l / F), $MachinePrecision] * N[(Pi / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.5 \cdot 10^{-164}:\\
\;\;\;\;\pi \cdot \ell - \frac{\ell}{F} \cdot \frac{\pi}{F}\\

\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 3.5e-164

    1. Initial program 67.7%

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell \cdot \pi}{{F}^{2}}} \]
    3. Step-by-step derivation
      1. associate-/l*63.0%

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell}{\frac{{F}^{2}}{\pi}}} \]
      2. associate-/r/63.0%

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell}{{F}^{2}} \cdot \pi} \]
      3. unpow263.0%

        \[\leadsto \pi \cdot \ell - \frac{\ell}{\color{blue}{F \cdot F}} \cdot \pi \]
    4. Simplified63.0%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell}{F \cdot F} \cdot \pi} \]
    5. Taylor expanded in l around 0 63.0%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell \cdot \pi}{{F}^{2}}} \]
    6. Step-by-step derivation
      1. unpow263.0%

        \[\leadsto \pi \cdot \ell - \frac{\ell \cdot \pi}{\color{blue}{F \cdot F}} \]
      2. times-frac71.1%

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell}{F} \cdot \frac{\pi}{F}} \]
    7. Simplified71.1%

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

    if 3.5e-164 < F

    1. Initial program 89.2%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. sqr-neg89.2%

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

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1 \cdot \tan \left(\pi \cdot \ell\right)}{\left(-F\right) \cdot \left(-F\right)}} \]
      3. *-lft-identity89.2%

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\tan \left(\pi \cdot \ell\right)}}{\left(-F\right) \cdot \left(-F\right)} \]
      4. sqr-neg89.2%

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

      \[\leadsto \color{blue}{\pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification78.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 3.5 \cdot 10^{-164}:\\ \;\;\;\;\pi \cdot \ell - \frac{\ell}{F} \cdot \frac{\pi}{F}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}\\ \end{array} \]

Alternative 5: 81.5% accurate, 1.0× speedup?

\[\begin{array}{l} F = |F|\\ \\ \pi \cdot \ell + \frac{\tan \left(\pi \cdot \ell\right)}{F} \cdot \frac{-1}{F} \end{array} \]
NOTE: F should be positive before calling this function
(FPCore (F l)
 :precision binary64
 (+ (* PI l) (* (/ (tan (* PI l)) F) (/ -1.0 F))))
F = abs(F);
double code(double F, double l) {
	return (((double) M_PI) * l) + ((tan((((double) M_PI) * l)) / F) * (-1.0 / F));
}
F = Math.abs(F);
public static double code(double F, double l) {
	return (Math.PI * l) + ((Math.tan((Math.PI * l)) / F) * (-1.0 / F));
}
F = abs(F)
def code(F, l):
	return (math.pi * l) + ((math.tan((math.pi * l)) / F) * (-1.0 / F))
F = abs(F)
function code(F, l)
	return Float64(Float64(pi * l) + Float64(Float64(tan(Float64(pi * l)) / F) * Float64(-1.0 / F)))
end
F = abs(F)
function tmp = code(F, l)
	tmp = (pi * l) + ((tan((pi * l)) / F) * (-1.0 / F));
end
NOTE: F should be positive before calling this function
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] + N[(N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
F = |F|\\
\\
\pi \cdot \ell + \frac{\tan \left(\pi \cdot \ell\right)}{F} \cdot \frac{-1}{F}
\end{array}
Derivation
  1. Initial program 76.7%

    \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
  2. Step-by-step derivation
    1. sqr-neg76.7%

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1 \cdot \tan \left(\pi \cdot \ell\right)}{\left(-F\right) \cdot \left(-F\right)}} \]
    3. *-lft-identity76.7%

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\tan \left(\pi \cdot \ell\right)}}{\left(-F\right) \cdot \left(-F\right)} \]
    4. sqr-neg76.7%

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

    \[\leadsto \color{blue}{\pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}} \]
  4. Step-by-step derivation
    1. associate-/r*81.4%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
    2. div-inv81.4%

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

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\tan \left(\pi \cdot \ell\right)}{F} \cdot \frac{1}{F}} \]
  6. Final simplification81.4%

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

Alternative 6: 81.5% accurate, 1.0× speedup?

\[\begin{array}{l} F = |F|\\ \\ \pi \cdot \ell + \frac{-1}{\frac{F}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}} \end{array} \]
NOTE: F should be positive before calling this function
(FPCore (F l)
 :precision binary64
 (+ (* PI l) (/ -1.0 (/ F (/ (tan (* PI l)) F)))))
F = abs(F);
double code(double F, double l) {
	return (((double) M_PI) * l) + (-1.0 / (F / (tan((((double) M_PI) * l)) / F)));
}
F = Math.abs(F);
public static double code(double F, double l) {
	return (Math.PI * l) + (-1.0 / (F / (Math.tan((Math.PI * l)) / F)));
}
F = abs(F)
def code(F, l):
	return (math.pi * l) + (-1.0 / (F / (math.tan((math.pi * l)) / F)))
F = abs(F)
function code(F, l)
	return Float64(Float64(pi * l) + Float64(-1.0 / Float64(F / Float64(tan(Float64(pi * l)) / F))))
end
F = abs(F)
function tmp = code(F, l)
	tmp = (pi * l) + (-1.0 / (F / (tan((pi * l)) / F)));
end
NOTE: F should be positive before calling this function
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] + N[(-1.0 / N[(F / N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
F = |F|\\
\\
\pi \cdot \ell + \frac{-1}{\frac{F}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}
\end{array}
Derivation
  1. Initial program 76.7%

    \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
  2. Step-by-step derivation
    1. associate-/r/76.7%

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

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

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

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

Alternative 7: 81.6% accurate, 1.0× speedup?

\[\begin{array}{l} F = |F|\\ \\ \pi \cdot \ell - \frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F} \end{array} \]
NOTE: F should be positive before calling this function
(FPCore (F l) :precision binary64 (- (* PI l) (/ (/ (tan (* PI l)) F) F)))
F = abs(F);
double code(double F, double l) {
	return (((double) M_PI) * l) - ((tan((((double) M_PI) * l)) / F) / F);
}
F = Math.abs(F);
public static double code(double F, double l) {
	return (Math.PI * l) - ((Math.tan((Math.PI * l)) / F) / F);
}
F = abs(F)
def code(F, l):
	return (math.pi * l) - ((math.tan((math.pi * l)) / F) / F)
F = abs(F)
function code(F, l)
	return Float64(Float64(pi * l) - Float64(Float64(tan(Float64(pi * l)) / F) / F))
end
F = abs(F)
function tmp = code(F, l)
	tmp = (pi * l) - ((tan((pi * l)) / F) / F);
end
NOTE: F should be positive before calling this function
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
F = |F|\\
\\
\pi \cdot \ell - \frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}
\end{array}
Derivation
  1. Initial program 76.7%

    \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
  2. Step-by-step derivation
    1. associate-*l/76.7%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1 \cdot \tan \left(\pi \cdot \ell\right)}{F \cdot F}} \]
    2. *-un-lft-identity76.7%

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

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

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
  4. Final simplification81.4%

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

Alternative 8: 74.0% accurate, 1.5× speedup?

\[\begin{array}{l} F = |F|\\ \\ \pi \cdot \ell - \frac{\ell}{F} \cdot \frac{\pi}{F} \end{array} \]
NOTE: F should be positive before calling this function
(FPCore (F l) :precision binary64 (- (* PI l) (* (/ l F) (/ PI F))))
F = abs(F);
double code(double F, double l) {
	return (((double) M_PI) * l) - ((l / F) * (((double) M_PI) / F));
}
F = Math.abs(F);
public static double code(double F, double l) {
	return (Math.PI * l) - ((l / F) * (Math.PI / F));
}
F = abs(F)
def code(F, l):
	return (math.pi * l) - ((l / F) * (math.pi / F))
F = abs(F)
function code(F, l)
	return Float64(Float64(pi * l) - Float64(Float64(l / F) * Float64(pi / F)))
end
F = abs(F)
function tmp = code(F, l)
	tmp = (pi * l) - ((l / F) * (pi / F));
end
NOTE: F should be positive before calling this function
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] - N[(N[(l / F), $MachinePrecision] * N[(Pi / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
F = |F|\\
\\
\pi \cdot \ell - \frac{\ell}{F} \cdot \frac{\pi}{F}
\end{array}
Derivation
  1. Initial program 76.7%

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

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell \cdot \pi}{{F}^{2}}} \]
  3. Step-by-step derivation
    1. associate-/l*69.6%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell}{\frac{{F}^{2}}{\pi}}} \]
    2. associate-/r/69.6%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell}{{F}^{2}} \cdot \pi} \]
    3. unpow269.6%

      \[\leadsto \pi \cdot \ell - \frac{\ell}{\color{blue}{F \cdot F}} \cdot \pi \]
  4. Simplified69.6%

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell}{F \cdot F} \cdot \pi} \]
  5. Taylor expanded in l around 0 69.6%

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell \cdot \pi}{{F}^{2}}} \]
  6. Step-by-step derivation
    1. unpow269.6%

      \[\leadsto \pi \cdot \ell - \frac{\ell \cdot \pi}{\color{blue}{F \cdot F}} \]
    2. times-frac74.4%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell}{F} \cdot \frac{\pi}{F}} \]
  7. Simplified74.4%

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell}{F} \cdot \frac{\pi}{F}} \]
  8. Final simplification74.4%

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

Alternative 9: 68.3% accurate, 1.5× speedup?

\[\begin{array}{l} F = |F|\\ \\ \pi \cdot \left(\ell - \ell \cdot {F}^{-2}\right) \end{array} \]
NOTE: F should be positive before calling this function
(FPCore (F l) :precision binary64 (* PI (- l (* l (pow F -2.0)))))
F = abs(F);
double code(double F, double l) {
	return ((double) M_PI) * (l - (l * pow(F, -2.0)));
}
F = Math.abs(F);
public static double code(double F, double l) {
	return Math.PI * (l - (l * Math.pow(F, -2.0)));
}
F = abs(F)
def code(F, l):
	return math.pi * (l - (l * math.pow(F, -2.0)))
F = abs(F)
function code(F, l)
	return Float64(pi * Float64(l - Float64(l * (F ^ -2.0))))
end
F = abs(F)
function tmp = code(F, l)
	tmp = pi * (l - (l * (F ^ -2.0)));
end
NOTE: F should be positive before calling this function
code[F_, l_] := N[(Pi * N[(l - N[(l * N[Power[F, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
F = |F|\\
\\
\pi \cdot \left(\ell - \ell \cdot {F}^{-2}\right)
\end{array}
Derivation
  1. Initial program 76.7%

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

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell \cdot \pi}{{F}^{2}}} \]
  3. Step-by-step derivation
    1. associate-/l*69.6%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell}{\frac{{F}^{2}}{\pi}}} \]
    2. associate-/r/69.6%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell}{{F}^{2}} \cdot \pi} \]
    3. unpow269.6%

      \[\leadsto \pi \cdot \ell - \frac{\ell}{\color{blue}{F \cdot F}} \cdot \pi \]
  4. Simplified69.6%

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell}{F \cdot F} \cdot \pi} \]
  5. Step-by-step derivation
    1. add-sqr-sqrt52.0%

      \[\leadsto \pi \cdot \ell - \color{blue}{\sqrt{\frac{\ell}{F \cdot F} \cdot \pi} \cdot \sqrt{\frac{\ell}{F \cdot F} \cdot \pi}} \]
    2. sqrt-unprod59.3%

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

      \[\leadsto \pi \cdot \ell - \sqrt{\color{blue}{{\left(\frac{\ell}{F \cdot F} \cdot \pi\right)}^{2}}} \]
    4. associate-*l/59.3%

      \[\leadsto \pi \cdot \ell - \sqrt{{\color{blue}{\left(\frac{\ell \cdot \pi}{F \cdot F}\right)}}^{2}} \]
    5. times-frac60.1%

      \[\leadsto \pi \cdot \ell - \sqrt{{\color{blue}{\left(\frac{\ell}{F} \cdot \frac{\pi}{F}\right)}}^{2}} \]
  6. Applied egg-rr60.1%

    \[\leadsto \pi \cdot \ell - \color{blue}{\sqrt{{\left(\frac{\ell}{F} \cdot \frac{\pi}{F}\right)}^{2}}} \]
  7. Step-by-step derivation
    1. unpow260.1%

      \[\leadsto \pi \cdot \ell - \sqrt{\color{blue}{\left(\frac{\ell}{F} \cdot \frac{\pi}{F}\right) \cdot \left(\frac{\ell}{F} \cdot \frac{\pi}{F}\right)}} \]
    2. rem-sqrt-square64.0%

      \[\leadsto \pi \cdot \ell - \color{blue}{\left|\frac{\ell}{F} \cdot \frac{\pi}{F}\right|} \]
    3. times-frac60.8%

      \[\leadsto \pi \cdot \ell - \left|\color{blue}{\frac{\ell \cdot \pi}{F \cdot F}}\right| \]
    4. *-commutative60.8%

      \[\leadsto \pi \cdot \ell - \left|\frac{\color{blue}{\pi \cdot \ell}}{F \cdot F}\right| \]
    5. *-lft-identity60.8%

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

      \[\leadsto \pi \cdot \ell - \left|\frac{\color{blue}{1 \cdot \left(\pi \cdot \ell\right)}}{F \cdot F}\right| \]
    7. associate-*l/60.8%

      \[\leadsto \pi \cdot \ell - \left|\color{blue}{\frac{1}{F \cdot F} \cdot \left(\pi \cdot \ell\right)}\right| \]
    8. associate-/r*60.8%

      \[\leadsto \pi \cdot \ell - \left|\color{blue}{\frac{\frac{1}{F}}{F}} \cdot \left(\pi \cdot \ell\right)\right| \]
    9. *-lft-identity60.8%

      \[\leadsto \pi \cdot \ell - \left|\frac{\color{blue}{1 \cdot \frac{1}{F}}}{F} \cdot \left(\pi \cdot \ell\right)\right| \]
    10. associate-*l/60.8%

      \[\leadsto \pi \cdot \ell - \left|\color{blue}{\left(\frac{1}{F} \cdot \frac{1}{F}\right)} \cdot \left(\pi \cdot \ell\right)\right| \]
    11. unpow-160.8%

      \[\leadsto \pi \cdot \ell - \left|\left(\color{blue}{{F}^{-1}} \cdot \frac{1}{F}\right) \cdot \left(\pi \cdot \ell\right)\right| \]
    12. unpow-160.8%

      \[\leadsto \pi \cdot \ell - \left|\left({F}^{-1} \cdot \color{blue}{{F}^{-1}}\right) \cdot \left(\pi \cdot \ell\right)\right| \]
    13. pow-sqr60.8%

      \[\leadsto \pi \cdot \ell - \left|\color{blue}{{F}^{\left(2 \cdot -1\right)}} \cdot \left(\pi \cdot \ell\right)\right| \]
    14. metadata-eval60.8%

      \[\leadsto \pi \cdot \ell - \left|{F}^{\color{blue}{-2}} \cdot \left(\pi \cdot \ell\right)\right| \]
    15. *-commutative60.8%

      \[\leadsto \pi \cdot \ell - \left|{F}^{-2} \cdot \color{blue}{\left(\ell \cdot \pi\right)}\right| \]
  8. Simplified60.8%

    \[\leadsto \pi \cdot \ell - \color{blue}{\left|{F}^{-2} \cdot \left(\ell \cdot \pi\right)\right|} \]
  9. Taylor expanded in l around 0 60.8%

    \[\leadsto \color{blue}{-1 \cdot \left|\frac{\ell \cdot \pi}{{F}^{2}}\right| + \ell \cdot \pi} \]
  10. Step-by-step derivation
    1. mul-1-neg60.8%

      \[\leadsto \color{blue}{\left(-\left|\frac{\ell \cdot \pi}{{F}^{2}}\right|\right)} + \ell \cdot \pi \]
    2. +-commutative60.8%

      \[\leadsto \color{blue}{\ell \cdot \pi + \left(-\left|\frac{\ell \cdot \pi}{{F}^{2}}\right|\right)} \]
    3. sub-neg60.8%

      \[\leadsto \color{blue}{\ell \cdot \pi - \left|\frac{\ell \cdot \pi}{{F}^{2}}\right|} \]
    4. *-commutative60.8%

      \[\leadsto \color{blue}{\pi \cdot \ell} - \left|\frac{\ell \cdot \pi}{{F}^{2}}\right| \]
    5. unpow260.8%

      \[\leadsto \pi \cdot \ell - \left|\frac{\ell \cdot \pi}{\color{blue}{F \cdot F}}\right| \]
    6. associate-/l*60.8%

      \[\leadsto \pi \cdot \ell - \left|\color{blue}{\frac{\ell}{\frac{F \cdot F}{\pi}}}\right| \]
    7. associate-*r/60.8%

      \[\leadsto \pi \cdot \ell - \left|\frac{\ell}{\color{blue}{F \cdot \frac{F}{\pi}}}\right| \]
    8. associate-/r*64.0%

      \[\leadsto \pi \cdot \ell - \left|\color{blue}{\frac{\frac{\ell}{F}}{\frac{F}{\pi}}}\right| \]
    9. associate-/l*64.0%

      \[\leadsto \pi \cdot \ell - \left|\color{blue}{\frac{\frac{\ell}{F} \cdot \pi}{F}}\right| \]
    10. *-rgt-identity64.0%

      \[\leadsto \pi \cdot \ell - \left|\frac{\color{blue}{\left(\frac{\ell}{F} \cdot \pi\right) \cdot 1}}{F}\right| \]
    11. associate-*r/64.0%

      \[\leadsto \pi \cdot \ell - \left|\color{blue}{\left(\frac{\ell}{F} \cdot \pi\right) \cdot \frac{1}{F}}\right| \]
    12. associate-*l/64.0%

      \[\leadsto \pi \cdot \ell - \left|\color{blue}{\frac{\ell \cdot \pi}{F}} \cdot \frac{1}{F}\right| \]
    13. *-commutative64.0%

      \[\leadsto \pi \cdot \ell - \left|\frac{\color{blue}{\pi \cdot \ell}}{F} \cdot \frac{1}{F}\right| \]
    14. associate-*l/64.0%

      \[\leadsto \pi \cdot \ell - \left|\color{blue}{\frac{\left(\pi \cdot \ell\right) \cdot \frac{1}{F}}{F}}\right| \]
    15. *-rgt-identity64.0%

      \[\leadsto \pi \cdot \ell - \left|\frac{\color{blue}{\left(\left(\pi \cdot \ell\right) \cdot \frac{1}{F}\right) \cdot 1}}{F}\right| \]
    16. associate-*r/64.0%

      \[\leadsto \pi \cdot \ell - \left|\color{blue}{\left(\left(\pi \cdot \ell\right) \cdot \frac{1}{F}\right) \cdot \frac{1}{F}}\right| \]
    17. associate-*l*60.8%

      \[\leadsto \pi \cdot \ell - \left|\color{blue}{\left(\pi \cdot \ell\right) \cdot \left(\frac{1}{F} \cdot \frac{1}{F}\right)}\right| \]
  11. Simplified69.7%

    \[\leadsto \color{blue}{\pi \cdot \left(\ell - \ell \cdot {F}^{-2}\right)} \]
  12. Final simplification69.7%

    \[\leadsto \pi \cdot \left(\ell - \ell \cdot {F}^{-2}\right) \]

Alternative 10: 20.7% accurate, 2.9× speedup?

\[\begin{array}{l} F = |F|\\ \\ \ell \cdot \frac{\frac{\pi}{F}}{-F} \end{array} \]
NOTE: F should be positive before calling this function
(FPCore (F l) :precision binary64 (* l (/ (/ PI F) (- F))))
F = abs(F);
double code(double F, double l) {
	return l * ((((double) M_PI) / F) / -F);
}
F = Math.abs(F);
public static double code(double F, double l) {
	return l * ((Math.PI / F) / -F);
}
F = abs(F)
def code(F, l):
	return l * ((math.pi / F) / -F)
F = abs(F)
function code(F, l)
	return Float64(l * Float64(Float64(pi / F) / Float64(-F)))
end
F = abs(F)
function tmp = code(F, l)
	tmp = l * ((pi / F) / -F);
end
NOTE: F should be positive before calling this function
code[F_, l_] := N[(l * N[(N[(Pi / F), $MachinePrecision] / (-F)), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
F = |F|\\
\\
\ell \cdot \frac{\frac{\pi}{F}}{-F}
\end{array}
Derivation
  1. Initial program 76.7%

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

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell \cdot \pi}{{F}^{2}}} \]
  3. Step-by-step derivation
    1. associate-/l*69.6%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell}{\frac{{F}^{2}}{\pi}}} \]
    2. associate-/r/69.6%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell}{{F}^{2}} \cdot \pi} \]
    3. unpow269.6%

      \[\leadsto \pi \cdot \ell - \frac{\ell}{\color{blue}{F \cdot F}} \cdot \pi \]
  4. Simplified69.6%

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell}{F \cdot F} \cdot \pi} \]
  5. Step-by-step derivation
    1. add-sqr-sqrt52.0%

      \[\leadsto \pi \cdot \ell - \color{blue}{\sqrt{\frac{\ell}{F \cdot F} \cdot \pi} \cdot \sqrt{\frac{\ell}{F \cdot F} \cdot \pi}} \]
    2. sqrt-unprod59.3%

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

      \[\leadsto \pi \cdot \ell - \sqrt{\color{blue}{{\left(\frac{\ell}{F \cdot F} \cdot \pi\right)}^{2}}} \]
    4. associate-*l/59.3%

      \[\leadsto \pi \cdot \ell - \sqrt{{\color{blue}{\left(\frac{\ell \cdot \pi}{F \cdot F}\right)}}^{2}} \]
    5. times-frac60.1%

      \[\leadsto \pi \cdot \ell - \sqrt{{\color{blue}{\left(\frac{\ell}{F} \cdot \frac{\pi}{F}\right)}}^{2}} \]
  6. Applied egg-rr60.1%

    \[\leadsto \pi \cdot \ell - \color{blue}{\sqrt{{\left(\frac{\ell}{F} \cdot \frac{\pi}{F}\right)}^{2}}} \]
  7. Step-by-step derivation
    1. unpow260.1%

      \[\leadsto \pi \cdot \ell - \sqrt{\color{blue}{\left(\frac{\ell}{F} \cdot \frac{\pi}{F}\right) \cdot \left(\frac{\ell}{F} \cdot \frac{\pi}{F}\right)}} \]
    2. rem-sqrt-square64.0%

      \[\leadsto \pi \cdot \ell - \color{blue}{\left|\frac{\ell}{F} \cdot \frac{\pi}{F}\right|} \]
    3. times-frac60.8%

      \[\leadsto \pi \cdot \ell - \left|\color{blue}{\frac{\ell \cdot \pi}{F \cdot F}}\right| \]
    4. *-commutative60.8%

      \[\leadsto \pi \cdot \ell - \left|\frac{\color{blue}{\pi \cdot \ell}}{F \cdot F}\right| \]
    5. *-lft-identity60.8%

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

      \[\leadsto \pi \cdot \ell - \left|\frac{\color{blue}{1 \cdot \left(\pi \cdot \ell\right)}}{F \cdot F}\right| \]
    7. associate-*l/60.8%

      \[\leadsto \pi \cdot \ell - \left|\color{blue}{\frac{1}{F \cdot F} \cdot \left(\pi \cdot \ell\right)}\right| \]
    8. associate-/r*60.8%

      \[\leadsto \pi \cdot \ell - \left|\color{blue}{\frac{\frac{1}{F}}{F}} \cdot \left(\pi \cdot \ell\right)\right| \]
    9. *-lft-identity60.8%

      \[\leadsto \pi \cdot \ell - \left|\frac{\color{blue}{1 \cdot \frac{1}{F}}}{F} \cdot \left(\pi \cdot \ell\right)\right| \]
    10. associate-*l/60.8%

      \[\leadsto \pi \cdot \ell - \left|\color{blue}{\left(\frac{1}{F} \cdot \frac{1}{F}\right)} \cdot \left(\pi \cdot \ell\right)\right| \]
    11. unpow-160.8%

      \[\leadsto \pi \cdot \ell - \left|\left(\color{blue}{{F}^{-1}} \cdot \frac{1}{F}\right) \cdot \left(\pi \cdot \ell\right)\right| \]
    12. unpow-160.8%

      \[\leadsto \pi \cdot \ell - \left|\left({F}^{-1} \cdot \color{blue}{{F}^{-1}}\right) \cdot \left(\pi \cdot \ell\right)\right| \]
    13. pow-sqr60.8%

      \[\leadsto \pi \cdot \ell - \left|\color{blue}{{F}^{\left(2 \cdot -1\right)}} \cdot \left(\pi \cdot \ell\right)\right| \]
    14. metadata-eval60.8%

      \[\leadsto \pi \cdot \ell - \left|{F}^{\color{blue}{-2}} \cdot \left(\pi \cdot \ell\right)\right| \]
    15. *-commutative60.8%

      \[\leadsto \pi \cdot \ell - \left|{F}^{-2} \cdot \color{blue}{\left(\ell \cdot \pi\right)}\right| \]
  8. Simplified60.8%

    \[\leadsto \pi \cdot \ell - \color{blue}{\left|{F}^{-2} \cdot \left(\ell \cdot \pi\right)\right|} \]
  9. Taylor expanded in l around 0 15.2%

    \[\leadsto \color{blue}{-1 \cdot \left|\frac{\ell \cdot \pi}{{F}^{2}}\right|} \]
  10. Simplified23.7%

    \[\leadsto \color{blue}{\ell \cdot \frac{\frac{\pi}{F}}{-F}} \]
  11. Final simplification23.7%

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

Reproduce

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