
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
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)
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
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
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)
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
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
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)
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
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
Initial program 99.6%
(FPCore (x y z t a) :precision binary64 (- (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) t))
double code(double x, double y, double z, double t, double a) {
return (log(y) + (log(z) + (log(t) * (a - 0.5)))) - t;
}
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)
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
code = (log(y) + (log(z) + (log(t) * (a - 0.5d0)))) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)))) - t;
}
def code(x, y, z, t, a): return (math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5)))) - t
function code(x, y, z, t, a) return Float64(Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))) - t) end
function tmp = code(x, y, z, t, a) tmp = (log(y) + (log(z) + (log(t) * (a - 0.5)))) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\right) - t
\end{array}
Initial program 99.6%
Taylor expanded in x around 0
lower--.f64N/A
lower-+.f64N/A
lower-log.f64N/A
lower-+.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6469.7
Applied rewrites69.7%
(FPCore (x y z t a) :precision binary64 (- (fma (- a 0.5) (log t) (log z)) (- t (log y))))
double code(double x, double y, double z, double t, double a) {
return fma((a - 0.5), log(t), log(z)) - (t - log(y));
}
function code(x, y, z, t, a) return Float64(fma(Float64(a - 0.5), log(t), log(z)) - Float64(t - log(y))) end
code[x_, y_, z_, t_, a_] := N[(N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - N[(t - N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a - 0.5, \log t, \log z\right) - \left(t - \log y\right)
\end{array}
Initial program 99.6%
Taylor expanded in x around 0
lower--.f64N/A
lower-+.f64N/A
lower-log.f64N/A
lower-+.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6469.7
Applied rewrites69.7%
lift--.f64N/A
sub-negate-revN/A
lift-+.f64N/A
associate--r+N/A
sub-negateN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6469.7
Applied rewrites69.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log (+ x y)) (log z)))
(t_2 (+ (log y) (+ (log z) (* (log t) (- a 0.5))))))
(if (<= t_1 -700.0)
t_2
(if (<= t_1 695.0)
(- (fma (log t) (- a 0.5) (log (* z (+ y x)))) t)
(if (<= t_1 860.0) (- (- (log (+ y x)) t) (log (/ (sqrt t) z))) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((x + y)) + log(z);
double t_2 = log(y) + (log(z) + (log(t) * (a - 0.5)));
double tmp;
if (t_1 <= -700.0) {
tmp = t_2;
} else if (t_1 <= 695.0) {
tmp = fma(log(t), (a - 0.5), log((z * (y + x)))) - t;
} else if (t_1 <= 860.0) {
tmp = (log((y + x)) - t) - log((sqrt(t) / z));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(log(Float64(x + y)) + log(z)) t_2 = Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))) tmp = 0.0 if (t_1 <= -700.0) tmp = t_2; elseif (t_1 <= 695.0) tmp = Float64(fma(log(t), Float64(a - 0.5), log(Float64(z * Float64(y + x)))) - t); elseif (t_1 <= 860.0) tmp = Float64(Float64(log(Float64(y + x)) - t) - log(Float64(sqrt(t) / z))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -700.0], t$95$2, If[LessEqual[t$95$1, 695.0], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision] + N[Log[N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$1, 860.0], N[(N[(N[Log[N[(y + x), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision] - N[Log[N[(N[Sqrt[t], $MachinePrecision] / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right) + \log z\\
t_2 := \log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{if}\;t\_1 \leq -700:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 695:\\
\;\;\;\;\mathsf{fma}\left(\log t, a - 0.5, \log \left(z \cdot \left(y + x\right)\right)\right) - t\\
\mathbf{elif}\;t\_1 \leq 860:\\
\;\;\;\;\left(\log \left(y + x\right) - t\right) - \log \left(\frac{\sqrt{t}}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -700 or 860 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.6%
Taylor expanded in x around 0
lower--.f64N/A
lower-+.f64N/A
lower-log.f64N/A
lower-+.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6469.7
Applied rewrites69.7%
lift--.f64N/A
sub-negate-revN/A
lift-+.f64N/A
associate--r+N/A
sub-negateN/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6469.7
Applied rewrites69.7%
Taylor expanded in t around 0
lower-+.f64N/A
lower-log.f64N/A
lower-+.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6441.6
Applied rewrites41.6%
if -700 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 695Initial program 99.6%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
Applied rewrites76.2%
if 695 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 860Initial program 99.6%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
add-flipN/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
log-pow-revN/A
neg-logN/A
lower-log.f64N/A
pow-flipN/A
remove-double-negN/A
unpow1/2N/A
lower-sqrt.f6499.6
Applied rewrites99.6%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-log.f64N/A
lower-log.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-log.f64N/A
lower-sqrt.f6462.1
Applied rewrites62.1%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lift-+.f64N/A
associate--r+N/A
associate-+l-N/A
lower--.f64N/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-log.f64N/A
lift-log.f64N/A
diff-logN/A
lower-log.f64N/A
lower-/.f6455.0
Applied rewrites55.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= a -2.05e+153)
t_1
(if (<= a -0.01)
(- (fma (log t) (- a 0.5) (log (* y z))) t)
(if (<= a 3.5e+38) (- (+ (log z) (log y)) (+ t (log (sqrt t)))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if (a <= -2.05e+153) {
tmp = t_1;
} else if (a <= -0.01) {
tmp = fma(log(t), (a - 0.5), log((y * z))) - t;
} else if (a <= 3.5e+38) {
tmp = (log(z) + log(y)) - (t + log(sqrt(t)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (a <= -2.05e+153) tmp = t_1; elseif (a <= -0.01) tmp = Float64(fma(log(t), Float64(a - 0.5), log(Float64(y * z))) - t); elseif (a <= 3.5e+38) tmp = Float64(Float64(log(z) + log(y)) - Float64(t + log(sqrt(t)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.05e+153], t$95$1, If[LessEqual[a, -0.01], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 3.5e+38], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(t + N[Log[N[Sqrt[t], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a \leq -2.05 \cdot 10^{+153}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -0.01:\\
\;\;\;\;\mathsf{fma}\left(\log t, a - 0.5, \log \left(y \cdot z\right)\right) - t\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{+38}:\\
\;\;\;\;\left(\log z + \log y\right) - \left(t + \log \left(\sqrt{t}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.05000000000000008e153 or 3.50000000000000002e38 < a Initial program 99.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower-log.f6438.4
Applied rewrites38.4%
if -2.05000000000000008e153 < a < -0.0100000000000000002Initial program 99.6%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
Applied rewrites76.2%
Taylor expanded in x around 0
lower-*.f6453.5
Applied rewrites53.5%
if -0.0100000000000000002 < a < 3.50000000000000002e38Initial program 99.6%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
add-flipN/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
log-pow-revN/A
neg-logN/A
lower-log.f64N/A
pow-flipN/A
remove-double-negN/A
unpow1/2N/A
lower-sqrt.f6499.6
Applied rewrites99.6%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-log.f64N/A
lower-log.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-log.f64N/A
lower-sqrt.f6462.1
Applied rewrites62.1%
Taylor expanded in x around 0
Applied rewrites41.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log (+ x y)) (log z))))
(if (<= t_1 -700.0)
(- (- (log z) t) (log (/ (sqrt t) (+ y x))))
(if (<= t_1 695.0)
(- (fma (log t) (- a 0.5) (log (* y z))) t)
(- (- (log (+ y x)) t) (log (/ (sqrt t) z)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((x + y)) + log(z);
double tmp;
if (t_1 <= -700.0) {
tmp = (log(z) - t) - log((sqrt(t) / (y + x)));
} else if (t_1 <= 695.0) {
tmp = fma(log(t), (a - 0.5), log((y * z))) - t;
} else {
tmp = (log((y + x)) - t) - log((sqrt(t) / z));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(log(Float64(x + y)) + log(z)) tmp = 0.0 if (t_1 <= -700.0) tmp = Float64(Float64(log(z) - t) - log(Float64(sqrt(t) / Float64(y + x)))); elseif (t_1 <= 695.0) tmp = Float64(fma(log(t), Float64(a - 0.5), log(Float64(y * z))) - t); else tmp = Float64(Float64(log(Float64(y + x)) - t) - log(Float64(sqrt(t) / z))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -700.0], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] - N[Log[N[(N[Sqrt[t], $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 695.0], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[N[(y + x), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision] - N[Log[N[(N[Sqrt[t], $MachinePrecision] / z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right) + \log z\\
\mathbf{if}\;t\_1 \leq -700:\\
\;\;\;\;\left(\log z - t\right) - \log \left(\frac{\sqrt{t}}{y + x}\right)\\
\mathbf{elif}\;t\_1 \leq 695:\\
\;\;\;\;\mathsf{fma}\left(\log t, a - 0.5, \log \left(y \cdot z\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(y + x\right) - t\right) - \log \left(\frac{\sqrt{t}}{z}\right)\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -700Initial program 99.6%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
add-flipN/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
log-pow-revN/A
neg-logN/A
lower-log.f64N/A
pow-flipN/A
remove-double-negN/A
unpow1/2N/A
lower-sqrt.f6499.6
Applied rewrites99.6%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-log.f64N/A
lower-log.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-log.f64N/A
lower-sqrt.f6462.1
Applied rewrites62.1%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-+.f64N/A
add-flipN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
sub-flipN/A
add-flipN/A
sub-negate-revN/A
lower--.f64N/A
lower--.f64N/A
Applied rewrites56.8%
if -700 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 695Initial program 99.6%
lift-+.f64N/A
+-commutativeN/A
lift--.f64N/A
associate-+r-N/A
lower--.f64N/A
Applied rewrites76.2%
Taylor expanded in x around 0
lower-*.f6453.5
Applied rewrites53.5%
if 695 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.6%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
add-flipN/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
log-pow-revN/A
neg-logN/A
lower-log.f64N/A
pow-flipN/A
remove-double-negN/A
unpow1/2N/A
lower-sqrt.f6499.6
Applied rewrites99.6%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-log.f64N/A
lower-log.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-log.f64N/A
lower-sqrt.f6462.1
Applied rewrites62.1%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
+-commutativeN/A
lift-+.f64N/A
associate--r+N/A
associate-+l-N/A
lower--.f64N/A
lower--.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lift-log.f64N/A
lift-log.f64N/A
diff-logN/A
lower-log.f64N/A
lower-/.f6455.0
Applied rewrites55.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= a -5.9e+16)
t_1
(if (<= a 3.5e+38) (- (- (log z) t) (log (/ (sqrt t) (+ y x)))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if (a <= -5.9e+16) {
tmp = t_1;
} else if (a <= 3.5e+38) {
tmp = (log(z) - t) - log((sqrt(t) / (y + x)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
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) :: t_1
real(8) :: tmp
t_1 = a * log(t)
if (a <= (-5.9d+16)) then
tmp = t_1
else if (a <= 3.5d+38) then
tmp = (log(z) - t) - log((sqrt(t) / (y + x)))
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 t_1 = a * Math.log(t);
double tmp;
if (a <= -5.9e+16) {
tmp = t_1;
} else if (a <= 3.5e+38) {
tmp = (Math.log(z) - t) - Math.log((Math.sqrt(t) / (y + x)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if a <= -5.9e+16: tmp = t_1 elif a <= 3.5e+38: tmp = (math.log(z) - t) - math.log((math.sqrt(t) / (y + x))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (a <= -5.9e+16) tmp = t_1; elseif (a <= 3.5e+38) tmp = Float64(Float64(log(z) - t) - log(Float64(sqrt(t) / Float64(y + x)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if (a <= -5.9e+16) tmp = t_1; elseif (a <= 3.5e+38) tmp = (log(z) - t) - log((sqrt(t) / (y + x))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.9e+16], t$95$1, If[LessEqual[a, 3.5e+38], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] - N[Log[N[(N[Sqrt[t], $MachinePrecision] / N[(y + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a \leq -5.9 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{+38}:\\
\;\;\;\;\left(\log z - t\right) - \log \left(\frac{\sqrt{t}}{y + x}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.9e16 or 3.50000000000000002e38 < a Initial program 99.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower-log.f6438.4
Applied rewrites38.4%
if -5.9e16 < a < 3.50000000000000002e38Initial program 99.6%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
add-flipN/A
*-commutativeN/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
log-pow-revN/A
neg-logN/A
lower-log.f64N/A
pow-flipN/A
remove-double-negN/A
unpow1/2N/A
lower-sqrt.f6499.6
Applied rewrites99.6%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-log.f64N/A
lower-log.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-log.f64N/A
lower-sqrt.f6462.1
Applied rewrites62.1%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-+.f64N/A
add-flipN/A
associate--r-N/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
sub-flipN/A
add-flipN/A
sub-negate-revN/A
lower--.f64N/A
lower--.f64N/A
Applied rewrites56.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= a -1.7e+16)
t_1
(if (<= a 11.0) (- (log (/ (* z (+ x y)) (sqrt t))) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if (a <= -1.7e+16) {
tmp = t_1;
} else if (a <= 11.0) {
tmp = log(((z * (x + y)) / sqrt(t))) - t;
} 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)
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) :: t_1
real(8) :: tmp
t_1 = a * log(t)
if (a <= (-1.7d+16)) then
tmp = t_1
else if (a <= 11.0d0) then
tmp = log(((z * (x + y)) / sqrt(t))) - t
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 t_1 = a * Math.log(t);
double tmp;
if (a <= -1.7e+16) {
tmp = t_1;
} else if (a <= 11.0) {
tmp = Math.log(((z * (x + y)) / Math.sqrt(t))) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if a <= -1.7e+16: tmp = t_1 elif a <= 11.0: tmp = math.log(((z * (x + y)) / math.sqrt(t))) - t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (a <= -1.7e+16) tmp = t_1; elseif (a <= 11.0) tmp = Float64(log(Float64(Float64(z * Float64(x + y)) / sqrt(t))) - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if (a <= -1.7e+16) tmp = t_1; elseif (a <= 11.0) tmp = log(((z * (x + y)) / sqrt(t))) - t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.7e+16], t$95$1, If[LessEqual[a, 11.0], N[(N[Log[N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] / N[Sqrt[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a \leq -1.7 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 11:\\
\;\;\;\;\log \left(\frac{z \cdot \left(x + y\right)}{\sqrt{t}}\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.7e16 or 11 < a Initial program 99.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower-log.f6438.4
Applied rewrites38.4%
if -1.7e16 < a < 11Initial program 99.6%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
lift--.f64N/A
sub-negate-revN/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
sub-flip-reverseN/A
sub-negate-revN/A
Applied rewrites69.4%
Taylor expanded in a around 0
lower--.f64N/A
lower-log.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-sqrt.f6443.9
Applied rewrites43.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* a (log t)))) (if (<= (- a 0.5) -4e+23) t_1 (if (<= (- a 0.5) 5e+38) (- t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if ((a - 0.5) <= -4e+23) {
tmp = t_1;
} else if ((a - 0.5) <= 5e+38) {
tmp = -t;
} 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)
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) :: t_1
real(8) :: tmp
t_1 = a * log(t)
if ((a - 0.5d0) <= (-4d+23)) then
tmp = t_1
else if ((a - 0.5d0) <= 5d+38) then
tmp = -t
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 t_1 = a * Math.log(t);
double tmp;
if ((a - 0.5) <= -4e+23) {
tmp = t_1;
} else if ((a - 0.5) <= 5e+38) {
tmp = -t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if (a - 0.5) <= -4e+23: tmp = t_1 elif (a - 0.5) <= 5e+38: tmp = -t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (Float64(a - 0.5) <= -4e+23) tmp = t_1; elseif (Float64(a - 0.5) <= 5e+38) tmp = Float64(-t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if ((a - 0.5) <= -4e+23) tmp = t_1; elseif ((a - 0.5) <= 5e+38) tmp = -t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a - 0.5), $MachinePrecision], -4e+23], t$95$1, If[LessEqual[N[(a - 0.5), $MachinePrecision], 5e+38], (-t), t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a - 0.5 \leq -4 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a - 0.5 \leq 5 \cdot 10^{+38}:\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -3.9999999999999997e23 or 4.9999999999999997e38 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower-log.f6438.4
Applied rewrites38.4%
if -3.9999999999999997e23 < (-.f64 a #s(literal 1/2 binary64)) < 4.9999999999999997e38Initial program 99.6%
Taylor expanded in t around inf
lower-*.f6438.5
Applied rewrites38.5%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6438.5
Applied rewrites38.5%
(FPCore (x y z t a) :precision binary64 (- t))
double code(double x, double y, double z, double t, double a) {
return -t;
}
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)
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
code = -t
end function
public static double code(double x, double y, double z, double t, double a) {
return -t;
}
def code(x, y, z, t, a): return -t
function code(x, y, z, t, a) return Float64(-t) end
function tmp = code(x, y, z, t, a) tmp = -t; end
code[x_, y_, z_, t_, a_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 99.6%
Taylor expanded in t around inf
lower-*.f6438.5
Applied rewrites38.5%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6438.5
Applied rewrites38.5%
herbie shell --seed 2025156
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))