VandenBroeck and Keller, Equation (6)

Percentage Accurate: 75.8% → 98.5%
Time: 12.8s
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: 75.8% 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 -5 \cdot 10^{+29} \lor \neg \left(\pi \cdot \ell \leq 10000000000\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell + \frac{-1}{F \cdot \frac{F}{\tan \left(\pi \cdot \ell\right)}}\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (or (<= (* PI l) -5e+29) (not (<= (* PI l) 10000000000.0)))
   (* PI l)
   (+ (* PI l) (/ -1.0 (* F (/ F (tan (* PI l))))))))
double code(double F, double l) {
	double tmp;
	if (((((double) M_PI) * l) <= -5e+29) || !((((double) M_PI) * l) <= 10000000000.0)) {
		tmp = ((double) M_PI) * l;
	} else {
		tmp = (((double) M_PI) * l) + (-1.0 / (F * (F / tan((((double) M_PI) * l)))));
	}
	return tmp;
}
public static double code(double F, double l) {
	double tmp;
	if (((Math.PI * l) <= -5e+29) || !((Math.PI * l) <= 10000000000.0)) {
		tmp = Math.PI * l;
	} else {
		tmp = (Math.PI * l) + (-1.0 / (F * (F / Math.tan((Math.PI * l)))));
	}
	return tmp;
}
def code(F, l):
	tmp = 0
	if ((math.pi * l) <= -5e+29) or not ((math.pi * l) <= 10000000000.0):
		tmp = math.pi * l
	else:
		tmp = (math.pi * l) + (-1.0 / (F * (F / math.tan((math.pi * l)))))
	return tmp
function code(F, l)
	tmp = 0.0
	if ((Float64(pi * l) <= -5e+29) || !(Float64(pi * l) <= 10000000000.0))
		tmp = Float64(pi * l);
	else
		tmp = Float64(Float64(pi * l) + Float64(-1.0 / Float64(F * Float64(F / tan(Float64(pi * l))))));
	end
	return tmp
end
function tmp_2 = code(F, l)
	tmp = 0.0;
	if (((pi * l) <= -5e+29) || ~(((pi * l) <= 10000000000.0)))
		tmp = pi * l;
	else
		tmp = (pi * l) + (-1.0 / (F * (F / tan((pi * l)))));
	end
	tmp_2 = tmp;
end
code[F_, l_] := If[Or[LessEqual[N[(Pi * l), $MachinePrecision], -5e+29], N[Not[LessEqual[N[(Pi * l), $MachinePrecision], 10000000000.0]], $MachinePrecision]], N[(Pi * l), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(-1.0 / N[(F * N[(F / N[Tan[N[(Pi * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

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

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


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

    1. Initial program 61.9%

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

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

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

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

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

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

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

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

    if -5.0000000000000001e29 < (*.f64 (PI.f64) l) < 1e10

    1. Initial program 87.1%

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

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

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

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

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\tan \left(\pi \cdot \ell\right)}{F} \cdot \frac{1}{F}} \]
    6. Step-by-step derivation
      1. clear-num98.9%

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

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

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

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

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

Alternative 2: 98.6% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 61.9%

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

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

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

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

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

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

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

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

    if -5.0000000000000001e29 < (*.f64 (PI.f64) l) < 1e10

    1. Initial program 87.1%

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

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

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

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

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

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

Alternative 3: 97.6% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (PI.f64) l) < -2e6 or 4.9999999999999999e-13 < (*.f64 (PI.f64) l)

    1. Initial program 64.0%

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

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

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

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

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

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

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

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

    if -2e6 < (*.f64 (PI.f64) l) < 4.9999999999999999e-13

    1. Initial program 87.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.6%

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

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

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

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

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

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

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

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

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

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

Alternative 4: 98.1% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 64.0%

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

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

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

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

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

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

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

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

    if -3.8e5 < l < 0.0379999999999999991

    1. Initial program 87.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.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 92.0% accurate, 1.5× speedup?

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

    1. Initial program 64.0%

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

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

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

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

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

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

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

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

    if -3.8e5 < l < 0.0379999999999999991

    1. Initial program 87.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.6%

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

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

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

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

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

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

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

Alternative 6: 74.5% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 10^{-292} \lor \neg \left(F \cdot F \leq 5 \cdot 10^{-138}\right) \land F \cdot F \leq 2 \cdot 10^{-80}:\\
\;\;\;\;\frac{\ell}{F} \cdot \frac{-1}{\frac{F}{\pi}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 F F) < 1.0000000000000001e-292 or 4.99999999999999989e-138 < (*.f64 F F) < 1.99999999999999992e-80

    1. Initial program 47.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\ell}{\frac{{F}^{2}}{\pi}}} \]
      3. distribute-neg-frac44.7%

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

        \[\leadsto \frac{-\ell}{\frac{\color{blue}{F \cdot F}}{\pi}} \]
      5. *-lft-identity44.7%

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

        \[\leadsto \frac{-\ell}{\color{blue}{\frac{F}{1} \cdot \frac{F}{\pi}}} \]
      7. /-rgt-identity44.7%

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

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

        \[\leadsto \frac{\color{blue}{-1 \cdot \ell}}{F \cdot \frac{F}{\pi}} \]
      2. *-commutative44.7%

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

        \[\leadsto \color{blue}{\frac{-1}{\frac{F}{\pi}} \cdot \frac{\ell}{F}} \]
    11. Applied egg-rr63.0%

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

    if 1.0000000000000001e-292 < (*.f64 F F) < 4.99999999999999989e-138 or 1.99999999999999992e-80 < (*.f64 F F)

    1. Initial program 90.7%

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

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

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

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

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

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

Alternative 7: 74.5% accurate, 2.6× speedup?

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

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

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

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


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

    1. Initial program 38.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\ell}{\frac{{F}^{2}}{\pi}}} \]
      3. distribute-neg-frac39.1%

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

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

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

        \[\leadsto \frac{-\ell}{\color{blue}{\frac{F}{1} \cdot \frac{F}{\pi}}} \]
      7. /-rgt-identity39.1%

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

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

        \[\leadsto \frac{\color{blue}{-1 \cdot \ell}}{F \cdot \frac{F}{\pi}} \]
      2. times-frac61.7%

        \[\leadsto \color{blue}{\frac{-1}{F} \cdot \frac{\ell}{\frac{F}{\pi}}} \]
    11. Applied egg-rr61.7%

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

    if 1.0000000000000001e-292 < (*.f64 F F) < 4.99999999999999989e-138 or 1.99999999999999992e-80 < (*.f64 F F)

    1. Initial program 90.7%

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

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

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

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

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

    if 4.99999999999999989e-138 < (*.f64 F F) < 1.99999999999999992e-80

    1. Initial program 85.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 73.1% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.35 \cdot 10^{-24} \lor \neg \left(\ell \leq -7 \cdot 10^{-155} \lor \neg \left(\ell \leq 1.1 \cdot 10^{-145}\right) \land \ell \leq 1.5 \cdot 10^{-79}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -1.35000000000000003e-24 or -7.00000000000000031e-155 < l < 1.1e-145 or 1.5e-79 < l

    1. Initial program 74.1%

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

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

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

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

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

    if -1.35000000000000003e-24 < l < -7.00000000000000031e-155 or 1.1e-145 < l < 1.5e-79

    1. Initial program 87.5%

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

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

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\tan \left(\pi \cdot \ell\right)}}{F \cdot F} \]
    3. Simplified89.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.6%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.35 \cdot 10^{-24} \lor \neg \left(\ell \leq -7 \cdot 10^{-155} \lor \neg \left(\ell \leq 1.1 \cdot 10^{-145}\right) \land \ell \leq 1.5 \cdot 10^{-79}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\frac{\pi \cdot \left(-\ell\right)}{F \cdot F}\\ \end{array} \]

Alternative 9: 73.2% accurate, 2.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.5 \cdot 10^{-23}:\\
\;\;\;\;\pi \cdot \ell\\

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

\mathbf{elif}\;\ell \leq 3.8 \cdot 10^{-142} \lor \neg \left(\ell \leq 6.7 \cdot 10^{-80}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if l < -5.5000000000000001e-23 or -9.600000000000001e-155 < l < 3.79999999999999972e-142 or 6.70000000000000002e-80 < l

    1. Initial program 74.1%

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

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

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

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

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

    if -5.5000000000000001e-23 < l < -9.600000000000001e-155

    1. Initial program 89.0%

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

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

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

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

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

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

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

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

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

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

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

    if 3.79999999999999972e-142 < l < 6.70000000000000002e-80

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\frac{\ell}{\frac{{F}^{2}}{\pi}}} \]
      3. distribute-neg-frac60.7%

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

        \[\leadsto \frac{-\ell}{\frac{\color{blue}{F \cdot F}}{\pi}} \]
      5. *-lft-identity60.7%

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

        \[\leadsto \frac{-\ell}{\color{blue}{\frac{F}{1} \cdot \frac{F}{\pi}}} \]
      7. /-rgt-identity61.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -5.5 \cdot 10^{-23}:\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{elif}\;\ell \leq -9.6 \cdot 10^{-155}:\\ \;\;\;\;\frac{\pi \cdot \left(-\ell\right)}{F \cdot F}\\ \mathbf{elif}\;\ell \leq 3.8 \cdot 10^{-142} \lor \neg \left(\ell \leq 6.7 \cdot 10^{-80}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\frac{-\ell}{F \cdot \frac{F}{\pi}}\\ \end{array} \]

Alternative 10: 73.4% accurate, 3.0× speedup?

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\ell \cdot \pi} \]
  8. Final simplification71.3%

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

Reproduce

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