
(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]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
Herbie found 21 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]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
(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]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
Initial program 99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- 1.0 (log t)) z (fma b (- a 0.5) y))))
(if (<= z -1.8e+120)
t_1
(if (<= z 2.35e+51) (fma b (- a 0.5) (+ y x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((1.0 - log(t)), z, fma(b, (a - 0.5), y));
double tmp;
if (z <= -1.8e+120) {
tmp = t_1;
} else if (z <= 2.35e+51) {
tmp = fma(b, (a - 0.5), (y + x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(1.0 - log(t)), z, fma(b, Float64(a - 0.5), y)) tmp = 0.0 if (z <= -1.8e+120) tmp = t_1; elseif (z <= 2.35e+51) tmp = fma(b, Float64(a - 0.5), Float64(y + x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + N[(b * N[(a - 0.5), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e+120], t$95$1, If[LessEqual[z, 2.35e+51], N[(b * N[(a - 0.5), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - \log t, z, \mathsf{fma}\left(b, a - 0.5, y\right)\right)\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{+51}:\\
\;\;\;\;\mathsf{fma}\left(b, a - 0.5, y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.80000000000000008e120 or 2.3500000000000001e51 < z Initial program 99.7%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
*-rgt-identityN/A
remove-double-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
Applied rewrites87.5%
if -1.80000000000000008e120 < z < 2.3500000000000001e51Initial program 100.0%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6494.8
Applied rewrites94.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- 1.0 (log t))))
(if (<= z -2.4e+120)
(fma t_1 z (fma b a y))
(if (<= z 1.55e+99)
(fma b (- a 0.5) (+ y x))
(fma (- a 0.5) b (* t_1 z))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 - log(t);
double tmp;
if (z <= -2.4e+120) {
tmp = fma(t_1, z, fma(b, a, y));
} else if (z <= 1.55e+99) {
tmp = fma(b, (a - 0.5), (y + x));
} else {
tmp = fma((a - 0.5), b, (t_1 * z));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(1.0 - log(t)) tmp = 0.0 if (z <= -2.4e+120) tmp = fma(t_1, z, fma(b, a, y)); elseif (z <= 1.55e+99) tmp = fma(b, Float64(a - 0.5), Float64(y + x)); else tmp = fma(Float64(a - 0.5), b, Float64(t_1 * z)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e+120], N[(t$95$1 * z + N[(b * a + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.55e+99], N[(b * N[(a - 0.5), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(a - 0.5), $MachinePrecision] * b + N[(t$95$1 * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 1 - \log t\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+120}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, z, \mathsf{fma}\left(b, a, y\right)\right)\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+99}:\\
\;\;\;\;\mathsf{fma}\left(b, a - 0.5, y + x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a - 0.5, b, t\_1 \cdot z\right)\\
\end{array}
\end{array}
if z < -2.40000000000000001e120Initial program 99.7%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
*-rgt-identityN/A
remove-double-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
Applied rewrites90.3%
Taylor expanded in a around inf
Applied rewrites84.0%
if -2.40000000000000001e120 < z < 1.55e99Initial program 100.0%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6494.1
Applied rewrites94.1%
if 1.55e99 < z Initial program 99.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lift-log.f6477.1
Applied rewrites77.1%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
*-rgt-identityN/A
metadata-evalN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
*-rgt-identityN/A
lower-fma.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
lift--.f64N/A
*-rgt-identity77.1
Applied rewrites77.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- 1.0 (log t)) z (fma b a y))))
(if (<= z -2.4e+120)
t_1
(if (<= z 1.3e+52) (fma b (- a 0.5) (+ y x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((1.0 - log(t)), z, fma(b, a, y));
double tmp;
if (z <= -2.4e+120) {
tmp = t_1;
} else if (z <= 1.3e+52) {
tmp = fma(b, (a - 0.5), (y + x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(1.0 - log(t)), z, fma(b, a, y)) tmp = 0.0 if (z <= -2.4e+120) tmp = t_1; elseif (z <= 1.3e+52) tmp = fma(b, Float64(a - 0.5), Float64(y + x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + N[(b * a + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.4e+120], t$95$1, If[LessEqual[z, 1.3e+52], N[(b * N[(a - 0.5), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - \log t, z, \mathsf{fma}\left(b, a, y\right)\right)\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+52}:\\
\;\;\;\;\mathsf{fma}\left(b, a - 0.5, y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.40000000000000001e120 or 1.3e52 < z Initial program 99.7%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
*-rgt-identityN/A
remove-double-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
Applied rewrites87.5%
Taylor expanded in a around inf
Applied rewrites79.9%
if -2.40000000000000001e120 < z < 1.3e52Initial program 100.0%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6494.8
Applied rewrites94.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- 1.0 (log t)) z (+ y x))))
(if (<= z -1.6e+101)
t_1
(if (<= z 6.5e+116) (fma b (- a 0.5) (+ y x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((1.0 - log(t)), z, (y + x));
double tmp;
if (z <= -1.6e+101) {
tmp = t_1;
} else if (z <= 6.5e+116) {
tmp = fma(b, (a - 0.5), (y + x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(1.0 - log(t)), z, Float64(y + x)) tmp = 0.0 if (z <= -1.6e+101) tmp = t_1; elseif (z <= 6.5e+116) tmp = fma(b, Float64(a - 0.5), Float64(y + x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6e+101], t$95$1, If[LessEqual[z, 6.5e+116], N[(b * N[(a - 0.5), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - \log t, z, y + x\right)\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+116}:\\
\;\;\;\;\mathsf{fma}\left(b, a - 0.5, y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.60000000000000003e101 or 6.4999999999999998e116 < z Initial program 99.7%
Taylor expanded in b around 0
associate-+l+N/A
associate--l+N/A
+-commutativeN/A
*-rgt-identityN/A
remove-double-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
Applied rewrites73.5%
if -1.60000000000000003e101 < z < 6.4999999999999998e116Initial program 100.0%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6494.1
Applied rewrites94.1%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4.8e+120) (- z (- (* (log t) z) y)) (if (<= z 2.8e+117) (fma b (- a 0.5) (+ y x)) (fma (- 1.0 (log t)) z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.8e+120) {
tmp = z - ((log(t) * z) - y);
} else if (z <= 2.8e+117) {
tmp = fma(b, (a - 0.5), (y + x));
} else {
tmp = fma((1.0 - log(t)), z, y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.8e+120) tmp = Float64(z - Float64(Float64(log(t) * z) - y)); elseif (z <= 2.8e+117) tmp = fma(b, Float64(a - 0.5), Float64(y + x)); else tmp = fma(Float64(1.0 - log(t)), z, y); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.8e+120], N[(z - N[(N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e+117], N[(b * N[(a - 0.5), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+120}:\\
\;\;\;\;z - \left(\log t \cdot z - y\right)\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+117}:\\
\;\;\;\;\mathsf{fma}\left(b, a - 0.5, y + x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - \log t, z, y\right)\\
\end{array}
\end{array}
if z < -4.80000000000000002e120Initial program 99.7%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
*-rgt-identityN/A
remove-double-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
Applied rewrites90.3%
Taylor expanded in y around inf
Applied rewrites66.0%
lift-fma.f64N/A
lift--.f64N/A
lift-log.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
fp-cancel-sub-signN/A
*-lft-identityN/A
*-commutativeN/A
associate-+l-N/A
lower--.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6465.9
Applied rewrites65.9%
if -4.80000000000000002e120 < z < 2.79999999999999997e117Initial program 100.0%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6493.6
Applied rewrites93.6%
if 2.79999999999999997e117 < z Initial program 99.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
*-rgt-identityN/A
remove-double-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
Applied rewrites87.7%
Taylor expanded in y around inf
Applied rewrites61.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- 1.0 (log t)) z y)))
(if (<= z -4.8e+120)
t_1
(if (<= z 2.8e+117) (fma b (- a 0.5) (+ y x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((1.0 - log(t)), z, y);
double tmp;
if (z <= -4.8e+120) {
tmp = t_1;
} else if (z <= 2.8e+117) {
tmp = fma(b, (a - 0.5), (y + x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(1.0 - log(t)), z, y) tmp = 0.0 if (z <= -4.8e+120) tmp = t_1; elseif (z <= 2.8e+117) tmp = fma(b, Float64(a - 0.5), Float64(y + x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + y), $MachinePrecision]}, If[LessEqual[z, -4.8e+120], t$95$1, If[LessEqual[z, 2.8e+117], N[(b * N[(a - 0.5), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - \log t, z, y\right)\\
\mathbf{if}\;z \leq -4.8 \cdot 10^{+120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+117}:\\
\;\;\;\;\mathsf{fma}\left(b, a - 0.5, y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.80000000000000002e120 or 2.79999999999999997e117 < z Initial program 99.7%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
*-rgt-identityN/A
remove-double-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
Applied rewrites89.0%
Taylor expanded in y around inf
Applied rewrites63.4%
if -4.80000000000000002e120 < z < 2.79999999999999997e117Initial program 100.0%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6493.6
Applied rewrites93.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- 1.0 (log t)) z x)))
(if (<= z -1.5e+198)
t_1
(if (<= z 9.5e+136) (fma b (- a 0.5) (+ y x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((1.0 - log(t)), z, x);
double tmp;
if (z <= -1.5e+198) {
tmp = t_1;
} else if (z <= 9.5e+136) {
tmp = fma(b, (a - 0.5), (y + x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(1.0 - log(t)), z, x) tmp = 0.0 if (z <= -1.5e+198) tmp = t_1; elseif (z <= 9.5e+136) tmp = fma(b, Float64(a - 0.5), Float64(y + x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z + x), $MachinePrecision]}, If[LessEqual[z, -1.5e+198], t$95$1, If[LessEqual[z, 9.5e+136], N[(b * N[(a - 0.5), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - \log t, z, x\right)\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+198}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+136}:\\
\;\;\;\;\mathsf{fma}\left(b, a - 0.5, y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.50000000000000009e198 or 9.49999999999999907e136 < z Initial program 99.6%
Taylor expanded in b around 0
associate-+l+N/A
associate--l+N/A
+-commutativeN/A
*-rgt-identityN/A
remove-double-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
Applied rewrites76.4%
Taylor expanded in x around inf
Applied rewrites69.3%
if -1.50000000000000009e198 < z < 9.49999999999999907e136Initial program 99.9%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6490.6
Applied rewrites90.6%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.62e+198) (- z (* (log t) z)) (if (<= z 1.32e+137) (fma b (- a 0.5) (+ y x)) (* (- 1.0 (log t)) z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.62e+198) {
tmp = z - (log(t) * z);
} else if (z <= 1.32e+137) {
tmp = fma(b, (a - 0.5), (y + x));
} else {
tmp = (1.0 - log(t)) * z;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.62e+198) tmp = Float64(z - Float64(log(t) * z)); elseif (z <= 1.32e+137) tmp = fma(b, Float64(a - 0.5), Float64(y + x)); else tmp = Float64(Float64(1.0 - log(t)) * z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.62e+198], N[(z - N[(N[Log[t], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.32e+137], N[(b * N[(a - 0.5), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.62 \cdot 10^{+198}:\\
\;\;\;\;z - \log t \cdot z\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{+137}:\\
\;\;\;\;\mathsf{fma}\left(b, a - 0.5, y + x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \log t\right) \cdot z\\
\end{array}
\end{array}
if z < -1.61999999999999989e198Initial program 99.7%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
*-rgt-identityN/A
remove-double-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
Applied rewrites94.7%
Taylor expanded in y around inf
Applied rewrites74.5%
lift-fma.f64N/A
lift--.f64N/A
lift-log.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
fp-cancel-sub-signN/A
*-lft-identityN/A
*-commutativeN/A
associate-+l-N/A
lower--.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6474.4
Applied rewrites74.4%
Taylor expanded in z around inf
*-commutativeN/A
lift-log.f64N/A
lift-*.f6467.7
Applied rewrites67.7%
if -1.61999999999999989e198 < z < 1.31999999999999997e137Initial program 99.9%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6490.6
Applied rewrites90.6%
if 1.31999999999999997e137 < z Initial program 99.6%
Taylor expanded in z around inf
*-commutativeN/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-*.f64N/A
lower--.f64N/A
lift-log.f6456.5
Applied rewrites56.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- 1.0 (log t)) z)))
(if (<= z -1.62e+198)
t_1
(if (<= z 1.32e+137) (fma b (- a 0.5) (+ y x)) 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.62e+198) {
tmp = t_1;
} else if (z <= 1.32e+137) {
tmp = fma(b, (a - 0.5), (y + x));
} 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.62e+198) tmp = t_1; elseif (z <= 1.32e+137) tmp = fma(b, Float64(a - 0.5), Float64(y + x)); else tmp = t_1; end return 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.62e+198], t$95$1, If[LessEqual[z, 1.32e+137], N[(b * N[(a - 0.5), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - \log t\right) \cdot z\\
\mathbf{if}\;z \leq -1.62 \cdot 10^{+198}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.32 \cdot 10^{+137}:\\
\;\;\;\;\mathsf{fma}\left(b, a - 0.5, y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.61999999999999989e198 or 1.31999999999999997e137 < z Initial program 99.6%
Taylor expanded in z around inf
*-commutativeN/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower-*.f64N/A
lower--.f64N/A
lift-log.f6460.8
Applied rewrites60.8%
if -1.61999999999999989e198 < z < 1.31999999999999997e137Initial program 99.9%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6490.6
Applied rewrites90.6%
(FPCore (x y z t a b) :precision binary64 (fma b (- a 0.5) (+ y x)))
double code(double x, double y, double z, double t, double a, double b) {
return fma(b, (a - 0.5), (y + x));
}
function code(x, y, z, t, a, b) return fma(b, Float64(a - 0.5), Float64(y + x)) end
code[x_, y_, z_, t_, a_, b_] := N[(b * N[(a - 0.5), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(b, a - 0.5, y + x\right)
\end{array}
Initial program 99.9%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6478.7
Applied rewrites78.7%
(FPCore (x y z t a b) :precision binary64 (if (<= (- (+ (+ x y) z) (* z (log t))) -5e-152) (fma b (- a 0.5) x) (fma b (- a 0.5) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((((x + y) + z) - (z * log(t))) <= -5e-152) {
tmp = fma(b, (a - 0.5), x);
} else {
tmp = fma(b, (a - 0.5), y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) <= -5e-152) tmp = fma(b, Float64(a - 0.5), x); else tmp = fma(b, Float64(a - 0.5), y); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-152], N[(b * N[(a - 0.5), $MachinePrecision] + x), $MachinePrecision], N[(b * N[(a - 0.5), $MachinePrecision] + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(x + y\right) + z\right) - z \cdot \log t \leq -5 \cdot 10^{-152}:\\
\;\;\;\;\mathsf{fma}\left(b, a - 0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, a - 0.5, y\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) < -4.9999999999999997e-152Initial program 99.8%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6478.4
Applied rewrites78.4%
Taylor expanded in x around inf
Applied rewrites57.8%
if -4.9999999999999997e-152 < (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) Initial program 99.9%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6479.0
Applied rewrites79.0%
Taylor expanded in x around 0
Applied rewrites58.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b))))
(if (<= t_1 1e-146)
(fma b (- a 0.5) x)
(if (<= t_1 2e+307) (fma b -0.5 y) (- z (* (- a) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
double tmp;
if (t_1 <= 1e-146) {
tmp = fma(b, (a - 0.5), x);
} else if (t_1 <= 2e+307) {
tmp = fma(b, -0.5, y);
} else {
tmp = z - (-a * b);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) tmp = 0.0 if (t_1 <= 1e-146) tmp = fma(b, Float64(a - 0.5), x); elseif (t_1 <= 2e+307) tmp = fma(b, -0.5, y); else tmp = Float64(z - Float64(Float64(-a) * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, 1e-146], N[(b * N[(a - 0.5), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+307], N[(b * -0.5 + y), $MachinePrecision], N[(z - N[((-a) * b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;t\_1 \leq 10^{-146}:\\
\;\;\;\;\mathsf{fma}\left(b, a - 0.5, x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+307}:\\
\;\;\;\;\mathsf{fma}\left(b, -0.5, y\right)\\
\mathbf{else}:\\
\;\;\;\;z - \left(-a\right) \cdot b\\
\end{array}
\end{array}
if (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) < 1.00000000000000003e-146Initial program 99.9%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6478.4
Applied rewrites78.4%
Taylor expanded in x around inf
Applied rewrites57.9%
if 1.00000000000000003e-146 < (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) < 1.99999999999999997e307Initial program 99.9%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6476.1
Applied rewrites76.1%
Taylor expanded in a around 0
Applied rewrites61.6%
Taylor expanded in x around 0
Applied rewrites38.3%
if 1.99999999999999997e307 < (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) Initial program 99.8%
Taylor expanded in x around 0
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
*-rgt-identityN/A
remove-double-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-outN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
distribute-lft-inN/A
*-commutativeN/A
Applied rewrites98.8%
Taylor expanded in y around inf
Applied rewrites5.6%
lift-fma.f64N/A
lift--.f64N/A
lift-log.f64N/A
*-lft-identityN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-commutativeN/A
distribute-rgt-inN/A
mul-1-negN/A
fp-cancel-sub-signN/A
*-lft-identityN/A
*-commutativeN/A
associate-+l-N/A
lower--.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f645.6
Applied rewrites5.6%
Taylor expanded in a around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6496.0
Applied rewrites96.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b))))
(if (<= t_1 (- INFINITY))
(* b a)
(if (<= t_1 -5e-152)
(fma b -0.5 x)
(if (<= t_1 2e+307) (fma b -0.5 y) (* b a))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = b * a;
} else if (t_1 <= -5e-152) {
tmp = fma(b, -0.5, x);
} else if (t_1 <= 2e+307) {
tmp = fma(b, -0.5, y);
} else {
tmp = b * a;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(b * a); elseif (t_1 <= -5e-152) tmp = fma(b, -0.5, x); elseif (t_1 <= 2e+307) tmp = fma(b, -0.5, y); else tmp = Float64(b * a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, (-Infinity)], N[(b * a), $MachinePrecision], If[LessEqual[t$95$1, -5e-152], N[(b * -0.5 + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+307], N[(b * -0.5 + y), $MachinePrecision], N[(b * a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;b \cdot a\\
\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-152}:\\
\;\;\;\;\mathsf{fma}\left(b, -0.5, x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+307}:\\
\;\;\;\;\mathsf{fma}\left(b, -0.5, y\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot a\\
\end{array}
\end{array}
if (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) < -inf.0 or 1.99999999999999997e307 < (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) Initial program 99.9%
Taylor expanded in a around inf
remove-double-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
mul-1-negN/A
mul-1-negN/A
distribute-lft-neg-inN/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
*-rgt-identity96.2
Applied rewrites96.2%
if -inf.0 < (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) < -4.9999999999999997e-152Initial program 99.8%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6476.0
Applied rewrites76.0%
Taylor expanded in a around 0
Applied rewrites61.9%
Taylor expanded in x around inf
Applied rewrites38.9%
if -4.9999999999999997e-152 < (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) < 1.99999999999999997e307Initial program 99.9%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6476.0
Applied rewrites76.0%
Taylor expanded in a around 0
Applied rewrites61.5%
Taylor expanded in x around 0
Applied rewrites38.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- a 0.5) b)) (t_2 (* b (- a 0.5)))) (if (<= t_1 -1e+215) t_2 (if (<= t_1 2e+67) (+ y x) 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 = b * (a - 0.5);
double tmp;
if (t_1 <= -1e+215) {
tmp = t_2;
} else if (t_1 <= 2e+67) {
tmp = y + x;
} 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 = b * (a - 0.5d0)
if (t_1 <= (-1d+215)) then
tmp = t_2
else if (t_1 <= 2d+67) then
tmp = y + x
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 = b * (a - 0.5);
double tmp;
if (t_1 <= -1e+215) {
tmp = t_2;
} else if (t_1 <= 2e+67) {
tmp = y + x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - 0.5) * b t_2 = b * (a - 0.5) tmp = 0 if t_1 <= -1e+215: tmp = t_2 elif t_1 <= 2e+67: tmp = y + x 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(b * Float64(a - 0.5)) tmp = 0.0 if (t_1 <= -1e+215) tmp = t_2; elseif (t_1 <= 2e+67) tmp = Float64(y + x); 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 = b * (a - 0.5); tmp = 0.0; if (t_1 <= -1e+215) tmp = t_2; elseif (t_1 <= 2e+67) tmp = y + x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+215], t$95$2, If[LessEqual[t$95$1, 2e+67], N[(y + x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
t_2 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+215}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+67}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -9.99999999999999907e214 or 1.99999999999999997e67 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in b around inf
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-*.f64N/A
*-rgt-identityN/A
lift--.f6473.1
Applied rewrites73.1%
if -9.99999999999999907e214 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.99999999999999997e67Initial program 99.8%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6470.6
Applied rewrites70.6%
Taylor expanded in b around 0
+-commutativeN/A
lift-+.f6457.4
Applied rewrites57.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- a 0.5) b)))
(if (<= t_1 -5e+292)
(* b a)
(if (<= t_1 -1e+215)
(fma b -0.5 x)
(if (<= t_1 1e+43)
(+ y x)
(if (<= t_1 1e+306) (fma b -0.5 x) (* b a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double tmp;
if (t_1 <= -5e+292) {
tmp = b * a;
} else if (t_1 <= -1e+215) {
tmp = fma(b, -0.5, x);
} else if (t_1 <= 1e+43) {
tmp = y + x;
} else if (t_1 <= 1e+306) {
tmp = fma(b, -0.5, x);
} else {
tmp = b * a;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) tmp = 0.0 if (t_1 <= -5e+292) tmp = Float64(b * a); elseif (t_1 <= -1e+215) tmp = fma(b, -0.5, x); elseif (t_1 <= 1e+43) tmp = Float64(y + x); elseif (t_1 <= 1e+306) tmp = fma(b, -0.5, x); else tmp = Float64(b * a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+292], N[(b * a), $MachinePrecision], If[LessEqual[t$95$1, -1e+215], N[(b * -0.5 + x), $MachinePrecision], If[LessEqual[t$95$1, 1e+43], N[(y + x), $MachinePrecision], If[LessEqual[t$95$1, 1e+306], N[(b * -0.5 + x), $MachinePrecision], N[(b * a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+292}:\\
\;\;\;\;b \cdot a\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+215}:\\
\;\;\;\;\mathsf{fma}\left(b, -0.5, x\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+43}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t\_1 \leq 10^{+306}:\\
\;\;\;\;\mathsf{fma}\left(b, -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot a\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -4.9999999999999996e292 or 1.00000000000000002e306 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in a around inf
remove-double-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
mul-1-negN/A
mul-1-negN/A
distribute-lft-neg-inN/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
*-rgt-identity95.3
Applied rewrites95.3%
if -4.9999999999999996e292 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -9.99999999999999907e214 or 1.00000000000000001e43 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.00000000000000002e306Initial program 99.9%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6485.4
Applied rewrites85.4%
Taylor expanded in a around 0
Applied rewrites57.0%
Taylor expanded in x around inf
Applied rewrites42.4%
if -9.99999999999999907e214 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.00000000000000001e43Initial program 99.8%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6470.5
Applied rewrites70.5%
Taylor expanded in b around 0
+-commutativeN/A
lift-+.f6457.6
Applied rewrites57.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- a 0.5) b)))
(if (<= t_1 -1e+216)
(* b a)
(if (<= t_1 2e+67) (+ y x) (if (<= t_1 1e+306) (* b -0.5) (* b a))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double tmp;
if (t_1 <= -1e+216) {
tmp = b * a;
} else if (t_1 <= 2e+67) {
tmp = y + x;
} else if (t_1 <= 1e+306) {
tmp = b * -0.5;
} else {
tmp = b * a;
}
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 = (a - 0.5d0) * b
if (t_1 <= (-1d+216)) then
tmp = b * a
else if (t_1 <= 2d+67) then
tmp = y + x
else if (t_1 <= 1d+306) then
tmp = b * (-0.5d0)
else
tmp = b * a
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 tmp;
if (t_1 <= -1e+216) {
tmp = b * a;
} else if (t_1 <= 2e+67) {
tmp = y + x;
} else if (t_1 <= 1e+306) {
tmp = b * -0.5;
} else {
tmp = b * a;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - 0.5) * b tmp = 0 if t_1 <= -1e+216: tmp = b * a elif t_1 <= 2e+67: tmp = y + x elif t_1 <= 1e+306: tmp = b * -0.5 else: tmp = b * a return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) tmp = 0.0 if (t_1 <= -1e+216) tmp = Float64(b * a); elseif (t_1 <= 2e+67) tmp = Float64(y + x); elseif (t_1 <= 1e+306) tmp = Float64(b * -0.5); else tmp = Float64(b * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a - 0.5) * b; tmp = 0.0; if (t_1 <= -1e+216) tmp = b * a; elseif (t_1 <= 2e+67) tmp = y + x; elseif (t_1 <= 1e+306) tmp = b * -0.5; else tmp = b * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+216], N[(b * a), $MachinePrecision], If[LessEqual[t$95$1, 2e+67], N[(y + x), $MachinePrecision], If[LessEqual[t$95$1, 1e+306], N[(b * -0.5), $MachinePrecision], N[(b * a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+216}:\\
\;\;\;\;b \cdot a\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+67}:\\
\;\;\;\;y + x\\
\mathbf{elif}\;t\_1 \leq 10^{+306}:\\
\;\;\;\;b \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;b \cdot a\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1e216 or 1.00000000000000002e306 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in a around inf
remove-double-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
mul-1-negN/A
mul-1-negN/A
distribute-lft-neg-inN/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
*-rgt-identity77.4
Applied rewrites77.4%
if -1e216 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.99999999999999997e67Initial program 99.8%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6470.7
Applied rewrites70.7%
Taylor expanded in b around 0
+-commutativeN/A
lift-+.f6457.4
Applied rewrites57.4%
if 1.99999999999999997e67 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.00000000000000002e306Initial program 99.9%
Taylor expanded in b around inf
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-*.f64N/A
*-rgt-identityN/A
lift--.f6454.7
Applied rewrites54.7%
Taylor expanded in a around 0
Applied rewrites28.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- a 0.5) b))) (if (<= t_1 -1e+216) (* b a) (if (<= t_1 2e+128) (+ y x) (* b a)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a - 0.5) * b;
double tmp;
if (t_1 <= -1e+216) {
tmp = b * a;
} else if (t_1 <= 2e+128) {
tmp = y + x;
} else {
tmp = b * a;
}
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 = (a - 0.5d0) * b
if (t_1 <= (-1d+216)) then
tmp = b * a
else if (t_1 <= 2d+128) then
tmp = y + x
else
tmp = b * a
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 tmp;
if (t_1 <= -1e+216) {
tmp = b * a;
} else if (t_1 <= 2e+128) {
tmp = y + x;
} else {
tmp = b * a;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a - 0.5) * b tmp = 0 if t_1 <= -1e+216: tmp = b * a elif t_1 <= 2e+128: tmp = y + x else: tmp = b * a return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a - 0.5) * b) tmp = 0.0 if (t_1 <= -1e+216) tmp = Float64(b * a); elseif (t_1 <= 2e+128) tmp = Float64(y + x); else tmp = Float64(b * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a - 0.5) * b; tmp = 0.0; if (t_1 <= -1e+216) tmp = b * a; elseif (t_1 <= 2e+128) tmp = y + x; else tmp = b * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+216], N[(b * a), $MachinePrecision], If[LessEqual[t$95$1, 2e+128], N[(y + x), $MachinePrecision], N[(b * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot b\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+216}:\\
\;\;\;\;b \cdot a\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+128}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;b \cdot a\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -1e216 or 2.0000000000000002e128 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in a around inf
remove-double-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
mul-1-negN/A
mul-1-negN/A
distribute-lft-neg-inN/A
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lower-*.f64N/A
*-rgt-identity58.0
Applied rewrites58.0%
if -1e216 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2.0000000000000002e128Initial program 99.8%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6471.3
Applied rewrites71.3%
Taylor expanded in b around 0
+-commutativeN/A
lift-+.f6456.7
Applied rewrites56.7%
(FPCore (x y z t a b) :precision binary64 (+ y x))
double code(double x, double y, double z, double t, double a, double b) {
return y + 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 = y + x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return y + x;
}
def code(x, y, z, t, a, b): return y + x
function code(x, y, z, t, a, b) return Float64(y + x) end
function tmp = code(x, y, z, t, a, b) tmp = y + x; end
code[x_, y_, z_, t_, a_, b_] := N[(y + x), $MachinePrecision]
\begin{array}{l}
\\
y + x
\end{array}
Initial program 99.9%
Taylor expanded in z around 0
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
*-rgt-identityN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-rgt-identityN/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6478.7
Applied rewrites78.7%
Taylor expanded in b around 0
+-commutativeN/A
lift-+.f6442.2
Applied rewrites42.2%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)) -4e-220) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((((x + y) + z) - (z * log(t))) + ((a - 0.5) * b)) <= -4e-220) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, 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 (((((x + y) + z) - (z * log(t))) + ((a - 0.5d0) * b)) <= (-4d-220)) then
tmp = x
else
tmp = y
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 (((((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b)) <= -4e-220) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)) <= -4e-220: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) <= -4e-220) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((((x + y) + z) - (z * log(t))) + ((a - 0.5) * b)) <= -4e-220) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[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], -4e-220], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b \leq -4 \cdot 10^{-220}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) < -3.99999999999999997e-220Initial program 99.9%
Taylor expanded in x around inf
Applied rewrites22.9%
if -3.99999999999999997e-220 < (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) Initial program 99.9%
Taylor expanded in y around inf
Applied rewrites21.2%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return 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 = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.9%
Taylor expanded in x around inf
Applied rewrites22.5%
herbie shell --seed 2025130
(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)))