VandenBroeck and Keller, Equation (6)

Percentage Accurate: 76.4% → 96.6%
Time: 25.9s
Alternatives: 13
Speedup: 1.0×

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 13 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.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: 96.6% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \pi \cdot \ell + \frac{\frac{\frac{-1}{\frac{1 + {\ell}^{2} \cdot \left(-0.5 \cdot {\pi}^{2} + {\ell}^{2} \cdot \left(-0.001388888888888889 \cdot \left({\ell}^{2} \cdot {\pi}^{6}\right) + 0.041666666666666664 \cdot {\pi}^{4}\right)\right)}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F} \end{array} \]
(FPCore (F l)
 :precision binary64
 (+
  (* PI l)
  (/
   (/
    (/
     -1.0
     (/
      (+
       1.0
       (*
        (pow l 2.0)
        (+
         (* -0.5 (pow PI 2.0))
         (*
          (pow l 2.0)
          (+
           (* -0.001388888888888889 (* (pow l 2.0) (pow PI 6.0)))
           (* 0.041666666666666664 (pow PI 4.0)))))))
      (sin (* PI l))))
    F)
   F)))
double code(double F, double l) {
	return (((double) M_PI) * l) + (((-1.0 / ((1.0 + (pow(l, 2.0) * ((-0.5 * pow(((double) M_PI), 2.0)) + (pow(l, 2.0) * ((-0.001388888888888889 * (pow(l, 2.0) * pow(((double) M_PI), 6.0))) + (0.041666666666666664 * pow(((double) M_PI), 4.0))))))) / sin((((double) M_PI) * l)))) / F) / F);
}
public static double code(double F, double l) {
	return (Math.PI * l) + (((-1.0 / ((1.0 + (Math.pow(l, 2.0) * ((-0.5 * Math.pow(Math.PI, 2.0)) + (Math.pow(l, 2.0) * ((-0.001388888888888889 * (Math.pow(l, 2.0) * Math.pow(Math.PI, 6.0))) + (0.041666666666666664 * Math.pow(Math.PI, 4.0))))))) / Math.sin((Math.PI * l)))) / F) / F);
}
def code(F, l):
	return (math.pi * l) + (((-1.0 / ((1.0 + (math.pow(l, 2.0) * ((-0.5 * math.pow(math.pi, 2.0)) + (math.pow(l, 2.0) * ((-0.001388888888888889 * (math.pow(l, 2.0) * math.pow(math.pi, 6.0))) + (0.041666666666666664 * math.pow(math.pi, 4.0))))))) / math.sin((math.pi * l)))) / F) / F)
function code(F, l)
	return Float64(Float64(pi * l) + Float64(Float64(Float64(-1.0 / Float64(Float64(1.0 + Float64((l ^ 2.0) * Float64(Float64(-0.5 * (pi ^ 2.0)) + Float64((l ^ 2.0) * Float64(Float64(-0.001388888888888889 * Float64((l ^ 2.0) * (pi ^ 6.0))) + Float64(0.041666666666666664 * (pi ^ 4.0))))))) / sin(Float64(pi * l)))) / F) / F))
end
function tmp = code(F, l)
	tmp = (pi * l) + (((-1.0 / ((1.0 + ((l ^ 2.0) * ((-0.5 * (pi ^ 2.0)) + ((l ^ 2.0) * ((-0.001388888888888889 * ((l ^ 2.0) * (pi ^ 6.0))) + (0.041666666666666664 * (pi ^ 4.0))))))) / sin((pi * l)))) / F) / F);
end
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] + N[(N[(N[(-1.0 / N[(N[(1.0 + N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[(-0.5 * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision] + N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[(-0.001388888888888889 * N[(N[Power[l, 2.0], $MachinePrecision] * N[Power[Pi, 6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.041666666666666664 * N[Power[Pi, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[N[(Pi * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\pi \cdot \ell + \frac{\frac{\frac{-1}{\frac{1 + {\ell}^{2} \cdot \left(-0.5 \cdot {\pi}^{2} + {\ell}^{2} \cdot \left(-0.001388888888888889 \cdot \left({\ell}^{2} \cdot {\pi}^{6}\right) + 0.041666666666666664 \cdot {\pi}^{4}\right)\right)}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F}
\end{array}
Derivation
  1. Initial program 76.4%

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

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

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

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

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

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

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

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

    \[\leadsto \pi \cdot \ell - \frac{\frac{\frac{1}{\frac{\color{blue}{1 + {\ell}^{2} \cdot \left(-0.5 \cdot {\pi}^{2} + {\ell}^{2} \cdot \left(-0.001388888888888889 \cdot \left({\ell}^{2} \cdot {\pi}^{6}\right) + 0.041666666666666664 \cdot {\pi}^{4}\right)\right)}}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F} \]
  8. Final simplification95.7%

    \[\leadsto \pi \cdot \ell + \frac{\frac{\frac{-1}{\frac{1 + {\ell}^{2} \cdot \left(-0.5 \cdot {\pi}^{2} + {\ell}^{2} \cdot \left(-0.001388888888888889 \cdot \left({\ell}^{2} \cdot {\pi}^{6}\right) + 0.041666666666666664 \cdot {\pi}^{4}\right)\right)}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F} \]
  9. Add Preprocessing

Alternative 2: 95.3% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \pi \cdot \ell + \frac{\frac{\frac{-1}{\frac{1 + {\ell}^{2} \cdot \left(-0.5 \cdot {\pi}^{2} + 0.041666666666666664 \cdot \left({\ell}^{2} \cdot {\pi}^{4}\right)\right)}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F} \end{array} \]
(FPCore (F l)
 :precision binary64
 (+
  (* PI l)
  (/
   (/
    (/
     -1.0
     (/
      (+
       1.0
       (*
        (pow l 2.0)
        (+
         (* -0.5 (pow PI 2.0))
         (* 0.041666666666666664 (* (pow l 2.0) (pow PI 4.0))))))
      (sin (* PI l))))
    F)
   F)))
double code(double F, double l) {
	return (((double) M_PI) * l) + (((-1.0 / ((1.0 + (pow(l, 2.0) * ((-0.5 * pow(((double) M_PI), 2.0)) + (0.041666666666666664 * (pow(l, 2.0) * pow(((double) M_PI), 4.0)))))) / sin((((double) M_PI) * l)))) / F) / F);
}
public static double code(double F, double l) {
	return (Math.PI * l) + (((-1.0 / ((1.0 + (Math.pow(l, 2.0) * ((-0.5 * Math.pow(Math.PI, 2.0)) + (0.041666666666666664 * (Math.pow(l, 2.0) * Math.pow(Math.PI, 4.0)))))) / Math.sin((Math.PI * l)))) / F) / F);
}
def code(F, l):
	return (math.pi * l) + (((-1.0 / ((1.0 + (math.pow(l, 2.0) * ((-0.5 * math.pow(math.pi, 2.0)) + (0.041666666666666664 * (math.pow(l, 2.0) * math.pow(math.pi, 4.0)))))) / math.sin((math.pi * l)))) / F) / F)
function code(F, l)
	return Float64(Float64(pi * l) + Float64(Float64(Float64(-1.0 / Float64(Float64(1.0 + Float64((l ^ 2.0) * Float64(Float64(-0.5 * (pi ^ 2.0)) + Float64(0.041666666666666664 * Float64((l ^ 2.0) * (pi ^ 4.0)))))) / sin(Float64(pi * l)))) / F) / F))
end
function tmp = code(F, l)
	tmp = (pi * l) + (((-1.0 / ((1.0 + ((l ^ 2.0) * ((-0.5 * (pi ^ 2.0)) + (0.041666666666666664 * ((l ^ 2.0) * (pi ^ 4.0)))))) / sin((pi * l)))) / F) / F);
end
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] + N[(N[(N[(-1.0 / N[(N[(1.0 + N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[(-0.5 * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision] + N[(0.041666666666666664 * N[(N[Power[l, 2.0], $MachinePrecision] * N[Power[Pi, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[N[(Pi * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\pi \cdot \ell + \frac{\frac{\frac{-1}{\frac{1 + {\ell}^{2} \cdot \left(-0.5 \cdot {\pi}^{2} + 0.041666666666666664 \cdot \left({\ell}^{2} \cdot {\pi}^{4}\right)\right)}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F}
\end{array}
Derivation
  1. Initial program 76.4%

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

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

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

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

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

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

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

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

    \[\leadsto \pi \cdot \ell - \frac{\frac{\frac{1}{\frac{\color{blue}{1 + {\ell}^{2} \cdot \left(-0.5 \cdot {\pi}^{2} + 0.041666666666666664 \cdot \left({\ell}^{2} \cdot {\pi}^{4}\right)\right)}}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F} \]
  8. Final simplification95.4%

    \[\leadsto \pi \cdot \ell + \frac{\frac{\frac{-1}{\frac{1 + {\ell}^{2} \cdot \left(-0.5 \cdot {\pi}^{2} + 0.041666666666666664 \cdot \left({\ell}^{2} \cdot {\pi}^{4}\right)\right)}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F} \]
  9. Add Preprocessing

Alternative 3: 95.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \pi \cdot \ell + \frac{\frac{-1}{F}}{F \cdot \frac{\mathsf{fma}\left({\ell}^{2}, \pi \cdot 0.16666666666666666 - {\ell}^{2} \cdot \left({\pi}^{3} \cdot -0.019444444444444445\right), \frac{1}{\pi}\right)}{\ell}} \end{array} \]
(FPCore (F l)
 :precision binary64
 (+
  (* PI l)
  (/
   (/ -1.0 F)
   (*
    F
    (/
     (fma
      (pow l 2.0)
      (-
       (* PI 0.16666666666666666)
       (* (pow l 2.0) (* (pow PI 3.0) -0.019444444444444445)))
      (/ 1.0 PI))
     l)))))
double code(double F, double l) {
	return (((double) M_PI) * l) + ((-1.0 / F) / (F * (fma(pow(l, 2.0), ((((double) M_PI) * 0.16666666666666666) - (pow(l, 2.0) * (pow(((double) M_PI), 3.0) * -0.019444444444444445))), (1.0 / ((double) M_PI))) / l)));
}
function code(F, l)
	return Float64(Float64(pi * l) + Float64(Float64(-1.0 / F) / Float64(F * Float64(fma((l ^ 2.0), Float64(Float64(pi * 0.16666666666666666) - Float64((l ^ 2.0) * Float64((pi ^ 3.0) * -0.019444444444444445))), Float64(1.0 / pi)) / l))))
end
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] + N[(N[(-1.0 / F), $MachinePrecision] / N[(F * N[(N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[(Pi * 0.16666666666666666), $MachinePrecision] - N[(N[Power[l, 2.0], $MachinePrecision] * N[(N[Power[Pi, 3.0], $MachinePrecision] * -0.019444444444444445), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / Pi), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\pi \cdot \ell + \frac{\frac{-1}{F}}{F \cdot \frac{\mathsf{fma}\left({\ell}^{2}, \pi \cdot 0.16666666666666666 - {\ell}^{2} \cdot \left({\pi}^{3} \cdot -0.019444444444444445\right), \frac{1}{\pi}\right)}{\ell}}
\end{array}
Derivation
  1. Initial program 76.4%

    \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. tan-quot76.4%

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

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

    \[\leadsto \pi \cdot \ell - \frac{1}{F \cdot F} \cdot \frac{\sin \left(\pi \cdot \ell\right)}{\color{blue}{1}} \]
  6. Step-by-step derivation
    1. /-rgt-identity75.6%

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\sin \left(\pi \cdot \ell\right) \cdot \frac{1}{F \cdot F}} \]
    3. /-rgt-identity75.6%

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

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

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

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

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

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{F \cdot F}}}{\frac{1}{\sin \left(\pi \cdot \ell\right)} \cdot F}} \]
    11. *-un-lft-identity64.6%

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

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

      \[\leadsto \pi \cdot \ell - \frac{\frac{\color{blue}{1}}{\sqrt{F \cdot F}}}{\frac{1}{\sin \left(\pi \cdot \ell\right)} \cdot F} \]
    14. sqrt-prod39.7%

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

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

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

    \[\leadsto \pi \cdot \ell - \frac{\frac{1}{F}}{\color{blue}{\frac{{\ell}^{2} \cdot \left(-1 \cdot \left({\ell}^{2} \cdot \left(-0.027777777777777776 \cdot {\pi}^{3} + 0.008333333333333333 \cdot {\pi}^{3}\right)\right) - -0.16666666666666666 \cdot \pi\right) + \frac{1}{\pi}}{\ell}} \cdot F} \]
  9. Step-by-step derivation
    1. fma-define95.0%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{F}}{\frac{\color{blue}{\mathsf{fma}\left({\ell}^{2}, -1 \cdot \left({\ell}^{2} \cdot \left(-0.027777777777777776 \cdot {\pi}^{3} + 0.008333333333333333 \cdot {\pi}^{3}\right)\right) - -0.16666666666666666 \cdot \pi, \frac{1}{\pi}\right)}}{\ell} \cdot F} \]
    2. cancel-sign-sub-inv95.0%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{F}}{\frac{\mathsf{fma}\left({\ell}^{2}, \color{blue}{-1 \cdot \left({\ell}^{2} \cdot \left(-0.027777777777777776 \cdot {\pi}^{3} + 0.008333333333333333 \cdot {\pi}^{3}\right)\right) + \left(--0.16666666666666666\right) \cdot \pi}, \frac{1}{\pi}\right)}{\ell} \cdot F} \]
    3. mul-1-neg95.0%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{F}}{\frac{\mathsf{fma}\left({\ell}^{2}, \color{blue}{\left(-{\ell}^{2} \cdot \left(-0.027777777777777776 \cdot {\pi}^{3} + 0.008333333333333333 \cdot {\pi}^{3}\right)\right)} + \left(--0.16666666666666666\right) \cdot \pi, \frac{1}{\pi}\right)}{\ell} \cdot F} \]
    4. distribute-rgt-out95.0%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{F}}{\frac{\mathsf{fma}\left({\ell}^{2}, \left(-{\ell}^{2} \cdot \color{blue}{\left({\pi}^{3} \cdot \left(-0.027777777777777776 + 0.008333333333333333\right)\right)}\right) + \left(--0.16666666666666666\right) \cdot \pi, \frac{1}{\pi}\right)}{\ell} \cdot F} \]
    5. metadata-eval95.0%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{F}}{\frac{\mathsf{fma}\left({\ell}^{2}, \left(-{\ell}^{2} \cdot \left({\pi}^{3} \cdot \color{blue}{-0.019444444444444445}\right)\right) + \left(--0.16666666666666666\right) \cdot \pi, \frac{1}{\pi}\right)}{\ell} \cdot F} \]
    6. metadata-eval95.0%

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{F}}{\frac{\mathsf{fma}\left({\ell}^{2}, \left(-{\ell}^{2} \cdot \left({\pi}^{3} \cdot -0.019444444444444445\right)\right) + \color{blue}{0.16666666666666666} \cdot \pi, \frac{1}{\pi}\right)}{\ell} \cdot F} \]
  10. Simplified95.0%

    \[\leadsto \pi \cdot \ell - \frac{\frac{1}{F}}{\color{blue}{\frac{\mathsf{fma}\left({\ell}^{2}, \left(-{\ell}^{2} \cdot \left({\pi}^{3} \cdot -0.019444444444444445\right)\right) + 0.16666666666666666 \cdot \pi, \frac{1}{\pi}\right)}{\ell}} \cdot F} \]
  11. Final simplification95.0%

    \[\leadsto \pi \cdot \ell + \frac{\frac{-1}{F}}{F \cdot \frac{\mathsf{fma}\left({\ell}^{2}, \pi \cdot 0.16666666666666666 - {\ell}^{2} \cdot \left({\pi}^{3} \cdot -0.019444444444444445\right), \frac{1}{\pi}\right)}{\ell}} \]
  12. Add Preprocessing

Alternative 4: 91.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;F \cdot F \leq 10^{-308}:\\ \;\;\;\;\pi \cdot \ell + \frac{\frac{-1}{F}}{F \cdot \frac{\frac{1}{\pi} + 0.16666666666666666 \cdot \left(\pi \cdot {\ell}^{2}\right)}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\pi \cdot \ell + \frac{\sin \left(\pi \cdot \ell\right)}{\mathsf{fma}\left(-0.5, {\left(\pi \cdot \ell\right)}^{2}, 1\right)} \cdot \frac{-1}{F \cdot F}\\ \end{array} \end{array} \]
(FPCore (F l)
 :precision binary64
 (if (<= (* F F) 1e-308)
   (+
    (* PI l)
    (/
     (/ -1.0 F)
     (* F (/ (+ (/ 1.0 PI) (* 0.16666666666666666 (* PI (pow l 2.0)))) l))))
   (+
    (* PI l)
    (*
     (/ (sin (* PI l)) (fma -0.5 (pow (* PI l) 2.0) 1.0))
     (/ -1.0 (* F F))))))
double code(double F, double l) {
	double tmp;
	if ((F * F) <= 1e-308) {
		tmp = (((double) M_PI) * l) + ((-1.0 / F) / (F * (((1.0 / ((double) M_PI)) + (0.16666666666666666 * (((double) M_PI) * pow(l, 2.0)))) / l)));
	} else {
		tmp = (((double) M_PI) * l) + ((sin((((double) M_PI) * l)) / fma(-0.5, pow((((double) M_PI) * l), 2.0), 1.0)) * (-1.0 / (F * F)));
	}
	return tmp;
}
function code(F, l)
	tmp = 0.0
	if (Float64(F * F) <= 1e-308)
		tmp = Float64(Float64(pi * l) + Float64(Float64(-1.0 / F) / Float64(F * Float64(Float64(Float64(1.0 / pi) + Float64(0.16666666666666666 * Float64(pi * (l ^ 2.0)))) / l))));
	else
		tmp = Float64(Float64(pi * l) + Float64(Float64(sin(Float64(pi * l)) / fma(-0.5, (Float64(pi * l) ^ 2.0), 1.0)) * Float64(-1.0 / Float64(F * F))));
	end
	return tmp
end
code[F_, l_] := If[LessEqual[N[(F * F), $MachinePrecision], 1e-308], N[(N[(Pi * l), $MachinePrecision] + N[(N[(-1.0 / F), $MachinePrecision] / N[(F * N[(N[(N[(1.0 / Pi), $MachinePrecision] + N[(0.16666666666666666 * N[(Pi * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(Pi * l), $MachinePrecision] + N[(N[(N[Sin[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / N[(-0.5 * N[Power[N[(Pi * l), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;F \cdot F \leq 10^{-308}:\\
\;\;\;\;\pi \cdot \ell + \frac{\frac{-1}{F}}{F \cdot \frac{\frac{1}{\pi} + 0.16666666666666666 \cdot \left(\pi \cdot {\ell}^{2}\right)}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\pi \cdot \ell + \frac{\sin \left(\pi \cdot \ell\right)}{\mathsf{fma}\left(-0.5, {\left(\pi \cdot \ell\right)}^{2}, 1\right)} \cdot \frac{-1}{F \cdot F}\\


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

    1. Initial program 37.3%

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

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

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

      \[\leadsto \pi \cdot \ell - \frac{1}{F \cdot F} \cdot \frac{\sin \left(\pi \cdot \ell\right)}{\color{blue}{1}} \]
    6. Step-by-step derivation
      1. /-rgt-identity35.7%

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

        \[\leadsto \pi \cdot \ell - \color{blue}{\sin \left(\pi \cdot \ell\right) \cdot \frac{1}{F \cdot F}} \]
      3. /-rgt-identity35.7%

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\sin \left(\pi \cdot \ell\right)}{1}} \cdot \frac{1}{F \cdot F} \]
      4. clear-num35.7%

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

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

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

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

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

        \[\leadsto \pi \cdot \ell - \frac{1}{\frac{1}{\sin \left(\pi \cdot \ell\right)}} \cdot \frac{\color{blue}{\sqrt{\frac{1}{F \cdot F}}}}{F} \]
      10. frac-times18.0%

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{F \cdot F}}}{\frac{1}{\sin \left(\pi \cdot \ell\right)} \cdot F}} \]
      11. *-un-lft-identity18.0%

        \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\sqrt{\frac{1}{F \cdot F}}}}{\frac{1}{\sin \left(\pi \cdot \ell\right)} \cdot F} \]
      12. sqrt-div19.2%

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

        \[\leadsto \pi \cdot \ell - \frac{\frac{\color{blue}{1}}{\sqrt{F \cdot F}}}{\frac{1}{\sin \left(\pi \cdot \ell\right)} \cdot F} \]
      14. sqrt-prod27.8%

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

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

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

      \[\leadsto \pi \cdot \ell - \frac{\frac{1}{F}}{\color{blue}{\frac{0.16666666666666666 \cdot \left({\ell}^{2} \cdot \pi\right) + \frac{1}{\pi}}{\ell}} \cdot F} \]

    if 9.9999999999999991e-309 < (*.f64 F F)

    1. Initial program 90.8%

      \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. tan-quot90.8%

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

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

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

        \[\leadsto \pi \cdot \ell - \frac{1}{F \cdot F} \cdot \frac{\sin \left(\pi \cdot \ell\right)}{\color{blue}{-0.5 \cdot \left({\ell}^{2} \cdot {\pi}^{2}\right) + 1}} \]
      2. fma-define97.9%

        \[\leadsto \pi \cdot \ell - \frac{1}{F \cdot F} \cdot \frac{\sin \left(\pi \cdot \ell\right)}{\color{blue}{\mathsf{fma}\left(-0.5, {\ell}^{2} \cdot {\pi}^{2}, 1\right)}} \]
      3. *-commutative97.9%

        \[\leadsto \pi \cdot \ell - \frac{1}{F \cdot F} \cdot \frac{\sin \left(\pi \cdot \ell\right)}{\mathsf{fma}\left(-0.5, \color{blue}{{\pi}^{2} \cdot {\ell}^{2}}, 1\right)} \]
      4. unpow297.9%

        \[\leadsto \pi \cdot \ell - \frac{1}{F \cdot F} \cdot \frac{\sin \left(\pi \cdot \ell\right)}{\mathsf{fma}\left(-0.5, \color{blue}{\left(\pi \cdot \pi\right)} \cdot {\ell}^{2}, 1\right)} \]
      5. unpow297.9%

        \[\leadsto \pi \cdot \ell - \frac{1}{F \cdot F} \cdot \frac{\sin \left(\pi \cdot \ell\right)}{\mathsf{fma}\left(-0.5, \left(\pi \cdot \pi\right) \cdot \color{blue}{\left(\ell \cdot \ell\right)}, 1\right)} \]
      6. swap-sqr97.9%

        \[\leadsto \pi \cdot \ell - \frac{1}{F \cdot F} \cdot \frac{\sin \left(\pi \cdot \ell\right)}{\mathsf{fma}\left(-0.5, \color{blue}{\left(\pi \cdot \ell\right) \cdot \left(\pi \cdot \ell\right)}, 1\right)} \]
      7. unpow297.9%

        \[\leadsto \pi \cdot \ell - \frac{1}{F \cdot F} \cdot \frac{\sin \left(\pi \cdot \ell\right)}{\mathsf{fma}\left(-0.5, \color{blue}{{\left(\pi \cdot \ell\right)}^{2}}, 1\right)} \]
      8. *-commutative97.9%

        \[\leadsto \pi \cdot \ell - \frac{1}{F \cdot F} \cdot \frac{\sin \left(\pi \cdot \ell\right)}{\mathsf{fma}\left(-0.5, {\color{blue}{\left(\ell \cdot \pi\right)}}^{2}, 1\right)} \]
    7. Simplified97.9%

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

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

Alternative 5: 91.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \pi \cdot \ell + \frac{\frac{\frac{-1}{\frac{\mathsf{fma}\left(-0.5, {\left(\pi \cdot \ell\right)}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F} \end{array} \]
(FPCore (F l)
 :precision binary64
 (+
  (* PI l)
  (/ (/ (/ -1.0 (/ (fma -0.5 (pow (* PI l) 2.0) 1.0) (sin (* PI l)))) F) F)))
double code(double F, double l) {
	return (((double) M_PI) * l) + (((-1.0 / (fma(-0.5, pow((((double) M_PI) * l), 2.0), 1.0) / sin((((double) M_PI) * l)))) / F) / F);
}
function code(F, l)
	return Float64(Float64(pi * l) + Float64(Float64(Float64(-1.0 / Float64(fma(-0.5, (Float64(pi * l) ^ 2.0), 1.0) / sin(Float64(pi * l)))) / F) / F))
end
code[F_, l_] := N[(N[(Pi * l), $MachinePrecision] + N[(N[(N[(-1.0 / N[(N[(-0.5 * N[Power[N[(Pi * l), $MachinePrecision], 2.0], $MachinePrecision] + 1.0), $MachinePrecision] / N[Sin[N[(Pi * l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\pi \cdot \ell + \frac{\frac{\frac{-1}{\frac{\mathsf{fma}\left(-0.5, {\left(\pi \cdot \ell\right)}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F}
\end{array}
Derivation
  1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

      \[\leadsto \pi \cdot \ell - \frac{\frac{\frac{1}{\frac{\color{blue}{-0.5 \cdot \left({\ell}^{2} \cdot {\pi}^{2}\right) + 1}}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F} \]
    2. fma-define91.9%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\frac{1}{\frac{\color{blue}{\mathsf{fma}\left(-0.5, {\ell}^{2} \cdot {\pi}^{2}, 1\right)}}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F} \]
    3. *-commutative91.9%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{{\pi}^{2} \cdot {\ell}^{2}}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F} \]
    4. unpow291.9%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{\left(\pi \cdot \pi\right)} \cdot {\ell}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F} \]
    5. unpow291.9%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \left(\pi \cdot \pi\right) \cdot \color{blue}{\left(\ell \cdot \ell\right)}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F} \]
    6. swap-sqr91.9%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{\left(\pi \cdot \ell\right) \cdot \left(\pi \cdot \ell\right)}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F} \]
    7. unpow291.9%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, \color{blue}{{\left(\pi \cdot \ell\right)}^{2}}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F} \]
    8. *-commutative91.9%

      \[\leadsto \pi \cdot \ell - \frac{\frac{\frac{1}{\frac{\mathsf{fma}\left(-0.5, {\color{blue}{\left(\ell \cdot \pi\right)}}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F} \]
  9. Simplified91.9%

    \[\leadsto \pi \cdot \ell - \frac{\frac{\frac{1}{\frac{\color{blue}{\mathsf{fma}\left(-0.5, {\left(\ell \cdot \pi\right)}^{2}, 1\right)}}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F} \]
  10. Final simplification91.9%

    \[\leadsto \pi \cdot \ell + \frac{\frac{\frac{-1}{\frac{\mathsf{fma}\left(-0.5, {\left(\pi \cdot \ell\right)}^{2}, 1\right)}{\sin \left(\pi \cdot \ell\right)}}}{F}}{F} \]
  11. Add Preprocessing

Alternative 6: 90.4% accurate, 0.9× speedup?

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

\\
\pi \cdot \ell + \frac{\frac{-1}{F}}{F \cdot \frac{\frac{1}{\pi} + 0.16666666666666666 \cdot \left(\pi \cdot {\ell}^{2}\right)}{\ell}}
\end{array}
Derivation
  1. Initial program 76.4%

    \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. tan-quot76.4%

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

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

    \[\leadsto \pi \cdot \ell - \frac{1}{F \cdot F} \cdot \frac{\sin \left(\pi \cdot \ell\right)}{\color{blue}{1}} \]
  6. Step-by-step derivation
    1. /-rgt-identity75.6%

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\sin \left(\pi \cdot \ell\right) \cdot \frac{1}{F \cdot F}} \]
    3. /-rgt-identity75.6%

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

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

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

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

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

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1 \cdot \sqrt{\frac{1}{F \cdot F}}}{\frac{1}{\sin \left(\pi \cdot \ell\right)} \cdot F}} \]
    11. *-un-lft-identity64.6%

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

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

      \[\leadsto \pi \cdot \ell - \frac{\frac{\color{blue}{1}}{\sqrt{F \cdot F}}}{\frac{1}{\sin \left(\pi \cdot \ell\right)} \cdot F} \]
    14. sqrt-prod39.7%

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

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

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

    \[\leadsto \pi \cdot \ell - \frac{\frac{1}{F}}{\color{blue}{\frac{0.16666666666666666 \cdot \left({\ell}^{2} \cdot \pi\right) + \frac{1}{\pi}}{\ell}} \cdot F} \]
  9. Final simplification88.2%

    \[\leadsto \pi \cdot \ell + \frac{\frac{-1}{F}}{F \cdot \frac{\frac{1}{\pi} + 0.16666666666666666 \cdot \left(\pi \cdot {\ell}^{2}\right)}{\ell}} \]
  10. Add Preprocessing

Alternative 7: 78.9% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 79.8%

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

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

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

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

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

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

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

      \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\ell \cdot \pi}}{F \cdot F} \]
    6. Step-by-step derivation
      1. *-commutative76.9%

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

        \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\pi}{F} \cdot \frac{\ell}{F}} \]
    7. Applied egg-rr83.5%

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\pi}{F} \cdot \frac{\ell}{F}} \]
    8. Step-by-step derivation
      1. clear-num83.5%

        \[\leadsto \pi \cdot \ell - \frac{\pi}{F} \cdot \color{blue}{\frac{1}{\frac{F}{\ell}}} \]
      2. un-div-inv83.6%

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

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

    if 1.9999999999999999e-77 < (*.f64 (PI.f64) l)

    1. Initial program 67.4%

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

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

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

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

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

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

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

Alternative 8: 82.6% accurate, 1.0× speedup?

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

\\
\pi \cdot \ell - \frac{\frac{\tan \left(\pi \cdot \ell\right)}{F}}{F}
\end{array}
Derivation
  1. Initial program 76.4%

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

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

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

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

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

Alternative 9: 81.8% accurate, 1.0× speedup?

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

\\
\pi \cdot \ell - \frac{\frac{\sin \left(\pi \cdot \ell\right)}{F}}{F}
\end{array}
Derivation
  1. Initial program 76.4%

    \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. tan-quot76.4%

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

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

    \[\leadsto \pi \cdot \ell - \frac{1}{F \cdot F} \cdot \frac{\sin \left(\pi \cdot \ell\right)}{\color{blue}{1}} \]
  6. Step-by-step derivation
    1. /-rgt-identity75.6%

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

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\sin \left(\pi \cdot \ell\right)}{F}}{F}} \]
  7. Applied egg-rr80.7%

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\sin \left(\pi \cdot \ell\right)}{F}}{F}} \]
  8. Add Preprocessing

Alternative 10: 75.2% accurate, 10.3× speedup?

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

\\
\pi \cdot \ell - \frac{\frac{\pi}{F}}{\frac{F}{\ell}}
\end{array}
Derivation
  1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\pi}{F} \cdot \frac{\ell}{F}} \]
  8. Step-by-step derivation
    1. clear-num77.3%

      \[\leadsto \pi \cdot \ell - \frac{\pi}{F} \cdot \color{blue}{\frac{1}{\frac{F}{\ell}}} \]
    2. un-div-inv77.3%

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

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\frac{\pi}{F}}{\frac{F}{\ell}}} \]
  10. Add Preprocessing

Alternative 11: 75.2% accurate, 10.3× speedup?

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

\\
\pi \cdot \ell - \frac{\ell \cdot \frac{\pi}{F}}{F}
\end{array}
Derivation
  1. Initial program 76.4%

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

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

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

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

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

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

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

    \[\leadsto \pi \cdot \ell - \frac{\color{blue}{\ell \cdot \frac{\pi}{F}}}{F} \]
  8. Add Preprocessing

Alternative 12: 75.2% accurate, 10.3× speedup?

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

\\
\pi \cdot \ell - \frac{\pi}{F \cdot \frac{F}{\ell}}
\end{array}
Derivation
  1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1 \cdot \pi}{\frac{F}{\ell} \cdot F}} \]
    4. *-un-lft-identity77.3%

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

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

    \[\leadsto \pi \cdot \ell - \frac{\pi}{F \cdot \frac{F}{\ell}} \]
  11. Add Preprocessing

Alternative 13: 75.2% accurate, 10.3× speedup?

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

\\
\pi \cdot \ell - \frac{\pi}{F} \cdot \frac{\ell}{F}
\end{array}
Derivation
  1. Initial program 76.4%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\pi}{F} \cdot \frac{\ell}{F}} \]
  8. Add Preprocessing

Reproduce

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