Email List: Xaustin-review-lX
[All Lists]

RE: Defect in XSH exp

To: <yyyyyyyy@xxxxxxx>, <yyyyyyyyyyyyyyy@xxxxxxxxxxxxx>
Subject: RE: Defect in XSH exp
From: "Jason Zions" <yyyyyyyy@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 16 Jul 2003 09:35:42 -0700
Thread-index: AcNLraJSY13rHFwbQT2P+dVOpie5RAACk4ww
Thread-topic: Defect in XSH exp
Wouldn't it be nice if the variable names in examples were meaningful
rather than single letters owing their heritage to FORTRAN?

Anyone who needs examples for math functions is not an expert in
numerical methods. It might be helpful in this example to explain why
your constant was defined so as to allow the function to be computed
with a multiplication rather than a division. An expert might be
insulted by such an observation, but an expert wouldn't be reading the
text in the first place.

Jason

-----Original Message-----
From: yyyyyyyy@xxxxxxx [mailto:yyyyyyyy@xxxxxxx] 
Sent: Wednesday, July 16, 2003 10:18 AM
To: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Defect in XSH exp

        Defect report from : Loic Domaigne , personal interest

(Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)

@ page 0 line 0 section exp comment {exp}

Problem:

Edition of Specification (Year): 2003

Defect code :  2. Omission

Missing Example.

Action:

Computing the density function of the standard normal distribution

This example shows a possible implementation using exp() for computing
the density function of the standard normal distribution.


#include <math.h>

double
normal_density (double  x
                )
{
  static double c = 0.39894228040143267794;  /* 1.0/sqrt(2*M_PI) */

  return c*exp(-x*x/2);
}



<Prev in Thread] Current Thread [Next in Thread>