VandenBroeck and Keller, Equation (6)

Percentage Accurate: 76.5% → 98.5%
Time: 14.3s
Alternatives: 10
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 10 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.5% 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.5% accurate, 0.6× speedup?

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

    1. Initial program 55.7%

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

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

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

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

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

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

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

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

    if -9.99999999999999977e37 < (*.f64 (PI.f64) l) < 1e13

    1. Initial program 89.4%

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

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

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

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

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

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

Alternative 2: 98.4% accurate, 0.7× speedup?

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

    1. Initial program 57.8%

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

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

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

      \[\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 98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.3% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 57.8%

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

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

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

      \[\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 98.0%

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

    if -0.5 < l < 1.55e9

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

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

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

      \[\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. Step-by-step derivation
      1. *-un-lft-identity88.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \pi + \color{blue}{\left(-\frac{\ell \cdot \pi}{{F}^{2}}\right)} \]
      2. unsub-neg90.2%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 1550000000\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell - \frac{\frac{\pi}{\frac{F}{\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 1550000000\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 1550000000.0)))
   (* PI l)
   (* l (- PI (/ PI (* F F))))))
double code(double F, double l) {
	double tmp;
	if ((l <= -0.5) || !(l <= 1550000000.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 <= 1550000000.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 <= 1550000000.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 <= 1550000000.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 <= 1550000000.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, 1550000000.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 1550000000\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.55e9 < l

    1. Initial program 57.8%

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

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

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

      \[\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 98.0%

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

    if -0.5 < l < 1.55e9

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -0.5 \lor \neg \left(\ell \leq 1550000000\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \left(\pi - \frac{\pi}{F \cdot F}\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 1550000000\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \left(\pi - \frac{\frac{\pi}{F}}{F}\right)\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (or (<= l -0.5) (not (<= l 1550000000.0)))
   (* PI l)
   (* l (- PI (/ (/ PI F) F)))))
double code(double F, double l) {
	double tmp;
	if ((l <= -0.5) || !(l <= 1550000000.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 <= 1550000000.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 <= 1550000000.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 <= 1550000000.0))
		tmp = Float64(pi * l);
	else
		tmp = Float64(l * Float64(pi - Float64(Float64(pi / F) / F)));
	end
	return tmp
end
function tmp_2 = code(F, l)
	tmp = 0.0;
	if ((l <= -0.5) || ~((l <= 1550000000.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, 1550000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(l * N[(Pi - N[(N[(Pi / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 57.8%

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

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

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

      \[\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 98.0%

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

    if -0.5 < l < 1.55e9

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

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

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

      \[\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. Step-by-step derivation
      1. *-un-lft-identity88.4%

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

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

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

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

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

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

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

Alternative 6: 92.6% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 57.8%

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

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

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

      \[\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 98.0%

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

    if -0.5 < l < 1.42e9

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

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

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

      \[\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. Step-by-step derivation
      1. *-un-lft-identity88.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \pi + \ell \cdot \left(-\frac{\pi}{\color{blue}{F \cdot F}}\right) \]
      4. *-rgt-identity88.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 75.0% accurate, 2.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 4 \cdot 10^{-261} \lor \neg \left(F \cdot F \leq 2 \cdot 10^{-207}\right) \land \left(F \cdot F \leq 2 \cdot 10^{-68} \lor \neg \left(F \cdot F \leq 5 \cdot 10^{-14}\right)\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 F F) < 3.99999999999999994e-261 or 1.99999999999999985e-207 < (*.f64 F F) < 2.00000000000000013e-68 or 5.0000000000000002e-14 < (*.f64 F F)

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

    if 3.99999999999999994e-261 < (*.f64 F F) < 1.99999999999999985e-207 or 2.00000000000000013e-68 < (*.f64 F F) < 5.0000000000000002e-14

    1. Initial program 88.6%

      \[\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. *-lft-identity88.5%

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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \color{blue}{\frac{-1 \cdot \pi}{F \cdot F}} \]
      3. neg-mul-178.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \cdot F \leq 4 \cdot 10^{-261} \lor \neg \left(F \cdot F \leq 2 \cdot 10^{-207}\right) \land \left(F \cdot F \leq 2 \cdot 10^{-68} \lor \neg \left(F \cdot F \leq 5 \cdot 10^{-14}\right)\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\frac{\pi}{F \cdot F} \cdot \left(-\ell\right)\\ \end{array} \]

Alternative 8: 75.0% accurate, 2.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 F F) < 3.99999999999999994e-261 or 1.99999999999999985e-207 < (*.f64 F F) < 2.00000000000000013e-68 or 5.0000000000000002e-14 < (*.f64 F F)

    1. Initial program 72.2%

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

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

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

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

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

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

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

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

    if 3.99999999999999994e-261 < (*.f64 F F) < 1.99999999999999985e-207

    1. Initial program 82.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \color{blue}{\frac{-1 \cdot \pi}{F \cdot F}} \]
      3. neg-mul-180.9%

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

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

    if 2.00000000000000013e-68 < (*.f64 F F) < 5.0000000000000002e-14

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \color{blue}{\frac{-1 \cdot \pi}{F \cdot F}} \]
      3. neg-mul-175.5%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 75.3% accurate, 2.7× speedup?

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

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

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

\mathbf{elif}\;F \leq 5.8 \cdot 10^{-34} \lor \neg \left(F \leq 4.6 \cdot 10^{-7}\right):\\
\;\;\;\;\pi \cdot \ell\\

\mathbf{else}:\\
\;\;\;\;\ell \cdot \frac{t_0}{F}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if F < 7e-287 or 6e-103 < F < 5.8000000000000004e-34 or 4.5999999999999999e-7 < F

    1. Initial program 79.9%

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

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

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

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

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

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

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

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

    if 7e-287 < F < 6e-103

    1. Initial program 43.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \color{blue}{\frac{-1 \cdot \pi}{F \cdot F}} \]
      3. neg-mul-138.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\ell}{F} \cdot \color{blue}{\frac{1 \cdot \pi}{-1 \cdot F}} \]
      8. *-lft-identity55.1%

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

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

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

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

        \[\leadsto \frac{\pi \cdot \ell}{\color{blue}{-F \cdot F}} \]
      13. distribute-lft-neg-in40.3%

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

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

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

    if 5.8000000000000004e-34 < F < 4.5999999999999999e-7

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \color{blue}{\frac{-1 \cdot \pi}{F \cdot F}} \]
      3. neg-mul-174.7%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 7 \cdot 10^{-287}:\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{elif}\;F \leq 6 \cdot 10^{-103}:\\ \;\;\;\;\frac{\ell}{F} \cdot \frac{\pi}{-F}\\ \mathbf{elif}\;F \leq 5.8 \cdot 10^{-34} \lor \neg \left(F \leq 4.6 \cdot 10^{-7}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \frac{\frac{\pi}{-F}}{F}\\ \end{array} \]

Alternative 10: 74.8% 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 73.8%

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

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

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

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

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

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

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

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

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

Reproduce

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