VandenBroeck and Keller, Equation (6)

Percentage Accurate: 77.2% → 99.0%
Time: 23.8s
Alternatives: 11
Speedup: 2.7×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 77.2% 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.0% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 56.9%

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

        \[\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/56.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-identity56.9%

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

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

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

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

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

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

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

    if -5.0000000000000001e26 < (*.f64 (PI.f64) l) < 2e11

    1. Initial program 86.7%

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

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

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

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

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

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

Alternative 2: 97.7% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (PI.f64) l) < -5.0000000000000001e26 or 5.0000000000000004e-16 < (*.f64 (PI.f64) l)

    1. Initial program 58.5%

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

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

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

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

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

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

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

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

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

    if -5.0000000000000001e26 < (*.f64 (PI.f64) l) < 5.0000000000000004e-16

    1. Initial program 86.4%

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

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

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

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

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

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

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

Alternative 3: 92.5% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.8 \cdot 10^{+22} \lor \neg \left(\ell \leq 1.25 \cdot 10^{-15}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \pi \cdot \frac{\ell}{F \cdot F}\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (or (<= l -1.8e+22) (not (<= l 1.25e-15)))
   (* PI l)
   (- (* PI l) (* PI (/ l (* F F))))))
double code(double F, double l) {
	double tmp;
	if ((l <= -1.8e+22) || !(l <= 1.25e-15)) {
		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 <= -1.8e+22) || !(l <= 1.25e-15)) {
		tmp = Math.PI * l;
	} else {
		tmp = (Math.PI * l) - (Math.PI * (l / (F * F)));
	}
	return tmp;
}
def code(F, l):
	tmp = 0
	if (l <= -1.8e+22) or not (l <= 1.25e-15):
		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 <= -1.8e+22) || !(l <= 1.25e-15))
		tmp = Float64(pi * l);
	else
		tmp = Float64(Float64(pi * l) - Float64(pi * Float64(l / Float64(F * F))));
	end
	return tmp
end
function tmp_2 = code(F, l)
	tmp = 0.0;
	if ((l <= -1.8e+22) || ~((l <= 1.25e-15)))
		tmp = pi * l;
	else
		tmp = (pi * l) - (pi * (l / (F * F)));
	end
	tmp_2 = tmp;
end
code[F_, l_] := If[Or[LessEqual[l, -1.8e+22], N[Not[LessEqual[l, 1.25e-15]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(Pi * N[(l / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.8 \cdot 10^{+22} \lor \neg \left(\ell \leq 1.25 \cdot 10^{-15}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.8e22 or 1.25e-15 < l

    1. Initial program 58.5%

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

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

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

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

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

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

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

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

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

    if -1.8e22 < l < 1.25e-15

    1. Initial program 86.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.8 \cdot 10^{+22} \lor \neg \left(\ell \leq 1.25 \cdot 10^{-15}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \pi \cdot \frac{\ell}{F \cdot F}\\ \end{array} \]

Alternative 4: 97.9% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.8 \cdot 10^{+22} \lor \neg \left(\ell \leq 1.25 \cdot 10^{-15}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.8e22 or 1.25e-15 < l

    1. Initial program 58.5%

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

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

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

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

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

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

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

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

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

    if -1.8e22 < l < 1.25e-15

    1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.8 \cdot 10^{+22} \lor \neg \left(\ell \leq 1.25 \cdot 10^{-15}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\pi}{F} \cdot \frac{\ell}{F}\\ \end{array} \]

Alternative 5: 92.2% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.8 \cdot 10^{+22} \lor \neg \left(\ell \leq 1.25 \cdot 10^{-15}\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 -1.8e+22) (not (<= l 1.25e-15)))
   (* PI l)
   (* l (* PI (- 1.0 (pow F -2.0))))))
double code(double F, double l) {
	double tmp;
	if ((l <= -1.8e+22) || !(l <= 1.25e-15)) {
		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 <= -1.8e+22) || !(l <= 1.25e-15)) {
		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 <= -1.8e+22) or not (l <= 1.25e-15):
		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 <= -1.8e+22) || !(l <= 1.25e-15))
		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 <= -1.8e+22) || ~((l <= 1.25e-15)))
		tmp = pi * l;
	else
		tmp = l * (pi * (1.0 - (F ^ -2.0)));
	end
	tmp_2 = tmp;
end
code[F_, l_] := If[Or[LessEqual[l, -1.8e+22], N[Not[LessEqual[l, 1.25e-15]], $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 -1.8 \cdot 10^{+22} \lor \neg \left(\ell \leq 1.25 \cdot 10^{-15}\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 < -1.8e22 or 1.25e-15 < l

    1. Initial program 58.5%

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

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

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

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

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

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

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

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

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

    if -1.8e22 < l < 1.25e-15

    1. Initial program 86.4%

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

        \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{\left(-F\right) \cdot \left(-F\right)}} \cdot \tan \left(\pi \cdot \ell\right) \]
      2. associate-*l/87.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-identity87.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell + \ell \cdot \left(-\color{blue}{\pi \cdot \frac{1}{F \cdot F}}\right) \]
      5. distribute-rgt-neg-in86.5%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.8 \cdot 10^{+22} \lor \neg \left(\ell \leq 1.25 \cdot 10^{-15}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \left(\pi \cdot \left(1 - {F}^{-2}\right)\right)\\ \end{array} \]

Alternative 6: 92.2% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.8 \cdot 10^{+22} \lor \neg \left(\ell \leq 1.25 \cdot 10^{-15}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.8e22 or 1.25e-15 < l

    1. Initial program 58.5%

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

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

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

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

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

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

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

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

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

    if -1.8e22 < l < 1.25e-15

    1. Initial program 86.4%

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

        \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{\left(-F\right) \cdot \left(-F\right)}} \cdot \tan \left(\pi \cdot \ell\right) \]
      2. associate-*l/87.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-identity87.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.8 \cdot 10^{+22} \lor \neg \left(\ell \leq 1.25 \cdot 10^{-15}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\right)\\ \end{array} \]

Alternative 7: 74.2% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \ell \cdot \frac{-\pi}{F \cdot F}\\ \mathbf{if}\;\ell \leq -118000:\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{elif}\;\ell \leq -7 \cdot 10^{-92}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;\ell \leq -2.4 \cdot 10^{-203}:\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{elif}\;\ell \leq 2.95 \cdot 10^{-183}:\\ \;\;\;\;\frac{\pi}{\left(-F\right) \cdot \frac{F}{\ell}}\\ \mathbf{elif}\;\ell \leq 2.9 \cdot 10^{-116} \lor \neg \left(\ell \leq 3.4 \cdot 10^{-16}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (let* ((t_0 (* l (/ (- PI) (* F F)))))
   (if (<= l -118000.0)
     (* PI l)
     (if (<= l -7e-92)
       t_0
       (if (<= l -2.4e-203)
         (* PI l)
         (if (<= l 2.95e-183)
           (/ PI (* (- F) (/ F l)))
           (if (or (<= l 2.9e-116) (not (<= l 3.4e-16))) (* PI l) t_0)))))))
double code(double F, double l) {
	double t_0 = l * (-((double) M_PI) / (F * F));
	double tmp;
	if (l <= -118000.0) {
		tmp = ((double) M_PI) * l;
	} else if (l <= -7e-92) {
		tmp = t_0;
	} else if (l <= -2.4e-203) {
		tmp = ((double) M_PI) * l;
	} else if (l <= 2.95e-183) {
		tmp = ((double) M_PI) / (-F * (F / l));
	} else if ((l <= 2.9e-116) || !(l <= 3.4e-16)) {
		tmp = ((double) M_PI) * l;
	} else {
		tmp = t_0;
	}
	return tmp;
}
public static double code(double F, double l) {
	double t_0 = l * (-Math.PI / (F * F));
	double tmp;
	if (l <= -118000.0) {
		tmp = Math.PI * l;
	} else if (l <= -7e-92) {
		tmp = t_0;
	} else if (l <= -2.4e-203) {
		tmp = Math.PI * l;
	} else if (l <= 2.95e-183) {
		tmp = Math.PI / (-F * (F / l));
	} else if ((l <= 2.9e-116) || !(l <= 3.4e-16)) {
		tmp = Math.PI * l;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(F, l):
	t_0 = l * (-math.pi / (F * F))
	tmp = 0
	if l <= -118000.0:
		tmp = math.pi * l
	elif l <= -7e-92:
		tmp = t_0
	elif l <= -2.4e-203:
		tmp = math.pi * l
	elif l <= 2.95e-183:
		tmp = math.pi / (-F * (F / l))
	elif (l <= 2.9e-116) or not (l <= 3.4e-16):
		tmp = math.pi * l
	else:
		tmp = t_0
	return tmp
function code(F, l)
	t_0 = Float64(l * Float64(Float64(-pi) / Float64(F * F)))
	tmp = 0.0
	if (l <= -118000.0)
		tmp = Float64(pi * l);
	elseif (l <= -7e-92)
		tmp = t_0;
	elseif (l <= -2.4e-203)
		tmp = Float64(pi * l);
	elseif (l <= 2.95e-183)
		tmp = Float64(pi / Float64(Float64(-F) * Float64(F / l)));
	elseif ((l <= 2.9e-116) || !(l <= 3.4e-16))
		tmp = Float64(pi * l);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(F, l)
	t_0 = l * (-pi / (F * F));
	tmp = 0.0;
	if (l <= -118000.0)
		tmp = pi * l;
	elseif (l <= -7e-92)
		tmp = t_0;
	elseif (l <= -2.4e-203)
		tmp = pi * l;
	elseif (l <= 2.95e-183)
		tmp = pi / (-F * (F / l));
	elseif ((l <= 2.9e-116) || ~((l <= 3.4e-16)))
		tmp = pi * l;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[F_, l_] := Block[{t$95$0 = N[(l * N[((-Pi) / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -118000.0], N[(Pi * l), $MachinePrecision], If[LessEqual[l, -7e-92], t$95$0, If[LessEqual[l, -2.4e-203], N[(Pi * l), $MachinePrecision], If[LessEqual[l, 2.95e-183], N[(Pi / N[((-F) * N[(F / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[l, 2.9e-116], N[Not[LessEqual[l, 3.4e-16]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \ell \cdot \frac{-\pi}{F \cdot F}\\
\mathbf{if}\;\ell \leq -118000:\\
\;\;\;\;\pi \cdot \ell\\

\mathbf{elif}\;\ell \leq -7 \cdot 10^{-92}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;\ell \leq -2.4 \cdot 10^{-203}:\\
\;\;\;\;\pi \cdot \ell\\

\mathbf{elif}\;\ell \leq 2.95 \cdot 10^{-183}:\\
\;\;\;\;\frac{\pi}{\left(-F\right) \cdot \frac{F}{\ell}}\\

\mathbf{elif}\;\ell \leq 2.9 \cdot 10^{-116} \lor \neg \left(\ell \leq 3.4 \cdot 10^{-16}\right):\\
\;\;\;\;\pi \cdot \ell\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -118000 or -7e-92 < l < -2.3999999999999999e-203 or 2.94999999999999992e-183 < l < 2.8999999999999998e-116 or 3.4e-16 < l

    1. Initial program 65.8%

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

        \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{\left(-F\right) \cdot \left(-F\right)}} \cdot \tan \left(\pi \cdot \ell\right) \]
      2. associate-*l/66.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-identity66.0%

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

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

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

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

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

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

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

    if -118000 < l < -7e-92 or 2.8999999999999998e-116 < l < 3.4e-16

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \color{blue}{\frac{-1 \cdot \pi}{{F}^{2}}} \]
      2. neg-mul-166.6%

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

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

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

    if -2.3999999999999999e-203 < l < 2.94999999999999992e-183

    1. Initial program 73.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \color{blue}{\frac{-1 \cdot \pi}{{F}^{2}}} \]
      2. neg-mul-139.4%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\ell}{\frac{F \cdot F}{-\pi}}} \]
      3. add-sqr-sqrt0.0%

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

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

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

        \[\leadsto \frac{\ell}{\frac{F \cdot F}{\color{blue}{\sqrt{\pi} \cdot \sqrt{\pi}}}} \]
      7. add-sqr-sqrt3.9%

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

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

        \[\leadsto \color{blue}{\frac{\ell}{F} \cdot \frac{\pi}{F}} \]
      10. clear-num4.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{F}{\ell}}} \cdot \frac{\pi}{F} \]
      11. frac-2neg4.0%

        \[\leadsto \frac{1}{\frac{F}{\ell}} \cdot \color{blue}{\frac{-\pi}{-F}} \]
      12. frac-times4.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -118000:\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{elif}\;\ell \leq -7 \cdot 10^{-92}:\\ \;\;\;\;\ell \cdot \frac{-\pi}{F \cdot F}\\ \mathbf{elif}\;\ell \leq -2.4 \cdot 10^{-203}:\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{elif}\;\ell \leq 2.95 \cdot 10^{-183}:\\ \;\;\;\;\frac{\pi}{\left(-F\right) \cdot \frac{F}{\ell}}\\ \mathbf{elif}\;\ell \leq 2.9 \cdot 10^{-116} \lor \neg \left(\ell \leq 3.4 \cdot 10^{-16}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \frac{-\pi}{F \cdot F}\\ \end{array} \]

Alternative 8: 74.4% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -16500:\\
\;\;\;\;\pi \cdot \ell\\

\mathbf{elif}\;\ell \leq -5.8 \cdot 10^{-93}:\\
\;\;\;\;\frac{\pi \cdot \frac{\ell}{F}}{-F}\\

\mathbf{elif}\;\ell \leq -4.6 \cdot 10^{-203}:\\
\;\;\;\;\pi \cdot \ell\\

\mathbf{elif}\;\ell \leq 5.6 \cdot 10^{-182}:\\
\;\;\;\;\frac{\pi}{\left(-F\right) \cdot \frac{F}{\ell}}\\

\mathbf{elif}\;\ell \leq 2.5 \cdot 10^{-116} \lor \neg \left(\ell \leq 3.6 \cdot 10^{-16}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if l < -16500 or -5.7999999999999997e-93 < l < -4.59999999999999983e-203 or 5.59999999999999986e-182 < l < 2.5000000000000001e-116 or 3.59999999999999983e-16 < l

    1. Initial program 65.8%

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

        \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{\left(-F\right) \cdot \left(-F\right)}} \cdot \tan \left(\pi \cdot \ell\right) \]
      2. associate-*l/66.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-identity66.0%

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

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

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

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

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

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

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

    if -16500 < l < -5.7999999999999997e-93

    1. Initial program 99.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \color{blue}{\frac{-1 \cdot \pi}{{F}^{2}}} \]
      2. neg-mul-162.2%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\ell}{\frac{F \cdot F}{-\pi}}} \]
      3. add-sqr-sqrt0.0%

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

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

        \[\leadsto \frac{\ell}{\frac{F \cdot F}{\sqrt{\color{blue}{\pi \cdot \pi}}}} \]
      6. sqrt-unprod1.7%

        \[\leadsto \frac{\ell}{\frac{F \cdot F}{\color{blue}{\sqrt{\pi} \cdot \sqrt{\pi}}}} \]
      7. add-sqr-sqrt1.7%

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

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

        \[\leadsto \color{blue}{\frac{\ell}{F} \cdot \frac{\pi}{F}} \]
      10. frac-2neg1.7%

        \[\leadsto \frac{\ell}{F} \cdot \color{blue}{\frac{-\pi}{-F}} \]
      11. associate-*r/1.7%

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

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

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

        \[\leadsto \frac{\frac{\ell}{F} \cdot \sqrt{\color{blue}{\pi \cdot \pi}}}{-F} \]
      15. sqrt-unprod62.1%

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

        \[\leadsto \frac{\frac{\ell}{F} \cdot \color{blue}{\pi}}{-F} \]
      17. *-commutative62.3%

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

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

    if -4.59999999999999983e-203 < l < 5.59999999999999986e-182

    1. Initial program 73.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \color{blue}{\frac{-1 \cdot \pi}{{F}^{2}}} \]
      2. neg-mul-139.4%

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

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

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

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

        \[\leadsto \color{blue}{\frac{\ell}{\frac{F \cdot F}{-\pi}}} \]
      3. add-sqr-sqrt0.0%

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

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

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

        \[\leadsto \frac{\ell}{\frac{F \cdot F}{\color{blue}{\sqrt{\pi} \cdot \sqrt{\pi}}}} \]
      7. add-sqr-sqrt3.9%

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

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

        \[\leadsto \color{blue}{\frac{\ell}{F} \cdot \frac{\pi}{F}} \]
      10. clear-num4.0%

        \[\leadsto \color{blue}{\frac{1}{\frac{F}{\ell}}} \cdot \frac{\pi}{F} \]
      11. frac-2neg4.0%

        \[\leadsto \frac{1}{\frac{F}{\ell}} \cdot \color{blue}{\frac{-\pi}{-F}} \]
      12. frac-times4.0%

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

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

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

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

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

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

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

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

    if 2.5000000000000001e-116 < l < 3.59999999999999983e-16

    1. Initial program 99.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \color{blue}{\frac{-1 \cdot \pi}{{F}^{2}}} \]
      2. neg-mul-171.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -16500:\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{elif}\;\ell \leq -5.8 \cdot 10^{-93}:\\ \;\;\;\;\frac{\pi \cdot \frac{\ell}{F}}{-F}\\ \mathbf{elif}\;\ell \leq -4.6 \cdot 10^{-203}:\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{elif}\;\ell \leq 5.6 \cdot 10^{-182}:\\ \;\;\;\;\frac{\pi}{\left(-F\right) \cdot \frac{F}{\ell}}\\ \mathbf{elif}\;\ell \leq 2.5 \cdot 10^{-116} \lor \neg \left(\ell \leq 3.6 \cdot 10^{-16}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \frac{-\pi}{F \cdot F}\\ \end{array} \]

Alternative 9: 73.8% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.66 \cdot 10^{-139} \lor \neg \left(F \leq 2.3 \cdot 10^{-127} \lor \neg \left(F \leq 2.55 \cdot 10^{-64}\right) \land F \leq 2.1 \cdot 10^{-42}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 1.6599999999999999e-139 or 2.30000000000000019e-127 < F < 2.54999999999999992e-64 or 2.10000000000000006e-42 < F

    1. Initial program 71.0%

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

        \[\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/71.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-identity71.6%

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

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

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

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

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

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

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

    if 1.6599999999999999e-139 < F < 2.30000000000000019e-127 or 2.54999999999999992e-64 < F < 2.10000000000000006e-42

    1. Initial program 98.7%

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

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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \color{blue}{\frac{-1 \cdot \pi}{{F}^{2}}} \]
      2. neg-mul-199.6%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 1.66 \cdot 10^{-139} \lor \neg \left(F \leq 2.3 \cdot 10^{-127} \lor \neg \left(F \leq 2.55 \cdot 10^{-64}\right) \land F \leq 2.1 \cdot 10^{-42}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \frac{-\pi}{F \cdot F}\\ \end{array} \]

Alternative 10: 92.2% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.8 \cdot 10^{+22} \lor \neg \left(\ell \leq 1.25 \cdot 10^{-15}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.8e22 or 1.25e-15 < l

    1. Initial program 58.5%

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

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

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

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

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

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

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

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

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

    if -1.8e22 < l < 1.25e-15

    1. Initial program 86.4%

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

        \[\leadsto \pi \cdot \ell - \frac{1}{\color{blue}{\left(-F\right) \cdot \left(-F\right)}} \cdot \tan \left(\pi \cdot \ell\right) \]
      2. associate-*l/87.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-identity87.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell + \ell \cdot \left(-\color{blue}{\pi \cdot \frac{1}{F \cdot F}}\right) \]
      5. distribute-rgt-neg-in86.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 73.4% 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 71.9%

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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