lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2011 William Pitcock <nenolod@dereferenced.org> |
| 3 | * |
| 4 | * Permission to use, copy, modify, and/or distribute this software for any |
| 5 | * purpose with or without fee is hereby granted, provided that the above |
| 6 | * copyright notice and this permission notice appear in all copies. |
| 7 | * |
| 8 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
| 9 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 10 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 11 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, |
| 12 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 13 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 14 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 15 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 16 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING |
| 17 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 18 | * POSSIBILITY OF SUCH DAMAGE. |
| 19 | */ |
| 20 | |
| 21 | #include <features.h> |
| 22 | #include <math.h> |
| 23 | |
| 24 | libm_hidden_proto(sincos) |
| 25 | void sincos(double x, double *s, double *c) |
| 26 | { |
| 27 | *s = sin(x); |
| 28 | *c = cos(x); |
| 29 | } |
| 30 | libm_hidden_def(sincos) |
| 31 | |
| 32 | libm_hidden_proto(sincosf) |
| 33 | void sincosf(float x, float *s, float *c) |
| 34 | { |
| 35 | *s = sinf(x); |
| 36 | *c = cosf(x); |
| 37 | } |
| 38 | libm_hidden_def(sincosf) |
| 39 | |
| 40 | #if defined __UCLIBC_HAS_LONG_DOUBLE_MATH__ && !defined __NO_LONG_DOUBLE_MATH |
| 41 | libm_hidden_proto(sincosl) |
| 42 | void sincosl(long double x, long double *s, long double *c) |
| 43 | { |
| 44 | *s = sinl(x); |
| 45 | *c = cosl(x); |
| 46 | } |
| 47 | libm_hidden_def(sincosl) |
| 48 | #endif |