VandenBroeck and Keller, Equation (6)

Percentage Accurate: 75.7% → 86.8%
Time: 36.7s
Alternatives: 12
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 12 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.7% 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.8% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.008333333333333333 \cdot {\pi}^{5}\\ t_1 := {\pi}^{3} \cdot 0.3333333333333333\\ t_2 := \mathsf{fma}\left({\pi}^{5}, 0.041666666666666664, \left(-0.5 \cdot {\pi}^{2}\right) \cdot t\_1\right)\\ t_3 := t\_2 - t\_0\\ t_4 := {F}^{2} \cdot \frac{t\_3}{{\pi}^{2}}\\ t_5 := {F}^{2} \cdot \frac{{\pi}^{6} \cdot 0.1111111111111111}{{\pi}^{3}}\\ \mathbf{if}\;F \cdot F \leq 10^{-320}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\ell \cdot \sqrt[3]{{\pi}^{3}}\right)}{F}}{F}\\ \mathbf{elif}\;F \cdot F \leq 10^{-54}:\\ \;\;\;\;\pi \cdot \ell + \frac{-1}{\frac{\mathsf{fma}\left({\ell}^{2}, \mathsf{fma}\left({\ell}^{2}, \mathsf{fma}\left(-{\ell}^{2}, \left({F}^{2} \cdot \frac{-0.0001984126984126984 \cdot {\pi}^{7} - \mathsf{fma}\left(-0.5, {\pi}^{2} \cdot \left(t\_0 - t\_2\right), \mathsf{fma}\left(0.041666666666666664 \cdot {\pi}^{4}, t\_1, {\pi}^{7} \cdot -0.001388888888888889\right)\right)}{{\pi}^{2}} + {F}^{2} \cdot \frac{t\_1 \cdot t\_3}{{\pi}^{3}}\right) + \left({\pi}^{3} \cdot \frac{0.3333333333333333}{\pi}\right) \cdot \left(t\_5 + t\_4\right), t\_5\right) + t\_4, {F}^{2} \cdot \left({\pi}^{3} \cdot \frac{0.3333333333333333}{-{\pi}^{2}}\right)\right), \frac{{F}^{2}}{\pi}\right)}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{1}{\frac{F}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (let* ((t_0 (* 0.008333333333333333 (pow PI 5.0)))
        (t_1 (* (pow PI 3.0) 0.3333333333333333))
        (t_2
         (fma (pow PI 5.0) 0.041666666666666664 (* (* -0.5 (pow PI 2.0)) t_1)))
        (t_3 (- t_2 t_0))
        (t_4 (* (pow F 2.0) (/ t_3 (pow PI 2.0))))
        (t_5
         (* (pow F 2.0) (/ (* (pow PI 6.0) 0.1111111111111111) (pow PI 3.0)))))
   (if (<= (* F F) 1e-320)
     (- (* PI l) (/ (/ (tan (* l (cbrt (pow PI 3.0)))) F) F))
     (if (<= (* F F) 1e-54)
       (+
        (* PI l)
        (/
         -1.0
         (/
          (fma
           (pow l 2.0)
           (fma
            (pow l 2.0)
            (+
             (fma
              (- (pow l 2.0))
              (+
               (+
                (*
                 (pow F 2.0)
                 (/
                  (-
                   (* -0.0001984126984126984 (pow PI 7.0))
                   (fma
                    -0.5
                    (* (pow PI 2.0) (- t_0 t_2))
                    (fma
                     (* 0.041666666666666664 (pow PI 4.0))
                     t_1
                     (* (pow PI 7.0) -0.001388888888888889))))
                  (pow PI 2.0)))
                (* (pow F 2.0) (/ (* t_1 t_3) (pow PI 3.0))))
               (* (* (pow PI 3.0) (/ 0.3333333333333333 PI)) (+ t_5 t_4)))
              t_5)
             t_4)
            (*
             (pow F 2.0)
             (* (pow PI 3.0) (/ 0.3333333333333333 (- (pow PI 2.0))))))
           (/ (pow F 2.0) PI))
          l)))
       (- (* PI l) (/ 1.0 (/ F (/ (tan (* PI l)) F))))))))
double code(double F, double l) {
	double t_0 = 0.008333333333333333 * pow(((double) M_PI), 5.0);
	double t_1 = pow(((double) M_PI), 3.0) * 0.3333333333333333;
	double t_2 = fma(pow(((double) M_PI), 5.0), 0.041666666666666664, ((-0.5 * pow(((double) M_PI), 2.0)) * t_1));
	double t_3 = t_2 - t_0;
	double t_4 = pow(F, 2.0) * (t_3 / pow(((double) M_PI), 2.0));
	double t_5 = pow(F, 2.0) * ((pow(((double) M_PI), 6.0) * 0.1111111111111111) / pow(((double) M_PI), 3.0));
	double tmp;
	if ((F * F) <= 1e-320) {
		tmp = (((double) M_PI) * l) - ((tan((l * cbrt(pow(((double) M_PI), 3.0)))) / F) / F);
	} else if ((F * F) <= 1e-54) {
		tmp = (((double) M_PI) * l) + (-1.0 / (fma(pow(l, 2.0), fma(pow(l, 2.0), (fma(-pow(l, 2.0), (((pow(F, 2.0) * (((-0.0001984126984126984 * pow(((double) M_PI), 7.0)) - fma(-0.5, (pow(((double) M_PI), 2.0) * (t_0 - t_2)), fma((0.041666666666666664 * pow(((double) M_PI), 4.0)), t_1, (pow(((double) M_PI), 7.0) * -0.001388888888888889)))) / pow(((double) M_PI), 2.0))) + (pow(F, 2.0) * ((t_1 * t_3) / pow(((double) M_PI), 3.0)))) + ((pow(((double) M_PI), 3.0) * (0.3333333333333333 / ((double) M_PI))) * (t_5 + t_4))), t_5) + t_4), (pow(F, 2.0) * (pow(((double) M_PI), 3.0) * (0.3333333333333333 / -pow(((double) M_PI), 2.0))))), (pow(F, 2.0) / ((double) M_PI))) / l));
	} else {
		tmp = (((double) M_PI) * l) - (1.0 / (F / (tan((((double) M_PI) * l)) / F)));
	}
	return tmp;
}
function code(F, l)
	t_0 = Float64(0.008333333333333333 * (pi ^ 5.0))
	t_1 = Float64((pi ^ 3.0) * 0.3333333333333333)
	t_2 = fma((pi ^ 5.0), 0.041666666666666664, Float64(Float64(-0.5 * (pi ^ 2.0)) * t_1))
	t_3 = Float64(t_2 - t_0)
	t_4 = Float64((F ^ 2.0) * Float64(t_3 / (pi ^ 2.0)))
	t_5 = Float64((F ^ 2.0) * Float64(Float64((pi ^ 6.0) * 0.1111111111111111) / (pi ^ 3.0)))
	tmp = 0.0
	if (Float64(F * F) <= 1e-320)
		tmp = Float64(Float64(pi * l) - Float64(Float64(tan(Float64(l * cbrt((pi ^ 3.0)))) / F) / F));
	elseif (Float64(F * F) <= 1e-54)
		tmp = Float64(Float64(pi * l) + Float64(-1.0 / Float64(fma((l ^ 2.0), fma((l ^ 2.0), Float64(fma(Float64(-(l ^ 2.0)), Float64(Float64(Float64((F ^ 2.0) * Float64(Float64(Float64(-0.0001984126984126984 * (pi ^ 7.0)) - fma(-0.5, Float64((pi ^ 2.0) * Float64(t_0 - t_2)), fma(Float64(0.041666666666666664 * (pi ^ 4.0)), t_1, Float64((pi ^ 7.0) * -0.001388888888888889)))) / (pi ^ 2.0))) + Float64((F ^ 2.0) * Float64(Float64(t_1 * t_3) / (pi ^ 3.0)))) + Float64(Float64((pi ^ 3.0) * Float64(0.3333333333333333 / pi)) * Float64(t_5 + t_4))), t_5) + t_4), Float64((F ^ 2.0) * Float64((pi ^ 3.0) * Float64(0.3333333333333333 / Float64(-(pi ^ 2.0)))))), Float64((F ^ 2.0) / pi)) / l)));
	else
		tmp = Float64(Float64(pi * l) - Float64(1.0 / Float64(F / Float64(tan(Float64(pi * l)) / F))));
	end
	return tmp
end
code[F_, l_] := Block[{t$95$0 = N[(0.008333333333333333 * N[Power[Pi, 5.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[Pi, 3.0], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[Pi, 5.0], $MachinePrecision] * 0.041666666666666664 + N[(N[(-0.5 * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - t$95$0), $MachinePrecision]}, Block[{t$95$4 = N[(N[Power[F, 2.0], $MachinePrecision] * N[(t$95$3 / N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[Power[F, 2.0], $MachinePrecision] * N[(N[(N[Power[Pi, 6.0], $MachinePrecision] * 0.1111111111111111), $MachinePrecision] / N[Power[Pi, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(F * F), $MachinePrecision], 1e-320], N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[Tan[N[(l * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(F * F), $MachinePrecision], 1e-54], N[(N[(Pi * l), $MachinePrecision] + N[(-1.0 / N[(N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[((-N[Power[l, 2.0], $MachinePrecision]) * N[(N[(N[(N[Power[F, 2.0], $MachinePrecision] * N[(N[(N[(-0.0001984126984126984 * N[Power[Pi, 7.0], $MachinePrecision]), $MachinePrecision] - N[(-0.5 * N[(N[Power[Pi, 2.0], $MachinePrecision] * N[(t$95$0 - t$95$2), $MachinePrecision]), $MachinePrecision] + N[(N[(0.041666666666666664 * N[Power[Pi, 4.0], $MachinePrecision]), $MachinePrecision] * t$95$1 + N[(N[Power[Pi, 7.0], $MachinePrecision] * -0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[F, 2.0], $MachinePrecision] * N[(N[(t$95$1 * t$95$3), $MachinePrecision] / N[Power[Pi, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[Pi, 3.0], $MachinePrecision] * N[(0.3333333333333333 / Pi), $MachinePrecision]), $MachinePrecision] * N[(t$95$5 + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision] + t$95$4), $MachinePrecision] + N[(N[Power[F, 2.0], $MachinePrecision] * N[(N[Power[Pi, 3.0], $MachinePrecision] * N[(0.3333333333333333 / (-N[Power[Pi, 2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[F, 2.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}

\\
\begin{array}{l}
t_0 := 0.008333333333333333 \cdot {\pi}^{5}\\
t_1 := {\pi}^{3} \cdot 0.3333333333333333\\
t_2 := \mathsf{fma}\left({\pi}^{5}, 0.041666666666666664, \left(-0.5 \cdot {\pi}^{2}\right) \cdot t\_1\right)\\
t_3 := t\_2 - t\_0\\
t_4 := {F}^{2} \cdot \frac{t\_3}{{\pi}^{2}}\\
t_5 := {F}^{2} \cdot \frac{{\pi}^{6} \cdot 0.1111111111111111}{{\pi}^{3}}\\
\mathbf{if}\;F \cdot F \leq 10^{-320}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\ell \cdot \sqrt[3]{{\pi}^{3}}\right)}{F}}{F}\\

\mathbf{elif}\;F \cdot F \leq 10^{-54}:\\
\;\;\;\;\pi \cdot \ell + \frac{-1}{\frac{\mathsf{fma}\left({\ell}^{2}, \mathsf{fma}\left({\ell}^{2}, \mathsf{fma}\left(-{\ell}^{2}, \left({F}^{2} \cdot \frac{-0.0001984126984126984 \cdot {\pi}^{7} - \mathsf{fma}\left(-0.5, {\pi}^{2} \cdot \left(t\_0 - t\_2\right), \mathsf{fma}\left(0.041666666666666664 \cdot {\pi}^{4}, t\_1, {\pi}^{7} \cdot -0.001388888888888889\right)\right)}{{\pi}^{2}} + {F}^{2} \cdot \frac{t\_1 \cdot t\_3}{{\pi}^{3}}\right) + \left({\pi}^{3} \cdot \frac{0.3333333333333333}{\pi}\right) \cdot \left(t\_5 + t\_4\right), t\_5\right) + t\_4, {F}^{2} \cdot \left({\pi}^{3} \cdot \frac{0.3333333333333333}{-{\pi}^{2}}\right)\right), \frac{{F}^{2}}{\pi}\right)}{\ell}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 F F) < 9.99989e-321

    1. Initial program 30.6%

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

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

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
    5. Step-by-step derivation
      1. add-cbrt-cube60.3%

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

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

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

    if 9.99989e-321 < (*.f64 F F) < 1e-54

    1. Initial program 67.2%

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

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

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

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

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

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

      \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{\frac{{\ell}^{2} \cdot \left({\ell}^{2} \cdot \left(-1 \cdot \left({\ell}^{2} \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(-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) - \frac{{F}^{2} \cdot \left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)}{{\pi}^{2}}\right) + \frac{{F}^{2}}{\pi}}{\ell}}} \]
    6. Simplified95.2%

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

    if 1e-54 < (*.f64 F F)

    1. Initial program 99.2%

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

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

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

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

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

      \[\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 simplification89.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \cdot F \leq 10^{-320}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\ell \cdot \sqrt[3]{{\pi}^{3}}\right)}{F}}{F}\\ \mathbf{elif}\;F \cdot F \leq 10^{-54}:\\ \;\;\;\;\pi \cdot \ell + \frac{-1}{\frac{\mathsf{fma}\left({\ell}^{2}, \mathsf{fma}\left({\ell}^{2}, \mathsf{fma}\left(-{\ell}^{2}, \left({F}^{2} \cdot \frac{-0.0001984126984126984 \cdot {\pi}^{7} - \mathsf{fma}\left(-0.5, {\pi}^{2} \cdot \left(0.008333333333333333 \cdot {\pi}^{5} - \mathsf{fma}\left({\pi}^{5}, 0.041666666666666664, \left(-0.5 \cdot {\pi}^{2}\right) \cdot \left({\pi}^{3} \cdot 0.3333333333333333\right)\right)\right), \mathsf{fma}\left(0.041666666666666664 \cdot {\pi}^{4}, {\pi}^{3} \cdot 0.3333333333333333, {\pi}^{7} \cdot -0.001388888888888889\right)\right)}{{\pi}^{2}} + {F}^{2} \cdot \frac{\left({\pi}^{3} \cdot 0.3333333333333333\right) \cdot \left(\mathsf{fma}\left({\pi}^{5}, 0.041666666666666664, \left(-0.5 \cdot {\pi}^{2}\right) \cdot \left({\pi}^{3} \cdot 0.3333333333333333\right)\right) - 0.008333333333333333 \cdot {\pi}^{5}\right)}{{\pi}^{3}}\right) + \left({\pi}^{3} \cdot \frac{0.3333333333333333}{\pi}\right) \cdot \left({F}^{2} \cdot \frac{{\pi}^{6} \cdot 0.1111111111111111}{{\pi}^{3}} + {F}^{2} \cdot \frac{\mathsf{fma}\left({\pi}^{5}, 0.041666666666666664, \left(-0.5 \cdot {\pi}^{2}\right) \cdot \left({\pi}^{3} \cdot 0.3333333333333333\right)\right) - 0.008333333333333333 \cdot {\pi}^{5}}{{\pi}^{2}}\right), {F}^{2} \cdot \frac{{\pi}^{6} \cdot 0.1111111111111111}{{\pi}^{3}}\right) + {F}^{2} \cdot \frac{\mathsf{fma}\left({\pi}^{5}, 0.041666666666666664, \left(-0.5 \cdot {\pi}^{2}\right) \cdot \left({\pi}^{3} \cdot 0.3333333333333333\right)\right) - 0.008333333333333333 \cdot {\pi}^{5}}{{\pi}^{2}}, {F}^{2} \cdot \left({\pi}^{3} \cdot \frac{0.3333333333333333}{-{\pi}^{2}}\right)\right), \frac{{F}^{2}}{\pi}\right)}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{1}{\frac{F}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 86.1% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \cdot F \leq 10^{-320}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\ell \cdot \sqrt[3]{{\pi}^{3}}\right)}{F}}{F}\\ \mathbf{elif}\;F \cdot F \leq 10^{-54}:\\ \;\;\;\;\pi \cdot \ell - \frac{1}{\frac{\mathsf{fma}\left({\ell}^{2}, \mathsf{fma}\left(-{\ell}^{2}, {F}^{2} \cdot \frac{0.008333333333333333 \cdot {\pi}^{5} - \mathsf{fma}\left({\pi}^{5}, 0.041666666666666664, \left(-0.5 \cdot {\pi}^{2}\right) \cdot \left({\pi}^{3} \cdot 0.3333333333333333\right)\right)}{{\pi}^{2}} - {F}^{2} \cdot \frac{{\pi}^{6} \cdot 0.1111111111111111}{{\pi}^{3}}, {F}^{2} \cdot \left({\pi}^{3} \cdot \frac{0.3333333333333333}{-{\pi}^{2}}\right)\right), \frac{{F}^{2}}{\pi}\right)}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{1}{\frac{F}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (<= (* F F) 1e-320)
   (- (* PI l) (/ (/ (tan (* l (cbrt (pow PI 3.0)))) F) F))
   (if (<= (* F F) 1e-54)
     (-
      (* PI l)
      (/
       1.0
       (/
        (fma
         (pow l 2.0)
         (fma
          (- (pow l 2.0))
          (-
           (*
            (pow F 2.0)
            (/
             (-
              (* 0.008333333333333333 (pow PI 5.0))
              (fma
               (pow PI 5.0)
               0.041666666666666664
               (* (* -0.5 (pow PI 2.0)) (* (pow PI 3.0) 0.3333333333333333))))
             (pow PI 2.0)))
           (*
            (pow F 2.0)
            (/ (* (pow PI 6.0) 0.1111111111111111) (pow PI 3.0))))
          (*
           (pow F 2.0)
           (* (pow PI 3.0) (/ 0.3333333333333333 (- (pow PI 2.0))))))
         (/ (pow F 2.0) PI))
        l)))
     (- (* PI l) (/ 1.0 (/ F (/ (tan (* PI l)) F)))))))
double code(double F, double l) {
	double tmp;
	if ((F * F) <= 1e-320) {
		tmp = (((double) M_PI) * l) - ((tan((l * cbrt(pow(((double) M_PI), 3.0)))) / F) / F);
	} else if ((F * F) <= 1e-54) {
		tmp = (((double) M_PI) * l) - (1.0 / (fma(pow(l, 2.0), fma(-pow(l, 2.0), ((pow(F, 2.0) * (((0.008333333333333333 * pow(((double) M_PI), 5.0)) - fma(pow(((double) M_PI), 5.0), 0.041666666666666664, ((-0.5 * pow(((double) M_PI), 2.0)) * (pow(((double) M_PI), 3.0) * 0.3333333333333333)))) / pow(((double) M_PI), 2.0))) - (pow(F, 2.0) * ((pow(((double) M_PI), 6.0) * 0.1111111111111111) / pow(((double) M_PI), 3.0)))), (pow(F, 2.0) * (pow(((double) M_PI), 3.0) * (0.3333333333333333 / -pow(((double) M_PI), 2.0))))), (pow(F, 2.0) / ((double) M_PI))) / l));
	} else {
		tmp = (((double) M_PI) * l) - (1.0 / (F / (tan((((double) M_PI) * l)) / F)));
	}
	return tmp;
}
function code(F, l)
	tmp = 0.0
	if (Float64(F * F) <= 1e-320)
		tmp = Float64(Float64(pi * l) - Float64(Float64(tan(Float64(l * cbrt((pi ^ 3.0)))) / F) / F));
	elseif (Float64(F * F) <= 1e-54)
		tmp = Float64(Float64(pi * l) - Float64(1.0 / Float64(fma((l ^ 2.0), fma(Float64(-(l ^ 2.0)), Float64(Float64((F ^ 2.0) * Float64(Float64(Float64(0.008333333333333333 * (pi ^ 5.0)) - fma((pi ^ 5.0), 0.041666666666666664, Float64(Float64(-0.5 * (pi ^ 2.0)) * Float64((pi ^ 3.0) * 0.3333333333333333)))) / (pi ^ 2.0))) - Float64((F ^ 2.0) * Float64(Float64((pi ^ 6.0) * 0.1111111111111111) / (pi ^ 3.0)))), Float64((F ^ 2.0) * Float64((pi ^ 3.0) * Float64(0.3333333333333333 / Float64(-(pi ^ 2.0)))))), Float64((F ^ 2.0) / pi)) / l)));
	else
		tmp = Float64(Float64(pi * l) - Float64(1.0 / Float64(F / Float64(tan(Float64(pi * l)) / F))));
	end
	return tmp
end
code[F_, l_] := If[LessEqual[N[(F * F), $MachinePrecision], 1e-320], N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[Tan[N[(l * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(F * F), $MachinePrecision], 1e-54], N[(N[(Pi * l), $MachinePrecision] - N[(1.0 / N[(N[(N[Power[l, 2.0], $MachinePrecision] * N[((-N[Power[l, 2.0], $MachinePrecision]) * N[(N[(N[Power[F, 2.0], $MachinePrecision] * N[(N[(N[(0.008333333333333333 * N[Power[Pi, 5.0], $MachinePrecision]), $MachinePrecision] - N[(N[Power[Pi, 5.0], $MachinePrecision] * 0.041666666666666664 + N[(N[(-0.5 * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision] * N[(N[Power[Pi, 3.0], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[Power[F, 2.0], $MachinePrecision] * N[(N[(N[Power[Pi, 6.0], $MachinePrecision] * 0.1111111111111111), $MachinePrecision] / N[Power[Pi, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[F, 2.0], $MachinePrecision] * N[(N[Power[Pi, 3.0], $MachinePrecision] * N[(0.3333333333333333 / (-N[Power[Pi, 2.0], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[F, 2.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}

\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 10^{-320}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\ell \cdot \sqrt[3]{{\pi}^{3}}\right)}{F}}{F}\\

\mathbf{elif}\;F \cdot F \leq 10^{-54}:\\
\;\;\;\;\pi \cdot \ell - \frac{1}{\frac{\mathsf{fma}\left({\ell}^{2}, \mathsf{fma}\left(-{\ell}^{2}, {F}^{2} \cdot \frac{0.008333333333333333 \cdot {\pi}^{5} - \mathsf{fma}\left({\pi}^{5}, 0.041666666666666664, \left(-0.5 \cdot {\pi}^{2}\right) \cdot \left({\pi}^{3} \cdot 0.3333333333333333\right)\right)}{{\pi}^{2}} - {F}^{2} \cdot \frac{{\pi}^{6} \cdot 0.1111111111111111}{{\pi}^{3}}, {F}^{2} \cdot \left({\pi}^{3} \cdot \frac{0.3333333333333333}{-{\pi}^{2}}\right)\right), \frac{{F}^{2}}{\pi}\right)}{\ell}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 F F) < 9.99989e-321

    1. Initial program 30.6%

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

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

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
    5. Step-by-step derivation
      1. add-cbrt-cube60.3%

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

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

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

    if 9.99989e-321 < (*.f64 F F) < 1e-54

    1. Initial program 67.2%

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

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

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

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

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

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

      \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{\frac{{\ell}^{2} \cdot \left(-1 \cdot \left({\ell}^{2} \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) - \frac{{F}^{2} \cdot \left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)}{{\pi}^{2}}\right) + \frac{{F}^{2}}{\pi}}{\ell}}} \]
    6. Simplified91.3%

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

    if 1e-54 < (*.f64 F F)

    1. Initial program 99.2%

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

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

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

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

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

      \[\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 simplification88.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \cdot F \leq 10^{-320}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\ell \cdot \sqrt[3]{{\pi}^{3}}\right)}{F}}{F}\\ \mathbf{elif}\;F \cdot F \leq 10^{-54}:\\ \;\;\;\;\pi \cdot \ell - \frac{1}{\frac{\mathsf{fma}\left({\ell}^{2}, \mathsf{fma}\left(-{\ell}^{2}, {F}^{2} \cdot \frac{0.008333333333333333 \cdot {\pi}^{5} - \mathsf{fma}\left({\pi}^{5}, 0.041666666666666664, \left(-0.5 \cdot {\pi}^{2}\right) \cdot \left({\pi}^{3} \cdot 0.3333333333333333\right)\right)}{{\pi}^{2}} - {F}^{2} \cdot \frac{{\pi}^{6} \cdot 0.1111111111111111}{{\pi}^{3}}, {F}^{2} \cdot \left({\pi}^{3} \cdot \frac{0.3333333333333333}{-{\pi}^{2}}\right)\right), \frac{{F}^{2}}{\pi}\right)}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{1}{\frac{F}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 84.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \cdot F \leq 10^{-320}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\ell \cdot \sqrt[3]{{\pi}^{3}}\right)}{F}}{F}\\ \mathbf{elif}\;F \cdot F \leq 10^{-54}:\\ \;\;\;\;\pi \cdot \ell + \frac{-1}{\frac{\frac{{F}^{2}}{\pi} - {F}^{2} \cdot \left({\ell}^{2} \cdot \left({\pi}^{3} \cdot \frac{0.3333333333333333}{{\pi}^{2}}\right)\right)}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{1}{\frac{F}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (<= (* F F) 1e-320)
   (- (* PI l) (/ (/ (tan (* l (cbrt (pow PI 3.0)))) F) F))
   (if (<= (* F F) 1e-54)
     (+
      (* PI l)
      (/
       -1.0
       (/
        (-
         (/ (pow F 2.0) PI)
         (*
          (pow F 2.0)
          (*
           (pow l 2.0)
           (* (pow PI 3.0) (/ 0.3333333333333333 (pow PI 2.0))))))
        l)))
     (- (* PI l) (/ 1.0 (/ F (/ (tan (* PI l)) F)))))))
double code(double F, double l) {
	double tmp;
	if ((F * F) <= 1e-320) {
		tmp = (((double) M_PI) * l) - ((tan((l * cbrt(pow(((double) M_PI), 3.0)))) / F) / F);
	} else if ((F * F) <= 1e-54) {
		tmp = (((double) M_PI) * l) + (-1.0 / (((pow(F, 2.0) / ((double) M_PI)) - (pow(F, 2.0) * (pow(l, 2.0) * (pow(((double) M_PI), 3.0) * (0.3333333333333333 / pow(((double) M_PI), 2.0)))))) / l));
	} else {
		tmp = (((double) M_PI) * l) - (1.0 / (F / (tan((((double) M_PI) * l)) / F)));
	}
	return tmp;
}
public static double code(double F, double l) {
	double tmp;
	if ((F * F) <= 1e-320) {
		tmp = (Math.PI * l) - ((Math.tan((l * Math.cbrt(Math.pow(Math.PI, 3.0)))) / F) / F);
	} else if ((F * F) <= 1e-54) {
		tmp = (Math.PI * l) + (-1.0 / (((Math.pow(F, 2.0) / Math.PI) - (Math.pow(F, 2.0) * (Math.pow(l, 2.0) * (Math.pow(Math.PI, 3.0) * (0.3333333333333333 / Math.pow(Math.PI, 2.0)))))) / l));
	} else {
		tmp = (Math.PI * l) - (1.0 / (F / (Math.tan((Math.PI * l)) / F)));
	}
	return tmp;
}
function code(F, l)
	tmp = 0.0
	if (Float64(F * F) <= 1e-320)
		tmp = Float64(Float64(pi * l) - Float64(Float64(tan(Float64(l * cbrt((pi ^ 3.0)))) / F) / F));
	elseif (Float64(F * F) <= 1e-54)
		tmp = Float64(Float64(pi * l) + Float64(-1.0 / Float64(Float64(Float64((F ^ 2.0) / pi) - Float64((F ^ 2.0) * Float64((l ^ 2.0) * Float64((pi ^ 3.0) * Float64(0.3333333333333333 / (pi ^ 2.0)))))) / l)));
	else
		tmp = Float64(Float64(pi * l) - Float64(1.0 / Float64(F / Float64(tan(Float64(pi * l)) / F))));
	end
	return tmp
end
code[F_, l_] := If[LessEqual[N[(F * F), $MachinePrecision], 1e-320], N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[Tan[N[(l * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(F * F), $MachinePrecision], 1e-54], N[(N[(Pi * l), $MachinePrecision] + N[(-1.0 / N[(N[(N[(N[Power[F, 2.0], $MachinePrecision] / Pi), $MachinePrecision] - N[(N[Power[F, 2.0], $MachinePrecision] * N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[Power[Pi, 3.0], $MachinePrecision] * N[(0.3333333333333333 / N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}

\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 10^{-320}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\ell \cdot \sqrt[3]{{\pi}^{3}}\right)}{F}}{F}\\

\mathbf{elif}\;F \cdot F \leq 10^{-54}:\\
\;\;\;\;\pi \cdot \ell + \frac{-1}{\frac{\frac{{F}^{2}}{\pi} - {F}^{2} \cdot \left({\ell}^{2} \cdot \left({\pi}^{3} \cdot \frac{0.3333333333333333}{{\pi}^{2}}\right)\right)}{\ell}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 F F) < 9.99989e-321

    1. Initial program 30.6%

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

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

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
    5. Step-by-step derivation
      1. add-cbrt-cube60.3%

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

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

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

    if 9.99989e-321 < (*.f64 F F) < 1e-54

    1. Initial program 67.2%

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

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

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

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

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

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

      \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{\frac{-1 \cdot \frac{{F}^{2} \cdot \left({\ell}^{2} \cdot \left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)\right)}{{\pi}^{2}} + \frac{{F}^{2}}{\pi}}{\ell}}} \]
    6. Step-by-step derivation
      1. Simplified86.2%

        \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{\frac{\frac{{F}^{2}}{\pi} - {F}^{2} \cdot \left({\ell}^{2} \cdot \left({\pi}^{3} \cdot \frac{0.3333333333333333}{{\pi}^{2}}\right)\right)}{\ell}}} \]

      if 1e-54 < (*.f64 F F)

      1. Initial program 99.2%

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;F \cdot F \leq 10^{-320}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\ell \cdot \sqrt[3]{{\pi}^{3}}\right)}{F}}{F}\\ \mathbf{elif}\;F \cdot F \leq 10^{-54}:\\ \;\;\;\;\pi \cdot \ell + \frac{-1}{\frac{\frac{{F}^{2}}{\pi} - {F}^{2} \cdot \left({\ell}^{2} \cdot \left({\pi}^{3} \cdot \frac{0.3333333333333333}{{\pi}^{2}}\right)\right)}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{1}{\frac{F}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}\\ \end{array} \]
    9. Add Preprocessing

    Alternative 4: 81.6% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ \pi \cdot \ell - \frac{1}{\frac{F}{\frac{\tan \left(\ell \cdot \sqrt[3]{{\pi}^{3}}\right)}{F}}} \end{array} \]
    (FPCore (F l)
     :precision binary64
     (- (* PI l) (/ 1.0 (/ F (/ (tan (* l (cbrt (pow PI 3.0)))) F)))))
    double code(double F, double l) {
    	return (((double) M_PI) * l) - (1.0 / (F / (tan((l * cbrt(pow(((double) M_PI), 3.0)))) / F)));
    }
    
    public static double code(double F, double l) {
    	return (Math.PI * l) - (1.0 / (F / (Math.tan((l * Math.cbrt(Math.pow(Math.PI, 3.0)))) / F)));
    }
    
    function code(F, l)
    	return Float64(Float64(pi * l) - Float64(1.0 / Float64(F / Float64(tan(Float64(l * cbrt((pi ^ 3.0)))) / F))))
    end
    
    code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] - N[(1.0 / N[(F / N[(N[Tan[N[(l * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \pi \cdot \ell - \frac{1}{\frac{F}{\frac{\tan \left(\ell \cdot \sqrt[3]{{\pi}^{3}}\right)}{F}}}
    \end{array}
    
    Derivation
    1. Initial program 76.0%

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

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

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

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{\frac{F}{\frac{\tan \left(\pi \cdot \ell\right)}{F}}}} \]
    5. Step-by-step derivation
      1. add-cbrt-cube83.4%

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

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

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

      \[\leadsto \pi \cdot \ell - \frac{1}{\frac{F}{\frac{\tan \left(\ell \cdot \sqrt[3]{{\pi}^{3}}\right)}{F}}} \]
    8. Add Preprocessing

    Alternative 5: 81.6% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ \pi \cdot \ell - \frac{\frac{\tan \left(\ell \cdot \sqrt[3]{{\pi}^{3}}\right)}{F}}{F} \end{array} \]
    (FPCore (F l)
     :precision binary64
     (- (* PI l) (/ (/ (tan (* l (cbrt (pow PI 3.0)))) F) F)))
    double code(double F, double l) {
    	return (((double) M_PI) * l) - ((tan((l * cbrt(pow(((double) M_PI), 3.0)))) / F) / F);
    }
    
    public static double code(double F, double l) {
    	return (Math.PI * l) - ((Math.tan((l * Math.cbrt(Math.pow(Math.PI, 3.0)))) / F) / F);
    }
    
    function code(F, l)
    	return Float64(Float64(pi * l) - Float64(Float64(tan(Float64(l * cbrt((pi ^ 3.0)))) / F) / F))
    end
    
    code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[Tan[N[(l * N[Power[N[Power[Pi, 3.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \pi \cdot \ell - \frac{\frac{\tan \left(\ell \cdot \sqrt[3]{{\pi}^{3}}\right)}{F}}{F}
    \end{array}
    
    Derivation
    1. Initial program 76.0%

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

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

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}} \]
    5. Step-by-step derivation
      1. add-cbrt-cube83.4%

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

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

      \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \left(\color{blue}{\sqrt[3]{{\pi}^{3}}} \cdot \ell\right)}{F}}{F} \]
    7. Final simplification83.4%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\tan \left(\ell \cdot \sqrt[3]{{\pi}^{3}}\right)}{F}}{F} \]
    8. Add Preprocessing

    Alternative 6: 78.1% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq 2 \cdot 10^{-47}:\\ \;\;\;\;\pi \cdot \ell - \frac{1}{F} \cdot \left(\pi \cdot \frac{\ell}{F}\right)\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}\\ \end{array} \end{array} \]
    (FPCore (F l)
     :precision binary64
     (if (<= (* PI l) 2e-47)
       (- (* PI l) (* (/ 1.0 F) (* PI (/ l F))))
       (- (* PI l) (/ (tan (* PI l)) (* F F)))))
    double code(double F, double l) {
    	double tmp;
    	if ((((double) M_PI) * l) <= 2e-47) {
    		tmp = (((double) M_PI) * l) - ((1.0 / F) * (((double) M_PI) * (l / F)));
    	} else {
    		tmp = (((double) M_PI) * l) - (tan((((double) M_PI) * l)) / (F * F));
    	}
    	return tmp;
    }
    
    public static double code(double F, double l) {
    	double tmp;
    	if ((Math.PI * l) <= 2e-47) {
    		tmp = (Math.PI * l) - ((1.0 / F) * (Math.PI * (l / F)));
    	} else {
    		tmp = (Math.PI * l) - (Math.tan((Math.PI * l)) / (F * F));
    	}
    	return tmp;
    }
    
    def code(F, l):
    	tmp = 0
    	if (math.pi * l) <= 2e-47:
    		tmp = (math.pi * l) - ((1.0 / F) * (math.pi * (l / F)))
    	else:
    		tmp = (math.pi * l) - (math.tan((math.pi * l)) / (F * F))
    	return tmp
    
    function code(F, l)
    	tmp = 0.0
    	if (Float64(pi * l) <= 2e-47)
    		tmp = Float64(Float64(pi * l) - Float64(Float64(1.0 / F) * Float64(pi * Float64(l / F))));
    	else
    		tmp = Float64(Float64(pi * l) - Float64(tan(Float64(pi * l)) / Float64(F * F)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(F, l)
    	tmp = 0.0;
    	if ((pi * l) <= 2e-47)
    		tmp = (pi * l) - ((1.0 / F) * (pi * (l / F)));
    	else
    		tmp = (pi * l) - (tan((pi * l)) / (F * F));
    	end
    	tmp_2 = tmp;
    end
    
    code[F_, l_] := If[LessEqual[N[(Pi * l), $MachinePrecision], 2e-47], N[(N[(Pi * l), $MachinePrecision] - N[(N[(1.0 / F), $MachinePrecision] * N[(Pi * N[(l / F), $MachinePrecision]), $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}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;\pi \cdot \ell \leq 2 \cdot 10^{-47}:\\
    \;\;\;\;\pi \cdot \ell - \frac{1}{F} \cdot \left(\pi \cdot \frac{\ell}{F}\right)\\
    
    \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 (*.f64 (PI.f64) l) < 1.9999999999999999e-47

      1. Initial program 79.6%

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

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

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

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

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

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

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

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

          \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\pi \cdot \ell}}{F \cdot F} \]
        2. *-un-lft-identity74.6%

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

          \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{F} \cdot \frac{\pi \cdot \ell}{F}} \]
        4. associate-/l*84.1%

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

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

      if 1.9999999999999999e-47 < (*.f64 (PI.f64) l)

      1. Initial program 66.4%

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

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

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

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

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

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

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

    Alternative 7: 81.7% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \pi \cdot \ell + \frac{\tan \left(\pi \cdot \ell\right)}{F} \cdot \frac{-1}{F} \end{array} \]
    (FPCore (F l)
     :precision binary64
     (+ (* PI l) (* (/ (tan (* PI l)) F) (/ -1.0 F))))
    double code(double F, double l) {
    	return (((double) M_PI) * l) + ((tan((((double) M_PI) * l)) / F) * (-1.0 / F));
    }
    
    public static double code(double F, double l) {
    	return (Math.PI * l) + ((Math.tan((Math.PI * l)) / F) * (-1.0 / F));
    }
    
    def code(F, l):
    	return (math.pi * l) + ((math.tan((math.pi * l)) / F) * (-1.0 / F))
    
    function code(F, l)
    	return Float64(Float64(pi * l) + Float64(Float64(tan(Float64(pi * l)) / F) * Float64(-1.0 / F)))
    end
    
    function tmp = code(F, l)
    	tmp = (pi * l) + ((tan((pi * l)) / F) * (-1.0 / F));
    end
    
    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}
    
    \\
    \pi \cdot \ell + \frac{\tan \left(\pi \cdot \ell\right)}{F} \cdot \frac{-1}{F}
    \end{array}
    
    Derivation
    1. Initial program 76.0%

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

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

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

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

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

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

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

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

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

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

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

    Alternative 8: 81.7% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \pi \cdot \ell - \frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F} \end{array} \]
    (FPCore (F l) :precision binary64 (- (* PI l) (/ (/ (tan (* PI l)) F) F)))
    double code(double F, double l) {
    	return (((double) M_PI) * l) - ((tan((((double) M_PI) * l)) / F) / F);
    }
    
    public static double code(double F, double l) {
    	return (Math.PI * l) - ((Math.tan((Math.PI * l)) / F) / F);
    }
    
    def code(F, l):
    	return (math.pi * l) - ((math.tan((math.pi * l)) / F) / F)
    
    function code(F, l)
    	return Float64(Float64(pi * l) - Float64(Float64(tan(Float64(pi * l)) / F) / F))
    end
    
    function tmp = code(F, l)
    	tmp = (pi * l) - ((tan((pi * l)) / F) / F);
    end
    
    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}
    
    \\
    \pi \cdot \ell - \frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}
    \end{array}
    
    Derivation
    1. Initial program 76.0%

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

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

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

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

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

    Alternative 9: 74.9% accurate, 6.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq 0.5:\\ \;\;\;\;\pi \cdot \ell - \frac{1}{F} \cdot \left(\pi \cdot \frac{\ell}{F}\right)\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell + \frac{\frac{1}{F}}{\frac{F}{\pi \cdot \ell}}\\ \end{array} \end{array} \]
    (FPCore (F l)
     :precision binary64
     (if (<= l 0.5)
       (- (* PI l) (* (/ 1.0 F) (* PI (/ l F))))
       (+ (* PI l) (/ (/ 1.0 F) (/ F (* PI l))))))
    double code(double F, double l) {
    	double tmp;
    	if (l <= 0.5) {
    		tmp = (((double) M_PI) * l) - ((1.0 / F) * (((double) M_PI) * (l / F)));
    	} else {
    		tmp = (((double) M_PI) * l) + ((1.0 / F) / (F / (((double) M_PI) * l)));
    	}
    	return tmp;
    }
    
    public static double code(double F, double l) {
    	double tmp;
    	if (l <= 0.5) {
    		tmp = (Math.PI * l) - ((1.0 / F) * (Math.PI * (l / F)));
    	} else {
    		tmp = (Math.PI * l) + ((1.0 / F) / (F / (Math.PI * l)));
    	}
    	return tmp;
    }
    
    def code(F, l):
    	tmp = 0
    	if l <= 0.5:
    		tmp = (math.pi * l) - ((1.0 / F) * (math.pi * (l / F)))
    	else:
    		tmp = (math.pi * l) + ((1.0 / F) / (F / (math.pi * l)))
    	return tmp
    
    function code(F, l)
    	tmp = 0.0
    	if (l <= 0.5)
    		tmp = Float64(Float64(pi * l) - Float64(Float64(1.0 / F) * Float64(pi * Float64(l / F))));
    	else
    		tmp = Float64(Float64(pi * l) + Float64(Float64(1.0 / F) / Float64(F / Float64(pi * l))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(F, l)
    	tmp = 0.0;
    	if (l <= 0.5)
    		tmp = (pi * l) - ((1.0 / F) * (pi * (l / F)));
    	else
    		tmp = (pi * l) + ((1.0 / F) / (F / (pi * l)));
    	end
    	tmp_2 = tmp;
    end
    
    code[F_, l_] := If[LessEqual[l, 0.5], N[(N[(Pi * l), $MachinePrecision] - N[(N[(1.0 / F), $MachinePrecision] * N[(Pi * N[(l / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(N[(1.0 / F), $MachinePrecision] / N[(F / N[(Pi * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;\ell \leq 0.5:\\
    \;\;\;\;\pi \cdot \ell - \frac{1}{F} \cdot \left(\pi \cdot \frac{\ell}{F}\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\pi \cdot \ell + \frac{\frac{1}{F}}{\frac{F}{\pi \cdot \ell}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if l < 0.5

      1. Initial program 80.1%

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

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\ell \cdot \pi}}{F \cdot F} \]
      6. Step-by-step derivation
        1. *-commutative75.8%

          \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\pi \cdot \ell}}{F \cdot F} \]
        2. *-un-lft-identity75.8%

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

          \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{F} \cdot \frac{\pi \cdot \ell}{F}} \]
        4. associate-/l*84.7%

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

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

      if 0.5 < l

      1. Initial program 62.4%

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

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

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

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

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

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

        \[\leadsto \color{blue}{\pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}} \]
      4. Add Preprocessing
      5. Step-by-step derivation
        1. add-sqr-sqrt62.4%

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

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

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

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

          \[\leadsto \pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{\color{blue}{\sqrt{F \cdot \left(-F\right)} \cdot \sqrt{F \cdot \left(-F\right)}}} \]
        6. add-sqr-sqrt59.6%

          \[\leadsto \pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{\color{blue}{F \cdot \left(-F\right)}} \]
        7. distribute-rgt-neg-out59.6%

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

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

          \[\leadsto \pi \cdot \ell - \left(-\color{blue}{\sqrt{\frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}} \cdot \sqrt{\frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}}}\right) \]
        10. distribute-rgt-neg-in43.2%

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

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

          \[\leadsto \pi \cdot \ell - \frac{\sqrt{\tan \left(\pi \cdot \ell\right)}}{\color{blue}{\sqrt{F} \cdot \sqrt{F}}} \cdot \left(-\sqrt{\frac{\tan \left(\pi \cdot \ell\right)}{F \cdot F}}\right) \]
        13. add-sqr-sqrt32.1%

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

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

          \[\leadsto \pi \cdot \ell - \frac{\sqrt{\tan \left(\pi \cdot \ell\right)}}{F} \cdot \left(-\frac{\sqrt{\tan \left(\pi \cdot \ell\right)}}{\color{blue}{\sqrt{F} \cdot \sqrt{F}}}\right) \]
        16. add-sqr-sqrt33.3%

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

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\sqrt{\tan \left(\pi \cdot \ell\right)}}{F} \cdot \left(-\frac{\sqrt{\tan \left(\pi \cdot \ell\right)}}{F}\right)} \]
      7. Applied egg-rr59.6%

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

        \[\leadsto \pi \cdot \ell - \frac{\frac{-1}{F}}{\frac{F}{\color{blue}{\ell \cdot \pi}}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification77.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 0.5:\\ \;\;\;\;\pi \cdot \ell - \frac{1}{F} \cdot \left(\pi \cdot \frac{\ell}{F}\right)\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell + \frac{\frac{1}{F}}{\frac{F}{\pi \cdot \ell}}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 10: 74.1% accurate, 8.7× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\ell \cdot \pi}}{F \cdot F} \]
    6. Step-by-step derivation
      1. *-commutative69.8%

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\pi \cdot \ell}}{F \cdot F} \]
      2. *-un-lft-identity69.8%

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{1 \cdot \left(\pi \cdot \ell\right)}}{F \cdot F} \]
      3. times-frac76.6%

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{F} \cdot \frac{\pi \cdot \ell}{F}} \]
      4. associate-/l*76.6%

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{F} \cdot \left(\pi \cdot \frac{\ell}{F}\right)} \]
    8. Add Preprocessing

    Alternative 11: 74.1% accurate, 10.3× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\ell \cdot \pi}}{F \cdot F} \]
    6. Step-by-step derivation
      1. *-commutative69.8%

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

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\pi}{F} \cdot \frac{\ell}{F}} \]
    7. Applied egg-rr76.6%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\pi}{F} \cdot \frac{\ell}{F}} \]
    8. Step-by-step derivation
      1. *-commutative76.6%

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell}{F} \cdot \frac{\pi}{F}} \]
      2. clear-num76.6%

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{\frac{F}{\ell}}} \cdot \frac{\pi}{F} \]
      3. frac-times76.6%

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1 \cdot \pi}{\frac{F}{\ell} \cdot F}} \]
      4. *-un-lft-identity76.6%

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\pi}}{\frac{F}{\ell} \cdot F} \]
    9. Applied egg-rr76.6%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\pi}{\frac{F}{\ell} \cdot F}} \]
    10. Final simplification76.6%

      \[\leadsto \pi \cdot \ell - \frac{\pi}{F \cdot \frac{F}{\ell}} \]
    11. Add Preprocessing

    Alternative 12: 74.1% accurate, 10.3× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\ell \cdot \pi}}{F \cdot F} \]
    6. Step-by-step derivation
      1. *-commutative69.8%

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

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\pi}{F} \cdot \frac{\ell}{F}} \]
    7. Applied egg-rr76.6%

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

      \[\leadsto \pi \cdot \ell - \frac{\ell}{F} \cdot \frac{\pi}{F} \]
    9. Add Preprocessing

    Reproduce

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