
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - 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 - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (* x (- y z)) (- t z)))
double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - 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 - z)
end function
public static double code(double x, double y, double z, double t) {
return (x * (y - z)) / (t - z);
}
def code(x, y, z, t): return (x * (y - z)) / (t - z)
function code(x, y, z, t) return Float64(Float64(x * Float64(y - z)) / Float64(t - z)) end
function tmp = code(x, y, z, t) tmp = (x * (y - z)) / (t - z); end
code[x_, y_, z_, t_] := N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(y - z\right)}{t - z}
\end{array}
(FPCore (x y z t) :precision binary64 (* x (/ (- y z) (- t z))))
double code(double x, double y, double z, double t) {
return x * ((y - z) / (t - 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 - z))
end function
public static double code(double x, double y, double z, double t) {
return x * ((y - z) / (t - z));
}
def code(x, y, z, t): return x * ((y - z) / (t - z))
function code(x, y, z, t) return Float64(x * Float64(Float64(y - z) / Float64(t - z))) end
function tmp = code(x, y, z, t) tmp = x * ((y - z) / (t - z)); end
code[x_, y_, z_, t_] := N[(x * N[(N[(y - z), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{y - z}{t - z}
\end{array}
Initial program 84.0%
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6496.8
Applied rewrites96.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (/ y (- t z))))) (if (<= y -4.6e-14) t_1 (if (<= y 1.28e+36) (* x (/ (- z) (- t z))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (y / (t - z));
double tmp;
if (y <= -4.6e-14) {
tmp = t_1;
} else if (y <= 1.28e+36) {
tmp = x * (-z / (t - z));
} 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 / (t - z))
if (y <= (-4.6d-14)) then
tmp = t_1
else if (y <= 1.28d+36) then
tmp = x * (-z / (t - z))
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 / (t - z));
double tmp;
if (y <= -4.6e-14) {
tmp = t_1;
} else if (y <= 1.28e+36) {
tmp = x * (-z / (t - z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (y / (t - z)) tmp = 0 if y <= -4.6e-14: tmp = t_1 elif y <= 1.28e+36: tmp = x * (-z / (t - z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(y / Float64(t - z))) tmp = 0.0 if (y <= -4.6e-14) tmp = t_1; elseif (y <= 1.28e+36) tmp = Float64(x * Float64(Float64(-z) / Float64(t - z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (y / (t - z)); tmp = 0.0; if (y <= -4.6e-14) tmp = t_1; elseif (y <= 1.28e+36) tmp = x * (-z / (t - z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.6e-14], t$95$1, If[LessEqual[y, 1.28e+36], N[(x * N[((-z) / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{t - z}\\
\mathbf{if}\;y \leq -4.6 \cdot 10^{-14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.28 \cdot 10^{+36}:\\
\;\;\;\;x \cdot \frac{-z}{t - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.59999999999999996e-14 or 1.27999999999999993e36 < y Initial program 82.8%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6473.2
Applied rewrites73.2%
if -4.59999999999999996e-14 < y < 1.27999999999999993e36Initial program 85.1%
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6496.7
Applied rewrites96.7%
Taylor expanded in y around 0
mul-1-negN/A
lift-neg.f6477.2
Applied rewrites77.2%
(FPCore (x y z t)
:precision binary64
(if (<= z -4e+101)
x
(if (<= z -7.2e-220)
(* x (/ y (- t z)))
(if (<= z 2.55e-107)
(/ (* x y) (- t z))
(if (<= z 1.38e+122) (* x (/ (- y z) t)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4e+101) {
tmp = x;
} else if (z <= -7.2e-220) {
tmp = x * (y / (t - z));
} else if (z <= 2.55e-107) {
tmp = (x * y) / (t - z);
} else if (z <= 1.38e+122) {
tmp = x * ((y - z) / t);
} else {
tmp = 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 <= (-4d+101)) then
tmp = x
else if (z <= (-7.2d-220)) then
tmp = x * (y / (t - z))
else if (z <= 2.55d-107) then
tmp = (x * y) / (t - z)
else if (z <= 1.38d+122) then
tmp = x * ((y - z) / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4e+101) {
tmp = x;
} else if (z <= -7.2e-220) {
tmp = x * (y / (t - z));
} else if (z <= 2.55e-107) {
tmp = (x * y) / (t - z);
} else if (z <= 1.38e+122) {
tmp = x * ((y - z) / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4e+101: tmp = x elif z <= -7.2e-220: tmp = x * (y / (t - z)) elif z <= 2.55e-107: tmp = (x * y) / (t - z) elif z <= 1.38e+122: tmp = x * ((y - z) / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4e+101) tmp = x; elseif (z <= -7.2e-220) tmp = Float64(x * Float64(y / Float64(t - z))); elseif (z <= 2.55e-107) tmp = Float64(Float64(x * y) / Float64(t - z)); elseif (z <= 1.38e+122) tmp = Float64(x * Float64(Float64(y - z) / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4e+101) tmp = x; elseif (z <= -7.2e-220) tmp = x * (y / (t - z)); elseif (z <= 2.55e-107) tmp = (x * y) / (t - z); elseif (z <= 1.38e+122) tmp = x * ((y - z) / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4e+101], x, If[LessEqual[z, -7.2e-220], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.55e-107], N[(N[(x * y), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.38e+122], N[(x * N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+101}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-220}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{elif}\;z \leq 2.55 \cdot 10^{-107}:\\
\;\;\;\;\frac{x \cdot y}{t - z}\\
\mathbf{elif}\;z \leq 1.38 \cdot 10^{+122}:\\
\;\;\;\;x \cdot \frac{y - z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.9999999999999999e101 or 1.37999999999999992e122 < z Initial program 67.1%
Taylor expanded in z around inf
Applied rewrites70.1%
if -3.9999999999999999e101 < z < -7.20000000000000042e-220Initial program 92.3%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6463.5
Applied rewrites63.5%
if -7.20000000000000042e-220 < z < 2.5500000000000001e-107Initial program 92.3%
Taylor expanded in y around inf
Applied rewrites84.6%
if 2.5500000000000001e-107 < z < 1.37999999999999992e122Initial program 90.9%
Taylor expanded in z around 0
Applied rewrites48.2%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6452.3
Applied rewrites52.3%
(FPCore (x y z t) :precision binary64 (if (<= z -4e+101) x (if (<= z 3.3e+140) (* x (/ y (- t z))) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4e+101) {
tmp = x;
} else if (z <= 3.3e+140) {
tmp = x * (y / (t - z));
} else {
tmp = 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 <= (-4d+101)) then
tmp = x
else if (z <= 3.3d+140) then
tmp = x * (y / (t - z))
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -4e+101) {
tmp = x;
} else if (z <= 3.3e+140) {
tmp = x * (y / (t - z));
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -4e+101: tmp = x elif z <= 3.3e+140: tmp = x * (y / (t - z)) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -4e+101) tmp = x; elseif (z <= 3.3e+140) tmp = Float64(x * Float64(y / Float64(t - z))); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -4e+101) tmp = x; elseif (z <= 3.3e+140) tmp = x * (y / (t - z)); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -4e+101], x, If[LessEqual[z, 3.3e+140], N[(x * N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+101}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+140}:\\
\;\;\;\;x \cdot \frac{y}{t - z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.9999999999999999e101 or 3.3000000000000002e140 < z Initial program 66.6%
Taylor expanded in z around inf
Applied rewrites71.1%
if -3.9999999999999999e101 < z < 3.3000000000000002e140Initial program 91.6%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6467.6
Applied rewrites67.6%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.55e+91)
x
(if (<= z -4e+28)
(* x (/ (- y) z))
(if (<= z 8.6e+30)
(* x (/ y t))
(if (<= z 2.15e+110) (/ (* x (- z)) t) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e+91) {
tmp = x;
} else if (z <= -4e+28) {
tmp = x * (-y / z);
} else if (z <= 8.6e+30) {
tmp = x * (y / t);
} else if (z <= 2.15e+110) {
tmp = (x * -z) / t;
} else {
tmp = 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.55d+91)) then
tmp = x
else if (z <= (-4d+28)) then
tmp = x * (-y / z)
else if (z <= 8.6d+30) then
tmp = x * (y / t)
else if (z <= 2.15d+110) then
tmp = (x * -z) / t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e+91) {
tmp = x;
} else if (z <= -4e+28) {
tmp = x * (-y / z);
} else if (z <= 8.6e+30) {
tmp = x * (y / t);
} else if (z <= 2.15e+110) {
tmp = (x * -z) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.55e+91: tmp = x elif z <= -4e+28: tmp = x * (-y / z) elif z <= 8.6e+30: tmp = x * (y / t) elif z <= 2.15e+110: tmp = (x * -z) / t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.55e+91) tmp = x; elseif (z <= -4e+28) tmp = Float64(x * Float64(Float64(-y) / z)); elseif (z <= 8.6e+30) tmp = Float64(x * Float64(y / t)); elseif (z <= 2.15e+110) tmp = Float64(Float64(x * Float64(-z)) / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.55e+91) tmp = x; elseif (z <= -4e+28) tmp = x * (-y / z); elseif (z <= 8.6e+30) tmp = x * (y / t); elseif (z <= 2.15e+110) tmp = (x * -z) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.55e+91], x, If[LessEqual[z, -4e+28], N[(x * N[((-y) / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.6e+30], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.15e+110], N[(N[(x * (-z)), $MachinePrecision] / t), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+91}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -4 \cdot 10^{+28}:\\
\;\;\;\;x \cdot \frac{-y}{z}\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{+30}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{+110}:\\
\;\;\;\;\frac{x \cdot \left(-z\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.54999999999999999e91 or 2.15000000000000003e110 < z Initial program 67.7%
Taylor expanded in z around inf
Applied rewrites68.6%
if -1.54999999999999999e91 < z < -3.99999999999999983e28Initial program 87.8%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6448.8
Applied rewrites48.8%
Taylor expanded in z around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6431.2
Applied rewrites31.2%
if -3.99999999999999983e28 < z < 8.6e30Initial program 93.5%
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6494.2
Applied rewrites94.2%
Taylor expanded in z around 0
lower-/.f6461.7
Applied rewrites61.7%
if 8.6e30 < z < 2.15000000000000003e110Initial program 86.3%
Taylor expanded in z around 0
Applied rewrites35.3%
Taylor expanded in y around 0
mul-1-negN/A
lift-neg.f6428.2
Applied rewrites28.2%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.55e+91)
x
(if (<= z -4e+28)
(* x (/ (- y) z))
(if (<= z 8.6e+30)
(* x (/ y t))
(if (<= z 2.15e+110) (* x (/ (- z) t)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e+91) {
tmp = x;
} else if (z <= -4e+28) {
tmp = x * (-y / z);
} else if (z <= 8.6e+30) {
tmp = x * (y / t);
} else if (z <= 2.15e+110) {
tmp = x * (-z / t);
} else {
tmp = 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.55d+91)) then
tmp = x
else if (z <= (-4d+28)) then
tmp = x * (-y / z)
else if (z <= 8.6d+30) then
tmp = x * (y / t)
else if (z <= 2.15d+110) then
tmp = x * (-z / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e+91) {
tmp = x;
} else if (z <= -4e+28) {
tmp = x * (-y / z);
} else if (z <= 8.6e+30) {
tmp = x * (y / t);
} else if (z <= 2.15e+110) {
tmp = x * (-z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.55e+91: tmp = x elif z <= -4e+28: tmp = x * (-y / z) elif z <= 8.6e+30: tmp = x * (y / t) elif z <= 2.15e+110: tmp = x * (-z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.55e+91) tmp = x; elseif (z <= -4e+28) tmp = Float64(x * Float64(Float64(-y) / z)); elseif (z <= 8.6e+30) tmp = Float64(x * Float64(y / t)); elseif (z <= 2.15e+110) tmp = Float64(x * Float64(Float64(-z) / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.55e+91) tmp = x; elseif (z <= -4e+28) tmp = x * (-y / z); elseif (z <= 8.6e+30) tmp = x * (y / t); elseif (z <= 2.15e+110) tmp = x * (-z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.55e+91], x, If[LessEqual[z, -4e+28], N[(x * N[((-y) / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.6e+30], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.15e+110], N[(x * N[((-z) / t), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+91}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -4 \cdot 10^{+28}:\\
\;\;\;\;x \cdot \frac{-y}{z}\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{+30}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{+110}:\\
\;\;\;\;x \cdot \frac{-z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.54999999999999999e91 or 2.15000000000000003e110 < z Initial program 67.7%
Taylor expanded in z around inf
Applied rewrites68.6%
if -1.54999999999999999e91 < z < -3.99999999999999983e28Initial program 87.8%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6448.8
Applied rewrites48.8%
Taylor expanded in z around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6431.2
Applied rewrites31.2%
if -3.99999999999999983e28 < z < 8.6e30Initial program 93.5%
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6494.2
Applied rewrites94.2%
Taylor expanded in z around 0
lower-/.f6461.7
Applied rewrites61.7%
if 8.6e30 < z < 2.15000000000000003e110Initial program 86.3%
Taylor expanded in z around 0
Applied rewrites35.3%
Taylor expanded in y around 0
mul-1-negN/A
lift-neg.f6428.2
Applied rewrites28.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6430.3
Applied rewrites30.3%
(FPCore (x y z t) :precision binary64 (if (<= z -1.55e+91) x (if (<= z -4e+28) (* x (/ (- y) z)) (if (<= z 2.5e+102) (* x (/ y t)) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e+91) {
tmp = x;
} else if (z <= -4e+28) {
tmp = x * (-y / z);
} else if (z <= 2.5e+102) {
tmp = x * (y / t);
} else {
tmp = 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.55d+91)) then
tmp = x
else if (z <= (-4d+28)) then
tmp = x * (-y / z)
else if (z <= 2.5d+102) then
tmp = x * (y / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e+91) {
tmp = x;
} else if (z <= -4e+28) {
tmp = x * (-y / z);
} else if (z <= 2.5e+102) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.55e+91: tmp = x elif z <= -4e+28: tmp = x * (-y / z) elif z <= 2.5e+102: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.55e+91) tmp = x; elseif (z <= -4e+28) tmp = Float64(x * Float64(Float64(-y) / z)); elseif (z <= 2.5e+102) tmp = Float64(x * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.55e+91) tmp = x; elseif (z <= -4e+28) tmp = x * (-y / z); elseif (z <= 2.5e+102) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.55e+91], x, If[LessEqual[z, -4e+28], N[(x * N[((-y) / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.5e+102], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+91}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -4 \cdot 10^{+28}:\\
\;\;\;\;x \cdot \frac{-y}{z}\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+102}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.54999999999999999e91 or 2.5e102 < z Initial program 68.0%
Taylor expanded in z around inf
Applied rewrites68.2%
if -1.54999999999999999e91 < z < -3.99999999999999983e28Initial program 87.8%
Taylor expanded in y around inf
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6448.8
Applied rewrites48.8%
Taylor expanded in z around inf
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6431.2
Applied rewrites31.2%
if -3.99999999999999983e28 < z < 2.5e102Initial program 92.7%
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6494.7
Applied rewrites94.7%
Taylor expanded in z around 0
lower-/.f6457.7
Applied rewrites57.7%
(FPCore (x y z t) :precision binary64 (if (<= z -3.4e+47) x (if (<= z 2.5e+102) (* x (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.4e+47) {
tmp = x;
} else if (z <= 2.5e+102) {
tmp = x * (y / t);
} else {
tmp = 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 <= (-3.4d+47)) then
tmp = x
else if (z <= 2.5d+102) then
tmp = x * (y / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -3.4e+47) {
tmp = x;
} else if (z <= 2.5e+102) {
tmp = x * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -3.4e+47: tmp = x elif z <= 2.5e+102: tmp = x * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -3.4e+47) tmp = x; elseif (z <= 2.5e+102) tmp = Float64(x * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -3.4e+47) tmp = x; elseif (z <= 2.5e+102) tmp = x * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -3.4e+47], x, If[LessEqual[z, 2.5e+102], N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.4 \cdot 10^{+47}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+102}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -3.3999999999999998e47 or 2.5e102 < z Initial program 70.1%
Taylor expanded in z around inf
Applied rewrites65.0%
if -3.3999999999999998e47 < z < 2.5e102Initial program 92.6%
lift--.f64N/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6494.9
Applied rewrites94.9%
Taylor expanded in z around 0
lower-/.f6457.1
Applied rewrites57.1%
(FPCore (x y z t) :precision binary64 (if (<= z -1.9e+24) x (if (<= z 2.5e+24) (/ (* y x) t) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.9e+24) {
tmp = x;
} else if (z <= 2.5e+24) {
tmp = (y * x) / t;
} else {
tmp = 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.9d+24)) then
tmp = x
else if (z <= 2.5d+24) then
tmp = (y * x) / t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.9e+24) {
tmp = x;
} else if (z <= 2.5e+24) {
tmp = (y * x) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.9e+24: tmp = x elif z <= 2.5e+24: tmp = (y * x) / t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.9e+24) tmp = x; elseif (z <= 2.5e+24) tmp = Float64(Float64(y * x) / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.9e+24) tmp = x; elseif (z <= 2.5e+24) tmp = (y * x) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.9e+24], x, If[LessEqual[z, 2.5e+24], N[(N[(y * x), $MachinePrecision] / t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+24}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{+24}:\\
\;\;\;\;\frac{y \cdot x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -1.90000000000000008e24 or 2.50000000000000023e24 < z Initial program 73.1%
Taylor expanded in z around inf
Applied rewrites59.7%
if -1.90000000000000008e24 < z < 2.50000000000000023e24Initial program 93.6%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6460.7
Applied rewrites60.7%
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
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
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 84.0%
Taylor expanded in z around inf
Applied rewrites34.5%
herbie shell --seed 2025101
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
(/ (* x (- y z)) (- t z)))