
(FPCore (x y) :precision binary64 (/ (* (sin x) (sinh y)) x))
double code(double x, double y) {
return (sin(x) * sinh(y)) / x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(x) * sinh(y)) / x
end function
public static double code(double x, double y) {
return (Math.sin(x) * Math.sinh(y)) / x;
}
def code(x, y): return (math.sin(x) * math.sinh(y)) / x
function code(x, y) return Float64(Float64(sin(x) * sinh(y)) / x) end
function tmp = code(x, y) tmp = (sin(x) * sinh(y)) / x; end
code[x_, y_] := N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin x \cdot \sinh y}{x}
\end{array}
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (/ (* (sin x) (sinh y)) x))
double code(double x, double y) {
return (sin(x) * sinh(y)) / x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sin(x) * sinh(y)) / x
end function
public static double code(double x, double y) {
return (Math.sin(x) * Math.sinh(y)) / x;
}
def code(x, y): return (math.sin(x) * math.sinh(y)) / x
function code(x, y) return Float64(Float64(sin(x) * sinh(y)) / x) end
function tmp = code(x, y) tmp = (sin(x) * sinh(y)) / x; end
code[x_, y_] := N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sin x \cdot \sinh y}{x}
\end{array}
(FPCore (x y) :precision binary64 (* (/ (sinh y) x) (sin x)))
double code(double x, double y) {
return (sinh(y) / x) * sin(x);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (sinh(y) / x) * sin(x)
end function
public static double code(double x, double y) {
return (Math.sinh(y) / x) * Math.sin(x);
}
def code(x, y): return (math.sinh(y) / x) * math.sin(x)
function code(x, y) return Float64(Float64(sinh(y) / x) * sin(x)) end
function tmp = code(x, y) tmp = (sinh(y) / x) * sin(x); end
code[x_, y_] := N[(N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\sinh y}{x} \cdot \sin x
\end{array}
Initial program 90.0%
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-sinh.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift-sinh.f64N/A
lift-sin.f6499.5
Applied rewrites99.5%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sin x) (sinh y)) x)) (t_1 (* 2.0 (sinh y))))
(if (<= t_0 -500000.0)
(* t_1 0.5)
(if (<= t_0 4e-8)
(* (/ (sin x) x) y)
(* t_1 (fma (* x x) -0.08333333333333333 0.5))))))
double code(double x, double y) {
double t_0 = (sin(x) * sinh(y)) / x;
double t_1 = 2.0 * sinh(y);
double tmp;
if (t_0 <= -500000.0) {
tmp = t_1 * 0.5;
} else if (t_0 <= 4e-8) {
tmp = (sin(x) / x) * y;
} else {
tmp = t_1 * fma((x * x), -0.08333333333333333, 0.5);
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sin(x) * sinh(y)) / x) t_1 = Float64(2.0 * sinh(y)) tmp = 0.0 if (t_0 <= -500000.0) tmp = Float64(t_1 * 0.5); elseif (t_0 <= 4e-8) tmp = Float64(Float64(sin(x) / x) * y); else tmp = Float64(t_1 * fma(Float64(x * x), -0.08333333333333333, 0.5)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$1 = N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -500000.0], N[(t$95$1 * 0.5), $MachinePrecision], If[LessEqual[t$95$0, 4e-8], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], N[(t$95$1 * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
t_1 := 2 \cdot \sinh y\\
\mathbf{if}\;t\_0 \leq -500000:\\
\;\;\;\;t\_1 \cdot 0.5\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{-8}:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -5e5Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6477.6
Applied rewrites77.6%
if -5e5 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 4.0000000000000001e-8Initial program 78.8%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f6498.8
Applied rewrites98.8%
if 4.0000000000000001e-8 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in x around 0
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f64N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6477.9
Applied rewrites77.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sin x) (sinh y)) x)))
(if (or (<= t_0 -500000.0) (not (<= t_0 4e-8)))
(* (* 2.0 (sinh y)) 0.5)
(* (/ (sin x) x) y))))
double code(double x, double y) {
double t_0 = (sin(x) * sinh(y)) / x;
double tmp;
if ((t_0 <= -500000.0) || !(t_0 <= 4e-8)) {
tmp = (2.0 * sinh(y)) * 0.5;
} else {
tmp = (sin(x) / x) * y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = (sin(x) * sinh(y)) / x
if ((t_0 <= (-500000.0d0)) .or. (.not. (t_0 <= 4d-8))) then
tmp = (2.0d0 * sinh(y)) * 0.5d0
else
tmp = (sin(x) / x) * y
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (Math.sin(x) * Math.sinh(y)) / x;
double tmp;
if ((t_0 <= -500000.0) || !(t_0 <= 4e-8)) {
tmp = (2.0 * Math.sinh(y)) * 0.5;
} else {
tmp = (Math.sin(x) / x) * y;
}
return tmp;
}
def code(x, y): t_0 = (math.sin(x) * math.sinh(y)) / x tmp = 0 if (t_0 <= -500000.0) or not (t_0 <= 4e-8): tmp = (2.0 * math.sinh(y)) * 0.5 else: tmp = (math.sin(x) / x) * y return tmp
function code(x, y) t_0 = Float64(Float64(sin(x) * sinh(y)) / x) tmp = 0.0 if ((t_0 <= -500000.0) || !(t_0 <= 4e-8)) tmp = Float64(Float64(2.0 * sinh(y)) * 0.5); else tmp = Float64(Float64(sin(x) / x) * y); end return tmp end
function tmp_2 = code(x, y) t_0 = (sin(x) * sinh(y)) / x; tmp = 0.0; if ((t_0 <= -500000.0) || ~((t_0 <= 4e-8))) tmp = (2.0 * sinh(y)) * 0.5; else tmp = (sin(x) / x) * y; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -500000.0], N[Not[LessEqual[t$95$0, 4e-8]], $MachinePrecision]], N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
\mathbf{if}\;t\_0 \leq -500000 \lor \neg \left(t\_0 \leq 4 \cdot 10^{-8}\right):\\
\;\;\;\;\left(2 \cdot \sinh y\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -5e5 or 4.0000000000000001e-8 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6477.0
Applied rewrites77.0%
if -5e5 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 4.0000000000000001e-8Initial program 78.8%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f6498.8
Applied rewrites98.8%
Final simplification87.3%
(FPCore (x y)
:precision binary64
(if (<= x 0.0064)
(* (* 2.0 (sinh y)) 0.5)
(/
(*
(sin x)
(*
(fma
(fma
(fma 0.0001984126984126984 (* y y) 0.008333333333333333)
(* y y)
0.16666666666666666)
(* y y)
1.0)
y))
x)))
double code(double x, double y) {
double tmp;
if (x <= 0.0064) {
tmp = (2.0 * sinh(y)) * 0.5;
} else {
tmp = (sin(x) * (fma(fma(fma(0.0001984126984126984, (y * y), 0.008333333333333333), (y * y), 0.16666666666666666), (y * y), 1.0) * y)) / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 0.0064) tmp = Float64(Float64(2.0 * sinh(y)) * 0.5); else tmp = Float64(Float64(sin(x) * Float64(fma(fma(fma(0.0001984126984126984, Float64(y * y), 0.008333333333333333), Float64(y * y), 0.16666666666666666), Float64(y * y), 1.0) * y)) / x); end return tmp end
code[x_, y_] := If[LessEqual[x, 0.0064], N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[Sin[x], $MachinePrecision] * N[(N[(N[(N[(0.0001984126984126984 * N[(y * y), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] * N[(y * y), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0064:\\
\;\;\;\;\left(2 \cdot \sinh y\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin x \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.0001984126984126984, y \cdot y, 0.008333333333333333\right), y \cdot y, 0.16666666666666666\right), y \cdot y, 1\right) \cdot y\right)}{x}\\
\end{array}
\end{array}
if x < 0.00640000000000000031Initial program 87.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6472.0
Applied rewrites72.0%
if 0.00640000000000000031 < x Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6488.4
Applied rewrites88.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 2.0 (sinh y)))
(t_1 (* (* (/ (fma (* y y) 0.16666666666666666 1.0) x) y) (sin x))))
(if (<= y -3.2e+132)
t_1
(if (<= y -0.095)
(* t_0 (fma (* x x) -0.08333333333333333 0.5))
(if (or (<= y 0.195) (not (<= y 1.6e+147))) t_1 (* t_0 0.5))))))
double code(double x, double y) {
double t_0 = 2.0 * sinh(y);
double t_1 = ((fma((y * y), 0.16666666666666666, 1.0) / x) * y) * sin(x);
double tmp;
if (y <= -3.2e+132) {
tmp = t_1;
} else if (y <= -0.095) {
tmp = t_0 * fma((x * x), -0.08333333333333333, 0.5);
} else if ((y <= 0.195) || !(y <= 1.6e+147)) {
tmp = t_1;
} else {
tmp = t_0 * 0.5;
}
return tmp;
}
function code(x, y) t_0 = Float64(2.0 * sinh(y)) t_1 = Float64(Float64(Float64(fma(Float64(y * y), 0.16666666666666666, 1.0) / x) * y) * sin(x)) tmp = 0.0 if (y <= -3.2e+132) tmp = t_1; elseif (y <= -0.095) tmp = Float64(t_0 * fma(Float64(x * x), -0.08333333333333333, 0.5)); elseif ((y <= 0.195) || !(y <= 1.6e+147)) tmp = t_1; else tmp = Float64(t_0 * 0.5); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3.2e+132], t$95$1, If[LessEqual[y, -0.095], N[(t$95$0 * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[y, 0.195], N[Not[LessEqual[y, 1.6e+147]], $MachinePrecision]], t$95$1, N[(t$95$0 * 0.5), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \sinh y\\
t_1 := \left(\frac{\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)}{x} \cdot y\right) \cdot \sin x\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{+132}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -0.095:\\
\;\;\;\;t\_0 \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\
\mathbf{elif}\;y \leq 0.195 \lor \neg \left(y \leq 1.6 \cdot 10^{+147}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 \cdot 0.5\\
\end{array}
\end{array}
if y < -3.1999999999999997e132 or -0.095000000000000001 < y < 0.19500000000000001 or 1.59999999999999989e147 < y Initial program 86.4%
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-sinh.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift-sinh.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r/N/A
div-add-revN/A
+-commutativeN/A
lower-/.f64N/A
*-commutativeN/A
pow2N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f6499.0
Applied rewrites99.0%
if -3.1999999999999997e132 < y < -0.095000000000000001Initial program 100.0%
Taylor expanded in x around 0
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f64N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6481.5
Applied rewrites81.5%
if 0.19500000000000001 < y < 1.59999999999999989e147Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6480.0
Applied rewrites80.0%
Final simplification94.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (* 2.0 (sinh y)) (fma (* x x) -0.08333333333333333 0.5)))
(t_1 (fma (* y y) 0.16666666666666666 1.0))
(t_2 (/ (* (* t_1 (sin x)) y) x)))
(if (<= y -4e+106)
t_2
(if (<= y -0.095)
t_0
(if (<= y 0.195)
(* (* (/ t_1 x) y) (sin x))
(if (<= y 1.5e+103) t_0 t_2))))))
double code(double x, double y) {
double t_0 = (2.0 * sinh(y)) * fma((x * x), -0.08333333333333333, 0.5);
double t_1 = fma((y * y), 0.16666666666666666, 1.0);
double t_2 = ((t_1 * sin(x)) * y) / x;
double tmp;
if (y <= -4e+106) {
tmp = t_2;
} else if (y <= -0.095) {
tmp = t_0;
} else if (y <= 0.195) {
tmp = ((t_1 / x) * y) * sin(x);
} else if (y <= 1.5e+103) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(2.0 * sinh(y)) * fma(Float64(x * x), -0.08333333333333333, 0.5)) t_1 = fma(Float64(y * y), 0.16666666666666666, 1.0) t_2 = Float64(Float64(Float64(t_1 * sin(x)) * y) / x) tmp = 0.0 if (y <= -4e+106) tmp = t_2; elseif (y <= -0.095) tmp = t_0; elseif (y <= 0.195) tmp = Float64(Float64(Float64(t_1 / x) * y) * sin(x)); elseif (y <= 1.5e+103) tmp = t_0; else tmp = t_2; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 * N[Sin[x], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[y, -4e+106], t$95$2, If[LessEqual[y, -0.095], t$95$0, If[LessEqual[y, 0.195], N[(N[(N[(t$95$1 / x), $MachinePrecision] * y), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e+103], t$95$0, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\
t_1 := \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)\\
t_2 := \frac{\left(t\_1 \cdot \sin x\right) \cdot y}{x}\\
\mathbf{if}\;y \leq -4 \cdot 10^{+106}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -0.095:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 0.195:\\
\;\;\;\;\left(\frac{t\_1}{x} \cdot y\right) \cdot \sin x\\
\mathbf{elif}\;y \leq 1.5 \cdot 10^{+103}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -4.00000000000000036e106 or 1.5e103 < y Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lift-sin.f64100.0
Applied rewrites100.0%
if -4.00000000000000036e106 < y < -0.095000000000000001 or 0.19500000000000001 < y < 1.5e103Initial program 100.0%
Taylor expanded in x around 0
associate-*r*N/A
distribute-rgt-outN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f64N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6479.6
Applied rewrites79.6%
if -0.095000000000000001 < y < 0.19500000000000001Initial program 78.9%
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-sinh.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift-sinh.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r/N/A
div-add-revN/A
+-commutativeN/A
lower-/.f64N/A
*-commutativeN/A
pow2N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f6499.2
Applied rewrites99.2%
(FPCore (x y)
:precision binary64
(if (<= x 0.0064)
(* (* 2.0 (sinh y)) 0.5)
(/
(*
(sin x)
(*
(fma (fma (* y y) 0.008333333333333333 0.16666666666666666) (* y y) 1.0)
y))
x)))
double code(double x, double y) {
double tmp;
if (x <= 0.0064) {
tmp = (2.0 * sinh(y)) * 0.5;
} else {
tmp = (sin(x) * (fma(fma((y * y), 0.008333333333333333, 0.16666666666666666), (y * y), 1.0) * y)) / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 0.0064) tmp = Float64(Float64(2.0 * sinh(y)) * 0.5); else tmp = Float64(Float64(sin(x) * Float64(fma(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666), Float64(y * y), 1.0) * y)) / x); end return tmp end
code[x_, y_] := If[LessEqual[x, 0.0064], N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[Sin[x], $MachinePrecision] * N[(N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 0.0064:\\
\;\;\;\;\left(2 \cdot \sinh y\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin x \cdot \left(\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), y \cdot y, 1\right) \cdot y\right)}{x}\\
\end{array}
\end{array}
if x < 0.00640000000000000031Initial program 87.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6472.0
Applied rewrites72.0%
if 0.00640000000000000031 < x Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6486.4
Applied rewrites86.4%
(FPCore (x y) :precision binary64 (if (<= x 1.25e+62) (* (* 2.0 (sinh y)) 0.5) (* (* (pow y 6.0) 0.0001984126984126984) y)))
double code(double x, double y) {
double tmp;
if (x <= 1.25e+62) {
tmp = (2.0 * sinh(y)) * 0.5;
} else {
tmp = (pow(y, 6.0) * 0.0001984126984126984) * y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 1.25d+62) then
tmp = (2.0d0 * sinh(y)) * 0.5d0
else
tmp = ((y ** 6.0d0) * 0.0001984126984126984d0) * y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 1.25e+62) {
tmp = (2.0 * Math.sinh(y)) * 0.5;
} else {
tmp = (Math.pow(y, 6.0) * 0.0001984126984126984) * y;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1.25e+62: tmp = (2.0 * math.sinh(y)) * 0.5 else: tmp = (math.pow(y, 6.0) * 0.0001984126984126984) * y return tmp
function code(x, y) tmp = 0.0 if (x <= 1.25e+62) tmp = Float64(Float64(2.0 * sinh(y)) * 0.5); else tmp = Float64(Float64((y ^ 6.0) * 0.0001984126984126984) * y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 1.25e+62) tmp = (2.0 * sinh(y)) * 0.5; else tmp = ((y ^ 6.0) * 0.0001984126984126984) * y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1.25e+62], N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[Power[y, 6.0], $MachinePrecision] * 0.0001984126984126984), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.25 \cdot 10^{+62}:\\
\;\;\;\;\left(2 \cdot \sinh y\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\left({y}^{6} \cdot 0.0001984126984126984\right) \cdot y\\
\end{array}
\end{array}
if x < 1.25000000000000007e62Initial program 88.1%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6470.9
Applied rewrites70.9%
if 1.25000000000000007e62 < x Initial program 99.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6430.0
Applied rewrites30.0%
Taylor expanded in y around 0
*-commutativeN/A
Applied rewrites27.8%
Taylor expanded in y around inf
*-commutativeN/A
metadata-evalN/A
pow-prod-upN/A
pow-prod-downN/A
pow2N/A
lower-*.f64N/A
pow2N/A
pow-prod-downN/A
pow-prod-upN/A
metadata-evalN/A
lower-pow.f6450.6
Applied rewrites50.6%
(FPCore (x y) :precision binary64 (if (<= x 1.25e+62) (* (* 2.0 (sinh y)) 0.5) (* (pow y 7.0) 0.0001984126984126984)))
double code(double x, double y) {
double tmp;
if (x <= 1.25e+62) {
tmp = (2.0 * sinh(y)) * 0.5;
} else {
tmp = pow(y, 7.0) * 0.0001984126984126984;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= 1.25d+62) then
tmp = (2.0d0 * sinh(y)) * 0.5d0
else
tmp = (y ** 7.0d0) * 0.0001984126984126984d0
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 1.25e+62) {
tmp = (2.0 * Math.sinh(y)) * 0.5;
} else {
tmp = Math.pow(y, 7.0) * 0.0001984126984126984;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 1.25e+62: tmp = (2.0 * math.sinh(y)) * 0.5 else: tmp = math.pow(y, 7.0) * 0.0001984126984126984 return tmp
function code(x, y) tmp = 0.0 if (x <= 1.25e+62) tmp = Float64(Float64(2.0 * sinh(y)) * 0.5); else tmp = Float64((y ^ 7.0) * 0.0001984126984126984); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 1.25e+62) tmp = (2.0 * sinh(y)) * 0.5; else tmp = (y ^ 7.0) * 0.0001984126984126984; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 1.25e+62], N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[Power[y, 7.0], $MachinePrecision] * 0.0001984126984126984), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.25 \cdot 10^{+62}:\\
\;\;\;\;\left(2 \cdot \sinh y\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;{y}^{7} \cdot 0.0001984126984126984\\
\end{array}
\end{array}
if x < 1.25000000000000007e62Initial program 88.1%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6470.9
Applied rewrites70.9%
if 1.25000000000000007e62 < x Initial program 99.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6430.0
Applied rewrites30.0%
Taylor expanded in y around 0
*-commutativeN/A
Applied rewrites27.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-pow.f6450.6
Applied rewrites50.6%
(FPCore (x y)
:precision binary64
(if (<= x 5.1e+61)
(*
(fma
(*
(fma
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
(* y y)
0.16666666666666666)
y)
y
1.0)
y)
(* (pow y 7.0) 0.0001984126984126984)))
double code(double x, double y) {
double tmp;
if (x <= 5.1e+61) {
tmp = fma((fma(fma((y * y), 0.0001984126984126984, 0.008333333333333333), (y * y), 0.16666666666666666) * y), y, 1.0) * y;
} else {
tmp = pow(y, 7.0) * 0.0001984126984126984;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 5.1e+61) tmp = Float64(fma(Float64(fma(fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), Float64(y * y), 0.16666666666666666) * y), y, 1.0) * y); else tmp = Float64((y ^ 7.0) * 0.0001984126984126984); end return tmp end
code[x_, y_] := If[LessEqual[x, 5.1e+61], N[(N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] * N[(y * y), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * y), $MachinePrecision] * y + 1.0), $MachinePrecision] * y), $MachinePrecision], N[(N[Power[y, 7.0], $MachinePrecision] * 0.0001984126984126984), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 5.1 \cdot 10^{+61}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), y \cdot y, 0.16666666666666666\right) \cdot y, y, 1\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;{y}^{7} \cdot 0.0001984126984126984\\
\end{array}
\end{array}
if x < 5.1000000000000001e61Initial program 88.1%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6470.9
Applied rewrites70.9%
Taylor expanded in y around 0
*-commutativeN/A
Applied rewrites61.4%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f6461.4
Applied rewrites61.4%
if 5.1000000000000001e61 < x Initial program 99.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6430.0
Applied rewrites30.0%
Taylor expanded in y around 0
*-commutativeN/A
Applied rewrites27.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-pow.f6450.6
Applied rewrites50.6%
(FPCore (x y)
:precision binary64
(if (<= x 1.9e+26)
(*
(fma
(*
(fma
(fma (* y y) 0.0001984126984126984 0.008333333333333333)
(* y y)
0.16666666666666666)
y)
y
1.0)
y)
(/ (* (* (* (* y y) 0.16666666666666666) x) y) x)))
double code(double x, double y) {
double tmp;
if (x <= 1.9e+26) {
tmp = fma((fma(fma((y * y), 0.0001984126984126984, 0.008333333333333333), (y * y), 0.16666666666666666) * y), y, 1.0) * y;
} else {
tmp = ((((y * y) * 0.16666666666666666) * x) * y) / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 1.9e+26) tmp = Float64(fma(Float64(fma(fma(Float64(y * y), 0.0001984126984126984, 0.008333333333333333), Float64(y * y), 0.16666666666666666) * y), y, 1.0) * y); else tmp = Float64(Float64(Float64(Float64(Float64(y * y) * 0.16666666666666666) * x) * y) / x); end return tmp end
code[x_, y_] := If[LessEqual[x, 1.9e+26], N[(N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] * N[(y * y), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * y), $MachinePrecision] * y + 1.0), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] * x), $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.9 \cdot 10^{+26}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.0001984126984126984, 0.008333333333333333\right), y \cdot y, 0.16666666666666666\right) \cdot y, y, 1\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot x\right) \cdot y}{x}\\
\end{array}
\end{array}
if x < 1.9000000000000001e26Initial program 87.8%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6471.4
Applied rewrites71.4%
Taylor expanded in y around 0
*-commutativeN/A
Applied rewrites61.6%
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f6461.6
Applied rewrites61.6%
if 1.9000000000000001e26 < x Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lift-sin.f6476.8
Applied rewrites76.8%
Taylor expanded in x around 0
Applied rewrites30.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6448.4
Applied rewrites48.4%
(FPCore (x y)
:precision binary64
(if (<= x 1.9e+26)
(*
(fma
(fma (* (* y y) 0.0001984126984126984) (* y y) 0.16666666666666666)
(* y y)
1.0)
y)
(/ (* (* (* (* y y) 0.16666666666666666) x) y) x)))
double code(double x, double y) {
double tmp;
if (x <= 1.9e+26) {
tmp = fma(fma(((y * y) * 0.0001984126984126984), (y * y), 0.16666666666666666), (y * y), 1.0) * y;
} else {
tmp = ((((y * y) * 0.16666666666666666) * x) * y) / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 1.9e+26) tmp = Float64(fma(fma(Float64(Float64(y * y) * 0.0001984126984126984), Float64(y * y), 0.16666666666666666), Float64(y * y), 1.0) * y); else tmp = Float64(Float64(Float64(Float64(Float64(y * y) * 0.16666666666666666) * x) * y) / x); end return tmp end
code[x_, y_] := If[LessEqual[x, 1.9e+26], N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 0.0001984126984126984), $MachinePrecision] * N[(y * y), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] * x), $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.9 \cdot 10^{+26}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(y \cdot y\right) \cdot 0.0001984126984126984, y \cdot y, 0.16666666666666666\right), y \cdot y, 1\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot x\right) \cdot y}{x}\\
\end{array}
\end{array}
if x < 1.9000000000000001e26Initial program 87.8%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6471.4
Applied rewrites71.4%
Taylor expanded in y around 0
*-commutativeN/A
Applied rewrites61.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6461.6
Applied rewrites61.6%
if 1.9000000000000001e26 < x Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lift-sin.f6476.8
Applied rewrites76.8%
Taylor expanded in x around 0
Applied rewrites30.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6448.4
Applied rewrites48.4%
(FPCore (x y)
:precision binary64
(if (<= x 1.9e+26)
(*
(fma (fma (* y y) 0.008333333333333333 0.16666666666666666) (* y y) 1.0)
y)
(/ (* (* (* (* y y) 0.16666666666666666) x) y) x)))
double code(double x, double y) {
double tmp;
if (x <= 1.9e+26) {
tmp = fma(fma((y * y), 0.008333333333333333, 0.16666666666666666), (y * y), 1.0) * y;
} else {
tmp = ((((y * y) * 0.16666666666666666) * x) * y) / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 1.9e+26) tmp = Float64(fma(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666), Float64(y * y), 1.0) * y); else tmp = Float64(Float64(Float64(Float64(Float64(y * y) * 0.16666666666666666) * x) * y) / x); end return tmp end
code[x_, y_] := If[LessEqual[x, 1.9e+26], N[(N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] * x), $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.9 \cdot 10^{+26}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), y \cdot y, 1\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot x\right) \cdot y}{x}\\
\end{array}
\end{array}
if x < 1.9000000000000001e26Initial program 87.8%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6471.4
Applied rewrites71.4%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6459.3
Applied rewrites59.3%
if 1.9000000000000001e26 < x Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lift-sin.f6476.8
Applied rewrites76.8%
Taylor expanded in x around 0
Applied rewrites30.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6448.4
Applied rewrites48.4%
(FPCore (x y)
:precision binary64
(if (<= x 8.5e+61)
(*
(fma (fma (* y y) 0.008333333333333333 0.16666666666666666) (* y y) 1.0)
y)
(* (* (* y y) 0.16666666666666666) y)))
double code(double x, double y) {
double tmp;
if (x <= 8.5e+61) {
tmp = fma(fma((y * y), 0.008333333333333333, 0.16666666666666666), (y * y), 1.0) * y;
} else {
tmp = ((y * y) * 0.16666666666666666) * y;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 8.5e+61) tmp = Float64(fma(fma(Float64(y * y), 0.008333333333333333, 0.16666666666666666), Float64(y * y), 1.0) * y); else tmp = Float64(Float64(Float64(y * y) * 0.16666666666666666) * y); end return tmp end
code[x_, y_] := If[LessEqual[x, 8.5e+61], N[(N[(N[(N[(y * y), $MachinePrecision] * 0.008333333333333333 + 0.16666666666666666), $MachinePrecision] * N[(y * y), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8.5 \cdot 10^{+61}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(y \cdot y, 0.008333333333333333, 0.16666666666666666\right), y \cdot y, 1\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot y\\
\end{array}
\end{array}
if x < 8.50000000000000035e61Initial program 88.1%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6470.9
Applied rewrites70.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6459.2
Applied rewrites59.2%
if 8.50000000000000035e61 < x Initial program 99.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6430.0
Applied rewrites30.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
pow2N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f6420.7
Applied rewrites20.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6440.9
Applied rewrites40.9%
(FPCore (x y) :precision binary64 (if (or (<= y -3.25e-9) (not (<= y 2.4e-5))) (* (* (* y y) 0.16666666666666666) y) y))
double code(double x, double y) {
double tmp;
if ((y <= -3.25e-9) || !(y <= 2.4e-5)) {
tmp = ((y * y) * 0.16666666666666666) * y;
} else {
tmp = y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if ((y <= (-3.25d-9)) .or. (.not. (y <= 2.4d-5))) then
tmp = ((y * y) * 0.16666666666666666d0) * y
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if ((y <= -3.25e-9) || !(y <= 2.4e-5)) {
tmp = ((y * y) * 0.16666666666666666) * y;
} else {
tmp = y;
}
return tmp;
}
def code(x, y): tmp = 0 if (y <= -3.25e-9) or not (y <= 2.4e-5): tmp = ((y * y) * 0.16666666666666666) * y else: tmp = y return tmp
function code(x, y) tmp = 0.0 if ((y <= -3.25e-9) || !(y <= 2.4e-5)) tmp = Float64(Float64(Float64(y * y) * 0.16666666666666666) * y); else tmp = y; end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if ((y <= -3.25e-9) || ~((y <= 2.4e-5))) tmp = ((y * y) * 0.16666666666666666) * y; else tmp = y; end tmp_2 = tmp; end
code[x_, y_] := If[Or[LessEqual[y, -3.25e-9], N[Not[LessEqual[y, 2.4e-5]], $MachinePrecision]], N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] * y), $MachinePrecision], y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.25 \cdot 10^{-9} \lor \neg \left(y \leq 2.4 \cdot 10^{-5}\right):\\
\;\;\;\;\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -3.2500000000000002e-9 or 2.4000000000000001e-5 < y Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6474.7
Applied rewrites74.7%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
pow2N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f6448.1
Applied rewrites48.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6448.1
Applied rewrites48.1%
if -3.2500000000000002e-9 < y < 2.4000000000000001e-5Initial program 78.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6452.6
Applied rewrites52.6%
Taylor expanded in y around 0
Applied rewrites52.6%
Final simplification50.1%
(FPCore (x y) :precision binary64 (if (<= x 1.9e+26) (* (fma y (* y 0.16666666666666666) 1.0) y) (* (* (* y y) 0.16666666666666666) y)))
double code(double x, double y) {
double tmp;
if (x <= 1.9e+26) {
tmp = fma(y, (y * 0.16666666666666666), 1.0) * y;
} else {
tmp = ((y * y) * 0.16666666666666666) * y;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 1.9e+26) tmp = Float64(fma(y, Float64(y * 0.16666666666666666), 1.0) * y); else tmp = Float64(Float64(Float64(y * y) * 0.16666666666666666) * y); end return tmp end
code[x_, y_] := If[LessEqual[x, 1.9e+26], N[(N[(y * N[(y * 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.9 \cdot 10^{+26}:\\
\;\;\;\;\mathsf{fma}\left(y, y \cdot 0.16666666666666666, 1\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot y\\
\end{array}
\end{array}
if x < 1.9000000000000001e26Initial program 87.8%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6471.4
Applied rewrites71.4%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
pow2N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f6456.1
Applied rewrites56.1%
lift-*.f64N/A
lift-fma.f64N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f6456.1
Applied rewrites56.1%
if 1.9000000000000001e26 < x Initial program 99.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6433.0
Applied rewrites33.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
pow2N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f6422.9
Applied rewrites22.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6440.4
Applied rewrites40.4%
(FPCore (x y) :precision binary64 y)
double code(double x, double y) {
return y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
code = y
end function
public static double code(double x, double y) {
return y;
}
def code(x, y): return y
function code(x, y) return y end
function tmp = code(x, y) tmp = y; end
code[x_, y_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 90.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6464.5
Applied rewrites64.5%
Taylor expanded in y around 0
Applied rewrites26.5%
(FPCore (x y) :precision binary64 (* (sin x) (/ (sinh y) x)))
double code(double x, double y) {
return sin(x) * (sinh(y) / x);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
code = sin(x) * (sinh(y) / x)
end function
public static double code(double x, double y) {
return Math.sin(x) * (Math.sinh(y) / x);
}
def code(x, y): return math.sin(x) * (math.sinh(y) / x)
function code(x, y) return Float64(sin(x) * Float64(sinh(y) / x)) end
function tmp = code(x, y) tmp = sin(x) * (sinh(y) / x); end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\sin x \cdot \frac{\sinh y}{x}
\end{array}
herbie shell --seed 2025084
(FPCore (x y)
:name "Linear.Quaternion:$ccosh from linear-1.19.1.3"
:precision binary64
:alt
(! :herbie-platform default (* (sin x) (/ (sinh y) x)))
(/ (* (sin x) (sinh y)) x))