VandenBroeck and Keller, Equation (6)

Percentage Accurate: 76.3% → 98.2%
Time: 26.7s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 76.3% accurate, 1.0× speedup?

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

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

Alternative 1: 98.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \pi \cdot \ell - \frac{\frac{\sin \left(\pi \cdot \ell\right)}{\mathsf{fma}\left(-0.5, {\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\pi \cdot \ell\right)\right)\right)}^{2}, 1\right)}}{F} \cdot \frac{1}{F} \end{array} \]
(FPCore (F l)
 :precision binary64
 (-
  (* PI l)
  (*
   (/ (/ (sin (* PI l)) (fma -0.5 (pow (log1p (expm1 (* PI l))) 2.0) 1.0)) F)
   (/ 1.0 F))))
double code(double F, double l) {
	return (((double) M_PI) * l) - (((sin((((double) M_PI) * l)) / fma(-0.5, pow(log1p(expm1((((double) M_PI) * l))), 2.0), 1.0)) / F) * (1.0 / F));
}
function code(F, l)
	return Float64(Float64(pi * l) - Float64(Float64(Float64(sin(Float64(pi * l)) / fma(-0.5, (log1p(expm1(Float64(pi * l))) ^ 2.0), 1.0)) / F) * Float64(1.0 / F)))
end
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[(N[Sin[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / N[(-0.5 * N[Power[N[Log[1 + N[(Exp[N[(Pi * l), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\pi \cdot \ell - \frac{\frac{\sin \left(\pi \cdot \ell\right)}{\mathsf{fma}\left(-0.5, {\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\pi \cdot \ell\right)\right)\right)}^{2}, 1\right)}}{F} \cdot \frac{1}{F}
\end{array}
Derivation
  1. Initial program 79.5%

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

      \[\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/79.6%

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

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

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

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

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\sin \left(\pi \cdot \ell\right)}{\cos \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    2. clear-num79.6%

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

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

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

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{-0.5 \cdot \left({\ell}^{2} \cdot {\pi}^{2}\right) + 1}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    2. fma-def83.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{\mathsf{fma}\left(-0.5, {\ell}^{2} \cdot {\pi}^{2}, 1\right)}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    3. *-commutative83.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{{\pi}^{2} \cdot {\ell}^{2}}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    4. unpow283.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{\left(\pi \cdot \pi\right)} \cdot {\ell}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    5. unpow283.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \left(\pi \cdot \pi\right) \cdot \color{blue}{\left(\ell \cdot \ell\right)}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    6. swap-sqr83.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{\left(\pi \cdot \ell\right) \cdot \left(\pi \cdot \ell\right)}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    7. unpow283.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{{\left(\pi \cdot \ell\right)}^{2}}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    8. *-commutative83.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, {\color{blue}{\left(\ell \cdot \pi\right)}}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
  8. Simplified83.2%

    \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
  9. Step-by-step derivation
    1. associate-/r*93.3%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F}} \]
    2. div-inv93.4%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F} \cdot \frac{1}{F}} \]
    3. clear-num93.3%

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\sin \left(\pi \cdot \ell\right)}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}}{F} \cdot \frac{1}{F} \]
    4. *-commutative93.3%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\sin \color{blue}{\left(\ell \cdot \pi\right)}}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}{F} \cdot \frac{1}{F} \]
  10. Applied egg-rr93.3%

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\sin \left(\ell \cdot \pi\right)}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}{F} \cdot \frac{1}{F}} \]
  11. Step-by-step derivation
    1. *-commutative93.3%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\sin \left(\ell \cdot \pi\right)}{\mathsf{fma}\left(-0.5, {\color{blue}{\left(\pi \cdot \ell\right)}}^{2}, 1\right)}}{F} \cdot \frac{1}{F} \]
    2. log1p-expm1-u98.6%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\sin \left(\ell \cdot \pi\right)}{\mathsf{fma}\left(-0.5, {\color{blue}{\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\pi \cdot \ell\right)\right)\right)}}^{2}, 1\right)}}{F} \cdot \frac{1}{F} \]
  12. Applied egg-rr98.6%

    \[\leadsto \pi \cdot \ell - \frac{\frac{\sin \left(\ell \cdot \pi\right)}{\mathsf{fma}\left(-0.5, {\color{blue}{\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\pi \cdot \ell\right)\right)\right)}}^{2}, 1\right)}}{F} \cdot \frac{1}{F} \]
  13. Final simplification98.6%

    \[\leadsto \pi \cdot \ell - \frac{\frac{\sin \left(\pi \cdot \ell\right)}{\mathsf{fma}\left(-0.5, {\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\pi \cdot \ell\right)\right)\right)}^{2}, 1\right)}}{F} \cdot \frac{1}{F} \]

Alternative 2: 92.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -1 \cdot 10^{+48} \lor \neg \left(\pi \cdot \ell \leq 5000000\right):\\ \;\;\;\;\pi \cdot \ell - \frac{\sin \left(\pi \cdot \ell\right)}{F} \cdot \frac{-2}{F \cdot {\left(\pi \cdot \ell\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\pi, \ell, \frac{\frac{\tan \left(\pi \cdot \ell\right)}{-F}}{F}\right)\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (or (<= (* PI l) -1e+48) (not (<= (* PI l) 5000000.0)))
   (- (* PI l) (* (/ (sin (* PI l)) F) (/ -2.0 (* F (pow (* PI l) 2.0)))))
   (fma PI l (/ (/ (tan (* PI l)) (- F)) F))))
double code(double F, double l) {
	double tmp;
	if (((((double) M_PI) * l) <= -1e+48) || !((((double) M_PI) * l) <= 5000000.0)) {
		tmp = (((double) M_PI) * l) - ((sin((((double) M_PI) * l)) / F) * (-2.0 / (F * pow((((double) M_PI) * l), 2.0))));
	} else {
		tmp = fma(((double) M_PI), l, ((tan((((double) M_PI) * l)) / -F) / F));
	}
	return tmp;
}
function code(F, l)
	tmp = 0.0
	if ((Float64(pi * l) <= -1e+48) || !(Float64(pi * l) <= 5000000.0))
		tmp = Float64(Float64(pi * l) - Float64(Float64(sin(Float64(pi * l)) / F) * Float64(-2.0 / Float64(F * (Float64(pi * l) ^ 2.0)))));
	else
		tmp = fma(pi, l, Float64(Float64(tan(Float64(pi * l)) / Float64(-F)) / F));
	end
	return tmp
end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -1e+48], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 5000000.0]], $MachinePrecision]], N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[Sin[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] * N[(-2.0 / N[(F * N[Power[N[(Pi * l), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(Pi * l + N[(N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / (-F)), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -1 \cdot 10^{+48} \lor \neg \left(\pi \cdot \ell \leq 5000000\right):\\
\;\;\;\;\pi \cdot \ell - \frac{\sin \left(\pi \cdot \ell\right)}{F} \cdot \frac{-2}{F \cdot {\left(\pi \cdot \ell\right)}^{2}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (PI.f64) l) < -1.00000000000000004e48 or 5e6 < (*.f64 (PI.f64) l)

    1. Initial program 63.4%

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

        \[\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/63.4%

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

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

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{-0.5 \cdot \left({\ell}^{2} \cdot {\pi}^{2}\right) + 1}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      2. fma-def72.9%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{\mathsf{fma}\left(-0.5, {\ell}^{2} \cdot {\pi}^{2}, 1\right)}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      3. *-commutative72.9%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{{\pi}^{2} \cdot {\ell}^{2}}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      4. unpow272.9%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{\left(\pi \cdot \pi\right)} \cdot {\ell}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      5. unpow272.9%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \left(\pi \cdot \pi\right) \cdot \color{blue}{\left(\ell \cdot \ell\right)}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      6. swap-sqr72.9%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{\left(\pi \cdot \ell\right) \cdot \left(\pi \cdot \ell\right)}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      7. unpow272.9%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{{\left(\pi \cdot \ell\right)}^{2}}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      8. *-commutative72.9%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, {\color{blue}{\left(\ell \cdot \pi\right)}}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    8. Simplified72.9%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    9. Step-by-step derivation
      1. associate-/r/72.9%

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{1}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)} \cdot \sin \left(\pi \cdot \ell\right)}}{F \cdot F} \]
      2. times-frac90.7%

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{1}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}{F} \cdot \frac{\sin \left(\pi \cdot \ell\right)}{F}} \]
      3. *-commutative90.7%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}{F} \cdot \frac{\sin \color{blue}{\left(\ell \cdot \pi\right)}}{F} \]
    10. Applied egg-rr90.7%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{1}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}{F} \cdot \frac{\sin \left(\ell \cdot \pi\right)}{F}} \]
    11. Taylor expanded in l around inf 90.7%

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

        \[\leadsto \pi \cdot \ell - \frac{-2}{F \cdot \left(\color{blue}{\left(\ell \cdot \ell\right)} \cdot {\pi}^{2}\right)} \cdot \frac{\sin \left(\ell \cdot \pi\right)}{F} \]
      2. unpow290.7%

        \[\leadsto \pi \cdot \ell - \frac{-2}{F \cdot \left(\left(\ell \cdot \ell\right) \cdot \color{blue}{\left(\pi \cdot \pi\right)}\right)} \cdot \frac{\sin \left(\ell \cdot \pi\right)}{F} \]
      3. swap-sqr90.7%

        \[\leadsto \pi \cdot \ell - \frac{-2}{F \cdot \color{blue}{\left(\left(\ell \cdot \pi\right) \cdot \left(\ell \cdot \pi\right)\right)}} \cdot \frac{\sin \left(\ell \cdot \pi\right)}{F} \]
      4. unpow290.7%

        \[\leadsto \pi \cdot \ell - \frac{-2}{F \cdot \color{blue}{{\left(\ell \cdot \pi\right)}^{2}}} \cdot \frac{\sin \left(\ell \cdot \pi\right)}{F} \]
    13. Simplified90.7%

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

    if -1.00000000000000004e48 < (*.f64 (PI.f64) l) < 5e6

    1. Initial program 93.7%

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\pi, \ell, -\frac{1}{\left(-F\right) \cdot \left(-F\right)} \cdot \tan \left(\pi \cdot \ell\right)\right)} \]
      5. associate-*l/93.8%

        \[\leadsto \mathsf{fma}\left(\pi, \ell, -\color{blue}{\frac{1 \cdot \tan \left(\pi \cdot \ell\right)}{\left(-F\right) \cdot \left(-F\right)}}\right) \]
      6. times-frac97.1%

        \[\leadsto \mathsf{fma}\left(\pi, \ell, -\color{blue}{\frac{1}{-F} \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}}\right) \]
      7. distribute-lft-neg-in97.1%

        \[\leadsto \mathsf{fma}\left(\pi, \ell, \color{blue}{\left(-\frac{1}{-F}\right) \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}}\right) \]
      8. neg-mul-197.1%

        \[\leadsto \mathsf{fma}\left(\pi, \ell, \left(-\frac{1}{\color{blue}{-1 \cdot F}}\right) \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}\right) \]
      9. associate-/r*97.1%

        \[\leadsto \mathsf{fma}\left(\pi, \ell, \left(-\color{blue}{\frac{\frac{1}{-1}}{F}}\right) \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}\right) \]
      10. metadata-eval97.1%

        \[\leadsto \mathsf{fma}\left(\pi, \ell, \left(-\frac{\color{blue}{-1}}{F}\right) \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}\right) \]
      11. distribute-neg-frac97.1%

        \[\leadsto \mathsf{fma}\left(\pi, \ell, \color{blue}{\frac{--1}{F}} \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}\right) \]
      12. metadata-eval97.1%

        \[\leadsto \mathsf{fma}\left(\pi, \ell, \frac{\color{blue}{1}}{F} \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}\right) \]
      13. times-frac93.8%

        \[\leadsto \mathsf{fma}\left(\pi, \ell, \color{blue}{\frac{1 \cdot \tan \left(\pi \cdot \ell\right)}{F \cdot \left(-F\right)}}\right) \]
    3. Simplified97.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -1 \cdot 10^{+48} \lor \neg \left(\pi \cdot \ell \leq 5000000\right):\\ \;\;\;\;\pi \cdot \ell - \frac{\sin \left(\pi \cdot \ell\right)}{F} \cdot \frac{-2}{F \cdot {\left(\pi \cdot \ell\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\pi, \ell, \frac{\frac{\tan \left(\pi \cdot \ell\right)}{-F}}{F}\right)\\ \end{array} \]

Alternative 3: 94.3% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \pi \cdot \ell + \frac{\frac{\sin \left(\pi \cdot \ell\right)}{\mathsf{fma}\left(-0.5, \sqrt{{\left(\pi \cdot \ell\right)}^{4}}, 1\right)}}{F} \cdot \frac{-1}{F} \end{array} \]
(FPCore (F l)
 :precision binary64
 (+
  (* PI l)
  (*
   (/ (/ (sin (* PI l)) (fma -0.5 (sqrt (pow (* PI l) 4.0)) 1.0)) F)
   (/ -1.0 F))))
double code(double F, double l) {
	return (((double) M_PI) * l) + (((sin((((double) M_PI) * l)) / fma(-0.5, sqrt(pow((((double) M_PI) * l), 4.0)), 1.0)) / F) * (-1.0 / F));
}
function code(F, l)
	return Float64(Float64(pi * l) + Float64(Float64(Float64(sin(Float64(pi * l)) / fma(-0.5, sqrt((Float64(pi * l) ^ 4.0)), 1.0)) / F) * Float64(-1.0 / F)))
end
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] + N[(N[(N[(N[Sin[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / N[(-0.5 * N[Sqrt[N[Power[N[(Pi * l), $MachinePrecision], 4.0], $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\pi \cdot \ell + \frac{\frac{\sin \left(\pi \cdot \ell\right)}{\mathsf{fma}\left(-0.5, \sqrt{{\left(\pi \cdot \ell\right)}^{4}}, 1\right)}}{F} \cdot \frac{-1}{F}
\end{array}
Derivation
  1. Initial program 79.5%

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

      \[\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/79.6%

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

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

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

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

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\sin \left(\pi \cdot \ell\right)}{\cos \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    2. clear-num79.6%

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

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

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

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{-0.5 \cdot \left({\ell}^{2} \cdot {\pi}^{2}\right) + 1}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    2. fma-def83.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{\mathsf{fma}\left(-0.5, {\ell}^{2} \cdot {\pi}^{2}, 1\right)}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    3. *-commutative83.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{{\pi}^{2} \cdot {\ell}^{2}}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    4. unpow283.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{\left(\pi \cdot \pi\right)} \cdot {\ell}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    5. unpow283.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \left(\pi \cdot \pi\right) \cdot \color{blue}{\left(\ell \cdot \ell\right)}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    6. swap-sqr83.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{\left(\pi \cdot \ell\right) \cdot \left(\pi \cdot \ell\right)}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    7. unpow283.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{{\left(\pi \cdot \ell\right)}^{2}}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    8. *-commutative83.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, {\color{blue}{\left(\ell \cdot \pi\right)}}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
  8. Simplified83.2%

    \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
  9. Step-by-step derivation
    1. associate-/r*93.3%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F}} \]
    2. div-inv93.4%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F} \cdot \frac{1}{F}} \]
    3. clear-num93.3%

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\sin \left(\pi \cdot \ell\right)}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}}{F} \cdot \frac{1}{F} \]
    4. *-commutative93.3%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\sin \color{blue}{\left(\ell \cdot \pi\right)}}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}{F} \cdot \frac{1}{F} \]
  10. Applied egg-rr93.3%

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\sin \left(\ell \cdot \pi\right)}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}{F} \cdot \frac{1}{F}} \]
  11. Step-by-step derivation
    1. add-sqr-sqrt93.3%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\sin \left(\ell \cdot \pi\right)}{\mathsf{fma}\left(-0.5, \color{blue}{\sqrt{{\left(\ell \cdot \pi\right)}^{2}} \cdot \sqrt{{\left(\ell \cdot \pi\right)}^{2}}}, 1\right)}}{F} \cdot \frac{1}{F} \]
    2. sqrt-unprod96.0%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\sin \left(\ell \cdot \pi\right)}{\mathsf{fma}\left(-0.5, \color{blue}{\sqrt{{\left(\ell \cdot \pi\right)}^{2} \cdot {\left(\ell \cdot \pi\right)}^{2}}}, 1\right)}}{F} \cdot \frac{1}{F} \]
    3. *-commutative96.0%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\sin \left(\ell \cdot \pi\right)}{\mathsf{fma}\left(-0.5, \sqrt{{\color{blue}{\left(\pi \cdot \ell\right)}}^{2} \cdot {\left(\ell \cdot \pi\right)}^{2}}, 1\right)}}{F} \cdot \frac{1}{F} \]
    4. *-commutative96.0%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\sin \left(\ell \cdot \pi\right)}{\mathsf{fma}\left(-0.5, \sqrt{{\left(\pi \cdot \ell\right)}^{2} \cdot {\color{blue}{\left(\pi \cdot \ell\right)}}^{2}}, 1\right)}}{F} \cdot \frac{1}{F} \]
    5. pow-prod-up96.0%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\sin \left(\ell \cdot \pi\right)}{\mathsf{fma}\left(-0.5, \sqrt{\color{blue}{{\left(\pi \cdot \ell\right)}^{\left(2 + 2\right)}}}, 1\right)}}{F} \cdot \frac{1}{F} \]
    6. *-commutative96.0%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\sin \left(\ell \cdot \pi\right)}{\mathsf{fma}\left(-0.5, \sqrt{{\color{blue}{\left(\ell \cdot \pi\right)}}^{\left(2 + 2\right)}}, 1\right)}}{F} \cdot \frac{1}{F} \]
    7. metadata-eval96.0%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\sin \left(\ell \cdot \pi\right)}{\mathsf{fma}\left(-0.5, \sqrt{{\left(\ell \cdot \pi\right)}^{\color{blue}{4}}}, 1\right)}}{F} \cdot \frac{1}{F} \]
  12. Applied egg-rr96.0%

    \[\leadsto \pi \cdot \ell - \frac{\frac{\sin \left(\ell \cdot \pi\right)}{\mathsf{fma}\left(-0.5, \color{blue}{\sqrt{{\left(\ell \cdot \pi\right)}^{4}}}, 1\right)}}{F} \cdot \frac{1}{F} \]
  13. Final simplification96.0%

    \[\leadsto \pi \cdot \ell + \frac{\frac{\sin \left(\pi \cdot \ell\right)}{\mathsf{fma}\left(-0.5, \sqrt{{\left(\pi \cdot \ell\right)}^{4}}, 1\right)}}{F} \cdot \frac{-1}{F} \]

Alternative 4: 91.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \pi \cdot \ell - \frac{\frac{1}{\mathsf{fma}\left(-0.5, {\left(\pi \cdot \ell\right)}^{2}, 1\right)}}{F} \cdot \frac{\sin \left(\pi \cdot \ell\right)}{F} \end{array} \]
(FPCore (F l)
 :precision binary64
 (-
  (* PI l)
  (* (/ (/ 1.0 (fma -0.5 (pow (* PI l) 2.0) 1.0)) F) (/ (sin (* PI l)) F))))
double code(double F, double l) {
	return (((double) M_PI) * l) - (((1.0 / fma(-0.5, pow((((double) M_PI) * l), 2.0), 1.0)) / F) * (sin((((double) M_PI) * l)) / F));
}
function code(F, l)
	return Float64(Float64(pi * l) - Float64(Float64(Float64(1.0 / fma(-0.5, (Float64(pi * l) ^ 2.0), 1.0)) / F) * Float64(sin(Float64(pi * l)) / F)))
end
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[(1.0 / N[(-0.5 * N[Power[N[(Pi * l), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision] * N[(N[Sin[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\pi \cdot \ell - \frac{\frac{1}{\mathsf{fma}\left(-0.5, {\left(\pi \cdot \ell\right)}^{2}, 1\right)}}{F} \cdot \frac{\sin \left(\pi \cdot \ell\right)}{F}
\end{array}
Derivation
  1. Initial program 79.5%

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

      \[\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/79.6%

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

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

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

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

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\sin \left(\pi \cdot \ell\right)}{\cos \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    2. clear-num79.6%

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

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

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

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{-0.5 \cdot \left({\ell}^{2} \cdot {\pi}^{2}\right) + 1}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    2. fma-def83.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{\mathsf{fma}\left(-0.5, {\ell}^{2} \cdot {\pi}^{2}, 1\right)}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    3. *-commutative83.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{{\pi}^{2} \cdot {\ell}^{2}}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    4. unpow283.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{\left(\pi \cdot \pi\right)} \cdot {\ell}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    5. unpow283.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \left(\pi \cdot \pi\right) \cdot \color{blue}{\left(\ell \cdot \ell\right)}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    6. swap-sqr83.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{\left(\pi \cdot \ell\right) \cdot \left(\pi \cdot \ell\right)}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    7. unpow283.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{{\left(\pi \cdot \ell\right)}^{2}}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    8. *-commutative83.2%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, {\color{blue}{\left(\ell \cdot \pi\right)}}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
  8. Simplified83.2%

    \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
  9. Step-by-step derivation
    1. associate-/r/83.2%

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{1}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)} \cdot \sin \left(\pi \cdot \ell\right)}}{F \cdot F} \]
    2. times-frac93.3%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{1}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}{F} \cdot \frac{\sin \left(\pi \cdot \ell\right)}{F}} \]
    3. *-commutative93.3%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}{F} \cdot \frac{\sin \color{blue}{\left(\ell \cdot \pi\right)}}{F} \]
  10. Applied egg-rr93.3%

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{1}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}{F} \cdot \frac{\sin \left(\ell \cdot \pi\right)}{F}} \]
  11. Final simplification93.3%

    \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\mathsf{fma}\left(-0.5, {\left(\pi \cdot \ell\right)}^{2}, 1\right)}}{F} \cdot \frac{\sin \left(\pi \cdot \ell\right)}{F} \]

Alternative 5: 40.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 1.1 \cdot 10^{-219}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{\sqrt{F}}}{\sqrt{F}}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell + \frac{\frac{-1}{\ell \cdot \left(\pi \cdot -0.5 - \pi \cdot -0.16666666666666666\right) + \frac{1}{\pi \cdot \ell}}}{F \cdot F}\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (<= F 1.1e-219)
   (- (* PI l) (/ (/ (/ (tan (* PI l)) F) (sqrt F)) (sqrt F)))
   (+
    (* PI l)
    (/
     (/
      -1.0
      (+ (* l (- (* PI -0.5) (* PI -0.16666666666666666))) (/ 1.0 (* PI l))))
     (* F F)))))
double code(double F, double l) {
	double tmp;
	if (F <= 1.1e-219) {
		tmp = (((double) M_PI) * l) - (((tan((((double) M_PI) * l)) / F) / sqrt(F)) / sqrt(F));
	} else {
		tmp = (((double) M_PI) * l) + ((-1.0 / ((l * ((((double) M_PI) * -0.5) - (((double) M_PI) * -0.16666666666666666))) + (1.0 / (((double) M_PI) * l)))) / (F * F));
	}
	return tmp;
}
public static double code(double F, double l) {
	double tmp;
	if (F <= 1.1e-219) {
		tmp = (Math.PI * l) - (((Math.tan((Math.PI * l)) / F) / Math.sqrt(F)) / Math.sqrt(F));
	} else {
		tmp = (Math.PI * l) + ((-1.0 / ((l * ((Math.PI * -0.5) - (Math.PI * -0.16666666666666666))) + (1.0 / (Math.PI * l)))) / (F * F));
	}
	return tmp;
}
def code(F, l):
	tmp = 0
	if F <= 1.1e-219:
		tmp = (math.pi * l) - (((math.tan((math.pi * l)) / F) / math.sqrt(F)) / math.sqrt(F))
	else:
		tmp = (math.pi * l) + ((-1.0 / ((l * ((math.pi * -0.5) - (math.pi * -0.16666666666666666))) + (1.0 / (math.pi * l)))) / (F * F))
	return tmp
function code(F, l)
	tmp = 0.0
	if (F <= 1.1e-219)
		tmp = Float64(Float64(pi * l) - Float64(Float64(Float64(tan(Float64(pi * l)) / F) / sqrt(F)) / sqrt(F)));
	else
		tmp = Float64(Float64(pi * l) + Float64(Float64(-1.0 / Float64(Float64(l * Float64(Float64(pi * -0.5) - Float64(pi * -0.16666666666666666))) + Float64(1.0 / Float64(pi * l)))) / Float64(F * F)));
	end
	return tmp
end
function tmp_2 = code(F, l)
	tmp = 0.0;
	if (F <= 1.1e-219)
		tmp = (pi * l) - (((tan((pi * l)) / F) / sqrt(F)) / sqrt(F));
	else
		tmp = (pi * l) + ((-1.0 / ((l * ((pi * -0.5) - (pi * -0.16666666666666666))) + (1.0 / (pi * l)))) / (F * F));
	end
	tmp_2 = tmp;
end
code[F_, l_] := If[LessEqual[F, 1.1e-219], N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] / N[Sqrt[F], $MachinePrecision]), $MachinePrecision] / N[Sqrt[F], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(N[(-1.0 / N[(N[(l * N[(N[(Pi * -0.5), $MachinePrecision] - N[(Pi * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(Pi * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 74.1%

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

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

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

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

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

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

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

    if 1.1e-219 < F

    1. Initial program 88.2%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. sqr-neg88.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/88.3%

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

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

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

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

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\sin \left(\pi \cdot \ell\right)}{\cos \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      2. clear-num88.3%

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

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

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

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{-0.5 \cdot \left({\ell}^{2} \cdot {\pi}^{2}\right) + 1}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      2. fma-def91.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{\mathsf{fma}\left(-0.5, {\ell}^{2} \cdot {\pi}^{2}, 1\right)}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      3. *-commutative91.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{{\pi}^{2} \cdot {\ell}^{2}}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      4. unpow291.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{\left(\pi \cdot \pi\right)} \cdot {\ell}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      5. unpow291.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \left(\pi \cdot \pi\right) \cdot \color{blue}{\left(\ell \cdot \ell\right)}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      6. swap-sqr91.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{\left(\pi \cdot \ell\right) \cdot \left(\pi \cdot \ell\right)}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      7. unpow291.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{{\left(\pi \cdot \ell\right)}^{2}}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      8. *-commutative91.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, {\color{blue}{\left(\ell \cdot \pi\right)}}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    8. Simplified91.0%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    9. Taylor expanded in l around 0 90.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 1.1 \cdot 10^{-219}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{\sqrt{F}}}{\sqrt{F}}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell + \frac{\frac{-1}{\ell \cdot \left(\pi \cdot -0.5 - \pi \cdot -0.16666666666666666\right) + \frac{1}{\pi \cdot \ell}}}{F \cdot F}\\ \end{array} \]

Alternative 6: 81.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.1 \cdot 10^{-219}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}\\

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


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

    1. Initial program 74.1%

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

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

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

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

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

    if 1.1e-219 < F

    1. Initial program 88.2%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. sqr-neg88.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/88.3%

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

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

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

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

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\sin \left(\pi \cdot \ell\right)}{\cos \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      2. clear-num88.3%

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

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

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

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{-0.5 \cdot \left({\ell}^{2} \cdot {\pi}^{2}\right) + 1}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      2. fma-def91.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{\mathsf{fma}\left(-0.5, {\ell}^{2} \cdot {\pi}^{2}, 1\right)}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      3. *-commutative91.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{{\pi}^{2} \cdot {\ell}^{2}}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      4. unpow291.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{\left(\pi \cdot \pi\right)} \cdot {\ell}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      5. unpow291.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \left(\pi \cdot \pi\right) \cdot \color{blue}{\left(\ell \cdot \ell\right)}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      6. swap-sqr91.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{\left(\pi \cdot \ell\right) \cdot \left(\pi \cdot \ell\right)}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      7. unpow291.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{{\left(\pi \cdot \ell\right)}^{2}}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      8. *-commutative91.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, {\color{blue}{\left(\ell \cdot \pi\right)}}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    8. Simplified91.0%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    9. Taylor expanded in l around 0 90.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 1.1 \cdot 10^{-219}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell + \frac{\frac{-1}{\ell \cdot \left(\pi \cdot -0.5 - \pi \cdot -0.16666666666666666\right) + \frac{1}{\pi \cdot \ell}}}{F \cdot F}\\ \end{array} \]

Alternative 7: 81.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 1.1 \cdot 10^{-219}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell + \frac{\frac{-1}{\mathsf{fma}\left(\ell, \pi \cdot -0.3333333333333333, \frac{\frac{1}{\ell}}{\pi}\right)}}{F \cdot F}\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (<= F 1.1e-219)
   (- (* PI l) (/ (/ (tan (* PI l)) F) F))
   (+
    (* PI l)
    (/ (/ -1.0 (fma l (* PI -0.3333333333333333) (/ (/ 1.0 l) PI))) (* F F)))))
double code(double F, double l) {
	double tmp;
	if (F <= 1.1e-219) {
		tmp = (((double) M_PI) * l) - ((tan((((double) M_PI) * l)) / F) / F);
	} else {
		tmp = (((double) M_PI) * l) + ((-1.0 / fma(l, (((double) M_PI) * -0.3333333333333333), ((1.0 / l) / ((double) M_PI)))) / (F * F));
	}
	return tmp;
}
function code(F, l)
	tmp = 0.0
	if (F <= 1.1e-219)
		tmp = Float64(Float64(pi * l) - Float64(Float64(tan(Float64(pi * l)) / F) / F));
	else
		tmp = Float64(Float64(pi * l) + Float64(Float64(-1.0 / fma(l, Float64(pi * -0.3333333333333333), Float64(Float64(1.0 / l) / pi))) / Float64(F * F)));
	end
	return tmp
end
code[F_, l_] := If[LessEqual[F, 1.1e-219], N[(N[(Pi * l), $MachinePrecision] - N[(N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(N[(-1.0 / N[(l * N[(Pi * -0.3333333333333333), $MachinePrecision] + N[(N[(1.0 / l), $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.1 \cdot 10^{-219}:\\
\;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}\\

\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + \frac{\frac{-1}{\mathsf{fma}\left(\ell, \pi \cdot -0.3333333333333333, \frac{\frac{1}{\ell}}{\pi}\right)}}{F \cdot F}\\


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

    1. Initial program 74.1%

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

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

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

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

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

    if 1.1e-219 < F

    1. Initial program 88.2%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. sqr-neg88.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/88.3%

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

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

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

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

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\sin \left(\pi \cdot \ell\right)}{\cos \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      2. clear-num88.3%

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

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

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

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{-0.5 \cdot \left({\ell}^{2} \cdot {\pi}^{2}\right) + 1}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      2. fma-def91.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{\mathsf{fma}\left(-0.5, {\ell}^{2} \cdot {\pi}^{2}, 1\right)}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      3. *-commutative91.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{{\pi}^{2} \cdot {\ell}^{2}}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      4. unpow291.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{\left(\pi \cdot \pi\right)} \cdot {\ell}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      5. unpow291.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \left(\pi \cdot \pi\right) \cdot \color{blue}{\left(\ell \cdot \ell\right)}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      6. swap-sqr91.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{\left(\pi \cdot \ell\right) \cdot \left(\pi \cdot \ell\right)}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      7. unpow291.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{{\left(\pi \cdot \ell\right)}^{2}}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
      8. *-commutative91.0%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, {\color{blue}{\left(\ell \cdot \pi\right)}}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    8. Simplified91.0%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\frac{\color{blue}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}{\sin \left(\pi \cdot \ell\right)}}}{F \cdot F} \]
    9. Taylor expanded in l around 0 90.2%

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

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\color{blue}{\mathsf{fma}\left(\ell, -0.5 \cdot \pi - -0.16666666666666666 \cdot \pi, \frac{1}{\ell \cdot \pi}\right)}}}{F \cdot F} \]
      2. distribute-rgt-out--90.2%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\mathsf{fma}\left(\ell, \color{blue}{\pi \cdot \left(-0.5 - -0.16666666666666666\right)}, \frac{1}{\ell \cdot \pi}\right)}}{F \cdot F} \]
      3. metadata-eval90.2%

        \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\mathsf{fma}\left(\ell, \pi \cdot \color{blue}{-0.3333333333333333}, \frac{1}{\ell \cdot \pi}\right)}}{F \cdot F} \]
      4. associate-/r*90.1%

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

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{\color{blue}{\mathsf{fma}\left(\ell, \pi \cdot -0.3333333333333333, \frac{\frac{1}{\ell}}{\pi}\right)}}}{F \cdot F} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification82.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 1.1 \cdot 10^{-219}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell + \frac{\frac{-1}{\mathsf{fma}\left(\ell, \pi \cdot -0.3333333333333333, \frac{\frac{1}{\ell}}{\pi}\right)}}{F \cdot F}\\ \end{array} \]

Alternative 8: 82.1% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\pi, \ell, \frac{\frac{\tan \left(\pi \cdot \ell\right)}{-F}}{F}\right) \end{array} \]
(FPCore (F l) :precision binary64 (fma PI l (/ (/ (tan (* PI l)) (- F)) F)))
double code(double F, double l) {
	return fma(((double) M_PI), l, ((tan((((double) M_PI) * l)) / -F) / F));
}
function code(F, l)
	return fma(pi, l, Float64(Float64(tan(Float64(pi * l)) / Float64(-F)) / F))
end
code[F_, l_] := N[(Pi * l + N[(N[(N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / (-F)), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\pi, \ell, \frac{\frac{\tan \left(\pi \cdot \ell\right)}{-F}}{F}\right)
\end{array}
Derivation
  1. Initial program 79.5%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\pi, \ell, -\frac{1}{\left(-F\right) \cdot \left(-F\right)} \cdot \tan \left(\pi \cdot \ell\right)\right)} \]
    5. associate-*l/79.6%

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

      \[\leadsto \mathsf{fma}\left(\pi, \ell, -\color{blue}{\frac{1}{-F} \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}}\right) \]
    7. distribute-lft-neg-in81.3%

      \[\leadsto \mathsf{fma}\left(\pi, \ell, \color{blue}{\left(-\frac{1}{-F}\right) \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}}\right) \]
    8. neg-mul-181.3%

      \[\leadsto \mathsf{fma}\left(\pi, \ell, \left(-\frac{1}{\color{blue}{-1 \cdot F}}\right) \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}\right) \]
    9. associate-/r*81.3%

      \[\leadsto \mathsf{fma}\left(\pi, \ell, \left(-\color{blue}{\frac{\frac{1}{-1}}{F}}\right) \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}\right) \]
    10. metadata-eval81.3%

      \[\leadsto \mathsf{fma}\left(\pi, \ell, \left(-\frac{\color{blue}{-1}}{F}\right) \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}\right) \]
    11. distribute-neg-frac81.3%

      \[\leadsto \mathsf{fma}\left(\pi, \ell, \color{blue}{\frac{--1}{F}} \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}\right) \]
    12. metadata-eval81.3%

      \[\leadsto \mathsf{fma}\left(\pi, \ell, \frac{\color{blue}{1}}{F} \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}\right) \]
    13. times-frac79.6%

      \[\leadsto \mathsf{fma}\left(\pi, \ell, \color{blue}{\frac{1 \cdot \tan \left(\pi \cdot \ell\right)}{F \cdot \left(-F\right)}}\right) \]
  3. Simplified81.3%

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

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

Alternative 9: 76.2% accurate, 1.0× speedup?

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

    1. Initial program 74.1%

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

        \[\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/74.1%

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

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

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

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\pi}{\frac{F}{\frac{\ell}{F}}}} \]
    8. Applied egg-rr71.1%

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

    if 1.1e-219 < F

    1. Initial program 88.2%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Step-by-step derivation
      1. sqr-neg88.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/88.3%

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

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

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

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

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

Alternative 10: 82.1% 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 79.5%

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

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

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

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

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

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

Alternative 11: 74.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\pi, \ell, \frac{\frac{\pi \cdot \ell}{-F}}{F}\right) \end{array} \]
(FPCore (F l) :precision binary64 (fma PI l (/ (/ (* PI l) (- F)) F)))
double code(double F, double l) {
	return fma(((double) M_PI), l, (((((double) M_PI) * l) / -F) / F));
}
function code(F, l)
	return fma(pi, l, Float64(Float64(Float64(pi * l) / Float64(-F)) / F))
end
code[F_, l_] := N[(Pi * l + N[(N[(N[(Pi * l), $MachinePrecision] / (-F)), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\pi, \ell, \frac{\frac{\pi \cdot \ell}{-F}}{F}\right)
\end{array}
Derivation
  1. Initial program 79.5%

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\pi, \ell, -\frac{1}{\left(-F\right) \cdot \left(-F\right)} \cdot \tan \left(\pi \cdot \ell\right)\right)} \]
    5. associate-*l/79.6%

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

      \[\leadsto \mathsf{fma}\left(\pi, \ell, -\color{blue}{\frac{1}{-F} \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}}\right) \]
    7. distribute-lft-neg-in81.3%

      \[\leadsto \mathsf{fma}\left(\pi, \ell, \color{blue}{\left(-\frac{1}{-F}\right) \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}}\right) \]
    8. neg-mul-181.3%

      \[\leadsto \mathsf{fma}\left(\pi, \ell, \left(-\frac{1}{\color{blue}{-1 \cdot F}}\right) \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}\right) \]
    9. associate-/r*81.3%

      \[\leadsto \mathsf{fma}\left(\pi, \ell, \left(-\color{blue}{\frac{\frac{1}{-1}}{F}}\right) \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}\right) \]
    10. metadata-eval81.3%

      \[\leadsto \mathsf{fma}\left(\pi, \ell, \left(-\frac{\color{blue}{-1}}{F}\right) \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}\right) \]
    11. distribute-neg-frac81.3%

      \[\leadsto \mathsf{fma}\left(\pi, \ell, \color{blue}{\frac{--1}{F}} \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}\right) \]
    12. metadata-eval81.3%

      \[\leadsto \mathsf{fma}\left(\pi, \ell, \frac{\color{blue}{1}}{F} \cdot \frac{\tan \left(\pi \cdot \ell\right)}{-F}\right) \]
    13. times-frac79.6%

      \[\leadsto \mathsf{fma}\left(\pi, \ell, \color{blue}{\frac{1 \cdot \tan \left(\pi \cdot \ell\right)}{F \cdot \left(-F\right)}}\right) \]
  3. Simplified81.3%

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

    \[\leadsto \mathsf{fma}\left(\pi, \ell, \frac{\frac{\color{blue}{\ell \cdot \pi}}{-F}}{F}\right) \]
  5. Final simplification74.2%

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

Alternative 12: 74.7% accurate, 1.5× 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 79.5%

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

      \[\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/79.6%

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

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

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

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

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

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

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

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

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

Alternative 13: 74.7% accurate, 1.5× speedup?

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

\\
\pi \cdot \ell - \frac{\pi}{\frac{F}{\frac{\ell}{F}}}
\end{array}
Derivation
  1. Initial program 79.5%

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

      \[\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/79.6%

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

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

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

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

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

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

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

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\pi}{\frac{F}{\frac{\ell}{F}}}} \]
  8. Applied egg-rr74.2%

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

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

Reproduce

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