
(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 9 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 (* (/ (- z y) (- z t)) x))
double code(double x, double y, double z, double t) {
return ((z - y) / (z - 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 = ((z - y) / (z - t)) * x
end function
public static double code(double x, double y, double z, double t) {
return ((z - y) / (z - t)) * x;
}
def code(x, y, z, t): return ((z - y) / (z - t)) * x
function code(x, y, z, t) return Float64(Float64(Float64(z - y) / Float64(z - t)) * x) end
function tmp = code(x, y, z, t) tmp = ((z - y) / (z - t)) * x; end
code[x_, y_, z_, t_] := N[(N[(N[(z - y), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
\frac{z - y}{z - t} \cdot x
\end{array}
Initial program 84.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6496.7
Applied rewrites96.7%
(FPCore (x y z t) :precision binary64 (if (<= z 2e+183) (* (/ x (- z t)) (- z y)) (* (/ (- z y) z) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 2e+183) {
tmp = (x / (z - t)) * (z - y);
} else {
tmp = ((z - 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 <= 2d+183) then
tmp = (x / (z - t)) * (z - y)
else
tmp = ((z - 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 <= 2e+183) {
tmp = (x / (z - t)) * (z - y);
} else {
tmp = ((z - y) / z) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 2e+183: tmp = (x / (z - t)) * (z - y) else: tmp = ((z - y) / z) * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 2e+183) tmp = Float64(Float64(x / Float64(z - t)) * Float64(z - y)); else tmp = Float64(Float64(Float64(z - y) / z) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 2e+183) tmp = (x / (z - t)) * (z - y); else tmp = ((z - y) / z) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 2e+183], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{+183}:\\
\;\;\;\;\frac{x}{z - t} \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z - y}{z} \cdot x\\
\end{array}
\end{array}
if z < 1.99999999999999989e183Initial program 84.2%
lift-/.f64N/A
frac-2negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower--.f6485.2
Applied rewrites85.2%
if 1.99999999999999989e183 < z Initial program 84.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6496.7
Applied rewrites96.7%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f6452.1
Applied rewrites52.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ (- z y) z) x))) (if (<= z -2.1e-29) t_1 (if (<= z 5.4e-5) (* (/ y (- t z)) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((z - y) / z) * x;
double tmp;
if (z <= -2.1e-29) {
tmp = t_1;
} else if (z <= 5.4e-5) {
tmp = (y / (t - 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 = ((z - y) / z) * x
if (z <= (-2.1d-29)) then
tmp = t_1
else if (z <= 5.4d-5) then
tmp = (y / (t - 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 = ((z - y) / z) * x;
double tmp;
if (z <= -2.1e-29) {
tmp = t_1;
} else if (z <= 5.4e-5) {
tmp = (y / (t - z)) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((z - y) / z) * x tmp = 0 if z <= -2.1e-29: tmp = t_1 elif z <= 5.4e-5: tmp = (y / (t - z)) * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(z - y) / z) * x) tmp = 0.0 if (z <= -2.1e-29) tmp = t_1; elseif (z <= 5.4e-5) tmp = Float64(Float64(y / Float64(t - z)) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((z - y) / z) * x; tmp = 0.0; if (z <= -2.1e-29) tmp = t_1; elseif (z <= 5.4e-5) tmp = (y / (t - z)) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -2.1e-29], t$95$1, If[LessEqual[z, 5.4e-5], N[(N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - y}{z} \cdot x\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{-29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-5}:\\
\;\;\;\;\frac{y}{t - z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.09999999999999989e-29 or 5.3999999999999998e-5 < z Initial program 84.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6496.7
Applied rewrites96.7%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f6452.1
Applied rewrites52.1%
if -2.09999999999999989e-29 < z < 5.3999999999999998e-5Initial program 84.2%
Taylor expanded in z around 0
Applied rewrites47.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6450.4
Applied rewrites50.4%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6453.6
Applied rewrites53.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x (- y z)) (- t z))))
(if (<= t_1 5e-227)
(* (/ y (- t z)) x)
(if (<= t_1 1e+273) (/ (* x (- z y)) z) (* (- z y) (/ x z))))))
double code(double x, double y, double z, double t) {
double t_1 = (x * (y - z)) / (t - z);
double tmp;
if (t_1 <= 5e-227) {
tmp = (y / (t - z)) * x;
} else if (t_1 <= 1e+273) {
tmp = (x * (z - y)) / z;
} else {
tmp = (z - y) * (x / z);
}
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)) / (t - z)
if (t_1 <= 5d-227) then
tmp = (y / (t - z)) * x
else if (t_1 <= 1d+273) then
tmp = (x * (z - y)) / z
else
tmp = (z - y) * (x / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x * (y - z)) / (t - z);
double tmp;
if (t_1 <= 5e-227) {
tmp = (y / (t - z)) * x;
} else if (t_1 <= 1e+273) {
tmp = (x * (z - y)) / z;
} else {
tmp = (z - y) * (x / z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * (y - z)) / (t - z) tmp = 0 if t_1 <= 5e-227: tmp = (y / (t - z)) * x elif t_1 <= 1e+273: tmp = (x * (z - y)) / z else: tmp = (z - y) * (x / z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * Float64(y - z)) / Float64(t - z)) tmp = 0.0 if (t_1 <= 5e-227) tmp = Float64(Float64(y / Float64(t - z)) * x); elseif (t_1 <= 1e+273) tmp = Float64(Float64(x * Float64(z - y)) / z); else tmp = Float64(Float64(z - y) * Float64(x / z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * (y - z)) / (t - z); tmp = 0.0; if (t_1 <= 5e-227) tmp = (y / (t - z)) * x; elseif (t_1 <= 1e+273) tmp = (x * (z - y)) / z; else tmp = (z - y) * (x / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-227], N[(N[(y / N[(t - z), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, 1e+273], N[(N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], N[(N[(z - y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot \left(y - z\right)}{t - z}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-227}:\\
\;\;\;\;\frac{y}{t - z} \cdot x\\
\mathbf{elif}\;t\_1 \leq 10^{+273}:\\
\;\;\;\;\frac{x \cdot \left(z - y\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(z - y\right) \cdot \frac{x}{z}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 4.99999999999999961e-227Initial program 84.2%
Taylor expanded in z around 0
Applied rewrites47.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6450.4
Applied rewrites50.4%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6453.6
Applied rewrites53.6%
if 4.99999999999999961e-227 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 9.99999999999999945e272Initial program 84.2%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6444.7
Applied rewrites44.7%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-fracN/A
lower-/.f64N/A
lift-*.f64N/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f6444.7
Applied rewrites44.7%
if 9.99999999999999945e272 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 84.2%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6444.7
Applied rewrites44.7%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f6443.7
Applied rewrites43.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- z y) (/ x z))))
(if (<= z -3.8e+137)
(* 1.0 x)
(if (<= z -9.6e-126)
t_1
(if (<= z 9.2e-118)
(* (/ y t) x)
(if (<= z 6.1e+218) t_1 (* 1.0 x)))))))
double code(double x, double y, double z, double t) {
double t_1 = (z - y) * (x / z);
double tmp;
if (z <= -3.8e+137) {
tmp = 1.0 * x;
} else if (z <= -9.6e-126) {
tmp = t_1;
} else if (z <= 9.2e-118) {
tmp = (y / t) * x;
} else if (z <= 6.1e+218) {
tmp = t_1;
} else {
tmp = 1.0 * 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) :: t_1
real(8) :: tmp
t_1 = (z - y) * (x / z)
if (z <= (-3.8d+137)) then
tmp = 1.0d0 * x
else if (z <= (-9.6d-126)) then
tmp = t_1
else if (z <= 9.2d-118) then
tmp = (y / t) * x
else if (z <= 6.1d+218) then
tmp = t_1
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z - y) * (x / z);
double tmp;
if (z <= -3.8e+137) {
tmp = 1.0 * x;
} else if (z <= -9.6e-126) {
tmp = t_1;
} else if (z <= 9.2e-118) {
tmp = (y / t) * x;
} else if (z <= 6.1e+218) {
tmp = t_1;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z - y) * (x / z) tmp = 0 if z <= -3.8e+137: tmp = 1.0 * x elif z <= -9.6e-126: tmp = t_1 elif z <= 9.2e-118: tmp = (y / t) * x elif z <= 6.1e+218: tmp = t_1 else: tmp = 1.0 * x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z - y) * Float64(x / z)) tmp = 0.0 if (z <= -3.8e+137) tmp = Float64(1.0 * x); elseif (z <= -9.6e-126) tmp = t_1; elseif (z <= 9.2e-118) tmp = Float64(Float64(y / t) * x); elseif (z <= 6.1e+218) tmp = t_1; else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z - y) * (x / z); tmp = 0.0; if (z <= -3.8e+137) tmp = 1.0 * x; elseif (z <= -9.6e-126) tmp = t_1; elseif (z <= 9.2e-118) tmp = (y / t) * x; elseif (z <= 6.1e+218) tmp = t_1; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z - y), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e+137], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, -9.6e-126], t$95$1, If[LessEqual[z, 9.2e-118], N[(N[(y / t), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 6.1e+218], t$95$1, N[(1.0 * x), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z - y\right) \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{+137}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq -9.6 \cdot 10^{-126}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-118}:\\
\;\;\;\;\frac{y}{t} \cdot x\\
\mathbf{elif}\;z \leq 6.1 \cdot 10^{+218}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -3.79999999999999963e137 or 6.10000000000000021e218 < z Initial program 84.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6496.7
Applied rewrites96.7%
Taylor expanded in z around inf
Applied rewrites34.9%
if -3.79999999999999963e137 < z < -9.60000000000000027e-126 or 9.20000000000000084e-118 < z < 6.10000000000000021e218Initial program 84.2%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6444.7
Applied rewrites44.7%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f6443.7
Applied rewrites43.7%
if -9.60000000000000027e-126 < z < 9.20000000000000084e-118Initial program 84.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6496.7
Applied rewrites96.7%
Taylor expanded in z around 0
lower-/.f6440.4
Applied rewrites40.4%
(FPCore (x y z t) :precision binary64 (if (<= z -2.1e-29) (* 1.0 x) (if (<= z 4e-5) (* (/ y t) x) (* 1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.1e-29) {
tmp = 1.0 * x;
} else if (z <= 4e-5) {
tmp = (y / t) * x;
} else {
tmp = 1.0 * 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 <= (-2.1d-29)) then
tmp = 1.0d0 * x
else if (z <= 4d-5) then
tmp = (y / t) * x
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.1e-29) {
tmp = 1.0 * x;
} else if (z <= 4e-5) {
tmp = (y / t) * x;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.1e-29: tmp = 1.0 * x elif z <= 4e-5: tmp = (y / t) * x else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.1e-29) tmp = Float64(1.0 * x); elseif (z <= 4e-5) tmp = Float64(Float64(y / t) * x); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.1e-29) tmp = 1.0 * x; elseif (z <= 4e-5) tmp = (y / t) * x; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.1e-29], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 4e-5], N[(N[(y / t), $MachinePrecision] * x), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-29}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-5}:\\
\;\;\;\;\frac{y}{t} \cdot x\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -2.09999999999999989e-29 or 4.00000000000000033e-5 < z Initial program 84.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6496.7
Applied rewrites96.7%
Taylor expanded in z around inf
Applied rewrites34.9%
if -2.09999999999999989e-29 < z < 4.00000000000000033e-5Initial program 84.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6496.7
Applied rewrites96.7%
Taylor expanded in z around 0
lower-/.f6440.4
Applied rewrites40.4%
(FPCore (x y z t) :precision binary64 (if (<= z -2.1e-29) (* 1.0 x) (if (<= z 4e-5) (/ (* x y) t) (* 1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.1e-29) {
tmp = 1.0 * x;
} else if (z <= 4e-5) {
tmp = (x * y) / t;
} else {
tmp = 1.0 * 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 <= (-2.1d-29)) then
tmp = 1.0d0 * x
else if (z <= 4d-5) then
tmp = (x * y) / t
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.1e-29) {
tmp = 1.0 * x;
} else if (z <= 4e-5) {
tmp = (x * y) / t;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.1e-29: tmp = 1.0 * x elif z <= 4e-5: tmp = (x * y) / t else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.1e-29) tmp = Float64(1.0 * x); elseif (z <= 4e-5) tmp = Float64(Float64(x * y) / t); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.1e-29) tmp = 1.0 * x; elseif (z <= 4e-5) tmp = (x * y) / t; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.1e-29], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 4e-5], N[(N[(x * y), $MachinePrecision] / t), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-29}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-5}:\\
\;\;\;\;\frac{x \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -2.09999999999999989e-29 or 4.00000000000000033e-5 < z Initial program 84.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6496.7
Applied rewrites96.7%
Taylor expanded in z around inf
Applied rewrites34.9%
if -2.09999999999999989e-29 < z < 4.00000000000000033e-5Initial program 84.2%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6438.5
Applied rewrites38.5%
(FPCore (x y z t) :precision binary64 (if (<= z -2.35e-30) (* 1.0 x) (if (<= z 8e-88) (* (/ x t) y) (* 1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.35e-30) {
tmp = 1.0 * x;
} else if (z <= 8e-88) {
tmp = (x / t) * y;
} else {
tmp = 1.0 * 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 <= (-2.35d-30)) then
tmp = 1.0d0 * x
else if (z <= 8d-88) then
tmp = (x / t) * y
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.35e-30) {
tmp = 1.0 * x;
} else if (z <= 8e-88) {
tmp = (x / t) * y;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.35e-30: tmp = 1.0 * x elif z <= 8e-88: tmp = (x / t) * y else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.35e-30) tmp = Float64(1.0 * x); elseif (z <= 8e-88) tmp = Float64(Float64(x / t) * y); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.35e-30) tmp = 1.0 * x; elseif (z <= 8e-88) tmp = (x / t) * y; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.35e-30], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 8e-88], N[(N[(x / t), $MachinePrecision] * y), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.35 \cdot 10^{-30}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq 8 \cdot 10^{-88}:\\
\;\;\;\;\frac{x}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if z < -2.34999999999999985e-30 or 7.99999999999999947e-88 < z Initial program 84.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6496.7
Applied rewrites96.7%
Taylor expanded in z around inf
Applied rewrites34.9%
if -2.34999999999999985e-30 < z < 7.99999999999999947e-88Initial program 84.2%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6438.5
Applied rewrites38.5%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f6438.8
Applied rewrites38.8%
(FPCore (x y z t) :precision binary64 (* 1.0 x))
double code(double x, double y, double z, double t) {
return 1.0 * 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 = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t) {
return 1.0 * x;
}
def code(x, y, z, t): return 1.0 * x
function code(x, y, z, t) return Float64(1.0 * x) end
function tmp = code(x, y, z, t) tmp = 1.0 * x; end
code[x_, y_, z_, t_] := N[(1.0 * x), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot x
\end{array}
Initial program 84.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-frac-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6496.7
Applied rewrites96.7%
Taylor expanded in z around inf
Applied rewrites34.9%
herbie shell --seed 2025149
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
(/ (* x (- y z)) (- t z)))