VandenBroeck and Keller, Equation (6)

Percentage Accurate: 76.6% → 99.1%
Time: 18.3s
Alternatives: 13
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 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.6% accurate, 1.0× speedup?

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

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

Alternative 1: 99.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -1 \cdot 10^{+17} \lor \neg \left(\pi \cdot \ell \leq 10000000\right):\\
\;\;\;\;\pi \cdot \ell\\

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


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

    1. Initial program 66.6%

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell - \left(\color{blue}{{F}^{-1}} \cdot \frac{1}{F}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      6. unpow-166.6%

        \[\leadsto \pi \cdot \ell - \left({F}^{-1} \cdot \color{blue}{{F}^{-1}}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      7. pow-sqr66.6%

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

        \[\leadsto \pi \cdot \ell - {F}^{\color{blue}{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    4. Simplified66.6%

      \[\leadsto \pi \cdot \ell - \color{blue}{{F}^{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    5. Taylor expanded in l around inf 99.6%

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

    if -1e17 < (*.f64 (PI.f64) l) < 1e7

    1. Initial program 90.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -1 \cdot 10^{+17} \lor \neg \left(\pi \cdot \ell \leq 10000000\right):\\
\;\;\;\;\pi \cdot \ell\\

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


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

    1. Initial program 66.6%

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell - \left(\color{blue}{{F}^{-1}} \cdot \frac{1}{F}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      6. unpow-166.6%

        \[\leadsto \pi \cdot \ell - \left({F}^{-1} \cdot \color{blue}{{F}^{-1}}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      7. pow-sqr66.6%

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

        \[\leadsto \pi \cdot \ell - {F}^{\color{blue}{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    4. Simplified66.6%

      \[\leadsto \pi \cdot \ell - \color{blue}{{F}^{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    5. Taylor expanded in l around inf 99.6%

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

    if -1e17 < (*.f64 (PI.f64) l) < 1e7

    1. Initial program 90.5%

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

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

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

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

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

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

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

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

Alternative 3: 99.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -1 \cdot 10^{+17} \lor \neg \left(\pi \cdot \ell \leq 10000000\right):\\
\;\;\;\;\pi \cdot \ell\\

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


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

    1. Initial program 66.6%

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell - \left(\color{blue}{{F}^{-1}} \cdot \frac{1}{F}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      6. unpow-166.6%

        \[\leadsto \pi \cdot \ell - \left({F}^{-1} \cdot \color{blue}{{F}^{-1}}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      7. pow-sqr66.6%

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

        \[\leadsto \pi \cdot \ell - {F}^{\color{blue}{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    4. Simplified66.6%

      \[\leadsto \pi \cdot \ell - \color{blue}{{F}^{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    5. Taylor expanded in l around inf 99.6%

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

    if -1e17 < (*.f64 (PI.f64) l) < 1e7

    1. Initial program 90.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 97.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -5 \lor \neg \left(\pi \cdot \ell \leq 4 \cdot 10^{-19}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell + \frac{\frac{-1}{F}}{F \cdot \frac{1}{\pi \cdot \ell}}\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (or (<= (* PI l) -5.0) (not (<= (* PI l) 4e-19)))
   (* PI l)
   (+ (* PI l) (/ (/ -1.0 F) (* F (/ 1.0 (* PI l)))))))
double code(double F, double l) {
	double tmp;
	if (((((double) M_PI) * l) <= -5.0) || !((((double) M_PI) * l) <= 4e-19)) {
		tmp = ((double) M_PI) * l;
	} else {
		tmp = (((double) M_PI) * l) + ((-1.0 / F) / (F * (1.0 / (((double) M_PI) * l))));
	}
	return tmp;
}
public static double code(double F, double l) {
	double tmp;
	if (((Math.PI * l) <= -5.0) || !((Math.PI * l) <= 4e-19)) {
		tmp = Math.PI * l;
	} else {
		tmp = (Math.PI * l) + ((-1.0 / F) / (F * (1.0 / (Math.PI * l))));
	}
	return tmp;
}
def code(F, l):
	tmp = 0
	if ((math.pi * l) <= -5.0) or not ((math.pi * l) <= 4e-19):
		tmp = math.pi * l
	else:
		tmp = (math.pi * l) + ((-1.0 / F) / (F * (1.0 / (math.pi * l))))
	return tmp
function code(F, l)
	tmp = 0.0
	if ((Float64(pi * l) <= -5.0) || !(Float64(pi * l) <= 4e-19))
		tmp = Float64(pi * l);
	else
		tmp = Float64(Float64(pi * l) + Float64(Float64(-1.0 / F) / Float64(F * Float64(1.0 / Float64(pi * l)))));
	end
	return tmp
end
function tmp_2 = code(F, l)
	tmp = 0.0;
	if (((pi * l) <= -5.0) || ~(((pi * l) <= 4e-19)))
		tmp = pi * l;
	else
		tmp = (pi * l) + ((-1.0 / F) / (F * (1.0 / (pi * l))));
	end
	tmp_2 = tmp;
end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -5.0], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 4e-19]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(N[(-1.0 / F), $MachinePrecision] / N[(F * N[(1.0 / N[(Pi * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -5 \lor \neg \left(\pi \cdot \ell \leq 4 \cdot 10^{-19}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


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

    1. Initial program 68.4%

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell - \left(\color{blue}{{F}^{-1}} \cdot \frac{1}{F}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      6. unpow-168.4%

        \[\leadsto \pi \cdot \ell - \left({F}^{-1} \cdot \color{blue}{{F}^{-1}}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      7. pow-sqr68.4%

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{{F}^{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    5. Taylor expanded in l around inf 98.1%

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

    if -5 < (*.f64 (PI.f64) l) < 3.9999999999999999e-19

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\tan \left(\pi \cdot \ell\right) \cdot \frac{1}{F}}}{\sqrt{-F} \cdot \sqrt{-F}} \]
      9. metadata-eval17.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -5 \lor \neg \left(\pi \cdot \ell \leq 4 \cdot 10^{-19}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell + \frac{\frac{-1}{F}}{F \cdot \frac{1}{\pi \cdot \ell}}\\ \end{array} \]

Alternative 5: 98.1% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 5.5 \cdot 10^{-12}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -0.5 or 5.5000000000000004e-12 < l

    1. Initial program 68.4%

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell - \left(\color{blue}{{F}^{-1}} \cdot \frac{1}{F}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      6. unpow-168.4%

        \[\leadsto \pi \cdot \ell - \left({F}^{-1} \cdot \color{blue}{{F}^{-1}}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      7. pow-sqr68.4%

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{{F}^{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    5. Taylor expanded in l around inf 98.1%

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

    if -0.5 < l < 5.5000000000000004e-12

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\tan \left(\pi \cdot \ell\right) \cdot \frac{1}{F}}}{\sqrt{-F} \cdot \sqrt{-F}} \]
      9. metadata-eval17.8%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 5.5 \cdot 10^{-12}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell + \frac{\frac{-1}{F}}{\frac{F}{\pi \cdot \ell}}\\ \end{array} \]

Alternative 6: 72.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.58 \cdot 10^{-54}:\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{elif}\;\ell \leq -2.25 \cdot 10^{-136}:\\ \;\;\;\;\ell \cdot \left({F}^{-2} \cdot \left(-\pi\right)\right)\\ \mathbf{elif}\;\ell \leq 2.2 \cdot 10^{-240} \lor \neg \left(\ell \leq 2.25 \cdot 10^{-46}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\frac{-\ell}{\frac{{F}^{2}}{\pi}}\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (<= l -1.58e-54)
   (* PI l)
   (if (<= l -2.25e-136)
     (* l (* (pow F -2.0) (- PI)))
     (if (or (<= l 2.2e-240) (not (<= l 2.25e-46)))
       (* PI l)
       (/ (- l) (/ (pow F 2.0) PI))))))
double code(double F, double l) {
	double tmp;
	if (l <= -1.58e-54) {
		tmp = ((double) M_PI) * l;
	} else if (l <= -2.25e-136) {
		tmp = l * (pow(F, -2.0) * -((double) M_PI));
	} else if ((l <= 2.2e-240) || !(l <= 2.25e-46)) {
		tmp = ((double) M_PI) * l;
	} else {
		tmp = -l / (pow(F, 2.0) / ((double) M_PI));
	}
	return tmp;
}
public static double code(double F, double l) {
	double tmp;
	if (l <= -1.58e-54) {
		tmp = Math.PI * l;
	} else if (l <= -2.25e-136) {
		tmp = l * (Math.pow(F, -2.0) * -Math.PI);
	} else if ((l <= 2.2e-240) || !(l <= 2.25e-46)) {
		tmp = Math.PI * l;
	} else {
		tmp = -l / (Math.pow(F, 2.0) / Math.PI);
	}
	return tmp;
}
def code(F, l):
	tmp = 0
	if l <= -1.58e-54:
		tmp = math.pi * l
	elif l <= -2.25e-136:
		tmp = l * (math.pow(F, -2.0) * -math.pi)
	elif (l <= 2.2e-240) or not (l <= 2.25e-46):
		tmp = math.pi * l
	else:
		tmp = -l / (math.pow(F, 2.0) / math.pi)
	return tmp
function code(F, l)
	tmp = 0.0
	if (l <= -1.58e-54)
		tmp = Float64(pi * l);
	elseif (l <= -2.25e-136)
		tmp = Float64(l * Float64((F ^ -2.0) * Float64(-pi)));
	elseif ((l <= 2.2e-240) || !(l <= 2.25e-46))
		tmp = Float64(pi * l);
	else
		tmp = Float64(Float64(-l) / Float64((F ^ 2.0) / pi));
	end
	return tmp
end
function tmp_2 = code(F, l)
	tmp = 0.0;
	if (l <= -1.58e-54)
		tmp = pi * l;
	elseif (l <= -2.25e-136)
		tmp = l * ((F ^ -2.0) * -pi);
	elseif ((l <= 2.2e-240) || ~((l <= 2.25e-46)))
		tmp = pi * l;
	else
		tmp = -l / ((F ^ 2.0) / pi);
	end
	tmp_2 = tmp;
end
code[F_, l_] := If[LessEqual[l, -1.58e-54], N[(Pi * l), $MachinePrecision], If[LessEqual[l, -2.25e-136], N[(l * N[(N[Power[F, -2.0], $MachinePrecision] * (-Pi)), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 2.2e-240], N[Not[LessEqual[l, 2.25e-46]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[((-l) / N[(N[Power[F, 2.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.58 \cdot 10^{-54}:\\
\;\;\;\;\pi \cdot \ell\\

\mathbf{elif}\;\ell \leq -2.25 \cdot 10^{-136}:\\
\;\;\;\;\ell \cdot \left({F}^{-2} \cdot \left(-\pi\right)\right)\\

\mathbf{elif}\;\ell \leq 2.2 \cdot 10^{-240} \lor \neg \left(\ell \leq 2.25 \cdot 10^{-46}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -1.57999999999999989e-54 or -2.24999999999999986e-136 < l < 2.1999999999999999e-240 or 2.25e-46 < l

    1. Initial program 74.6%

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell - \left(\color{blue}{{F}^{-1}} \cdot \frac{1}{F}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      6. unpow-174.5%

        \[\leadsto \pi \cdot \ell - \left({F}^{-1} \cdot \color{blue}{{F}^{-1}}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      7. pow-sqr74.6%

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

        \[\leadsto \pi \cdot \ell - {F}^{\color{blue}{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    4. Simplified74.6%

      \[\leadsto \pi \cdot \ell - \color{blue}{{F}^{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    5. Taylor expanded in l around inf 86.7%

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

    if -1.57999999999999989e-54 < l < -2.24999999999999986e-136

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\ell}{\frac{{F}^{2}}{\pi}}} \]
      3. distribute-neg-frac70.7%

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

        \[\leadsto \frac{-\ell}{\frac{\color{blue}{F \cdot F}}{\pi}} \]
      5. sqr-neg70.7%

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

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

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

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

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

        \[\leadsto -\frac{\ell}{\color{blue}{\frac{F}{\pi} \cdot F}} \]
      11. associate-/l/74.6%

        \[\leadsto -\color{blue}{\frac{\frac{\ell}{F}}{\frac{F}{\pi}}} \]
      12. remove-double-neg74.6%

        \[\leadsto -\frac{\frac{\color{blue}{-\left(-\ell\right)}}{F}}{\frac{F}{\pi}} \]
      13. neg-mul-174.6%

        \[\leadsto -\frac{\frac{-\color{blue}{-1 \cdot \ell}}{F}}{\frac{F}{\pi}} \]
      14. distribute-lft-neg-in74.6%

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

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

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

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

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

    if 2.1999999999999999e-240 < l < 2.25e-46

    1. Initial program 89.1%

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

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

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

        \[\leadsto \pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{\color{blue}{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 89.1%

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

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

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

        \[\leadsto -\color{blue}{\frac{\ell}{\frac{{F}^{2}}{\pi}}} \]
    7. Simplified55.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.58 \cdot 10^{-54}:\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{elif}\;\ell \leq -2.25 \cdot 10^{-136}:\\ \;\;\;\;\ell \cdot \left({F}^{-2} \cdot \left(-\pi\right)\right)\\ \mathbf{elif}\;\ell \leq 2.2 \cdot 10^{-240} \lor \neg \left(\ell \leq 2.25 \cdot 10^{-46}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\frac{-\ell}{\frac{{F}^{2}}{\pi}}\\ \end{array} \]

Alternative 7: 72.3% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.58 \cdot 10^{-54}:\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{elif}\;\ell \leq -1.36 \cdot 10^{-135}:\\ \;\;\;\;\ell \cdot \left({F}^{-2} \cdot \left(-\pi\right)\right)\\ \mathbf{elif}\;\ell \leq 3.15 \cdot 10^{-251} \lor \neg \left(\ell \leq 2.6 \cdot 10^{-46}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \frac{-\ell}{{F}^{2}}\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (<= l -1.58e-54)
   (* PI l)
   (if (<= l -1.36e-135)
     (* l (* (pow F -2.0) (- PI)))
     (if (or (<= l 3.15e-251) (not (<= l 2.6e-46)))
       (* PI l)
       (* PI (/ (- l) (pow F 2.0)))))))
double code(double F, double l) {
	double tmp;
	if (l <= -1.58e-54) {
		tmp = ((double) M_PI) * l;
	} else if (l <= -1.36e-135) {
		tmp = l * (pow(F, -2.0) * -((double) M_PI));
	} else if ((l <= 3.15e-251) || !(l <= 2.6e-46)) {
		tmp = ((double) M_PI) * l;
	} else {
		tmp = ((double) M_PI) * (-l / pow(F, 2.0));
	}
	return tmp;
}
public static double code(double F, double l) {
	double tmp;
	if (l <= -1.58e-54) {
		tmp = Math.PI * l;
	} else if (l <= -1.36e-135) {
		tmp = l * (Math.pow(F, -2.0) * -Math.PI);
	} else if ((l <= 3.15e-251) || !(l <= 2.6e-46)) {
		tmp = Math.PI * l;
	} else {
		tmp = Math.PI * (-l / Math.pow(F, 2.0));
	}
	return tmp;
}
def code(F, l):
	tmp = 0
	if l <= -1.58e-54:
		tmp = math.pi * l
	elif l <= -1.36e-135:
		tmp = l * (math.pow(F, -2.0) * -math.pi)
	elif (l <= 3.15e-251) or not (l <= 2.6e-46):
		tmp = math.pi * l
	else:
		tmp = math.pi * (-l / math.pow(F, 2.0))
	return tmp
function code(F, l)
	tmp = 0.0
	if (l <= -1.58e-54)
		tmp = Float64(pi * l);
	elseif (l <= -1.36e-135)
		tmp = Float64(l * Float64((F ^ -2.0) * Float64(-pi)));
	elseif ((l <= 3.15e-251) || !(l <= 2.6e-46))
		tmp = Float64(pi * l);
	else
		tmp = Float64(pi * Float64(Float64(-l) / (F ^ 2.0)));
	end
	return tmp
end
function tmp_2 = code(F, l)
	tmp = 0.0;
	if (l <= -1.58e-54)
		tmp = pi * l;
	elseif (l <= -1.36e-135)
		tmp = l * ((F ^ -2.0) * -pi);
	elseif ((l <= 3.15e-251) || ~((l <= 2.6e-46)))
		tmp = pi * l;
	else
		tmp = pi * (-l / (F ^ 2.0));
	end
	tmp_2 = tmp;
end
code[F_, l_] := If[LessEqual[l, -1.58e-54], N[(Pi * l), $MachinePrecision], If[LessEqual[l, -1.36e-135], N[(l * N[(N[Power[F, -2.0], $MachinePrecision] * (-Pi)), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 3.15e-251], N[Not[LessEqual[l, 2.6e-46]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(Pi * N[((-l) / N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.58 \cdot 10^{-54}:\\
\;\;\;\;\pi \cdot \ell\\

\mathbf{elif}\;\ell \leq -1.36 \cdot 10^{-135}:\\
\;\;\;\;\ell \cdot \left({F}^{-2} \cdot \left(-\pi\right)\right)\\

\mathbf{elif}\;\ell \leq 3.15 \cdot 10^{-251} \lor \neg \left(\ell \leq 2.6 \cdot 10^{-46}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -1.57999999999999989e-54 or -1.36e-135 < l < 3.1499999999999999e-251 or 2.6000000000000002e-46 < l

    1. Initial program 74.6%

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell - \left(\color{blue}{{F}^{-1}} \cdot \frac{1}{F}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      6. unpow-174.5%

        \[\leadsto \pi \cdot \ell - \left({F}^{-1} \cdot \color{blue}{{F}^{-1}}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      7. pow-sqr74.6%

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

        \[\leadsto \pi \cdot \ell - {F}^{\color{blue}{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    4. Simplified74.6%

      \[\leadsto \pi \cdot \ell - \color{blue}{{F}^{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    5. Taylor expanded in l around inf 86.7%

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

    if -1.57999999999999989e-54 < l < -1.36e-135

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\ell}{\frac{{F}^{2}}{\pi}}} \]
      3. distribute-neg-frac70.7%

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

        \[\leadsto \frac{-\ell}{\frac{\color{blue}{F \cdot F}}{\pi}} \]
      5. sqr-neg70.7%

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

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

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

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

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

        \[\leadsto -\frac{\ell}{\color{blue}{\frac{F}{\pi} \cdot F}} \]
      11. associate-/l/74.6%

        \[\leadsto -\color{blue}{\frac{\frac{\ell}{F}}{\frac{F}{\pi}}} \]
      12. remove-double-neg74.6%

        \[\leadsto -\frac{\frac{\color{blue}{-\left(-\ell\right)}}{F}}{\frac{F}{\pi}} \]
      13. neg-mul-174.6%

        \[\leadsto -\frac{\frac{-\color{blue}{-1 \cdot \ell}}{F}}{\frac{F}{\pi}} \]
      14. distribute-lft-neg-in74.6%

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

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

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

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

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

    if 3.1499999999999999e-251 < l < 2.6000000000000002e-46

    1. Initial program 89.1%

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

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

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

        \[\leadsto \pi \cdot \ell - \frac{\tan \left(\pi \cdot \ell\right)}{\color{blue}{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 90.9%

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

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\ell \cdot \pi}{F}}{F}} \]
      2. div-inv99.5%

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

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

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

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell \cdot \frac{1}{F}}{\frac{F}{\pi}}} \]
      2. div-inv99.4%

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\ell}{\frac{{F}^{2}}{\pi}}} \]
      3. distribute-frac-neg55.8%

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

        \[\leadsto \color{blue}{\frac{-\ell}{{F}^{2}} \cdot \pi} \]
    11. Simplified55.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.58 \cdot 10^{-54}:\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{elif}\;\ell \leq -1.36 \cdot 10^{-135}:\\ \;\;\;\;\ell \cdot \left({F}^{-2} \cdot \left(-\pi\right)\right)\\ \mathbf{elif}\;\ell \leq 3.15 \cdot 10^{-251} \lor \neg \left(\ell \leq 2.6 \cdot 10^{-46}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \frac{-\ell}{{F}^{2}}\\ \end{array} \]

Alternative 8: 98.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 5.5 \cdot 10^{-12}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\ell}{F} \cdot \frac{\pi}{F}\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (or (<= l -0.5) (not (<= l 5.5e-12)))
   (* PI l)
   (- (* PI l) (* (/ l F) (/ PI F)))))
double code(double F, double l) {
	double tmp;
	if ((l <= -0.5) || !(l <= 5.5e-12)) {
		tmp = ((double) M_PI) * l;
	} else {
		tmp = (((double) M_PI) * l) - ((l / F) * (((double) M_PI) / F));
	}
	return tmp;
}
public static double code(double F, double l) {
	double tmp;
	if ((l <= -0.5) || !(l <= 5.5e-12)) {
		tmp = Math.PI * l;
	} else {
		tmp = (Math.PI * l) - ((l / F) * (Math.PI / F));
	}
	return tmp;
}
def code(F, l):
	tmp = 0
	if (l <= -0.5) or not (l <= 5.5e-12):
		tmp = math.pi * l
	else:
		tmp = (math.pi * l) - ((l / F) * (math.pi / F))
	return tmp
function code(F, l)
	tmp = 0.0
	if ((l <= -0.5) || !(l <= 5.5e-12))
		tmp = Float64(pi * l);
	else
		tmp = Float64(Float64(pi * l) - Float64(Float64(l / F) * Float64(pi / F)));
	end
	return tmp
end
function tmp_2 = code(F, l)
	tmp = 0.0;
	if ((l <= -0.5) || ~((l <= 5.5e-12)))
		tmp = pi * l;
	else
		tmp = (pi * l) - ((l / F) * (pi / F));
	end
	tmp_2 = tmp;
end
code[F_, l_] := If[Or[LessEqual[l, -0.5], N[Not[LessEqual[l, 5.5e-12]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(l / F), $MachinePrecision] * N[(Pi / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 5.5 \cdot 10^{-12}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -0.5 or 5.5000000000000004e-12 < l

    1. Initial program 68.4%

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell - \left(\color{blue}{{F}^{-1}} \cdot \frac{1}{F}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      6. unpow-168.4%

        \[\leadsto \pi \cdot \ell - \left({F}^{-1} \cdot \color{blue}{{F}^{-1}}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      7. pow-sqr68.4%

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{{F}^{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    5. Taylor expanded in l around inf 98.1%

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

    if -0.5 < l < 5.5000000000000004e-12

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

Alternative 9: 98.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 5.5 \cdot 10^{-12}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\pi \cdot \frac{\ell}{F}}{F}\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (or (<= l -0.5) (not (<= l 5.5e-12)))
   (* PI l)
   (- (* PI l) (/ (* PI (/ l F)) F))))
double code(double F, double l) {
	double tmp;
	if ((l <= -0.5) || !(l <= 5.5e-12)) {
		tmp = ((double) M_PI) * l;
	} else {
		tmp = (((double) M_PI) * l) - ((((double) M_PI) * (l / F)) / F);
	}
	return tmp;
}
public static double code(double F, double l) {
	double tmp;
	if ((l <= -0.5) || !(l <= 5.5e-12)) {
		tmp = Math.PI * l;
	} else {
		tmp = (Math.PI * l) - ((Math.PI * (l / F)) / F);
	}
	return tmp;
}
def code(F, l):
	tmp = 0
	if (l <= -0.5) or not (l <= 5.5e-12):
		tmp = math.pi * l
	else:
		tmp = (math.pi * l) - ((math.pi * (l / F)) / F)
	return tmp
function code(F, l)
	tmp = 0.0
	if ((l <= -0.5) || !(l <= 5.5e-12))
		tmp = Float64(pi * l);
	else
		tmp = Float64(Float64(pi * l) - Float64(Float64(pi * Float64(l / F)) / F));
	end
	return tmp
end
function tmp_2 = code(F, l)
	tmp = 0.0;
	if ((l <= -0.5) || ~((l <= 5.5e-12)))
		tmp = pi * l;
	else
		tmp = (pi * l) - ((pi * (l / F)) / F);
	end
	tmp_2 = tmp;
end
code[F_, l_] := If[Or[LessEqual[l, -0.5], N[Not[LessEqual[l, 5.5e-12]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(Pi * N[(l / F), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 5.5 \cdot 10^{-12}\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 < -0.5 or 5.5000000000000004e-12 < l

    1. Initial program 68.4%

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell - \left(\color{blue}{{F}^{-1}} \cdot \frac{1}{F}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      6. unpow-168.4%

        \[\leadsto \pi \cdot \ell - \left({F}^{-1} \cdot \color{blue}{{F}^{-1}}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      7. pow-sqr68.4%

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{{F}^{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    5. Taylor expanded in l around inf 98.1%

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

    if -0.5 < l < 5.5000000000000004e-12

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 98.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 5.5 \cdot 10^{-12}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\ell}{F}}{\frac{F}{\pi}}\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (or (<= l -0.5) (not (<= l 5.5e-12)))
   (* PI l)
   (- (* PI l) (/ (/ l F) (/ F PI)))))
double code(double F, double l) {
	double tmp;
	if ((l <= -0.5) || !(l <= 5.5e-12)) {
		tmp = ((double) M_PI) * l;
	} else {
		tmp = (((double) M_PI) * l) - ((l / F) / (F / ((double) M_PI)));
	}
	return tmp;
}
public static double code(double F, double l) {
	double tmp;
	if ((l <= -0.5) || !(l <= 5.5e-12)) {
		tmp = Math.PI * l;
	} else {
		tmp = (Math.PI * l) - ((l / F) / (F / Math.PI));
	}
	return tmp;
}
def code(F, l):
	tmp = 0
	if (l <= -0.5) or not (l <= 5.5e-12):
		tmp = math.pi * l
	else:
		tmp = (math.pi * l) - ((l / F) / (F / math.pi))
	return tmp
function code(F, l)
	tmp = 0.0
	if ((l <= -0.5) || !(l <= 5.5e-12))
		tmp = Float64(pi * l);
	else
		tmp = Float64(Float64(pi * l) - Float64(Float64(l / F) / Float64(F / pi)));
	end
	return tmp
end
function tmp_2 = code(F, l)
	tmp = 0.0;
	if ((l <= -0.5) || ~((l <= 5.5e-12)))
		tmp = pi * l;
	else
		tmp = (pi * l) - ((l / F) / (F / pi));
	end
	tmp_2 = tmp;
end
code[F_, l_] := If[Or[LessEqual[l, -0.5], N[Not[LessEqual[l, 5.5e-12]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(N[(l / F), $MachinePrecision] / N[(F / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 5.5 \cdot 10^{-12}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -0.5 or 5.5000000000000004e-12 < l

    1. Initial program 68.4%

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell - \left(\color{blue}{{F}^{-1}} \cdot \frac{1}{F}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      6. unpow-168.4%

        \[\leadsto \pi \cdot \ell - \left({F}^{-1} \cdot \color{blue}{{F}^{-1}}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      7. pow-sqr68.4%

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{{F}^{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    5. Taylor expanded in l around inf 98.1%

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

    if -0.5 < l < 5.5000000000000004e-12

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 46.7% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 2.4 \cdot 10^{-259} \lor \neg \left(F \leq 5.5 \cdot 10^{-46}\right) \land F \leq 8.6 \cdot 10^{-5}:\\ \;\;\;\;\frac{-\ell}{\frac{{F}^{2}}{\pi}}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (or (<= F 2.4e-259) (and (not (<= F 5.5e-46)) (<= F 8.6e-5)))
   (/ (- l) (/ (pow F 2.0) PI))
   (* PI l)))
double code(double F, double l) {
	double tmp;
	if ((F <= 2.4e-259) || (!(F <= 5.5e-46) && (F <= 8.6e-5))) {
		tmp = -l / (pow(F, 2.0) / ((double) M_PI));
	} else {
		tmp = ((double) M_PI) * l;
	}
	return tmp;
}
public static double code(double F, double l) {
	double tmp;
	if ((F <= 2.4e-259) || (!(F <= 5.5e-46) && (F <= 8.6e-5))) {
		tmp = -l / (Math.pow(F, 2.0) / Math.PI);
	} else {
		tmp = Math.PI * l;
	}
	return tmp;
}
def code(F, l):
	tmp = 0
	if (F <= 2.4e-259) or (not (F <= 5.5e-46) and (F <= 8.6e-5)):
		tmp = -l / (math.pow(F, 2.0) / math.pi)
	else:
		tmp = math.pi * l
	return tmp
function code(F, l)
	tmp = 0.0
	if ((F <= 2.4e-259) || (!(F <= 5.5e-46) && (F <= 8.6e-5)))
		tmp = Float64(Float64(-l) / Float64((F ^ 2.0) / pi));
	else
		tmp = Float64(pi * l);
	end
	return tmp
end
function tmp_2 = code(F, l)
	tmp = 0.0;
	if ((F <= 2.4e-259) || (~((F <= 5.5e-46)) && (F <= 8.6e-5)))
		tmp = -l / ((F ^ 2.0) / pi);
	else
		tmp = pi * l;
	end
	tmp_2 = tmp;
end
code[F_, l_] := If[Or[LessEqual[F, 2.4e-259], And[N[Not[LessEqual[F, 5.5e-46]], $MachinePrecision], LessEqual[F, 8.6e-5]]], N[((-l) / N[(N[Power[F, 2.0], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision], N[(Pi * l), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.4 \cdot 10^{-259} \lor \neg \left(F \leq 5.5 \cdot 10^{-46}\right) \land F \leq 8.6 \cdot 10^{-5}:\\
\;\;\;\;\frac{-\ell}{\frac{{F}^{2}}{\pi}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 2.4000000000000001e-259 or 5.49999999999999983e-46 < F < 8.6000000000000003e-5

    1. Initial program 79.2%

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\ell}{\frac{{F}^{2}}{\pi}}} \]
    7. Simplified31.7%

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

    if 2.4000000000000001e-259 < F < 5.49999999999999983e-46 or 8.6000000000000003e-5 < F

    1. Initial program 78.6%

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell - \left(\color{blue}{{F}^{-1}} \cdot \frac{1}{F}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      6. unpow-178.6%

        \[\leadsto \pi \cdot \ell - \left({F}^{-1} \cdot \color{blue}{{F}^{-1}}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      7. pow-sqr78.7%

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

        \[\leadsto \pi \cdot \ell - {F}^{\color{blue}{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    4. Simplified78.7%

      \[\leadsto \pi \cdot \ell - \color{blue}{{F}^{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    5. Taylor expanded in l around inf 83.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 2.4 \cdot 10^{-259} \lor \neg \left(F \leq 5.5 \cdot 10^{-46}\right) \land F \leq 8.6 \cdot 10^{-5}:\\ \;\;\;\;\frac{-\ell}{\frac{{F}^{2}}{\pi}}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell\\ \end{array} \]

Alternative 12: 92.2% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 5.5 \cdot 10^{-12}\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 < -0.5 or 5.5000000000000004e-12 < l

    1. Initial program 68.4%

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell - \left(\color{blue}{{F}^{-1}} \cdot \frac{1}{F}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      6. unpow-168.4%

        \[\leadsto \pi \cdot \ell - \left({F}^{-1} \cdot \color{blue}{{F}^{-1}}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
      7. pow-sqr68.4%

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{{F}^{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    5. Taylor expanded in l around inf 98.1%

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

    if -0.5 < l < 5.5000000000000004e-12

    1. Initial program 90.1%

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{\ell \cdot \pi}{{F}^{2}} + \ell \cdot \pi} \]
    6. Simplified90.0%

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

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

Alternative 13: 74.0% accurate, 3.0× speedup?

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

\\
\pi \cdot \ell
\end{array}
Derivation
  1. Initial program 79.0%

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

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

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

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

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

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

      \[\leadsto \pi \cdot \ell - \left(\color{blue}{{F}^{-1}} \cdot \frac{1}{F}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
    6. unpow-178.9%

      \[\leadsto \pi \cdot \ell - \left({F}^{-1} \cdot \color{blue}{{F}^{-1}}\right) \cdot \tan \left(\pi \cdot \ell\right) \]
    7. pow-sqr79.0%

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

      \[\leadsto \pi \cdot \ell - {F}^{\color{blue}{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
  4. Simplified79.0%

    \[\leadsto \pi \cdot \ell - \color{blue}{{F}^{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
  5. Taylor expanded in l around inf 72.8%

    \[\leadsto \color{blue}{\ell \cdot \pi} \]
  6. Final simplification72.8%

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

Reproduce

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