Average Error: 16.7 → 2.5
Time: 6.6s
Precision: binary64
\[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
\[\begin{array}{l} t_0 := {\pi}^{3} \cdot 0.3333333333333333\\ t_1 := {\pi}^{3} \cdot -0.3333333333333333\\ t_2 := \mathsf{fma}\left({\pi}^{5}, -0.03333333333333333, -0.5 \cdot \left(t_1 \cdot {\pi}^{2}\right)\right)\\ t_3 := \frac{F}{{\pi}^{2}} \cdot \left(t_2 + \frac{{\pi}^{6} \cdot -0.1111111111111111}{\pi}\right)\\ \pi \cdot \ell - {\left(F \cdot \left(\frac{F}{\pi \cdot \ell} + \left(\frac{\left(\ell \cdot F\right) \cdot t_1}{{\pi}^{2}} - \mathsf{fma}\left({\ell}^{5}, \frac{\mathsf{fma}\left(-0.0001984126984126984, {\pi}^{7}, 0.041666666666666664 \cdot \left(-0.3333333333333333 \cdot \left({\pi}^{3} \cdot {\pi}^{4}\right)\right)\right) - \mathsf{fma}\left(t_2, {\pi}^{2} \cdot -0.5, {\pi}^{7} \cdot -0.001388888888888889\right)}{\frac{{\pi}^{2}}{F}} - \mathsf{fma}\left(\frac{F}{{\pi}^{3}}, t_2 \cdot t_0, \frac{t_0}{\pi} \cdot t_3\right), t_3 \cdot {\ell}^{3}\right)\right)\right)\right)}^{-1} \end{array} \]
(FPCore (F l)
 :precision binary64
 (- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))
(FPCore (F l)
 :precision binary64
 (let* ((t_0 (* (pow PI 3.0) 0.3333333333333333))
        (t_1 (* (pow PI 3.0) -0.3333333333333333))
        (t_2
         (fma (pow PI 5.0) -0.03333333333333333 (* -0.5 (* t_1 (pow PI 2.0)))))
        (t_3
         (*
          (/ F (pow PI 2.0))
          (+ t_2 (/ (* (pow PI 6.0) -0.1111111111111111) PI)))))
   (-
    (* PI l)
    (pow
     (*
      F
      (+
       (/ F (* PI l))
       (-
        (/ (* (* l F) t_1) (pow PI 2.0))
        (fma
         (pow l 5.0)
         (-
          (/
           (-
            (fma
             -0.0001984126984126984
             (pow PI 7.0)
             (*
              0.041666666666666664
              (* -0.3333333333333333 (* (pow PI 3.0) (pow PI 4.0)))))
            (fma
             t_2
             (* (pow PI 2.0) -0.5)
             (* (pow PI 7.0) -0.001388888888888889)))
           (/ (pow PI 2.0) F))
          (fma (/ F (pow PI 3.0)) (* t_2 t_0) (* (/ t_0 PI) t_3)))
         (* t_3 (pow l 3.0))))))
     -1.0))))
double code(double F, double l) {
	return (((double) M_PI) * l) - ((1.0 / (F * F)) * tan((((double) M_PI) * l)));
}
double code(double F, double l) {
	double t_0 = pow(((double) M_PI), 3.0) * 0.3333333333333333;
	double t_1 = pow(((double) M_PI), 3.0) * -0.3333333333333333;
	double t_2 = fma(pow(((double) M_PI), 5.0), -0.03333333333333333, (-0.5 * (t_1 * pow(((double) M_PI), 2.0))));
	double t_3 = (F / pow(((double) M_PI), 2.0)) * (t_2 + ((pow(((double) M_PI), 6.0) * -0.1111111111111111) / ((double) M_PI)));
	return (((double) M_PI) * l) - pow((F * ((F / (((double) M_PI) * l)) + ((((l * F) * t_1) / pow(((double) M_PI), 2.0)) - fma(pow(l, 5.0), (((fma(-0.0001984126984126984, pow(((double) M_PI), 7.0), (0.041666666666666664 * (-0.3333333333333333 * (pow(((double) M_PI), 3.0) * pow(((double) M_PI), 4.0))))) - fma(t_2, (pow(((double) M_PI), 2.0) * -0.5), (pow(((double) M_PI), 7.0) * -0.001388888888888889))) / (pow(((double) M_PI), 2.0) / F)) - fma((F / pow(((double) M_PI), 3.0)), (t_2 * t_0), ((t_0 / ((double) M_PI)) * t_3))), (t_3 * pow(l, 3.0)))))), -1.0);
}
function code(F, l)
	return Float64(Float64(pi * l) - Float64(Float64(1.0 / Float64(F * F)) * tan(Float64(pi * l))))
end
function code(F, l)
	t_0 = Float64((pi ^ 3.0) * 0.3333333333333333)
	t_1 = Float64((pi ^ 3.0) * -0.3333333333333333)
	t_2 = fma((pi ^ 5.0), -0.03333333333333333, Float64(-0.5 * Float64(t_1 * (pi ^ 2.0))))
	t_3 = Float64(Float64(F / (pi ^ 2.0)) * Float64(t_2 + Float64(Float64((pi ^ 6.0) * -0.1111111111111111) / pi)))
	return Float64(Float64(pi * l) - (Float64(F * Float64(Float64(F / Float64(pi * l)) + Float64(Float64(Float64(Float64(l * F) * t_1) / (pi ^ 2.0)) - fma((l ^ 5.0), Float64(Float64(Float64(fma(-0.0001984126984126984, (pi ^ 7.0), Float64(0.041666666666666664 * Float64(-0.3333333333333333 * Float64((pi ^ 3.0) * (pi ^ 4.0))))) - fma(t_2, Float64((pi ^ 2.0) * -0.5), Float64((pi ^ 7.0) * -0.001388888888888889))) / Float64((pi ^ 2.0) / F)) - fma(Float64(F / (pi ^ 3.0)), Float64(t_2 * t_0), Float64(Float64(t_0 / pi) * t_3))), Float64(t_3 * (l ^ 3.0)))))) ^ -1.0))
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]
code[F_, l_] := Block[{t$95$0 = N[(N[Power[Pi, 3.0], $MachinePrecision] * 0.3333333333333333), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[Pi, 3.0], $MachinePrecision] * -0.3333333333333333), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[Pi, 5.0], $MachinePrecision] * -0.03333333333333333 + N[(-0.5 * N[(t$95$1 * N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(F / N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision] * N[(t$95$2 + N[(N[(N[Power[Pi, 6.0], $MachinePrecision] * -0.1111111111111111), $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(Pi * l), $MachinePrecision] - N[Power[N[(F * N[(N[(F / N[(Pi * l), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(l * F), $MachinePrecision] * t$95$1), $MachinePrecision] / N[Power[Pi, 2.0], $MachinePrecision]), $MachinePrecision] - N[(N[Power[l, 5.0], $MachinePrecision] * N[(N[(N[(N[(-0.0001984126984126984 * N[Power[Pi, 7.0], $MachinePrecision] + N[(0.041666666666666664 * N[(-0.3333333333333333 * N[(N[Power[Pi, 3.0], $MachinePrecision] * N[Power[Pi, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$2 * N[(N[Power[Pi, 2.0], $MachinePrecision] * -0.5), $MachinePrecision] + N[(N[Power[Pi, 7.0], $MachinePrecision] * -0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[Power[Pi, 2.0], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - N[(N[(F / N[Power[Pi, 3.0], $MachinePrecision]), $MachinePrecision] * N[(t$95$2 * t$95$0), $MachinePrecision] + N[(N[(t$95$0 / Pi), $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$3 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]]]
\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)
\begin{array}{l}
t_0 := {\pi}^{3} \cdot 0.3333333333333333\\
t_1 := {\pi}^{3} \cdot -0.3333333333333333\\
t_2 := \mathsf{fma}\left({\pi}^{5}, -0.03333333333333333, -0.5 \cdot \left(t_1 \cdot {\pi}^{2}\right)\right)\\
t_3 := \frac{F}{{\pi}^{2}} \cdot \left(t_2 + \frac{{\pi}^{6} \cdot -0.1111111111111111}{\pi}\right)\\
\pi \cdot \ell - {\left(F \cdot \left(\frac{F}{\pi \cdot \ell} + \left(\frac{\left(\ell \cdot F\right) \cdot t_1}{{\pi}^{2}} - \mathsf{fma}\left({\ell}^{5}, \frac{\mathsf{fma}\left(-0.0001984126984126984, {\pi}^{7}, 0.041666666666666664 \cdot \left(-0.3333333333333333 \cdot \left({\pi}^{3} \cdot {\pi}^{4}\right)\right)\right) - \mathsf{fma}\left(t_2, {\pi}^{2} \cdot -0.5, {\pi}^{7} \cdot -0.001388888888888889\right)}{\frac{{\pi}^{2}}{F}} - \mathsf{fma}\left(\frac{F}{{\pi}^{3}}, t_2 \cdot t_0, \frac{t_0}{\pi} \cdot t_3\right), t_3 \cdot {\ell}^{3}\right)\right)\right)\right)}^{-1}
\end{array}

Error

Derivation

  1. Initial program 16.7

    \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
  2. Simplified16.4

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

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

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

    \[\leadsto \pi \cdot \ell - {\left(F \cdot \color{blue}{\left(-1 \cdot \frac{F \cdot \left(\ell \cdot \left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)\right)}{{\pi}^{2}} + \left(\frac{F}{\ell \cdot \pi} + \left(-1 \cdot \left(\left(\frac{\left(-0.0001984126984126984 \cdot {\pi}^{7} - \left(0.041666666666666664 \cdot \left(\left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right) \cdot {\pi}^{4}\right) + \left(-0.001388888888888889 \cdot {\pi}^{7} + -0.5 \cdot \left(\left(0.008333333333333333 \cdot {\pi}^{5} - \left(0.041666666666666664 \cdot {\pi}^{5} + -0.5 \cdot \left(\left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right) \cdot {\pi}^{2}\right)\right)\right) \cdot {\pi}^{2}\right)\right)\right)\right) \cdot F}{{\pi}^{2}} + \left(-1 \cdot \frac{\left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right) \cdot \left(-1 \cdot \frac{F \cdot {\left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)}^{2}}{{\pi}^{3}} + \frac{F \cdot \left(0.008333333333333333 \cdot {\pi}^{5} - \left(0.041666666666666664 \cdot {\pi}^{5} + -0.5 \cdot \left(\left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right) \cdot {\pi}^{2}\right)\right)\right)}{{\pi}^{2}}\right)}{\pi} + -1 \cdot \frac{F \cdot \left(\left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right) \cdot \left(0.008333333333333333 \cdot {\pi}^{5} - \left(0.041666666666666664 \cdot {\pi}^{5} + -0.5 \cdot \left(\left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right) \cdot {\pi}^{2}\right)\right)\right)\right)}{{\pi}^{3}}\right)\right) \cdot {\ell}^{5}\right) + -1 \cdot \left({\ell}^{3} \cdot \left(-1 \cdot \frac{F \cdot {\left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right)}^{2}}{{\pi}^{3}} + \frac{F \cdot \left(0.008333333333333333 \cdot {\pi}^{5} - \left(0.041666666666666664 \cdot {\pi}^{5} + -0.5 \cdot \left(\left(-0.16666666666666666 \cdot {\pi}^{3} - -0.5 \cdot {\pi}^{3}\right) \cdot {\pi}^{2}\right)\right)\right)}{{\pi}^{2}}\right)\right)\right)\right)\right)}\right)}^{-1} \]
  6. Simplified2.5

    \[\leadsto \pi \cdot \ell - {\left(F \cdot \color{blue}{\left(\frac{F}{\ell \cdot \pi} + \left(\frac{\left(\ell \cdot F\right) \cdot \left({\pi}^{3} \cdot -0.3333333333333333\right)}{{\pi}^{2}} - \mathsf{fma}\left({\ell}^{5}, \frac{\mathsf{fma}\left(-0.0001984126984126984, {\pi}^{7}, 0.041666666666666664 \cdot \left(\left({\pi}^{4} \cdot {\pi}^{3}\right) \cdot -0.3333333333333333\right)\right) - \mathsf{fma}\left(\mathsf{fma}\left({\pi}^{5}, -0.03333333333333333, -0.5 \cdot \left({\pi}^{2} \cdot \left({\pi}^{3} \cdot -0.3333333333333333\right)\right)\right), {\pi}^{2} \cdot -0.5, {\pi}^{7} \cdot -0.001388888888888889\right)}{\frac{{\pi}^{2}}{F}} - \mathsf{fma}\left(\frac{F}{{\pi}^{3}}, \left({\pi}^{3} \cdot 0.3333333333333333\right) \cdot \mathsf{fma}\left({\pi}^{5}, -0.03333333333333333, -0.5 \cdot \left({\pi}^{2} \cdot \left({\pi}^{3} \cdot -0.3333333333333333\right)\right)\right), \frac{{\pi}^{3} \cdot 0.3333333333333333}{\pi} \cdot \left(\frac{F}{{\pi}^{2}} \cdot \left(\mathsf{fma}\left({\pi}^{5}, -0.03333333333333333, -0.5 \cdot \left({\pi}^{2} \cdot \left({\pi}^{3} \cdot -0.3333333333333333\right)\right)\right) - \frac{{\pi}^{6} \cdot 0.1111111111111111}{\pi}\right)\right)\right), {\ell}^{3} \cdot \left(\frac{F}{{\pi}^{2}} \cdot \left(\mathsf{fma}\left({\pi}^{5}, -0.03333333333333333, -0.5 \cdot \left({\pi}^{2} \cdot \left({\pi}^{3} \cdot -0.3333333333333333\right)\right)\right) - \frac{{\pi}^{6} \cdot 0.1111111111111111}{\pi}\right)\right)\right)\right)\right)}\right)}^{-1} \]
  7. Final simplification2.5

    \[\leadsto \pi \cdot \ell - {\left(F \cdot \left(\frac{F}{\pi \cdot \ell} + \left(\frac{\left(\ell \cdot F\right) \cdot \left({\pi}^{3} \cdot -0.3333333333333333\right)}{{\pi}^{2}} - \mathsf{fma}\left({\ell}^{5}, \frac{\mathsf{fma}\left(-0.0001984126984126984, {\pi}^{7}, 0.041666666666666664 \cdot \left(-0.3333333333333333 \cdot \left({\pi}^{3} \cdot {\pi}^{4}\right)\right)\right) - \mathsf{fma}\left(\mathsf{fma}\left({\pi}^{5}, -0.03333333333333333, -0.5 \cdot \left(\left({\pi}^{3} \cdot -0.3333333333333333\right) \cdot {\pi}^{2}\right)\right), {\pi}^{2} \cdot -0.5, {\pi}^{7} \cdot -0.001388888888888889\right)}{\frac{{\pi}^{2}}{F}} - \mathsf{fma}\left(\frac{F}{{\pi}^{3}}, \mathsf{fma}\left({\pi}^{5}, -0.03333333333333333, -0.5 \cdot \left(\left({\pi}^{3} \cdot -0.3333333333333333\right) \cdot {\pi}^{2}\right)\right) \cdot \left({\pi}^{3} \cdot 0.3333333333333333\right), \frac{{\pi}^{3} \cdot 0.3333333333333333}{\pi} \cdot \left(\frac{F}{{\pi}^{2}} \cdot \left(\mathsf{fma}\left({\pi}^{5}, -0.03333333333333333, -0.5 \cdot \left(\left({\pi}^{3} \cdot -0.3333333333333333\right) \cdot {\pi}^{2}\right)\right) + \frac{{\pi}^{6} \cdot -0.1111111111111111}{\pi}\right)\right)\right), \left(\frac{F}{{\pi}^{2}} \cdot \left(\mathsf{fma}\left({\pi}^{5}, -0.03333333333333333, -0.5 \cdot \left(\left({\pi}^{3} \cdot -0.3333333333333333\right) \cdot {\pi}^{2}\right)\right) + \frac{{\pi}^{6} \cdot -0.1111111111111111}{\pi}\right)\right) \cdot {\ell}^{3}\right)\right)\right)\right)}^{-1} \]

Reproduce

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