Average Error: 16.9 → 0.8
Time: 8.4s
Precision: binary64
\[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
\[\pi \cdot \ell + {\left(\frac{F}{\pi \cdot \ell} - \left(0.3333333333333333 \cdot \left(\pi \cdot \left(\ell \cdot F\right)\right) + \left(0.0021164021164021165 \cdot \left({\pi}^{5} \cdot \log \left({\left(e^{{\ell}^{5}}\right)}^{F}\right)\right) + 0.022222222222222223 \cdot \left({\pi}^{3} \cdot \left(F \cdot {\ell}^{3}\right)\right)\right)\right)\right)}^{-1} \cdot \frac{-1}{F} \]
(FPCore (F l)
 :precision binary64
 (- (* PI l) (* (/ 1.0 (* F F)) (tan (* PI l)))))
(FPCore (F l)
 :precision binary64
 (+
  (* PI l)
  (*
   (pow
    (-
     (/ F (* PI l))
     (+
      (* 0.3333333333333333 (* PI (* l F)))
      (+
       (*
        0.0021164021164021165
        (* (pow PI 5.0) (log (pow (exp (pow l 5.0)) F))))
       (* 0.022222222222222223 (* (pow PI 3.0) (* F (pow l 3.0)))))))
    -1.0)
   (/ -1.0 F))))
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) {
	return (((double) M_PI) * l) + (pow(((F / (((double) M_PI) * l)) - ((0.3333333333333333 * (((double) M_PI) * (l * F))) + ((0.0021164021164021165 * (pow(((double) M_PI), 5.0) * log(pow(exp(pow(l, 5.0)), F)))) + (0.022222222222222223 * (pow(((double) M_PI), 3.0) * (F * pow(l, 3.0))))))), -1.0) * (-1.0 / F));
}
public static double code(double F, double l) {
	return (Math.PI * l) - ((1.0 / (F * F)) * Math.tan((Math.PI * l)));
}
public static double code(double F, double l) {
	return (Math.PI * l) + (Math.pow(((F / (Math.PI * l)) - ((0.3333333333333333 * (Math.PI * (l * F))) + ((0.0021164021164021165 * (Math.pow(Math.PI, 5.0) * Math.log(Math.pow(Math.exp(Math.pow(l, 5.0)), F)))) + (0.022222222222222223 * (Math.pow(Math.PI, 3.0) * (F * Math.pow(l, 3.0))))))), -1.0) * (-1.0 / F));
}
def code(F, l):
	return (math.pi * l) - ((1.0 / (F * F)) * math.tan((math.pi * l)))
def code(F, l):
	return (math.pi * l) + (math.pow(((F / (math.pi * l)) - ((0.3333333333333333 * (math.pi * (l * F))) + ((0.0021164021164021165 * (math.pow(math.pi, 5.0) * math.log(math.pow(math.exp(math.pow(l, 5.0)), F)))) + (0.022222222222222223 * (math.pow(math.pi, 3.0) * (F * math.pow(l, 3.0))))))), -1.0) * (-1.0 / F))
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)
	return Float64(Float64(pi * l) + Float64((Float64(Float64(F / Float64(pi * l)) - Float64(Float64(0.3333333333333333 * Float64(pi * Float64(l * F))) + Float64(Float64(0.0021164021164021165 * Float64((pi ^ 5.0) * log((exp((l ^ 5.0)) ^ F)))) + Float64(0.022222222222222223 * Float64((pi ^ 3.0) * Float64(F * (l ^ 3.0))))))) ^ -1.0) * Float64(-1.0 / F)))
end
function tmp = code(F, l)
	tmp = (pi * l) - ((1.0 / (F * F)) * tan((pi * l)));
end
function tmp = code(F, l)
	tmp = (pi * l) + ((((F / (pi * l)) - ((0.3333333333333333 * (pi * (l * F))) + ((0.0021164021164021165 * ((pi ^ 5.0) * log((exp((l ^ 5.0)) ^ F)))) + (0.022222222222222223 * ((pi ^ 3.0) * (F * (l ^ 3.0))))))) ^ -1.0) * (-1.0 / F));
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_] := N[(N[(Pi * l), $MachinePrecision] + N[(N[Power[N[(N[(F / N[(Pi * l), $MachinePrecision]), $MachinePrecision] - N[(N[(0.3333333333333333 * N[(Pi * N[(l * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(0.0021164021164021165 * N[(N[Power[Pi, 5.0], $MachinePrecision] * N[Log[N[Power[N[Exp[N[Power[l, 5.0], $MachinePrecision]], $MachinePrecision], F], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.022222222222222223 * N[(N[Power[Pi, 3.0], $MachinePrecision] * N[(F * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right)
\pi \cdot \ell + {\left(\frac{F}{\pi \cdot \ell} - \left(0.3333333333333333 \cdot \left(\pi \cdot \left(\ell \cdot F\right)\right) + \left(0.0021164021164021165 \cdot \left({\pi}^{5} \cdot \log \left({\left(e^{{\ell}^{5}}\right)}^{F}\right)\right) + 0.022222222222222223 \cdot \left({\pi}^{3} \cdot \left(F \cdot {\ell}^{3}\right)\right)\right)\right)\right)}^{-1} \cdot \frac{-1}{F}

Error

Bits error versus F

Bits error versus l

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 16.9

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

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

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

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

    \[\leadsto \pi \cdot \ell - {\color{blue}{\left(\frac{F}{\pi \cdot \ell} - \left(0.3333333333333333 \cdot \left(\pi \cdot \left(F \cdot \ell\right)\right) + \left(0.0021164021164021165 \cdot \left({\pi}^{5} \cdot \left({\ell}^{5} \cdot F\right)\right) + 0.022222222222222223 \cdot \left({\pi}^{3} \cdot \left({\ell}^{3} \cdot F\right)\right)\right)\right)\right)}}^{-1} \cdot \frac{1}{F} \]
  6. Applied egg-rr0.8

    \[\leadsto \pi \cdot \ell - {\left(\frac{F}{\pi \cdot \ell} - \left(0.3333333333333333 \cdot \left(\pi \cdot \left(F \cdot \ell\right)\right) + \left(0.0021164021164021165 \cdot \left({\pi}^{5} \cdot \color{blue}{\log \left({\left(e^{{\ell}^{5}}\right)}^{F}\right)}\right) + 0.022222222222222223 \cdot \left({\pi}^{3} \cdot \left({\ell}^{3} \cdot F\right)\right)\right)\right)\right)}^{-1} \cdot \frac{1}{F} \]
  7. Final simplification0.8

    \[\leadsto \pi \cdot \ell + {\left(\frac{F}{\pi \cdot \ell} - \left(0.3333333333333333 \cdot \left(\pi \cdot \left(\ell \cdot F\right)\right) + \left(0.0021164021164021165 \cdot \left({\pi}^{5} \cdot \log \left({\left(e^{{\ell}^{5}}\right)}^{F}\right)\right) + 0.022222222222222223 \cdot \left({\pi}^{3} \cdot \left(F \cdot {\ell}^{3}\right)\right)\right)\right)\right)}^{-1} \cdot \frac{-1}{F} \]

Reproduce

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