
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 1/2) 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 - 1/2), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\right) \cdot b
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 1/2) 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 - 1/2), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - \frac{1}{2}\right) \cdot b
(FPCore (x y z t a b) :precision binary64 (- (+ (+ (* b (- a 1/2)) y) x) (- (* (log t) z) z)))
double code(double x, double y, double z, double t, double a, double b) {
return (((b * (a - 0.5)) + y) + x) - ((log(t) * z) - z);
}
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 = (((b * (a - 0.5d0)) + y) + x) - ((log(t) * z) - z)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((b * (a - 0.5)) + y) + x) - ((Math.log(t) * z) - z);
}
def code(x, y, z, t, a, b): return (((b * (a - 0.5)) + y) + x) - ((math.log(t) * z) - z)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(b * Float64(a - 0.5)) + y) + x) - Float64(Float64(log(t) * z) - z)) end
function tmp = code(x, y, z, t, a, b) tmp = (((b * (a - 0.5)) + y) + x) - ((log(t) * z) - z); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(b * N[(a - 1/2), $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision] + x), $MachinePrecision] - N[(N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]
\left(\left(b \cdot \left(a - \frac{1}{2}\right) + y\right) + x\right) - \left(\log t \cdot z - z\right)
Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
associate-+r+N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
lower-+.f64N/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6499.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8%
Applied rewrites99.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 1/2))))
(if (<=
a
-50000000000000001178468375708512791662476639752844093156495626963414083423308086629915468079622475513115705344)
(- (+ x (+ z (* a b))) (* z (log t)))
(if (<=
a
9200000000000000143146628391094955823267452851673765187001889339963670786715752470037865587218436518621097783984128)
(- (+ (+ (* b -1/2) y) x) (- (* (log t) z) z))
(* (- 1 (/ (- (- (* -1 x) z) y) t_1)) 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 (a <= -5e+109) {
tmp = (x + (z + (a * b))) - (z * log(t));
} else if (a <= 9.2e+114) {
tmp = (((b * -0.5) + y) + x) - ((log(t) * z) - z);
} else {
tmp = (1.0 - ((((-1.0 * x) - z) - y) / t_1)) * 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 (a <= (-5d+109)) then
tmp = (x + (z + (a * b))) - (z * log(t))
else if (a <= 9.2d+114) then
tmp = (((b * (-0.5d0)) + y) + x) - ((log(t) * z) - z)
else
tmp = (1.0d0 - (((((-1.0d0) * x) - z) - y) / t_1)) * 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 (a <= -5e+109) {
tmp = (x + (z + (a * b))) - (z * Math.log(t));
} else if (a <= 9.2e+114) {
tmp = (((b * -0.5) + y) + x) - ((Math.log(t) * z) - z);
} else {
tmp = (1.0 - ((((-1.0 * x) - z) - y) / t_1)) * t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if a <= -5e+109: tmp = (x + (z + (a * b))) - (z * math.log(t)) elif a <= 9.2e+114: tmp = (((b * -0.5) + y) + x) - ((math.log(t) * z) - z) else: tmp = (1.0 - ((((-1.0 * x) - z) - y) / t_1)) * t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (a <= -5e+109) tmp = Float64(Float64(x + Float64(z + Float64(a * b))) - Float64(z * log(t))); elseif (a <= 9.2e+114) tmp = Float64(Float64(Float64(Float64(b * -0.5) + y) + x) - Float64(Float64(log(t) * z) - z)); else tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(-1.0 * x) - z) - y) / t_1)) * 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 (a <= -5e+109) tmp = (x + (z + (a * b))) - (z * log(t)); elseif (a <= 9.2e+114) tmp = (((b * -0.5) + y) + x) - ((log(t) * z) - z); else tmp = (1.0 - ((((-1.0 * x) - z) - y) / t_1)) * t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 1/2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -50000000000000001178468375708512791662476639752844093156495626963414083423308086629915468079622475513115705344], N[(N[(x + N[(z + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9200000000000000143146628391094955823267452851673765187001889339963670786715752470037865587218436518621097783984128], N[(N[(N[(N[(b * -1/2), $MachinePrecision] + y), $MachinePrecision] + x), $MachinePrecision] - N[(N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[(N[(1 - N[(N[(N[(N[(-1 * x), $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]
\begin{array}{l}
t_1 := b \cdot \left(a - \frac{1}{2}\right)\\
\mathbf{if}\;a \leq -50000000000000001178468375708512791662476639752844093156495626963414083423308086629915468079622475513115705344:\\
\;\;\;\;\left(x + \left(z + a \cdot b\right)\right) - z \cdot \log t\\
\mathbf{elif}\;a \leq 9200000000000000143146628391094955823267452851673765187001889339963670786715752470037865587218436518621097783984128:\\
\;\;\;\;\left(\left(b \cdot \frac{-1}{2} + y\right) + x\right) - \left(\log t \cdot z - z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{\left(-1 \cdot x - z\right) - y}{t\_1}\right) \cdot t\_1\\
\end{array}
if a < -5.0000000000000001e109Initial program 99.8%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6479.0%
Applied rewrites79.0%
Taylor expanded in a around inf
lower-*.f6466.5%
Applied rewrites66.5%
if -5.0000000000000001e109 < a < 9.2000000000000001e114Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
associate-+r+N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
lower-+.f64N/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6499.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8%
Applied rewrites99.8%
Taylor expanded in a around 0
Applied rewrites74.9%
if 9.2000000000000001e114 < a 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.8%
Taylor expanded in x around inf
lower-*.f6468.4%
Applied rewrites68.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (log t))) (t_2 (* b (- a 1/2))))
(if (<=
a
-50000000000000001178468375708512791662476639752844093156495626963414083423308086629915468079622475513115705344)
(- (+ x (+ z (* a b))) t_1)
(if (<=
a
9200000000000000143146628391094955823267452851673765187001889339963670786715752470037865587218436518621097783984128)
(+ (- (+ (+ x y) z) t_1) (* -1/2 b))
(* (- 1 (/ (- (- (* -1 x) z) y) t_2)) t_2)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * log(t);
double t_2 = b * (a - 0.5);
double tmp;
if (a <= -5e+109) {
tmp = (x + (z + (a * b))) - t_1;
} else if (a <= 9.2e+114) {
tmp = (((x + y) + z) - t_1) + (-0.5 * b);
} else {
tmp = (1.0 - ((((-1.0 * x) - z) - y) / t_2)) * t_2;
}
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 = z * log(t)
t_2 = b * (a - 0.5d0)
if (a <= (-5d+109)) then
tmp = (x + (z + (a * b))) - t_1
else if (a <= 9.2d+114) then
tmp = (((x + y) + z) - t_1) + ((-0.5d0) * b)
else
tmp = (1.0d0 - (((((-1.0d0) * x) - z) - y) / t_2)) * t_2
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 * Math.log(t);
double t_2 = b * (a - 0.5);
double tmp;
if (a <= -5e+109) {
tmp = (x + (z + (a * b))) - t_1;
} else if (a <= 9.2e+114) {
tmp = (((x + y) + z) - t_1) + (-0.5 * b);
} else {
tmp = (1.0 - ((((-1.0 * x) - z) - y) / t_2)) * t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * math.log(t) t_2 = b * (a - 0.5) tmp = 0 if a <= -5e+109: tmp = (x + (z + (a * b))) - t_1 elif a <= 9.2e+114: tmp = (((x + y) + z) - t_1) + (-0.5 * b) else: tmp = (1.0 - ((((-1.0 * x) - z) - y) / t_2)) * t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * log(t)) t_2 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (a <= -5e+109) tmp = Float64(Float64(x + Float64(z + Float64(a * b))) - t_1); elseif (a <= 9.2e+114) tmp = Float64(Float64(Float64(Float64(x + y) + z) - t_1) + Float64(-0.5 * b)); else tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(-1.0 * x) - z) - y) / t_2)) * t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * log(t); t_2 = b * (a - 0.5); tmp = 0.0; if (a <= -5e+109) tmp = (x + (z + (a * b))) - t_1; elseif (a <= 9.2e+114) tmp = (((x + y) + z) - t_1) + (-0.5 * b); else tmp = (1.0 - ((((-1.0 * x) - z) - y) / t_2)) * t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a - 1/2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -50000000000000001178468375708512791662476639752844093156495626963414083423308086629915468079622475513115705344], N[(N[(x + N[(z + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[a, 9200000000000000143146628391094955823267452851673765187001889339963670786715752470037865587218436518621097783984128], N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(-1/2 * b), $MachinePrecision]), $MachinePrecision], N[(N[(1 - N[(N[(N[(N[(-1 * x), $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := z \cdot \log t\\
t_2 := b \cdot \left(a - \frac{1}{2}\right)\\
\mathbf{if}\;a \leq -50000000000000001178468375708512791662476639752844093156495626963414083423308086629915468079622475513115705344:\\
\;\;\;\;\left(x + \left(z + a \cdot b\right)\right) - t\_1\\
\mathbf{elif}\;a \leq 9200000000000000143146628391094955823267452851673765187001889339963670786715752470037865587218436518621097783984128:\\
\;\;\;\;\left(\left(\left(x + y\right) + z\right) - t\_1\right) + \frac{-1}{2} \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{\left(-1 \cdot x - z\right) - y}{t\_2}\right) \cdot t\_2\\
\end{array}
if a < -5.0000000000000001e109Initial program 99.8%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6479.0%
Applied rewrites79.0%
Taylor expanded in a around inf
lower-*.f6466.5%
Applied rewrites66.5%
if -5.0000000000000001e109 < a < 9.2000000000000001e114Initial program 99.8%
Taylor expanded in a around 0
Applied rewrites74.9%
if 9.2000000000000001e114 < a 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.8%
Taylor expanded in x around inf
lower-*.f6468.4%
Applied rewrites68.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 1/2))) (t_2 (- (+ x (+ z t_1)) (* z (log t)))))
(if (<=
z
-47999999999999997570582494259552905614254960528643683508027392)
t_2
(if (<=
z
530000000000000025841683757015923606591138044939848103725756910541269096456075767165977247773001678082539520)
(+ x (+ y t_1))
t_2))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = (x + (z + t_1)) - (z * log(t));
double tmp;
if (z <= -4.8e+61) {
tmp = t_2;
} else if (z <= 5.3e+107) {
tmp = x + (y + t_1);
} else {
tmp = t_2;
}
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 = (x + (z + t_1)) - (z * log(t))
if (z <= (-4.8d+61)) then
tmp = t_2
else if (z <= 5.3d+107) then
tmp = x + (y + t_1)
else
tmp = t_2
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 = (x + (z + t_1)) - (z * Math.log(t));
double tmp;
if (z <= -4.8e+61) {
tmp = t_2;
} else if (z <= 5.3e+107) {
tmp = x + (y + t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) t_2 = (x + (z + t_1)) - (z * math.log(t)) tmp = 0 if z <= -4.8e+61: tmp = t_2 elif z <= 5.3e+107: tmp = x + (y + t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) t_2 = Float64(Float64(x + Float64(z + t_1)) - Float64(z * log(t))) tmp = 0.0 if (z <= -4.8e+61) tmp = t_2; elseif (z <= 5.3e+107) tmp = Float64(x + Float64(y + t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); t_2 = (x + (z + t_1)) - (z * log(t)); tmp = 0.0; if (z <= -4.8e+61) tmp = t_2; elseif (z <= 5.3e+107) tmp = x + (y + t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 1/2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -47999999999999997570582494259552905614254960528643683508027392], t$95$2, If[LessEqual[z, 530000000000000025841683757015923606591138044939848103725756910541269096456075767165977247773001678082539520], N[(x + N[(y + t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := b \cdot \left(a - \frac{1}{2}\right)\\
t_2 := \left(x + \left(z + t\_1\right)\right) - z \cdot \log t\\
\mathbf{if}\;z \leq -47999999999999997570582494259552905614254960528643683508027392:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 530000000000000025841683757015923606591138044939848103725756910541269096456075767165977247773001678082539520:\\
\;\;\;\;x + \left(y + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if z < -4.7999999999999998e61 or 5.3000000000000003e107 < z Initial program 99.8%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6479.0%
Applied rewrites79.0%
if -4.7999999999999998e61 < z < 5.3000000000000003e107Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6478.6%
Applied rewrites78.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 1/2))) (t_2 (* (- a 1/2) b)))
(if (<=
t_2
-99999999999999999475366575191804932315794610450682175621941694731908308538307845136842752)
(+ x (+ y t_1))
(if (<=
t_2
999999999999999926539781176481198923508803215199467887262646419780362305536)
(- (+ x y) (- (* (log t) z) z))
(* (- 1 (/ (- (- (* -1 x) z) y) t_1)) t_1)))))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 <= -1e+89) {
tmp = x + (y + t_1);
} else if (t_2 <= 1e+75) {
tmp = (x + y) - ((log(t) * z) - z);
} else {
tmp = (1.0 - ((((-1.0 * x) - z) - y) / t_1)) * 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) :: t_2
real(8) :: tmp
t_1 = b * (a - 0.5d0)
t_2 = (a - 0.5d0) * b
if (t_2 <= (-1d+89)) then
tmp = x + (y + t_1)
else if (t_2 <= 1d+75) then
tmp = (x + y) - ((log(t) * z) - z)
else
tmp = (1.0d0 - (((((-1.0d0) * x) - z) - y) / t_1)) * 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 t_2 = (a - 0.5) * b;
double tmp;
if (t_2 <= -1e+89) {
tmp = x + (y + t_1);
} else if (t_2 <= 1e+75) {
tmp = (x + y) - ((Math.log(t) * z) - z);
} else {
tmp = (1.0 - ((((-1.0 * x) - z) - y) / t_1)) * t_1;
}
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 <= -1e+89: tmp = x + (y + t_1) elif t_2 <= 1e+75: tmp = (x + y) - ((math.log(t) * z) - z) else: tmp = (1.0 - ((((-1.0 * x) - z) - y) / t_1)) * t_1 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 <= -1e+89) tmp = Float64(x + Float64(y + t_1)); elseif (t_2 <= 1e+75) tmp = Float64(Float64(x + y) - Float64(Float64(log(t) * z) - z)); else tmp = Float64(Float64(1.0 - Float64(Float64(Float64(Float64(-1.0 * x) - z) - y) / t_1)) * t_1); 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 <= -1e+89) tmp = x + (y + t_1); elseif (t_2 <= 1e+75) tmp = (x + y) - ((log(t) * z) - z); else tmp = (1.0 - ((((-1.0 * x) - z) - y) / t_1)) * t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 1/2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a - 1/2), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$2, -99999999999999999475366575191804932315794610450682175621941694731908308538307845136842752], N[(x + N[(y + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 999999999999999926539781176481198923508803215199467887262646419780362305536], N[(N[(x + y), $MachinePrecision] - N[(N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[(N[(1 - N[(N[(N[(N[(-1 * x), $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := b \cdot \left(a - \frac{1}{2}\right)\\
t_2 := \left(a - \frac{1}{2}\right) \cdot b\\
\mathbf{if}\;t\_2 \leq -99999999999999999475366575191804932315794610450682175621941694731908308538307845136842752:\\
\;\;\;\;x + \left(y + t\_1\right)\\
\mathbf{elif}\;t\_2 \leq 999999999999999926539781176481198923508803215199467887262646419780362305536:\\
\;\;\;\;\left(x + y\right) - \left(\log t \cdot z - z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{\left(-1 \cdot x - z\right) - y}{t\_1}\right) \cdot t\_1\\
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -9.9999999999999999e88Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6478.6%
Applied rewrites78.6%
if -9.9999999999999999e88 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 9.9999999999999993e74Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
associate-+r+N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
lower-+.f64N/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6499.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8%
Applied rewrites99.8%
Taylor expanded in b around 0
lower-+.f6462.5%
Applied rewrites62.5%
if 9.9999999999999993e74 < (*.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.8%
Taylor expanded in x around inf
lower-*.f6468.4%
Applied rewrites68.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ x z) (* z (log t)))))
(if (<=
z
-270000000000000015622925075568963669351667537923450883516024401736966650111093395320409595458887354758154385005401480468333727466637597396053093937668831995798258744623446317973831829352267460529618944)
t_1
(if (<=
z
250000000000000009429696323264137572935448428542751981167584144640888663471097611248404761559037397323268853527271847424913882895808728702689001407504731355782198298197770216730555199998000831152521216)
(+ x (+ y (* b (- a 1/2))))
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + z) - (z * log(t));
double tmp;
if (z <= -2.7e+200) {
tmp = t_1;
} else if (z <= 2.5e+200) {
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 = (x + z) - (z * log(t))
if (z <= (-2.7d+200)) then
tmp = t_1
else if (z <= 2.5d+200) 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 = (x + z) - (z * Math.log(t));
double tmp;
if (z <= -2.7e+200) {
tmp = t_1;
} else if (z <= 2.5e+200) {
tmp = x + (y + (b * (a - 0.5)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x + z) - (z * math.log(t)) tmp = 0 if z <= -2.7e+200: tmp = t_1 elif z <= 2.5e+200: 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(x + z) - Float64(z * log(t))) tmp = 0.0 if (z <= -2.7e+200) tmp = t_1; elseif (z <= 2.5e+200) 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 = (x + z) - (z * log(t)); tmp = 0.0; if (z <= -2.7e+200) tmp = t_1; elseif (z <= 2.5e+200) 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[(x + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -270000000000000015622925075568963669351667537923450883516024401736966650111093395320409595458887354758154385005401480468333727466637597396053093937668831995798258744623446317973831829352267460529618944], t$95$1, If[LessEqual[z, 250000000000000009429696323264137572935448428542751981167584144640888663471097611248404761559037397323268853527271847424913882895808728702689001407504731355782198298197770216730555199998000831152521216], N[(x + N[(y + N[(b * N[(a - 1/2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(x + z\right) - z \cdot \log t\\
\mathbf{if}\;z \leq -270000000000000015622925075568963669351667537923450883516024401736966650111093395320409595458887354758154385005401480468333727466637597396053093937668831995798258744623446317973831829352267460529618944:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 250000000000000009429696323264137572935448428542751981167584144640888663471097611248404761559037397323268853527271847424913882895808728702689001407504731355782198298197770216730555199998000831152521216:\\
\;\;\;\;x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.7000000000000002e200 or 2.5000000000000001e200 < z Initial program 99.8%
Taylor expanded in y around 0
lower--.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6479.0%
Applied rewrites79.0%
Taylor expanded in b around 0
lower-+.f6442.1%
Applied rewrites42.1%
if -2.7000000000000002e200 < z < 2.5000000000000001e200Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6478.6%
Applied rewrites78.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1 (log t)))))
(if (<=
z
-14800000000000000340041668154530370960108143406693656871263469168978465021262893298235095723292003076663484885930831787006057639849935408631631211522853648387464881343251087069825363803079055890480915257693493134001803791112036489850104400076772960255852348728305254400)
t_1
(if (<=
z
250000000000000009429696323264137572935448428542751981167584144640888663471097611248404761559037397323268853527271847424913882895808728702689001407504731355782198298197770216730555199998000831152521216)
(+ x (+ y (* b (- a 1/2))))
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - log(t));
double tmp;
if (z <= -1.48e+268) {
tmp = t_1;
} else if (z <= 2.5e+200) {
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))
if (z <= (-1.48d+268)) then
tmp = t_1
else if (z <= 2.5d+200) 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));
double tmp;
if (z <= -1.48e+268) {
tmp = t_1;
} else if (z <= 2.5e+200) {
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)) tmp = 0 if z <= -1.48e+268: tmp = t_1 elif z <= 2.5e+200: tmp = x + (y + (b * (a - 0.5))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(1.0 - log(t))) tmp = 0.0 if (z <= -1.48e+268) tmp = t_1; elseif (z <= 2.5e+200) 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)); tmp = 0.0; if (z <= -1.48e+268) tmp = t_1; elseif (z <= 2.5e+200) 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[(z * N[(1 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -14800000000000000340041668154530370960108143406693656871263469168978465021262893298235095723292003076663484885930831787006057639849935408631631211522853648387464881343251087069825363803079055890480915257693493134001803791112036489850104400076772960255852348728305254400], t$95$1, If[LessEqual[z, 250000000000000009429696323264137572935448428542751981167584144640888663471097611248404761559037397323268853527271847424913882895808728702689001407504731355782198298197770216730555199998000831152521216], N[(x + N[(y + N[(b * N[(a - 1/2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -14800000000000000340041668154530370960108143406693656871263469168978465021262893298235095723292003076663484885930831787006057639849935408631631211522853648387464881343251087069825363803079055890480915257693493134001803791112036489850104400076772960255852348728305254400:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 250000000000000009429696323264137572935448428542751981167584144640888663471097611248404761559037397323268853527271847424913882895808728702689001407504731355782198298197770216730555199998000831152521216:\\
\;\;\;\;x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.48e268 or 2.5000000000000001e200 < z Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
associate-+r+N/A
sub-negate-revN/A
sub-flip-reverseN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
lower-+.f64N/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f6499.8%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8%
Applied rewrites99.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-log.f6422.3%
Applied rewrites22.3%
if -1.48e268 < z < 2.5000000000000001e200Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6478.6%
Applied rewrites78.6%
(FPCore (x y z t a b) :precision binary64 (+ x (+ y (* b (- a 1/2)))))
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 - 1/2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \left(y + b \cdot \left(a - \frac{1}{2}\right)\right)
Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6478.6%
Applied rewrites78.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 1/2))))
(if (<=
(- (+ (+ (fmin x y) (fmax x y)) z) (* z (log t)))
-2206260905240795/44125218104815898389829825659447310364864904872680898823178155169729591099393726561029280015550468702670279148410687446533176513529349858556664892007608532912981188929417439383947376132698492620683708741856789536964608)
(+ (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-203) {
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-203)) 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-203) {
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-203: 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-203) 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-203) 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 - 1/2), $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], -2206260905240795/44125218104815898389829825659447310364864904872680898823178155169729591099393726561029280015550468702670279148410687446533176513529349858556664892007608532912981188929417439383947376132698492620683708741856789536964608], 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 - \frac{1}{2}\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 \frac{-2206260905240795}{44125218104815898389829825659447310364864904872680898823178155169729591099393726561029280015550468702670279148410687446533176513529349858556664892007608532912981188929417439383947376132698492620683708741856789536964608}:\\
\;\;\;\;\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))) < -5.0000000000000002e-203Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6478.6%
Applied rewrites78.6%
Taylor expanded in a around inf
lower-*.f6466.1%
Applied rewrites66.1%
Taylor expanded in y around 0
lower-*.f64N/A
lower--.f6458.3%
Applied rewrites58.3%
if -5.0000000000000002e-203 < (-.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--.f6478.6%
Applied rewrites78.6%
Taylor expanded in a around inf
lower-*.f6466.1%
Applied rewrites66.1%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f6458.2%
Applied rewrites58.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- a 1/2) b)) (t_2 (+ (fmax x y) (* b (- a 1/2)))))
(if (<=
t_1
-10000000000000000146306952306748730309700429878646550592786107871697963642511482159104)
t_2
(if (<= t_1 50000000000000004410680702653211320350932992)
(+ (fmin x y) (fmax x y))
t_2))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double t_2 = fmax(x, y) + (b * (a - 0.5));
double tmp;
if (t_1 <= -1e+85) {
tmp = t_2;
} else if (t_1 <= 5e+43) {
tmp = fmin(x, y) + fmax(x, y);
} else {
tmp = t_2;
}
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 = (a - 0.5d0) * b
t_2 = fmax(x, y) + (b * (a - 0.5d0))
if (t_1 <= (-1d+85)) then
tmp = t_2
else if (t_1 <= 5d+43) then
tmp = fmin(x, y) + fmax(x, y)
else
tmp = t_2
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 = (a - 0.5) * b;
double t_2 = fmax(x, y) + (b * (a - 0.5));
double tmp;
if (t_1 <= -1e+85) {
tmp = t_2;
} else if (t_1 <= 5e+43) {
tmp = fmin(x, y) + fmax(x, y);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - 0.5) * b t_2 = fmax(x, y) + (b * (a - 0.5)) tmp = 0 if t_1 <= -1e+85: tmp = t_2 elif t_1 <= 5e+43: tmp = fmin(x, y) + fmax(x, y) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) t_2 = Float64(fmax(x, y) + Float64(b * Float64(a - 0.5))) tmp = 0.0 if (t_1 <= -1e+85) tmp = t_2; elseif (t_1 <= 5e+43) tmp = Float64(fmin(x, y) + fmax(x, y)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a - 0.5) * b; t_2 = max(x, y) + (b * (a - 0.5)); tmp = 0.0; if (t_1 <= -1e+85) tmp = t_2; elseif (t_1 <= 5e+43) tmp = min(x, y) + max(x, y); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 1/2), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[Max[x, y], $MachinePrecision] + N[(b * N[(a - 1/2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -10000000000000000146306952306748730309700429878646550592786107871697963642511482159104], t$95$2, If[LessEqual[t$95$1, 50000000000000004410680702653211320350932992], N[(N[Min[x, y], $MachinePrecision] + N[Max[x, y], $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \left(a - \frac{1}{2}\right) \cdot b\\
t_2 := \mathsf{max}\left(x, y\right) + b \cdot \left(a - \frac{1}{2}\right)\\
\mathbf{if}\;t\_1 \leq -10000000000000000146306952306748730309700429878646550592786107871697963642511482159104:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 50000000000000004410680702653211320350932992:\\
\;\;\;\;\mathsf{min}\left(x, y\right) + \mathsf{max}\left(x, y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1e85 or 5.0000000000000004e43 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6478.6%
Applied rewrites78.6%
Taylor expanded in a around inf
lower-*.f6466.1%
Applied rewrites66.1%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f6458.2%
Applied rewrites58.2%
if -1e85 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 5.0000000000000004e43Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6478.6%
Applied rewrites78.6%
Taylor expanded in a around inf
lower-*.f6466.1%
Applied rewrites66.1%
Taylor expanded in b around 0
lower-+.f6441.8%
Applied rewrites41.8%
(FPCore (x y z t a b) :precision binary64 (+ x y))
double code(double x, double y, double z, double t, double a, double b) {
return x + 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, 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
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + y;
}
def code(x, y, z, t, a, b): return x + y
function code(x, y, z, t, a, b) return Float64(x + y) end
function tmp = code(x, y, z, t, a, b) tmp = x + y; end
code[x_, y_, z_, t_, a_, b_] := N[(x + y), $MachinePrecision]
x + y
Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6478.6%
Applied rewrites78.6%
Taylor expanded in a around inf
lower-*.f6466.1%
Applied rewrites66.1%
Taylor expanded in b around 0
lower-+.f6441.8%
Applied rewrites41.8%
(FPCore (x y z t a b) :precision binary64 (fmax x y))
double code(double x, double y, double z, double t, double a, double b) {
return fmax(x, 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, 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 = fmax(x, y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return fmax(x, y);
}
def code(x, y, z, t, a, b): return fmax(x, y)
function code(x, y, z, t, a, b) return fmax(x, y) end
function tmp = code(x, y, z, t, a, b) tmp = max(x, y); end
code[x_, y_, z_, t_, a_, b_] := N[Max[x, y], $MachinePrecision]
\mathsf{max}\left(x, y\right)
Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6478.6%
Applied rewrites78.6%
Taylor expanded in a around inf
lower-*.f6466.1%
Applied rewrites66.1%
Taylor expanded in b around 0
lower-+.f6441.8%
Applied rewrites41.8%
Taylor expanded in x around 0
Applied rewrites21.8%
herbie shell --seed 2025271 -o generate:evaluate
(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 1/2) b)))