
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
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, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
}
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, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))) (t_2 (* (- a 0.5) b)))
(if (<= t_2 -5e+136)
(+ x (+ y t_1))
(if (<= t_2 1e+224)
(+ (- (+ (+ x y) z) (* z (log t))) (* -0.5 b))
(* b (* (+ 1.0 (+ (/ x t_1) (/ y t_1))) (- a 0.5)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = (a - 0.5) * b;
double tmp;
if (t_2 <= -5e+136) {
tmp = x + (y + t_1);
} else if (t_2 <= 1e+224) {
tmp = (((x + y) + z) - (z * log(t))) + (-0.5 * b);
} else {
tmp = b * ((1.0 + ((x / t_1) + (y / t_1))) * (a - 0.5));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = b * (a - 0.5d0)
t_2 = (a - 0.5d0) * b
if (t_2 <= (-5d+136)) then
tmp = x + (y + t_1)
else if (t_2 <= 1d+224) then
tmp = (((x + y) + z) - (z * log(t))) + ((-0.5d0) * b)
else
tmp = b * ((1.0d0 + ((x / t_1) + (y / t_1))) * (a - 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = (a - 0.5) * b;
double tmp;
if (t_2 <= -5e+136) {
tmp = x + (y + t_1);
} else if (t_2 <= 1e+224) {
tmp = (((x + y) + z) - (z * Math.log(t))) + (-0.5 * b);
} else {
tmp = b * ((1.0 + ((x / t_1) + (y / t_1))) * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) t_2 = (a - 0.5) * b tmp = 0 if t_2 <= -5e+136: tmp = x + (y + t_1) elif t_2 <= 1e+224: tmp = (((x + y) + z) - (z * math.log(t))) + (-0.5 * b) else: tmp = b * ((1.0 + ((x / t_1) + (y / t_1))) * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) t_2 = Float64(Float64(a - 0.5) * b) tmp = 0.0 if (t_2 <= -5e+136) tmp = Float64(x + Float64(y + t_1)); elseif (t_2 <= 1e+224) tmp = Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(-0.5 * b)); else tmp = Float64(b * Float64(Float64(1.0 + Float64(Float64(x / t_1) + Float64(y / t_1))) * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); t_2 = (a - 0.5) * b; tmp = 0.0; if (t_2 <= -5e+136) tmp = x + (y + t_1); elseif (t_2 <= 1e+224) tmp = (((x + y) + z) - (z * log(t))) + (-0.5 * b); else tmp = b * ((1.0 + ((x / t_1) + (y / t_1))) * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+136], N[(x + N[(y + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+224], N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision], N[(b * N[(N[(1.0 + N[(N[(x / t$95$1), $MachinePrecision] + N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
t_2 := \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+136}:\\
\;\;\;\;x + \left(y + t\_1\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+224}:\\
\;\;\;\;\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + -0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(\left(1 + \left(\frac{x}{t\_1} + \frac{y}{t\_1}\right)\right) \cdot \left(a - 0.5\right)\right)\\
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -5.0000000000000002e136Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6479.0%
Applied rewrites79.0%
if -5.0000000000000002e136 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 9.9999999999999997e223Initial program 99.8%
Taylor expanded in a around 0
Applied rewrites75.0%
if 9.9999999999999997e223 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
sub-flip-reverseN/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites83.0%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6462.2%
Applied rewrites62.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.9e+196)
(+ (* z (- 1.0 (log t))) (* (- a 0.5) b))
(if (<= z 1.16e+84)
(+ (fmin x y) (+ (fmax x y) (* b (- a 0.5))))
(+ (- (+ (fmin x y) z) (* z (log t))) (* -0.5 b)))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.9e+196) {
tmp = (z * (1.0 - log(t))) + ((a - 0.5) * b);
} else if (z <= 1.16e+84) {
tmp = fmin(x, y) + (fmax(x, y) + (b * (a - 0.5)));
} else {
tmp = ((fmin(x, y) + z) - (z * log(t))) + (-0.5 * b);
}
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, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.9d+196)) then
tmp = (z * (1.0d0 - log(t))) + ((a - 0.5d0) * b)
else if (z <= 1.16d+84) then
tmp = fmin(x, y) + (fmax(x, y) + (b * (a - 0.5d0)))
else
tmp = ((fmin(x, y) + z) - (z * log(t))) + ((-0.5d0) * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.9e+196) {
tmp = (z * (1.0 - Math.log(t))) + ((a - 0.5) * b);
} else if (z <= 1.16e+84) {
tmp = fmin(x, y) + (fmax(x, y) + (b * (a - 0.5)));
} else {
tmp = ((fmin(x, y) + z) - (z * Math.log(t))) + (-0.5 * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.9e+196: tmp = (z * (1.0 - math.log(t))) + ((a - 0.5) * b) elif z <= 1.16e+84: tmp = fmin(x, y) + (fmax(x, y) + (b * (a - 0.5))) else: tmp = ((fmin(x, y) + z) - (z * math.log(t))) + (-0.5 * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.9e+196) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(Float64(a - 0.5) * b)); elseif (z <= 1.16e+84) tmp = Float64(fmin(x, y) + Float64(fmax(x, y) + Float64(b * Float64(a - 0.5)))); else tmp = Float64(Float64(Float64(fmin(x, y) + z) - Float64(z * log(t))) + Float64(-0.5 * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.9e+196) tmp = (z * (1.0 - log(t))) + ((a - 0.5) * b); elseif (z <= 1.16e+84) tmp = min(x, y) + (max(x, y) + (b * (a - 0.5))); else tmp = ((min(x, y) + z) - (z * log(t))) + (-0.5 * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.9e+196], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.16e+84], N[(N[Min[x, y], $MachinePrecision] + N[(N[Max[x, y], $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Min[x, y], $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+196}:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + \left(a - 0.5\right) \cdot b\\
\mathbf{elif}\;z \leq 1.16 \cdot 10^{+84}:\\
\;\;\;\;\mathsf{min}\left(x, y\right) + \left(\mathsf{max}\left(x, y\right) + b \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\mathsf{min}\left(x, y\right) + z\right) - z \cdot \log t\right) + -0.5 \cdot b\\
\end{array}
if z < -1.9000000000000001e196Initial program 99.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-log.f6458.4%
Applied rewrites58.4%
if -1.9000000000000001e196 < z < 1.16e84Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6479.0%
Applied rewrites79.0%
if 1.16e84 < z Initial program 99.8%
Taylor expanded in a around 0
Applied rewrites75.0%
Taylor expanded in y around 0
lower-+.f6454.0%
Applied rewrites54.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* z (- 1.0 (log t))) (* (- a 0.5) b))))
(if (<= z -1.9e+196)
t_1
(if (<= z 7.4e+86) (+ x (+ y (* b (- a 0.5)))) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * (1.0 - log(t))) + ((a - 0.5) * b);
double tmp;
if (z <= -1.9e+196) {
tmp = t_1;
} else if (z <= 7.4e+86) {
tmp = x + (y + (b * (a - 0.5)));
} 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, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z * (1.0d0 - log(t))) + ((a - 0.5d0) * b)
if (z <= (-1.9d+196)) then
tmp = t_1
else if (z <= 7.4d+86) then
tmp = x + (y + (b * (a - 0.5d0)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * (1.0 - Math.log(t))) + ((a - 0.5) * b);
double tmp;
if (z <= -1.9e+196) {
tmp = t_1;
} else if (z <= 7.4e+86) {
tmp = x + (y + (b * (a - 0.5)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * (1.0 - math.log(t))) + ((a - 0.5) * b) tmp = 0 if z <= -1.9e+196: tmp = t_1 elif z <= 7.4e+86: tmp = x + (y + (b * (a - 0.5))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(Float64(a - 0.5) * b)) tmp = 0.0 if (z <= -1.9e+196) tmp = t_1; elseif (z <= 7.4e+86) tmp = Float64(x + Float64(y + Float64(b * Float64(a - 0.5)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * (1.0 - log(t))) + ((a - 0.5) * b); tmp = 0.0; if (z <= -1.9e+196) tmp = t_1; elseif (z <= 7.4e+86) tmp = x + (y + (b * (a - 0.5))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.9e+196], t$95$1, If[LessEqual[z, 7.4e+86], N[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right) + \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{+196}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{+86}:\\
\;\;\;\;x + \left(y + b \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.9000000000000001e196 or 7.3999999999999998e86 < z Initial program 99.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-log.f6458.4%
Applied rewrites58.4%
if -1.9000000000000001e196 < z < 7.3999999999999998e86Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6479.0%
Applied rewrites79.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- 1.0 (log t)) z)))
(if (<= z -1.9e+196)
t_1
(if (<= z 7.4e+86) (+ x (+ y (* b (- a 0.5)))) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 - log(t)) * z;
double tmp;
if (z <= -1.9e+196) {
tmp = t_1;
} else if (z <= 7.4e+86) {
tmp = x + (y + (b * (a - 0.5)));
} 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, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (1.0d0 - log(t)) * z
if (z <= (-1.9d+196)) then
tmp = t_1
else if (z <= 7.4d+86) then
tmp = x + (y + (b * (a - 0.5d0)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 - Math.log(t)) * z;
double tmp;
if (z <= -1.9e+196) {
tmp = t_1;
} else if (z <= 7.4e+86) {
tmp = x + (y + (b * (a - 0.5)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (1.0 - math.log(t)) * z tmp = 0 if z <= -1.9e+196: tmp = t_1 elif z <= 7.4e+86: tmp = x + (y + (b * (a - 0.5))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(1.0 - log(t)) * z) tmp = 0.0 if (z <= -1.9e+196) tmp = t_1; elseif (z <= 7.4e+86) tmp = Float64(x + Float64(y + Float64(b * Float64(a - 0.5)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (1.0 - log(t)) * z; tmp = 0.0; if (z <= -1.9e+196) tmp = t_1; elseif (z <= 7.4e+86) tmp = x + (y + (b * (a - 0.5))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -1.9e+196], t$95$1, If[LessEqual[z, 7.4e+86], N[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(1 - \log t\right) \cdot z\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{+196}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{+86}:\\
\;\;\;\;x + \left(y + b \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.9000000000000001e196 or 7.3999999999999998e86 < z Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6479.0%
Applied rewrites79.0%
Taylor expanded in z around -inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6422.0%
Applied rewrites22.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.0%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity22.0%
Applied rewrites22.0%
if -1.9000000000000001e196 < z < 7.3999999999999998e86Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6479.0%
Applied rewrites79.0%
(FPCore (x y z t a b) :precision binary64 (+ x (+ y (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
return x + (y + (b * (a - 0.5)));
}
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, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x + (y + (b * (a - 0.5d0)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + (y + (b * (a - 0.5)));
}
def code(x, y, z, t, a, b): return x + (y + (b * (a - 0.5)))
function code(x, y, z, t, a, b) return Float64(x + Float64(y + Float64(b * Float64(a - 0.5)))) end
function tmp = code(x, y, z, t, a, b) tmp = x + (y + (b * (a - 0.5))); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \left(y + b \cdot \left(a - 0.5\right)\right)
Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6479.0%
Applied rewrites79.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= (- (+ (+ (fmin x y) (fmax x y)) z) (* z (log t))) -5e-117)
(+ (fmin x y) t_1)
(+ (fmax x y) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((((fmin(x, y) + fmax(x, y)) + z) - (z * log(t))) <= -5e-117) {
tmp = fmin(x, y) + t_1;
} else {
tmp = fmax(x, y) + 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, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((((fmin(x, y) + fmax(x, y)) + z) - (z * log(t))) <= (-5d-117)) then
tmp = fmin(x, y) + t_1
else
tmp = fmax(x, y) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((((fmin(x, y) + fmax(x, y)) + z) - (z * Math.log(t))) <= -5e-117) {
tmp = fmin(x, y) + t_1;
} else {
tmp = fmax(x, y) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (((fmin(x, y) + fmax(x, y)) + z) - (z * math.log(t))) <= -5e-117: tmp = fmin(x, y) + t_1 else: tmp = fmax(x, y) + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (Float64(Float64(Float64(fmin(x, y) + fmax(x, y)) + z) - Float64(z * log(t))) <= -5e-117) tmp = Float64(fmin(x, y) + t_1); else tmp = Float64(fmax(x, y) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((((min(x, y) + max(x, y)) + z) - (z * log(t))) <= -5e-117) tmp = min(x, y) + t_1; else tmp = max(x, y) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[Min[x, y], $MachinePrecision] + N[Max[x, y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-117], N[(N[Min[x, y], $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[Max[x, y], $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;\left(\left(\mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\right) + z\right) - z \cdot \log t \leq -5 \cdot 10^{-117}:\\
\;\;\;\;\mathsf{min}\left(x, y\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x, y\right) + t\_1\\
\end{array}
if (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) < -5e-117Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6479.0%
Applied rewrites79.0%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f6458.1%
Applied rewrites58.1%
if -5e-117 < (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6479.0%
Applied rewrites79.0%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f6458.8%
Applied rewrites58.8%
(FPCore (x y z t a b) :precision binary64 (if (<= (- (+ (+ (fmin x y) (fmax x y)) z) (* z (log t))) -1e+153) (* 1.0 (fmin x y)) (+ (fmax x y) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((((fmin(x, y) + fmax(x, y)) + z) - (z * log(t))) <= -1e+153) {
tmp = 1.0 * fmin(x, y);
} else {
tmp = fmax(x, y) + (b * (a - 0.5));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((((fmin(x, y) + fmax(x, y)) + z) - (z * log(t))) <= (-1d+153)) then
tmp = 1.0d0 * fmin(x, y)
else
tmp = fmax(x, y) + (b * (a - 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((((fmin(x, y) + fmax(x, y)) + z) - (z * Math.log(t))) <= -1e+153) {
tmp = 1.0 * fmin(x, y);
} else {
tmp = fmax(x, y) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (((fmin(x, y) + fmax(x, y)) + z) - (z * math.log(t))) <= -1e+153: tmp = 1.0 * fmin(x, y) else: tmp = fmax(x, y) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(Float64(fmin(x, y) + fmax(x, y)) + z) - Float64(z * log(t))) <= -1e+153) tmp = Float64(1.0 * fmin(x, y)); else tmp = Float64(fmax(x, y) + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((((min(x, y) + max(x, y)) + z) - (z * log(t))) <= -1e+153) tmp = 1.0 * min(x, y); else tmp = max(x, y) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(N[Min[x, y], $MachinePrecision] + N[Max[x, y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e+153], N[(1.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision], N[(N[Max[x, y], $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\right) + z\right) - z \cdot \log t \leq -1 \cdot 10^{+153}:\\
\;\;\;\;1 \cdot \mathsf{min}\left(x, y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x, y\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
if (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) < -1e153Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6479.0%
Applied rewrites79.0%
lift-+.f64N/A
add-flipN/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites63.7%
Taylor expanded in x around inf
Applied rewrites21.7%
if -1e153 < (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6479.0%
Applied rewrites79.0%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f6458.8%
Applied rewrites58.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (fmin x y) (fmax x y))))
(if (<= t_1 -5e+152)
(* 1.0 (fmin x y))
(if (<= t_1 2e+102) (* b (- a 0.5)) (+ (fmax x y) (* b -0.5))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fmin(x, y) + fmax(x, y);
double tmp;
if (t_1 <= -5e+152) {
tmp = 1.0 * fmin(x, y);
} else if (t_1 <= 2e+102) {
tmp = b * (a - 0.5);
} else {
tmp = fmax(x, y) + (b * -0.5);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = fmin(x, y) + fmax(x, y)
if (t_1 <= (-5d+152)) then
tmp = 1.0d0 * fmin(x, y)
else if (t_1 <= 2d+102) then
tmp = b * (a - 0.5d0)
else
tmp = fmax(x, y) + (b * (-0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fmin(x, y) + fmax(x, y);
double tmp;
if (t_1 <= -5e+152) {
tmp = 1.0 * fmin(x, y);
} else if (t_1 <= 2e+102) {
tmp = b * (a - 0.5);
} else {
tmp = fmax(x, y) + (b * -0.5);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = fmin(x, y) + fmax(x, y) tmp = 0 if t_1 <= -5e+152: tmp = 1.0 * fmin(x, y) elif t_1 <= 2e+102: tmp = b * (a - 0.5) else: tmp = fmax(x, y) + (b * -0.5) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(fmin(x, y) + fmax(x, y)) tmp = 0.0 if (t_1 <= -5e+152) tmp = Float64(1.0 * fmin(x, y)); elseif (t_1 <= 2e+102) tmp = Float64(b * Float64(a - 0.5)); else tmp = Float64(fmax(x, y) + Float64(b * -0.5)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = min(x, y) + max(x, y); tmp = 0.0; if (t_1 <= -5e+152) tmp = 1.0 * min(x, y); elseif (t_1 <= 2e+102) tmp = b * (a - 0.5); else tmp = max(x, y) + (b * -0.5); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Min[x, y], $MachinePrecision] + N[Max[x, y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+152], N[(1.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+102], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(N[Max[x, y], $MachinePrecision] + N[(b * -0.5), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+152}:\\
\;\;\;\;1 \cdot \mathsf{min}\left(x, y\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+102}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(x, y\right) + b \cdot -0.5\\
\end{array}
if (+.f64 x y) < -5e152Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6479.0%
Applied rewrites79.0%
lift-+.f64N/A
add-flipN/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites63.7%
Taylor expanded in x around inf
Applied rewrites21.7%
if -5e152 < (+.f64 x y) < 2e102Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6479.0%
Applied rewrites79.0%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f6458.8%
Applied rewrites58.8%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f6438.3%
Applied rewrites38.3%
if 2e102 < (+.f64 x y) Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6479.0%
Applied rewrites79.0%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f6458.8%
Applied rewrites58.8%
Taylor expanded in a around 0
Applied rewrites34.4%
(FPCore (x y z t a b) :precision binary64 (if (<= (- (+ (+ (fmin x y) (fmax x y)) z) (* z (log t))) -1e+153) (* 1.0 (fmin x y)) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((((fmin(x, y) + fmax(x, y)) + z) - (z * log(t))) <= -1e+153) {
tmp = 1.0 * fmin(x, y);
} else {
tmp = b * (a - 0.5);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((((fmin(x, y) + fmax(x, y)) + z) - (z * log(t))) <= (-1d+153)) then
tmp = 1.0d0 * fmin(x, y)
else
tmp = b * (a - 0.5d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((((fmin(x, y) + fmax(x, y)) + z) - (z * Math.log(t))) <= -1e+153) {
tmp = 1.0 * fmin(x, y);
} else {
tmp = b * (a - 0.5);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (((fmin(x, y) + fmax(x, y)) + z) - (z * math.log(t))) <= -1e+153: tmp = 1.0 * fmin(x, y) else: tmp = b * (a - 0.5) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(Float64(fmin(x, y) + fmax(x, y)) + z) - Float64(z * log(t))) <= -1e+153) tmp = Float64(1.0 * fmin(x, y)); else tmp = Float64(b * Float64(a - 0.5)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((((min(x, y) + max(x, y)) + z) - (z * log(t))) <= -1e+153) tmp = 1.0 * min(x, y); else tmp = b * (a - 0.5); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(N[Min[x, y], $MachinePrecision] + N[Max[x, y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e+153], N[(1.0 * N[Min[x, y], $MachinePrecision]), $MachinePrecision], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\left(\left(\mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\right) + z\right) - z \cdot \log t \leq -1 \cdot 10^{+153}:\\
\;\;\;\;1 \cdot \mathsf{min}\left(x, y\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\end{array}
if (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) < -1e153Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6479.0%
Applied rewrites79.0%
lift-+.f64N/A
add-flipN/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites63.7%
Taylor expanded in x around inf
Applied rewrites21.7%
if -1e153 < (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6479.0%
Applied rewrites79.0%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f6458.8%
Applied rewrites58.8%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f6438.3%
Applied rewrites38.3%
(FPCore (x y z t a b) :precision binary64 (* 1.0 x))
double code(double x, double y, double z, double t, double a, double b) {
return 1.0 * x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return 1.0 * x;
}
def code(x, y, z, t, a, b): return 1.0 * x
function code(x, y, z, t, a, b) return Float64(1.0 * x) end
function tmp = code(x, y, z, t, a, b) tmp = 1.0 * x; end
code[x_, y_, z_, t_, a_, b_] := N[(1.0 * x), $MachinePrecision]
1 \cdot x
Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6479.0%
Applied rewrites79.0%
lift-+.f64N/A
add-flipN/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites63.7%
Taylor expanded in x around inf
Applied rewrites21.7%
herbie shell --seed 2025258
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))