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

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 17.1

    \[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
  2. Applied egg-rr12.8

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

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

    \[\leadsto \pi \cdot \ell - {\left(F \cdot \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)}\right)}^{-1} \]
  5. Applied egg-rr1.7

    \[\leadsto \pi \cdot \ell - {\left(F \cdot \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(e^{F \cdot {\ell}^{5}}\right)}\right) + 0.022222222222222223 \cdot \left({\pi}^{3} \cdot \left({\ell}^{3} \cdot F\right)\right)\right)\right)\right)\right)}^{-1} \]
  6. Final simplification1.7

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

Reproduce

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