VandenBroeck and Keller, Equation (6)

Percentage Accurate: 76.8% → 98.8%
Time: 16.4s
Alternatives: 7
Speedup: 2.8×

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 7 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.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.8% accurate, 0.4× speedup?

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

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

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


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

    1. Initial program 71.4%

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

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

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

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

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

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

      \[\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 -1e27 < (*.f64 (PI.f64) l) < 1e10

    1. Initial program 88.2%

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

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

        \[\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}} \]
    4. Step-by-step derivation
      1. tan-quot99.0%

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

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

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

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

Alternative 2: 98.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -1 \cdot 10^{+27} \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) -1e+27) (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) <= -1e+27) || !((((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) <= -1e+27) || !((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) <= -1e+27) 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) <= -1e+27) || !(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) <= -1e+27) || ~(((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], -1e+27], 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 -1 \cdot 10^{+27} \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) < -1e27 or 1e10 < (*.f64 (PI.f64) l)

    1. Initial program 71.4%

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

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

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

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

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

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

      \[\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 -1e27 < (*.f64 (PI.f64) l) < 1e10

    1. Initial program 88.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\pi \cdot \ell \leq -1 \cdot 10^{+27} \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: 98.4% accurate, 0.7× speedup?

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

    1. Initial program 71.7%

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

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

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

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

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

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

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

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

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

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 93.0% accurate, 2.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if l < -3.3e12 or 8.6e8 < l

    1. Initial program 71.7%

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

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

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

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

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

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

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

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

    if -3.3e12 < l < 8.6e8

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell + \left(\frac{\color{blue}{-1}}{F} \cdot \frac{\pi}{F}\right) \cdot \ell \]
      8. distribute-neg-frac87.9%

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

        \[\leadsto \pi \cdot \ell + \color{blue}{\left(-\frac{1}{F}\right) \cdot \left(\frac{\pi}{F} \cdot \ell\right)} \]
      10. distribute-neg-frac98.9%

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

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

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

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

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

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

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

        \[\leadsto \pi \cdot \ell + \color{blue}{-1 \cdot \frac{\ell \cdot \pi}{{F}^{2}}} \]
    9. Simplified88.6%

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

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

Alternative 5: 69.2% accurate, 2.8× speedup?

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

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

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


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

    1. Initial program 49.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-173 < (*.f64 F F)

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

Alternative 6: 74.6% accurate, 2.8× speedup?

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

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

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


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

    1. Initial program 49.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-173 < (*.f64 F F)

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

Alternative 7: 73.8% accurate, 3.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

Reproduce

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