1*25c28e83SPiotr Jasiukajtis /* 2*25c28e83SPiotr Jasiukajtis * CDDL HEADER START 3*25c28e83SPiotr Jasiukajtis * 4*25c28e83SPiotr Jasiukajtis * The contents of this file are subject to the terms of the 5*25c28e83SPiotr Jasiukajtis * Common Development and Distribution License (the "License"). 6*25c28e83SPiotr Jasiukajtis * You may not use this file except in compliance with the License. 7*25c28e83SPiotr Jasiukajtis * 8*25c28e83SPiotr Jasiukajtis * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*25c28e83SPiotr Jasiukajtis * or http://www.opensolaris.org/os/licensing. 10*25c28e83SPiotr Jasiukajtis * See the License for the specific language governing permissions 11*25c28e83SPiotr Jasiukajtis * and limitations under the License. 12*25c28e83SPiotr Jasiukajtis * 13*25c28e83SPiotr Jasiukajtis * When distributing Covered Code, include this CDDL HEADER in each 14*25c28e83SPiotr Jasiukajtis * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*25c28e83SPiotr Jasiukajtis * If applicable, add the following below this CDDL HEADER, with the 16*25c28e83SPiotr Jasiukajtis * fields enclosed by brackets "[]" replaced with your own identifying 17*25c28e83SPiotr Jasiukajtis * information: Portions Copyright [yyyy] [name of copyright owner] 18*25c28e83SPiotr Jasiukajtis * 19*25c28e83SPiotr Jasiukajtis * CDDL HEADER END 20*25c28e83SPiotr Jasiukajtis */ 21*25c28e83SPiotr Jasiukajtis 22*25c28e83SPiotr Jasiukajtis /* 23*25c28e83SPiotr Jasiukajtis * Copyright 2011 Nexenta Systems, Inc. All rights reserved. 24*25c28e83SPiotr Jasiukajtis */ 25*25c28e83SPiotr Jasiukajtis /* 26*25c28e83SPiotr Jasiukajtis * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 27*25c28e83SPiotr Jasiukajtis * Use is subject to license terms. 28*25c28e83SPiotr Jasiukajtis */ 29*25c28e83SPiotr Jasiukajtis 30*25c28e83SPiotr Jasiukajtis #ifdef __RESTRICT 31*25c28e83SPiotr Jasiukajtis #define restrict _Restrict 32*25c28e83SPiotr Jasiukajtis #else 33*25c28e83SPiotr Jasiukajtis #define restrict 34*25c28e83SPiotr Jasiukajtis #endif 35*25c28e83SPiotr Jasiukajtis 36*25c28e83SPiotr Jasiukajtis extern void __vz_exp(int, double *, int, double *, int, double *); 37*25c28e83SPiotr Jasiukajtis extern void __vz_log(int, double *, int, double *, int); 38*25c28e83SPiotr Jasiukajtis 39*25c28e83SPiotr Jasiukajtis void 40*25c28e83SPiotr Jasiukajtis __vz_pow(int n, double * restrict x, int stridex, double * restrict y, 41*25c28e83SPiotr Jasiukajtis int stridey, double * restrict z, int stridez, double * restrict tmp) 42*25c28e83SPiotr Jasiukajtis { 43*25c28e83SPiotr Jasiukajtis double r; 44*25c28e83SPiotr Jasiukajtis int i, j, k; 45*25c28e83SPiotr Jasiukajtis 46*25c28e83SPiotr Jasiukajtis __vz_log(n, x, stridex, tmp, 1); 47*25c28e83SPiotr Jasiukajtis stridey <<= 1; 48*25c28e83SPiotr Jasiukajtis for (i = j = 0; i < n; i++, j += stridey) 49*25c28e83SPiotr Jasiukajtis { 50*25c28e83SPiotr Jasiukajtis k = i << 1; 51*25c28e83SPiotr Jasiukajtis r = y[j] * tmp[k] - y[j+1] * tmp[k+1]; 52*25c28e83SPiotr Jasiukajtis tmp[k+1] = y[j+1] * tmp[k] + y[j] * tmp[k+1]; 53*25c28e83SPiotr Jasiukajtis tmp[k] = r; 54*25c28e83SPiotr Jasiukajtis } 55*25c28e83SPiotr Jasiukajtis __vz_exp(n, tmp, 1, z, stridez, tmp + n + n); 56*25c28e83SPiotr Jasiukajtis } 57