Average Error: 16.6 → 0.7
Time: 7.4s
Precision: binary64
\[\pi \cdot \ell - \frac{1}{F \cdot F} \cdot \tan \left(\pi \cdot \ell\right) \]
\[\pi \cdot \ell + \frac{\frac{\sin \left(\pi \cdot \ell\right)}{F}}{1 + {\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\pi \cdot \ell\right)\right)\right)}^{2} \cdot -0.5} \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)
  (*
   (/ (/ (sin (* PI l)) F) (+ 1.0 (* (pow (log1p (expm1 (* PI l))) 2.0) -0.5)))
   (/ -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) + (((sin((((double) M_PI) * l)) / F) / (1.0 + (pow(log1p(expm1((((double) M_PI) * l))), 2.0) * -0.5))) * (-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.sin((Math.PI * l)) / F) / (1.0 + (Math.pow(Math.log1p(Math.expm1((Math.PI * l))), 2.0) * -0.5))) * (-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.sin((math.pi * l)) / F) / (1.0 + (math.pow(math.log1p(math.expm1((math.pi * l))), 2.0) * -0.5))) * (-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(sin(Float64(pi * l)) / F) / Float64(1.0 + Float64((log1p(expm1(Float64(pi * l))) ^ 2.0) * -0.5))) * Float64(-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[(N[(N[Sin[N[(Pi * l), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] / N[(1.0 + N[(N[Power[N[Log[1 + N[(Exp[N[(Pi * l), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $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 + \frac{\frac{\sin \left(\pi \cdot \ell\right)}{F}}{1 + {\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\pi \cdot \ell\right)\right)\right)}^{2} \cdot -0.5} \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.6

    \[\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. Taylor expanded in l around inf 16.4

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{\sin \left(\ell \cdot \pi\right)}{\cos \left(\ell \cdot \pi\right) \cdot {F}^{2}}} \]
  4. Simplified12.5

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

    \[\leadsto \pi \cdot \ell - \frac{\frac{\sin \left(\ell \cdot \pi\right)}{\color{blue}{\left(-0.5 \cdot \left({\ell}^{2} \cdot {\pi}^{2}\right) + 1\right)} \cdot F}}{F} \]
  6. Simplified5.0

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

    \[\leadsto \pi \cdot \ell - \color{blue}{\frac{1}{F} \cdot \frac{\frac{\sin \left(\pi \cdot \ell\right)}{F}}{1 + {\left(\pi \cdot \ell\right)}^{2} \cdot -0.5}} \]
  8. Applied egg-rr0.7

    \[\leadsto \pi \cdot \ell - \frac{1}{F} \cdot \frac{\frac{\sin \left(\pi \cdot \ell\right)}{F}}{1 + {\color{blue}{\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\pi \cdot \ell\right)\right)\right)}}^{2} \cdot -0.5} \]
  9. Final simplification0.7

    \[\leadsto \pi \cdot \ell + \frac{\frac{\sin \left(\pi \cdot \ell\right)}{F}}{1 + {\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\pi \cdot \ell\right)\right)\right)}^{2} \cdot -0.5} \cdot \frac{-1}{F} \]

Reproduce

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