[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Any difference between 1 div $x and math:pow($x, -

Subject: Re: Any difference between 1 div $x and math:pow($x, -1)?
From: "Norman Tovey-Walsh ndw@xxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 27 Jun 2020 14:09:11 -0000
Re:  Any difference between 1 div $x and math:pow($x
Roger L Costello costello@xxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
writes:
> Hi Folks,
>
> My XSLT program computes this expression many times for different values of
$x:
>
> 1 div (1 + math:exp(-$x))
>
> Here is an equivalent expression:
>
> math:pow(1 + math:exp(-$x), -1)

As David points out, theybre not strictly equivalent.

> - produces more accurate results
> - is faster

The best way to answer those questions is to run some experiments.

> - is easier to understand, more intuitive

Thatbs going to depend on whobs looking at the code, I guess. If I think
about it, I can work out that math:pow($x, -1) is like 1/$x but this
many years removed from regular mathematical exercise, I have to think
about it for a moment.

                                        Be seeing you,
                                          norm

--
Norman Tovey-Walsh <ndw@xxxxxxxxxx>
https://nwalsh.com/

> Everything has been said before, but since nobody every listens we have
> to keep going back and beginning all over again.--AndrC) Gide

[demime 1.01d removed an attachment of type application/pgp-signature which had a name of signature.asc]

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.