SINC function (WP 34S)  Printable Version + HP Forums (https://archived.hpcalc.org/museumforum) + Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum1.html) + Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum2.html) + Thread: SINC function (WP 34S) (/thread248720.html) 
SINC function (WP 34S)  Gerson W. Barbosa  08232013 I've noticed the SINC function on the WP 34S, at least in version 3.2r3382, is giving wrong results when in angles modes other than RAD, except when the argument is 1. This is something similar to the current implementation of the Gamma function on the Prime, which gives wrong results in Degrees mode. Sorry if this has been addressed already.
Gerson.
Re: SINC function (WP 34S)  Marcus von Cube, Germany  08232013 It seems to me that Pauli has to lock after this one.
We'll be fixing any bug, wont we?
Re: SINC function (WP 34S)  Gerson W. Barbosa  08232013 Quote: No complaint about the Bug Fixing Department, quite the contrary :)
Not an important bug anyway. Too few people using this function, it appears.
Re: SINC function (WP 34S)  Paul Dale  08232013 Can you give an example where an error is occurring? The numbers I'm seeing here are the same as executing:
SIN i.e. sin(x) / x
Re: SINC function (WP 34S)  Didier Lachieze  08232013 As the argument of SINC is assumed to be in radians, I think it should be rather like:
LocR 001
Edited: 23 Aug 2013, 8:39 p.m.
Re: SINC function (WP 34S)  Paul Dale  08232013 Why should radians be assumed? We don't assume radians for SIN and the definition of SINC(x) is SIN(x) / x. It is easy enough to change the behaviour but I wonder if it is necessary or desirable.
Re: SINC function (WP 34S)  Gerson W. Barbosa  08232013 When in degrees or grads there is a discontinuity in x = 0. For x = 1 the function returns 1 (in accordance with the definition), but for x + epsilon and x  epsilon the function returns pi/180 or pi/200, depending on the angle mode. It appears to me sinc doesn't make sense for arguments in degrees or grads, because sinc is a continuous function and sinc(0) = 1.
Gerson.
Re: SINC function (WP 34S)  Paul Dale  08232013 I understand the problem now.
I see two fixes here:
Neither is difficult.
Re: SINC function (WP 34S)  Gerson W. Barbosa  08232013 I don't remember ever seeing sinc using arguments in degrees, but further discussion might be necessary before either choice is made. http://mathworld.wolfram.com/SincFunction.html http://en.wikipedia.org/wiki/Sinc_function
Gerson.
Re: SINC function (WP 34S)  Manolo Sobrino  08242013 Ahem... this... misconception... again. Re: SINC function (WP 34S)  Didier Lachieze  08242013 Quote:This is explicitly said in the first link provided by Gerson on the SINC function (under details).
Edited: 24 Aug 2013, 1:35 a.m.
Re: SINC function (WP 34S)  Paul Dale  08242013 The same site's definition of SIN also says the argument is in radians. Following logically on from this, the trigonometric functions shouldn't support degrees and gradians at all.
Re: SINC function (WP 34S)  Paul Dale  08242013 This makes sense. SINC is fixed. The documentation will need a minor update to match  in degrees mode SINC(x) = SIN(x) / (PI * x / 180) and in gradians mode SINC(x) = SIN(x) / (PI * x / 200). SINC(30^{o}) = 0.9549296585513720 = SINC(PI / 6 radians).
Re: SINC function (WP 34S)  Didier Lachieze  08242013 Good point, I've been too fast to a conclusion.
Manolo's explanation is the right one.
Re: SINC function (WP 34S)  Andrew Nikitin  08242013 It seems that you missed the punchline of Manolo's explanation: Quote: SINC argument should be always considered radians, independent on angle setting, just like complex trig functions.
There is simply no use case for this functions where it makes sense to treat input x=30 as 30^o
Re: SINC function (WP 34S)  Walter B  08242013 I concur with Manolo's reasoning. There's simply no use using SINC in any angular mode but RAD.
d:)
Re: SINC function (WP 34S)  Gerson W. Barbosa  08242013 Quote: That's my opinion as well. Probably people using SINC have their calculator set to radian most of the time, but we shoudn't count on this. SINC with arguments in degrees is just useless and inconvenient. Anyway, if someone has a good reason for that, I would like to know.
Gerson.
Re: SINC function (WP 34S)  Gerson W. Barbosa  08242013 Quote: Then why not assuming the arguments are always in radians, regardless of the angular mode? There's no inconsistency in this since the function is never used with practical angle units. A similar behavior occurs with the complex trigonometric functions, as Andrew Nikitin has reminded us. It would require a short note in page 113 of the manual, however.
Re: SINC function (WP 34S)  Gerson W. Barbosa  08242013 Quote: I see that's what has been implemented in the latest version (2013825 3448), but now 0 is causing a Domain Error that wasn't there before. Gerson.
Edited: 24 Aug 2013, 10:32 p.m.
Re: SINC function (WP 34S)  Paul Dale  08242013 Bummer, accidentally took out the small x guard code.
Re: SINC function (WP 34S)  Paul Dale  08252013 And fixed in 3450.
 Pauli
Re: SINC function (WP 34S)  Walter B  08252013
Quote:Will be in next edition.
d:)
Re: SINC function (WP 34S)  Gerson W. Barbosa  08252013 Case closed. Next! :) For those who missed the thread, here's an unusual problem involving SINC: http://www.hpmuseum.org/cgisys/cgiwrap/hpmuseum/archv020.cgi?read=177273 Gerson.
