Blame gst/audiofx/math_compat.h
|
Packit |
1f69a5 |
/*
|
|
Packit |
1f69a5 |
* GStreamer
|
|
Packit |
1f69a5 |
* Copyright (C) 2008 Sebastian Dröge <slomo@circular-chaos.org>
|
|
Packit |
1f69a5 |
*
|
|
Packit |
1f69a5 |
* This library is free software; you can redistribute it and/or
|
|
Packit |
1f69a5 |
* modify it under the terms of the GNU Library General Public
|
|
Packit |
1f69a5 |
* License as published by the Free Software Foundation; either
|
|
Packit |
1f69a5 |
* version 2 of the License, or (at your option) any later version.
|
|
Packit |
1f69a5 |
*
|
|
Packit |
1f69a5 |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
1f69a5 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
1f69a5 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
1f69a5 |
* Library General Public License for more details.
|
|
Packit |
1f69a5 |
*
|
|
Packit |
1f69a5 |
* You should have received a copy of the GNU Library General Public
|
|
Packit |
1f69a5 |
* License along with this library; if not, write to the
|
|
Packit |
1f69a5 |
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
Packit |
1f69a5 |
* Boston, MA 02110-1301, USA.
|
|
Packit |
1f69a5 |
*/
|
|
Packit |
1f69a5 |
|
|
Packit |
1f69a5 |
#ifndef __MATH_COMPAT_H__
|
|
Packit |
1f69a5 |
#define __MATH_COMPAT_H__
|
|
Packit |
1f69a5 |
|
|
Packit |
1f69a5 |
#ifdef HAVE_CONFIG_H
|
|
Packit |
1f69a5 |
#include "config.h"
|
|
Packit |
1f69a5 |
#endif
|
|
Packit |
1f69a5 |
|
|
Packit |
1f69a5 |
#include <glib.h>
|
|
Packit |
1f69a5 |
#include <math.h>
|
|
Packit |
1f69a5 |
|
|
Packit |
1f69a5 |
#ifndef HAVE_ASINH
|
|
Packit |
1f69a5 |
static inline gdouble
|
|
Packit |
1f69a5 |
asinh (gdouble x)
|
|
Packit |
1f69a5 |
{
|
|
Packit |
1f69a5 |
return log(x + sqrt (x * x + 1));
|
|
Packit |
1f69a5 |
}
|
|
Packit |
1f69a5 |
#endif
|
|
Packit |
1f69a5 |
|
|
Packit |
1f69a5 |
#ifndef HAVE_SINH
|
|
Packit |
1f69a5 |
static inline gdouble
|
|
Packit |
1f69a5 |
sinh (gdouble x)
|
|
Packit |
1f69a5 |
{
|
|
Packit |
1f69a5 |
return 0.5 * (exp (x) - exp (-x));
|
|
Packit |
1f69a5 |
}
|
|
Packit |
1f69a5 |
#endif
|
|
Packit |
1f69a5 |
|
|
Packit |
1f69a5 |
#ifndef HAVE_COSH
|
|
Packit |
1f69a5 |
static inline gdouble
|
|
Packit |
1f69a5 |
cosh (gdouble x)
|
|
Packit |
1f69a5 |
{
|
|
Packit |
1f69a5 |
return 0.5 * (exp (x) + exp (-x));
|
|
Packit |
1f69a5 |
}
|
|
Packit |
1f69a5 |
#endif
|
|
Packit |
1f69a5 |
|
|
Packit |
1f69a5 |
#endif /* __MATH_COMPAT_H__ */
|