VandenBroeck and Keller, Equation (6)

Percentage Accurate: 76.9% → 98.3%
Time: 25.9s
Alternatives: 11
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 11 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.9% 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.3% accurate, 0.6× speedup?

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

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

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


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

    1. Initial program 65.1%

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

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

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

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

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

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

      \[\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 -1.99999999999999991e37 < (*.f64 (PI.f64) l) < 2e14

    1. Initial program 89.1%

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

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

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

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

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

Alternative 2: 98.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;\pi \cdot \ell \leq -2 \cdot 10^{+37} \lor \neg \left(\pi \cdot \ell \leq 2 \cdot 10^{+14}\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) < -1.99999999999999991e37 or 2e14 < (*.f64 (PI.f64) l)

    1. Initial program 65.1%

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

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

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

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

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

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

      \[\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 -1.99999999999999991e37 < (*.f64 (PI.f64) l) < 2e14

    1. Initial program 89.1%

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

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

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

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

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

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

Alternative 3: 98.5% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 66.2%

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

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

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

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

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

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

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

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

    if -4e13 < (*.f64 (PI.f64) l) < 0.050000000000000003

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 93.1% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 66.2%

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

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

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

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

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

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

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

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

    if -6.2e11 < l < 0.5

    1. Initial program 89.1%

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

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

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

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

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

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

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

Alternative 5: 98.5% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 66.2%

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

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

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

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

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

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

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

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

    if -6.2e11 < l < 0.5

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 92.7% accurate, 1.5× speedup?

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

    1. Initial program 66.2%

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

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

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

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

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

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

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

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

    if -6.2e11 < l < 0.5

    1. Initial program 89.1%

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

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

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

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

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

Alternative 7: 92.8% accurate, 1.5× speedup?

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

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

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


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

    1. Initial program 66.2%

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

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

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

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

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

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

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

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

    if -6.2e11 < l < 0.5

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

        \[\leadsto \ell \cdot \left(\pi - \frac{\pi}{\color{blue}{F \cdot F}}\right) \]
      2. /-rgt-identity87.8%

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

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

        \[\leadsto \ell \cdot \left(\pi - \color{blue}{\frac{\pi}{F} \cdot \frac{1}{F}}\right) \]
      5. *-rgt-identity87.8%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\pi \cdot \left(\ell - {F}^{-2} \cdot \ell\right)} \]
      16. *-commutative87.9%

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

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

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

Alternative 8: 74.6% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq 6.2 \cdot 10^{-280} \lor \neg \left(F \leq 8.2 \cdot 10^{-206}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 6.20000000000000042e-280 or 8.20000000000000032e-206 < F

    1. Initial program 78.4%

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

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

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

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

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

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

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

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

    if 6.20000000000000042e-280 < F < 8.20000000000000032e-206

    1. Initial program 50.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;F \leq 6.2 \cdot 10^{-280} \lor \neg \left(F \leq 8.2 \cdot 10^{-206}\right):\\ \;\;\;\;\pi \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \left(\frac{\ell}{F} \cdot \frac{-1}{F}\right)\\ \end{array} \]

Alternative 9: 74.6% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.8 \cdot 10^{-282} \lor \neg \left(F \leq 9 \cdot 10^{-208}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 2.7999999999999999e-282 or 8.9999999999999992e-208 < F

    1. Initial program 78.4%

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

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

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

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

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

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

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

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

    if 2.7999999999999999e-282 < F < 8.9999999999999992e-208

    1. Initial program 50.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-\frac{\ell}{F \cdot \frac{F}{\pi}}} \]
    12. Step-by-step derivation
      1. *-un-lft-identity49.4%

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

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

        \[\leadsto -\color{blue}{\frac{1}{\frac{F}{\pi}} \cdot \frac{\ell}{F}} \]
      4. clear-num76.2%

        \[\leadsto -\color{blue}{\frac{\pi}{F}} \cdot \frac{\ell}{F} \]
    13. Applied egg-rr76.2%

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

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

Alternative 10: 74.6% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.3 \cdot 10^{-282} \lor \neg \left(F \leq 5.8 \cdot 10^{-205}\right):\\
\;\;\;\;\pi \cdot \ell\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if F < 3.3e-282 or 5.80000000000000036e-205 < F

    1. Initial program 78.4%

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

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

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

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

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

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

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

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

    if 3.3e-282 < F < 5.80000000000000036e-205

    1. Initial program 50.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 74.6% 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.6%

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

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

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

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

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

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

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

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

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

Reproduce

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