
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (* x (- (/ y z) (/ t (- 1.0 z)))))
double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x * ((y / z) - (t / (1.0d0 - z)))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y / z) - (t / (1.0 - z)));
}
def code(x, y, z, t): return x * ((y / z) - (t / (1.0 - z)))
function code(x, y, z, t) return Float64(x * Float64(Float64(y / z) - Float64(t / Float64(1.0 - z)))) end
function tmp = code(x, y, z, t) tmp = x * ((y / z) - (t / (1.0 - z))); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\frac{y}{z} - \frac{t}{1 - z}\right)
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (/ y z) (/ t (- 1.0 z)))))
(if (<= t_1 (- INFINITY))
(* (/ x z) y)
(if (<= t_1 4e+265) (* x t_1) (/ y (/ z x))))))
double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (x / z) * y;
} else if (t_1 <= 4e+265) {
tmp = x * t_1;
} else {
tmp = y / (z / x);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (y / z) - (t / (1.0 - z));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (x / z) * y;
} else if (t_1 <= 4e+265) {
tmp = x * t_1;
} else {
tmp = y / (z / x);
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / z) - (t / (1.0 - z)) tmp = 0 if t_1 <= -math.inf: tmp = (x / z) * y elif t_1 <= 4e+265: tmp = x * t_1 else: tmp = y / (z / x) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(x / z) * y); elseif (t_1 <= 4e+265) tmp = Float64(x * t_1); else tmp = Float64(y / Float64(z / x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / z) - (t / (1.0 - z)); tmp = 0.0; if (t_1 <= -Inf) tmp = (x / z) * y; elseif (t_1 <= 4e+265) tmp = x * t_1; else tmp = y / (z / x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, 4e+265], N[(x * t$95$1), $MachinePrecision], N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{z} - \frac{t}{1 - z}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+265}:\\
\;\;\;\;x \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{z}{x}}\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -inf.0Initial program 94.8%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
mult-flip-revN/A
lift-/.f64N/A
lift-*.f64N/A
lower-*.f6461.1
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6461.2
Applied rewrites61.2%
if -inf.0 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 4.00000000000000027e265Initial program 94.8%
if 4.00000000000000027e265 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 94.8%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
mult-flip-revN/A
lift-/.f64N/A
lift-*.f64N/A
lower-*.f6461.1
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6461.2
Applied rewrites61.2%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6460.8
Applied rewrites60.8%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6460.9
Applied rewrites60.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ (- y (* -1.0 t)) z)))) (if (<= z -1.0) t_1 (if (<= z 1.0) (* x (- (/ y z) t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * ((y - (-1.0 * t)) / z);
double tmp;
if (z <= -1.0) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = x * ((y / z) - 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)
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) :: t_1
real(8) :: tmp
t_1 = x * ((y - ((-1.0d0) * t)) / z)
if (z <= (-1.0d0)) then
tmp = t_1
else if (z <= 1.0d0) then
tmp = x * ((y / z) - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * ((y - (-1.0 * t)) / z);
double tmp;
if (z <= -1.0) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * ((y - (-1.0 * t)) / z) tmp = 0 if z <= -1.0: tmp = t_1 elif z <= 1.0: tmp = x * ((y / z) - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(Float64(y - Float64(-1.0 * t)) / z)) tmp = 0.0 if (z <= -1.0) tmp = t_1; elseif (z <= 1.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * ((y - (-1.0 * t)) / z); tmp = 0.0; if (z <= -1.0) tmp = t_1; elseif (z <= 1.0) tmp = x * ((y / z) - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(N[(y - N[(-1.0 * t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.0], t$95$1, If[LessEqual[z, 1.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y - -1 \cdot t}{z}\\
\mathbf{if}\;z \leq -1:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1 or 1 < z Initial program 94.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower--.f64N/A
lower-*.f6474.0
Applied rewrites74.0%
if -1 < z < 1Initial program 94.8%
Taylor expanded in z around 0
Applied rewrites64.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* (+ y t) x) z))) (if (<= z -0.029) t_1 (if (<= z 1.0) (* x (- (/ y z) t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((y + t) * x) / z;
double tmp;
if (z <= -0.029) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = x * ((y / z) - 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)
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) :: t_1
real(8) :: tmp
t_1 = ((y + t) * x) / z
if (z <= (-0.029d0)) then
tmp = t_1
else if (z <= 1.0d0) then
tmp = x * ((y / z) - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = ((y + t) * x) / z;
double tmp;
if (z <= -0.029) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((y + t) * x) / z tmp = 0 if z <= -0.029: tmp = t_1 elif z <= 1.0: tmp = x * ((y / z) - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(y + t) * x) / z) tmp = 0.0 if (z <= -0.029) tmp = t_1; elseif (z <= 1.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((y + t) * x) / z; tmp = 0.0; if (z <= -0.029) tmp = t_1; elseif (z <= 1.0) tmp = x * ((y / z) - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(y + t), $MachinePrecision] * x), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[z, -0.029], t$95$1, If[LessEqual[z, 1.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(y + t\right) \cdot x}{z}\\
\mathbf{if}\;z \leq -0.029:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.0290000000000000015 or 1 < z Initial program 94.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6471.3
Applied rewrites71.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.3
lift--.f64N/A
lift-*.f64N/A
mul-1-negN/A
add-flip-revN/A
lower-+.f6471.3
Applied rewrites71.3%
if -0.0290000000000000015 < z < 1Initial program 94.8%
Taylor expanded in z around 0
Applied rewrites64.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (+ y t) (/ x z)))) (if (<= z -0.029) t_1 (if (<= z 1.0) (* x (- (/ y z) t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y + t) * (x / z);
double tmp;
if (z <= -0.029) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = x * ((y / z) - 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)
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) :: t_1
real(8) :: tmp
t_1 = (y + t) * (x / z)
if (z <= (-0.029d0)) then
tmp = t_1
else if (z <= 1.0d0) then
tmp = x * ((y / z) - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y + t) * (x / z);
double tmp;
if (z <= -0.029) {
tmp = t_1;
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y + t) * (x / z) tmp = 0 if z <= -0.029: tmp = t_1 elif z <= 1.0: tmp = x * ((y / z) - t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y + t) * Float64(x / z)) tmp = 0.0 if (z <= -0.029) tmp = t_1; elseif (z <= 1.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y + t) * (x / z); tmp = 0.0; if (z <= -0.029) tmp = t_1; elseif (z <= 1.0) tmp = x * ((y / z) - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y + t), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.029], t$95$1, If[LessEqual[z, 1.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + t\right) \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -0.029:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -0.0290000000000000015 or 1 < z Initial program 94.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6471.3
Applied rewrites71.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
mult-flip-revN/A
lift-/.f64N/A
lift-*.f64N/A
lower-*.f6471.2
lift--.f64N/A
lift-*.f64N/A
mul-1-negN/A
add-flip-revN/A
lower-+.f6471.2
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6471.3
Applied rewrites71.3%
if -0.0290000000000000015 < z < 1Initial program 94.8%
Taylor expanded in z around 0
Applied rewrites64.5%
(FPCore (x y z t) :precision binary64 (if (<= z -1.05e+159) (* x (/ t z)) (if (<= z 1.0) (* x (- (/ y z) t)) (* (/ y z) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.05e+159) {
tmp = x * (t / z);
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = (y / z) * x;
}
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)
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) :: tmp
if (z <= (-1.05d+159)) then
tmp = x * (t / z)
else if (z <= 1.0d0) then
tmp = x * ((y / z) - t)
else
tmp = (y / z) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.05e+159) {
tmp = x * (t / z);
} else if (z <= 1.0) {
tmp = x * ((y / z) - t);
} else {
tmp = (y / z) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.05e+159: tmp = x * (t / z) elif z <= 1.0: tmp = x * ((y / z) - t) else: tmp = (y / z) * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.05e+159) tmp = Float64(x * Float64(t / z)); elseif (z <= 1.0) tmp = Float64(x * Float64(Float64(y / z) - t)); else tmp = Float64(Float64(y / z) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.05e+159) tmp = x * (t / z); elseif (z <= 1.0) tmp = x * ((y / z) - t); else tmp = (y / z) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.05e+159], N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.0], N[(x * N[(N[(y / z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+159}:\\
\;\;\;\;x \cdot \frac{t}{z}\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;x \cdot \left(\frac{y}{z} - t\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\end{array}
\end{array}
if z < -1.04999999999999994e159Initial program 94.8%
lift--.f64N/A
sub-negate-revN/A
lift-/.f64N/A
frac-2negN/A
sub-to-fractionN/A
distribute-neg-frac2N/A
remove-double-negN/A
lower-/.f64N/A
Applied rewrites83.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6446.0
Applied rewrites46.0%
Taylor expanded in z around inf
lower-/.f6435.9
Applied rewrites35.9%
if -1.04999999999999994e159 < z < 1Initial program 94.8%
Taylor expanded in z around 0
Applied rewrites64.5%
if 1 < z Initial program 94.8%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (/ (* x y) z))) (if (<= y -2.15e-13) t_1 (if (<= y 6.5e-36) (* x (/ t (- z 1.0))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x * y) / z;
double tmp;
if (y <= -2.15e-13) {
tmp = t_1;
} else if (y <= 6.5e-36) {
tmp = x * (t / (z - 1.0));
} 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)
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) :: t_1
real(8) :: tmp
t_1 = (x * y) / z
if (y <= (-2.15d-13)) then
tmp = t_1
else if (y <= 6.5d-36) then
tmp = x * (t / (z - 1.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * y) / z;
double tmp;
if (y <= -2.15e-13) {
tmp = t_1;
} else if (y <= 6.5e-36) {
tmp = x * (t / (z - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * y) / z tmp = 0 if y <= -2.15e-13: tmp = t_1 elif y <= 6.5e-36: tmp = x * (t / (z - 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * y) / z) tmp = 0.0 if (y <= -2.15e-13) tmp = t_1; elseif (y <= 6.5e-36) tmp = Float64(x * Float64(t / Float64(z - 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * y) / z; tmp = 0.0; if (y <= -2.15e-13) tmp = t_1; elseif (y <= 6.5e-36) tmp = x * (t / (z - 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[y, -2.15e-13], t$95$1, If[LessEqual[y, 6.5e-36], N[(x * N[(t / N[(z - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot y}{z}\\
\mathbf{if}\;y \leq -2.15 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-36}:\\
\;\;\;\;x \cdot \frac{t}{z - 1}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.1499999999999999e-13 or 6.50000000000000012e-36 < y Initial program 94.8%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
if -2.1499999999999999e-13 < y < 6.50000000000000012e-36Initial program 94.8%
lift--.f64N/A
sub-negate-revN/A
lift-/.f64N/A
frac-2negN/A
sub-to-fractionN/A
distribute-neg-frac2N/A
remove-double-negN/A
lower-/.f64N/A
Applied rewrites83.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6446.0
Applied rewrites46.0%
(FPCore (x y z t)
:precision binary64
(if (<= t -5.4e+255)
(/ (* x t) z)
(if (<= t 3.5e-174)
(* (/ y z) x)
(if (<= t 2.8e+141) (/ (* x y) z) (* (- t) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.4e+255) {
tmp = (x * t) / z;
} else if (t <= 3.5e-174) {
tmp = (y / z) * x;
} else if (t <= 2.8e+141) {
tmp = (x * y) / z;
} else {
tmp = -t * x;
}
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)
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) :: tmp
if (t <= (-5.4d+255)) then
tmp = (x * t) / z
else if (t <= 3.5d-174) then
tmp = (y / z) * x
else if (t <= 2.8d+141) then
tmp = (x * y) / z
else
tmp = -t * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.4e+255) {
tmp = (x * t) / z;
} else if (t <= 3.5e-174) {
tmp = (y / z) * x;
} else if (t <= 2.8e+141) {
tmp = (x * y) / z;
} else {
tmp = -t * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5.4e+255: tmp = (x * t) / z elif t <= 3.5e-174: tmp = (y / z) * x elif t <= 2.8e+141: tmp = (x * y) / z else: tmp = -t * x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5.4e+255) tmp = Float64(Float64(x * t) / z); elseif (t <= 3.5e-174) tmp = Float64(Float64(y / z) * x); elseif (t <= 2.8e+141) tmp = Float64(Float64(x * y) / z); else tmp = Float64(Float64(-t) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -5.4e+255) tmp = (x * t) / z; elseif (t <= 3.5e-174) tmp = (y / z) * x; elseif (t <= 2.8e+141) tmp = (x * y) / z; else tmp = -t * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.4e+255], N[(N[(x * t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 3.5e-174], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 2.8e+141], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], N[((-t) * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.4 \cdot 10^{+255}:\\
\;\;\;\;\frac{x \cdot t}{z}\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-174}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{+141}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot x\\
\end{array}
\end{array}
if t < -5.4000000000000002e255Initial program 94.8%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6471.3
Applied rewrites71.3%
Taylor expanded in y around 0
Applied rewrites33.2%
if -5.4000000000000002e255 < t < 3.49999999999999987e-174Initial program 94.8%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
if 3.49999999999999987e-174 < t < 2.79999999999999991e141Initial program 94.8%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
if 2.79999999999999991e141 < t Initial program 94.8%
lift--.f64N/A
sub-negate-revN/A
lift-/.f64N/A
frac-2negN/A
sub-to-fractionN/A
distribute-neg-frac2N/A
remove-double-negN/A
lower-/.f64N/A
Applied rewrites83.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6446.0
Applied rewrites46.0%
Taylor expanded in z around 0
lower-*.f6423.0
Applied rewrites23.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6423.0
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6423.0
Applied rewrites23.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- t) x))
(t_2 (- (/ y z) (/ t (- 1.0 z))))
(t_3 (* (/ x z) y)))
(if (<= t_2 -2e+292)
t_3
(if (<= t_2 -1e+226)
t_1
(if (<= t_2 5e+194) (* (/ y z) x) (if (<= t_2 4e+216) t_1 t_3))))))
double code(double x, double y, double z, double t) {
double t_1 = -t * x;
double t_2 = (y / z) - (t / (1.0 - z));
double t_3 = (x / z) * y;
double tmp;
if (t_2 <= -2e+292) {
tmp = t_3;
} else if (t_2 <= -1e+226) {
tmp = t_1;
} else if (t_2 <= 5e+194) {
tmp = (y / z) * x;
} else if (t_2 <= 4e+216) {
tmp = t_1;
} else {
tmp = t_3;
}
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)
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) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = -t * x
t_2 = (y / z) - (t / (1.0d0 - z))
t_3 = (x / z) * y
if (t_2 <= (-2d+292)) then
tmp = t_3
else if (t_2 <= (-1d+226)) then
tmp = t_1
else if (t_2 <= 5d+194) then
tmp = (y / z) * x
else if (t_2 <= 4d+216) then
tmp = t_1
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -t * x;
double t_2 = (y / z) - (t / (1.0 - z));
double t_3 = (x / z) * y;
double tmp;
if (t_2 <= -2e+292) {
tmp = t_3;
} else if (t_2 <= -1e+226) {
tmp = t_1;
} else if (t_2 <= 5e+194) {
tmp = (y / z) * x;
} else if (t_2 <= 4e+216) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t): t_1 = -t * x t_2 = (y / z) - (t / (1.0 - z)) t_3 = (x / z) * y tmp = 0 if t_2 <= -2e+292: tmp = t_3 elif t_2 <= -1e+226: tmp = t_1 elif t_2 <= 5e+194: tmp = (y / z) * x elif t_2 <= 4e+216: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-t) * x) t_2 = Float64(Float64(y / z) - Float64(t / Float64(1.0 - z))) t_3 = Float64(Float64(x / z) * y) tmp = 0.0 if (t_2 <= -2e+292) tmp = t_3; elseif (t_2 <= -1e+226) tmp = t_1; elseif (t_2 <= 5e+194) tmp = Float64(Float64(y / z) * x); elseif (t_2 <= 4e+216) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -t * x; t_2 = (y / z) - (t / (1.0 - z)); t_3 = (x / z) * y; tmp = 0.0; if (t_2 <= -2e+292) tmp = t_3; elseif (t_2 <= -1e+226) tmp = t_1; elseif (t_2 <= 5e+194) tmp = (y / z) * x; elseif (t_2 <= 4e+216) tmp = t_1; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-t) * x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y / z), $MachinePrecision] - N[(t / N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+292], t$95$3, If[LessEqual[t$95$2, -1e+226], t$95$1, If[LessEqual[t$95$2, 5e+194], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$2, 4e+216], t$95$1, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-t\right) \cdot x\\
t_2 := \frac{y}{z} - \frac{t}{1 - z}\\
t_3 := \frac{x}{z} \cdot y\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+292}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+226}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+194}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+216}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -2e292 or 4.0000000000000001e216 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) Initial program 94.8%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
mult-flip-revN/A
lift-/.f64N/A
lift-*.f64N/A
lower-*.f6461.1
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6461.2
Applied rewrites61.2%
if -2e292 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < -9.99999999999999961e225 or 4.99999999999999989e194 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 4.0000000000000001e216Initial program 94.8%
lift--.f64N/A
sub-negate-revN/A
lift-/.f64N/A
frac-2negN/A
sub-to-fractionN/A
distribute-neg-frac2N/A
remove-double-negN/A
lower-/.f64N/A
Applied rewrites83.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6446.0
Applied rewrites46.0%
Taylor expanded in z around 0
lower-*.f6423.0
Applied rewrites23.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6423.0
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6423.0
Applied rewrites23.0%
if -9.99999999999999961e225 < (-.f64 (/.f64 y z) (/.f64 t (-.f64 #s(literal 1 binary64) z))) < 4.99999999999999989e194Initial program 94.8%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ t z)))) (if (<= t -5.4e+255) t_1 (if (<= t 1.95e+120) (* (/ y z) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -5.4e+255) {
tmp = t_1;
} else if (t <= 1.95e+120) {
tmp = (y / z) * 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)
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) :: t_1
real(8) :: tmp
t_1 = x * (t / z)
if (t <= (-5.4d+255)) then
tmp = t_1
else if (t <= 1.95d+120) then
tmp = (y / z) * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * (t / z);
double tmp;
if (t <= -5.4e+255) {
tmp = t_1;
} else if (t <= 1.95e+120) {
tmp = (y / z) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (t / z) tmp = 0 if t <= -5.4e+255: tmp = t_1 elif t <= 1.95e+120: tmp = (y / z) * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(t / z)) tmp = 0.0 if (t <= -5.4e+255) tmp = t_1; elseif (t <= 1.95e+120) tmp = Float64(Float64(y / z) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (t / z); tmp = 0.0; if (t <= -5.4e+255) tmp = t_1; elseif (t <= 1.95e+120) tmp = (y / z) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(t / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.4e+255], t$95$1, If[LessEqual[t, 1.95e+120], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{t}{z}\\
\mathbf{if}\;t \leq -5.4 \cdot 10^{+255}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+120}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.4000000000000002e255 or 1.9499999999999999e120 < t Initial program 94.8%
lift--.f64N/A
sub-negate-revN/A
lift-/.f64N/A
frac-2negN/A
sub-to-fractionN/A
distribute-neg-frac2N/A
remove-double-negN/A
lower-/.f64N/A
Applied rewrites83.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6446.0
Applied rewrites46.0%
Taylor expanded in z around inf
lower-/.f6435.9
Applied rewrites35.9%
if -5.4000000000000002e255 < t < 1.9499999999999999e120Initial program 94.8%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
(FPCore (x y z t) :precision binary64 (if (<= t 3.5e-174) (* (/ y z) x) (if (<= t 2.8e+141) (/ (* x y) z) (* (- t) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.5e-174) {
tmp = (y / z) * x;
} else if (t <= 2.8e+141) {
tmp = (x * y) / z;
} else {
tmp = -t * x;
}
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)
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) :: tmp
if (t <= 3.5d-174) then
tmp = (y / z) * x
else if (t <= 2.8d+141) then
tmp = (x * y) / z
else
tmp = -t * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 3.5e-174) {
tmp = (y / z) * x;
} else if (t <= 2.8e+141) {
tmp = (x * y) / z;
} else {
tmp = -t * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 3.5e-174: tmp = (y / z) * x elif t <= 2.8e+141: tmp = (x * y) / z else: tmp = -t * x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 3.5e-174) tmp = Float64(Float64(y / z) * x); elseif (t <= 2.8e+141) tmp = Float64(Float64(x * y) / z); else tmp = Float64(Float64(-t) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 3.5e-174) tmp = (y / z) * x; elseif (t <= 2.8e+141) tmp = (x * y) / z; else tmp = -t * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 3.5e-174], N[(N[(y / z), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 2.8e+141], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], N[((-t) * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.5 \cdot 10^{-174}:\\
\;\;\;\;\frac{y}{z} \cdot x\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{+141}:\\
\;\;\;\;\frac{x \cdot y}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot x\\
\end{array}
\end{array}
if t < 3.49999999999999987e-174Initial program 94.8%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
if 3.49999999999999987e-174 < t < 2.79999999999999991e141Initial program 94.8%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
if 2.79999999999999991e141 < t Initial program 94.8%
lift--.f64N/A
sub-negate-revN/A
lift-/.f64N/A
frac-2negN/A
sub-to-fractionN/A
distribute-neg-frac2N/A
remove-double-negN/A
lower-/.f64N/A
Applied rewrites83.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6446.0
Applied rewrites46.0%
Taylor expanded in z around 0
lower-*.f6423.0
Applied rewrites23.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6423.0
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6423.0
Applied rewrites23.0%
(FPCore (x y z t) :precision binary64 (if (<= t 2.8e+141) (* (/ x z) y) (* (- t) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.8e+141) {
tmp = (x / z) * y;
} else {
tmp = -t * x;
}
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)
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) :: tmp
if (t <= 2.8d+141) then
tmp = (x / z) * y
else
tmp = -t * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= 2.8e+141) {
tmp = (x / z) * y;
} else {
tmp = -t * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= 2.8e+141: tmp = (x / z) * y else: tmp = -t * x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= 2.8e+141) tmp = Float64(Float64(x / z) * y); else tmp = Float64(Float64(-t) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= 2.8e+141) tmp = (x / z) * y; else tmp = -t * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, 2.8e+141], N[(N[(x / z), $MachinePrecision] * y), $MachinePrecision], N[((-t) * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.8 \cdot 10^{+141}:\\
\;\;\;\;\frac{x}{z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot x\\
\end{array}
\end{array}
if t < 2.79999999999999991e141Initial program 94.8%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6460.7
Applied rewrites60.7%
lift-/.f64N/A
lift-*.f64N/A
associate-*l/N/A
mult-flip-revN/A
lift-/.f64N/A
lift-*.f64N/A
lower-*.f6461.1
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f6461.2
Applied rewrites61.2%
if 2.79999999999999991e141 < t Initial program 94.8%
lift--.f64N/A
sub-negate-revN/A
lift-/.f64N/A
frac-2negN/A
sub-to-fractionN/A
distribute-neg-frac2N/A
remove-double-negN/A
lower-/.f64N/A
Applied rewrites83.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6446.0
Applied rewrites46.0%
Taylor expanded in z around 0
lower-*.f6423.0
Applied rewrites23.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6423.0
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6423.0
Applied rewrites23.0%
(FPCore (x y z t) :precision binary64 (* (- t) x))
double code(double x, double y, double z, double t) {
return -t * 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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -t * x
end function
public static double code(double x, double y, double z, double t) {
return -t * x;
}
def code(x, y, z, t): return -t * x
function code(x, y, z, t) return Float64(Float64(-t) * x) end
function tmp = code(x, y, z, t) tmp = -t * x; end
code[x_, y_, z_, t_] := N[((-t) * x), $MachinePrecision]
\begin{array}{l}
\\
\left(-t\right) \cdot x
\end{array}
Initial program 94.8%
lift--.f64N/A
sub-negate-revN/A
lift-/.f64N/A
frac-2negN/A
sub-to-fractionN/A
distribute-neg-frac2N/A
remove-double-negN/A
lower-/.f64N/A
Applied rewrites83.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower--.f6446.0
Applied rewrites46.0%
Taylor expanded in z around 0
lower-*.f6423.0
Applied rewrites23.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6423.0
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6423.0
Applied rewrites23.0%
herbie shell --seed 2025155
(FPCore (x y z t)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, C"
:precision binary64
(* x (- (/ y z) (/ t (- 1.0 z)))))