VandenBroeck and Keller, Equation (6)

Percentage Accurate: 75.4% → 99.3%
Time: 18.8s
Alternatives: 10
Speedup: 3.7×

Specification

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

\\
\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 10 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 75.4% accurate, 1.0× speedup?

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

\\
\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)
\end{array}

Alternative 1: 99.3% accurate, 0.9× speedup?

\[\begin{array}{l} l\_m = \left|\ell\right| \\ l\_s = \mathsf{copysign}\left(1, \ell\right) \\ l\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \cdot \pi \leq 10^{+15}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\tan \left(l\_m \cdot \pi\right)}{F}, \frac{-1}{F}, l\_m \cdot \pi\right)\\ \mathbf{else}:\\ \;\;\;\;l\_m \cdot \pi\\ \end{array} \end{array} \]
l\_m = (fabs.f64 l)
l\_s = (copysign.f64 #s(literal 1 binary64) l)
(FPCore (l_s F l_m)
 :precision binary64
 (*
  l_s
  (if (<= (* l_m PI) 1e+15)
    (fma (/ (tan (* l_m PI)) F) (/ -1.0 F) (* l_m PI))
    (* l_m PI))))
l\_m = fabs(l);
l\_s = copysign(1.0, l);
double code(double l_s, double F, double l_m) {
	double tmp;
	if ((l_m * ((double) M_PI)) <= 1e+15) {
		tmp = fma((tan((l_m * ((double) M_PI))) / F), (-1.0 / F), (l_m * ((double) M_PI)));
	} else {
		tmp = l_m * ((double) M_PI);
	}
	return l_s * tmp;
}
l\_m = abs(l)
l\_s = copysign(1.0, l)
function code(l_s, F, l_m)
	tmp = 0.0
	if (Float64(l_m * pi) <= 1e+15)
		tmp = fma(Float64(tan(Float64(l_m * pi)) / F), Float64(-1.0 / F), Float64(l_m * pi));
	else
		tmp = Float64(l_m * pi);
	end
	return Float64(l_s * tmp)
end
l\_m = N[Abs[l], $MachinePrecision]
l\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[l]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[l$95$s_, F_, l$95$m_] := N[(l$95$s * If[LessEqual[N[(l$95$m * Pi), $MachinePrecision], 1e+15], N[(N[(N[Tan[N[(l$95$m * Pi), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision] + N[(l$95$m * Pi), $MachinePrecision]), $MachinePrecision], N[(l$95$m * Pi), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l\_m = \left|\ell\right|
\\
l\_s = \mathsf{copysign}\left(1, \ell\right)

\\
l\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \cdot \pi \leq 10^{+15}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\tan \left(l\_m \cdot \pi\right)}{F}, \frac{-1}{F}, l\_m \cdot \pi\right)\\

\mathbf{else}:\\
\;\;\;\;l\_m \cdot \pi\\


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

    1. Initial program 86.9%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift--.f64N/A

        \[\leadsto \color{blue}{\mathsf{PI}\left(\right) \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\mathsf{PI}\left(\right) \cdot \ell\right)} \]
      2. sub-negN/A

        \[\leadsto \color{blue}{\mathsf{PI}\left(\right) \cdot \ell + \left(\mathsf{neg}\left(\frac{1}{F \cdot F} \cdot \tan \left(\mathsf{PI}\left(\right) \cdot \ell\right)\right)\right)} \]
      3. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{F \cdot F} \cdot \tan \left(\mathsf{PI}\left(\right) \cdot \ell\right)\right)\right) + \mathsf{PI}\left(\right) \cdot \ell} \]
      4. lift-*.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{1}{F \cdot F} \cdot \tan \left(\mathsf{PI}\left(\right) \cdot \ell\right)}\right)\right) + \mathsf{PI}\left(\right) \cdot \ell \]
      5. *-commutativeN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\tan \left(\mathsf{PI}\left(\right) \cdot \ell\right) \cdot \frac{1}{F \cdot F}}\right)\right) + \mathsf{PI}\left(\right) \cdot \ell \]
      6. lift-/.f64N/A

        \[\leadsto \left(\mathsf{neg}\left(\tan \left(\mathsf{PI}\left(\right) \cdot \ell\right) \cdot \color{blue}{\frac{1}{F \cdot F}}\right)\right) + \mathsf{PI}\left(\right) \cdot \ell \]
      7. un-div-invN/A

        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\frac{\tan \left(\mathsf{PI}\left(\right) \cdot \ell\right)}{F \cdot F}}\right)\right) + \mathsf{PI}\left(\right) \cdot \ell \]
      8. distribute-neg-frac2N/A

        \[\leadsto \color{blue}{\frac{\tan \left(\mathsf{PI}\left(\right) \cdot \ell\right)}{\mathsf{neg}\left(F \cdot F\right)}} + \mathsf{PI}\left(\right) \cdot \ell \]
      9. *-rgt-identityN/A

        \[\leadsto \frac{\color{blue}{\tan \left(\mathsf{PI}\left(\right) \cdot \ell\right) \cdot 1}}{\mathsf{neg}\left(F \cdot F\right)} + \mathsf{PI}\left(\right) \cdot \ell \]
      10. lift-*.f64N/A

        \[\leadsto \frac{\tan \left(\mathsf{PI}\left(\right) \cdot \ell\right) \cdot 1}{\mathsf{neg}\left(\color{blue}{F \cdot F}\right)} + \mathsf{PI}\left(\right) \cdot \ell \]
      11. distribute-rgt-neg-inN/A

        \[\leadsto \frac{\tan \left(\mathsf{PI}\left(\right) \cdot \ell\right) \cdot 1}{\color{blue}{F \cdot \left(\mathsf{neg}\left(F\right)\right)}} + \mathsf{PI}\left(\right) \cdot \ell \]
      12. times-fracN/A

        \[\leadsto \color{blue}{\frac{\tan \left(\mathsf{PI}\left(\right) \cdot \ell\right)}{F} \cdot \frac{1}{\mathsf{neg}\left(F\right)}} + \mathsf{PI}\left(\right) \cdot \ell \]
      13. distribute-neg-frac2N/A

        \[\leadsto \frac{\tan \left(\mathsf{PI}\left(\right) \cdot \ell\right)}{F} \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{1}{F}\right)\right)} + \mathsf{PI}\left(\right) \cdot \ell \]
      14. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\tan \left(\mathsf{PI}\left(\right) \cdot \ell\right)}{F}, \mathsf{neg}\left(\frac{1}{F}\right), \mathsf{PI}\left(\right) \cdot \ell\right)} \]
    4. Applied rewrites97.6%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{\tan \left(\ell \cdot \pi\right)}{F}, \frac{-1}{F}, \ell \cdot \pi\right)} \]

    if 1e15 < (*.f64 (PI.f64) l)

    1. Initial program 63.1%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Add Preprocessing
    3. Taylor expanded in l around inf

      \[\leadsto \color{blue}{\ell \cdot \mathsf{PI}\left(\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\mathsf{PI}\left(\right) \cdot \ell} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\mathsf{PI}\left(\right) \cdot \ell} \]
      3. lower-PI.f6499.7

        \[\leadsto \color{blue}{\pi} \cdot \ell \]
    5. Applied rewrites99.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \cdot \pi \leq 10^{+15}:\\ \;\;\;\;\mathsf{fma}\left(\frac{\tan \left(\ell \cdot \pi\right)}{F}, \frac{-1}{F}, \ell \cdot \pi\right)\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \pi\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 83.1% accurate, 0.8× speedup?

\[\begin{array}{l} l\_m = \left|\ell\right| \\ l\_s = \mathsf{copysign}\left(1, \ell\right) \\ l\_s \cdot \begin{array}{l} \mathbf{if}\;l\_m \cdot \pi - \tan \left(l\_m \cdot \pi\right) \cdot \frac{1}{F \cdot F} \leq -5 \cdot 10^{-292}:\\ \;\;\;\;\frac{\left(-l\_m\right) \cdot \pi}{F \cdot F}\\ \mathbf{else}:\\ \;\;\;\;l\_m \cdot \pi\\ \end{array} \end{array} \]
l\_m = (fabs.f64 l)
l\_s = (copysign.f64 #s(literal 1 binary64) l)
(FPCore (l_s F l_m)
 :precision binary64
 (*
  l_s
  (if (<= (- (* l_m PI) (* (tan (* l_m PI)) (/ 1.0 (* F F)))) -5e-292)
    (/ (* (- l_m) PI) (* F F))
    (* l_m PI))))
l\_m = fabs(l);
l\_s = copysign(1.0, l);
double code(double l_s, double F, double l_m) {
	double tmp;
	if (((l_m * ((double) M_PI)) - (tan((l_m * ((double) M_PI))) * (1.0 / (F * F)))) <= -5e-292) {
		tmp = (-l_m * ((double) M_PI)) / (F * F);
	} else {
		tmp = l_m * ((double) M_PI);
	}
	return l_s * tmp;
}
l\_m = Math.abs(l);
l\_s = Math.copySign(1.0, l);
public static double code(double l_s, double F, double l_m) {
	double tmp;
	if (((l_m * Math.PI) - (Math.tan((l_m * Math.PI)) * (1.0 / (F * F)))) <= -5e-292) {
		tmp = (-l_m * Math.PI) / (F * F);
	} else {
		tmp = l_m * Math.PI;
	}
	return l_s * tmp;
}
l\_m = math.fabs(l)
l\_s = math.copysign(1.0, l)
def code(l_s, F, l_m):
	tmp = 0
	if ((l_m * math.pi) - (math.tan((l_m * math.pi)) * (1.0 / (F * F)))) <= -5e-292:
		tmp = (-l_m * math.pi) / (F * F)
	else:
		tmp = l_m * math.pi
	return l_s * tmp
l\_m = abs(l)
l\_s = copysign(1.0, l)
function code(l_s, F, l_m)
	tmp = 0.0
	if (Float64(Float64(l_m * pi) - Float64(tan(Float64(l_m * pi)) * Float64(1.0 / Float64(F * F)))) <= -5e-292)
		tmp = Float64(Float64(Float64(-l_m) * pi) / Float64(F * F));
	else
		tmp = Float64(l_m * pi);
	end
	return Float64(l_s * tmp)
end
l\_m = abs(l);
l\_s = sign(l) * abs(1.0);
function tmp_2 = code(l_s, F, l_m)
	tmp = 0.0;
	if (((l_m * pi) - (tan((l_m * pi)) * (1.0 / (F * F)))) <= -5e-292)
		tmp = (-l_m * pi) / (F * F);
	else
		tmp = l_m * pi;
	end
	tmp_2 = l_s * tmp;
end
l\_m = N[Abs[l], $MachinePrecision]
l\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[l]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[l$95$s_, F_, l$95$m_] := N[(l$95$s * If[LessEqual[N[(N[(l$95$m * Pi), $MachinePrecision] - N[(N[Tan[N[(l$95$m * Pi), $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-292], N[(N[((-l$95$m) * Pi), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision], N[(l$95$m * Pi), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
l\_m = \left|\ell\right|
\\
l\_s = \mathsf{copysign}\left(1, \ell\right)

\\
l\_s \cdot \begin{array}{l}
\mathbf{if}\;l\_m \cdot \pi - \tan \left(l\_m \cdot \pi\right) \cdot \frac{1}{F \cdot F} \leq -5 \cdot 10^{-292}:\\
\;\;\;\;\frac{\left(-l\_m\right) \cdot \pi}{F \cdot F}\\

\mathbf{else}:\\
\;\;\;\;l\_m \cdot \pi\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (*.f64 (PI.f64) l) (*.f64 (/.f64 #s(literal 1 binary64) (*.f64 F F)) (tan.f64 (*.f64 (PI.f64) l)))) < -4.99999999999999981e-292

    1. Initial program 55.8%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{\sin \left(\ell \cdot \mathsf{PI}\left(\right)\right)}{{F}^{2} \cdot \cos \left(\ell \cdot \mathsf{PI}\left(\right)\right)}} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{\sin \left(\ell \cdot \mathsf{PI}\left(\right)\right)}{{F}^{2} \cdot \cos \left(\ell \cdot \mathsf{PI}\left(\right)\right)}\right)} \]
      2. distribute-neg-frac2N/A

        \[\leadsto \color{blue}{\frac{\sin \left(\ell \cdot \mathsf{PI}\left(\right)\right)}{\mathsf{neg}\left({F}^{2} \cdot \cos \left(\ell \cdot \mathsf{PI}\left(\right)\right)\right)}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\sin \left(\ell \cdot \mathsf{PI}\left(\right)\right)}{\mathsf{neg}\left({F}^{2} \cdot \cos \left(\ell \cdot \mathsf{PI}\left(\right)\right)\right)}} \]
      4. lower-sin.f64N/A

        \[\leadsto \frac{\color{blue}{\sin \left(\ell \cdot \mathsf{PI}\left(\right)\right)}}{\mathsf{neg}\left({F}^{2} \cdot \cos \left(\ell \cdot \mathsf{PI}\left(\right)\right)\right)} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \ell\right)}}{\mathsf{neg}\left({F}^{2} \cdot \cos \left(\ell \cdot \mathsf{PI}\left(\right)\right)\right)} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\sin \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \ell\right)}}{\mathsf{neg}\left({F}^{2} \cdot \cos \left(\ell \cdot \mathsf{PI}\left(\right)\right)\right)} \]
      7. lower-PI.f64N/A

        \[\leadsto \frac{\sin \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \ell\right)}{\mathsf{neg}\left({F}^{2} \cdot \cos \left(\ell \cdot \mathsf{PI}\left(\right)\right)\right)} \]
      8. distribute-lft-neg-inN/A

        \[\leadsto \frac{\sin \left(\mathsf{PI}\left(\right) \cdot \ell\right)}{\color{blue}{\left(\mathsf{neg}\left({F}^{2}\right)\right) \cdot \cos \left(\ell \cdot \mathsf{PI}\left(\right)\right)}} \]
      9. lower-*.f64N/A

        \[\leadsto \frac{\sin \left(\mathsf{PI}\left(\right) \cdot \ell\right)}{\color{blue}{\left(\mathsf{neg}\left({F}^{2}\right)\right) \cdot \cos \left(\ell \cdot \mathsf{PI}\left(\right)\right)}} \]
      10. unpow2N/A

        \[\leadsto \frac{\sin \left(\mathsf{PI}\left(\right) \cdot \ell\right)}{\left(\mathsf{neg}\left(\color{blue}{F \cdot F}\right)\right) \cdot \cos \left(\ell \cdot \mathsf{PI}\left(\right)\right)} \]
      11. distribute-lft-neg-inN/A

        \[\leadsto \frac{\sin \left(\mathsf{PI}\left(\right) \cdot \ell\right)}{\color{blue}{\left(\left(\mathsf{neg}\left(F\right)\right) \cdot F\right)} \cdot \cos \left(\ell \cdot \mathsf{PI}\left(\right)\right)} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{\sin \left(\mathsf{PI}\left(\right) \cdot \ell\right)}{\color{blue}{\left(\left(\mathsf{neg}\left(F\right)\right) \cdot F\right)} \cdot \cos \left(\ell \cdot \mathsf{PI}\left(\right)\right)} \]
      13. lower-neg.f64N/A

        \[\leadsto \frac{\sin \left(\mathsf{PI}\left(\right) \cdot \ell\right)}{\left(\color{blue}{\left(\mathsf{neg}\left(F\right)\right)} \cdot F\right) \cdot \cos \left(\ell \cdot \mathsf{PI}\left(\right)\right)} \]
      14. lower-cos.f64N/A

        \[\leadsto \frac{\sin \left(\mathsf{PI}\left(\right) \cdot \ell\right)}{\left(\left(\mathsf{neg}\left(F\right)\right) \cdot F\right) \cdot \color{blue}{\cos \left(\ell \cdot \mathsf{PI}\left(\right)\right)}} \]
      15. *-commutativeN/A

        \[\leadsto \frac{\sin \left(\mathsf{PI}\left(\right) \cdot \ell\right)}{\left(\left(\mathsf{neg}\left(F\right)\right) \cdot F\right) \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \ell\right)}} \]
      16. lower-*.f64N/A

        \[\leadsto \frac{\sin \left(\mathsf{PI}\left(\right) \cdot \ell\right)}{\left(\left(\mathsf{neg}\left(F\right)\right) \cdot F\right) \cdot \cos \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \ell\right)}} \]
      17. lower-PI.f6456.2

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

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

      \[\leadsto -1 \cdot \color{blue}{\frac{\ell \cdot \mathsf{PI}\left(\right)}{{F}^{2}}} \]
    7. Step-by-step derivation
      1. Applied rewrites54.4%

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

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

        if -4.99999999999999981e-292 < (-.f64 (*.f64 (PI.f64) l) (*.f64 (/.f64 #s(literal 1 binary64) (*.f64 F F)) (tan.f64 (*.f64 (PI.f64) l))))

        1. Initial program 86.0%

          \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
        2. Add Preprocessing
        3. Taylor expanded in l around inf

          \[\leadsto \color{blue}{\ell \cdot \mathsf{PI}\left(\right)} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{\mathsf{PI}\left(\right) \cdot \ell} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\mathsf{PI}\left(\right) \cdot \ell} \]
          3. lower-PI.f6498.0

            \[\leadsto \color{blue}{\pi} \cdot \ell \]
        5. Applied rewrites98.0%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \cdot \pi - \tan \left(\ell \cdot \pi\right) \cdot \frac{1}{F \cdot F} \leq -5 \cdot 10^{-292}:\\ \;\;\;\;\frac{\left(-\ell\right) \cdot \pi}{F \cdot F}\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \pi\\ \end{array} \]
      5. Add Preprocessing

      Reproduce

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