
(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 18 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 88.7%
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.9
Applied rewrites99.9%
(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)))
(if (<= y -2.4e+132)
(* (/ (* (* (* y y) 0.16666666666666666) (sin x)) x) y)
(if (<= y -27.0)
t_0
(if (<= y 2.1e-13)
(* (* t_1 (/ (sin x) x)) y)
(if (<= y 1.55e+106) t_0 (* (/ (* (sin x) t_1) x) y)))))))
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 tmp;
if (y <= -2.4e+132) {
tmp = ((((y * y) * 0.16666666666666666) * sin(x)) / x) * y;
} else if (y <= -27.0) {
tmp = t_0;
} else if (y <= 2.1e-13) {
tmp = (t_1 * (sin(x) / x)) * y;
} else if (y <= 1.55e+106) {
tmp = t_0;
} else {
tmp = ((sin(x) * t_1) / x) * y;
}
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) tmp = 0.0 if (y <= -2.4e+132) tmp = Float64(Float64(Float64(Float64(Float64(y * y) * 0.16666666666666666) * sin(x)) / x) * y); elseif (y <= -27.0) tmp = t_0; elseif (y <= 2.1e-13) tmp = Float64(Float64(t_1 * Float64(sin(x) / x)) * y); elseif (y <= 1.55e+106) tmp = t_0; else tmp = Float64(Float64(Float64(sin(x) * t_1) / x) * y); 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]}, If[LessEqual[y, -2.4e+132], N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, -27.0], t$95$0, If[LessEqual[y, 2.1e-13], N[(N[(t$95$1 * N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, 1.55e+106], t$95$0, N[(N[(N[(N[Sin[x], $MachinePrecision] * t$95$1), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision]]]]]]]
\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)\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{+132}:\\
\;\;\;\;\frac{\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot \sin x}{x} \cdot y\\
\mathbf{elif}\;y \leq -27:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-13}:\\
\;\;\;\;\left(t\_1 \cdot \frac{\sin x}{x}\right) \cdot y\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+106}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\sin x \cdot t\_1}{x} \cdot y\\
\end{array}
\end{array}
if y < -2.4000000000000001e132Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites96.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6496.7
Applied rewrites96.7%
if -2.4000000000000001e132 < y < -27 or 2.09999999999999989e-13 < y < 1.55e106Initial program 99.9%
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-*.f6471.4
Applied rewrites71.4%
if -27 < y < 2.09999999999999989e-13Initial program 77.3%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.4%
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-sin.f64N/A
associate-/l*N/A
+-commutativeN/A
pow2N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
pow2N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lower-/.f64N/A
lift-sin.f6499.4
Applied rewrites99.4%
if 1.55e106 < y Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.4%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-sin.f64N/A
*-commutativeN/A
+-commutativeN/A
pow2N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f64N/A
*-commutativeN/A
pow2N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f6493.4
Applied rewrites93.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (* 2.0 (sinh y)) (fma (* x x) -0.08333333333333333 0.5)))
(t_1 (* (/ (* (sin x) (fma (* y y) 0.16666666666666666 1.0)) x) y)))
(if (<= y -2.4e+132)
(* (/ (* (* (* y y) 0.16666666666666666) (sin x)) x) y)
(if (<= y -27.0)
t_0
(if (<= y 2.1e-13) t_1 (if (<= y 1.55e+106) t_0 t_1))))))
double code(double x, double y) {
double t_0 = (2.0 * sinh(y)) * fma((x * x), -0.08333333333333333, 0.5);
double t_1 = ((sin(x) * fma((y * y), 0.16666666666666666, 1.0)) / x) * y;
double tmp;
if (y <= -2.4e+132) {
tmp = ((((y * y) * 0.16666666666666666) * sin(x)) / x) * y;
} else if (y <= -27.0) {
tmp = t_0;
} else if (y <= 2.1e-13) {
tmp = t_1;
} else if (y <= 1.55e+106) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(2.0 * sinh(y)) * fma(Float64(x * x), -0.08333333333333333, 0.5)) t_1 = Float64(Float64(Float64(sin(x) * fma(Float64(y * y), 0.16666666666666666, 1.0)) / x) * y) tmp = 0.0 if (y <= -2.4e+132) tmp = Float64(Float64(Float64(Float64(Float64(y * y) * 0.16666666666666666) * sin(x)) / x) * y); elseif (y <= -27.0) tmp = t_0; elseif (y <= 2.1e-13) tmp = t_1; elseif (y <= 1.55e+106) tmp = t_0; else tmp = t_1; 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[(N[(N[Sin[x], $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.4e+132], N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, -27.0], t$95$0, If[LessEqual[y, 2.1e-13], t$95$1, If[LessEqual[y, 1.55e+106], t$95$0, t$95$1]]]]]]
\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 := \frac{\sin x \cdot \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)}{x} \cdot y\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{+132}:\\
\;\;\;\;\frac{\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot \sin x}{x} \cdot y\\
\mathbf{elif}\;y \leq -27:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+106}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.4000000000000001e132Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites96.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6496.7
Applied rewrites96.7%
if -2.4000000000000001e132 < y < -27 or 2.09999999999999989e-13 < y < 1.55e106Initial program 99.9%
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-*.f6471.4
Applied rewrites71.4%
if -27 < y < 2.09999999999999989e-13 or 1.55e106 < y Initial program 82.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites97.9%
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-sin.f64N/A
*-commutativeN/A
+-commutativeN/A
pow2N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f64N/A
*-commutativeN/A
pow2N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f6497.9
Applied rewrites97.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (* 2.0 (sinh y)) (fma (* x x) -0.08333333333333333 0.5)))
(t_1 (* (/ (* (* (* y y) 0.16666666666666666) (sin x)) x) y)))
(if (<= y -2.4e+132)
t_1
(if (<= y -27.0)
t_0
(if (<= y 2.1e-13)
(* (/ (sin x) x) y)
(if (<= y 1.55e+106) t_0 t_1))))))
double code(double x, double y) {
double t_0 = (2.0 * sinh(y)) * fma((x * x), -0.08333333333333333, 0.5);
double t_1 = ((((y * y) * 0.16666666666666666) * sin(x)) / x) * y;
double tmp;
if (y <= -2.4e+132) {
tmp = t_1;
} else if (y <= -27.0) {
tmp = t_0;
} else if (y <= 2.1e-13) {
tmp = (sin(x) / x) * y;
} else if (y <= 1.55e+106) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(2.0 * sinh(y)) * fma(Float64(x * x), -0.08333333333333333, 0.5)) t_1 = Float64(Float64(Float64(Float64(Float64(y * y) * 0.16666666666666666) * sin(x)) / x) * y) tmp = 0.0 if (y <= -2.4e+132) tmp = t_1; elseif (y <= -27.0) tmp = t_0; elseif (y <= 2.1e-13) tmp = Float64(Float64(sin(x) / x) * y); elseif (y <= 1.55e+106) tmp = t_0; else tmp = t_1; 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[(N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.4e+132], t$95$1, If[LessEqual[y, -27.0], t$95$0, If[LessEqual[y, 2.1e-13], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, 1.55e+106], t$95$0, t$95$1]]]]]]
\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 := \frac{\left(\left(y \cdot y\right) \cdot 0.16666666666666666\right) \cdot \sin x}{x} \cdot y\\
\mathbf{if}\;y \leq -2.4 \cdot 10^{+132}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -27:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-13}:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+106}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.4000000000000001e132 or 1.55e106 < y Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites94.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6494.9
Applied rewrites94.9%
if -2.4000000000000001e132 < y < -27 or 2.09999999999999989e-13 < y < 1.55e106Initial program 99.9%
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-*.f6471.4
Applied rewrites71.4%
if -27 < y < 2.09999999999999989e-13Initial program 77.3%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f6499.1
Applied rewrites99.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sin x) (sinh y)) x))
(t_1 (* (* 2.0 (sinh y)) (fma (* x x) -0.08333333333333333 0.5))))
(if (<= t_0 -2e-6) t_1 (if (<= t_0 5e-48) (* (/ (sin x) x) y) t_1))))
double code(double x, double y) {
double t_0 = (sin(x) * sinh(y)) / x;
double t_1 = (2.0 * sinh(y)) * fma((x * x), -0.08333333333333333, 0.5);
double tmp;
if (t_0 <= -2e-6) {
tmp = t_1;
} else if (t_0 <= 5e-48) {
tmp = (sin(x) / x) * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sin(x) * sinh(y)) / x) t_1 = Float64(Float64(2.0 * sinh(y)) * fma(Float64(x * x), -0.08333333333333333, 0.5)) tmp = 0.0 if (t_0 <= -2e-6) tmp = t_1; elseif (t_0 <= 5e-48) tmp = Float64(Float64(sin(x) / x) * y); else tmp = t_1; 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[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -2e-6], t$95$1, If[LessEqual[t$95$0, 5e-48], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
t_1 := \left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-48}:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -1.99999999999999991e-6 or 4.9999999999999999e-48 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 99.9%
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-*.f6474.8
Applied rewrites74.8%
if -1.99999999999999991e-6 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 4.9999999999999999e-48Initial program 76.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f6499.2
Applied rewrites99.2%
(FPCore (x y) :precision binary64 (if (<= x 4.5e+115) (* (* 2.0 (sinh y)) (fma (* x x) -0.08333333333333333 0.5)) (* (- (exp y) (exp (- y))) 0.5)))
double code(double x, double y) {
double tmp;
if (x <= 4.5e+115) {
tmp = (2.0 * sinh(y)) * fma((x * x), -0.08333333333333333, 0.5);
} else {
tmp = (exp(y) - exp(-y)) * 0.5;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 4.5e+115) tmp = Float64(Float64(2.0 * sinh(y)) * fma(Float64(x * x), -0.08333333333333333, 0.5)); else tmp = Float64(Float64(exp(y) - exp(Float64(-y))) * 0.5); end return tmp end
code[x_, y_] := If[LessEqual[x, 4.5e+115], N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[y], $MachinePrecision] - N[Exp[(-y)], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.5 \cdot 10^{+115}:\\
\;\;\;\;\left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(e^{y} - e^{-y}\right) \cdot 0.5\\
\end{array}
\end{array}
if x < 4.49999999999999963e115Initial program 86.7%
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-*.f6468.5
Applied rewrites68.5%
if 4.49999999999999963e115 < 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.f6426.7
Applied rewrites26.7%
lift-*.f64N/A
lift-sinh.f64N/A
sinh-undef-revN/A
rec-expN/A
lower--.f64N/A
lower-exp.f64N/A
rec-expN/A
lower-exp.f64N/A
lower-neg.f6457.6
Applied rewrites57.6%
(FPCore (x y) :precision binary64 (if (<= x 4.5e+115) (* (* 2.0 (sinh y)) (fma (* x x) -0.08333333333333333 0.5)) (/ (* x (* (* (* y y) y) 0.16666666666666666)) x)))
double code(double x, double y) {
double tmp;
if (x <= 4.5e+115) {
tmp = (2.0 * sinh(y)) * fma((x * x), -0.08333333333333333, 0.5);
} else {
tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 4.5e+115) tmp = Float64(Float64(2.0 * sinh(y)) * fma(Float64(x * x), -0.08333333333333333, 0.5)); else tmp = Float64(Float64(x * Float64(Float64(Float64(y * y) * y) * 0.16666666666666666)) / x); end return tmp end
code[x_, y_] := If[LessEqual[x, 4.5e+115], N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.5 \cdot 10^{+115}:\\
\;\;\;\;\left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x}\\
\end{array}
\end{array}
if x < 4.49999999999999963e115Initial program 86.7%
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-*.f6468.5
Applied rewrites68.5%
if 4.49999999999999963e115 < x Initial program 99.9%
Taylor expanded in x around 0
Applied rewrites26.7%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6424.5
Applied rewrites24.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
unpow3N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f6451.4
Applied rewrites51.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 2.0 (sinh y))))
(if (<= x 16.0)
(* t_0 0.5)
(if (<= x 4.5e+115)
(* t_0 (* (* x x) -0.08333333333333333))
(/ (* x (* (* (* y y) y) 0.16666666666666666)) x)))))
double code(double x, double y) {
double t_0 = 2.0 * sinh(y);
double tmp;
if (x <= 16.0) {
tmp = t_0 * 0.5;
} else if (x <= 4.5e+115) {
tmp = t_0 * ((x * x) * -0.08333333333333333);
} else {
tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x;
}
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 = 2.0d0 * sinh(y)
if (x <= 16.0d0) then
tmp = t_0 * 0.5d0
else if (x <= 4.5d+115) then
tmp = t_0 * ((x * x) * (-0.08333333333333333d0))
else
tmp = (x * (((y * y) * y) * 0.16666666666666666d0)) / x
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 2.0 * Math.sinh(y);
double tmp;
if (x <= 16.0) {
tmp = t_0 * 0.5;
} else if (x <= 4.5e+115) {
tmp = t_0 * ((x * x) * -0.08333333333333333);
} else {
tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x;
}
return tmp;
}
def code(x, y): t_0 = 2.0 * math.sinh(y) tmp = 0 if x <= 16.0: tmp = t_0 * 0.5 elif x <= 4.5e+115: tmp = t_0 * ((x * x) * -0.08333333333333333) else: tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x return tmp
function code(x, y) t_0 = Float64(2.0 * sinh(y)) tmp = 0.0 if (x <= 16.0) tmp = Float64(t_0 * 0.5); elseif (x <= 4.5e+115) tmp = Float64(t_0 * Float64(Float64(x * x) * -0.08333333333333333)); else tmp = Float64(Float64(x * Float64(Float64(Float64(y * y) * y) * 0.16666666666666666)) / x); end return tmp end
function tmp_2 = code(x, y) t_0 = 2.0 * sinh(y); tmp = 0.0; if (x <= 16.0) tmp = t_0 * 0.5; elseif (x <= 4.5e+115) tmp = t_0 * ((x * x) * -0.08333333333333333); else tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 16.0], N[(t$95$0 * 0.5), $MachinePrecision], If[LessEqual[x, 4.5e+115], N[(t$95$0 * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \sinh y\\
\mathbf{if}\;x \leq 16:\\
\;\;\;\;t\_0 \cdot 0.5\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{+115}:\\
\;\;\;\;t\_0 \cdot \left(\left(x \cdot x\right) \cdot -0.08333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x}\\
\end{array}
\end{array}
if x < 16Initial program 85.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6474.6
Applied rewrites74.6%
if 16 < x < 4.49999999999999963e115Initial program 99.8%
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-*.f6424.2
Applied rewrites24.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6424.2
Applied rewrites24.2%
if 4.49999999999999963e115 < x Initial program 99.9%
Taylor expanded in x around 0
Applied rewrites26.7%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6424.5
Applied rewrites24.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
unpow3N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f6451.4
Applied rewrites51.4%
(FPCore (x y)
:precision binary64
(if (<= x 4e+46)
(* (* 2.0 (sinh y)) 0.5)
(if (<= x 4.5e+115)
(*
(* (fma 0.3333333333333333 (* y y) 2.0) y)
(* (* x x) -0.08333333333333333))
(/ (* x (* (* (* y y) y) 0.16666666666666666)) x))))
double code(double x, double y) {
double tmp;
if (x <= 4e+46) {
tmp = (2.0 * sinh(y)) * 0.5;
} else if (x <= 4.5e+115) {
tmp = (fma(0.3333333333333333, (y * y), 2.0) * y) * ((x * x) * -0.08333333333333333);
} else {
tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 4e+46) tmp = Float64(Float64(2.0 * sinh(y)) * 0.5); elseif (x <= 4.5e+115) tmp = Float64(Float64(fma(0.3333333333333333, Float64(y * y), 2.0) * y) * Float64(Float64(x * x) * -0.08333333333333333)); else tmp = Float64(Float64(x * Float64(Float64(Float64(y * y) * y) * 0.16666666666666666)) / x); end return tmp end
code[x_, y_] := If[LessEqual[x, 4e+46], N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 4.5e+115], N[(N[(N[(0.3333333333333333 * N[(y * y), $MachinePrecision] + 2.0), $MachinePrecision] * y), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4 \cdot 10^{+46}:\\
\;\;\;\;\left(2 \cdot \sinh y\right) \cdot 0.5\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{+115}:\\
\;\;\;\;\left(\mathsf{fma}\left(0.3333333333333333, y \cdot y, 2\right) \cdot y\right) \cdot \left(\left(x \cdot x\right) \cdot -0.08333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x}\\
\end{array}
\end{array}
if x < 4e46Initial program 85.8%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6472.4
Applied rewrites72.4%
if 4e46 < x < 4.49999999999999963e115Initial program 99.8%
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-*.f6423.8
Applied rewrites23.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6423.8
Applied rewrites23.8%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6421.4
Applied rewrites21.4%
if 4.49999999999999963e115 < x Initial program 99.9%
Taylor expanded in x around 0
Applied rewrites26.7%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6424.5
Applied rewrites24.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
unpow3N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f6451.4
Applied rewrites51.4%
(FPCore (x y)
:precision binary64
(if (<= y -1.1e+162)
(*
(* (fma 0.3333333333333333 (* y y) 2.0) y)
(fma (* x x) -0.08333333333333333 0.5))
(* x (/ (sinh y) x))))
double code(double x, double y) {
double tmp;
if (y <= -1.1e+162) {
tmp = (fma(0.3333333333333333, (y * y), 2.0) * y) * fma((x * x), -0.08333333333333333, 0.5);
} else {
tmp = x * (sinh(y) / x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (y <= -1.1e+162) tmp = Float64(Float64(fma(0.3333333333333333, Float64(y * y), 2.0) * y) * fma(Float64(x * x), -0.08333333333333333, 0.5)); else tmp = Float64(x * Float64(sinh(y) / x)); end return tmp end
code[x_, y_] := If[LessEqual[y, -1.1e+162], N[(N[(N[(0.3333333333333333 * N[(y * y), $MachinePrecision] + 2.0), $MachinePrecision] * y), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333 + 0.5), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.1 \cdot 10^{+162}:\\
\;\;\;\;\left(\mathsf{fma}\left(0.3333333333333333, y \cdot y, 2\right) \cdot y\right) \cdot \mathsf{fma}\left(x \cdot x, -0.08333333333333333, 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\sinh y}{x}\\
\end{array}
\end{array}
if y < -1.1000000000000001e162Initial 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-*.f6475.2
Applied rewrites75.2%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6475.2
Applied rewrites75.2%
if -1.1000000000000001e162 < y Initial program 87.1%
Taylor expanded in x around 0
Applied rewrites48.8%
lift-/.f64N/A
lift-*.f64N/A
lift-sinh.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sinh.f64N/A
lift-/.f6473.6
Applied rewrites73.6%
(FPCore (x y) :precision binary64 (if (<= x 550000.0) (* (* 2.0 (sinh y)) 0.5) (/ (* x (* (* (* y y) y) 0.16666666666666666)) x)))
double code(double x, double y) {
double tmp;
if (x <= 550000.0) {
tmp = (2.0 * sinh(y)) * 0.5;
} else {
tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x;
}
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 <= 550000.0d0) then
tmp = (2.0d0 * sinh(y)) * 0.5d0
else
tmp = (x * (((y * y) * y) * 0.16666666666666666d0)) / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (x <= 550000.0) {
tmp = (2.0 * Math.sinh(y)) * 0.5;
} else {
tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x;
}
return tmp;
}
def code(x, y): tmp = 0 if x <= 550000.0: tmp = (2.0 * math.sinh(y)) * 0.5 else: tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x return tmp
function code(x, y) tmp = 0.0 if (x <= 550000.0) tmp = Float64(Float64(2.0 * sinh(y)) * 0.5); else tmp = Float64(Float64(x * Float64(Float64(Float64(y * y) * y) * 0.16666666666666666)) / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (x <= 550000.0) tmp = (2.0 * sinh(y)) * 0.5; else tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[x, 550000.0], N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(x * N[(N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 550000:\\
\;\;\;\;\left(2 \cdot \sinh y\right) \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x}\\
\end{array}
\end{array}
if x < 5.5e5Initial program 85.1%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6474.4
Applied rewrites74.4%
if 5.5e5 < x Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites28.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6424.1
Applied rewrites24.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
unpow3N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f6444.2
Applied rewrites44.2%
(FPCore (x y) :precision binary64 (* x (/ (sinh y) x)))
double code(double x, double y) {
return 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 = x * (sinh(y) / x)
end function
public static double code(double x, double y) {
return x * (Math.sinh(y) / x);
}
def code(x, y): return x * (math.sinh(y) / x)
function code(x, y) return Float64(x * Float64(sinh(y) / x)) end
function tmp = code(x, y) tmp = x * (sinh(y) / x); end
code[x_, y_] := N[(x * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{\sinh y}{x}
\end{array}
Initial program 88.7%
Taylor expanded in x around 0
Applied rewrites52.0%
lift-/.f64N/A
lift-*.f64N/A
lift-sinh.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sinh.f64N/A
lift-/.f6473.8
Applied rewrites73.8%
(FPCore (x y) :precision binary64 (if (<= x 550000.0) (* x (/ (* (fma (* y y) 0.16666666666666666 1.0) y) x)) (/ (* x (* (* (* y y) y) 0.16666666666666666)) x)))
double code(double x, double y) {
double tmp;
if (x <= 550000.0) {
tmp = x * ((fma((y * y), 0.16666666666666666, 1.0) * y) / x);
} else {
tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 550000.0) tmp = Float64(x * Float64(Float64(fma(Float64(y * y), 0.16666666666666666, 1.0) * y) / x)); else tmp = Float64(Float64(x * Float64(Float64(Float64(y * y) * y) * 0.16666666666666666)) / x); end return tmp end
code[x_, y_] := If[LessEqual[x, 550000.0], N[(x * N[(N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 550000:\\
\;\;\;\;x \cdot \frac{\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x}\\
\end{array}
\end{array}
if x < 5.5e5Initial program 85.1%
Taylor expanded in x around 0
Applied rewrites59.6%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6448.3
Applied rewrites48.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6474.1
Applied rewrites74.1%
if 5.5e5 < x Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites28.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6424.1
Applied rewrites24.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
unpow3N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f6444.2
Applied rewrites44.2%
(FPCore (x y) :precision binary64 (if (<= x 550000.0) (* (fma (* y y) 0.16666666666666666 1.0) y) (/ (* x (* (* (* y y) y) 0.16666666666666666)) x)))
double code(double x, double y) {
double tmp;
if (x <= 550000.0) {
tmp = fma((y * y), 0.16666666666666666, 1.0) * y;
} else {
tmp = (x * (((y * y) * y) * 0.16666666666666666)) / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 550000.0) tmp = Float64(fma(Float64(y * y), 0.16666666666666666, 1.0) * y); else tmp = Float64(Float64(x * Float64(Float64(Float64(y * y) * y) * 0.16666666666666666)) / x); end return tmp end
code[x_, y_] := If[LessEqual[x, 550000.0], N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] * y), $MachinePrecision], N[(N[(x * N[(N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 550000:\\
\;\;\;\;\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot 0.16666666666666666\right)}{x}\\
\end{array}
\end{array}
if x < 5.5e5Initial program 85.1%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6474.4
Applied rewrites74.4%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6461.7
Applied rewrites61.7%
if 5.5e5 < x Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites28.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6424.1
Applied rewrites24.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
unpow3N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lift-*.f6444.2
Applied rewrites44.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (fma (* y y) 0.16666666666666666 1.0) y)))
(if (<= y -6.2e-143)
t_0
(if (<= y 2e-130)
(* x (/ y x))
(if (<= y 1.35e+82) (fma (* x x) (* -0.16666666666666666 y) y) t_0)))))
double code(double x, double y) {
double t_0 = fma((y * y), 0.16666666666666666, 1.0) * y;
double tmp;
if (y <= -6.2e-143) {
tmp = t_0;
} else if (y <= 2e-130) {
tmp = x * (y / x);
} else if (y <= 1.35e+82) {
tmp = fma((x * x), (-0.16666666666666666 * y), y);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) t_0 = Float64(fma(Float64(y * y), 0.16666666666666666, 1.0) * y) tmp = 0.0 if (y <= -6.2e-143) tmp = t_0; elseif (y <= 2e-130) tmp = Float64(x * Float64(y / x)); elseif (y <= 1.35e+82) tmp = fma(Float64(x * x), Float64(-0.16666666666666666 * y), y); else tmp = t_0; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -6.2e-143], t$95$0, If[LessEqual[y, 2e-130], N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.35e+82], N[(N[(x * x), $MachinePrecision] * N[(-0.16666666666666666 * y), $MachinePrecision] + y), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{-143}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-130}:\\
\;\;\;\;x \cdot \frac{y}{x}\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+82}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot x, -0.16666666666666666 \cdot y, y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -6.20000000000000015e-143 or 1.35e82 < y Initial program 98.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6469.3
Applied rewrites69.3%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6456.8
Applied rewrites56.8%
if -6.20000000000000015e-143 < y < 2.0000000000000002e-130Initial program 67.7%
Taylor expanded in x around 0
Applied rewrites21.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6421.0
Applied rewrites21.0%
Taylor expanded in y around 0
Applied rewrites21.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6483.4
Applied rewrites83.4%
if 2.0000000000000002e-130 < y < 1.35e82Initial program 94.2%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f6462.4
Applied rewrites62.4%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6435.5
Applied rewrites35.5%
lift-*.f64N/A
lift-*.f64N/A
pow2N/A
lower-fma.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f64N/A
lower-*.f6435.5
Applied rewrites35.5%
(FPCore (x y) :precision binary64 (let* ((t_0 (* (fma (* y y) 0.16666666666666666 1.0) y))) (if (<= y -6.2e-143) t_0 (if (<= y 8.5e+86) (* x (/ y x)) t_0))))
double code(double x, double y) {
double t_0 = fma((y * y), 0.16666666666666666, 1.0) * y;
double tmp;
if (y <= -6.2e-143) {
tmp = t_0;
} else if (y <= 8.5e+86) {
tmp = x * (y / x);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) t_0 = Float64(fma(Float64(y * y), 0.16666666666666666, 1.0) * y) tmp = 0.0 if (y <= -6.2e-143) tmp = t_0; elseif (y <= 8.5e+86) tmp = Float64(x * Float64(y / x)); else tmp = t_0; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -6.2e-143], t$95$0, If[LessEqual[y, 8.5e+86], N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{-143}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+86}:\\
\;\;\;\;x \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -6.20000000000000015e-143 or 8.5000000000000005e86 < y Initial program 98.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6469.4
Applied rewrites69.4%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6457.1
Applied rewrites57.1%
if -6.20000000000000015e-143 < y < 8.5000000000000005e86Initial program 77.7%
Taylor expanded in x around 0
Applied rewrites33.7%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6424.8
Applied rewrites24.8%
Taylor expanded in y around 0
Applied rewrites23.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6466.9
Applied rewrites66.9%
(FPCore (x y) :precision binary64 (* x (/ y x)))
double code(double x, double y) {
return x * (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 = x * (y / x)
end function
public static double code(double x, double y) {
return x * (y / x);
}
def code(x, y): return x * (y / x)
function code(x, y) return Float64(x * Float64(y / x)) end
function tmp = code(x, y) tmp = x * (y / x); end
code[x_, y_] := N[(x * N[(y / x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y}{x}
\end{array}
Initial program 88.7%
Taylor expanded in x around 0
Applied rewrites52.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6442.5
Applied rewrites42.5%
Taylor expanded in y around 0
Applied rewrites22.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6450.1
Applied rewrites50.1%
(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 88.7%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f6452.3
Applied rewrites52.3%
Taylor expanded in x around 0
Applied rewrites28.0%
herbie shell --seed 2025114
(FPCore (x y)
:name "Linear.Quaternion:$ccosh from linear-1.19.1.3"
:precision binary64
(/ (* (sin x) (sinh y)) x))