
(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]
\frac{x \cdot \left(y - z\right)}{t - z}
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]
\frac{x \cdot \left(y - z\right)}{t - z}
(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]
\frac{z - y}{z - t} \cdot x
Initial program 84.1%
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.8%
Applied rewrites96.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (/ z (- z t)) x)))
(if (<= z -2.1e+172)
t_1
(if (<= z 1.3e+210) (* (/ x (- z t)) (- z y)) t_1))))double code(double x, double y, double z, double t) {
double t_1 = (z / (z - t)) * x;
double tmp;
if (z <= -2.1e+172) {
tmp = t_1;
} else if (z <= 1.3e+210) {
tmp = (x / (z - t)) * (z - y);
} 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 / (z - t)) * x
if (z <= (-2.1d+172)) then
tmp = t_1
else if (z <= 1.3d+210) then
tmp = (x / (z - t)) * (z - y)
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 / (z - t)) * x;
double tmp;
if (z <= -2.1e+172) {
tmp = t_1;
} else if (z <= 1.3e+210) {
tmp = (x / (z - t)) * (z - y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z / (z - t)) * x tmp = 0 if z <= -2.1e+172: tmp = t_1 elif z <= 1.3e+210: tmp = (x / (z - t)) * (z - y) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z / Float64(z - t)) * x) tmp = 0.0 if (z <= -2.1e+172) tmp = t_1; elseif (z <= 1.3e+210) tmp = Float64(Float64(x / Float64(z - t)) * Float64(z - y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z / (z - t)) * x; tmp = 0.0; if (z <= -2.1e+172) tmp = t_1; elseif (z <= 1.3e+210) tmp = (x / (z - t)) * (z - y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[z, -2.1e+172], t$95$1, If[LessEqual[z, 1.3e+210], N[(N[(x / N[(z - t), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{z}{z - t} \cdot x\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{+210}:\\
\;\;\;\;\frac{x}{z - t} \cdot \left(z - y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.1000000000000001e172 or 1.29999999999999995e210 < z Initial program 84.1%
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.8%
Applied rewrites96.8%
Taylor expanded in y around 0
Applied rewrites54.5%
if -2.1000000000000001e172 < z < 1.29999999999999995e210Initial program 84.1%
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--.f6484.6%
Applied rewrites84.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ (- y z) t) x))) (if (<= t -1.32e+69) t_1 (if (<= t 2.7e+32) (* (/ (- z y) z) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((y - z) / t) * x;
double tmp;
if (t <= -1.32e+69) {
tmp = t_1;
} else if (t <= 2.7e+32) {
tmp = ((z - 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 = ((y - z) / t) * x
if (t <= (-1.32d+69)) then
tmp = t_1
else if (t <= 2.7d+32) then
tmp = ((z - 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 = ((y - z) / t) * x;
double tmp;
if (t <= -1.32e+69) {
tmp = t_1;
} else if (t <= 2.7e+32) {
tmp = ((z - y) / z) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((y - z) / t) * x tmp = 0 if t <= -1.32e+69: tmp = t_1 elif t <= 2.7e+32: tmp = ((z - y) / z) * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(y - z) / t) * x) tmp = 0.0 if (t <= -1.32e+69) tmp = t_1; elseif (t <= 2.7e+32) tmp = Float64(Float64(Float64(z - y) / z) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((y - z) / t) * x; tmp = 0.0; if (t <= -1.32e+69) tmp = t_1; elseif (t <= 2.7e+32) tmp = ((z - y) / z) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(y - z), $MachinePrecision] / t), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -1.32e+69], t$95$1, If[LessEqual[t, 2.7e+32], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{y - z}{t} \cdot x\\
\mathbf{if}\;t \leq -1.32 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{+32}:\\
\;\;\;\;\frac{z - y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -1.32e69 or 2.70000000000000013e32 < t Initial program 84.1%
Taylor expanded in z around 0
Applied rewrites47.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6450.6%
Applied rewrites50.6%
if -1.32e69 < t < 2.70000000000000013e32Initial program 84.1%
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.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f6451.6%
Applied rewrites51.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ x t) (- y z)))) (if (<= t -1.32e+69) t_1 (if (<= t 2.7e+32) (* (/ (- z y) z) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x / t) * (y - z);
double tmp;
if (t <= -1.32e+69) {
tmp = t_1;
} else if (t <= 2.7e+32) {
tmp = ((z - 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) * (y - z)
if (t <= (-1.32d+69)) then
tmp = t_1
else if (t <= 2.7d+32) then
tmp = ((z - 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) * (y - z);
double tmp;
if (t <= -1.32e+69) {
tmp = t_1;
} else if (t <= 2.7e+32) {
tmp = ((z - y) / z) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x / t) * (y - z) tmp = 0 if t <= -1.32e+69: tmp = t_1 elif t <= 2.7e+32: tmp = ((z - y) / z) * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x / t) * Float64(y - z)) tmp = 0.0 if (t <= -1.32e+69) tmp = t_1; elseif (t <= 2.7e+32) tmp = Float64(Float64(Float64(z - y) / z) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x / t) * (y - z); tmp = 0.0; if (t <= -1.32e+69) tmp = t_1; elseif (t <= 2.7e+32) tmp = ((z - y) / z) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.32e+69], t$95$1, If[LessEqual[t, 2.7e+32], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{x}{t} \cdot \left(y - z\right)\\
\mathbf{if}\;t \leq -1.32 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{+32}:\\
\;\;\;\;\frac{z - y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -1.32e69 or 2.70000000000000013e32 < t Initial program 84.1%
Taylor expanded in z around 0
Applied rewrites47.9%
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-/.f6447.6%
Applied rewrites47.6%
if -1.32e69 < t < 2.70000000000000013e32Initial program 84.1%
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.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f6451.6%
Applied rewrites51.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ y t) x))) (if (<= t -1.32e+69) t_1 (if (<= t 2.7e+32) (* (/ (- z y) z) x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (y / t) * x;
double tmp;
if (t <= -1.32e+69) {
tmp = t_1;
} else if (t <= 2.7e+32) {
tmp = ((z - 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 = (y / t) * x
if (t <= (-1.32d+69)) then
tmp = t_1
else if (t <= 2.7d+32) then
tmp = ((z - 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 = (y / t) * x;
double tmp;
if (t <= -1.32e+69) {
tmp = t_1;
} else if (t <= 2.7e+32) {
tmp = ((z - y) / z) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / t) * x tmp = 0 if t <= -1.32e+69: tmp = t_1 elif t <= 2.7e+32: tmp = ((z - y) / z) * x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / t) * x) tmp = 0.0 if (t <= -1.32e+69) tmp = t_1; elseif (t <= 2.7e+32) tmp = Float64(Float64(Float64(z - y) / z) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / t) * x; tmp = 0.0; if (t <= -1.32e+69) tmp = t_1; elseif (t <= 2.7e+32) tmp = ((z - y) / z) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / t), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -1.32e+69], t$95$1, If[LessEqual[t, 2.7e+32], N[(N[(N[(z - y), $MachinePrecision] / z), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{y}{t} \cdot x\\
\mathbf{if}\;t \leq -1.32 \cdot 10^{+69}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{+32}:\\
\;\;\;\;\frac{z - y}{z} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -1.32e69 or 2.70000000000000013e32 < t Initial program 84.1%
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.8%
Applied rewrites96.8%
Taylor expanded in z around 0
lower-/.f6439.5%
Applied rewrites39.5%
if -1.32e69 < t < 2.70000000000000013e32Initial program 84.1%
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.8%
Applied rewrites96.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f6451.6%
Applied rewrites51.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* (fabs x) (- y z)) (- t z))))
(*
(copysign 1.0 x)
(if (<= t_1 -1e-183)
(* (/ y t) (fabs x))
(if (<= t_1 4e+56)
(/ (* (fabs x) z) (- z t))
(* (/ (fabs x) z) (- z y)))))))double code(double x, double y, double z, double t) {
double t_1 = (fabs(x) * (y - z)) / (t - z);
double tmp;
if (t_1 <= -1e-183) {
tmp = (y / t) * fabs(x);
} else if (t_1 <= 4e+56) {
tmp = (fabs(x) * z) / (z - t);
} else {
tmp = (fabs(x) / z) * (z - y);
}
return copysign(1.0, x) * tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (Math.abs(x) * (y - z)) / (t - z);
double tmp;
if (t_1 <= -1e-183) {
tmp = (y / t) * Math.abs(x);
} else if (t_1 <= 4e+56) {
tmp = (Math.abs(x) * z) / (z - t);
} else {
tmp = (Math.abs(x) / z) * (z - y);
}
return Math.copySign(1.0, x) * tmp;
}
def code(x, y, z, t): t_1 = (math.fabs(x) * (y - z)) / (t - z) tmp = 0 if t_1 <= -1e-183: tmp = (y / t) * math.fabs(x) elif t_1 <= 4e+56: tmp = (math.fabs(x) * z) / (z - t) else: tmp = (math.fabs(x) / z) * (z - y) return math.copysign(1.0, x) * tmp
function code(x, y, z, t) t_1 = Float64(Float64(abs(x) * Float64(y - z)) / Float64(t - z)) tmp = 0.0 if (t_1 <= -1e-183) tmp = Float64(Float64(y / t) * abs(x)); elseif (t_1 <= 4e+56) tmp = Float64(Float64(abs(x) * z) / Float64(z - t)); else tmp = Float64(Float64(abs(x) / z) * Float64(z - y)); end return Float64(copysign(1.0, x) * tmp) end
function tmp_2 = code(x, y, z, t) t_1 = (abs(x) * (y - z)) / (t - z); tmp = 0.0; if (t_1 <= -1e-183) tmp = (y / t) * abs(x); elseif (t_1 <= 4e+56) tmp = (abs(x) * z) / (z - t); else tmp = (abs(x) / z) * (z - y); end tmp_2 = (sign(x) * abs(1.0)) * tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[Abs[x], $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - z), $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$1, -1e-183], N[(N[(y / t), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+56], N[(N[(N[Abs[x], $MachinePrecision] * z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision], N[(N[(N[Abs[x], $MachinePrecision] / z), $MachinePrecision] * N[(z - y), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
t_1 := \frac{\left|x\right| \cdot \left(y - z\right)}{t - z}\\
\mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-183}:\\
\;\;\;\;\frac{y}{t} \cdot \left|x\right|\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+56}:\\
\;\;\;\;\frac{\left|x\right| \cdot z}{z - t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left|x\right|}{z} \cdot \left(z - y\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < -1.00000000000000001e-183Initial program 84.1%
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.8%
Applied rewrites96.8%
Taylor expanded in z around 0
lower-/.f6439.5%
Applied rewrites39.5%
if -1.00000000000000001e-183 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) < 4.00000000000000037e56Initial program 84.1%
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.8%
Applied rewrites96.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6445.0%
Applied rewrites45.0%
if 4.00000000000000037e56 < (/.f64 (*.f64 x (-.f64 y z)) (-.f64 t z)) Initial program 84.1%
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--.f6484.6%
Applied rewrites84.6%
Taylor expanded in z around inf
lower-/.f6443.5%
Applied rewrites43.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* x z) (- z t))))
(if (<= z -4.1e-63)
t_1
(if (<= z 7e-34) (* (/ y t) x) (if (<= z 1.22e+176) t_1 (* 1.0 x))))))double code(double x, double y, double z, double t) {
double t_1 = (x * z) / (z - t);
double tmp;
if (z <= -4.1e-63) {
tmp = t_1;
} else if (z <= 7e-34) {
tmp = (y / t) * x;
} else if (z <= 1.22e+176) {
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 = (x * z) / (z - t)
if (z <= (-4.1d-63)) then
tmp = t_1
else if (z <= 7d-34) then
tmp = (y / t) * x
else if (z <= 1.22d+176) 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 = (x * z) / (z - t);
double tmp;
if (z <= -4.1e-63) {
tmp = t_1;
} else if (z <= 7e-34) {
tmp = (y / t) * x;
} else if (z <= 1.22e+176) {
tmp = t_1;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * z) / (z - t) tmp = 0 if z <= -4.1e-63: tmp = t_1 elif z <= 7e-34: tmp = (y / t) * x elif z <= 1.22e+176: tmp = t_1 else: tmp = 1.0 * x return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * z) / Float64(z - t)) tmp = 0.0 if (z <= -4.1e-63) tmp = t_1; elseif (z <= 7e-34) tmp = Float64(Float64(y / t) * x); elseif (z <= 1.22e+176) tmp = t_1; else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * z) / (z - t); tmp = 0.0; if (z <= -4.1e-63) tmp = t_1; elseif (z <= 7e-34) tmp = (y / t) * x; elseif (z <= 1.22e+176) tmp = t_1; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * z), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.1e-63], t$95$1, If[LessEqual[z, 7e-34], N[(N[(y / t), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[z, 1.22e+176], t$95$1, N[(1.0 * x), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \frac{x \cdot z}{z - t}\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-34}:\\
\;\;\;\;\frac{y}{t} \cdot x\\
\mathbf{elif}\;z \leq 1.22 \cdot 10^{+176}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
if z < -4.0999999999999998e-63 or 7e-34 < z < 1.2199999999999999e176Initial program 84.1%
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.8%
Applied rewrites96.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6445.0%
Applied rewrites45.0%
if -4.0999999999999998e-63 < z < 7e-34Initial program 84.1%
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.8%
Applied rewrites96.8%
Taylor expanded in z around 0
lower-/.f6439.5%
Applied rewrites39.5%
if 1.2199999999999999e176 < z Initial program 84.1%
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.8%
Applied rewrites96.8%
Taylor expanded in z around inf
Applied rewrites35.2%
(FPCore (x y z t) :precision binary64 (if (<= z -1.12e-25) (* 1.0 x) (if (<= z 2.9e+29) (* (/ y t) x) (* 1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.12e-25) {
tmp = 1.0 * x;
} else if (z <= 2.9e+29) {
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 <= (-1.12d-25)) then
tmp = 1.0d0 * x
else if (z <= 2.9d+29) 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 <= -1.12e-25) {
tmp = 1.0 * x;
} else if (z <= 2.9e+29) {
tmp = (y / t) * x;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.12e-25: tmp = 1.0 * x elif z <= 2.9e+29: tmp = (y / t) * x else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.12e-25) tmp = Float64(1.0 * x); elseif (z <= 2.9e+29) 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 <= -1.12e-25) tmp = 1.0 * x; elseif (z <= 2.9e+29) tmp = (y / t) * x; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.12e-25], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 2.9e+29], N[(N[(y / t), $MachinePrecision] * x), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{-25}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+29}:\\
\;\;\;\;\frac{y}{t} \cdot x\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
if z < -1.12e-25 or 2.8999999999999999e29 < z Initial program 84.1%
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.8%
Applied rewrites96.8%
Taylor expanded in z around inf
Applied rewrites35.2%
if -1.12e-25 < z < 2.8999999999999999e29Initial program 84.1%
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.8%
Applied rewrites96.8%
Taylor expanded in z around 0
lower-/.f6439.5%
Applied rewrites39.5%
(FPCore (x y z t) :precision binary64 (if (<= z -1.12e-25) (* 1.0 x) (if (<= z 2.9e+29) (* (/ x t) y) (* 1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.12e-25) {
tmp = 1.0 * x;
} else if (z <= 2.9e+29) {
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 <= (-1.12d-25)) then
tmp = 1.0d0 * x
else if (z <= 2.9d+29) 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 <= -1.12e-25) {
tmp = 1.0 * x;
} else if (z <= 2.9e+29) {
tmp = (x / t) * y;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.12e-25: tmp = 1.0 * x elif z <= 2.9e+29: tmp = (x / t) * y else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.12e-25) tmp = Float64(1.0 * x); elseif (z <= 2.9e+29) 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 <= -1.12e-25) tmp = 1.0 * x; elseif (z <= 2.9e+29) tmp = (x / t) * y; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.12e-25], N[(1.0 * x), $MachinePrecision], If[LessEqual[z, 2.9e+29], N[(N[(x / t), $MachinePrecision] * y), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -1.12 \cdot 10^{-25}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{+29}:\\
\;\;\;\;\frac{x}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
if z < -1.12e-25 or 2.8999999999999999e29 < z Initial program 84.1%
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.8%
Applied rewrites96.8%
Taylor expanded in z around inf
Applied rewrites35.2%
if -1.12e-25 < z < 2.8999999999999999e29Initial program 84.1%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f6437.8%
Applied rewrites37.8%
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-/.f6437.4%
Applied rewrites37.4%
(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]
1 \cdot x
Initial program 84.1%
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.8%
Applied rewrites96.8%
Taylor expanded in z around inf
Applied rewrites35.2%
herbie shell --seed 2025183
(FPCore (x y z t)
:name "Graphics.Rendering.Chart.Plot.AreaSpots:renderAreaSpots4D from Chart-1.5.3"
:precision binary64
(/ (* x (- y z)) (- t z)))