VandenBroeck and Keller, Equation (6)

Percentage Accurate: 76.7% → 99.1%
Time: 18.8s
Alternatives: 13
Speedup: 1.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 76.7% accurate, 1.0× speedup?

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

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

Alternative 1: 99.1% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 59.8%

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

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

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

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

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

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

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

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

    if -1e18 < (*.f64 (PI.f64) l) < 2e9

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.1% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 59.8%

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

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

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

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

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

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

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

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

    if -1e18 < (*.f64 (PI.f64) l) < 2e9

    1. Initial program 88.4%

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

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

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

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

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

Alternative 3: 99.2% accurate, 0.6× speedup?

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

    1. Initial program 59.8%

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

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

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

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

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

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

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

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

    if -1e18 < (*.f64 (PI.f64) l) < 2e9

    1. Initial program 88.4%

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

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

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

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

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

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

Alternative 4: 98.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -50000000000 \lor \neg \left(\pi \cdot \ell \leq 500000\right):\\
\;\;\;\;\pi \cdot \ell\\

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


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

    1. Initial program 60.1%

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

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

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

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

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

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

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

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

    if -5e10 < (*.f64 (PI.f64) l) < 5e5

    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. inv-pow88.8%

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

        \[\leadsto \pi \cdot \ell - \color{blue}{\left({F}^{-1} \cdot {F}^{-1}\right)} \cdot \tan \left(\pi \cdot \ell\right) \]
      3. pow-prod-up88.8%

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

        \[\leadsto \pi \cdot \ell - \color{blue}{e^{\log F \cdot \left(-1 + -1\right)}} \cdot \tan \left(\pi \cdot \ell\right) \]
      5. metadata-eval45.6%

        \[\leadsto \pi \cdot \ell - e^{\log F \cdot \color{blue}{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    3. Applied egg-rr45.6%

      \[\leadsto \pi \cdot \ell - \color{blue}{e^{\log F \cdot -2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    4. Taylor expanded in l around 0 88.4%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 98.6% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -70000000 \lor \neg \left(\ell \leq 260000000\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 -70000000.0) (not (<= l 260000000.0)))
   (* PI l)
   (- (* PI l) (* (/ PI F) (/ l F)))))
double code(double F, double l) {
	double tmp;
	if ((l <= -70000000.0) || !(l <= 260000000.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 ((l <= -70000000.0) || !(l <= 260000000.0)) {
		tmp = Math.PI * l;
	} else {
		tmp = (Math.PI * l) - ((Math.PI / F) * (l / F));
	}
	return tmp;
}
def code(F, l):
	tmp = 0
	if (l <= -70000000.0) or not (l <= 260000000.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 ((l <= -70000000.0) || !(l <= 260000000.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 ((l <= -70000000.0) || ~((l <= 260000000.0)))
		tmp = pi * l;
	else
		tmp = (pi * l) - ((pi / F) * (l / F));
	end
	tmp_2 = tmp;
end
code[F_, l_] := If[Or[LessEqual[l, -70000000.0], N[Not[LessEqual[l, 260000000.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}\;\ell \leq -70000000 \lor \neg \left(\ell \leq 260000000\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 < -7e7 or 2.6e8 < l

    1. Initial program 60.1%

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

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

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

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

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

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

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

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

    if -7e7 < l < 2.6e8

    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. inv-pow88.8%

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

        \[\leadsto \pi \cdot \ell - \color{blue}{\left({F}^{-1} \cdot {F}^{-1}\right)} \cdot \tan \left(\pi \cdot \ell\right) \]
      3. pow-prod-up88.8%

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

        \[\leadsto \pi \cdot \ell - \color{blue}{e^{\log F \cdot \left(-1 + -1\right)}} \cdot \tan \left(\pi \cdot \ell\right) \]
      5. metadata-eval45.6%

        \[\leadsto \pi \cdot \ell - e^{\log F \cdot \color{blue}{-2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    3. Applied egg-rr45.6%

      \[\leadsto \pi \cdot \ell - \color{blue}{e^{\log F \cdot -2}} \cdot \tan \left(\pi \cdot \ell\right) \]
    4. Taylor expanded in l around 0 88.4%

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

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

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

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

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

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

Alternative 6: 92.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -70000000 \lor \neg \left(\ell \leq 260000000\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 -70000000.0) (not (<= l 260000000.0)))
   (* PI l)
   (* l (* PI (- 1.0 (pow F -2.0))))))
double code(double F, double l) {
	double tmp;
	if ((l <= -70000000.0) || !(l <= 260000000.0)) {
		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 <= -70000000.0) || !(l <= 260000000.0)) {
		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 <= -70000000.0) or not (l <= 260000000.0):
		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 <= -70000000.0) || !(l <= 260000000.0))
		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 <= -70000000.0) || ~((l <= 260000000.0)))
		tmp = pi * l;
	else
		tmp = l * (pi * (1.0 - (F ^ -2.0)));
	end
	tmp_2 = tmp;
end
code[F_, l_] := If[Or[LessEqual[l, -70000000.0], N[Not[LessEqual[l, 260000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(l * N[(Pi * N[(1.0 - N[Power[F, -2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -70000000 \lor \neg \left(\ell \leq 260000000\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 < -7e7 or 2.6e8 < l

    1. Initial program 60.1%

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

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

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

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

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

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

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

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

    if -7e7 < l < 2.6e8

    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/88.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 92.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -70000000 \lor \neg \left(\ell \leq 260000000\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 -70000000.0) (not (<= l 260000000.0)))
   (* PI l)
   (* l (- PI (/ PI (* F F))))))
double code(double F, double l) {
	double tmp;
	if ((l <= -70000000.0) || !(l <= 260000000.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 ((l <= -70000000.0) || !(l <= 260000000.0)) {
		tmp = Math.PI * l;
	} else {
		tmp = l * (Math.PI - (Math.PI / (F * F)));
	}
	return tmp;
}
def code(F, l):
	tmp = 0
	if (l <= -70000000.0) or not (l <= 260000000.0):
		tmp = math.pi * l
	else:
		tmp = l * (math.pi - (math.pi / (F * F)))
	return tmp
function code(F, l)
	tmp = 0.0
	if ((l <= -70000000.0) || !(l <= 260000000.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 ((l <= -70000000.0) || ~((l <= 260000000.0)))
		tmp = pi * l;
	else
		tmp = l * (pi - (pi / (F * F)));
	end
	tmp_2 = tmp;
end
code[F_, l_] := If[Or[LessEqual[l, -70000000.0], N[Not[LessEqual[l, 260000000.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}\;\ell \leq -70000000 \lor \neg \left(\ell \leq 260000000\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 < -7e7 or 2.6e8 < l

    1. Initial program 60.1%

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

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

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

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

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

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

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

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

    if -7e7 < l < 2.6e8

    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/88.8%

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

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

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

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

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

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

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

Alternative 8: 92.4% accurate, 1.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -70000000 \lor \neg \left(\ell \leq 260000000\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -7e7 or 2.6e8 < l

    1. Initial program 60.1%

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

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

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

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

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

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

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

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

    if -7e7 < l < 2.6e8

    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-/r*88.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell + \left(\pi \cdot \ell\right) \cdot \left(-\color{blue}{{F}^{\left(-2\right)}}\right) \]
      9. metadata-eval88.4%

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

      \[\leadsto \color{blue}{\pi \cdot \ell + \left(\pi \cdot \ell\right) \cdot \left(-{F}^{-2}\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-neg-out88.4%

        \[\leadsto \pi \cdot \ell + \color{blue}{\left(-\left(\pi \cdot \ell\right) \cdot {F}^{-2}\right)} \]
      2. associate-*r*88.4%

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

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

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

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

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

Alternative 9: 73.7% accurate, 2.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 2.25 \cdot 10^{-304} \lor \neg \left(F \cdot F \leq 1.08 \cdot 10^{-197} \lor \neg \left(F \cdot F \leq 3.5 \cdot 10^{-133}\right) \land F \cdot F \leq 9.5 \cdot 10^{-52}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 F F) < 2.2499999999999999e-304 or 1.0800000000000001e-197 < (*.f64 F F) < 3.50000000000000003e-133 or 9.50000000000000007e-52 < (*.f64 F F)

    1. Initial program 73.6%

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

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

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

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

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

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

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

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

    if 2.2499999999999999e-304 < (*.f64 F F) < 1.0800000000000001e-197 or 3.50000000000000003e-133 < (*.f64 F F) < 9.50000000000000007e-52

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \cdot F \leq 2.25 \cdot 10^{-304} \lor \neg \left(F \cdot F \leq 1.08 \cdot 10^{-197} \lor \neg \left(F \cdot F \leq 3.5 \cdot 10^{-133}\right) \land F \cdot F \leq 9.5 \cdot 10^{-52}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \frac{-\ell}{F \cdot F}\\ \end{array} \]

Alternative 10: 73.3% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.9 \cdot 10^{-48} \lor \neg \left(\ell \leq -1.25 \cdot 10^{-199} \lor \neg \left(\ell \leq -2.95 \cdot 10^{-232}\right) \land \left(\ell \leq 4.3 \cdot 10^{-276} \lor \neg \left(\ell \leq 9.5 \cdot 10^{-258}\right) \land \ell \leq 1.75 \cdot 10^{-124}\right)\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.90000000000000001e-48 or -1.2499999999999999e-199 < l < -2.95000000000000008e-232 or 4.2999999999999996e-276 < l < 9.5000000000000009e-258 or 1.7499999999999999e-124 < l

    1. Initial program 72.1%

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

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

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

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

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

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

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

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

    if -1.90000000000000001e-48 < l < -1.2499999999999999e-199 or -2.95000000000000008e-232 < l < 4.2999999999999996e-276 or 9.5000000000000009e-258 < l < 1.7499999999999999e-124

    1. Initial program 82.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.9 \cdot 10^{-48} \lor \neg \left(\ell \leq -1.25 \cdot 10^{-199} \lor \neg \left(\ell \leq -2.95 \cdot 10^{-232}\right) \land \left(\ell \leq 4.3 \cdot 10^{-276} \lor \neg \left(\ell \leq 9.5 \cdot 10^{-258}\right) \land \ell \leq 1.75 \cdot 10^{-124}\right)\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\frac{\pi}{F} \cdot \left(-\frac{\ell}{F}\right)\\ \end{array} \]

Alternative 11: 73.2% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.75 \cdot 10^{-48} \lor \neg \left(\ell \leq -6 \cdot 10^{-203}\right) \land \left(\ell \leq -2.35 \cdot 10^{-232} \lor \neg \left(\ell \leq 5.2 \cdot 10^{-276}\right) \land \left(\ell \leq 1.65 \cdot 10^{-255} \lor \neg \left(\ell \leq 7 \cdot 10^{-125}\right)\right)\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.74999999999999996e-48 or -6.0000000000000002e-203 < l < -2.35000000000000017e-232 or 5.19999999999999969e-276 < l < 1.64999999999999994e-255 or 6.99999999999999995e-125 < l

    1. Initial program 72.1%

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

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

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

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

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

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

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

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

    if -1.74999999999999996e-48 < l < -6.0000000000000002e-203 or -2.35000000000000017e-232 < l < 5.19999999999999969e-276 or 1.64999999999999994e-255 < l < 6.99999999999999995e-125

    1. Initial program 82.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.75 \cdot 10^{-48} \lor \neg \left(\ell \leq -6 \cdot 10^{-203}\right) \land \left(\ell \leq -2.35 \cdot 10^{-232} \lor \neg \left(\ell \leq 5.2 \cdot 10^{-276}\right) \land \left(\ell \leq 1.65 \cdot 10^{-255} \lor \neg \left(\ell \leq 7 \cdot 10^{-125}\right)\right)\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{-\pi}{\frac{F}{\ell}}}{F}\\ \end{array} \]

Alternative 12: 73.2% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\frac{-\pi}{\frac{F}{\ell}}}{F}\\ \mathbf{if}\;\ell \leq -2.15 \cdot 10^{-48}:\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{elif}\;\ell \leq -4.6 \cdot 10^{-201}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;\ell \leq -3.15 \cdot 10^{-232}:\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{elif}\;\ell \leq 4.8 \cdot 10^{-276}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;\ell \leq 2.9 \cdot 10^{-258} \lor \neg \left(\ell \leq 1.75 \cdot 10^{-124}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \left(-\frac{\frac{\ell}{F}}{F}\right)\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (let* ((t_0 (/ (/ (- PI) (/ F l)) F)))
   (if (<= l -2.15e-48)
     (* PI l)
     (if (<= l -4.6e-201)
       t_0
       (if (<= l -3.15e-232)
         (* PI l)
         (if (<= l 4.8e-276)
           t_0
           (if (or (<= l 2.9e-258) (not (<= l 1.75e-124)))
             (* PI l)
             (* PI (- (/ (/ l F) F))))))))))
double code(double F, double l) {
	double t_0 = (-((double) M_PI) / (F / l)) / F;
	double tmp;
	if (l <= -2.15e-48) {
		tmp = ((double) M_PI) * l;
	} else if (l <= -4.6e-201) {
		tmp = t_0;
	} else if (l <= -3.15e-232) {
		tmp = ((double) M_PI) * l;
	} else if (l <= 4.8e-276) {
		tmp = t_0;
	} else if ((l <= 2.9e-258) || !(l <= 1.75e-124)) {
		tmp = ((double) M_PI) * l;
	} else {
		tmp = ((double) M_PI) * -((l / F) / F);
	}
	return tmp;
}
public static double code(double F, double l) {
	double t_0 = (-Math.PI / (F / l)) / F;
	double tmp;
	if (l <= -2.15e-48) {
		tmp = Math.PI * l;
	} else if (l <= -4.6e-201) {
		tmp = t_0;
	} else if (l <= -3.15e-232) {
		tmp = Math.PI * l;
	} else if (l <= 4.8e-276) {
		tmp = t_0;
	} else if ((l <= 2.9e-258) || !(l <= 1.75e-124)) {
		tmp = Math.PI * l;
	} else {
		tmp = Math.PI * -((l / F) / F);
	}
	return tmp;
}
def code(F, l):
	t_0 = (-math.pi / (F / l)) / F
	tmp = 0
	if l <= -2.15e-48:
		tmp = math.pi * l
	elif l <= -4.6e-201:
		tmp = t_0
	elif l <= -3.15e-232:
		tmp = math.pi * l
	elif l <= 4.8e-276:
		tmp = t_0
	elif (l <= 2.9e-258) or not (l <= 1.75e-124):
		tmp = math.pi * l
	else:
		tmp = math.pi * -((l / F) / F)
	return tmp
function code(F, l)
	t_0 = Float64(Float64(Float64(-pi) / Float64(F / l)) / F)
	tmp = 0.0
	if (l <= -2.15e-48)
		tmp = Float64(pi * l);
	elseif (l <= -4.6e-201)
		tmp = t_0;
	elseif (l <= -3.15e-232)
		tmp = Float64(pi * l);
	elseif (l <= 4.8e-276)
		tmp = t_0;
	elseif ((l <= 2.9e-258) || !(l <= 1.75e-124))
		tmp = Float64(pi * l);
	else
		tmp = Float64(pi * Float64(-Float64(Float64(l / F) / F)));
	end
	return tmp
end
function tmp_2 = code(F, l)
	t_0 = (-pi / (F / l)) / F;
	tmp = 0.0;
	if (l <= -2.15e-48)
		tmp = pi * l;
	elseif (l <= -4.6e-201)
		tmp = t_0;
	elseif (l <= -3.15e-232)
		tmp = pi * l;
	elseif (l <= 4.8e-276)
		tmp = t_0;
	elseif ((l <= 2.9e-258) || ~((l <= 1.75e-124)))
		tmp = pi * l;
	else
		tmp = pi * -((l / F) / F);
	end
	tmp_2 = tmp;
end
code[F_, l_] := Block[{t$95$0 = N[(N[((-Pi) / N[(F / l), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]}, If[LessEqual[l, -2.15e-48], N[(Pi * l), $MachinePrecision], If[LessEqual[l, -4.6e-201], t$95$0, If[LessEqual[l, -3.15e-232], N[(Pi * l), $MachinePrecision], If[LessEqual[l, 4.8e-276], t$95$0, If[Or[LessEqual[l, 2.9e-258], N[Not[LessEqual[l, 1.75e-124]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(Pi * (-N[(N[(l / F), $MachinePrecision] / F), $MachinePrecision])), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\frac{-\pi}{\frac{F}{\ell}}}{F}\\
\mathbf{if}\;\ell \leq -2.15 \cdot 10^{-48}:\\
\;\;\;\;\pi \cdot \ell\\

\mathbf{elif}\;\ell \leq -4.6 \cdot 10^{-201}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;\ell \leq -3.15 \cdot 10^{-232}:\\
\;\;\;\;\pi \cdot \ell\\

\mathbf{elif}\;\ell \leq 4.8 \cdot 10^{-276}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;\ell \leq 2.9 \cdot 10^{-258} \lor \neg \left(\ell \leq 1.75 \cdot 10^{-124}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -2.15e-48 or -4.59999999999999971e-201 < l < -3.15000000000000005e-232 or 4.79999999999999965e-276 < l < 2.9e-258 or 1.7499999999999999e-124 < l

    1. Initial program 72.1%

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

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

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

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

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

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

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

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

    if -2.15e-48 < l < -4.59999999999999971e-201 or -3.15000000000000005e-232 < l < 4.79999999999999965e-276

    1. Initial program 82.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.9e-258 < l < 1.7499999999999999e-124

    1. Initial program 81.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\pi \cdot \frac{\ell}{F \cdot F}} \]
      5. distribute-rgt-neg-in50.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -2.15 \cdot 10^{-48}:\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{elif}\;\ell \leq -4.6 \cdot 10^{-201}:\\ \;\;\;\;\frac{\frac{-\pi}{\frac{F}{\ell}}}{F}\\ \mathbf{elif}\;\ell \leq -3.15 \cdot 10^{-232}:\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{elif}\;\ell \leq 4.8 \cdot 10^{-276}:\\ \;\;\;\;\frac{\frac{-\pi}{\frac{F}{\ell}}}{F}\\ \mathbf{elif}\;\ell \leq 2.9 \cdot 10^{-258} \lor \neg \left(\ell \leq 1.75 \cdot 10^{-124}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \left(-\frac{\frac{\ell}{F}}{F}\right)\\ \end{array} \]

Alternative 13: 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 75.0%

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

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

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

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

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

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

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

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

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

Reproduce

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