VandenBroeck and Keller, Equation (6)

Percentage Accurate: 76.1% → 98.8%
Time: 15.9s
Alternatives: 12
Speedup: 0.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 76.1% accurate, 1.0× speedup?

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

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

Alternative 1: 98.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -5 \cdot 10^{+19} \lor \neg \left(\pi \cdot \ell \leq 50000\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+19) (not (<= (* PI l) 50000.0)))
   (* PI l)
   (- (* PI l) (/ (/ (tan (* PI l)) F) F))))
double code(double F, double l) {
	double tmp;
	if (((((double) M_PI) * l) <= -5e+19) || !((((double) M_PI) * l) <= 50000.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+19) || !((Math.PI * l) <= 50000.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+19) or not ((math.pi * l) <= 50000.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+19) || !(Float64(pi * l) <= 50000.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+19) || ~(((pi * l) <= 50000.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+19], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 50000.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^{+19} \lor \neg \left(\pi \cdot \ell \leq 50000\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) < -5e19 or 5e4 < (*.f64 (PI.f64) l)

    1. Initial program 67.3%

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

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

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

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

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

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

      \[\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 -5e19 < (*.f64 (PI.f64) l) < 5e4

    1. Initial program 88.8%

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

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

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

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

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

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

Alternative 2: 98.2% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 67.3%

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

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

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

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

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

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

      \[\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 -5e19 < (*.f64 (PI.f64) l) < 5e4

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1 \cdot 1}{\frac{F}{\ell \cdot \pi} \cdot F}} \]
      3. metadata-eval97.0%

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{1}}{\frac{F}{\ell \cdot \pi} \cdot F} \]
      4. *-commutative97.0%

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

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

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

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

Alternative 3: 92.9% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -5 \cdot 10^{+19} \lor \neg \left(\pi \cdot \ell \leq 50000\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 (<= (* PI l) -5e+19) (not (<= (* PI l) 50000.0)))
   (* PI l)
   (- (* PI l) (* PI (/ l (* F F))))))
double code(double F, double l) {
	double tmp;
	if (((((double) M_PI) * l) <= -5e+19) || !((((double) M_PI) * l) <= 50000.0)) {
		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+19) || !((Math.PI * l) <= 50000.0)) {
		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+19) or not ((math.pi * l) <= 50000.0):
		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+19) || !(Float64(pi * l) <= 50000.0))
		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 (((pi * l) <= -5e+19) || ~(((pi * l) <= 50000.0)))
		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+19], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 50000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] - N[(Pi * N[(l / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -5 \cdot 10^{+19} \lor \neg \left(\pi \cdot \ell \leq 50000\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 (*.f64 (PI.f64) l) < -5e19 or 5e4 < (*.f64 (PI.f64) l)

    1. Initial program 67.3%

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

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

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

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

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

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

      \[\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 -5e19 < (*.f64 (PI.f64) l) < 5e4

    1. Initial program 88.8%

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

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

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

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

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

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

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

Alternative 4: 98.2% accurate, 0.7× speedup?

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

    1. Initial program 67.3%

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

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

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

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

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

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

      \[\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 -5e19 < (*.f64 (PI.f64) l) < 5e4

    1. Initial program 88.8%

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

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

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

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

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

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell \cdot \pi}{F}} \cdot \frac{1}{F} \]
    7. Taylor expanded in l around 0 87.3%

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

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

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

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

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

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

Alternative 5: 98.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -5 \cdot 10^{+19} \lor \neg \left(\pi \cdot \ell \leq 50000\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+19) (not (<= (* PI l) 50000.0)))
   (* PI l)
   (- (* PI l) (/ (/ (* PI l) F) F))))
double code(double F, double l) {
	double tmp;
	if (((((double) M_PI) * l) <= -5e+19) || !((((double) M_PI) * l) <= 50000.0)) {
		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+19) || !((Math.PI * l) <= 50000.0)) {
		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+19) or not ((math.pi * l) <= 50000.0):
		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+19) || !(Float64(pi * l) <= 50000.0))
		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+19) || ~(((pi * l) <= 50000.0)))
		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+19], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 50000.0]], $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^{+19} \lor \neg \left(\pi \cdot \ell \leq 50000\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) < -5e19 or 5e4 < (*.f64 (PI.f64) l)

    1. Initial program 67.3%

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

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

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

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

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

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

      \[\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 -5e19 < (*.f64 (PI.f64) l) < 5e4

    1. Initial program 88.8%

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

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

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

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

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

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\ell \cdot \pi}{F}} \cdot \frac{1}{F} \]
    7. Step-by-step derivation
      1. un-div-inv97.0%

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

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

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

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

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\frac{\ell \cdot \pi}{F}}}{F} \]
      2. *-commutative97.0%

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

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

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

Alternative 6: 92.5% accurate, 0.8× speedup?

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

    1. Initial program 67.3%

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

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

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

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

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

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

      \[\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 -5e19 < (*.f64 (PI.f64) l) < 5e4

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

Alternative 7: 73.7% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 2 \cdot 10^{-289}:\\
\;\;\;\;\pi \cdot \left(\frac{\ell}{F} \cdot \frac{-1}{F}\right)\\

\mathbf{elif}\;F \cdot F \leq 5 \cdot 10^{-90} \lor \neg \left(F \cdot F \leq 2 \cdot 10^{-41}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


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

    1. Initial program 39.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e-289 < (*.f64 F F) < 5.00000000000000019e-90 or 2.00000000000000001e-41 < (*.f64 F F)

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

    if 5.00000000000000019e-90 < (*.f64 F F) < 2.00000000000000001e-41

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -{F}^{\color{blue}{-2}} \cdot \left(\ell \cdot \pi\right) \]
      6. *-commutative72.7%

        \[\leadsto -{F}^{-2} \cdot \color{blue}{\left(\pi \cdot \ell\right)} \]
    11. Applied egg-rr72.7%

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

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

Alternative 8: 73.8% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;F \cdot F \leq 5 \cdot 10^{-90} \lor \neg \left(F \cdot F \leq 2 \cdot 10^{-41}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


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

    1. Initial program 39.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e-289 < (*.f64 F F) < 5.00000000000000019e-90 or 2.00000000000000001e-41 < (*.f64 F F)

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

    if 5.00000000000000019e-90 < (*.f64 F F) < 2.00000000000000001e-41

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \cdot F \leq 2 \cdot 10^{-289}:\\ \;\;\;\;\frac{\frac{\ell}{F}}{F} \cdot \left(-\pi\right)\\ \mathbf{elif}\;F \cdot F \leq 5 \cdot 10^{-90} \lor \neg \left(F \cdot F \leq 2 \cdot 10^{-41}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell}{F} \cdot \frac{-\pi}{F}\\ \end{array} \]

Alternative 9: 73.8% accurate, 2.6× speedup?

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

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

\mathbf{elif}\;F \cdot F \leq 5 \cdot 10^{-90} \lor \neg \left(F \cdot F \leq 2 \cdot 10^{-41}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


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

    1. Initial program 39.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e-289 < (*.f64 F F) < 5.00000000000000019e-90 or 2.00000000000000001e-41 < (*.f64 F F)

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

    if 5.00000000000000019e-90 < (*.f64 F F) < 2.00000000000000001e-41

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \cdot F \leq 2 \cdot 10^{-289}:\\ \;\;\;\;\frac{\frac{\ell}{F}}{F} \cdot \left(-\pi\right)\\ \mathbf{elif}\;F \cdot F \leq 5 \cdot 10^{-90} \lor \neg \left(F \cdot F \leq 2 \cdot 10^{-41}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\frac{-\ell}{\frac{F \cdot F}{\pi}}\\ \end{array} \]

Alternative 10: 73.8% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 2 \cdot 10^{-289}:\\
\;\;\;\;\pi \cdot \left(\frac{\ell}{F} \cdot \frac{-1}{F}\right)\\

\mathbf{elif}\;F \cdot F \leq 5 \cdot 10^{-90} \lor \neg \left(F \cdot F \leq 2 \cdot 10^{-41}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


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

    1. Initial program 39.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2e-289 < (*.f64 F F) < 5.00000000000000019e-90 or 2.00000000000000001e-41 < (*.f64 F F)

    1. Initial program 89.5%

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

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

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

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

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

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

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

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

    if 5.00000000000000019e-90 < (*.f64 F F) < 2.00000000000000001e-41

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 50.5% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq 4.2 \cdot 10^{-145} \lor \neg \left(F \leq 4.4 \cdot 10^{-45}\right) \land F \leq 5.8 \cdot 10^{-20}:\\
\;\;\;\;\frac{\ell}{F} \cdot \frac{-\pi}{F}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 4.19999999999999982e-145 or 4.39999999999999987e-45 < F < 5.8e-20

    1. Initial program 72.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.19999999999999982e-145 < F < 4.39999999999999987e-45 or 5.8e-20 < F

    1. Initial program 90.6%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 4.2 \cdot 10^{-145} \lor \neg \left(F \leq 4.4 \cdot 10^{-45}\right) \land F \leq 5.8 \cdot 10^{-20}:\\ \;\;\;\;\frac{\ell}{F} \cdot \frac{-\pi}{F}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell\\ \end{array} \]

Alternative 12: 73.2% 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 78.1%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\ell \cdot \pi} \]
  8. Final simplification75.5%

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

Reproduce

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