
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* (- y x) (- z t)) (- a t))))
double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (((y - x) * (z - t)) / (a - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (((y - x) * (z - t)) / (a - t));
}
def code(x, y, z, t, a): return x + (((y - x) * (z - t)) / (a - t))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) end
function tmp = code(x, y, z, t, a) tmp = x + (((y - x) * (z - t)) / (a - t)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- t a))) (t_2 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (<= t_2 -5e-154)
(fma (- y x) t_1 x)
(if (<= t_2 0.0)
(/ (- (* t y) (* (- y x) (- z a))) t)
(+ x (* (- y x) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (t - a);
double t_2 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if (t_2 <= -5e-154) {
tmp = fma((y - x), t_1, x);
} else if (t_2 <= 0.0) {
tmp = ((t * y) - ((y - x) * (z - a))) / t;
} else {
tmp = x + ((y - x) * t_1);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(t - a)) t_2 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -5e-154) tmp = fma(Float64(y - x), t_1, x); elseif (t_2 <= 0.0) tmp = Float64(Float64(Float64(t * y) - Float64(Float64(y - x) * Float64(z - a))) / t); else tmp = Float64(x + Float64(Float64(y - x) * t_1)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-154], N[(N[(y - x), $MachinePrecision] * t$95$1 + x), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(N[(N[(t * y), $MachinePrecision] - N[(N[(y - x), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{t - a}\\
t_2 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-154}:\\
\;\;\;\;\mathsf{fma}\left(y - x, t\_1, x\right)\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{t \cdot y - \left(y - x\right) \cdot \left(z - a\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -5.0000000000000002e-154Initial program 70.8%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
sub-negateN/A
sub-negateN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6489.8
Applied rewrites89.8%
if -5.0000000000000002e-154 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 27.4%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6479.7
Applied rewrites79.7%
Taylor expanded in t around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f6479.3
Applied rewrites79.3%
if 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 71.8%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
associate-/l*N/A
sub-divN/A
lower-*.f64N/A
lift--.f64N/A
sub-divN/A
sub-negateN/A
sub-negateN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6490.0
Applied rewrites90.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- t z) (- t a))) (t_2 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (<= t_2 -5e-154)
(fma (- y x) t_1 x)
(if (<= t_2 0.0) (+ (/ (* x (- z a)) t) y) (+ x (* (- y x) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (t - z) / (t - a);
double t_2 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if (t_2 <= -5e-154) {
tmp = fma((y - x), t_1, x);
} else if (t_2 <= 0.0) {
tmp = ((x * (z - a)) / t) + y;
} else {
tmp = x + ((y - x) * t_1);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(t - z) / Float64(t - a)) t_2 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -5e-154) tmp = fma(Float64(y - x), t_1, x); elseif (t_2 <= 0.0) tmp = Float64(Float64(Float64(x * Float64(z - a)) / t) + y); else tmp = Float64(x + Float64(Float64(y - x) * t_1)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-154], N[(N[(y - x), $MachinePrecision] * t$95$1 + x), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(N[(N[(x * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision], N[(x + N[(N[(y - x), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{t - z}{t - a}\\
t_2 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-154}:\\
\;\;\;\;\mathsf{fma}\left(y - x, t\_1, x\right)\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{x \cdot \left(z - a\right)}{t} + y\\
\mathbf{else}:\\
\;\;\;\;x + \left(y - x\right) \cdot t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -5.0000000000000002e-154Initial program 70.8%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
sub-negateN/A
sub-negateN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6489.8
Applied rewrites89.8%
if -5.0000000000000002e-154 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 27.4%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6479.7
Applied rewrites79.7%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lift--.f6479.3
Applied rewrites79.3%
if 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 71.8%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
associate-/l*N/A
sub-divN/A
lower-*.f64N/A
lift--.f64N/A
sub-divN/A
sub-negateN/A
sub-negateN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6490.0
Applied rewrites90.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y x) (/ (- t z) (- t a)) x))
(t_2 (+ x (/ (* (- y x) (- z t)) (- a t)))))
(if (<= t_2 -5e-154) t_1 (if (<= t_2 0.0) (+ (/ (* x (- z a)) t) y) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - x), ((t - z) / (t - a)), x);
double t_2 = x + (((y - x) * (z - t)) / (a - t));
double tmp;
if (t_2 <= -5e-154) {
tmp = t_1;
} else if (t_2 <= 0.0) {
tmp = ((x * (z - a)) / t) + y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - x), Float64(Float64(t - z) / Float64(t - a)), x) t_2 = Float64(x + Float64(Float64(Float64(y - x) * Float64(z - t)) / Float64(a - t))) tmp = 0.0 if (t_2 <= -5e-154) tmp = t_1; elseif (t_2 <= 0.0) tmp = Float64(Float64(Float64(x * Float64(z - a)) / t) + y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] * N[(N[(t - z), $MachinePrecision] / N[(t - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(N[(y - x), $MachinePrecision] * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-154], t$95$1, If[LessEqual[t$95$2, 0.0], N[(N[(N[(x * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - x, \frac{t - z}{t - a}, x\right)\\
t_2 := x + \frac{\left(y - x\right) \cdot \left(z - t\right)}{a - t}\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-154}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{x \cdot \left(z - a\right)}{t} + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < -5.0000000000000002e-154 or 0.0 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) Initial program 71.3%
lift-+.f64N/A
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
associate-/l*N/A
sub-divN/A
lower-fma.f64N/A
lift--.f64N/A
sub-divN/A
sub-negateN/A
sub-negateN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6489.9
Applied rewrites89.9%
if -5.0000000000000002e-154 < (+.f64 x (/.f64 (*.f64 (-.f64 y x) (-.f64 z t)) (-.f64 a t))) < 0.0Initial program 27.4%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6479.7
Applied rewrites79.7%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lift--.f6479.3
Applied rewrites79.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y x) (/ (- z t) a) x)))
(if (<= a -1.12e-129)
t_1
(if (<= a -1.7e-217)
(/ (* (- y x) z) (- a t))
(if (<= a 3.4e+34) (+ (- (/ (* (- y x) (- z a)) t)) y) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - x), ((z - t) / a), x);
double tmp;
if (a <= -1.12e-129) {
tmp = t_1;
} else if (a <= -1.7e-217) {
tmp = ((y - x) * z) / (a - t);
} else if (a <= 3.4e+34) {
tmp = -(((y - x) * (z - a)) / t) + y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - x), Float64(Float64(z - t) / a), x) tmp = 0.0 if (a <= -1.12e-129) tmp = t_1; elseif (a <= -1.7e-217) tmp = Float64(Float64(Float64(y - x) * z) / Float64(a - t)); elseif (a <= 3.4e+34) tmp = Float64(Float64(-Float64(Float64(Float64(y - x) * Float64(z - a)) / t)) + y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -1.12e-129], t$95$1, If[LessEqual[a, -1.7e-217], N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.4e+34], N[((-N[(N[(N[(y - x), $MachinePrecision] * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]) + y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - x, \frac{z - t}{a}, x\right)\\
\mathbf{if}\;a \leq -1.12 \cdot 10^{-129}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.7 \cdot 10^{-217}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot z}{a - t}\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{+34}:\\
\;\;\;\;\left(-\frac{\left(y - x\right) \cdot \left(z - a\right)}{t}\right) + y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.12000000000000006e-129 or 3.3999999999999999e34 < a Initial program 67.9%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6470.1
Applied rewrites70.1%
if -1.12000000000000006e-129 < a < -1.70000000000000008e-217Initial program 63.1%
Taylor expanded in z around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6453.9
Applied rewrites53.9%
if -1.70000000000000008e-217 < a < 3.3999999999999999e34Initial program 66.3%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6473.3
Applied rewrites73.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- y x) (/ (- z t) a) x)))
(if (<= a -1.12e-129)
t_1
(if (<= a -1.7e-217)
(/ (* (- y x) z) (- a t))
(if (<= a 3.4e+34) (- y (/ (* z (- y x)) t)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((y - x), ((z - t) / a), x);
double tmp;
if (a <= -1.12e-129) {
tmp = t_1;
} else if (a <= -1.7e-217) {
tmp = ((y - x) * z) / (a - t);
} else if (a <= 3.4e+34) {
tmp = y - ((z * (y - x)) / t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(y - x), Float64(Float64(z - t) / a), x) tmp = 0.0 if (a <= -1.12e-129) tmp = t_1; elseif (a <= -1.7e-217) tmp = Float64(Float64(Float64(y - x) * z) / Float64(a - t)); elseif (a <= 3.4e+34) tmp = Float64(y - Float64(Float64(z * Float64(y - x)) / t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - x), $MachinePrecision] * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -1.12e-129], t$95$1, If[LessEqual[a, -1.7e-217], N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.4e+34], N[(y - N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y - x, \frac{z - t}{a}, x\right)\\
\mathbf{if}\;a \leq -1.12 \cdot 10^{-129}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.7 \cdot 10^{-217}:\\
\;\;\;\;\frac{\left(y - x\right) \cdot z}{a - t}\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{+34}:\\
\;\;\;\;y - \frac{z \cdot \left(y - x\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.12000000000000006e-129 or 3.3999999999999999e34 < a Initial program 67.9%
Taylor expanded in a around inf
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
lower-/.f64N/A
lift--.f6470.1
Applied rewrites70.1%
if -1.12000000000000006e-129 < a < -1.70000000000000008e-217Initial program 63.1%
Taylor expanded in z around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6453.9
Applied rewrites53.9%
if -1.70000000000000008e-217 < a < 3.3999999999999999e34Initial program 66.3%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6473.3
Applied rewrites73.3%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6469.7
Applied rewrites69.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.35e-40) (+ (/ (* x (- z a)) t) y) (if (<= t 5.2e-109) (+ x (* (- y x) (/ z a))) (* y (/ (- z t) (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.35e-40) {
tmp = ((x * (z - a)) / t) + y;
} else if (t <= 5.2e-109) {
tmp = x + ((y - x) * (z / a));
} else {
tmp = y * ((z - t) / (a - t));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= (-1.35d-40)) then
tmp = ((x * (z - a)) / t) + y
else if (t <= 5.2d-109) then
tmp = x + ((y - x) * (z / a))
else
tmp = y * ((z - t) / (a - t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.35e-40) {
tmp = ((x * (z - a)) / t) + y;
} else if (t <= 5.2e-109) {
tmp = x + ((y - x) * (z / a));
} else {
tmp = y * ((z - t) / (a - t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= -1.35e-40: tmp = ((x * (z - a)) / t) + y elif t <= 5.2e-109: tmp = x + ((y - x) * (z / a)) else: tmp = y * ((z - t) / (a - t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.35e-40) tmp = Float64(Float64(Float64(x * Float64(z - a)) / t) + y); elseif (t <= 5.2e-109) tmp = Float64(x + Float64(Float64(y - x) * Float64(z / a))); else tmp = Float64(y * Float64(Float64(z - t) / Float64(a - t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= -1.35e-40) tmp = ((x * (z - a)) / t) + y; elseif (t <= 5.2e-109) tmp = x + ((y - x) * (z / a)); else tmp = y * ((z - t) / (a - t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.35e-40], N[(N[(N[(x * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[t, 5.2e-109], N[(x + N[(N[(y - x), $MachinePrecision] * N[(z / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{-40}:\\
\;\;\;\;\frac{x \cdot \left(z - a\right)}{t} + y\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{-109}:\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\
\end{array}
\end{array}
if t < -1.35e-40Initial program 48.9%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6459.2
Applied rewrites59.2%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lift--.f6456.1
Applied rewrites56.1%
if -1.35e-40 < t < 5.1999999999999997e-109Initial program 89.9%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
associate-/l*N/A
sub-divN/A
lower-*.f64N/A
lift--.f64N/A
sub-divN/A
sub-negateN/A
sub-negateN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f64N/A
lower--.f6495.9
Applied rewrites95.9%
Taylor expanded in t around 0
lower-/.f6481.1
Applied rewrites81.1%
if 5.1999999999999997e-109 < t Initial program 56.4%
Taylor expanded in a around inf
Applied rewrites19.2%
Taylor expanded in y around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6456.6
Applied rewrites56.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -1.35e-40) (+ (/ (* x (- z a)) t) y) (if (<= t 5.2e-109) (fma z (/ (- y x) a) x) (* y (/ (- z t) (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -1.35e-40) {
tmp = ((x * (z - a)) / t) + y;
} else if (t <= 5.2e-109) {
tmp = fma(z, ((y - x) / a), x);
} else {
tmp = y * ((z - t) / (a - t));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -1.35e-40) tmp = Float64(Float64(Float64(x * Float64(z - a)) / t) + y); elseif (t <= 5.2e-109) tmp = fma(z, Float64(Float64(y - x) / a), x); else tmp = Float64(y * Float64(Float64(z - t) / Float64(a - t))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -1.35e-40], N[(N[(N[(x * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + y), $MachinePrecision], If[LessEqual[t, 5.2e-109], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{-40}:\\
\;\;\;\;\frac{x \cdot \left(z - a\right)}{t} + y\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{-109}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\
\end{array}
\end{array}
if t < -1.35e-40Initial program 48.9%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6459.2
Applied rewrites59.2%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lift--.f6456.1
Applied rewrites56.1%
if -1.35e-40 < t < 5.1999999999999997e-109Initial program 89.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6478.5
Applied rewrites78.5%
if 5.1999999999999997e-109 < t Initial program 56.4%
Taylor expanded in a around inf
Applied rewrites19.2%
Taylor expanded in y around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6456.6
Applied rewrites56.6%
(FPCore (x y z t a) :precision binary64 (if (<= t -8.4e-41) (- y (/ (* z (- y x)) t)) (if (<= t 5.2e-109) (fma z (/ (- y x) a) x) (* y (/ (- z t) (- a t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -8.4e-41) {
tmp = y - ((z * (y - x)) / t);
} else if (t <= 5.2e-109) {
tmp = fma(z, ((y - x) / a), x);
} else {
tmp = y * ((z - t) / (a - t));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -8.4e-41) tmp = Float64(y - Float64(Float64(z * Float64(y - x)) / t)); elseif (t <= 5.2e-109) tmp = fma(z, Float64(Float64(y - x) / a), x); else tmp = Float64(y * Float64(Float64(z - t) / Float64(a - t))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -8.4e-41], N[(y - N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.2e-109], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], N[(y * N[(N[(z - t), $MachinePrecision] / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.4 \cdot 10^{-41}:\\
\;\;\;\;y - \frac{z \cdot \left(y - x\right)}{t}\\
\mathbf{elif}\;t \leq 5.2 \cdot 10^{-109}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z - t}{a - t}\\
\end{array}
\end{array}
if t < -8.40000000000000051e-41Initial program 48.9%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6459.2
Applied rewrites59.2%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6455.9
Applied rewrites55.9%
if -8.40000000000000051e-41 < t < 5.1999999999999997e-109Initial program 89.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6478.5
Applied rewrites78.5%
if 5.1999999999999997e-109 < t Initial program 56.4%
Taylor expanded in a around inf
Applied rewrites19.2%
Taylor expanded in y around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6456.6
Applied rewrites56.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma z (/ (- y x) a) x))) (if (<= a -1.28e-123) t_1 (if (<= a 6e-16) (- y (/ (* z (- y x)) t)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma(z, ((y - x) / a), x);
double tmp;
if (a <= -1.28e-123) {
tmp = t_1;
} else if (a <= 6e-16) {
tmp = y - ((z * (y - x)) / t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(z, Float64(Float64(y - x) / a), x) tmp = 0.0 if (a <= -1.28e-123) tmp = t_1; elseif (a <= 6e-16) tmp = Float64(y - Float64(Float64(z * Float64(y - x)) / t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -1.28e-123], t$95$1, If[LessEqual[a, 6e-16], N[(y - N[(N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{if}\;a \leq -1.28 \cdot 10^{-123}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6 \cdot 10^{-16}:\\
\;\;\;\;y - \frac{z \cdot \left(y - x\right)}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.28000000000000002e-123 or 5.99999999999999987e-16 < a Initial program 68.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6461.9
Applied rewrites61.9%
if -1.28000000000000002e-123 < a < 5.99999999999999987e-16Initial program 65.2%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6476.0
Applied rewrites76.0%
Taylor expanded in a around 0
lower--.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift--.f6472.7
Applied rewrites72.7%
(FPCore (x y z t a) :precision binary64 (if (<= t -2.5e+139) y (if (<= t 8.6e+132) (fma z (/ (- y x) a) x) y)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= -2.5e+139) {
tmp = y;
} else if (t <= 8.6e+132) {
tmp = fma(z, ((y - x) / a), x);
} else {
tmp = y;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= -2.5e+139) tmp = y; elseif (t <= 8.6e+132) tmp = fma(z, Float64(Float64(y - x) / a), x); else tmp = y; end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, -2.5e+139], y, If[LessEqual[t, 8.6e+132], N[(z * N[(N[(y - x), $MachinePrecision] / a), $MachinePrecision] + x), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{+139}:\\
\;\;\;\;y\\
\mathbf{elif}\;t \leq 8.6 \cdot 10^{+132}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{y - x}{a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if t < -2.50000000000000015e139 or 8.59999999999999964e132 < t Initial program 29.6%
Taylor expanded in t around inf
Applied rewrites54.8%
if -2.50000000000000015e139 < t < 8.59999999999999964e132Initial program 81.2%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6461.4
Applied rewrites61.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- y x) z) a)))
(if (<= z -2.8e+224)
(* y (/ (- z t) a))
(if (<= z -3.5e+155)
(* z (/ (- x y) t))
(if (<= z -2.1e+93)
t_1
(if (<= z -1.15e-148)
x
(if (<= z 6e-215)
(- (* t (/ y (- a t))))
(if (<= z 1.7e-17) x t_1))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - x) * z) / a;
double tmp;
if (z <= -2.8e+224) {
tmp = y * ((z - t) / a);
} else if (z <= -3.5e+155) {
tmp = z * ((x - y) / t);
} else if (z <= -2.1e+93) {
tmp = t_1;
} else if (z <= -1.15e-148) {
tmp = x;
} else if (z <= 6e-215) {
tmp = -(t * (y / (a - t)));
} else if (z <= 1.7e-17) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = ((y - x) * z) / a
if (z <= (-2.8d+224)) then
tmp = y * ((z - t) / a)
else if (z <= (-3.5d+155)) then
tmp = z * ((x - y) / t)
else if (z <= (-2.1d+93)) then
tmp = t_1
else if (z <= (-1.15d-148)) then
tmp = x
else if (z <= 6d-215) then
tmp = -(t * (y / (a - t)))
else if (z <= 1.7d-17) then
tmp = x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - x) * z) / a;
double tmp;
if (z <= -2.8e+224) {
tmp = y * ((z - t) / a);
} else if (z <= -3.5e+155) {
tmp = z * ((x - y) / t);
} else if (z <= -2.1e+93) {
tmp = t_1;
} else if (z <= -1.15e-148) {
tmp = x;
} else if (z <= 6e-215) {
tmp = -(t * (y / (a - t)));
} else if (z <= 1.7e-17) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y - x) * z) / a tmp = 0 if z <= -2.8e+224: tmp = y * ((z - t) / a) elif z <= -3.5e+155: tmp = z * ((x - y) / t) elif z <= -2.1e+93: tmp = t_1 elif z <= -1.15e-148: tmp = x elif z <= 6e-215: tmp = -(t * (y / (a - t))) elif z <= 1.7e-17: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - x) * z) / a) tmp = 0.0 if (z <= -2.8e+224) tmp = Float64(y * Float64(Float64(z - t) / a)); elseif (z <= -3.5e+155) tmp = Float64(z * Float64(Float64(x - y) / t)); elseif (z <= -2.1e+93) tmp = t_1; elseif (z <= -1.15e-148) tmp = x; elseif (z <= 6e-215) tmp = Float64(-Float64(t * Float64(y / Float64(a - t)))); elseif (z <= 1.7e-17) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y - x) * z) / a; tmp = 0.0; if (z <= -2.8e+224) tmp = y * ((z - t) / a); elseif (z <= -3.5e+155) tmp = z * ((x - y) / t); elseif (z <= -2.1e+93) tmp = t_1; elseif (z <= -1.15e-148) tmp = x; elseif (z <= 6e-215) tmp = -(t * (y / (a - t))); elseif (z <= 1.7e-17) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -2.8e+224], N[(y * N[(N[(z - t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.5e+155], N[(z * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.1e+93], t$95$1, If[LessEqual[z, -1.15e-148], x, If[LessEqual[z, 6e-215], (-N[(t * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[z, 1.7e-17], x, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(y - x\right) \cdot z}{a}\\
\mathbf{if}\;z \leq -2.8 \cdot 10^{+224}:\\
\;\;\;\;y \cdot \frac{z - t}{a}\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{+155}:\\
\;\;\;\;z \cdot \frac{x - y}{t}\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-148}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-215}:\\
\;\;\;\;-t \cdot \frac{y}{a - t}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-17}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.80000000000000008e224Initial program 70.1%
Taylor expanded in a around inf
Applied rewrites5.8%
Taylor expanded in y around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lift--.f64N/A
lift--.f6454.9
Applied rewrites54.9%
Taylor expanded in t around 0
Applied rewrites40.1%
if -2.80000000000000008e224 < z < -3.49999999999999985e155Initial program 65.8%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6442.5
Applied rewrites42.5%
Taylor expanded in z around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6447.2
Applied rewrites47.2%
if -3.49999999999999985e155 < z < -2.0999999999999998e93 or 1.6999999999999999e-17 < z Initial program 67.4%
Taylor expanded in z around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6456.0
Applied rewrites56.0%
Taylor expanded in t around 0
Applied rewrites34.4%
if -2.0999999999999998e93 < z < -1.14999999999999999e-148 or 6.00000000000000051e-215 < z < 1.6999999999999999e-17Initial program 67.7%
Taylor expanded in a around inf
Applied rewrites30.5%
if -1.14999999999999999e-148 < z < 6.00000000000000051e-215Initial program 64.6%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6440.2
Applied rewrites40.2%
Taylor expanded in z around inf
Applied rewrites6.4%
Taylor expanded in z around 0
mul-1-negN/A
lower-neg.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6441.0
Applied rewrites41.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* (- y x) z) a)))
(if (<= a -4.5e+38)
x
(if (<= a -1.7e-217)
t_1
(if (<= a 1.9e-16)
y
(if (<= a 1400000.0)
(/ (* x (- z a)) t)
(if (<= a 6.2e+168) t_1 x)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - x) * z) / a;
double tmp;
if (a <= -4.5e+38) {
tmp = x;
} else if (a <= -1.7e-217) {
tmp = t_1;
} else if (a <= 1.9e-16) {
tmp = y;
} else if (a <= 1400000.0) {
tmp = (x * (z - a)) / t;
} else if (a <= 6.2e+168) {
tmp = t_1;
} 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, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = ((y - x) * z) / a
if (a <= (-4.5d+38)) then
tmp = x
else if (a <= (-1.7d-217)) then
tmp = t_1
else if (a <= 1.9d-16) then
tmp = y
else if (a <= 1400000.0d0) then
tmp = (x * (z - a)) / t
else if (a <= 6.2d+168) then
tmp = t_1
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = ((y - x) * z) / a;
double tmp;
if (a <= -4.5e+38) {
tmp = x;
} else if (a <= -1.7e-217) {
tmp = t_1;
} else if (a <= 1.9e-16) {
tmp = y;
} else if (a <= 1400000.0) {
tmp = (x * (z - a)) / t;
} else if (a <= 6.2e+168) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((y - x) * z) / a tmp = 0 if a <= -4.5e+38: tmp = x elif a <= -1.7e-217: tmp = t_1 elif a <= 1.9e-16: tmp = y elif a <= 1400000.0: tmp = (x * (z - a)) / t elif a <= 6.2e+168: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(y - x) * z) / a) tmp = 0.0 if (a <= -4.5e+38) tmp = x; elseif (a <= -1.7e-217) tmp = t_1; elseif (a <= 1.9e-16) tmp = y; elseif (a <= 1400000.0) tmp = Float64(Float64(x * Float64(z - a)) / t); elseif (a <= 6.2e+168) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((y - x) * z) / a; tmp = 0.0; if (a <= -4.5e+38) tmp = x; elseif (a <= -1.7e-217) tmp = t_1; elseif (a <= 1.9e-16) tmp = y; elseif (a <= 1400000.0) tmp = (x * (z - a)) / t; elseif (a <= 6.2e+168) tmp = t_1; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[a, -4.5e+38], x, If[LessEqual[a, -1.7e-217], t$95$1, If[LessEqual[a, 1.9e-16], y, If[LessEqual[a, 1400000.0], N[(N[(x * N[(z - a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[a, 6.2e+168], t$95$1, x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(y - x\right) \cdot z}{a}\\
\mathbf{if}\;a \leq -4.5 \cdot 10^{+38}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -1.7 \cdot 10^{-217}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.9 \cdot 10^{-16}:\\
\;\;\;\;y\\
\mathbf{elif}\;a \leq 1400000:\\
\;\;\;\;\frac{x \cdot \left(z - a\right)}{t}\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{+168}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.4999999999999998e38 or 6.19999999999999993e168 < a Initial program 67.3%
Taylor expanded in a around inf
Applied rewrites49.4%
if -4.4999999999999998e38 < a < -1.70000000000000008e-217 or 1.4e6 < a < 6.19999999999999993e168Initial program 67.6%
Taylor expanded in z around inf
sub-divN/A
associate-/l*N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6441.9
Applied rewrites41.9%
Taylor expanded in t around 0
Applied rewrites27.7%
if -1.70000000000000008e-217 < a < 1.90000000000000006e-16Initial program 65.7%
Taylor expanded in t around inf
Applied rewrites36.3%
if 1.90000000000000006e-16 < a < 1.4e6Initial program 71.9%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6453.5
Applied rewrites53.5%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lift--.f6424.2
Applied rewrites24.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* z (/ y (- a t)))))
(if (<= z -1.3e+93)
t_1
(if (<= z -8e-222) x (if (<= z 1.25e-82) y (if (<= z 1.92e+28) x t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / (a - t));
double tmp;
if (z <= -1.3e+93) {
tmp = t_1;
} else if (z <= -8e-222) {
tmp = x;
} else if (z <= 1.25e-82) {
tmp = y;
} else if (z <= 1.92e+28) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = z * (y / (a - t))
if (z <= (-1.3d+93)) then
tmp = t_1
else if (z <= (-8d-222)) then
tmp = x
else if (z <= 1.25d-82) then
tmp = y
else if (z <= 1.92d+28) then
tmp = x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = z * (y / (a - t));
double tmp;
if (z <= -1.3e+93) {
tmp = t_1;
} else if (z <= -8e-222) {
tmp = x;
} else if (z <= 1.25e-82) {
tmp = y;
} else if (z <= 1.92e+28) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = z * (y / (a - t)) tmp = 0 if z <= -1.3e+93: tmp = t_1 elif z <= -8e-222: tmp = x elif z <= 1.25e-82: tmp = y elif z <= 1.92e+28: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(z * Float64(y / Float64(a - t))) tmp = 0.0 if (z <= -1.3e+93) tmp = t_1; elseif (z <= -8e-222) tmp = x; elseif (z <= 1.25e-82) tmp = y; elseif (z <= 1.92e+28) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = z * (y / (a - t)); tmp = 0.0; if (z <= -1.3e+93) tmp = t_1; elseif (z <= -8e-222) tmp = x; elseif (z <= 1.25e-82) tmp = y; elseif (z <= 1.92e+28) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(z * N[(y / N[(a - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.3e+93], t$95$1, If[LessEqual[z, -8e-222], x, If[LessEqual[z, 1.25e-82], y, If[LessEqual[z, 1.92e+28], x, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{y}{a - t}\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-222}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-82}:\\
\;\;\;\;y\\
\mathbf{elif}\;z \leq 1.92 \cdot 10^{+28}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.3e93 or 1.91999999999999998e28 < z Initial program 67.4%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6439.0
Applied rewrites39.0%
Taylor expanded in z around inf
Applied rewrites34.1%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6441.3
Applied rewrites41.3%
if -1.3e93 < z < -8.00000000000000038e-222 or 1.25e-82 < z < 1.91999999999999998e28Initial program 68.5%
Taylor expanded in a around inf
Applied rewrites29.5%
if -8.00000000000000038e-222 < z < 1.25e-82Initial program 64.3%
Taylor expanded in t around inf
Applied rewrites37.9%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.3e+28)
x
(if (<= a 6.2e-151)
(* z (/ (- x y) t))
(if (<= a 2.7e+105) (* (/ y x) x) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.3e+28) {
tmp = x;
} else if (a <= 6.2e-151) {
tmp = z * ((x - y) / t);
} else if (a <= 2.7e+105) {
tmp = (y / x) * x;
} 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, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-2.3d+28)) then
tmp = x
else if (a <= 6.2d-151) then
tmp = z * ((x - y) / t)
else if (a <= 2.7d+105) then
tmp = (y / x) * x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.3e+28) {
tmp = x;
} else if (a <= 6.2e-151) {
tmp = z * ((x - y) / t);
} else if (a <= 2.7e+105) {
tmp = (y / x) * x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.3e+28: tmp = x elif a <= 6.2e-151: tmp = z * ((x - y) / t) elif a <= 2.7e+105: tmp = (y / x) * x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.3e+28) tmp = x; elseif (a <= 6.2e-151) tmp = Float64(z * Float64(Float64(x - y) / t)); elseif (a <= 2.7e+105) tmp = Float64(Float64(y / x) * x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.3e+28) tmp = x; elseif (a <= 6.2e-151) tmp = z * ((x - y) / t); elseif (a <= 2.7e+105) tmp = (y / x) * x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.3e+28], x, If[LessEqual[a, 6.2e-151], N[(z * N[(N[(x - y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.7e+105], N[(N[(y / x), $MachinePrecision] * x), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.3 \cdot 10^{+28}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{-151}:\\
\;\;\;\;z \cdot \frac{x - y}{t}\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{+105}:\\
\;\;\;\;\frac{y}{x} \cdot x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -2.29999999999999984e28 or 2.70000000000000016e105 < a Initial program 68.0%
Taylor expanded in a around inf
Applied rewrites47.7%
if -2.29999999999999984e28 < a < 6.19999999999999969e-151Initial program 64.9%
Taylor expanded in t around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lift--.f64N/A
lower--.f6473.9
Applied rewrites73.9%
Taylor expanded in z around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6442.1
Applied rewrites42.1%
if 6.19999999999999969e-151 < a < 2.70000000000000016e105Initial program 69.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites65.4%
Taylor expanded in t around inf
lower-/.f6423.9
Applied rewrites23.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ z a))))
(if (<= z -2.7e+93)
t_1
(if (<= z -8e-222) x (if (<= z 1.25e-82) y (if (<= z 7e+134) x t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / a);
double tmp;
if (z <= -2.7e+93) {
tmp = t_1;
} else if (z <= -8e-222) {
tmp = x;
} else if (z <= 1.25e-82) {
tmp = y;
} else if (z <= 7e+134) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = y * (z / a)
if (z <= (-2.7d+93)) then
tmp = t_1
else if (z <= (-8d-222)) then
tmp = x
else if (z <= 1.25d-82) then
tmp = y
else if (z <= 7d+134) then
tmp = x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * (z / a);
double tmp;
if (z <= -2.7e+93) {
tmp = t_1;
} else if (z <= -8e-222) {
tmp = x;
} else if (z <= 1.25e-82) {
tmp = y;
} else if (z <= 7e+134) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * (z / a) tmp = 0 if z <= -2.7e+93: tmp = t_1 elif z <= -8e-222: tmp = x elif z <= 1.25e-82: tmp = y elif z <= 7e+134: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(z / a)) tmp = 0.0 if (z <= -2.7e+93) tmp = t_1; elseif (z <= -8e-222) tmp = x; elseif (z <= 1.25e-82) tmp = y; elseif (z <= 7e+134) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * (z / a); tmp = 0.0; if (z <= -2.7e+93) tmp = t_1; elseif (z <= -8e-222) tmp = x; elseif (z <= 1.25e-82) tmp = y; elseif (z <= 7e+134) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.7e+93], t$95$1, If[LessEqual[z, -8e-222], x, If[LessEqual[z, 1.25e-82], y, If[LessEqual[z, 7e+134], x, t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z}{a}\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8 \cdot 10^{-222}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{-82}:\\
\;\;\;\;y\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+134}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.6999999999999999e93 or 7.00000000000000006e134 < z Initial program 67.6%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6438.7
Applied rewrites38.7%
Taylor expanded in z around inf
Applied rewrites35.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f6433.7
Applied rewrites33.7%
if -2.6999999999999999e93 < z < -8.00000000000000038e-222 or 1.25e-82 < z < 7.00000000000000006e134Initial program 68.2%
Taylor expanded in a around inf
Applied rewrites28.1%
if -8.00000000000000038e-222 < z < 1.25e-82Initial program 64.3%
Taylor expanded in t around inf
Applied rewrites37.9%
(FPCore (x y z t a) :precision binary64 (if (<= a -4.5e+38) x (if (<= a -2e-192) (* y (/ z a)) (if (<= a 2.7e+105) (* (/ y x) x) x))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.5e+38) {
tmp = x;
} else if (a <= -2e-192) {
tmp = y * (z / a);
} else if (a <= 2.7e+105) {
tmp = (y / x) * x;
} 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, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-4.5d+38)) then
tmp = x
else if (a <= (-2d-192)) then
tmp = y * (z / a)
else if (a <= 2.7d+105) then
tmp = (y / x) * x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -4.5e+38) {
tmp = x;
} else if (a <= -2e-192) {
tmp = y * (z / a);
} else if (a <= 2.7e+105) {
tmp = (y / x) * x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -4.5e+38: tmp = x elif a <= -2e-192: tmp = y * (z / a) elif a <= 2.7e+105: tmp = (y / x) * x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -4.5e+38) tmp = x; elseif (a <= -2e-192) tmp = Float64(y * Float64(z / a)); elseif (a <= 2.7e+105) tmp = Float64(Float64(y / x) * x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -4.5e+38) tmp = x; elseif (a <= -2e-192) tmp = y * (z / a); elseif (a <= 2.7e+105) tmp = (y / x) * x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.5e+38], x, If[LessEqual[a, -2e-192], N[(y * N[(z / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.7e+105], N[(N[(y / x), $MachinePrecision] * x), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.5 \cdot 10^{+38}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq -2 \cdot 10^{-192}:\\
\;\;\;\;y \cdot \frac{z}{a}\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{+105}:\\
\;\;\;\;\frac{y}{x} \cdot x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -4.4999999999999998e38 or 2.70000000000000016e105 < a Initial program 67.7%
Taylor expanded in a around inf
Applied rewrites48.1%
if -4.4999999999999998e38 < a < -2.0000000000000002e-192Initial program 66.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift--.f6446.5
Applied rewrites46.5%
Taylor expanded in z around inf
Applied rewrites24.8%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f6419.6
Applied rewrites19.6%
if -2.0000000000000002e-192 < a < 2.70000000000000016e105Initial program 66.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.3%
Taylor expanded in t around inf
lower-/.f6430.2
Applied rewrites30.2%
(FPCore (x y z t a) :precision binary64 (if (<= a -50000000.0) x (if (<= a 2.7e+105) y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -50000000.0) {
tmp = x;
} else if (a <= 2.7e+105) {
tmp = y;
} 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, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (a <= (-50000000.0d0)) then
tmp = x
else if (a <= 2.7d+105) then
tmp = y
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -50000000.0) {
tmp = x;
} else if (a <= 2.7e+105) {
tmp = y;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -50000000.0: tmp = x elif a <= 2.7e+105: tmp = y else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -50000000.0) tmp = x; elseif (a <= 2.7e+105) tmp = y; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -50000000.0) tmp = x; elseif (a <= 2.7e+105) tmp = y; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -50000000.0], x, If[LessEqual[a, 2.7e+105], y, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -50000000:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{+105}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -5e7 or 2.70000000000000016e105 < a Initial program 68.1%
Taylor expanded in a around inf
Applied rewrites46.7%
if -5e7 < a < 2.70000000000000016e105Initial program 66.3%
Taylor expanded in t around inf
Applied rewrites33.0%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
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, a)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 67.0%
Taylor expanded in a around inf
Applied rewrites24.9%
herbie shell --seed 2025127
(FPCore (x y z t a)
:name "Graphics.Rendering.Chart.Axis.Types:linMap from Chart-1.5.3"
:precision binary64
(+ x (/ (* (- y x) (- z t)) (- a t))))