
(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 (* (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}
Initial program 88.7%
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-sinh.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lower-/.f64N/A
lift-sinh.f6499.8
Applied rewrites99.8%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sin x) (sinh y)) x)))
(if (<= t_0 (- INFINITY))
(* (* 2.0 (sinh y)) (* (* x x) -0.08333333333333333))
(if (<= t_0 2e-104)
(* (/ (* (sin x) (fma (* y y) 0.16666666666666666 1.0)) x) y)
(* x (/ (sinh y) x))))))
double code(double x, double y) {
double t_0 = (sin(x) * sinh(y)) / x;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (2.0 * sinh(y)) * ((x * x) * -0.08333333333333333);
} else if (t_0 <= 2e-104) {
tmp = ((sin(x) * fma((y * y), 0.16666666666666666, 1.0)) / x) * y;
} else {
tmp = x * (sinh(y) / x);
}
return tmp;
}
function code(x, y) t_0 = Float64(Float64(sin(x) * sinh(y)) / x) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(2.0 * sinh(y)) * Float64(Float64(x * x) * -0.08333333333333333)); elseif (t_0 <= 2e-104) tmp = Float64(Float64(Float64(sin(x) * fma(Float64(y * y), 0.16666666666666666, 1.0)) / x) * y); else tmp = Float64(x * Float64(sinh(y) / x)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e-104], N[(N[(N[(N[Sin[x], $MachinePrecision] * N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], N[(x * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\left(2 \cdot \sinh y\right) \cdot \left(\left(x \cdot x\right) \cdot -0.08333333333333333\right)\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-104}:\\
\;\;\;\;\frac{\sin x \cdot \mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right)}{x} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\sinh y}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -inf.0Initial 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
lower-fma.f64N/A
unpow2N/A
lower-*.f6475.0
Applied rewrites75.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6424.7
Applied rewrites24.7%
if -inf.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 1.99999999999999985e-104Initial program 76.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.0%
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-*.f6499.0
Applied rewrites99.0%
if 1.99999999999999985e-104 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 99.7%
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-sinh.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lower-/.f64N/A
lift-sinh.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites75.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sin x) (sinh y)) x)))
(if (<= t_0 (- INFINITY))
(* (* 2.0 (sinh y)) (* (* x x) -0.08333333333333333))
(if (<= t_0 2e-104) (* (/ (sin x) x) y) (* x (/ (sinh y) x))))))
double code(double x, double y) {
double t_0 = (sin(x) * sinh(y)) / x;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = (2.0 * sinh(y)) * ((x * x) * -0.08333333333333333);
} else if (t_0 <= 2e-104) {
tmp = (sin(x) / x) * y;
} else {
tmp = x * (sinh(y) / x);
}
return tmp;
}
public static double code(double x, double y) {
double t_0 = (Math.sin(x) * Math.sinh(y)) / x;
double tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = (2.0 * Math.sinh(y)) * ((x * x) * -0.08333333333333333);
} else if (t_0 <= 2e-104) {
tmp = (Math.sin(x) / x) * y;
} else {
tmp = x * (Math.sinh(y) / x);
}
return tmp;
}
def code(x, y): t_0 = (math.sin(x) * math.sinh(y)) / x tmp = 0 if t_0 <= -math.inf: tmp = (2.0 * math.sinh(y)) * ((x * x) * -0.08333333333333333) elif t_0 <= 2e-104: tmp = (math.sin(x) / x) * y else: tmp = x * (math.sinh(y) / x) return tmp
function code(x, y) t_0 = Float64(Float64(sin(x) * sinh(y)) / x) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(Float64(2.0 * sinh(y)) * Float64(Float64(x * x) * -0.08333333333333333)); elseif (t_0 <= 2e-104) tmp = Float64(Float64(sin(x) / x) * y); else tmp = Float64(x * Float64(sinh(y) / x)); end return tmp end
function tmp_2 = code(x, y) t_0 = (sin(x) * sinh(y)) / x; tmp = 0.0; if (t_0 <= -Inf) tmp = (2.0 * sinh(y)) * ((x * x) * -0.08333333333333333); elseif (t_0 <= 2e-104) tmp = (sin(x) / x) * y; else tmp = x * (sinh(y) / x); 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[LessEqual[t$95$0, (-Infinity)], N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e-104], N[(N[(N[Sin[x], $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], N[(x * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;\left(2 \cdot \sinh y\right) \cdot \left(\left(x \cdot x\right) \cdot -0.08333333333333333\right)\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-104}:\\
\;\;\;\;\frac{\sin x}{x} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\sinh y}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -inf.0Initial 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
lower-fma.f64N/A
unpow2N/A
lower-*.f6475.0
Applied rewrites75.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6424.7
Applied rewrites24.7%
if -inf.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 1.99999999999999985e-104Initial program 76.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f6498.6
Applied rewrites98.6%
if 1.99999999999999985e-104 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 99.7%
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-sinh.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lower-/.f64N/A
lift-sinh.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites75.7%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sin x) (sinh y)) x) -4e-211) (* (* 2.0 (sinh y)) (fma -0.08333333333333333 (* x x) 0.5)) (* x (/ (sinh y) x))))
double code(double x, double y) {
double tmp;
if (((sin(x) * sinh(y)) / x) <= -4e-211) {
tmp = (2.0 * sinh(y)) * fma(-0.08333333333333333, (x * x), 0.5);
} else {
tmp = x * (sinh(y) / x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sin(x) * sinh(y)) / x) <= -4e-211) tmp = Float64(Float64(2.0 * sinh(y)) * fma(-0.08333333333333333, Float64(x * x), 0.5)); else tmp = Float64(x * Float64(sinh(y) / x)); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], -4e-211], N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * N[(-0.08333333333333333 * N[(x * x), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sin x \cdot \sinh y}{x} \leq -4 \cdot 10^{-211}:\\
\;\;\;\;\left(2 \cdot \sinh y\right) \cdot \mathsf{fma}\left(-0.08333333333333333, x \cdot x, 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\sinh y}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -4.00000000000000034e-211Initial program 99.6%
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
lower-fma.f64N/A
unpow2N/A
lower-*.f6471.9
Applied rewrites71.9%
if -4.00000000000000034e-211 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 83.3%
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-sinh.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lower-/.f64N/A
lift-sinh.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites74.7%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sin x) (sinh y)) x) -4e-211) (* (* 2.0 (sinh y)) (* (* x x) -0.08333333333333333)) (* x (/ (sinh y) x))))
double code(double x, double y) {
double tmp;
if (((sin(x) * sinh(y)) / x) <= -4e-211) {
tmp = (2.0 * sinh(y)) * ((x * x) * -0.08333333333333333);
} else {
tmp = x * (sinh(y) / 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 (((sin(x) * sinh(y)) / x) <= (-4d-211)) then
tmp = (2.0d0 * sinh(y)) * ((x * x) * (-0.08333333333333333d0))
else
tmp = x * (sinh(y) / x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (((Math.sin(x) * Math.sinh(y)) / x) <= -4e-211) {
tmp = (2.0 * Math.sinh(y)) * ((x * x) * -0.08333333333333333);
} else {
tmp = x * (Math.sinh(y) / x);
}
return tmp;
}
def code(x, y): tmp = 0 if ((math.sin(x) * math.sinh(y)) / x) <= -4e-211: tmp = (2.0 * math.sinh(y)) * ((x * x) * -0.08333333333333333) else: tmp = x * (math.sinh(y) / x) return tmp
function code(x, y) tmp = 0.0 if (Float64(Float64(sin(x) * sinh(y)) / x) <= -4e-211) tmp = Float64(Float64(2.0 * sinh(y)) * Float64(Float64(x * x) * -0.08333333333333333)); else tmp = Float64(x * Float64(sinh(y) / x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (((sin(x) * sinh(y)) / x) <= -4e-211) tmp = (2.0 * sinh(y)) * ((x * x) * -0.08333333333333333); else tmp = x * (sinh(y) / x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], -4e-211], N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sin x \cdot \sinh y}{x} \leq -4 \cdot 10^{-211}:\\
\;\;\;\;\left(2 \cdot \sinh y\right) \cdot \left(\left(x \cdot x\right) \cdot -0.08333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\sinh y}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -4.00000000000000034e-211Initial program 99.6%
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
lower-fma.f64N/A
unpow2N/A
lower-*.f6471.9
Applied rewrites71.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6418.9
Applied rewrites18.9%
if -4.00000000000000034e-211 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 83.3%
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-sinh.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lower-/.f64N/A
lift-sinh.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites74.7%
(FPCore (x y)
:precision binary64
(if (<= (/ (* (sin x) (sinh y)) x) -4e-211)
(*
(* (fma 0.3333333333333333 (* y y) 2.0) y)
(fma -0.08333333333333333 (* x x) 0.5))
(* x (/ (sinh y) x))))
double code(double x, double y) {
double tmp;
if (((sin(x) * sinh(y)) / x) <= -4e-211) {
tmp = (fma(0.3333333333333333, (y * y), 2.0) * y) * fma(-0.08333333333333333, (x * x), 0.5);
} else {
tmp = x * (sinh(y) / x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sin(x) * sinh(y)) / x) <= -4e-211) tmp = Float64(Float64(fma(0.3333333333333333, Float64(y * y), 2.0) * y) * fma(-0.08333333333333333, Float64(x * x), 0.5)); else tmp = Float64(x * Float64(sinh(y) / x)); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], -4e-211], N[(N[(N[(0.3333333333333333 * N[(y * y), $MachinePrecision] + 2.0), $MachinePrecision] * y), $MachinePrecision] * N[(-0.08333333333333333 * N[(x * x), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sin x \cdot \sinh y}{x} \leq -4 \cdot 10^{-211}:\\
\;\;\;\;\left(\mathsf{fma}\left(0.3333333333333333, y \cdot y, 2\right) \cdot y\right) \cdot \mathsf{fma}\left(-0.08333333333333333, x \cdot x, 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\sinh y}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -4.00000000000000034e-211Initial program 99.6%
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
lower-fma.f64N/A
unpow2N/A
lower-*.f6471.9
Applied rewrites71.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6459.1
Applied rewrites59.1%
if -4.00000000000000034e-211 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 83.3%
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-sinh.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lower-/.f64N/A
lift-sinh.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites74.7%
(FPCore (x y)
:precision binary64
(if (<= (/ (* (sin x) (sinh y)) x) -4e-211)
(*
(* (fma 0.3333333333333333 (* y y) 2.0) y)
(* (* x x) -0.08333333333333333))
(* x (/ (sinh y) x))))
double code(double x, double y) {
double tmp;
if (((sin(x) * sinh(y)) / x) <= -4e-211) {
tmp = (fma(0.3333333333333333, (y * y), 2.0) * y) * ((x * x) * -0.08333333333333333);
} else {
tmp = x * (sinh(y) / x);
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sin(x) * sinh(y)) / x) <= -4e-211) tmp = Float64(Float64(fma(0.3333333333333333, Float64(y * y), 2.0) * y) * Float64(Float64(x * x) * -0.08333333333333333)); else tmp = Float64(x * Float64(sinh(y) / x)); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], -4e-211], N[(N[(N[(0.3333333333333333 * N[(y * y), $MachinePrecision] + 2.0), $MachinePrecision] * y), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sin x \cdot \sinh y}{x} \leq -4 \cdot 10^{-211}:\\
\;\;\;\;\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}:\\
\;\;\;\;x \cdot \frac{\sinh y}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -4.00000000000000034e-211Initial program 99.6%
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
lower-fma.f64N/A
unpow2N/A
lower-*.f6471.9
Applied rewrites71.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6459.1
Applied rewrites59.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6417.7
Applied rewrites17.7%
if -4.00000000000000034e-211 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 83.3%
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-sinh.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lower-/.f64N/A
lift-sinh.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites74.7%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sin x) (sinh y)) x) -5e-235) (* (* (* (* y y) 0.3333333333333333) y) (* (* x x) -0.08333333333333333)) (* x (/ (sinh y) x))))
double code(double x, double y) {
double tmp;
if (((sin(x) * sinh(y)) / x) <= -5e-235) {
tmp = (((y * y) * 0.3333333333333333) * y) * ((x * x) * -0.08333333333333333);
} else {
tmp = x * (sinh(y) / 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 (((sin(x) * sinh(y)) / x) <= (-5d-235)) then
tmp = (((y * y) * 0.3333333333333333d0) * y) * ((x * x) * (-0.08333333333333333d0))
else
tmp = x * (sinh(y) / x)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (((Math.sin(x) * Math.sinh(y)) / x) <= -5e-235) {
tmp = (((y * y) * 0.3333333333333333) * y) * ((x * x) * -0.08333333333333333);
} else {
tmp = x * (Math.sinh(y) / x);
}
return tmp;
}
def code(x, y): tmp = 0 if ((math.sin(x) * math.sinh(y)) / x) <= -5e-235: tmp = (((y * y) * 0.3333333333333333) * y) * ((x * x) * -0.08333333333333333) else: tmp = x * (math.sinh(y) / x) return tmp
function code(x, y) tmp = 0.0 if (Float64(Float64(sin(x) * sinh(y)) / x) <= -5e-235) tmp = Float64(Float64(Float64(Float64(y * y) * 0.3333333333333333) * y) * Float64(Float64(x * x) * -0.08333333333333333)); else tmp = Float64(x * Float64(sinh(y) / x)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (((sin(x) * sinh(y)) / x) <= -5e-235) tmp = (((y * y) * 0.3333333333333333) * y) * ((x * x) * -0.08333333333333333); else tmp = x * (sinh(y) / x); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], -5e-235], N[(N[(N[(N[(y * y), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] * y), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Sinh[y], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sin x \cdot \sinh y}{x} \leq -5 \cdot 10^{-235}:\\
\;\;\;\;\left(\left(\left(y \cdot y\right) \cdot 0.3333333333333333\right) \cdot y\right) \cdot \left(\left(x \cdot x\right) \cdot -0.08333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\sinh y}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -4.9999999999999998e-235Initial program 99.5%
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
lower-fma.f64N/A
unpow2N/A
lower-*.f6470.9
Applied rewrites70.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6458.3
Applied rewrites58.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6442.5
Applied rewrites42.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6417.5
Applied rewrites17.5%
if -4.9999999999999998e-235 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 83.2%
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-sinh.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lower-/.f64N/A
lift-sinh.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites75.2%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sin x) (sinh y)) x) 0.0) (* (* (fma -0.16666666666666666 (* x x) 1.0) x) (/ y x)) (* (* 2.0 (sinh y)) 0.5)))
double code(double x, double y) {
double tmp;
if (((sin(x) * sinh(y)) / x) <= 0.0) {
tmp = (fma(-0.16666666666666666, (x * x), 1.0) * x) * (y / x);
} else {
tmp = (2.0 * sinh(y)) * 0.5;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sin(x) * sinh(y)) / x) <= 0.0) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * x) * Float64(y / x)); else tmp = Float64(Float64(2.0 * sinh(y)) * 0.5); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.0], N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Sinh[y], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sin x \cdot \sinh y}{x} \leq 0:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot x\right) \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\left(2 \cdot \sinh y\right) \cdot 0.5\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 0.0Initial program 82.0%
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-sinh.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lower-/.f64N/A
lift-sinh.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6461.0
Applied rewrites61.0%
Taylor expanded in y around 0
Applied rewrites48.9%
if 0.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 99.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
rec-expN/A
sinh-undefN/A
lower-*.f64N/A
lift-sinh.f6466.2
Applied rewrites66.2%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sin x) (sinh y)) x) 0.0) (* (* (fma -0.16666666666666666 (* x x) 1.0) x) (/ y x)) (* (/ (* (fma (* y y) 0.16666666666666666 1.0) x) x) y)))
double code(double x, double y) {
double tmp;
if (((sin(x) * sinh(y)) / x) <= 0.0) {
tmp = (fma(-0.16666666666666666, (x * x), 1.0) * x) * (y / x);
} else {
tmp = ((fma((y * y), 0.16666666666666666, 1.0) * x) / x) * y;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sin(x) * sinh(y)) / x) <= 0.0) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * x) * Float64(y / x)); else tmp = Float64(Float64(Float64(fma(Float64(y * y), 0.16666666666666666, 1.0) * x) / x) * y); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.0], N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * x), $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] * x), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sin x \cdot \sinh y}{x} \leq 0:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot x\right) \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot x}{x} \cdot y\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 0.0Initial program 82.0%
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
lift-sinh.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-sin.f64N/A
lower-/.f64N/A
lift-sinh.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6461.0
Applied rewrites61.0%
Taylor expanded in y around 0
Applied rewrites48.9%
if 0.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 99.2%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites75.3%
Taylor expanded in x around 0
Applied rewrites52.5%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sin x) (sinh y)) x) -4e-211) (* (/ (* (fma -0.16666666666666666 (* x x) 1.0) x) x) y) (* (/ (* (fma (* y y) 0.16666666666666666 1.0) x) x) y)))
double code(double x, double y) {
double tmp;
if (((sin(x) * sinh(y)) / x) <= -4e-211) {
tmp = ((fma(-0.16666666666666666, (x * x), 1.0) * x) / x) * y;
} else {
tmp = ((fma((y * y), 0.16666666666666666, 1.0) * x) / x) * y;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sin(x) * sinh(y)) / x) <= -4e-211) tmp = Float64(Float64(Float64(fma(-0.16666666666666666, Float64(x * x), 1.0) * x) / x) * y); else tmp = Float64(Float64(Float64(fma(Float64(y * y), 0.16666666666666666, 1.0) * x) / x) * y); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], -4e-211], N[(N[(N[(N[(-0.16666666666666666 * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] * x), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] * x), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sin x \cdot \sinh y}{x} \leq -4 \cdot 10^{-211}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.16666666666666666, x \cdot x, 1\right) \cdot x}{x} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot x}{x} \cdot y\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -4.00000000000000034e-211Initial program 99.6%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f6429.1
Applied rewrites29.1%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6433.0
Applied rewrites33.0%
if -4.00000000000000034e-211 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 83.3%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites85.6%
Taylor expanded in x around 0
Applied rewrites50.4%
(FPCore (x y) :precision binary64 (if (<= x 8.2e+37) (* (fma (* y y) 0.16666666666666666 1.0) y) (* (* (* (* y y) 0.3333333333333333) y) 0.5)))
double code(double x, double y) {
double tmp;
if (x <= 8.2e+37) {
tmp = fma((y * y), 0.16666666666666666, 1.0) * y;
} else {
tmp = (((y * y) * 0.3333333333333333) * y) * 0.5;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (x <= 8.2e+37) tmp = Float64(fma(Float64(y * y), 0.16666666666666666, 1.0) * y); else tmp = Float64(Float64(Float64(Float64(y * y) * 0.3333333333333333) * y) * 0.5); end return tmp end
code[x_, y_] := If[LessEqual[x, 8.2e+37], N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] * y), $MachinePrecision], N[(N[(N[(N[(y * y), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] * y), $MachinePrecision] * 0.5), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 8.2 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(y \cdot y\right) \cdot 0.3333333333333333\right) \cdot y\right) \cdot 0.5\\
\end{array}
\end{array}
if x < 8.1999999999999996e37Initial program 85.7%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites81.9%
Taylor expanded in x around 0
*-commutativeN/A
pow2N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f6460.0
Applied rewrites60.0%
if 8.1999999999999996e37 < x Initial 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
lower-fma.f64N/A
unpow2N/A
lower-*.f6424.3
Applied rewrites24.3%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6423.2
Applied rewrites23.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6430.1
Applied rewrites30.1%
Taylor expanded in x around 0
Applied rewrites44.3%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sin x) (sinh y)) x) -4e-211) (fma (* x x) (* -0.16666666666666666 y) y) (* (fma (* y y) 0.16666666666666666 1.0) y)))
double code(double x, double y) {
double tmp;
if (((sin(x) * sinh(y)) / x) <= -4e-211) {
tmp = fma((x * x), (-0.16666666666666666 * y), y);
} else {
tmp = fma((y * y), 0.16666666666666666, 1.0) * y;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sin(x) * sinh(y)) / x) <= -4e-211) tmp = fma(Float64(x * x), Float64(-0.16666666666666666 * y), y); else tmp = Float64(fma(Float64(y * y), 0.16666666666666666, 1.0) * y); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], -4e-211], N[(N[(x * x), $MachinePrecision] * N[(-0.16666666666666666 * y), $MachinePrecision] + y), $MachinePrecision], N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sin x \cdot \sinh y}{x} \leq -4 \cdot 10^{-211}:\\
\;\;\;\;\mathsf{fma}\left(x \cdot x, -0.16666666666666666 \cdot y, y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y \cdot y, 0.16666666666666666, 1\right) \cdot y\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -4.00000000000000034e-211Initial program 99.6%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f6429.1
Applied rewrites29.1%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6432.6
Applied rewrites32.6%
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-*.f6432.6
Applied rewrites32.6%
if -4.00000000000000034e-211 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 83.3%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites85.6%
Taylor expanded in x around 0
*-commutativeN/A
pow2N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f6449.4
Applied rewrites49.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (sin x) (sinh y)) x)))
(if (<= t_0 -4e-211)
(* (* (* x x) y) -0.16666666666666666)
(if (<= t_0 1e-19) y (/ (* x y) x)))))
double code(double x, double y) {
double t_0 = (sin(x) * sinh(y)) / x;
double tmp;
if (t_0 <= -4e-211) {
tmp = ((x * x) * y) * -0.16666666666666666;
} else if (t_0 <= 1e-19) {
tmp = y;
} else {
tmp = (x * y) / 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 = (sin(x) * sinh(y)) / x
if (t_0 <= (-4d-211)) then
tmp = ((x * x) * y) * (-0.16666666666666666d0)
else if (t_0 <= 1d-19) then
tmp = y
else
tmp = (x * y) / x
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 <= -4e-211) {
tmp = ((x * x) * y) * -0.16666666666666666;
} else if (t_0 <= 1e-19) {
tmp = y;
} else {
tmp = (x * y) / x;
}
return tmp;
}
def code(x, y): t_0 = (math.sin(x) * math.sinh(y)) / x tmp = 0 if t_0 <= -4e-211: tmp = ((x * x) * y) * -0.16666666666666666 elif t_0 <= 1e-19: tmp = y else: tmp = (x * y) / x return tmp
function code(x, y) t_0 = Float64(Float64(sin(x) * sinh(y)) / x) tmp = 0.0 if (t_0 <= -4e-211) tmp = Float64(Float64(Float64(x * x) * y) * -0.16666666666666666); elseif (t_0 <= 1e-19) tmp = y; else tmp = Float64(Float64(x * y) / x); end return tmp end
function tmp_2 = code(x, y) t_0 = (sin(x) * sinh(y)) / x; tmp = 0.0; if (t_0 <= -4e-211) tmp = ((x * x) * y) * -0.16666666666666666; elseif (t_0 <= 1e-19) tmp = y; else tmp = (x * y) / x; 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[LessEqual[t$95$0, -4e-211], N[(N[(N[(x * x), $MachinePrecision] * y), $MachinePrecision] * -0.16666666666666666), $MachinePrecision], If[LessEqual[t$95$0, 1e-19], y, N[(N[(x * y), $MachinePrecision] / x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
\mathbf{if}\;t\_0 \leq -4 \cdot 10^{-211}:\\
\;\;\;\;\left(\left(x \cdot x\right) \cdot y\right) \cdot -0.16666666666666666\\
\mathbf{elif}\;t\_0 \leq 10^{-19}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < -4.00000000000000034e-211Initial program 99.6%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f6429.1
Applied rewrites29.1%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6432.6
Applied rewrites32.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lift-*.f6415.3
Applied rewrites15.3%
if -4.00000000000000034e-211 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 9.9999999999999998e-20Initial program 73.1%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f6499.4
Applied rewrites99.4%
Taylor expanded in x around 0
Applied rewrites47.9%
if 9.9999999999999998e-20 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f646.6
Applied rewrites6.6%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6424.0
Applied rewrites24.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f6424.9
lift-*.f64N/A
lift-fma.f64N/A
pow2N/A
*-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6424.9
Applied rewrites24.9%
Taylor expanded in x around 0
Applied rewrites17.0%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sin x) (sinh y)) x) 0.0) (fma (* x (* y x)) -0.16666666666666666 y) (/ (* x y) x)))
double code(double x, double y) {
double tmp;
if (((sin(x) * sinh(y)) / x) <= 0.0) {
tmp = fma((x * (y * x)), -0.16666666666666666, y);
} else {
tmp = (x * y) / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sin(x) * sinh(y)) / x) <= 0.0) tmp = fma(Float64(x * Float64(y * x)), -0.16666666666666666, y); else tmp = Float64(Float64(x * y) / x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.0], N[(N[(x * N[(y * x), $MachinePrecision]), $MachinePrecision] * -0.16666666666666666 + y), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sin x \cdot \sinh y}{x} \leq 0:\\
\;\;\;\;\mathsf{fma}\left(x \cdot \left(y \cdot x\right), -0.16666666666666666, y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 0.0Initial program 82.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f6461.5
Applied rewrites61.5%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6438.4
Applied rewrites38.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6438.4
Applied rewrites38.4%
if 0.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 99.2%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f6437.9
Applied rewrites37.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6432.3
Applied rewrites32.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f6432.3
lift-*.f64N/A
lift-fma.f64N/A
pow2N/A
*-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6432.3
Applied rewrites32.3%
Taylor expanded in x around 0
Applied rewrites27.3%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sin x) (sinh y)) x) 0.0) (fma (* x x) (* -0.16666666666666666 y) y) (/ (* x y) x)))
double code(double x, double y) {
double tmp;
if (((sin(x) * sinh(y)) / x) <= 0.0) {
tmp = fma((x * x), (-0.16666666666666666 * y), y);
} else {
tmp = (x * y) / x;
}
return tmp;
}
function code(x, y) tmp = 0.0 if (Float64(Float64(sin(x) * sinh(y)) / x) <= 0.0) tmp = fma(Float64(x * x), Float64(-0.16666666666666666 * y), y); else tmp = Float64(Float64(x * y) / x); end return tmp end
code[x_, y_] := If[LessEqual[N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 0.0], N[(N[(x * x), $MachinePrecision] * N[(-0.16666666666666666 * y), $MachinePrecision] + y), $MachinePrecision], N[(N[(x * y), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sin x \cdot \sinh y}{x} \leq 0:\\
\;\;\;\;\mathsf{fma}\left(x \cdot x, -0.16666666666666666 \cdot y, y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 0.0Initial program 82.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f6461.5
Applied rewrites61.5%
Taylor expanded in x around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6438.4
Applied rewrites38.4%
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-*.f6438.4
Applied rewrites38.4%
if 0.0 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 99.2%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f6437.9
Applied rewrites37.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6432.3
Applied rewrites32.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f6432.3
lift-*.f64N/A
lift-fma.f64N/A
pow2N/A
*-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6432.3
Applied rewrites32.3%
Taylor expanded in x around 0
Applied rewrites27.3%
(FPCore (x y) :precision binary64 (if (<= (/ (* (sin x) (sinh y)) x) 1e-19) y (/ (* x y) x)))
double code(double x, double y) {
double tmp;
if (((sin(x) * sinh(y)) / x) <= 1e-19) {
tmp = y;
} else {
tmp = (x * y) / 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 (((sin(x) * sinh(y)) / x) <= 1d-19) then
tmp = y
else
tmp = (x * y) / x
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (((Math.sin(x) * Math.sinh(y)) / x) <= 1e-19) {
tmp = y;
} else {
tmp = (x * y) / x;
}
return tmp;
}
def code(x, y): tmp = 0 if ((math.sin(x) * math.sinh(y)) / x) <= 1e-19: tmp = y else: tmp = (x * y) / x return tmp
function code(x, y) tmp = 0.0 if (Float64(Float64(sin(x) * sinh(y)) / x) <= 1e-19) tmp = y; else tmp = Float64(Float64(x * y) / x); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (((sin(x) * sinh(y)) / x) <= 1e-19) tmp = y; else tmp = (x * y) / x; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision], 1e-19], y, N[(N[(x * y), $MachinePrecision] / x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\sin x \cdot \sinh y}{x} \leq 10^{-19}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot y}{x}\\
\end{array}
\end{array}
if (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) < 9.9999999999999998e-20Initial program 84.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f6468.1
Applied rewrites68.1%
Taylor expanded in x around 0
Applied rewrites35.4%
if 9.9999999999999998e-20 < (/.f64 (*.f64 (sin.f64 x) (sinh.f64 y)) x) Initial program 99.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-*l/N/A
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f646.6
Applied rewrites6.6%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6424.0
Applied rewrites24.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f6424.9
lift-*.f64N/A
lift-fma.f64N/A
pow2N/A
*-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6424.9
Applied rewrites24.9%
Taylor expanded in x around 0
Applied rewrites17.0%
(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 rewrites27.9%
herbie shell --seed 2025110
(FPCore (x y)
:name "Linear.Quaternion:$ccosh from linear-1.19.1.3"
:precision binary64
(/ (* (sin x) (sinh y)) x))