
(FPCore (x y) :precision binary64 (+ (- (* x (- y 1)) (* y 1/2)) 918938533204673/1000000000000000))
double code(double x, double y) {
return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673;
}
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 - 1.0d0)) - (y * 0.5d0)) + 0.918938533204673d0
end function
public static double code(double x, double y) {
return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673;
}
def code(x, y): return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673
function code(x, y) return Float64(Float64(Float64(x * Float64(y - 1.0)) - Float64(y * 0.5)) + 0.918938533204673) end
function tmp = code(x, y) tmp = ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673; end
code[x_, y_] := N[(N[(N[(x * N[(y - 1), $MachinePrecision]), $MachinePrecision] - N[(y * 1/2), $MachinePrecision]), $MachinePrecision] + 918938533204673/1000000000000000), $MachinePrecision]
\left(x \cdot \left(y - 1\right) - y \cdot \frac{1}{2}\right) + \frac{918938533204673}{1000000000000000}
Herbie found 9 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (+ (- (* x (- y 1)) (* y 1/2)) 918938533204673/1000000000000000))
double code(double x, double y) {
return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673;
}
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 - 1.0d0)) - (y * 0.5d0)) + 0.918938533204673d0
end function
public static double code(double x, double y) {
return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673;
}
def code(x, y): return ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673
function code(x, y) return Float64(Float64(Float64(x * Float64(y - 1.0)) - Float64(y * 0.5)) + 0.918938533204673) end
function tmp = code(x, y) tmp = ((x * (y - 1.0)) - (y * 0.5)) + 0.918938533204673; end
code[x_, y_] := N[(N[(N[(x * N[(y - 1), $MachinePrecision]), $MachinePrecision] - N[(y * 1/2), $MachinePrecision]), $MachinePrecision] + 918938533204673/1000000000000000), $MachinePrecision]
\left(x \cdot \left(y - 1\right) - y \cdot \frac{1}{2}\right) + \frac{918938533204673}{1000000000000000}
(FPCore (x y) :precision binary64 (- (- (* y (+ -1/2 x)) x) -918938533204673/1000000000000000))
double code(double x, double y) {
return ((y * (-0.5 + x)) - x) - -0.918938533204673;
}
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 * ((-0.5d0) + x)) - x) - (-0.918938533204673d0)
end function
public static double code(double x, double y) {
return ((y * (-0.5 + x)) - x) - -0.918938533204673;
}
def code(x, y): return ((y * (-0.5 + x)) - x) - -0.918938533204673
function code(x, y) return Float64(Float64(Float64(y * Float64(-0.5 + x)) - x) - -0.918938533204673) end
function tmp = code(x, y) tmp = ((y * (-0.5 + x)) - x) - -0.918938533204673; end
code[x_, y_] := N[(N[(N[(y * N[(-1/2 + x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] - -918938533204673/1000000000000000), $MachinePrecision]
\left(y \cdot \left(\frac{-1}{2} + x\right) - x\right) - \frac{-918938533204673}{1000000000000000}
Initial program 100.0%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
Applied rewrites100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (- y 1))))
(if (<= x -31500000000)
t_0
(if (<= x 860000000)
(+ (* y (- x 1/2)) 918938533204673/1000000000000000)
t_0))))double code(double x, double y) {
double t_0 = x * (y - 1.0);
double tmp;
if (x <= -31500000000.0) {
tmp = t_0;
} else if (x <= 860000000.0) {
tmp = (y * (x - 0.5)) + 0.918938533204673;
} else {
tmp = t_0;
}
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 = x * (y - 1.0d0)
if (x <= (-31500000000.0d0)) then
tmp = t_0
else if (x <= 860000000.0d0) then
tmp = (y * (x - 0.5d0)) + 0.918938533204673d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x * (y - 1.0);
double tmp;
if (x <= -31500000000.0) {
tmp = t_0;
} else if (x <= 860000000.0) {
tmp = (y * (x - 0.5)) + 0.918938533204673;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x * (y - 1.0) tmp = 0 if x <= -31500000000.0: tmp = t_0 elif x <= 860000000.0: tmp = (y * (x - 0.5)) + 0.918938533204673 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x * Float64(y - 1.0)) tmp = 0.0 if (x <= -31500000000.0) tmp = t_0; elseif (x <= 860000000.0) tmp = Float64(Float64(y * Float64(x - 0.5)) + 0.918938533204673); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x * (y - 1.0); tmp = 0.0; if (x <= -31500000000.0) tmp = t_0; elseif (x <= 860000000.0) tmp = (y * (x - 0.5)) + 0.918938533204673; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(y - 1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -31500000000], t$95$0, If[LessEqual[x, 860000000], N[(N[(y * N[(x - 1/2), $MachinePrecision]), $MachinePrecision] + 918938533204673/1000000000000000), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x \cdot \left(y - 1\right)\\
\mathbf{if}\;x \leq -31500000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 860000000:\\
\;\;\;\;y \cdot \left(x - \frac{1}{2}\right) + \frac{918938533204673}{1000000000000000}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -3.15e10 or 8.6e8 < x Initial program 100.0%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f6450.1%
Applied rewrites50.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f6450.1%
Applied rewrites50.1%
if -3.15e10 < x < 8.6e8Initial program 100.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6475.4%
Applied rewrites75.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (- y 1))))
(if (<= x -31500000000)
t_0
(if (<= x 380)
(+ (* -1/2 y) 918938533204673/1000000000000000)
t_0))))double code(double x, double y) {
double t_0 = x * (y - 1.0);
double tmp;
if (x <= -31500000000.0) {
tmp = t_0;
} else if (x <= 380.0) {
tmp = (-0.5 * y) + 0.918938533204673;
} else {
tmp = t_0;
}
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 = x * (y - 1.0d0)
if (x <= (-31500000000.0d0)) then
tmp = t_0
else if (x <= 380.0d0) then
tmp = ((-0.5d0) * y) + 0.918938533204673d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x * (y - 1.0);
double tmp;
if (x <= -31500000000.0) {
tmp = t_0;
} else if (x <= 380.0) {
tmp = (-0.5 * y) + 0.918938533204673;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x * (y - 1.0) tmp = 0 if x <= -31500000000.0: tmp = t_0 elif x <= 380.0: tmp = (-0.5 * y) + 0.918938533204673 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x * Float64(y - 1.0)) tmp = 0.0 if (x <= -31500000000.0) tmp = t_0; elseif (x <= 380.0) tmp = Float64(Float64(-0.5 * y) + 0.918938533204673); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x * (y - 1.0); tmp = 0.0; if (x <= -31500000000.0) tmp = t_0; elseif (x <= 380.0) tmp = (-0.5 * y) + 0.918938533204673; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(y - 1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -31500000000], t$95$0, If[LessEqual[x, 380], N[(N[(-1/2 * y), $MachinePrecision] + 918938533204673/1000000000000000), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x \cdot \left(y - 1\right)\\
\mathbf{if}\;x \leq -31500000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 380:\\
\;\;\;\;\frac{-1}{2} \cdot y + \frac{918938533204673}{1000000000000000}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -3.15e10 or 380 < x Initial program 100.0%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f6450.1%
Applied rewrites50.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f6450.1%
Applied rewrites50.1%
if -3.15e10 < x < 380Initial program 100.0%
Taylor expanded in x around 0
lower-*.f6451.1%
Applied rewrites51.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* y (- x 1/2))))
(if (<= y -25000)
t_0
(if (<= y 11/2) (- 918938533204673/1000000000000000 x) t_0))))double code(double x, double y) {
double t_0 = y * (x - 0.5);
double tmp;
if (y <= -25000.0) {
tmp = t_0;
} else if (y <= 5.5) {
tmp = 0.918938533204673 - x;
} else {
tmp = t_0;
}
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 = y * (x - 0.5d0)
if (y <= (-25000.0d0)) then
tmp = t_0
else if (y <= 5.5d0) then
tmp = 0.918938533204673d0 - x
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = y * (x - 0.5);
double tmp;
if (y <= -25000.0) {
tmp = t_0;
} else if (y <= 5.5) {
tmp = 0.918938533204673 - x;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = y * (x - 0.5) tmp = 0 if y <= -25000.0: tmp = t_0 elif y <= 5.5: tmp = 0.918938533204673 - x else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(y * Float64(x - 0.5)) tmp = 0.0 if (y <= -25000.0) tmp = t_0; elseif (y <= 5.5) tmp = Float64(0.918938533204673 - x); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = y * (x - 0.5); tmp = 0.0; if (y <= -25000.0) tmp = t_0; elseif (y <= 5.5) tmp = 0.918938533204673 - x; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(y * N[(x - 1/2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -25000], t$95$0, If[LessEqual[y, 11/2], N[(918938533204673/1000000000000000 - x), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := y \cdot \left(x - \frac{1}{2}\right)\\
\mathbf{if}\;y \leq -25000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq \frac{11}{2}:\\
\;\;\;\;\frac{918938533204673}{1000000000000000} - x\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if y < -25000 or 5.5 < y Initial program 100.0%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f6450.1%
Applied rewrites50.1%
Taylor expanded in x around 0
Applied rewrites26.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6451.3%
Applied rewrites51.3%
if -25000 < y < 5.5Initial program 100.0%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in y around 0
lower--.f6450.1%
Applied rewrites50.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* x (- y 1)))
(t_1 (+ (- t_0 (* y 1/2)) 918938533204673/1000000000000000)))
(if (<=
t_1
-19999999999999999022865849278470264106778320922372433398933167781147023447499918366556775778344680456191750897534276513413896506501104986185271471852552907987540733076746850001554473076458172448768)
t_0
(if (<= t_1 -10000000000)
(* y -1/2)
(if (<=
t_1
500000000000000039145770202298121921152680149943058432)
(- 918938533204673/1000000000000000 x)
(if (<=
t_1
2999999999999999980486599061817381213271671188243728977063313482190191329280)
(* y -1/2)
t_0))))))double code(double x, double y) {
double t_0 = x * (y - 1.0);
double t_1 = (t_0 - (y * 0.5)) + 0.918938533204673;
double tmp;
if (t_1 <= -2e+196) {
tmp = t_0;
} else if (t_1 <= -10000000000.0) {
tmp = y * -0.5;
} else if (t_1 <= 5e+53) {
tmp = 0.918938533204673 - x;
} else if (t_1 <= 3e+75) {
tmp = y * -0.5;
} else {
tmp = t_0;
}
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) :: t_1
real(8) :: tmp
t_0 = x * (y - 1.0d0)
t_1 = (t_0 - (y * 0.5d0)) + 0.918938533204673d0
if (t_1 <= (-2d+196)) then
tmp = t_0
else if (t_1 <= (-10000000000.0d0)) then
tmp = y * (-0.5d0)
else if (t_1 <= 5d+53) then
tmp = 0.918938533204673d0 - x
else if (t_1 <= 3d+75) then
tmp = y * (-0.5d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x * (y - 1.0);
double t_1 = (t_0 - (y * 0.5)) + 0.918938533204673;
double tmp;
if (t_1 <= -2e+196) {
tmp = t_0;
} else if (t_1 <= -10000000000.0) {
tmp = y * -0.5;
} else if (t_1 <= 5e+53) {
tmp = 0.918938533204673 - x;
} else if (t_1 <= 3e+75) {
tmp = y * -0.5;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x * (y - 1.0) t_1 = (t_0 - (y * 0.5)) + 0.918938533204673 tmp = 0 if t_1 <= -2e+196: tmp = t_0 elif t_1 <= -10000000000.0: tmp = y * -0.5 elif t_1 <= 5e+53: tmp = 0.918938533204673 - x elif t_1 <= 3e+75: tmp = y * -0.5 else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x * Float64(y - 1.0)) t_1 = Float64(Float64(t_0 - Float64(y * 0.5)) + 0.918938533204673) tmp = 0.0 if (t_1 <= -2e+196) tmp = t_0; elseif (t_1 <= -10000000000.0) tmp = Float64(y * -0.5); elseif (t_1 <= 5e+53) tmp = Float64(0.918938533204673 - x); elseif (t_1 <= 3e+75) tmp = Float64(y * -0.5); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x * (y - 1.0); t_1 = (t_0 - (y * 0.5)) + 0.918938533204673; tmp = 0.0; if (t_1 <= -2e+196) tmp = t_0; elseif (t_1 <= -10000000000.0) tmp = y * -0.5; elseif (t_1 <= 5e+53) tmp = 0.918938533204673 - x; elseif (t_1 <= 3e+75) tmp = y * -0.5; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x * N[(y - 1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 - N[(y * 1/2), $MachinePrecision]), $MachinePrecision] + 918938533204673/1000000000000000), $MachinePrecision]}, If[LessEqual[t$95$1, -19999999999999999022865849278470264106778320922372433398933167781147023447499918366556775778344680456191750897534276513413896506501104986185271471852552907987540733076746850001554473076458172448768], t$95$0, If[LessEqual[t$95$1, -10000000000], N[(y * -1/2), $MachinePrecision], If[LessEqual[t$95$1, 500000000000000039145770202298121921152680149943058432], N[(918938533204673/1000000000000000 - x), $MachinePrecision], If[LessEqual[t$95$1, 2999999999999999980486599061817381213271671188243728977063313482190191329280], N[(y * -1/2), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
t_0 := x \cdot \left(y - 1\right)\\
t_1 := \left(t\_0 - y \cdot \frac{1}{2}\right) + \frac{918938533204673}{1000000000000000}\\
\mathbf{if}\;t\_1 \leq -19999999999999999022865849278470264106778320922372433398933167781147023447499918366556775778344680456191750897534276513413896506501104986185271471852552907987540733076746850001554473076458172448768:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq -10000000000:\\
\;\;\;\;y \cdot \frac{-1}{2}\\
\mathbf{elif}\;t\_1 \leq 500000000000000039145770202298121921152680149943058432:\\
\;\;\;\;\frac{918938533204673}{1000000000000000} - x\\
\mathbf{elif}\;t\_1 \leq 2999999999999999980486599061817381213271671188243728977063313482190191329280:\\
\;\;\;\;y \cdot \frac{-1}{2}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 y #s(literal 1 binary64))) (*.f64 y #s(literal 1/2 binary64))) #s(literal 918938533204673/1000000000000000 binary64)) < -1.9999999999999999e196 or 3e75 < (+.f64 (-.f64 (*.f64 x (-.f64 y #s(literal 1 binary64))) (*.f64 y #s(literal 1/2 binary64))) #s(literal 918938533204673/1000000000000000 binary64)) Initial program 100.0%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f6450.1%
Applied rewrites50.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f6450.1%
Applied rewrites50.1%
if -1.9999999999999999e196 < (+.f64 (-.f64 (*.f64 x (-.f64 y #s(literal 1 binary64))) (*.f64 y #s(literal 1/2 binary64))) #s(literal 918938533204673/1000000000000000 binary64)) < -1e10 or 5.0000000000000004e53 < (+.f64 (-.f64 (*.f64 x (-.f64 y #s(literal 1 binary64))) (*.f64 y #s(literal 1/2 binary64))) #s(literal 918938533204673/1000000000000000 binary64)) < 3e75Initial program 100.0%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f6450.1%
Applied rewrites50.1%
Taylor expanded in x around 0
Applied rewrites26.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6451.3%
Applied rewrites51.3%
Taylor expanded in x around 0
Applied rewrites26.9%
if -1e10 < (+.f64 (-.f64 (*.f64 x (-.f64 y #s(literal 1 binary64))) (*.f64 y #s(literal 1/2 binary64))) #s(literal 918938533204673/1000000000000000 binary64)) < 5.0000000000000004e53Initial program 100.0%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in y around 0
lower--.f6450.1%
Applied rewrites50.1%
(FPCore (x y)
:precision binary64
(if (<=
y
-60000000000000002807012422227762526562645946359988349865723547266293968589294224216830388071681671922486927166140031906922005288910511928360257579557507738543076049824450300405816469334962855765094694912)
(* y -1/2)
(if (<=
y
-4499999999999999974429565382633177664789268512599431293281255448379551384886050990420847233375141888)
(* x y)
(if (<= y -25000)
(* y -1/2)
(if (<= y 11/2)
(- 918938533204673/1000000000000000 x)
(* y -1/2))))))double code(double x, double y) {
double tmp;
if (y <= -6e+202) {
tmp = y * -0.5;
} else if (y <= -4.5e+99) {
tmp = x * y;
} else if (y <= -25000.0) {
tmp = y * -0.5;
} else if (y <= 5.5) {
tmp = 0.918938533204673 - x;
} else {
tmp = y * -0.5;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-6d+202)) then
tmp = y * (-0.5d0)
else if (y <= (-4.5d+99)) then
tmp = x * y
else if (y <= (-25000.0d0)) then
tmp = y * (-0.5d0)
else if (y <= 5.5d0) then
tmp = 0.918938533204673d0 - x
else
tmp = y * (-0.5d0)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -6e+202) {
tmp = y * -0.5;
} else if (y <= -4.5e+99) {
tmp = x * y;
} else if (y <= -25000.0) {
tmp = y * -0.5;
} else if (y <= 5.5) {
tmp = 0.918938533204673 - x;
} else {
tmp = y * -0.5;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -6e+202: tmp = y * -0.5 elif y <= -4.5e+99: tmp = x * y elif y <= -25000.0: tmp = y * -0.5 elif y <= 5.5: tmp = 0.918938533204673 - x else: tmp = y * -0.5 return tmp
function code(x, y) tmp = 0.0 if (y <= -6e+202) tmp = Float64(y * -0.5); elseif (y <= -4.5e+99) tmp = Float64(x * y); elseif (y <= -25000.0) tmp = Float64(y * -0.5); elseif (y <= 5.5) tmp = Float64(0.918938533204673 - x); else tmp = Float64(y * -0.5); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -6e+202) tmp = y * -0.5; elseif (y <= -4.5e+99) tmp = x * y; elseif (y <= -25000.0) tmp = y * -0.5; elseif (y <= 5.5) tmp = 0.918938533204673 - x; else tmp = y * -0.5; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -60000000000000002807012422227762526562645946359988349865723547266293968589294224216830388071681671922486927166140031906922005288910511928360257579557507738543076049824450300405816469334962855765094694912], N[(y * -1/2), $MachinePrecision], If[LessEqual[y, -4499999999999999974429565382633177664789268512599431293281255448379551384886050990420847233375141888], N[(x * y), $MachinePrecision], If[LessEqual[y, -25000], N[(y * -1/2), $MachinePrecision], If[LessEqual[y, 11/2], N[(918938533204673/1000000000000000 - x), $MachinePrecision], N[(y * -1/2), $MachinePrecision]]]]]
\begin{array}{l}
\mathbf{if}\;y \leq -60000000000000002807012422227762526562645946359988349865723547266293968589294224216830388071681671922486927166140031906922005288910511928360257579557507738543076049824450300405816469334962855765094694912:\\
\;\;\;\;y \cdot \frac{-1}{2}\\
\mathbf{elif}\;y \leq -4499999999999999974429565382633177664789268512599431293281255448379551384886050990420847233375141888:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq -25000:\\
\;\;\;\;y \cdot \frac{-1}{2}\\
\mathbf{elif}\;y \leq \frac{11}{2}:\\
\;\;\;\;\frac{918938533204673}{1000000000000000} - x\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{-1}{2}\\
\end{array}
if y < -6.0000000000000003e202 or -4.5e99 < y < -25000 or 5.5 < y Initial program 100.0%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f6450.1%
Applied rewrites50.1%
Taylor expanded in x around 0
Applied rewrites26.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6451.3%
Applied rewrites51.3%
Taylor expanded in x around 0
Applied rewrites26.9%
if -6.0000000000000003e202 < y < -4.5e99Initial program 100.0%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f6450.1%
Applied rewrites50.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f6450.1%
Applied rewrites50.1%
Taylor expanded in y around inf
lower-*.f6426.5%
Applied rewrites26.5%
if -25000 < y < 5.5Initial program 100.0%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in y around 0
lower--.f6450.1%
Applied rewrites50.1%
(FPCore (x y) :precision binary64 (if (<= y -1350000000000000) (* x y) (if (<= y 11/2) (- 918938533204673/1000000000000000 x) (* x y))))
double code(double x, double y) {
double tmp;
if (y <= -1.35e+15) {
tmp = x * y;
} else if (y <= 5.5) {
tmp = 0.918938533204673 - x;
} else {
tmp = x * y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (y <= (-1.35d+15)) then
tmp = x * y
else if (y <= 5.5d0) then
tmp = 0.918938533204673d0 - x
else
tmp = x * y
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -1.35e+15) {
tmp = x * y;
} else if (y <= 5.5) {
tmp = 0.918938533204673 - x;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -1.35e+15: tmp = x * y elif y <= 5.5: tmp = 0.918938533204673 - x else: tmp = x * y return tmp
function code(x, y) tmp = 0.0 if (y <= -1.35e+15) tmp = Float64(x * y); elseif (y <= 5.5) tmp = Float64(0.918938533204673 - x); else tmp = Float64(x * y); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -1.35e+15) tmp = x * y; elseif (y <= 5.5) tmp = 0.918938533204673 - x; else tmp = x * y; end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -1350000000000000], N[(x * y), $MachinePrecision], If[LessEqual[y, 11/2], N[(918938533204673/1000000000000000 - x), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;y \leq -1350000000000000:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;y \leq \frac{11}{2}:\\
\;\;\;\;\frac{918938533204673}{1000000000000000} - x\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
if y < -1.35e15 or 5.5 < y Initial program 100.0%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f6450.1%
Applied rewrites50.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f6450.1%
Applied rewrites50.1%
Taylor expanded in y around inf
lower-*.f6426.5%
Applied rewrites26.5%
if -1.35e15 < y < 5.5Initial program 100.0%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in y around 0
lower--.f6450.1%
Applied rewrites50.1%
(FPCore (x y) :precision binary64 (- 918938533204673/1000000000000000 x))
double code(double x, double y) {
return 0.918938533204673 - 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 = 0.918938533204673d0 - x
end function
public static double code(double x, double y) {
return 0.918938533204673 - x;
}
def code(x, y): return 0.918938533204673 - x
function code(x, y) return Float64(0.918938533204673 - x) end
function tmp = code(x, y) tmp = 0.918938533204673 - x; end
code[x_, y_] := N[(918938533204673/1000000000000000 - x), $MachinePrecision]
\frac{918938533204673}{1000000000000000} - x
Initial program 100.0%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in y around 0
lower--.f6450.1%
Applied rewrites50.1%
(FPCore (x y) :precision binary64 918938533204673/1000000000000000)
double code(double x, double y) {
return 0.918938533204673;
}
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 = 0.918938533204673d0
end function
public static double code(double x, double y) {
return 0.918938533204673;
}
def code(x, y): return 0.918938533204673
function code(x, y) return 0.918938533204673 end
function tmp = code(x, y) tmp = 0.918938533204673; end
code[x_, y_] := 918938533204673/1000000000000000
\frac{918938533204673}{1000000000000000}
Initial program 100.0%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f6450.1%
Applied rewrites50.1%
Taylor expanded in x around 0
Applied rewrites26.2%
herbie shell --seed 2025271 -o generate:evaluate
(FPCore (x y)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2, A"
:precision binary64
(+ (- (* x (- y 1)) (* y 1/2)) 918938533204673/1000000000000000))