
(FPCore (x y) :precision binary64 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))
double code(double x, double y) {
return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
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 = 1.0d0 - (((1.0d0 - x) * y) / (y + 1.0d0))
end function
public static double code(double x, double y) {
return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
def code(x, y): return 1.0 - (((1.0 - x) * y) / (y + 1.0))
function code(x, y) return Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0))) end
function tmp = code(x, y) tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0)); end
code[x_, y_] := N[(1.0 - N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{\left(1 - x\right) \cdot y}{y + 1}
\end{array}
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))
double code(double x, double y) {
return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
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 = 1.0d0 - (((1.0d0 - x) * y) / (y + 1.0d0))
end function
public static double code(double x, double y) {
return 1.0 - (((1.0 - x) * y) / (y + 1.0));
}
def code(x, y): return 1.0 - (((1.0 - x) * y) / (y + 1.0))
function code(x, y) return Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0))) end
function tmp = code(x, y) tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0)); end
code[x_, y_] := N[(1.0 - N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 - \frac{\left(1 - x\right) \cdot y}{y + 1}
\end{array}
(FPCore (x y)
:precision binary64
(let* ((t_0 (* 2.0 (+ y 1.0))))
(if (<= y -1000000000.0)
(- x (/ (- x 1.0) y))
(if (<= y 1.25e+15)
(/ (- t_0 (* 2.0 (* (- 1.0 x) y))) t_0)
(- x (/ -1.0 y))))))
double code(double x, double y) {
double t_0 = 2.0 * (y + 1.0);
double tmp;
if (y <= -1000000000.0) {
tmp = x - ((x - 1.0) / y);
} else if (y <= 1.25e+15) {
tmp = (t_0 - (2.0 * ((1.0 - x) * y))) / t_0;
} else {
tmp = x - (-1.0 / y);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: tmp
t_0 = 2.0d0 * (y + 1.0d0)
if (y <= (-1000000000.0d0)) then
tmp = x - ((x - 1.0d0) / y)
else if (y <= 1.25d+15) then
tmp = (t_0 - (2.0d0 * ((1.0d0 - x) * y))) / t_0
else
tmp = x - ((-1.0d0) / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 2.0 * (y + 1.0);
double tmp;
if (y <= -1000000000.0) {
tmp = x - ((x - 1.0) / y);
} else if (y <= 1.25e+15) {
tmp = (t_0 - (2.0 * ((1.0 - x) * y))) / t_0;
} else {
tmp = x - (-1.0 / y);
}
return tmp;
}
def code(x, y): t_0 = 2.0 * (y + 1.0) tmp = 0 if y <= -1000000000.0: tmp = x - ((x - 1.0) / y) elif y <= 1.25e+15: tmp = (t_0 - (2.0 * ((1.0 - x) * y))) / t_0 else: tmp = x - (-1.0 / y) return tmp
function code(x, y) t_0 = Float64(2.0 * Float64(y + 1.0)) tmp = 0.0 if (y <= -1000000000.0) tmp = Float64(x - Float64(Float64(x - 1.0) / y)); elseif (y <= 1.25e+15) tmp = Float64(Float64(t_0 - Float64(2.0 * Float64(Float64(1.0 - x) * y))) / t_0); else tmp = Float64(x - Float64(-1.0 / y)); end return tmp end
function tmp_2 = code(x, y) t_0 = 2.0 * (y + 1.0); tmp = 0.0; if (y <= -1000000000.0) tmp = x - ((x - 1.0) / y); elseif (y <= 1.25e+15) tmp = (t_0 - (2.0 * ((1.0 - x) * y))) / t_0; else tmp = x - (-1.0 / y); end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(2.0 * N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1000000000.0], N[(x - N[(N[(x - 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e+15], N[(N[(t$95$0 - N[(2.0 * N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision], N[(x - N[(-1.0 / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 \cdot \left(y + 1\right)\\
\mathbf{if}\;y \leq -1000000000:\\
\;\;\;\;x - \frac{x - 1}{y}\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{+15}:\\
\;\;\;\;\frac{t\_0 - 2 \cdot \left(\left(1 - x\right) \cdot y\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{-1}{y}\\
\end{array}
\end{array}
if y < -1e9Initial program 65.2%
Taylor expanded in y around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.0
Applied rewrites51.0%
if -1e9 < y < 1.25e15Initial program 65.2%
lift--.f64N/A
metadata-evalN/A
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
frac-subN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
lift-+.f6465.6
Applied rewrites65.6%
if 1.25e15 < y Initial program 65.2%
Taylor expanded in y around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.0
Applied rewrites51.0%
Taylor expanded in x around 0
Applied rewrites51.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (- x 1.0) y)))
(if (<= y -11500000000.0)
(- x t_0)
(if (<= y 116000.0)
(- 1.0 (* (/ (+ (- y) (/ y x)) (+ y 1.0)) x))
(+ (- (/ (- (- t_0) (- (- x 1.0))) y)) x)))))
double code(double x, double y) {
double t_0 = (x - 1.0) / y;
double tmp;
if (y <= -11500000000.0) {
tmp = x - t_0;
} else if (y <= 116000.0) {
tmp = 1.0 - (((-y + (y / x)) / (y + 1.0)) * x);
} else {
tmp = -((-t_0 - -(x - 1.0)) / 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 = (x - 1.0d0) / y
if (y <= (-11500000000.0d0)) then
tmp = x - t_0
else if (y <= 116000.0d0) then
tmp = 1.0d0 - (((-y + (y / x)) / (y + 1.0d0)) * x)
else
tmp = -((-t_0 - -(x - 1.0d0)) / y) + x
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (x - 1.0) / y;
double tmp;
if (y <= -11500000000.0) {
tmp = x - t_0;
} else if (y <= 116000.0) {
tmp = 1.0 - (((-y + (y / x)) / (y + 1.0)) * x);
} else {
tmp = -((-t_0 - -(x - 1.0)) / y) + x;
}
return tmp;
}
def code(x, y): t_0 = (x - 1.0) / y tmp = 0 if y <= -11500000000.0: tmp = x - t_0 elif y <= 116000.0: tmp = 1.0 - (((-y + (y / x)) / (y + 1.0)) * x) else: tmp = -((-t_0 - -(x - 1.0)) / y) + x return tmp
function code(x, y) t_0 = Float64(Float64(x - 1.0) / y) tmp = 0.0 if (y <= -11500000000.0) tmp = Float64(x - t_0); elseif (y <= 116000.0) tmp = Float64(1.0 - Float64(Float64(Float64(Float64(-y) + Float64(y / x)) / Float64(y + 1.0)) * x)); else tmp = Float64(Float64(-Float64(Float64(Float64(-t_0) - Float64(-Float64(x - 1.0))) / y)) + x); end return tmp end
function tmp_2 = code(x, y) t_0 = (x - 1.0) / y; tmp = 0.0; if (y <= -11500000000.0) tmp = x - t_0; elseif (y <= 116000.0) tmp = 1.0 - (((-y + (y / x)) / (y + 1.0)) * x); else tmp = -((-t_0 - -(x - 1.0)) / y) + x; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(x - 1.0), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -11500000000.0], N[(x - t$95$0), $MachinePrecision], If[LessEqual[y, 116000.0], N[(1.0 - N[(N[(N[((-y) + N[(y / x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[((-N[(N[((-t$95$0) - (-N[(x - 1.0), $MachinePrecision])), $MachinePrecision] / y), $MachinePrecision]) + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x - 1}{y}\\
\mathbf{if}\;y \leq -11500000000:\\
\;\;\;\;x - t\_0\\
\mathbf{elif}\;y \leq 116000:\\
\;\;\;\;1 - \frac{\left(-y\right) + \frac{y}{x}}{y + 1} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{\left(-t\_0\right) - \left(-\left(x - 1\right)\right)}{y}\right) + x\\
\end{array}
\end{array}
if y < -1.15e10Initial program 65.2%
Taylor expanded in y around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.0
Applied rewrites51.0%
if -1.15e10 < y < 116000Initial program 65.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r/N/A
mul-1-negN/A
associate-/r*N/A
div-add-revN/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-+.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
+-commutativeN/A
lift-+.f6476.9
Applied rewrites76.9%
if 116000 < y Initial program 65.2%
Taylor expanded in y around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f6451.0
Applied rewrites51.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))
(t_1 (- 1.0 (* (/ (+ (- y) (/ y x)) (+ y 1.0)) x))))
(if (<= t_0 -50.0)
t_1
(if (<= t_0 2e-14) (/ (- (+ (* x y) 1.0) x) y) t_1))))
double code(double x, double y) {
double t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0));
double t_1 = 1.0 - (((-y + (y / x)) / (y + 1.0)) * x);
double tmp;
if (t_0 <= -50.0) {
tmp = t_1;
} else if (t_0 <= 2e-14) {
tmp = (((x * y) + 1.0) - x) / y;
} else {
tmp = t_1;
}
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 = 1.0d0 - (((1.0d0 - x) * y) / (y + 1.0d0))
t_1 = 1.0d0 - (((-y + (y / x)) / (y + 1.0d0)) * x)
if (t_0 <= (-50.0d0)) then
tmp = t_1
else if (t_0 <= 2d-14) then
tmp = (((x * y) + 1.0d0) - x) / y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0));
double t_1 = 1.0 - (((-y + (y / x)) / (y + 1.0)) * x);
double tmp;
if (t_0 <= -50.0) {
tmp = t_1;
} else if (t_0 <= 2e-14) {
tmp = (((x * y) + 1.0) - x) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y): t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0)) t_1 = 1.0 - (((-y + (y / x)) / (y + 1.0)) * x) tmp = 0 if t_0 <= -50.0: tmp = t_1 elif t_0 <= 2e-14: tmp = (((x * y) + 1.0) - x) / y else: tmp = t_1 return tmp
function code(x, y) t_0 = Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0))) t_1 = Float64(1.0 - Float64(Float64(Float64(Float64(-y) + Float64(y / x)) / Float64(y + 1.0)) * x)) tmp = 0.0 if (t_0 <= -50.0) tmp = t_1; elseif (t_0 <= 2e-14) tmp = Float64(Float64(Float64(Float64(x * y) + 1.0) - x) / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0)); t_1 = 1.0 - (((-y + (y / x)) / (y + 1.0)) * x); tmp = 0.0; if (t_0 <= -50.0) tmp = t_1; elseif (t_0 <= 2e-14) tmp = (((x * y) + 1.0) - x) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 - N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - N[(N[(N[((-y) + N[(y / x), $MachinePrecision]), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -50.0], t$95$1, If[LessEqual[t$95$0, 2e-14], N[(N[(N[(N[(x * y), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\\
t_1 := 1 - \frac{\left(-y\right) + \frac{y}{x}}{y + 1} \cdot x\\
\mathbf{if}\;t\_0 \leq -50:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{-14}:\\
\;\;\;\;\frac{\left(x \cdot y + 1\right) - x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < -50 or 2e-14 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) Initial program 65.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r/N/A
mul-1-negN/A
associate-/r*N/A
div-add-revN/A
mul-1-negN/A
lower-/.f64N/A
mul-1-negN/A
lower-+.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
+-commutativeN/A
lift-+.f6476.9
Applied rewrites76.9%
if -50 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < 2e-14Initial program 65.2%
Taylor expanded in y around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.0
Applied rewrites51.0%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6438.8
Applied rewrites38.8%
lift-fma.f64N/A
*-commutativeN/A
lower-+.f64N/A
lower-*.f6438.8
Applied rewrites38.8%
(FPCore (x y)
:precision binary64
(if (<= y -125000000.0)
(- x (/ (- x 1.0) y))
(if (<= y 3500000000.0)
(- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0)))
(- x (/ -1.0 y)))))
double code(double x, double y) {
double tmp;
if (y <= -125000000.0) {
tmp = x - ((x - 1.0) / y);
} else if (y <= 3500000000.0) {
tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0));
} else {
tmp = x - (-1.0 / 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 <= (-125000000.0d0)) then
tmp = x - ((x - 1.0d0) / y)
else if (y <= 3500000000.0d0) then
tmp = 1.0d0 - (((1.0d0 - x) * y) / (y + 1.0d0))
else
tmp = x - ((-1.0d0) / y)
end if
code = tmp
end function
public static double code(double x, double y) {
double tmp;
if (y <= -125000000.0) {
tmp = x - ((x - 1.0) / y);
} else if (y <= 3500000000.0) {
tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0));
} else {
tmp = x - (-1.0 / y);
}
return tmp;
}
def code(x, y): tmp = 0 if y <= -125000000.0: tmp = x - ((x - 1.0) / y) elif y <= 3500000000.0: tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0)) else: tmp = x - (-1.0 / y) return tmp
function code(x, y) tmp = 0.0 if (y <= -125000000.0) tmp = Float64(x - Float64(Float64(x - 1.0) / y)); elseif (y <= 3500000000.0) tmp = Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0))); else tmp = Float64(x - Float64(-1.0 / y)); end return tmp end
function tmp_2 = code(x, y) tmp = 0.0; if (y <= -125000000.0) tmp = x - ((x - 1.0) / y); elseif (y <= 3500000000.0) tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0)); else tmp = x - (-1.0 / y); end tmp_2 = tmp; end
code[x_, y_] := If[LessEqual[y, -125000000.0], N[(x - N[(N[(x - 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3500000000.0], N[(1.0 - N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(-1.0 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -125000000:\\
\;\;\;\;x - \frac{x - 1}{y}\\
\mathbf{elif}\;y \leq 3500000000:\\
\;\;\;\;1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{-1}{y}\\
\end{array}
\end{array}
if y < -1.25e8Initial program 65.2%
Taylor expanded in y around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.0
Applied rewrites51.0%
if -1.25e8 < y < 3.5e9Initial program 65.2%
if 3.5e9 < y Initial program 65.2%
Taylor expanded in y around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.0
Applied rewrites51.0%
Taylor expanded in x around 0
Applied rewrites51.2%
(FPCore (x y) :precision binary64 (let* ((t_0 (- x (/ (- x 1.0) y)))) (if (<= y -1.0) t_0 (if (<= y 1.0) (fma (- x 1.0) y 1.0) t_0))))
double code(double x, double y) {
double t_0 = x - ((x - 1.0) / y);
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 1.0) {
tmp = fma((x - 1.0), y, 1.0);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) t_0 = Float64(x - Float64(Float64(x - 1.0) / y)) tmp = 0.0 if (y <= -1.0) tmp = t_0; elseif (y <= 1.0) tmp = fma(Float64(x - 1.0), y, 1.0); else tmp = t_0; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(x - N[(N[(x - 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.0], t$95$0, If[LessEqual[y, 1.0], N[(N[(x - 1.0), $MachinePrecision] * y + 1.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x - \frac{x - 1}{y}\\
\mathbf{if}\;y \leq -1:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 1:\\
\;\;\;\;\mathsf{fma}\left(x - 1, y, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1 or 1 < y Initial program 65.2%
Taylor expanded in y around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.0
Applied rewrites51.0%
if -1 < y < 1Initial program 65.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6450.0
Applied rewrites50.0%
(FPCore (x y) :precision binary64 (let* ((t_0 (- x (/ -1.0 y)))) (if (<= y -1.0) t_0 (if (<= y 0.82) (fma (- x 1.0) y 1.0) t_0))))
double code(double x, double y) {
double t_0 = x - (-1.0 / y);
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 0.82) {
tmp = fma((x - 1.0), y, 1.0);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) t_0 = Float64(x - Float64(-1.0 / y)) tmp = 0.0 if (y <= -1.0) tmp = t_0; elseif (y <= 0.82) tmp = fma(Float64(x - 1.0), y, 1.0); else tmp = t_0; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(x - N[(-1.0 / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.0], t$95$0, If[LessEqual[y, 0.82], N[(N[(x - 1.0), $MachinePrecision] * y + 1.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x - \frac{-1}{y}\\
\mathbf{if}\;y \leq -1:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 0.82:\\
\;\;\;\;\mathsf{fma}\left(x - 1, y, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1 or 0.819999999999999951 < y Initial program 65.2%
Taylor expanded in y around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.0
Applied rewrites51.0%
Taylor expanded in x around 0
Applied rewrites51.2%
if -1 < y < 0.819999999999999951Initial program 65.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6450.0
Applied rewrites50.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0)))) (t_1 (- x (/ x y))))
(if (<= t_0 0.5)
(- x (/ -1.0 y))
(if (<= t_0 2.0)
(+ (- y) 1.0)
(if (<= t_0 5e+30) t_1 (if (<= t_0 5e+191) (* y x) t_1))))))
double code(double x, double y) {
double t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0));
double t_1 = x - (x / y);
double tmp;
if (t_0 <= 0.5) {
tmp = x - (-1.0 / y);
} else if (t_0 <= 2.0) {
tmp = -y + 1.0;
} else if (t_0 <= 5e+30) {
tmp = t_1;
} else if (t_0 <= 5e+191) {
tmp = y * x;
} else {
tmp = t_1;
}
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 = 1.0d0 - (((1.0d0 - x) * y) / (y + 1.0d0))
t_1 = x - (x / y)
if (t_0 <= 0.5d0) then
tmp = x - ((-1.0d0) / y)
else if (t_0 <= 2.0d0) then
tmp = -y + 1.0d0
else if (t_0 <= 5d+30) then
tmp = t_1
else if (t_0 <= 5d+191) then
tmp = y * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0));
double t_1 = x - (x / y);
double tmp;
if (t_0 <= 0.5) {
tmp = x - (-1.0 / y);
} else if (t_0 <= 2.0) {
tmp = -y + 1.0;
} else if (t_0 <= 5e+30) {
tmp = t_1;
} else if (t_0 <= 5e+191) {
tmp = y * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y): t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0)) t_1 = x - (x / y) tmp = 0 if t_0 <= 0.5: tmp = x - (-1.0 / y) elif t_0 <= 2.0: tmp = -y + 1.0 elif t_0 <= 5e+30: tmp = t_1 elif t_0 <= 5e+191: tmp = y * x else: tmp = t_1 return tmp
function code(x, y) t_0 = Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0))) t_1 = Float64(x - Float64(x / y)) tmp = 0.0 if (t_0 <= 0.5) tmp = Float64(x - Float64(-1.0 / y)); elseif (t_0 <= 2.0) tmp = Float64(Float64(-y) + 1.0); elseif (t_0 <= 5e+30) tmp = t_1; elseif (t_0 <= 5e+191) tmp = Float64(y * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0)); t_1 = x - (x / y); tmp = 0.0; if (t_0 <= 0.5) tmp = x - (-1.0 / y); elseif (t_0 <= 2.0) tmp = -y + 1.0; elseif (t_0 <= 5e+30) tmp = t_1; elseif (t_0 <= 5e+191) tmp = y * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 - N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x - N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.5], N[(x - N[(-1.0 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2.0], N[((-y) + 1.0), $MachinePrecision], If[LessEqual[t$95$0, 5e+30], t$95$1, If[LessEqual[t$95$0, 5e+191], N[(y * x), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\\
t_1 := x - \frac{x}{y}\\
\mathbf{if}\;t\_0 \leq 0.5:\\
\;\;\;\;x - \frac{-1}{y}\\
\mathbf{elif}\;t\_0 \leq 2:\\
\;\;\;\;\left(-y\right) + 1\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+191}:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < 0.5Initial program 65.2%
Taylor expanded in y around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.0
Applied rewrites51.0%
Taylor expanded in x around 0
Applied rewrites51.2%
if 0.5 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < 2Initial program 65.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6450.0
Applied rewrites50.0%
Taylor expanded in x around 0
mul-1-negN/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6438.3
Applied rewrites38.3%
if 2 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < 4.9999999999999998e30 or 5.0000000000000002e191 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) Initial program 65.2%
Taylor expanded in y around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.0
Applied rewrites51.0%
Taylor expanded in x around inf
lower-/.f6439.4
Applied rewrites39.4%
if 4.9999999999999998e30 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < 5.0000000000000002e191Initial program 65.2%
Taylor expanded in x around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lift-+.f6451.4
Applied rewrites51.4%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f6414.4
Applied rewrites14.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- x (/ x y))))
(if (<= y -1.0)
t_0
(if (<= y 0.75) (+ (- y) 1.0) (if (<= y 4.7e+95) (/ 1.0 y) t_0)))))
double code(double x, double y) {
double t_0 = x - (x / y);
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 0.75) {
tmp = -y + 1.0;
} else if (y <= 4.7e+95) {
tmp = 1.0 / y;
} 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 - (x / y)
if (y <= (-1.0d0)) then
tmp = t_0
else if (y <= 0.75d0) then
tmp = -y + 1.0d0
else if (y <= 4.7d+95) then
tmp = 1.0d0 / y
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x - (x / y);
double tmp;
if (y <= -1.0) {
tmp = t_0;
} else if (y <= 0.75) {
tmp = -y + 1.0;
} else if (y <= 4.7e+95) {
tmp = 1.0 / y;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x - (x / y) tmp = 0 if y <= -1.0: tmp = t_0 elif y <= 0.75: tmp = -y + 1.0 elif y <= 4.7e+95: tmp = 1.0 / y else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x - Float64(x / y)) tmp = 0.0 if (y <= -1.0) tmp = t_0; elseif (y <= 0.75) tmp = Float64(Float64(-y) + 1.0); elseif (y <= 4.7e+95) tmp = Float64(1.0 / y); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x - (x / y); tmp = 0.0; if (y <= -1.0) tmp = t_0; elseif (y <= 0.75) tmp = -y + 1.0; elseif (y <= 4.7e+95) tmp = 1.0 / y; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x - N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.0], t$95$0, If[LessEqual[y, 0.75], N[((-y) + 1.0), $MachinePrecision], If[LessEqual[y, 4.7e+95], N[(1.0 / y), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x - \frac{x}{y}\\
\mathbf{if}\;y \leq -1:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 0.75:\\
\;\;\;\;\left(-y\right) + 1\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{+95}:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if y < -1 or 4.69999999999999972e95 < y Initial program 65.2%
Taylor expanded in y around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.0
Applied rewrites51.0%
Taylor expanded in x around inf
lower-/.f6439.4
Applied rewrites39.4%
if -1 < y < 0.75Initial program 65.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6450.0
Applied rewrites50.0%
Taylor expanded in x around 0
mul-1-negN/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6438.3
Applied rewrites38.3%
if 0.75 < y < 4.69999999999999972e95Initial program 65.2%
Taylor expanded in y around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.0
Applied rewrites51.0%
Taylor expanded in x around 0
lower-/.f6414.1
Applied rewrites14.1%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0)))) (t_1 (- 1.0 (- x))))
(if (<= t_0 -50.0)
t_1
(if (<= t_0 0.5)
(/ 1.0 y)
(if (<= t_0 1e+24) (+ (- y) 1.0) (if (<= t_0 5e+191) (* y x) t_1))))))
double code(double x, double y) {
double t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0));
double t_1 = 1.0 - -x;
double tmp;
if (t_0 <= -50.0) {
tmp = t_1;
} else if (t_0 <= 0.5) {
tmp = 1.0 / y;
} else if (t_0 <= 1e+24) {
tmp = -y + 1.0;
} else if (t_0 <= 5e+191) {
tmp = y * x;
} else {
tmp = t_1;
}
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 = 1.0d0 - (((1.0d0 - x) * y) / (y + 1.0d0))
t_1 = 1.0d0 - -x
if (t_0 <= (-50.0d0)) then
tmp = t_1
else if (t_0 <= 0.5d0) then
tmp = 1.0d0 / y
else if (t_0 <= 1d+24) then
tmp = -y + 1.0d0
else if (t_0 <= 5d+191) then
tmp = y * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0));
double t_1 = 1.0 - -x;
double tmp;
if (t_0 <= -50.0) {
tmp = t_1;
} else if (t_0 <= 0.5) {
tmp = 1.0 / y;
} else if (t_0 <= 1e+24) {
tmp = -y + 1.0;
} else if (t_0 <= 5e+191) {
tmp = y * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y): t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0)) t_1 = 1.0 - -x tmp = 0 if t_0 <= -50.0: tmp = t_1 elif t_0 <= 0.5: tmp = 1.0 / y elif t_0 <= 1e+24: tmp = -y + 1.0 elif t_0 <= 5e+191: tmp = y * x else: tmp = t_1 return tmp
function code(x, y) t_0 = Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0))) t_1 = Float64(1.0 - Float64(-x)) tmp = 0.0 if (t_0 <= -50.0) tmp = t_1; elseif (t_0 <= 0.5) tmp = Float64(1.0 / y); elseif (t_0 <= 1e+24) tmp = Float64(Float64(-y) + 1.0); elseif (t_0 <= 5e+191) tmp = Float64(y * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0)); t_1 = 1.0 - -x; tmp = 0.0; if (t_0 <= -50.0) tmp = t_1; elseif (t_0 <= 0.5) tmp = 1.0 / y; elseif (t_0 <= 1e+24) tmp = -y + 1.0; elseif (t_0 <= 5e+191) tmp = y * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 - N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - (-x)), $MachinePrecision]}, If[LessEqual[t$95$0, -50.0], t$95$1, If[LessEqual[t$95$0, 0.5], N[(1.0 / y), $MachinePrecision], If[LessEqual[t$95$0, 1e+24], N[((-y) + 1.0), $MachinePrecision], If[LessEqual[t$95$0, 5e+191], N[(y * x), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\\
t_1 := 1 - \left(-x\right)\\
\mathbf{if}\;t\_0 \leq -50:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 0.5:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{elif}\;t\_0 \leq 10^{+24}:\\
\;\;\;\;\left(-y\right) + 1\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+191}:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < -50 or 5.0000000000000002e191 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) Initial program 65.2%
Taylor expanded in y around inf
lift--.f6428.6
Applied rewrites28.6%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f6449.8
Applied rewrites49.8%
if -50 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < 0.5Initial program 65.2%
Taylor expanded in y around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.0
Applied rewrites51.0%
Taylor expanded in x around 0
lower-/.f6414.1
Applied rewrites14.1%
if 0.5 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < 9.9999999999999998e23Initial program 65.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6450.0
Applied rewrites50.0%
Taylor expanded in x around 0
mul-1-negN/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6438.3
Applied rewrites38.3%
if 9.9999999999999998e23 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < 5.0000000000000002e191Initial program 65.2%
Taylor expanded in x around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lift-+.f6451.4
Applied rewrites51.4%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f6414.4
Applied rewrites14.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0)))) (t_1 (- 1.0 (- x))))
(if (<= t_0 -50.0)
t_1
(if (<= t_0 0.5)
(/ 1.0 y)
(if (<= t_0 5e+30) 1.0 (if (<= t_0 5e+191) (* y x) t_1))))))
double code(double x, double y) {
double t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0));
double t_1 = 1.0 - -x;
double tmp;
if (t_0 <= -50.0) {
tmp = t_1;
} else if (t_0 <= 0.5) {
tmp = 1.0 / y;
} else if (t_0 <= 5e+30) {
tmp = 1.0;
} else if (t_0 <= 5e+191) {
tmp = y * x;
} else {
tmp = t_1;
}
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 = 1.0d0 - (((1.0d0 - x) * y) / (y + 1.0d0))
t_1 = 1.0d0 - -x
if (t_0 <= (-50.0d0)) then
tmp = t_1
else if (t_0 <= 0.5d0) then
tmp = 1.0d0 / y
else if (t_0 <= 5d+30) then
tmp = 1.0d0
else if (t_0 <= 5d+191) then
tmp = y * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0));
double t_1 = 1.0 - -x;
double tmp;
if (t_0 <= -50.0) {
tmp = t_1;
} else if (t_0 <= 0.5) {
tmp = 1.0 / y;
} else if (t_0 <= 5e+30) {
tmp = 1.0;
} else if (t_0 <= 5e+191) {
tmp = y * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y): t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0)) t_1 = 1.0 - -x tmp = 0 if t_0 <= -50.0: tmp = t_1 elif t_0 <= 0.5: tmp = 1.0 / y elif t_0 <= 5e+30: tmp = 1.0 elif t_0 <= 5e+191: tmp = y * x else: tmp = t_1 return tmp
function code(x, y) t_0 = Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0))) t_1 = Float64(1.0 - Float64(-x)) tmp = 0.0 if (t_0 <= -50.0) tmp = t_1; elseif (t_0 <= 0.5) tmp = Float64(1.0 / y); elseif (t_0 <= 5e+30) tmp = 1.0; elseif (t_0 <= 5e+191) tmp = Float64(y * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0)); t_1 = 1.0 - -x; tmp = 0.0; if (t_0 <= -50.0) tmp = t_1; elseif (t_0 <= 0.5) tmp = 1.0 / y; elseif (t_0 <= 5e+30) tmp = 1.0; elseif (t_0 <= 5e+191) tmp = y * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 - N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - (-x)), $MachinePrecision]}, If[LessEqual[t$95$0, -50.0], t$95$1, If[LessEqual[t$95$0, 0.5], N[(1.0 / y), $MachinePrecision], If[LessEqual[t$95$0, 5e+30], 1.0, If[LessEqual[t$95$0, 5e+191], N[(y * x), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\\
t_1 := 1 - \left(-x\right)\\
\mathbf{if}\;t\_0 \leq -50:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 0.5:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+30}:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+191}:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < -50 or 5.0000000000000002e191 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) Initial program 65.2%
Taylor expanded in y around inf
lift--.f6428.6
Applied rewrites28.6%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f6449.8
Applied rewrites49.8%
if -50 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < 0.5Initial program 65.2%
Taylor expanded in y around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.0
Applied rewrites51.0%
Taylor expanded in x around 0
lower-/.f6414.1
Applied rewrites14.1%
if 0.5 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < 4.9999999999999998e30Initial program 65.2%
lift--.f64N/A
metadata-evalN/A
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
frac-subN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
lift-+.f6465.6
Applied rewrites65.6%
Taylor expanded in y around 0
Applied rewrites50.2%
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
metadata-evalN/A
lower-fma.f6450.2
Applied rewrites50.2%
Taylor expanded in y around 0
+-commutative38.5
metadata-eval38.5
distribute-rgt-in38.5
+-commutative38.5
frac-sub38.5
metadata-eval38.5
+-commutative38.5
Applied rewrites38.5%
if 4.9999999999999998e30 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < 5.0000000000000002e191Initial program 65.2%
Taylor expanded in x around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lift-+.f6451.4
Applied rewrites51.4%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f6414.4
Applied rewrites14.4%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0)))) (t_1 (- 1.0 (- 1.0 x))))
(if (<= t_0 -50.0)
t_1
(if (<= t_0 0.5) (/ 1.0 y) (if (<= t_0 2.0) (+ (- y) 1.0) t_1)))))
double code(double x, double y) {
double t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0));
double t_1 = 1.0 - (1.0 - x);
double tmp;
if (t_0 <= -50.0) {
tmp = t_1;
} else if (t_0 <= 0.5) {
tmp = 1.0 / y;
} else if (t_0 <= 2.0) {
tmp = -y + 1.0;
} else {
tmp = t_1;
}
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 = 1.0d0 - (((1.0d0 - x) * y) / (y + 1.0d0))
t_1 = 1.0d0 - (1.0d0 - x)
if (t_0 <= (-50.0d0)) then
tmp = t_1
else if (t_0 <= 0.5d0) then
tmp = 1.0d0 / y
else if (t_0 <= 2.0d0) then
tmp = -y + 1.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0));
double t_1 = 1.0 - (1.0 - x);
double tmp;
if (t_0 <= -50.0) {
tmp = t_1;
} else if (t_0 <= 0.5) {
tmp = 1.0 / y;
} else if (t_0 <= 2.0) {
tmp = -y + 1.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y): t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0)) t_1 = 1.0 - (1.0 - x) tmp = 0 if t_0 <= -50.0: tmp = t_1 elif t_0 <= 0.5: tmp = 1.0 / y elif t_0 <= 2.0: tmp = -y + 1.0 else: tmp = t_1 return tmp
function code(x, y) t_0 = Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0))) t_1 = Float64(1.0 - Float64(1.0 - x)) tmp = 0.0 if (t_0 <= -50.0) tmp = t_1; elseif (t_0 <= 0.5) tmp = Float64(1.0 / y); elseif (t_0 <= 2.0) tmp = Float64(Float64(-y) + 1.0); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0)); t_1 = 1.0 - (1.0 - x); tmp = 0.0; if (t_0 <= -50.0) tmp = t_1; elseif (t_0 <= 0.5) tmp = 1.0 / y; elseif (t_0 <= 2.0) tmp = -y + 1.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(1.0 - N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - N[(1.0 - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -50.0], t$95$1, If[LessEqual[t$95$0, 0.5], N[(1.0 / y), $MachinePrecision], If[LessEqual[t$95$0, 2.0], N[((-y) + 1.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\\
t_1 := 1 - \left(1 - x\right)\\
\mathbf{if}\;t\_0 \leq -50:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 0.5:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{elif}\;t\_0 \leq 2:\\
\;\;\;\;\left(-y\right) + 1\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < -50 or 2 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) Initial program 65.2%
Taylor expanded in y around inf
lift--.f6428.6
Applied rewrites28.6%
if -50 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < 0.5Initial program 65.2%
Taylor expanded in y around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.0
Applied rewrites51.0%
Taylor expanded in x around 0
lower-/.f6414.1
Applied rewrites14.1%
if 0.5 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < 2Initial program 65.2%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6450.0
Applied rewrites50.0%
Taylor expanded in x around 0
mul-1-negN/A
+-commutativeN/A
lower-+.f64N/A
lower-neg.f6438.3
Applied rewrites38.3%
(FPCore (x y)
:precision binary64
(let* ((t_0 (/ (* (- 1.0 x) y) (+ y 1.0))))
(if (<= t_0 -1e+40)
(* y x)
(if (<= t_0 0.005) 1.0 (if (<= t_0 2.0) (/ 1.0 y) (* y x))))))
double code(double x, double y) {
double t_0 = ((1.0 - x) * y) / (y + 1.0);
double tmp;
if (t_0 <= -1e+40) {
tmp = y * x;
} else if (t_0 <= 0.005) {
tmp = 1.0;
} else if (t_0 <= 2.0) {
tmp = 1.0 / y;
} else {
tmp = 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 = ((1.0d0 - x) * y) / (y + 1.0d0)
if (t_0 <= (-1d+40)) then
tmp = y * x
else if (t_0 <= 0.005d0) then
tmp = 1.0d0
else if (t_0 <= 2.0d0) then
tmp = 1.0d0 / y
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = ((1.0 - x) * y) / (y + 1.0);
double tmp;
if (t_0 <= -1e+40) {
tmp = y * x;
} else if (t_0 <= 0.005) {
tmp = 1.0;
} else if (t_0 <= 2.0) {
tmp = 1.0 / y;
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y): t_0 = ((1.0 - x) * y) / (y + 1.0) tmp = 0 if t_0 <= -1e+40: tmp = y * x elif t_0 <= 0.005: tmp = 1.0 elif t_0 <= 2.0: tmp = 1.0 / y else: tmp = y * x return tmp
function code(x, y) t_0 = Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0)) tmp = 0.0 if (t_0 <= -1e+40) tmp = Float64(y * x); elseif (t_0 <= 0.005) tmp = 1.0; elseif (t_0 <= 2.0) tmp = Float64(1.0 / y); else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y) t_0 = ((1.0 - x) * y) / (y + 1.0); tmp = 0.0; if (t_0 <= -1e+40) tmp = y * x; elseif (t_0 <= 0.005) tmp = 1.0; elseif (t_0 <= 2.0) tmp = 1.0 / y; else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+40], N[(y * x), $MachinePrecision], If[LessEqual[t$95$0, 0.005], 1.0, If[LessEqual[t$95$0, 2.0], N[(1.0 / y), $MachinePrecision], N[(y * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(1 - x\right) \cdot y}{y + 1}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+40}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;t\_0 \leq 0.005:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_0 \leq 2:\\
\;\;\;\;\frac{1}{y}\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < -1.00000000000000003e40 or 2 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) Initial program 65.2%
Taylor expanded in x around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lift-+.f6451.4
Applied rewrites51.4%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f6414.4
Applied rewrites14.4%
if -1.00000000000000003e40 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 0.0050000000000000001Initial program 65.2%
lift--.f64N/A
metadata-evalN/A
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
frac-subN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
lift-+.f6465.6
Applied rewrites65.6%
Taylor expanded in y around 0
Applied rewrites50.2%
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
metadata-evalN/A
lower-fma.f6450.2
Applied rewrites50.2%
Taylor expanded in y around 0
+-commutative38.5
metadata-eval38.5
distribute-rgt-in38.5
+-commutative38.5
frac-sub38.5
metadata-eval38.5
+-commutative38.5
Applied rewrites38.5%
if 0.0050000000000000001 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 2Initial program 65.2%
Taylor expanded in y around -inf
fp-cancel-sign-sub-invN/A
metadata-evalN/A
metadata-evalN/A
times-fracN/A
mul-1-negN/A
mul-1-negN/A
frac-2negN/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.0
Applied rewrites51.0%
Taylor expanded in x around 0
lower-/.f6414.1
Applied rewrites14.1%
(FPCore (x y) :precision binary64 (let* ((t_0 (/ (* (- 1.0 x) y) (+ y 1.0)))) (if (<= t_0 -1e+40) (* y x) (if (<= t_0 2.0) 1.0 (* y x)))))
double code(double x, double y) {
double t_0 = ((1.0 - x) * y) / (y + 1.0);
double tmp;
if (t_0 <= -1e+40) {
tmp = y * x;
} else if (t_0 <= 2.0) {
tmp = 1.0;
} else {
tmp = 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 = ((1.0d0 - x) * y) / (y + 1.0d0)
if (t_0 <= (-1d+40)) then
tmp = y * x
else if (t_0 <= 2.0d0) then
tmp = 1.0d0
else
tmp = y * x
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = ((1.0 - x) * y) / (y + 1.0);
double tmp;
if (t_0 <= -1e+40) {
tmp = y * x;
} else if (t_0 <= 2.0) {
tmp = 1.0;
} else {
tmp = y * x;
}
return tmp;
}
def code(x, y): t_0 = ((1.0 - x) * y) / (y + 1.0) tmp = 0 if t_0 <= -1e+40: tmp = y * x elif t_0 <= 2.0: tmp = 1.0 else: tmp = y * x return tmp
function code(x, y) t_0 = Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0)) tmp = 0.0 if (t_0 <= -1e+40) tmp = Float64(y * x); elseif (t_0 <= 2.0) tmp = 1.0; else tmp = Float64(y * x); end return tmp end
function tmp_2 = code(x, y) t_0 = ((1.0 - x) * y) / (y + 1.0); tmp = 0.0; if (t_0 <= -1e+40) tmp = y * x; elseif (t_0 <= 2.0) tmp = 1.0; else tmp = y * x; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e+40], N[(y * x), $MachinePrecision], If[LessEqual[t$95$0, 2.0], 1.0, N[(y * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(1 - x\right) \cdot y}{y + 1}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{+40}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;t\_0 \leq 2:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\end{array}
if (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < -1.00000000000000003e40 or 2 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) Initial program 65.2%
Taylor expanded in x around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
+-commutativeN/A
lift-+.f6451.4
Applied rewrites51.4%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f6414.4
Applied rewrites14.4%
if -1.00000000000000003e40 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 2Initial program 65.2%
lift--.f64N/A
metadata-evalN/A
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
frac-subN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
lift-+.f6465.6
Applied rewrites65.6%
Taylor expanded in y around 0
Applied rewrites50.2%
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
metadata-evalN/A
lower-fma.f6450.2
Applied rewrites50.2%
Taylor expanded in y around 0
+-commutative38.5
metadata-eval38.5
distribute-rgt-in38.5
+-commutative38.5
frac-sub38.5
metadata-eval38.5
+-commutative38.5
Applied rewrites38.5%
(FPCore (x y) :precision binary64 1.0)
double code(double x, double y) {
return 1.0;
}
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 = 1.0d0
end function
public static double code(double x, double y) {
return 1.0;
}
def code(x, y): return 1.0
function code(x, y) return 1.0 end
function tmp = code(x, y) tmp = 1.0; end
code[x_, y_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 65.2%
lift--.f64N/A
metadata-evalN/A
lift-+.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
+-commutativeN/A
frac-subN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lift-+.f64N/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
lift-+.f6465.6
Applied rewrites65.6%
Taylor expanded in y around 0
Applied rewrites50.2%
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
metadata-evalN/A
lower-fma.f6450.2
Applied rewrites50.2%
Taylor expanded in y around 0
+-commutative38.5
metadata-eval38.5
distribute-rgt-in38.5
+-commutative38.5
frac-sub38.5
metadata-eval38.5
+-commutative38.5
Applied rewrites38.5%
herbie shell --seed 2025130
(FPCore (x y)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, D"
:precision binary64
(- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))))