VandenBroeck and Keller, Equation (6)

Percentage Accurate: 76.4% → 98.8%
Time: 17.9s
Alternatives: 9
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 9 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.4% 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 -2 \cdot 10^{+16} \lor \neg \left(\pi \cdot \ell \leq 20000\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) -2e+16) (not (<= (* PI l) 20000.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) <= -2e+16) || !((((double) M_PI) * l) <= 20000.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) <= -2e+16) || !((Math.PI * l) <= 20000.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) <= -2e+16) or not ((math.pi * l) <= 20000.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) <= -2e+16) || !(Float64(pi * l) <= 20000.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) <= -2e+16) || ~(((pi * l) <= 20000.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], -2e+16], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 20000.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 -2 \cdot 10^{+16} \lor \neg \left(\pi \cdot \ell \leq 20000\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) < -2e16 or 2e4 < (*.f64 (PI.f64) l)

    1. Initial program 56.7%

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

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

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

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

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

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

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

    1. Initial program 91.1%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -2 \cdot 10^{+16} \lor \neg \left(\pi \cdot \ell \leq 20000\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: 98.9% accurate, 0.6× speedup?

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

    1. Initial program 56.7%

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

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

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

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

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

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

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

    1. Initial program 91.1%

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

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

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

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

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

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

Alternative 3: 98.2% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -200 \lor \neg \left(\pi \cdot \ell \leq 20000\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) -200.0) (not (<= (* PI l) 20000.0)))
   (* PI l)
   (- (* PI l) (* (/ PI F) (/ l F)))))
double code(double F, double l) {
	double tmp;
	if (((((double) M_PI) * l) <= -200.0) || !((((double) M_PI) * l) <= 20000.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) <= -200.0) || !((Math.PI * l) <= 20000.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) <= -200.0) or not ((math.pi * l) <= 20000.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) <= -200.0) || !(Float64(pi * l) <= 20000.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) <= -200.0) || ~(((pi * l) <= 20000.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], -200.0], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 20000.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 -200 \lor \neg \left(\pi \cdot \ell \leq 20000\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) < -200 or 2e4 < (*.f64 (PI.f64) l)

    1. Initial program 57.4%

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

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

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

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

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

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

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

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

    if -200 < (*.f64 (PI.f64) l) < 2e4

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\ell, \pi, -1 \cdot \frac{\ell \cdot \pi}{{F}^{2}}\right)} \]
      2. mul-1-neg90.1%

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

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

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

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

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

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

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

Alternative 4: 92.6% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 180000\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \left(\pi \cdot \left(1 - {F}^{-2}\right)\right)\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (or (<= l -0.5) (not (<= l 180000.0)))
   (* PI l)
   (* l (* PI (- 1.0 (pow F -2.0))))))
double code(double F, double l) {
	double tmp;
	if ((l <= -0.5) || !(l <= 180000.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 <= -0.5) || !(l <= 180000.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 <= -0.5) or not (l <= 180000.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 <= -0.5) || !(l <= 180000.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 <= -0.5) || ~((l <= 180000.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, -0.5], N[Not[LessEqual[l, 180000.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 -0.5 \lor \neg \left(\ell \leq 180000\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -0.5 or 1.8e5 < l

    1. Initial program 57.4%

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

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

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

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

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

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

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

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

    if -0.5 < l < 1.8e5

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 92.6% accurate, 1.5× speedup?

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

    1. Initial program 57.4%

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

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

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

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

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

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

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

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

    if -0.5 < l < 1.8e5

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

Alternative 6: 73.6% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \cdot F \leq 10^{-290}:\\ \;\;\;\;\frac{\ell \cdot F}{\frac{F}{\pi}}\\ \mathbf{elif}\;F \cdot F \leq 2 \cdot 10^{-277}:\\ \;\;\;\;\ell \cdot \frac{-\pi}{F \cdot F}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (<= (* F F) 1e-290)
   (/ (* l F) (/ F PI))
   (if (<= (* F F) 2e-277) (* l (/ (- PI) (* F F))) (* PI l))))
double code(double F, double l) {
	double tmp;
	if ((F * F) <= 1e-290) {
		tmp = (l * F) / (F / ((double) M_PI));
	} else if ((F * F) <= 2e-277) {
		tmp = l * (-((double) M_PI) / (F * F));
	} else {
		tmp = ((double) M_PI) * l;
	}
	return tmp;
}
public static double code(double F, double l) {
	double tmp;
	if ((F * F) <= 1e-290) {
		tmp = (l * F) / (F / Math.PI);
	} else if ((F * F) <= 2e-277) {
		tmp = l * (-Math.PI / (F * F));
	} else {
		tmp = Math.PI * l;
	}
	return tmp;
}
def code(F, l):
	tmp = 0
	if (F * F) <= 1e-290:
		tmp = (l * F) / (F / math.pi)
	elif (F * F) <= 2e-277:
		tmp = l * (-math.pi / (F * F))
	else:
		tmp = math.pi * l
	return tmp
function code(F, l)
	tmp = 0.0
	if (Float64(F * F) <= 1e-290)
		tmp = Float64(Float64(l * F) / Float64(F / pi));
	elseif (Float64(F * F) <= 2e-277)
		tmp = Float64(l * Float64(Float64(-pi) / Float64(F * F)));
	else
		tmp = Float64(pi * l);
	end
	return tmp
end
function tmp_2 = code(F, l)
	tmp = 0.0;
	if ((F * F) <= 1e-290)
		tmp = (l * F) / (F / pi);
	elseif ((F * F) <= 2e-277)
		tmp = l * (-pi / (F * F));
	else
		tmp = pi * l;
	end
	tmp_2 = tmp;
end
code[F_, l_] := If[LessEqual[N[(F * F), $MachinePrecision], 1e-290], N[(N[(l * F), $MachinePrecision] / N[(F / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(F * F), $MachinePrecision], 2e-277], N[(l * N[((-Pi) / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(Pi * l), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 10^{-290}:\\
\;\;\;\;\frac{\ell \cdot F}{\frac{F}{\pi}}\\

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

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


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

    1. Initial program 28.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\ell}{\frac{F}{\pi}} \cdot \color{blue}{{F}^{-1}} \]
      13. metadata-eval7.6%

        \[\leadsto \frac{\ell}{\frac{F}{\pi}} \cdot {F}^{\color{blue}{\left(\frac{-2}{2}\right)}} \]
      14. sqrt-pow113.4%

        \[\leadsto \frac{\ell}{\frac{F}{\pi}} \cdot \color{blue}{\sqrt{{F}^{-2}}} \]
      15. exp-to-pow2.9%

        \[\leadsto \frac{\ell}{\frac{F}{\pi}} \cdot \sqrt{\color{blue}{e^{\log F \cdot -2}}} \]
      16. associate-*l/2.9%

        \[\leadsto \color{blue}{\frac{\ell \cdot \sqrt{e^{\log F \cdot -2}}}{\frac{F}{\pi}}} \]
    11. Applied egg-rr59.8%

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

    if 1.0000000000000001e-290 < (*.f64 F F) < 1.99999999999999994e-277

    1. Initial program 88.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999994e-277 < (*.f64 F F)

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \cdot F \leq 10^{-290}:\\ \;\;\;\;\frac{\ell \cdot F}{\frac{F}{\pi}}\\ \mathbf{elif}\;F \cdot F \leq 2 \cdot 10^{-277}:\\ \;\;\;\;\ell \cdot \frac{-\pi}{F \cdot F}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell\\ \end{array} \]

Alternative 7: 73.6% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \cdot F \leq 10^{-290}:\\ \;\;\;\;\frac{\ell \cdot F}{\frac{F}{\pi}}\\ \mathbf{elif}\;F \cdot F \leq 2 \cdot 10^{-277}:\\ \;\;\;\;\frac{\ell}{F} \cdot \frac{\pi}{-F}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (<= (* F F) 1e-290)
   (/ (* l F) (/ F PI))
   (if (<= (* F F) 2e-277) (* (/ l F) (/ PI (- F))) (* PI l))))
double code(double F, double l) {
	double tmp;
	if ((F * F) <= 1e-290) {
		tmp = (l * F) / (F / ((double) M_PI));
	} else if ((F * F) <= 2e-277) {
		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 * F) <= 1e-290) {
		tmp = (l * F) / (F / Math.PI);
	} else if ((F * F) <= 2e-277) {
		tmp = (l / F) * (Math.PI / -F);
	} else {
		tmp = Math.PI * l;
	}
	return tmp;
}
def code(F, l):
	tmp = 0
	if (F * F) <= 1e-290:
		tmp = (l * F) / (F / math.pi)
	elif (F * F) <= 2e-277:
		tmp = (l / F) * (math.pi / -F)
	else:
		tmp = math.pi * l
	return tmp
function code(F, l)
	tmp = 0.0
	if (Float64(F * F) <= 1e-290)
		tmp = Float64(Float64(l * F) / Float64(F / pi));
	elseif (Float64(F * F) <= 2e-277)
		tmp = Float64(Float64(l / F) * Float64(pi / Float64(-F)));
	else
		tmp = Float64(pi * l);
	end
	return tmp
end
function tmp_2 = code(F, l)
	tmp = 0.0;
	if ((F * F) <= 1e-290)
		tmp = (l * F) / (F / pi);
	elseif ((F * F) <= 2e-277)
		tmp = (l / F) * (pi / -F);
	else
		tmp = pi * l;
	end
	tmp_2 = tmp;
end
code[F_, l_] := If[LessEqual[N[(F * F), $MachinePrecision], 1e-290], N[(N[(l * F), $MachinePrecision] / N[(F / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(F * F), $MachinePrecision], 2e-277], N[(N[(l / F), $MachinePrecision] * N[(Pi / (-F)), $MachinePrecision]), $MachinePrecision], N[(Pi * l), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 10^{-290}:\\
\;\;\;\;\frac{\ell \cdot F}{\frac{F}{\pi}}\\

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

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


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

    1. Initial program 28.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\ell}{\frac{F}{\pi}} \cdot \color{blue}{{F}^{-1}} \]
      13. metadata-eval7.6%

        \[\leadsto \frac{\ell}{\frac{F}{\pi}} \cdot {F}^{\color{blue}{\left(\frac{-2}{2}\right)}} \]
      14. sqrt-pow113.4%

        \[\leadsto \frac{\ell}{\frac{F}{\pi}} \cdot \color{blue}{\sqrt{{F}^{-2}}} \]
      15. exp-to-pow2.9%

        \[\leadsto \frac{\ell}{\frac{F}{\pi}} \cdot \sqrt{\color{blue}{e^{\log F \cdot -2}}} \]
      16. associate-*l/2.9%

        \[\leadsto \color{blue}{\frac{\ell \cdot \sqrt{e^{\log F \cdot -2}}}{\frac{F}{\pi}}} \]
    11. Applied egg-rr59.8%

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

    if 1.0000000000000001e-290 < (*.f64 F F) < 1.99999999999999994e-277

    1. Initial program 88.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \color{blue}{\frac{-\left(-\pi\right)}{-F \cdot F}} \]
      2. remove-double-neg87.1%

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

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

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

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

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

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

    if 1.99999999999999994e-277 < (*.f64 F F)

    1. Initial program 88.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \cdot F \leq 10^{-290}:\\ \;\;\;\;\frac{\ell \cdot F}{\frac{F}{\pi}}\\ \mathbf{elif}\;F \cdot F \leq 2 \cdot 10^{-277}:\\ \;\;\;\;\frac{\ell}{F} \cdot \frac{\pi}{-F}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell\\ \end{array} \]

Alternative 8: 68.2% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \leq 1.2 \cdot 10^{-145}:\\ \;\;\;\;\frac{\ell \cdot F}{\frac{F}{\pi}}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{-139}:\\ \;\;\;\;\frac{\pi \cdot \ell}{-F \cdot F}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (<= F 1.2e-145)
   (/ (* l F) (/ F PI))
   (if (<= F 6e-139) (/ (* PI l) (- (* F F))) (* PI l))))
double code(double F, double l) {
	double tmp;
	if (F <= 1.2e-145) {
		tmp = (l * F) / (F / ((double) M_PI));
	} else if (F <= 6e-139) {
		tmp = (((double) M_PI) * l) / -(F * F);
	} else {
		tmp = ((double) M_PI) * l;
	}
	return tmp;
}
public static double code(double F, double l) {
	double tmp;
	if (F <= 1.2e-145) {
		tmp = (l * F) / (F / Math.PI);
	} else if (F <= 6e-139) {
		tmp = (Math.PI * l) / -(F * F);
	} else {
		tmp = Math.PI * l;
	}
	return tmp;
}
def code(F, l):
	tmp = 0
	if F <= 1.2e-145:
		tmp = (l * F) / (F / math.pi)
	elif F <= 6e-139:
		tmp = (math.pi * l) / -(F * F)
	else:
		tmp = math.pi * l
	return tmp
function code(F, l)
	tmp = 0.0
	if (F <= 1.2e-145)
		tmp = Float64(Float64(l * F) / Float64(F / pi));
	elseif (F <= 6e-139)
		tmp = Float64(Float64(pi * l) / Float64(-Float64(F * F)));
	else
		tmp = Float64(pi * l);
	end
	return tmp
end
function tmp_2 = code(F, l)
	tmp = 0.0;
	if (F <= 1.2e-145)
		tmp = (l * F) / (F / pi);
	elseif (F <= 6e-139)
		tmp = (pi * l) / -(F * F);
	else
		tmp = pi * l;
	end
	tmp_2 = tmp;
end
code[F_, l_] := If[LessEqual[F, 1.2e-145], N[(N[(l * F), $MachinePrecision] / N[(F / Pi), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6e-139], N[(N[(Pi * l), $MachinePrecision] / (-N[(F * F), $MachinePrecision])), $MachinePrecision], N[(Pi * l), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.2 \cdot 10^{-145}:\\
\;\;\;\;\frac{\ell \cdot F}{\frac{F}{\pi}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < 1.20000000000000008e-145

    1. Initial program 64.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\frac{\ell \cdot \pi}{F}}{F}} \]
      10. div-inv5.8%

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

        \[\leadsto \color{blue}{\frac{\ell}{\frac{F}{\pi}}} \cdot \frac{1}{F} \]
      12. inv-pow5.8%

        \[\leadsto \frac{\ell}{\frac{F}{\pi}} \cdot \color{blue}{{F}^{-1}} \]
      13. metadata-eval5.8%

        \[\leadsto \frac{\ell}{\frac{F}{\pi}} \cdot {F}^{\color{blue}{\left(\frac{-2}{2}\right)}} \]
      14. sqrt-pow115.4%

        \[\leadsto \frac{\ell}{\frac{F}{\pi}} \cdot \color{blue}{\sqrt{{F}^{-2}}} \]
      15. exp-to-pow1.2%

        \[\leadsto \frac{\ell}{\frac{F}{\pi}} \cdot \sqrt{\color{blue}{e^{\log F \cdot -2}}} \]
      16. associate-*l/1.2%

        \[\leadsto \color{blue}{\frac{\ell \cdot \sqrt{e^{\log F \cdot -2}}}{\frac{F}{\pi}}} \]
    11. Applied egg-rr61.8%

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

    if 1.20000000000000008e-145 < F < 5.9999999999999998e-139

    1. Initial program 81.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \color{blue}{\frac{-\left(-\pi\right)}{-F \cdot F}} \]
      2. remove-double-neg79.7%

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

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

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

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

    if 5.9999999999999998e-139 < 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 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 inf 88.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 1.2 \cdot 10^{-145}:\\ \;\;\;\;\frac{\ell \cdot F}{\frac{F}{\pi}}\\ \mathbf{elif}\;F \leq 6 \cdot 10^{-139}:\\ \;\;\;\;\frac{\pi \cdot \ell}{-F \cdot F}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell\\ \end{array} \]

Alternative 9: 74.0% accurate, 3.0× speedup?

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\ell \cdot \pi} \]
  8. Final simplification76.9%

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

Reproduce

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