VandenBroeck and Keller, Equation (6)

Percentage Accurate: 75.9% → 98.5%
Time: 14.3s
Alternatives: 11
Speedup: 1.5×

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 11 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.9% 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.5% accurate, 0.4× speedup?

\[\begin{array}{l} F = |F|\\ \\ \begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -2 \cdot 10^{+31} \lor \neg \left(\pi \cdot \ell \leq 1000000000000\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{\sqrt{F}}}{\sqrt{F}}\\ \end{array} \end{array} \]
NOTE: F should be positive before calling this function
(FPCore (F l)
 :precision binary64
 (if (or (<= (* PI l) -2e+31) (not (<= (* PI l) 1000000000000.0)))
   (* PI l)
   (- (* PI l) (/ (/ (/ (tan (* PI l)) F) (sqrt F)) (sqrt F)))))
F = abs(F);
double code(double F, double l) {
	double tmp;
	if (((((double) M_PI) * l) <= -2e+31) || !((((double) M_PI) * l) <= 1000000000000.0)) {
		tmp = ((double) M_PI) * l;
	} else {
		tmp = (((double) M_PI) * l) - (((tan((((double) M_PI) * l)) / F) / sqrt(F)) / sqrt(F));
	}
	return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
	double tmp;
	if (((Math.PI * l) <= -2e+31) || !((Math.PI * l) <= 1000000000000.0)) {
		tmp = Math.PI * l;
	} else {
		tmp = (Math.PI * l) - (((Math.tan((Math.PI * l)) / F) / Math.sqrt(F)) / Math.sqrt(F));
	}
	return tmp;
}
F = abs(F)
def code(F, l):
	tmp = 0
	if ((math.pi * l) <= -2e+31) or not ((math.pi * l) <= 1000000000000.0):
		tmp = math.pi * l
	else:
		tmp = (math.pi * l) - (((math.tan((math.pi * l)) / F) / math.sqrt(F)) / math.sqrt(F))
	return tmp
F = abs(F)
function code(F, l)
	tmp = 0.0
	if ((Float64(pi * l) <= -2e+31) || !(Float64(pi * l) <= 1000000000000.0))
		tmp = Float64(pi * l);
	else
		tmp = Float64(Float64(pi * l) - Float64(Float64(Float64(tan(Float64(pi * l)) / F) / sqrt(F)) / sqrt(F)));
	end
	return tmp
end
F = abs(F)
function tmp_2 = code(F, l)
	tmp = 0.0;
	if (((pi * l) <= -2e+31) || ~(((pi * l) <= 1000000000000.0)))
		tmp = pi * l;
	else
		tmp = (pi * l) - (((tan((pi * l)) / F) / sqrt(F)) / sqrt(F));
	end
	tmp_2 = tmp;
end
NOTE: F should be positive before calling this function
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -2e+31], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 1000000000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], 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]]
\begin{array}{l}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -2 \cdot 10^{+31} \lor \neg \left(\pi \cdot \ell \leq 1000000000000\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (PI.f64) l) < -1.9999999999999999e31 or 1e12 < (*.f64 (PI.f64) l)

    1. Initial program 61.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)} \]
    7. Taylor expanded in F around inf 99.7%

      \[\leadsto \color{blue}{\ell \cdot \pi} \]

    if -1.9999999999999999e31 < (*.f64 (PI.f64) l) < 1e12

    1. Initial program 87.9%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -2 \cdot 10^{+31} \lor \neg \left(\pi \cdot \ell \leq 1000000000000\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{\sqrt{F}}}{\sqrt{F}}\\ \end{array} \]

Alternative 2: 98.6% accurate, 0.6× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (PI.f64) l) < -1.9999999999999999e31 or 1e12 < (*.f64 (PI.f64) l)

    1. Initial program 61.7%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)} \]
    7. Taylor expanded in F around inf 99.7%

      \[\leadsto \color{blue}{\ell \cdot \pi} \]

    if -1.9999999999999999e31 < (*.f64 (PI.f64) l) < 1e12

    1. Initial program 87.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -2 \cdot 10^{+31} \lor \neg \left(\pi \cdot \ell \leq 1000000000000\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}\\ \end{array} \]

Alternative 3: 98.5% accurate, 0.7× speedup?

\[\begin{array}{l} F = |F|\\ \\ \begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -100000000 \lor \neg \left(\pi \cdot \ell \leq 1000000000000\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\ell \cdot \frac{\pi}{F}}{F}\\ \end{array} \end{array} \]
NOTE: F should be positive before calling this function
(FPCore (F l)
 :precision binary64
 (if (or (<= (* PI l) -100000000.0) (not (<= (* PI l) 1000000000000.0)))
   (* PI l)
   (- (* PI l) (/ (* l (/ PI F)) F))))
F = abs(F);
double code(double F, double l) {
	double tmp;
	if (((((double) M_PI) * l) <= -100000000.0) || !((((double) M_PI) * l) <= 1000000000000.0)) {
		tmp = ((double) M_PI) * l;
	} else {
		tmp = (((double) M_PI) * l) - ((l * (((double) M_PI) / F)) / F);
	}
	return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
	double tmp;
	if (((Math.PI * l) <= -100000000.0) || !((Math.PI * l) <= 1000000000000.0)) {
		tmp = Math.PI * l;
	} else {
		tmp = (Math.PI * l) - ((l * (Math.PI / F)) / F);
	}
	return tmp;
}
F = abs(F)
def code(F, l):
	tmp = 0
	if ((math.pi * l) <= -100000000.0) or not ((math.pi * l) <= 1000000000000.0):
		tmp = math.pi * l
	else:
		tmp = (math.pi * l) - ((l * (math.pi / F)) / F)
	return tmp
F = abs(F)
function code(F, l)
	tmp = 0.0
	if ((Float64(pi * l) <= -100000000.0) || !(Float64(pi * l) <= 1000000000000.0))
		tmp = Float64(pi * l);
	else
		tmp = Float64(Float64(pi * l) - Float64(Float64(l * Float64(pi / F)) / F));
	end
	return tmp
end
F = abs(F)
function tmp_2 = code(F, l)
	tmp = 0.0;
	if (((pi * l) <= -100000000.0) || ~(((pi * l) <= 1000000000000.0)))
		tmp = pi * l;
	else
		tmp = (pi * l) - ((l * (pi / F)) / F);
	end
	tmp_2 = tmp;
end
NOTE: F should be positive before calling this function
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -100000000.0], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 1000000000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(l * N[(Pi / F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -100000000 \lor \neg \left(\pi \cdot \ell \leq 1000000000000\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (PI.f64) l) < -1e8 or 1e12 < (*.f64 (PI.f64) l)

    1. Initial program 62.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)} \]
    7. Taylor expanded in F around inf 98.9%

      \[\leadsto \color{blue}{\ell \cdot \pi} \]

    if -1e8 < (*.f64 (PI.f64) l) < 1e12

    1. Initial program 88.0%

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

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

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

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

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

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

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

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\ell}{\frac{F}{\pi}}}}{F} \]
    7. Step-by-step derivation
      1. clear-num97.1%

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

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{1}{\frac{F}{\pi}} \cdot \ell}}{F} \]
      3. clear-num97.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -100000000 \lor \neg \left(\pi \cdot \ell \leq 1000000000000\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\ell \cdot \frac{\pi}{F}}{F}\\ \end{array} \]

Alternative 4: 92.7% accurate, 1.5× speedup?

\[\begin{array}{l} F = |F|\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -44000000 \lor \neg \left(\ell \leq 45000000000000\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \pi \cdot \frac{\ell}{F \cdot F}\\ \end{array} \end{array} \]
NOTE: F should be positive before calling this function
(FPCore (F l)
 :precision binary64
 (if (or (<= l -44000000.0) (not (<= l 45000000000000.0)))
   (* PI l)
   (- (* PI l) (* PI (/ l (* F F))))))
F = abs(F);
double code(double F, double l) {
	double tmp;
	if ((l <= -44000000.0) || !(l <= 45000000000000.0)) {
		tmp = ((double) M_PI) * l;
	} else {
		tmp = (((double) M_PI) * l) - (((double) M_PI) * (l / (F * F)));
	}
	return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
	double tmp;
	if ((l <= -44000000.0) || !(l <= 45000000000000.0)) {
		tmp = Math.PI * l;
	} else {
		tmp = (Math.PI * l) - (Math.PI * (l / (F * F)));
	}
	return tmp;
}
F = abs(F)
def code(F, l):
	tmp = 0
	if (l <= -44000000.0) or not (l <= 45000000000000.0):
		tmp = math.pi * l
	else:
		tmp = (math.pi * l) - (math.pi * (l / (F * F)))
	return tmp
F = abs(F)
function code(F, l)
	tmp = 0.0
	if ((l <= -44000000.0) || !(l <= 45000000000000.0))
		tmp = Float64(pi * l);
	else
		tmp = Float64(Float64(pi * l) - Float64(pi * Float64(l / Float64(F * F))));
	end
	return tmp
end
F = abs(F)
function tmp_2 = code(F, l)
	tmp = 0.0;
	if ((l <= -44000000.0) || ~((l <= 45000000000000.0)))
		tmp = pi * l;
	else
		tmp = (pi * l) - (pi * (l / (F * F)));
	end
	tmp_2 = tmp;
end
NOTE: F should be positive before calling this function
code[F_, l_] := If[Or[LessEqual[l, -44000000.0], N[Not[LessEqual[l, 45000000000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(Pi * N[(l / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -44000000 \lor \neg \left(\ell \leq 45000000000000\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -4.4e7 or 4.5e13 < l

    1. Initial program 62.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)} \]
    7. Taylor expanded in F around inf 98.9%

      \[\leadsto \color{blue}{\ell \cdot \pi} \]

    if -4.4e7 < l < 4.5e13

    1. Initial program 88.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -44000000 \lor \neg \left(\ell \leq 45000000000000\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \pi \cdot \frac{\ell}{F \cdot F}\\ \end{array} \]

Alternative 5: 92.7% accurate, 1.5× speedup?

\[\begin{array}{l} F = |F|\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -44000000 \lor \neg \left(\ell \leq 45000000000000\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\pi \cdot \ell}{F \cdot F}\\ \end{array} \end{array} \]
NOTE: F should be positive before calling this function
(FPCore (F l)
 :precision binary64
 (if (or (<= l -44000000.0) (not (<= l 45000000000000.0)))
   (* PI l)
   (- (* PI l) (/ (* PI l) (* F F)))))
F = abs(F);
double code(double F, double l) {
	double tmp;
	if ((l <= -44000000.0) || !(l <= 45000000000000.0)) {
		tmp = ((double) M_PI) * l;
	} else {
		tmp = (((double) M_PI) * l) - ((((double) M_PI) * l) / (F * F));
	}
	return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
	double tmp;
	if ((l <= -44000000.0) || !(l <= 45000000000000.0)) {
		tmp = Math.PI * l;
	} else {
		tmp = (Math.PI * l) - ((Math.PI * l) / (F * F));
	}
	return tmp;
}
F = abs(F)
def code(F, l):
	tmp = 0
	if (l <= -44000000.0) or not (l <= 45000000000000.0):
		tmp = math.pi * l
	else:
		tmp = (math.pi * l) - ((math.pi * l) / (F * F))
	return tmp
F = abs(F)
function code(F, l)
	tmp = 0.0
	if ((l <= -44000000.0) || !(l <= 45000000000000.0))
		tmp = Float64(pi * l);
	else
		tmp = Float64(Float64(pi * l) - Float64(Float64(pi * l) / Float64(F * F)));
	end
	return tmp
end
F = abs(F)
function tmp_2 = code(F, l)
	tmp = 0.0;
	if ((l <= -44000000.0) || ~((l <= 45000000000000.0)))
		tmp = pi * l;
	else
		tmp = (pi * l) - ((pi * l) / (F * F));
	end
	tmp_2 = tmp;
end
NOTE: F should be positive before calling this function
code[F_, l_] := If[Or[LessEqual[l, -44000000.0], N[Not[LessEqual[l, 45000000000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(Pi * l), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -44000000 \lor \neg \left(\ell \leq 45000000000000\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -4.4e7 or 4.5e13 < l

    1. Initial program 62.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)} \]
    7. Taylor expanded in F around inf 98.9%

      \[\leadsto \color{blue}{\ell \cdot \pi} \]

    if -4.4e7 < l < 4.5e13

    1. Initial program 88.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -44000000 \lor \neg \left(\ell \leq 45000000000000\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\pi \cdot \ell}{F \cdot F}\\ \end{array} \]

Alternative 6: 98.5% accurate, 1.5× speedup?

\[\begin{array}{l} F = |F|\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -44000000 \lor \neg \left(\ell \leq 45000000000000\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\pi \cdot \frac{\ell}{F}}{F}\\ \end{array} \end{array} \]
NOTE: F should be positive before calling this function
(FPCore (F l)
 :precision binary64
 (if (or (<= l -44000000.0) (not (<= l 45000000000000.0)))
   (* PI l)
   (- (* PI l) (/ (* PI (/ l F)) F))))
F = abs(F);
double code(double F, double l) {
	double tmp;
	if ((l <= -44000000.0) || !(l <= 45000000000000.0)) {
		tmp = ((double) M_PI) * l;
	} else {
		tmp = (((double) M_PI) * l) - ((((double) M_PI) * (l / F)) / F);
	}
	return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
	double tmp;
	if ((l <= -44000000.0) || !(l <= 45000000000000.0)) {
		tmp = Math.PI * l;
	} else {
		tmp = (Math.PI * l) - ((Math.PI * (l / F)) / F);
	}
	return tmp;
}
F = abs(F)
def code(F, l):
	tmp = 0
	if (l <= -44000000.0) or not (l <= 45000000000000.0):
		tmp = math.pi * l
	else:
		tmp = (math.pi * l) - ((math.pi * (l / F)) / F)
	return tmp
F = abs(F)
function code(F, l)
	tmp = 0.0
	if ((l <= -44000000.0) || !(l <= 45000000000000.0))
		tmp = Float64(pi * l);
	else
		tmp = Float64(Float64(pi * l) - Float64(Float64(pi * Float64(l / F)) / F));
	end
	return tmp
end
F = abs(F)
function tmp_2 = code(F, l)
	tmp = 0.0;
	if ((l <= -44000000.0) || ~((l <= 45000000000000.0)))
		tmp = pi * l;
	else
		tmp = (pi * l) - ((pi * (l / F)) / F);
	end
	tmp_2 = tmp;
end
NOTE: F should be positive before calling this function
code[F_, l_] := If[Or[LessEqual[l, -44000000.0], N[Not[LessEqual[l, 45000000000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(Pi * N[(l / F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -44000000 \lor \neg \left(\ell \leq 45000000000000\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -4.4e7 or 4.5e13 < l

    1. Initial program 62.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)} \]
    7. Taylor expanded in F around inf 98.9%

      \[\leadsto \color{blue}{\ell \cdot \pi} \]

    if -4.4e7 < l < 4.5e13

    1. Initial program 88.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -44000000 \lor \neg \left(\ell \leq 45000000000000\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\pi \cdot \frac{\ell}{F}}{F}\\ \end{array} \]

Alternative 7: 92.4% accurate, 1.5× speedup?

\[\begin{array}{l} F = |F|\\ \\ \begin{array}{l} \mathbf{if}\;\ell \leq -44000000 \lor \neg \left(\ell \leq 45000000000000\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \left(\pi \cdot \left(1 - {F}^{-2}\right)\right)\\ \end{array} \end{array} \]
NOTE: F should be positive before calling this function
(FPCore (F l)
 :precision binary64
 (if (or (<= l -44000000.0) (not (<= l 45000000000000.0)))
   (* PI l)
   (* l (* PI (- 1.0 (pow F -2.0))))))
F = abs(F);
double code(double F, double l) {
	double tmp;
	if ((l <= -44000000.0) || !(l <= 45000000000000.0)) {
		tmp = ((double) M_PI) * l;
	} else {
		tmp = l * (((double) M_PI) * (1.0 - pow(F, -2.0)));
	}
	return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
	double tmp;
	if ((l <= -44000000.0) || !(l <= 45000000000000.0)) {
		tmp = Math.PI * l;
	} else {
		tmp = l * (Math.PI * (1.0 - Math.pow(F, -2.0)));
	}
	return tmp;
}
F = abs(F)
def code(F, l):
	tmp = 0
	if (l <= -44000000.0) or not (l <= 45000000000000.0):
		tmp = math.pi * l
	else:
		tmp = l * (math.pi * (1.0 - math.pow(F, -2.0)))
	return tmp
F = abs(F)
function code(F, l)
	tmp = 0.0
	if ((l <= -44000000.0) || !(l <= 45000000000000.0))
		tmp = Float64(pi * l);
	else
		tmp = Float64(l * Float64(pi * Float64(1.0 - (F ^ -2.0))));
	end
	return tmp
end
F = abs(F)
function tmp_2 = code(F, l)
	tmp = 0.0;
	if ((l <= -44000000.0) || ~((l <= 45000000000000.0)))
		tmp = pi * l;
	else
		tmp = l * (pi * (1.0 - (F ^ -2.0)));
	end
	tmp_2 = tmp;
end
NOTE: F should be positive before calling this function
code[F_, l_] := If[Or[LessEqual[l, -44000000.0], N[Not[LessEqual[l, 45000000000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(l * N[(Pi * N[(1.0 - N[Power[F, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -44000000 \lor \neg \left(\ell \leq 45000000000000\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -4.4e7 or 4.5e13 < l

    1. Initial program 62.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)} \]
    7. Taylor expanded in F around inf 98.9%

      \[\leadsto \color{blue}{\ell \cdot \pi} \]

    if -4.4e7 < l < 4.5e13

    1. Initial program 88.0%

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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \color{blue}{\left(\pi + \left(-\frac{\pi}{F \cdot F}\right)\right)} \]
      2. distribute-lft-in86.3%

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

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

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

        \[\leadsto \pi \cdot \ell + \ell \cdot \left(-\pi \cdot \frac{1}{\color{blue}{{F}^{2}}}\right) \]
      6. pow-flip86.3%

        \[\leadsto \pi \cdot \ell + \ell \cdot \left(-\pi \cdot \color{blue}{{F}^{\left(-2\right)}}\right) \]
      7. metadata-eval86.3%

        \[\leadsto \pi \cdot \ell + \ell \cdot \left(-\pi \cdot {F}^{\color{blue}{-2}}\right) \]
      8. distribute-rgt-neg-in86.3%

        \[\leadsto \pi \cdot \ell + \ell \cdot \color{blue}{\left(\pi \cdot \left(-{F}^{-2}\right)\right)} \]
    8. Applied egg-rr86.3%

      \[\leadsto \color{blue}{\pi \cdot \ell + \ell \cdot \left(\pi \cdot \left(-{F}^{-2}\right)\right)} \]
    9. Step-by-step derivation
      1. *-commutative86.3%

        \[\leadsto \color{blue}{\ell \cdot \pi} + \ell \cdot \left(\pi \cdot \left(-{F}^{-2}\right)\right) \]
      2. distribute-lft-in86.3%

        \[\leadsto \color{blue}{\ell \cdot \left(\pi + \pi \cdot \left(-{F}^{-2}\right)\right)} \]
      3. distribute-rgt-neg-out86.3%

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

        \[\leadsto \ell \cdot \color{blue}{\left(\pi - \pi \cdot {F}^{-2}\right)} \]
      5. *-rgt-identity86.3%

        \[\leadsto \ell \cdot \left(\color{blue}{\pi \cdot 1} - \pi \cdot {F}^{-2}\right) \]
      6. distribute-lft-out--86.3%

        \[\leadsto \ell \cdot \color{blue}{\left(\pi \cdot \left(1 - {F}^{-2}\right)\right)} \]
    10. Simplified86.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -44000000 \lor \neg \left(\ell \leq 45000000000000\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \left(\pi \cdot \left(1 - {F}^{-2}\right)\right)\\ \end{array} \]

Alternative 8: 74.2% accurate, 2.6× speedup?

\[\begin{array}{l} F = |F|\\ \\ \begin{array}{l} \mathbf{if}\;F \cdot F \leq 2.5 \cdot 10^{-299}:\\ \;\;\;\;\frac{\pi}{F} \cdot \frac{-\ell}{F}\\ \mathbf{elif}\;F \cdot F \leq 10^{-257} \lor \neg \left(F \cdot F \leq 10^{-205}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell}{F \cdot F} \cdot \left(-\pi\right)\\ \end{array} \end{array} \]
NOTE: F should be positive before calling this function
(FPCore (F l)
 :precision binary64
 (if (<= (* F F) 2.5e-299)
   (* (/ PI F) (/ (- l) F))
   (if (or (<= (* F F) 1e-257) (not (<= (* F F) 1e-205)))
     (* PI l)
     (* (/ l (* F F)) (- PI)))))
F = abs(F);
double code(double F, double l) {
	double tmp;
	if ((F * F) <= 2.5e-299) {
		tmp = (((double) M_PI) / F) * (-l / F);
	} else if (((F * F) <= 1e-257) || !((F * F) <= 1e-205)) {
		tmp = ((double) M_PI) * l;
	} else {
		tmp = (l / (F * F)) * -((double) M_PI);
	}
	return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
	double tmp;
	if ((F * F) <= 2.5e-299) {
		tmp = (Math.PI / F) * (-l / F);
	} else if (((F * F) <= 1e-257) || !((F * F) <= 1e-205)) {
		tmp = Math.PI * l;
	} else {
		tmp = (l / (F * F)) * -Math.PI;
	}
	return tmp;
}
F = abs(F)
def code(F, l):
	tmp = 0
	if (F * F) <= 2.5e-299:
		tmp = (math.pi / F) * (-l / F)
	elif ((F * F) <= 1e-257) or not ((F * F) <= 1e-205):
		tmp = math.pi * l
	else:
		tmp = (l / (F * F)) * -math.pi
	return tmp
F = abs(F)
function code(F, l)
	tmp = 0.0
	if (Float64(F * F) <= 2.5e-299)
		tmp = Float64(Float64(pi / F) * Float64(Float64(-l) / F));
	elseif ((Float64(F * F) <= 1e-257) || !(Float64(F * F) <= 1e-205))
		tmp = Float64(pi * l);
	else
		tmp = Float64(Float64(l / Float64(F * F)) * Float64(-pi));
	end
	return tmp
end
F = abs(F)
function tmp_2 = code(F, l)
	tmp = 0.0;
	if ((F * F) <= 2.5e-299)
		tmp = (pi / F) * (-l / F);
	elseif (((F * F) <= 1e-257) || ~(((F * F) <= 1e-205)))
		tmp = pi * l;
	else
		tmp = (l / (F * F)) * -pi;
	end
	tmp_2 = tmp;
end
NOTE: F should be positive before calling this function
code[F_, l_] := If[LessEqual[N[(F * F), $MachinePrecision], 2.5e-299], N[(N[(Pi / F), $MachinePrecision] * N[((-l) / F), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(F * F), $MachinePrecision], 1e-257], N[Not[LessEqual[N[(F * F), $MachinePrecision], 1e-205]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(l / N[(F * F), $MachinePrecision]), $MachinePrecision] * (-Pi)), $MachinePrecision]]]
\begin{array}{l}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 2.5 \cdot 10^{-299}:\\
\;\;\;\;\frac{\pi}{F} \cdot \frac{-\ell}{F}\\

\mathbf{elif}\;F \cdot F \leq 10^{-257} \lor \neg \left(F \cdot F \leq 10^{-205}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


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

    1. Initial program 40.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{\ell \cdot \pi}{{F}^{2}}} \]
    8. Step-by-step derivation
      1. mul-1-neg40.7%

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

        \[\leadsto -\color{blue}{\frac{\ell}{\frac{{F}^{2}}{\pi}}} \]
      3. unpow240.5%

        \[\leadsto -\frac{\ell}{\frac{\color{blue}{F \cdot F}}{\pi}} \]
    9. Simplified40.5%

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

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

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

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

    if 2.49999999999999978e-299 < (*.f64 F F) < 9.9999999999999998e-258 or 1e-205 < (*.f64 F F)

    1. Initial program 90.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)} \]
    7. Taylor expanded in F around inf 86.9%

      \[\leadsto \color{blue}{\ell \cdot \pi} \]

    if 9.9999999999999998e-258 < (*.f64 F F) < 1e-205

    1. Initial program 72.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\ell}{\frac{{F}^{2}}{\pi}}} \]
      3. unpow270.9%

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

      \[\leadsto \color{blue}{-\frac{\ell}{\frac{F \cdot F}{\pi}}} \]
    10. Step-by-step derivation
      1. associate-/r/70.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \cdot F \leq 2.5 \cdot 10^{-299}:\\ \;\;\;\;\frac{\pi}{F} \cdot \frac{-\ell}{F}\\ \mathbf{elif}\;F \cdot F \leq 10^{-257} \lor \neg \left(F \cdot F \leq 10^{-205}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell}{F \cdot F} \cdot \left(-\pi\right)\\ \end{array} \]

Alternative 9: 74.2% accurate, 2.6× speedup?

\[\begin{array}{l} F = |F|\\ \\ \begin{array}{l} \mathbf{if}\;F \cdot F \leq 2.5 \cdot 10^{-299}:\\ \;\;\;\;\frac{\pi}{F} \cdot \frac{-\ell}{F}\\ \mathbf{elif}\;F \cdot F \leq 10^{-257} \lor \neg \left(F \cdot F \leq 10^{-205}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\frac{-\ell}{\frac{F \cdot F}{\pi}}\\ \end{array} \end{array} \]
NOTE: F should be positive before calling this function
(FPCore (F l)
 :precision binary64
 (if (<= (* F F) 2.5e-299)
   (* (/ PI F) (/ (- l) F))
   (if (or (<= (* F F) 1e-257) (not (<= (* F F) 1e-205)))
     (* PI l)
     (/ (- l) (/ (* F F) PI)))))
F = abs(F);
double code(double F, double l) {
	double tmp;
	if ((F * F) <= 2.5e-299) {
		tmp = (((double) M_PI) / F) * (-l / F);
	} else if (((F * F) <= 1e-257) || !((F * F) <= 1e-205)) {
		tmp = ((double) M_PI) * l;
	} else {
		tmp = -l / ((F * F) / ((double) M_PI));
	}
	return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
	double tmp;
	if ((F * F) <= 2.5e-299) {
		tmp = (Math.PI / F) * (-l / F);
	} else if (((F * F) <= 1e-257) || !((F * F) <= 1e-205)) {
		tmp = Math.PI * l;
	} else {
		tmp = -l / ((F * F) / Math.PI);
	}
	return tmp;
}
F = abs(F)
def code(F, l):
	tmp = 0
	if (F * F) <= 2.5e-299:
		tmp = (math.pi / F) * (-l / F)
	elif ((F * F) <= 1e-257) or not ((F * F) <= 1e-205):
		tmp = math.pi * l
	else:
		tmp = -l / ((F * F) / math.pi)
	return tmp
F = abs(F)
function code(F, l)
	tmp = 0.0
	if (Float64(F * F) <= 2.5e-299)
		tmp = Float64(Float64(pi / F) * Float64(Float64(-l) / F));
	elseif ((Float64(F * F) <= 1e-257) || !(Float64(F * F) <= 1e-205))
		tmp = Float64(pi * l);
	else
		tmp = Float64(Float64(-l) / Float64(Float64(F * F) / pi));
	end
	return tmp
end
F = abs(F)
function tmp_2 = code(F, l)
	tmp = 0.0;
	if ((F * F) <= 2.5e-299)
		tmp = (pi / F) * (-l / F);
	elseif (((F * F) <= 1e-257) || ~(((F * F) <= 1e-205)))
		tmp = pi * l;
	else
		tmp = -l / ((F * F) / pi);
	end
	tmp_2 = tmp;
end
NOTE: F should be positive before calling this function
code[F_, l_] := If[LessEqual[N[(F * F), $MachinePrecision], 2.5e-299], N[(N[(Pi / F), $MachinePrecision] * N[((-l) / F), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(F * F), $MachinePrecision], 1e-257], N[Not[LessEqual[N[(F * F), $MachinePrecision], 1e-205]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[((-l) / N[(N[(F * F), $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 2.5 \cdot 10^{-299}:\\
\;\;\;\;\frac{\pi}{F} \cdot \frac{-\ell}{F}\\

\mathbf{elif}\;F \cdot F \leq 10^{-257} \lor \neg \left(F \cdot F \leq 10^{-205}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


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

    1. Initial program 40.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{\ell \cdot \pi}{{F}^{2}}} \]
    8. Step-by-step derivation
      1. mul-1-neg40.7%

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

        \[\leadsto -\color{blue}{\frac{\ell}{\frac{{F}^{2}}{\pi}}} \]
      3. unpow240.5%

        \[\leadsto -\frac{\ell}{\frac{\color{blue}{F \cdot F}}{\pi}} \]
    9. Simplified40.5%

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

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

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

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

    if 2.49999999999999978e-299 < (*.f64 F F) < 9.9999999999999998e-258 or 1e-205 < (*.f64 F F)

    1. Initial program 90.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)} \]
    7. Taylor expanded in F around inf 86.9%

      \[\leadsto \color{blue}{\ell \cdot \pi} \]

    if 9.9999999999999998e-258 < (*.f64 F F) < 1e-205

    1. Initial program 72.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\ell}{\frac{{F}^{2}}{\pi}}} \]
      3. unpow270.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \cdot F \leq 2.5 \cdot 10^{-299}:\\ \;\;\;\;\frac{\pi}{F} \cdot \frac{-\ell}{F}\\ \mathbf{elif}\;F \cdot F \leq 10^{-257} \lor \neg \left(F \cdot F \leq 10^{-205}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\frac{-\ell}{\frac{F \cdot F}{\pi}}\\ \end{array} \]

Alternative 10: 73.3% accurate, 2.7× speedup?

\[\begin{array}{l} F = |F|\\ \\ \begin{array}{l} \mathbf{if}\;F \leq 2.7 \cdot 10^{-232} \lor \neg \left(F \leq 1.05 \cdot 10^{-161}\right) \land \left(F \leq 4.8 \cdot 10^{-150} \lor \neg \left(F \leq 9.2 \cdot 10^{-128}\right) \land F \leq 1.25 \cdot 10^{-102}\right):\\ \;\;\;\;\frac{\pi}{F} \cdot \frac{-\ell}{F}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell\\ \end{array} \end{array} \]
NOTE: F should be positive before calling this function
(FPCore (F l)
 :precision binary64
 (if (or (<= F 2.7e-232)
         (and (not (<= F 1.05e-161))
              (or (<= F 4.8e-150)
                  (and (not (<= F 9.2e-128)) (<= F 1.25e-102)))))
   (* (/ PI F) (/ (- l) F))
   (* PI l)))
F = abs(F);
double code(double F, double l) {
	double tmp;
	if ((F <= 2.7e-232) || (!(F <= 1.05e-161) && ((F <= 4.8e-150) || (!(F <= 9.2e-128) && (F <= 1.25e-102))))) {
		tmp = (((double) M_PI) / F) * (-l / F);
	} else {
		tmp = ((double) M_PI) * l;
	}
	return tmp;
}
F = Math.abs(F);
public static double code(double F, double l) {
	double tmp;
	if ((F <= 2.7e-232) || (!(F <= 1.05e-161) && ((F <= 4.8e-150) || (!(F <= 9.2e-128) && (F <= 1.25e-102))))) {
		tmp = (Math.PI / F) * (-l / F);
	} else {
		tmp = Math.PI * l;
	}
	return tmp;
}
F = abs(F)
def code(F, l):
	tmp = 0
	if (F <= 2.7e-232) or (not (F <= 1.05e-161) and ((F <= 4.8e-150) or (not (F <= 9.2e-128) and (F <= 1.25e-102)))):
		tmp = (math.pi / F) * (-l / F)
	else:
		tmp = math.pi * l
	return tmp
F = abs(F)
function code(F, l)
	tmp = 0.0
	if ((F <= 2.7e-232) || (!(F <= 1.05e-161) && ((F <= 4.8e-150) || (!(F <= 9.2e-128) && (F <= 1.25e-102)))))
		tmp = Float64(Float64(pi / F) * Float64(Float64(-l) / F));
	else
		tmp = Float64(pi * l);
	end
	return tmp
end
F = abs(F)
function tmp_2 = code(F, l)
	tmp = 0.0;
	if ((F <= 2.7e-232) || (~((F <= 1.05e-161)) && ((F <= 4.8e-150) || (~((F <= 9.2e-128)) && (F <= 1.25e-102)))))
		tmp = (pi / F) * (-l / F);
	else
		tmp = pi * l;
	end
	tmp_2 = tmp;
end
NOTE: F should be positive before calling this function
code[F_, l_] := If[Or[LessEqual[F, 2.7e-232], And[N[Not[LessEqual[F, 1.05e-161]], $MachinePrecision], Or[LessEqual[F, 4.8e-150], And[N[Not[LessEqual[F, 9.2e-128]], $MachinePrecision], LessEqual[F, 1.25e-102]]]]], N[(N[(Pi / F), $MachinePrecision] * N[((-l) / F), $MachinePrecision]), $MachinePrecision], N[(Pi * l), $MachinePrecision]]
\begin{array}{l}
F = |F|\\
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.7 \cdot 10^{-232} \lor \neg \left(F \leq 1.05 \cdot 10^{-161}\right) \land \left(F \leq 4.8 \cdot 10^{-150} \lor \neg \left(F \leq 9.2 \cdot 10^{-128}\right) \land F \leq 1.25 \cdot 10^{-102}\right):\\
\;\;\;\;\frac{\pi}{F} \cdot \frac{-\ell}{F}\\

\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 2.6999999999999999e-232 or 1.05e-161 < F < 4.8e-150 or 9.2000000000000003e-128 < F < 1.25000000000000006e-102

    1. Initial program 71.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\ell}{\frac{{F}^{2}}{\pi}}} \]
      3. unpow227.9%

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

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

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

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

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

    if 2.6999999999999999e-232 < F < 1.05e-161 or 4.8e-150 < F < 9.2000000000000003e-128 or 1.25000000000000006e-102 < F

    1. Initial program 82.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)} \]
    7. Taylor expanded in F around inf 83.9%

      \[\leadsto \color{blue}{\ell \cdot \pi} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 2.7 \cdot 10^{-232} \lor \neg \left(F \leq 1.05 \cdot 10^{-161}\right) \land \left(F \leq 4.8 \cdot 10^{-150} \lor \neg \left(F \leq 9.2 \cdot 10^{-128}\right) \land F \leq 1.25 \cdot 10^{-102}\right):\\ \;\;\;\;\frac{\pi}{F} \cdot \frac{-\ell}{F}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell\\ \end{array} \]

Alternative 11: 72.9% accurate, 3.0× speedup?

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)} \]
  7. Taylor expanded in F around inf 71.4%

    \[\leadsto \color{blue}{\ell \cdot \pi} \]
  8. Final simplification71.4%

    \[\leadsto \pi \cdot \ell \]

Reproduce

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