
(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]
1 - \frac{\left(1 - x\right) \cdot y}{y + 1}
Herbie found 13 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]
1 - \frac{\left(1 - x\right) \cdot y}{y + 1}
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (* -1.0 (/ (- x 1.0) y)))))
(if (<= y -1.55e+22)
t_0
(if (<= y 38000000.0) (/ (fma (- x 1.0) y (- y -1.0)) (- y -1.0)) t_0))))double code(double x, double y) {
double t_0 = x + (-1.0 * ((x - 1.0) / y));
double tmp;
if (y <= -1.55e+22) {
tmp = t_0;
} else if (y <= 38000000.0) {
tmp = fma((x - 1.0), y, (y - -1.0)) / (y - -1.0);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) t_0 = Float64(x + Float64(-1.0 * Float64(Float64(x - 1.0) / y))) tmp = 0.0 if (y <= -1.55e+22) tmp = t_0; elseif (y <= 38000000.0) tmp = Float64(fma(Float64(x - 1.0), y, Float64(y - -1.0)) / Float64(y - -1.0)); else tmp = t_0; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(-1.0 * N[(N[(x - 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.55e+22], t$95$0, If[LessEqual[y, 38000000.0], N[(N[(N[(x - 1.0), $MachinePrecision] * y + N[(y - -1.0), $MachinePrecision]), $MachinePrecision] / N[(y - -1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x + -1 \cdot \frac{x - 1}{y}\\
\mathbf{if}\;y \leq -1.55 \cdot 10^{+22}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 38000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(x - 1, y, y - -1\right)}{y - -1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if y < -1.5500000000000001e22 or 3.8e7 < y Initial program 66.2%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6449.7%
Applied rewrites49.7%
if -1.5500000000000001e22 < y < 3.8e7Initial program 66.2%
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
lower-/.f64N/A
sub-flipN/A
*-lft-identityN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f6466.7%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-eval66.7%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-eval66.7%
Applied rewrites66.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0)))))
(if (<= t_0 -2e+18)
(* (/ y (- y -1.0)) x)
(if (<= t_0 0.01)
(/ (* (- (/ -1.0 x) y) x) (- -1.0 y))
(fma y (/ (- x 1.0) (- y -1.0)) 1.0)))))double code(double x, double y) {
double t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0));
double tmp;
if (t_0 <= -2e+18) {
tmp = (y / (y - -1.0)) * x;
} else if (t_0 <= 0.01) {
tmp = (((-1.0 / x) - y) * x) / (-1.0 - y);
} else {
tmp = fma(y, ((x - 1.0) / (y - -1.0)), 1.0);
}
return tmp;
}
function code(x, y) t_0 = Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0))) tmp = 0.0 if (t_0 <= -2e+18) tmp = Float64(Float64(y / Float64(y - -1.0)) * x); elseif (t_0 <= 0.01) tmp = Float64(Float64(Float64(Float64(-1.0 / x) - y) * x) / Float64(-1.0 - y)); else tmp = fma(y, Float64(Float64(x - 1.0) / Float64(y - -1.0)), 1.0); end return 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]}, If[LessEqual[t$95$0, -2e+18], N[(N[(y / N[(y - -1.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$0, 0.01], N[(N[(N[(N[(-1.0 / x), $MachinePrecision] - y), $MachinePrecision] * x), $MachinePrecision] / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(x - 1.0), $MachinePrecision] / N[(y - -1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]]]
\begin{array}{l}
t_0 := 1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{+18}:\\
\;\;\;\;\frac{y}{y - -1} \cdot x\\
\mathbf{elif}\;t\_0 \leq 0.01:\\
\;\;\;\;\frac{\left(\frac{-1}{x} - y\right) \cdot x}{-1 - y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x - 1}{y - -1}, 1\right)\\
\end{array}
if (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < -2e18Initial program 66.2%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6438.0%
Applied rewrites38.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6449.5%
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
lift--.f6449.5%
Applied rewrites49.5%
if -2e18 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < 0.01Initial program 66.2%
Taylor expanded in x around 0
Applied rewrites40.8%
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
frac-2negN/A
distribute-neg-fracN/A
distribute-frac-neg2N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
*-lft-identityN/A
lift-+.f64N/A
+-commutativeN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
sub-negate-revN/A
lower--.f6441.2%
Applied rewrites41.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f6488.4%
Applied rewrites88.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6488.4%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
metadata-evalN/A
distribute-rgt-neg-outN/A
sub-flip-reverseN/A
lower--.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
*-rgt-identity88.4%
Applied rewrites88.4%
if 0.01 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) Initial program 66.2%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-/.f64N/A
frac-2negN/A
distribute-neg-frac2N/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
remove-double-negN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6477.6%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-eval77.6%
Applied rewrites77.6%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (* -1.0 (/ (- x 1.0) y)))))
(if (<= y -420000000.0)
t_0
(if (<= y 38000000.0) (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0))) t_0))))double code(double x, double y) {
double t_0 = x + (-1.0 * ((x - 1.0) / y));
double tmp;
if (y <= -420000000.0) {
tmp = t_0;
} else if (y <= 38000000.0) {
tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0));
} 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 + ((-1.0d0) * ((x - 1.0d0) / y))
if (y <= (-420000000.0d0)) then
tmp = t_0
else if (y <= 38000000.0d0) then
tmp = 1.0d0 - (((1.0d0 - x) * y) / (y + 1.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (-1.0 * ((x - 1.0) / y));
double tmp;
if (y <= -420000000.0) {
tmp = t_0;
} else if (y <= 38000000.0) {
tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x + (-1.0 * ((x - 1.0) / y)) tmp = 0 if y <= -420000000.0: tmp = t_0 elif y <= 38000000.0: tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x + Float64(-1.0 * Float64(Float64(x - 1.0) / y))) tmp = 0.0 if (y <= -420000000.0) tmp = t_0; elseif (y <= 38000000.0) tmp = Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x + (-1.0 * ((x - 1.0) / y)); tmp = 0.0; if (y <= -420000000.0) tmp = t_0; elseif (y <= 38000000.0) tmp = 1.0 - (((1.0 - x) * y) / (y + 1.0)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(-1.0 * N[(N[(x - 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -420000000.0], t$95$0, If[LessEqual[y, 38000000.0], N[(1.0 - N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] / N[(y + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x + -1 \cdot \frac{x - 1}{y}\\
\mathbf{if}\;y \leq -420000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 38000000:\\
\;\;\;\;1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if y < -4.2e8 or 3.8e7 < y Initial program 66.2%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6449.7%
Applied rewrites49.7%
if -4.2e8 < y < 3.8e7Initial program 66.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ x (* -1.0 (/ (- x 1.0) y)))))
(if (<= y -110000000.0)
t_0
(if (<= y 500000000.0) (fma y (/ (- x 1.0) (- y -1.0)) 1.0) t_0))))double code(double x, double y) {
double t_0 = x + (-1.0 * ((x - 1.0) / y));
double tmp;
if (y <= -110000000.0) {
tmp = t_0;
} else if (y <= 500000000.0) {
tmp = fma(y, ((x - 1.0) / (y - -1.0)), 1.0);
} else {
tmp = t_0;
}
return tmp;
}
function code(x, y) t_0 = Float64(x + Float64(-1.0 * Float64(Float64(x - 1.0) / y))) tmp = 0.0 if (y <= -110000000.0) tmp = t_0; elseif (y <= 500000000.0) tmp = fma(y, Float64(Float64(x - 1.0) / Float64(y - -1.0)), 1.0); else tmp = t_0; end return tmp end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(-1.0 * N[(N[(x - 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -110000000.0], t$95$0, If[LessEqual[y, 500000000.0], N[(y * N[(N[(x - 1.0), $MachinePrecision] / N[(y - -1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x + -1 \cdot \frac{x - 1}{y}\\
\mathbf{if}\;y \leq -110000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 500000000:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{x - 1}{y - -1}, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if y < -1.1e8 or 5e8 < y Initial program 66.2%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6449.7%
Applied rewrites49.7%
if -1.1e8 < y < 5e8Initial program 66.2%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-/.f64N/A
frac-2negN/A
distribute-neg-frac2N/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
remove-double-negN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower--.f6477.6%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
metadata-eval77.6%
Applied rewrites77.6%
(FPCore (x y) :precision binary64 (let* ((t_0 (+ x (* -1.0 (/ (- x 1.0) y))))) (if (<= y -150.0) t_0 (if (<= y 0.98) (- 1.0 (* y (- 1.0 x))) t_0))))
double code(double x, double y) {
double t_0 = x + (-1.0 * ((x - 1.0) / y));
double tmp;
if (y <= -150.0) {
tmp = t_0;
} else if (y <= 0.98) {
tmp = 1.0 - (y * (1.0 - 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 = x + ((-1.0d0) * ((x - 1.0d0) / y))
if (y <= (-150.0d0)) then
tmp = t_0
else if (y <= 0.98d0) then
tmp = 1.0d0 - (y * (1.0d0 - x))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = x + (-1.0 * ((x - 1.0) / y));
double tmp;
if (y <= -150.0) {
tmp = t_0;
} else if (y <= 0.98) {
tmp = 1.0 - (y * (1.0 - x));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = x + (-1.0 * ((x - 1.0) / y)) tmp = 0 if y <= -150.0: tmp = t_0 elif y <= 0.98: tmp = 1.0 - (y * (1.0 - x)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(x + Float64(-1.0 * Float64(Float64(x - 1.0) / y))) tmp = 0.0 if (y <= -150.0) tmp = t_0; elseif (y <= 0.98) tmp = Float64(1.0 - Float64(y * Float64(1.0 - x))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = x + (-1.0 * ((x - 1.0) / y)); tmp = 0.0; if (y <= -150.0) tmp = t_0; elseif (y <= 0.98) tmp = 1.0 - (y * (1.0 - x)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(x + N[(-1.0 * N[(N[(x - 1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -150.0], t$95$0, If[LessEqual[y, 0.98], N[(1.0 - N[(y * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x + -1 \cdot \frac{x - 1}{y}\\
\mathbf{if}\;y \leq -150:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 0.98:\\
\;\;\;\;1 - y \cdot \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if y < -150 or 0.97999999999999998 < y Initial program 66.2%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6449.7%
Applied rewrites49.7%
if -150 < y < 0.97999999999999998Initial program 66.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f6451.2%
Applied rewrites51.2%
(FPCore (x y) :precision binary64 (let* ((t_0 (* (/ y (- y -1.0)) x))) (if (<= y -1.85e-7) t_0 (if (<= y 0.24) (- 1.0 (* y (- 1.0 x))) t_0))))
double code(double x, double y) {
double t_0 = (y / (y - -1.0)) * x;
double tmp;
if (y <= -1.85e-7) {
tmp = t_0;
} else if (y <= 0.24) {
tmp = 1.0 - (y * (1.0 - 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 / (y - (-1.0d0))) * x
if (y <= (-1.85d-7)) then
tmp = t_0
else if (y <= 0.24d0) then
tmp = 1.0d0 - (y * (1.0d0 - x))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (y / (y - -1.0)) * x;
double tmp;
if (y <= -1.85e-7) {
tmp = t_0;
} else if (y <= 0.24) {
tmp = 1.0 - (y * (1.0 - x));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = (y / (y - -1.0)) * x tmp = 0 if y <= -1.85e-7: tmp = t_0 elif y <= 0.24: tmp = 1.0 - (y * (1.0 - x)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(Float64(y / Float64(y - -1.0)) * x) tmp = 0.0 if (y <= -1.85e-7) tmp = t_0; elseif (y <= 0.24) tmp = Float64(1.0 - Float64(y * Float64(1.0 - x))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = (y / (y - -1.0)) * x; tmp = 0.0; if (y <= -1.85e-7) tmp = t_0; elseif (y <= 0.24) tmp = 1.0 - (y * (1.0 - x)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(y / N[(y - -1.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -1.85e-7], t$95$0, If[LessEqual[y, 0.24], N[(1.0 - N[(y * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \frac{y}{y - -1} \cdot x\\
\mathbf{if}\;y \leq -1.85 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 0.24:\\
\;\;\;\;1 - y \cdot \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if y < -1.85e-7 or 0.23999999999999999 < y Initial program 66.2%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6438.0%
Applied rewrites38.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6449.5%
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
lift--.f6449.5%
Applied rewrites49.5%
if -1.85e-7 < y < 0.23999999999999999Initial program 66.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f6451.2%
Applied rewrites51.2%
(FPCore (x y) :precision binary64 (let* ((t_0 (/ (* (- 1.0 x) y) (+ y 1.0))) (t_1 (* (/ x (- y -1.0)) y))) (if (<= t_0 -500.0) t_1 (if (<= t_0 1.5) (/ -1.0 (- -1.0 y)) t_1))))
double code(double x, double y) {
double t_0 = ((1.0 - x) * y) / (y + 1.0);
double t_1 = (x / (y - -1.0)) * y;
double tmp;
if (t_0 <= -500.0) {
tmp = t_1;
} else if (t_0 <= 1.5) {
tmp = -1.0 / (-1.0 - 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 - x) * y) / (y + 1.0d0)
t_1 = (x / (y - (-1.0d0))) * y
if (t_0 <= (-500.0d0)) then
tmp = t_1
else if (t_0 <= 1.5d0) then
tmp = (-1.0d0) / ((-1.0d0) - y)
else
tmp = t_1
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 t_1 = (x / (y - -1.0)) * y;
double tmp;
if (t_0 <= -500.0) {
tmp = t_1;
} else if (t_0 <= 1.5) {
tmp = -1.0 / (-1.0 - y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y): t_0 = ((1.0 - x) * y) / (y + 1.0) t_1 = (x / (y - -1.0)) * y tmp = 0 if t_0 <= -500.0: tmp = t_1 elif t_0 <= 1.5: tmp = -1.0 / (-1.0 - y) else: tmp = t_1 return tmp
function code(x, y) t_0 = Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0)) t_1 = Float64(Float64(x / Float64(y - -1.0)) * y) tmp = 0.0 if (t_0 <= -500.0) tmp = t_1; elseif (t_0 <= 1.5) tmp = Float64(-1.0 / Float64(-1.0 - y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y) t_0 = ((1.0 - x) * y) / (y + 1.0); t_1 = (x / (y - -1.0)) * y; tmp = 0.0; if (t_0 <= -500.0) tmp = t_1; elseif (t_0 <= 1.5) tmp = -1.0 / (-1.0 - y); else tmp = t_1; 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]}, Block[{t$95$1 = N[(N[(x / N[(y - -1.0), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$0, -500.0], t$95$1, If[LessEqual[t$95$0, 1.5], N[(-1.0 / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_0 := \frac{\left(1 - x\right) \cdot y}{y + 1}\\
t_1 := \frac{x}{y - -1} \cdot y\\
\mathbf{if}\;t\_0 \leq -500:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 1.5:\\
\;\;\;\;\frac{-1}{-1 - y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < -500 or 1.5 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) Initial program 66.2%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6438.0%
Applied rewrites38.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l*N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
metadata-evalN/A
add-flipN/A
lift-+.f64N/A
lower-/.f6444.4%
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
lift--.f6444.4%
Applied rewrites44.4%
if -500 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 1.5Initial program 66.2%
Taylor expanded in x around 0
Applied rewrites40.8%
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
frac-2negN/A
distribute-neg-fracN/A
distribute-frac-neg2N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
*-lft-identityN/A
lift-+.f64N/A
+-commutativeN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
sub-negate-revN/A
lower--.f6441.2%
Applied rewrites41.2%
Taylor expanded in x around 0
Applied rewrites52.0%
(FPCore (x y) :precision binary64 (let* ((t_0 (* (/ x y) y))) (if (<= y -0.00021) t_0 (if (<= y 0.0285) (- 1.0 (* y (- 1.0 x))) t_0))))
double code(double x, double y) {
double t_0 = (x / y) * y;
double tmp;
if (y <= -0.00021) {
tmp = t_0;
} else if (y <= 0.0285) {
tmp = 1.0 - (y * (1.0 - 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 = (x / y) * y
if (y <= (-0.00021d0)) then
tmp = t_0
else if (y <= 0.0285d0) then
tmp = 1.0d0 - (y * (1.0d0 - x))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y) {
double t_0 = (x / y) * y;
double tmp;
if (y <= -0.00021) {
tmp = t_0;
} else if (y <= 0.0285) {
tmp = 1.0 - (y * (1.0 - x));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y): t_0 = (x / y) * y tmp = 0 if y <= -0.00021: tmp = t_0 elif y <= 0.0285: tmp = 1.0 - (y * (1.0 - x)) else: tmp = t_0 return tmp
function code(x, y) t_0 = Float64(Float64(x / y) * y) tmp = 0.0 if (y <= -0.00021) tmp = t_0; elseif (y <= 0.0285) tmp = Float64(1.0 - Float64(y * Float64(1.0 - x))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y) t_0 = (x / y) * y; tmp = 0.0; if (y <= -0.00021) tmp = t_0; elseif (y <= 0.0285) tmp = 1.0 - (y * (1.0 - x)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_] := Block[{t$95$0 = N[(N[(x / y), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -0.00021], t$95$0, If[LessEqual[y, 0.0285], N[(1.0 - N[(y * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \frac{x}{y} \cdot y\\
\mathbf{if}\;y \leq -0.00021:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 0.0285:\\
\;\;\;\;1 - y \cdot \left(1 - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if y < -2.1000000000000001e-4 or 0.028500000000000001 < y Initial program 66.2%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6438.0%
Applied rewrites38.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-/l*N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
metadata-evalN/A
add-flipN/A
lift-+.f64N/A
lower-/.f6444.4%
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
lift--.f6444.4%
Applied rewrites44.4%
Taylor expanded in y around inf
lower-/.f6432.8%
Applied rewrites32.8%
if -2.1000000000000001e-4 < y < 0.028500000000000001Initial program 66.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f6451.2%
Applied rewrites51.2%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- 1.0 (/ (* (- 1.0 x) y) (+ y 1.0)))))
(if (<= t_0 (- INFINITY))
(- 1.0 (- x))
(if (<= t_0 -0.5)
(* x y)
(if (<= t_0 2000.0) (/ -1.0 (- -1.0 y)) (- 1.0 (- 1.0 x)))))))double code(double x, double y) {
double t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0));
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = 1.0 - -x;
} else if (t_0 <= -0.5) {
tmp = x * y;
} else if (t_0 <= 2000.0) {
tmp = -1.0 / (-1.0 - y);
} else {
tmp = 1.0 - (1.0 - x);
}
return tmp;
}
public static double code(double x, double y) {
double t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0));
double tmp;
if (t_0 <= -Double.POSITIVE_INFINITY) {
tmp = 1.0 - -x;
} else if (t_0 <= -0.5) {
tmp = x * y;
} else if (t_0 <= 2000.0) {
tmp = -1.0 / (-1.0 - y);
} else {
tmp = 1.0 - (1.0 - x);
}
return tmp;
}
def code(x, y): t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0)) tmp = 0 if t_0 <= -math.inf: tmp = 1.0 - -x elif t_0 <= -0.5: tmp = x * y elif t_0 <= 2000.0: tmp = -1.0 / (-1.0 - y) else: tmp = 1.0 - (1.0 - x) return tmp
function code(x, y) t_0 = Float64(1.0 - Float64(Float64(Float64(1.0 - x) * y) / Float64(y + 1.0))) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = Float64(1.0 - Float64(-x)); elseif (t_0 <= -0.5) tmp = Float64(x * y); elseif (t_0 <= 2000.0) tmp = Float64(-1.0 / Float64(-1.0 - y)); else tmp = Float64(1.0 - Float64(1.0 - x)); end return tmp end
function tmp_2 = code(x, y) t_0 = 1.0 - (((1.0 - x) * y) / (y + 1.0)); tmp = 0.0; if (t_0 <= -Inf) tmp = 1.0 - -x; elseif (t_0 <= -0.5) tmp = x * y; elseif (t_0 <= 2000.0) tmp = -1.0 / (-1.0 - y); else tmp = 1.0 - (1.0 - x); 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]}, If[LessEqual[t$95$0, (-Infinity)], N[(1.0 - (-x)), $MachinePrecision], If[LessEqual[t$95$0, -0.5], N[(x * y), $MachinePrecision], If[LessEqual[t$95$0, 2000.0], N[(-1.0 / N[(-1.0 - y), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(1.0 - x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := 1 - \frac{\left(1 - x\right) \cdot y}{y + 1}\\
\mathbf{if}\;t\_0 \leq -\infty:\\
\;\;\;\;1 - \left(-x\right)\\
\mathbf{elif}\;t\_0 \leq -0.5:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;t\_0 \leq 2000:\\
\;\;\;\;\frac{-1}{-1 - y}\\
\mathbf{else}:\\
\;\;\;\;1 - \left(1 - x\right)\\
\end{array}
if (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < -inf.0Initial program 66.2%
Taylor expanded in y around inf
lower--.f6427.5%
Applied rewrites27.5%
Taylor expanded in x around inf
lower-*.f6449.6%
Applied rewrites49.6%
lift-*.f64N/A
metadata-evalN/A
distribute-lft-neg-outN/A
metadata-evalN/A
distribute-lft-neg-outN/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
*-rgt-identity49.6%
Applied rewrites49.6%
if -inf.0 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < -0.5Initial program 66.2%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6438.0%
Applied rewrites38.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6449.5%
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
lift--.f6449.5%
Applied rewrites49.5%
Taylor expanded in y around 0
lower-*.f6414.2%
Applied rewrites14.2%
if -0.5 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < 2e3Initial program 66.2%
Taylor expanded in x around 0
Applied rewrites40.8%
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
frac-2negN/A
distribute-neg-fracN/A
distribute-frac-neg2N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
*-lft-identityN/A
lift-+.f64N/A
+-commutativeN/A
associate--r+N/A
lower--.f64N/A
lower--.f64N/A
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
sub-negate-revN/A
lower--.f6441.2%
Applied rewrites41.2%
Taylor expanded in x around 0
Applied rewrites52.0%
if 2e3 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) Initial program 66.2%
Taylor expanded in y around inf
lower--.f6427.5%
Applied rewrites27.5%
(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 (- INFINITY))
t_1
(if (<= t_0 0.01) (* x y) (if (<= t_0 2000.0) (- 1.0 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 - -x;
double tmp;
if (t_0 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_0 <= 0.01) {
tmp = x * y;
} else if (t_0 <= 2000.0) {
tmp = 1.0 - y;
} else {
tmp = t_1;
}
return tmp;
}
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 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_0 <= 0.01) {
tmp = x * y;
} else if (t_0 <= 2000.0) {
tmp = 1.0 - 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 - -x tmp = 0 if t_0 <= -math.inf: tmp = t_1 elif t_0 <= 0.01: tmp = x * y elif t_0 <= 2000.0: tmp = 1.0 - 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(-x)) tmp = 0.0 if (t_0 <= Float64(-Inf)) tmp = t_1; elseif (t_0 <= 0.01) tmp = Float64(x * y); elseif (t_0 <= 2000.0) tmp = Float64(1.0 - 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 - -x; tmp = 0.0; if (t_0 <= -Inf) tmp = t_1; elseif (t_0 <= 0.01) tmp = x * y; elseif (t_0 <= 2000.0) tmp = 1.0 - 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 - (-x)), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], t$95$1, If[LessEqual[t$95$0, 0.01], N[(x * y), $MachinePrecision], If[LessEqual[t$95$0, 2000.0], N[(1.0 - y), $MachinePrecision], t$95$1]]]]]
\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 -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 0.01:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;t\_0 \leq 2000:\\
\;\;\;\;1 - y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < -inf.0 or 2e3 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) Initial program 66.2%
Taylor expanded in y around inf
lower--.f6427.5%
Applied rewrites27.5%
Taylor expanded in x around inf
lower-*.f6449.6%
Applied rewrites49.6%
lift-*.f64N/A
metadata-evalN/A
distribute-lft-neg-outN/A
metadata-evalN/A
distribute-lft-neg-outN/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
*-rgt-identity49.6%
Applied rewrites49.6%
if -inf.0 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < 0.01Initial program 66.2%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6438.0%
Applied rewrites38.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6449.5%
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
lift--.f6449.5%
Applied rewrites49.5%
Taylor expanded in y around 0
lower-*.f6414.2%
Applied rewrites14.2%
if 0.01 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < 2e3Initial program 66.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f6451.2%
Applied rewrites51.2%
Taylor expanded in x around 0
Applied rewrites39.5%
(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 0.01) t_1 (if (<= t_0 2000.0) (- 1.0 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 - (1.0 - x);
double tmp;
if (t_0 <= 0.01) {
tmp = t_1;
} else if (t_0 <= 2000.0) {
tmp = 1.0 - 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 - (1.0d0 - x)
if (t_0 <= 0.01d0) then
tmp = t_1
else if (t_0 <= 2000.0d0) then
tmp = 1.0d0 - 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 - (1.0 - x);
double tmp;
if (t_0 <= 0.01) {
tmp = t_1;
} else if (t_0 <= 2000.0) {
tmp = 1.0 - 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 - (1.0 - x) tmp = 0 if t_0 <= 0.01: tmp = t_1 elif t_0 <= 2000.0: tmp = 1.0 - 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(1.0 - x)) tmp = 0.0 if (t_0 <= 0.01) tmp = t_1; elseif (t_0 <= 2000.0) tmp = Float64(1.0 - 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 - (1.0 - x); tmp = 0.0; if (t_0 <= 0.01) tmp = t_1; elseif (t_0 <= 2000.0) tmp = 1.0 - 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[(1.0 - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 0.01], t$95$1, If[LessEqual[t$95$0, 2000.0], N[(1.0 - y), $MachinePrecision], t$95$1]]]]
\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 0.01:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 2000:\\
\;\;\;\;1 - y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < 0.01 or 2e3 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) Initial program 66.2%
Taylor expanded in y around inf
lower--.f6427.5%
Applied rewrites27.5%
if 0.01 < (-.f64 #s(literal 1 binary64) (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64)))) < 2e3Initial program 66.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f6451.2%
Applied rewrites51.2%
Taylor expanded in x around 0
Applied rewrites39.5%
(FPCore (x y) :precision binary64 (let* ((t_0 (/ (* (- 1.0 x) y) (+ y 1.0)))) (if (<= t_0 -500.0) (* x y) (if (<= t_0 0.05) (- 1.0 y) (* x y)))))
double code(double x, double y) {
double t_0 = ((1.0 - x) * y) / (y + 1.0);
double tmp;
if (t_0 <= -500.0) {
tmp = x * y;
} else if (t_0 <= 0.05) {
tmp = 1.0 - y;
} 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) :: t_0
real(8) :: tmp
t_0 = ((1.0d0 - x) * y) / (y + 1.0d0)
if (t_0 <= (-500.0d0)) then
tmp = x * y
else if (t_0 <= 0.05d0) then
tmp = 1.0d0 - y
else
tmp = x * y
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 <= -500.0) {
tmp = x * y;
} else if (t_0 <= 0.05) {
tmp = 1.0 - y;
} else {
tmp = x * y;
}
return tmp;
}
def code(x, y): t_0 = ((1.0 - x) * y) / (y + 1.0) tmp = 0 if t_0 <= -500.0: tmp = x * y elif t_0 <= 0.05: tmp = 1.0 - y else: tmp = x * y 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 <= -500.0) tmp = Float64(x * y); elseif (t_0 <= 0.05) tmp = Float64(1.0 - y); else tmp = Float64(x * y); 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 <= -500.0) tmp = x * y; elseif (t_0 <= 0.05) tmp = 1.0 - y; else tmp = x * y; 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, -500.0], N[(x * y), $MachinePrecision], If[LessEqual[t$95$0, 0.05], N[(1.0 - y), $MachinePrecision], N[(x * y), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{\left(1 - x\right) \cdot y}{y + 1}\\
\mathbf{if}\;t\_0 \leq -500:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;t\_0 \leq 0.05:\\
\;\;\;\;1 - y\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
if (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < -500 or 0.050000000000000003 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) Initial program 66.2%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6438.0%
Applied rewrites38.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6449.5%
lift-+.f64N/A
add-flipN/A
metadata-evalN/A
lift--.f6449.5%
Applied rewrites49.5%
Taylor expanded in y around 0
lower-*.f6414.2%
Applied rewrites14.2%
if -500 < (/.f64 (*.f64 (-.f64 #s(literal 1 binary64) x) y) (+.f64 y #s(literal 1 binary64))) < 0.050000000000000003Initial program 66.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f6451.2%
Applied rewrites51.2%
Taylor expanded in x around 0
Applied rewrites39.5%
(FPCore (x y) :precision binary64 (- 1.0 y))
double code(double x, double y) {
return 1.0 - y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
code = 1.0d0 - y
end function
public static double code(double x, double y) {
return 1.0 - y;
}
def code(x, y): return 1.0 - y
function code(x, y) return Float64(1.0 - y) end
function tmp = code(x, y) tmp = 1.0 - y; end
code[x_, y_] := N[(1.0 - y), $MachinePrecision]
1 - y
Initial program 66.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f6451.2%
Applied rewrites51.2%
Taylor expanded in x around 0
Applied rewrites39.5%
herbie shell --seed 2025205
(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))))